mirror of
https://github.com/bluekitchen/btstack.git
synced 2025-04-15 23:42:52 +00:00
wiced: use btstack_run_loop_execute_code_on_main_thread instead of btstack_run_loop_wiced_execute_code_on_main_thread
This commit is contained in:
parent
62b026069e
commit
739fcdb2bb
@ -56,11 +56,14 @@ static wiced_result_t stdin_reader_notify(void * p){
|
|||||||
return WICED_SUCCESS;
|
return WICED_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static btstack_context_callback_registration_t callback_registration;
|
||||||
static void stdin_reader_thread_process(wiced_thread_arg_t p){
|
static void stdin_reader_thread_process(wiced_thread_arg_t p){
|
||||||
UNUSED(p);
|
UNUSED(p);
|
||||||
|
callback_registration.callback = &callback_registration;
|
||||||
while (true){
|
while (true){
|
||||||
uint8_t c = getchar();
|
uint8_t c = getchar();
|
||||||
btstack_run_loop_wiced_execute_code_on_main_thread(&stdin_reader_notify, (void *)(uintptr_t) c);
|
callback_registration.context = (void *)(uintptr_t) c;
|
||||||
|
btstack_run_loop_execute_code_on_main_thread(&callback_registration);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -117,6 +117,7 @@ static wiced_result_t btstack_uart_block_wiced_main_notify_block_read(void *arg)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// executed on tx worker thread
|
// executed on tx worker thread
|
||||||
|
static btstack_context_callback_registration_t block_send_callback_registration;
|
||||||
static wiced_result_t btstack_uart_block_wiced_tx_worker_send_block(void * arg){
|
static wiced_result_t btstack_uart_block_wiced_tx_worker_send_block(void * arg){
|
||||||
// wait for CTS to become low in manual flow control mode
|
// wait for CTS to become low in manual flow control mode
|
||||||
if (btstack_flow_control_mode == BTSTACK_FLOW_CONTROL_MANUAL && wiced_bt_uart_pins[WICED_BT_PIN_UART_CTS]){
|
if (btstack_flow_control_mode == BTSTACK_FLOW_CONTROL_MANUAL && wiced_bt_uart_pins[WICED_BT_PIN_UART_CTS]){
|
||||||
@ -129,11 +130,13 @@ static wiced_result_t btstack_uart_block_wiced_tx_worker_send_block(void * arg){
|
|||||||
platform_uart_transmit_bytes(wiced_bt_uart_driver, tx_worker_data_buffer, tx_worker_data_size);
|
platform_uart_transmit_bytes(wiced_bt_uart_driver, tx_worker_data_buffer, tx_worker_data_size);
|
||||||
|
|
||||||
// let transport know
|
// let transport know
|
||||||
btstack_run_loop_wiced_execute_code_on_main_thread(&btstack_uart_block_wiced_main_notify_block_send, NULL);
|
block_send_callback_registration.callback = &btstack_uart_block_wiced_main_notify_block_send;
|
||||||
|
btstack_run_loop_execute_code_on_main_thread(&block_send_callback_registration);
|
||||||
return WICED_SUCCESS;
|
return WICED_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
// executed on rx worker thread
|
// executed on rx worker thread
|
||||||
|
static btstack_context_callback_registration_t block_received_callback_registration;
|
||||||
static wiced_result_t btstack_uart_block_wiced_rx_worker_receive_block(void * arg){
|
static wiced_result_t btstack_uart_block_wiced_rx_worker_receive_block(void * arg){
|
||||||
|
|
||||||
if (btstack_flow_control_mode == BTSTACK_FLOW_CONTROL_MANUAL && wiced_bt_uart_pins[WICED_BT_PIN_UART_CTS]){
|
if (btstack_flow_control_mode == BTSTACK_FLOW_CONTROL_MANUAL && wiced_bt_uart_pins[WICED_BT_PIN_UART_CTS]){
|
||||||
@ -155,7 +158,8 @@ static wiced_result_t btstack_uart_block_wiced_rx_worker_receive_block(void * ar
|
|||||||
}
|
}
|
||||||
|
|
||||||
// let transport know
|
// let transport know
|
||||||
btstack_run_loop_wiced_execute_code_on_main_thread(&btstack_uart_block_wiced_main_notify_block_read, NULL);
|
block_received_callback_registration.callback = &btstack_uart_block_wiced_main_notify_block_read;
|
||||||
|
btstack_run_loop_execute_code_on_main_thread(&block_received_callback_registration);
|
||||||
return WICED_SUCCESS;
|
return WICED_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user