mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-06-29 08:50:35 +08:00
ChbiOS 18 support
This commit is contained in:
@@ -551,7 +551,11 @@ bool CanIface::waitMsrINakBitStateChange(bool target_state)
|
||||
::usleep(1000);
|
||||
#endif
|
||||
#if UAVCAN_STM32_CHIBIOS
|
||||
#ifdef MS2ST
|
||||
::chThdSleep(MS2ST(1));
|
||||
#else
|
||||
::chThdSleep(TIME_MS2I(1));
|
||||
#endif
|
||||
#endif
|
||||
#if UAVCAN_STM32_FREERTOS
|
||||
::osDelay(1);
|
||||
|
||||
@@ -34,8 +34,10 @@ bool BusEvent::wait(uavcan::MonotonicDuration duration)
|
||||
{
|
||||
# if (CH_KERNEL_MAJOR == 2)
|
||||
ret = sem_.waitTimeout((msec > MaxDelayMSec) ? MS2ST(MaxDelayMSec) : MS2ST(msec));
|
||||
# else // ChibiOS 3+
|
||||
# elif defined(MS2ST) // ChibiOS 3+
|
||||
ret = sem_.wait((msec > MaxDelayMSec) ? MS2ST(MaxDelayMSec) : MS2ST(msec));
|
||||
# else // ChibiOS 17+
|
||||
ret = sem_.wait(::systime_t((msec > MaxDelayMSec) ? TIME_MS2I(MaxDelayMSec) : TIME_MS2I(msec)));
|
||||
# endif
|
||||
}
|
||||
# if (CH_KERNEL_MAJOR == 2)
|
||||
|
||||
Reference in New Issue
Block a user