mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-04-14 10:07:39 +08:00
added new method that yield from ISR after semaphore is given from ISR
This commit is contained in:
parent
ada61ef06b
commit
ee6ae3ec95
@ -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)
|
||||
{
|
||||
|
||||
@ -116,6 +116,11 @@ void BusEvent::signalFromInterrupt()
|
||||
portYIELD_FROM_ISR( xHigherPriorityTaskWoken );
|
||||
}
|
||||
|
||||
void BusEvent::yieldFromISR()
|
||||
{
|
||||
portYIELD_FROM_ISR( xHigherPriorityTaskWoken );
|
||||
}
|
||||
|
||||
/*
|
||||
* Mutex
|
||||
*/
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user