mn_sleep.hpp
Go to the documentation of this file.
1 
19 #ifndef _MINILIB_NANOSLEEP_H_
20 #define _MINILIB_NANOSLEEP_H_
21 
22 #include "mn_config.hpp"
23 
24 #include <errno.h>
25 #include <sys/signal.h>
26 #include <sys/time.h>
27 #include <time.h>
28 
29 #include <freertos/FreeRTOS.h>
30 #include <freertos/task.h>
31 
32 #include "mn_timespan.hpp"
33 
39 #define MN_DELAY_SEC(sec) mn::delay(timespan_t(0,0,0,sec,0))
40 #define MN_DELAY_MICROS(ms) mn::delay(timespan_t(0,0,0,0,ms))
41 
42 namespace mn {
43 
48  void delay(const timespan_t& ts);
49 
59  unsigned int delay_until( timespan_t& tsPreviousWakeTime, const unsigned int& uiTimeIncrement);
67  void ndelay(const timespan_t& req, timespan_t* rem);
68 
69 }
70 
72 
73 #endif
#define MN_EXTERNC_BEGINN
Definition: mn_defines.hpp:49
#define MN_EXTERNC_END
Definition: mn_defines.hpp:50
Definition: mn_allocator_typetraits.hpp:25
void ndelay(const timespan_t &req, timespan_t *rem)
Definition: mn_sleep.cpp:112
basic_timespan timespan_t
Definition: mn_timespan.hpp:225
unsigned int delay_until(timespan_t &tsPreviousWakeTime, const unsigned int &uiTimeIncrement)
Delay a task until a specified time.
Definition: mn_sleep.cpp:134
void delay(const timespan_t &ts)
Definition: mn_sleep.cpp:147