|
@@ -16,7 +16,8 @@ static void tx_handler(const uint8_t* buffer, size_t size) {
|
|
|
furi_stream_buffer_send(cli_tx_stream, buffer, size, FuriWaitForever);
|
|
furi_stream_buffer_send(cli_tx_stream, buffer, size, FuriWaitForever);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-static void tx_handler_stdout(const char* buffer, size_t size) {
|
|
|
|
|
|
|
+static void tx_handler_stdout(const char* buffer, size_t size, void* context) {
|
|
|
|
|
+ UNUSED(context);
|
|
|
tx_handler((const uint8_t*)buffer, size);
|
|
tx_handler((const uint8_t*)buffer, size);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -32,9 +33,9 @@ static size_t real_rx_handler(uint8_t* buffer, size_t size, uint32_t timeout) {
|
|
|
rx_cnt += len;
|
|
rx_cnt += len;
|
|
|
}
|
|
}
|
|
|
if(restore_tx_stdout) {
|
|
if(restore_tx_stdout) {
|
|
|
- furi_thread_set_stdout_callback(cli_vcp.tx_stdout);
|
|
|
|
|
|
|
+ furi_thread_set_stdout_callback(cli_vcp.tx_stdout, NULL);
|
|
|
} else {
|
|
} else {
|
|
|
- furi_thread_set_stdout_callback(tx_handler_stdout);
|
|
|
|
|
|
|
+ furi_thread_set_stdout_callback(tx_handler_stdout, NULL);
|
|
|
}
|
|
}
|
|
|
return rx_cnt;
|
|
return rx_cnt;
|
|
|
}
|
|
}
|
|
@@ -87,7 +88,7 @@ void clicontrol_hijack(size_t tx_size, size_t rx_size) {
|
|
|
cli_session_close(global_cli);
|
|
cli_session_close(global_cli);
|
|
|
restore_tx_stdout = false;
|
|
restore_tx_stdout = false;
|
|
|
cli_session_open(global_cli, session);
|
|
cli_session_open(global_cli, session);
|
|
|
- furi_thread_set_stdout_callback(prev_stdout);
|
|
|
|
|
|
|
+ furi_thread_set_stdout_callback(prev_stdout, NULL);
|
|
|
|
|
|
|
|
furi_record_close(RECORD_CLI);
|
|
furi_record_close(RECORD_CLI);
|
|
|
}
|
|
}
|
|
@@ -134,7 +135,7 @@ void clicontrol_unhijack(bool persist) {
|
|
|
FuriThreadStdoutWriteCallback prev_stdout = furi_thread_get_stdout_callback();
|
|
FuriThreadStdoutWriteCallback prev_stdout = furi_thread_get_stdout_callback();
|
|
|
cli_session_close(global_cli);
|
|
cli_session_close(global_cli);
|
|
|
cli_session_open(global_cli, &cli_vcp);
|
|
cli_session_open(global_cli, &cli_vcp);
|
|
|
- furi_thread_set_stdout_callback(prev_stdout);
|
|
|
|
|
|
|
+ furi_thread_set_stdout_callback(prev_stdout, NULL);
|
|
|
furi_record_close(RECORD_CLI);
|
|
furi_record_close(RECORD_CLI);
|
|
|
|
|
|
|
|
// Unblock waiting rx handler, restore old cli_vcp.tx_stdout
|
|
// Unblock waiting rx handler, restore old cli_vcp.tx_stdout
|