diff --git a/platform/wiced/btstack_stdin_wiced.c b/platform/wiced/btstack_stdin_wiced.c index c3ae67eb7..94fe63dcb 100644 --- a/platform/wiced/btstack_stdin_wiced.c +++ b/platform/wiced/btstack_stdin_wiced.c @@ -56,11 +56,14 @@ static wiced_result_t stdin_reader_notify(void * p){ return WICED_SUCCESS; } +static btstack_context_callback_registration_t callback_registration; static void stdin_reader_thread_process(wiced_thread_arg_t p){ UNUSED(p); + callback_registration.callback = &callback_registration; while (true){ 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); } } diff --git a/platform/wiced/btstack_uart_block_wiced.c b/platform/wiced/btstack_uart_block_wiced.c index 0b731d70b..392664f0e 100644 --- a/platform/wiced/btstack_uart_block_wiced.c +++ b/platform/wiced/btstack_uart_block_wiced.c @@ -117,6 +117,7 @@ static wiced_result_t btstack_uart_block_wiced_main_notify_block_read(void *arg) } // 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){ // 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]){ @@ -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); // 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; } // 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){ 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 - 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; }