mirror of
https://bitbucket.org/librepilot/librepilot.git
synced 2024-12-01 09:24:10 +01:00
OP-1275 - Fix PIOS_COM to be used with no PIOS_INCLUDE_FREERTOS defined
This commit is contained in:
parent
ffac550601
commit
94c39caa50
@ -167,10 +167,11 @@ out_fail:
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if defined(PIOS_INCLUDE_FREERTOS)
|
||||||
static void PIOS_COM_UnblockRx(struct pios_com_dev *com_dev, bool *need_yield)
|
static void PIOS_COM_UnblockRx(struct pios_com_dev *com_dev, bool *need_yield)
|
||||||
{
|
{
|
||||||
#if defined(PIOS_INCLUDE_FREERTOS)
|
|
||||||
static signed portBASE_TYPE xHigherPriorityTaskWoken = pdFALSE;
|
static signed portBASE_TYPE xHigherPriorityTaskWoken = pdFALSE;
|
||||||
|
|
||||||
xSemaphoreGiveFromISR(com_dev->rx_sem, &xHigherPriorityTaskWoken);
|
xSemaphoreGiveFromISR(com_dev->rx_sem, &xHigherPriorityTaskWoken);
|
||||||
|
|
||||||
if (xHigherPriorityTaskWoken != pdFALSE) {
|
if (xHigherPriorityTaskWoken != pdFALSE) {
|
||||||
@ -178,15 +179,19 @@ static void PIOS_COM_UnblockRx(struct pios_com_dev *com_dev, bool *need_yield)
|
|||||||
} else {
|
} else {
|
||||||
*need_yield = false;
|
*need_yield = false;
|
||||||
}
|
}
|
||||||
#else
|
|
||||||
*need_yield = false;
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
#else
|
||||||
|
static void PIOS_COM_UnblockRx(__attribute__((unused)) struct pios_com_dev *com_dev, bool *need_yield)
|
||||||
|
{
|
||||||
|
*need_yield = false;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if defined(PIOS_INCLUDE_FREERTOS)
|
||||||
static void PIOS_COM_UnblockTx(struct pios_com_dev *com_dev, bool *need_yield)
|
static void PIOS_COM_UnblockTx(struct pios_com_dev *com_dev, bool *need_yield)
|
||||||
{
|
{
|
||||||
#if defined(PIOS_INCLUDE_FREERTOS)
|
|
||||||
static signed portBASE_TYPE xHigherPriorityTaskWoken = pdFALSE;
|
static signed portBASE_TYPE xHigherPriorityTaskWoken = pdFALSE;
|
||||||
|
|
||||||
xSemaphoreGiveFromISR(com_dev->tx_sem, &xHigherPriorityTaskWoken);
|
xSemaphoreGiveFromISR(com_dev->tx_sem, &xHigherPriorityTaskWoken);
|
||||||
|
|
||||||
if (xHigherPriorityTaskWoken != pdFALSE) {
|
if (xHigherPriorityTaskWoken != pdFALSE) {
|
||||||
@ -194,10 +199,14 @@ static void PIOS_COM_UnblockTx(struct pios_com_dev *com_dev, bool *need_yield)
|
|||||||
} else {
|
} else {
|
||||||
*need_yield = false;
|
*need_yield = false;
|
||||||
}
|
}
|
||||||
#else
|
|
||||||
*need_yield = false;
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
#else
|
||||||
|
static void PIOS_COM_UnblockTx(__attribute__((unused)) struct pios_com_dev *com_dev, bool *need_yield)
|
||||||
|
{
|
||||||
|
*need_yield = false;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
static uint16_t PIOS_COM_RxInCallback(uint32_t context, uint8_t *buf, uint16_t buf_len, uint16_t *headroom, bool *need_yield)
|
static uint16_t PIOS_COM_RxInCallback(uint32_t context, uint8_t *buf, uint16_t buf_len, uint16_t *headroom, bool *need_yield)
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user