Merge pull request #123 from UAVCAN/stm32-chibios-18

STM32 ChibiOS 18 support
This commit is contained in:
Pavel Kirienko
2018-04-19 15:34:33 +03:00
committed by GitHub
2 changed files with 7 additions and 1 deletions
@@ -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)