Skip to content

Commit

Permalink
Merge pull request #123 from UAVCAN/stm32-chibios-18
Browse files Browse the repository at this point in the history
STM32 ChibiOS 18 support
  • Loading branch information
pavel-kirienko authored Apr 19, 2018
2 parents 9a8b059 + fca6224 commit dbd037b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
4 changes: 4 additions & 0 deletions libuavcan_drivers/stm32/driver/src/uc_stm32_can.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
4 changes: 3 additions & 1 deletion libuavcan_drivers/stm32/driver/src/uc_stm32_thread.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit dbd037b

Please sign in to comment.