mirror of
https://github.com/bluekitchen/btstack.git
synced 2025-01-01 09:08:06 +00:00
freertos: use generic btstack_run_loop_poll_data_sources_from_irq instead of btstack_run_loop_freertos_trigger_from_isr
This commit is contained in:
parent
4fd33db703
commit
d9d4921fd5
@ -40,14 +40,14 @@
|
|||||||
/*
|
/*
|
||||||
* btstack_uart_block_freertos.c
|
* btstack_uart_block_freertos.c
|
||||||
*
|
*
|
||||||
* Adapter to IRQ-driven hal_uart_dma.h with FreeRTOS BTstack Run Loop and
|
* Adapter to IRQ-driven hal_uart_dma.h with FreeRTOS BTstack Run Loop
|
||||||
* Callbacks are executed on main thread via data source and btstack_run_loop_freertos_trigger_from_isr
|
* Callbacks are executed on main thread via data source and btstack_run_loop_poll_data_sources_from_irq
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "btstack_debug.h"
|
#include "btstack_debug.h"
|
||||||
#include "btstack_uart_block.h"
|
#include "btstack_uart_block.h"
|
||||||
#include "btstack_run_loop_freertos.h"
|
#include "btstack_run_loop.h"
|
||||||
#include "hal_uart_dma.h"
|
#include "hal_uart_dma.h"
|
||||||
|
|
||||||
#ifdef HAVE_FREERTOS_INCLUDE_PREFIX
|
#ifdef HAVE_FREERTOS_INCLUDE_PREFIX
|
||||||
@ -56,12 +56,6 @@
|
|||||||
#include "FreeRTOS.h"
|
#include "FreeRTOS.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#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 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
|
// uart config
|
||||||
static const btstack_uart_config_t * uart_config;
|
static const btstack_uart_config_t * uart_config;
|
||||||
|
|
||||||
@ -77,12 +71,12 @@ static int receive_complete;
|
|||||||
|
|
||||||
static void btstack_uart_block_freertos_received_isr(void){
|
static void btstack_uart_block_freertos_received_isr(void){
|
||||||
receive_complete = 1;
|
receive_complete = 1;
|
||||||
btstack_run_loop_freertos_trigger_from_isr();
|
btstack_run_loop_poll_data_sources_from_irq();
|
||||||
}
|
}
|
||||||
|
|
||||||
static void btstack_uart_block_freertos_sent_isr(void){
|
static void btstack_uart_block_freertos_sent_isr(void){
|
||||||
send_complete = 1;
|
send_complete = 1;
|
||||||
btstack_run_loop_freertos_trigger_from_isr();
|
btstack_run_loop_poll_data_sources_from_irq();
|
||||||
}
|
}
|
||||||
|
|
||||||
static void btstack_uart_block_freertos_process(btstack_data_source_t *ds, btstack_data_source_callback_type_t callback_type) {
|
static void btstack_uart_block_freertos_process(btstack_data_source_t *ds, btstack_data_source_callback_type_t callback_type) {
|
||||||
|
Loading…
Reference in New Issue
Block a user