mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-25 04:33:33 +08:00
STM32: Added mutex; clock made thread safe
This commit is contained in:
@@ -8,7 +8,9 @@ namespace uavcan_stm32
|
||||
{
|
||||
|
||||
#if UAVCAN_STM32_CHIBIOS
|
||||
|
||||
/*
|
||||
* Event
|
||||
*/
|
||||
bool Event::wait(uavcan::MonotonicDuration duration)
|
||||
{
|
||||
msg_t ret = msg_t();
|
||||
@@ -35,6 +37,19 @@ void Event::signalFromInterrupt()
|
||||
chSysUnlockFromIsr();
|
||||
}
|
||||
|
||||
/*
|
||||
* Mutex
|
||||
*/
|
||||
void Mutex::lock()
|
||||
{
|
||||
mtx_.lock();
|
||||
}
|
||||
|
||||
void Mutex::unlock()
|
||||
{
|
||||
chibios_rt::BaseThread::unlockMutex();
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user