mirror of
https://github.com/hathach/tinyusb.git
synced 2025-03-27 20:37:30 +00:00
follow up to pr468
This commit is contained in:
parent
787c891702
commit
dfca92d29b
@ -32,7 +32,6 @@
|
|||||||
#include "semphr.h"
|
#include "semphr.h"
|
||||||
#include "queue.h"
|
#include "queue.h"
|
||||||
#include "task.h"
|
#include "task.h"
|
||||||
#include "tusb_option.h"
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
extern "C" {
|
extern "C" {
|
||||||
@ -59,19 +58,23 @@ static inline osal_semaphore_t osal_semaphore_create(osal_semaphore_def_t* semde
|
|||||||
|
|
||||||
static inline bool osal_semaphore_post(osal_semaphore_t sem_hdl, bool in_isr)
|
static inline bool osal_semaphore_post(osal_semaphore_t sem_hdl, bool in_isr)
|
||||||
{
|
{
|
||||||
if(!in_isr){
|
if ( !in_isr )
|
||||||
|
{
|
||||||
return xSemaphoreGive(sem_hdl) != 0;
|
return xSemaphoreGive(sem_hdl) != 0;
|
||||||
}
|
}
|
||||||
BaseType_t xHigherPriorityTaskWoken;
|
else
|
||||||
BaseType_t res = xSemaphoreGiveFromISR(sem_hdl, &xHigherPriorityTaskWoken);
|
{
|
||||||
|
BaseType_t xHigherPriorityTaskWoken;
|
||||||
|
BaseType_t res = xSemaphoreGiveFromISR(sem_hdl, &xHigherPriorityTaskWoken);
|
||||||
|
|
||||||
#if CFG_TUSB_MCU == OPT_MCU_ESP32S2
|
#if CFG_TUSB_MCU == OPT_MCU_ESP32S2
|
||||||
if (xHigherPriorityTaskWoken) {
|
if ( xHigherPriorityTaskWoken ) portYIELD_FROM_ISR();
|
||||||
portYIELD_FROM_ISR();
|
|
||||||
}
|
|
||||||
#else
|
#else
|
||||||
portYIELD_FROM_ISR(xHigherPriorityTaskWoken);
|
portYIELD_FROM_ISR(xHigherPriorityTaskWoken);
|
||||||
#endif
|
#endif
|
||||||
return res != 0;
|
|
||||||
|
return res != 0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline bool osal_semaphore_wait (osal_semaphore_t sem_hdl, uint32_t msec)
|
static inline bool osal_semaphore_wait (osal_semaphore_t sem_hdl, uint32_t msec)
|
||||||
@ -138,19 +141,23 @@ static inline bool osal_queue_receive(osal_queue_t qhdl, void* data)
|
|||||||
|
|
||||||
static inline bool osal_queue_send(osal_queue_t qhdl, void const * data, bool in_isr)
|
static inline bool osal_queue_send(osal_queue_t qhdl, void const * data, bool in_isr)
|
||||||
{
|
{
|
||||||
if(!in_isr){
|
if ( !in_isr )
|
||||||
|
{
|
||||||
return xQueueSendToBack(qhdl, data, OSAL_TIMEOUT_WAIT_FOREVER) != 0;
|
return xQueueSendToBack(qhdl, data, OSAL_TIMEOUT_WAIT_FOREVER) != 0;
|
||||||
}
|
}
|
||||||
BaseType_t xHigherPriorityTaskWoken;
|
else
|
||||||
BaseType_t res = xQueueSendToBackFromISR(qhdl, data, &xHigherPriorityTaskWoken);
|
{
|
||||||
|
BaseType_t xHigherPriorityTaskWoken;
|
||||||
|
BaseType_t res = xQueueSendToBackFromISR(qhdl, data, &xHigherPriorityTaskWoken);
|
||||||
|
|
||||||
#if CFG_TUSB_MCU == OPT_MCU_ESP32S2
|
#if CFG_TUSB_MCU == OPT_MCU_ESP32S2
|
||||||
if (xHigherPriorityTaskWoken) {
|
if ( xHigherPriorityTaskWoken ) portYIELD_FROM_ISR();
|
||||||
portYIELD_FROM_ISR();
|
|
||||||
}
|
|
||||||
#else
|
#else
|
||||||
portYIELD_FROM_ISR(xHigherPriorityTaskWoken);
|
portYIELD_FROM_ISR(xHigherPriorityTaskWoken);
|
||||||
#endif
|
#endif
|
||||||
return res != 0;
|
|
||||||
|
return res != 0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline bool osal_queue_empty(osal_queue_t qhdl)
|
static inline bool osal_queue_empty(osal_queue_t qhdl)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user