21 #ifndef COSA_PERIODIC_HH 22 #define COSA_PERIODIC_HH 58 __attribute__((always_inline))
68 __attribute__((always_inline))
91 virtual void on_event(uint8_t type, uint16_t value)
121 #define periodic(timer,ms) \ 122 static uint32_t timer = RTT::millis(); \ 123 for (int __UNIQUE(i) = 1; \ 124 (__UNIQUE(i) != 0) && ((RTT::since(timer)) >= ms); \ 125 __UNIQUE(i)--, timer += ms) 145 #define PERIODIC(timer,us) \ 146 static uint32_t timer = RTT::micros(); \ 147 for (int __UNIQUE(i) = 1; \ 148 (__UNIQUE(i) != 0) && ((RTT::micros() - timer) >= us); \ 149 __UNIQUE(i)--, timer += us)
virtual void on_event(uint8_t type, uint16_t value)
int32_t expire_after() const
Periodic(Job::Scheduler *scheduler, uint32_t period)
void period(uint32_t time)