16 sem_init(&
sem_, 0, 0);
17 sem_setprotocol(&
sem_, SEM_PRIO_NONE);
27 if (duration.isPositive()) {
30 if (clock_gettime(CLOCK_REALTIME, &abstime) == 0) {
31 const unsigned billion = 1000 * 1000 * 1000;
32 uint64_t nsecs = abstime.tv_nsec + (uint64_t)duration.toUSec() * 1000;
33 abstime.tv_sec += nsecs / billion;
34 nsecs -= (nsecs / billion) * billion;
35 abstime.tv_nsec = nsecs;
39 while ((ret = sem_timedwait(&
sem_, &abstime)) == -1 && errno == EINTR);
54 if (
sem_.semcount <= 0) {
55 (void)sem_post(&
sem_);
BusEvent(CanDriver &can_driver)
CAN driver, incorporates all available CAN ifaces.
void signalFromInterrupt()
SignalCallbackHandler signal_cb_
bool wait(uavcan::MonotonicDuration duration)