added new method that yield from ISR after semaphore is given from ISR

This commit is contained in:
suiauthon 2016-02-17 09:46:36 +01:00
parent ada61ef06b
commit ee6ae3ec95
2 changed files with 11 additions and 4 deletions

View File

@ -20,9 +20,9 @@
#elif UAVCAN_STM32_FREERTOS
# include <stm32f4xx.h>
# include <cmsis_os.h>
#ifndef MAX_SEMAPHORE_COUNT
#define MAX_SEMAPHORE_COUNT 50
#endif
# ifndef MAX_SEMAPHORE_COUNT
# define MAX_SEMAPHORE_COUNT 50
#endif
#else
# error "Unknown OS"
#endif
@ -186,12 +186,14 @@ public:
void signal();
void signalFromInterrupt();
void yieldFromISR();
};
class Mutex
{
SemaphoreHandle_t mtx_;
BaseType_t xHigherPriorityTaskWoken;
public:
Mutex(void)
{

View File

@ -116,6 +116,11 @@ void BusEvent::signalFromInterrupt()
portYIELD_FROM_ISR( xHigherPriorityTaskWoken );
}
void BusEvent::yieldFromISR()
{
portYIELD_FROM_ISR( xHigherPriorityTaskWoken );
}
/*
* Mutex
*/