OsWrapper.c 976 B

12345678910111213141516171819202122232425262728
  1. /*******************************************************************************
  2. * Copyright (c) 2016, 2017 logi.cals GmbH
  3. *
  4. * All rights reserved. This program and the accompanying materials
  5. * are made available under the terms of the Eclipse Public License v1.0
  6. * and Eclipse Distribution License v1.0 which accompany this distribution.
  7. *
  8. * The Eclipse Public License is available at
  9. * http://www.eclipse.org/legal/epl-v10.html
  10. * and the Eclipse Distribution License is available at
  11. * http://www.eclipse.org/org/documents/edl-v10.php.
  12. *
  13. * Contributors:
  14. * Gunter Raidl - timer support for VxWorks
  15. * Rainer Poisel - reusability
  16. *******************************************************************************/
  17. #include "OsWrapper.h"
  18. #if defined(_WRS_KERNEL)
  19. void usleep(useconds_t useconds)
  20. {
  21. struct timespec tv;
  22. tv.tv_sec = useconds / 1000000;
  23. tv.tv_nsec = (useconds % 1000000) * 1000;
  24. nanosleep(&tv, NULL);
  25. }
  26. #endif /* defined(_WRS_KERNEL) */