STM32: Added mutex; clock made thread safe

This commit is contained in:
Pavel Kirienko
2014-04-05 11:19:20 +04:00
parent c025df05fb
commit 9e197f129b
3 changed files with 57 additions and 2 deletions
@@ -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
}