freertos: use portYIELD_FROM_ISR without arguments on esp32 and allow to compile of btstack_uart_block_freertos

This commit is contained in:
Matthias Ringwald 2017-10-24 15:03:11 +02:00
parent 233eb2b535
commit 297a0e053d
2 changed files with 6 additions and 7 deletions

View File

@ -152,7 +152,11 @@ void btstack_run_loop_freertos_trigger_from_isr(void){
#ifdef HAVE_FREERTOS_TASK_NOTIFICATIONS
xTaskNotifyFromISR(btstack_run_loop_task, EVENT_GROUP_FLAG_RUN_LOOP, eSetBits, &xHigherPriorityTaskWoken);
if (xHigherPriorityTaskWoken) {
#ifdef ESP_PLATFORM
portYIELD_FROM_ISR();
#else
portYIELD_FROM_ISR( xHigherPriorityTaskWoken );
#endif
}
#else
xEventGroupSetBitsFromISR(btstack_run_loop_event_group, EVENT_GROUP_FLAG_RUN_LOOP, &xHigherPriorityTaskWoken);

View File

@ -50,12 +50,10 @@
#include "btstack_run_loop_freertos.h"
#include "hal_uart_dma.h"
// hack to avoid error for ESP32
#ifndef ESP_PLATFORM
#if (INCLUDE_xEventGroupSetBitFromISR != 1) && !defined(HAVE_FREERTOS_TASK_NOTIFICATIONS)
#error "The BTstack HAL UART Run Loop integration (btstack_uart_block_freertos) needs to trigger Run Loop iterations from ISR context," \
"but 'INCLUDE_xEventGroupSetBitFromISR' is not enabled in your FreeRTOS configuration. Please enable INCLUDE_xEventGroupSetBitFromISR."
"but neither 'INCLUDE_xEventGroupSetBitFromISR' is enabled in your FreeRTOS configuration nor HAVE_FREERTOS_TASK_NOTIFICATIONS is enabled in " \
"btstack_config.h. Please enable INCLUDE_xEventGroupSetBitFromISR or HAVE_FREERTOS_TASK_NOTIFICATIONS."
#endif
// uart config
@ -169,6 +167,3 @@ static const btstack_uart_block_t btstack_uart_block_freertos = {
const btstack_uart_block_t * btstack_uart_block_freertos_instance(void){
return &btstack_uart_block_freertos;
}
// end of hack to avoid error for ESP32
#endif // ESP_PLATFORM