mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-24 01:33:34 +08:00
added new method that yield from ISR after semaphore is given from ISR
This commit is contained in:
@@ -20,9 +20,9 @@
|
|||||||
#elif UAVCAN_STM32_FREERTOS
|
#elif UAVCAN_STM32_FREERTOS
|
||||||
# include <stm32f4xx.h>
|
# include <stm32f4xx.h>
|
||||||
# include <cmsis_os.h>
|
# include <cmsis_os.h>
|
||||||
#ifndef MAX_SEMAPHORE_COUNT
|
# ifndef MAX_SEMAPHORE_COUNT
|
||||||
#define MAX_SEMAPHORE_COUNT 50
|
# define MAX_SEMAPHORE_COUNT 50
|
||||||
#endif
|
#endif
|
||||||
#else
|
#else
|
||||||
# error "Unknown OS"
|
# error "Unknown OS"
|
||||||
#endif
|
#endif
|
||||||
@@ -186,12 +186,14 @@ public:
|
|||||||
void signal();
|
void signal();
|
||||||
|
|
||||||
void signalFromInterrupt();
|
void signalFromInterrupt();
|
||||||
|
|
||||||
|
void yieldFromISR();
|
||||||
};
|
};
|
||||||
|
|
||||||
class Mutex
|
class Mutex
|
||||||
{
|
{
|
||||||
SemaphoreHandle_t mtx_;
|
SemaphoreHandle_t mtx_;
|
||||||
BaseType_t xHigherPriorityTaskWoken;
|
|
||||||
public:
|
public:
|
||||||
Mutex(void)
|
Mutex(void)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -116,6 +116,11 @@ void BusEvent::signalFromInterrupt()
|
|||||||
portYIELD_FROM_ISR( xHigherPriorityTaskWoken );
|
portYIELD_FROM_ISR( xHigherPriorityTaskWoken );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void BusEvent::yieldFromISR()
|
||||||
|
{
|
||||||
|
portYIELD_FROM_ISR( xHigherPriorityTaskWoken );
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Mutex
|
* Mutex
|
||||||
*/
|
*/
|
||||||
|
|||||||
Reference in New Issue
Block a user