RPC: Add Virtual Display & Unify log tags (#814)
* RPC: Update protobuf sources * RPC: Add Virtual Display * Unify log tags * RPC: Virtual Display placeholder * Rpc: clear frame buffer callback before confirm. * Firmware: full assert for hal, move fatfs initialization to furi hal. * FuriHal: VCP optimizations, thread safe console. Rpc: adjust buffer sizes. Co-authored-by: Aleksandr Kutuzov <alleteam@gmail.com>
This commit is contained in:
@@ -6,8 +6,12 @@
|
||||
#include <stm32wbxx_ll_usart.h>
|
||||
#include <m-string.h>
|
||||
|
||||
#include <utilities_conf.h>
|
||||
|
||||
#include <furi.h>
|
||||
|
||||
#define TAG "FuriHalConsole"
|
||||
|
||||
#define CONSOLE_BAUDRATE 230400
|
||||
|
||||
volatile bool furi_hal_console_alive = false;
|
||||
@@ -16,7 +20,7 @@ void furi_hal_console_init() {
|
||||
furi_hal_uart_init(FuriHalUartIdUSART1, CONSOLE_BAUDRATE);
|
||||
furi_hal_console_alive = true;
|
||||
|
||||
FURI_LOG_I("FuriHalConsole", "Init OK");
|
||||
FURI_LOG_I(TAG, "Init OK");
|
||||
}
|
||||
|
||||
void furi_hal_console_enable() {
|
||||
@@ -35,22 +39,26 @@ void furi_hal_console_tx(const uint8_t* buffer, size_t buffer_size) {
|
||||
if (!furi_hal_console_alive)
|
||||
return;
|
||||
|
||||
UTILS_ENTER_CRITICAL_SECTION();
|
||||
// Transmit data
|
||||
furi_hal_uart_tx(FuriHalUartIdUSART1, (uint8_t*)buffer, buffer_size);
|
||||
// Wait for TC flag to be raised for last char
|
||||
while (!LL_USART_IsActiveFlag_TC(USART1));
|
||||
UTILS_EXIT_CRITICAL_SECTION();
|
||||
}
|
||||
|
||||
void furi_hal_console_tx_with_new_line(const uint8_t* buffer, size_t buffer_size) {
|
||||
if (!furi_hal_console_alive)
|
||||
return;
|
||||
|
||||
UTILS_ENTER_CRITICAL_SECTION();
|
||||
// Transmit data
|
||||
furi_hal_uart_tx(FuriHalUartIdUSART1, (uint8_t*)buffer, buffer_size);
|
||||
// Transmit new line symbols
|
||||
furi_hal_uart_tx(FuriHalUartIdUSART1, (uint8_t*)"\r\n", 2);
|
||||
// Wait for TC flag to be raised for last char
|
||||
while (!LL_USART_IsActiveFlag_TC(USART1));
|
||||
UTILS_EXIT_CRITICAL_SECTION();
|
||||
}
|
||||
|
||||
void furi_hal_console_printf(const char format[], ...) {
|
||||
|
Reference in New Issue
Block a user