diff --git a/platform/embedded/btstack_em9304_spi_embedded.c b/platform/embedded/btstack_em9304_spi_embedded.c index 85318bb44..4317e68df 100644 --- a/platform/embedded/btstack_em9304_spi_embedded.c +++ b/platform/embedded/btstack_em9304_spi_embedded.c @@ -43,7 +43,7 @@ */ #include "btstack_debug.h" -#include "btstack_run_loop_embedded.h" +#include "btstack_run_loop.h" #include "btstack_em9304_spi.h" #include "hal_em9304_spi.h" @@ -58,12 +58,12 @@ static int btstack_em9304_spi_embedded_notify_transfer_done; static void btstack_em9304_spi_embedded_ready(void){ btstack_em9304_spi_embedded_notify_ready = 1; - btstack_run_loop_embedded_trigger(); + btstack_run_loop_poll_data_sources_from_irq(); } static void btstack_em9304_spi_transfer_done(void){ btstack_em9304_spi_embedded_notify_transfer_done = 1; - btstack_run_loop_embedded_trigger(); + btstack_run_loop_poll_data_sources_from_irq(); } static void btstack_em9304_spi_embedded_process(btstack_data_source_t *ds, btstack_data_source_callback_type_t callback_type) { diff --git a/platform/embedded/btstack_stdin_embedded.c b/platform/embedded/btstack_stdin_embedded.c index 8f7c6abac..3467ae36c 100644 --- a/platform/embedded/btstack_stdin_embedded.c +++ b/platform/embedded/btstack_stdin_embedded.c @@ -61,13 +61,15 @@ static btstack_data_source_t stdin_data_source; #ifndef ENABLE_SEGGER_RTT +// callback from hal_stdin is from irq context + volatile int stdin_character_received; volatile char stdin_character; static void btstack_stdin_handler(char c){ stdin_character = c; stdin_character_received = 1; - btstack_run_loop_embedded_trigger(); + btstack_run_loop_poll_data_sources_from_irq(); } static void btstack_stdin_process(struct btstack_data_source *ds, btstack_data_source_callback_type_t callback_type){ diff --git a/platform/embedded/btstack_uart_block_embedded.c b/platform/embedded/btstack_uart_block_embedded.c index 0ba3188ae..5b836676e 100644 --- a/platform/embedded/btstack_uart_block_embedded.c +++ b/platform/embedded/btstack_uart_block_embedded.c @@ -40,13 +40,13 @@ /* * btstack_uart_block_embedded.c * - * Common code to access UART via asynchronous block read/write commands on top of hal_uart_dma.h - * + * Adapter to IRQ-driven hal_uart_dma.h with Embedded BTstack Run Loop + * Callbacks are executed on main thread via data source and btstack_run_loop_poll_data_sources_from_irq */ #include "btstack_debug.h" #include "btstack_uart_block.h" -#include "btstack_run_loop_embedded.h" +#include "btstack_run_loop.h" #include "hal_uart_dma.h" // NULL @@ -70,17 +70,17 @@ static void (*wakeup_handler)(void); static void btstack_uart_block_received(void){ receive_complete = 1; - btstack_run_loop_embedded_trigger(); + btstack_run_loop_poll_data_sources_from_irq(); } static void btstack_uart_block_sent(void){ send_complete = 1; - btstack_run_loop_embedded_trigger(); + btstack_run_loop_poll_data_sources_from_irq(); } static void btstack_uart_cts_pulse(void){ wakeup_event = 1; - btstack_run_loop_embedded_trigger(); + btstack_run_loop_poll_data_sources_from_irq(); } static int btstack_uart_embedded_init(const btstack_uart_config_t * config){ diff --git a/port/max32630-fthr/src/btstack_port.c b/port/max32630-fthr/src/btstack_port.c index 55e3b70eb..95c4e2e5a 100644 --- a/port/max32630-fthr/src/btstack_port.c +++ b/port/max32630-fthr/src/btstack_port.c @@ -363,7 +363,7 @@ static void stdin_process(struct btstack_data_source *ds, btstack_data_source_ca static void btstack_stdin_handler(char c){ stdin_character_received = 1; - btstack_run_loop_embedded_trigger(); + btstack_run_loop_poll_data_sources_from_irq(); printf("Received: %c\n", c); } diff --git a/port/stm32-l073rz-nucleo-em9304/port/port.c b/port/stm32-l073rz-nucleo-em9304/port/port.c index 5c1dca4b8..a1e49c746 100644 --- a/port/stm32-l073rz-nucleo-em9304/port/port.c +++ b/port/stm32-l073rz-nucleo-em9304/port/port.c @@ -204,7 +204,7 @@ static void (*rx_done_handler)(void) = &dummy_handler; static void (*tx_done_handler)(void) = &dummy_handler; static inline void hal_spi_em9304_trigger_run_loop(void){ - btstack_run_loop_embedded_trigger(); + btstack_run_loop_poll_data_sources_from_irq(); } static inline int hal_spi_em9304_rdy(void){