mirror of
https://github.com/bluekitchen/btstack.git
synced 2024-12-29 09:26:08 +00:00
embedded: use generic btstack_run_loop_poll_data_sources_from_irq instead of btstack_run_loop_embedded_trigger
This commit is contained in:
parent
6cbe83c51d
commit
d338410556
@ -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) {
|
||||
|
@ -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){
|
||||
|
@ -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){
|
||||
|
@ -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);
|
||||
}
|
||||
|
||||
|
@ -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){
|
||||
|
Loading…
Reference in New Issue
Block a user