BT: stop advertising in bt test cli commands (#712)
* bt: stop advertising in bt test cli commands * furi-hal-bt: add switch context in furi_hal_bt_lock_flash * Lib: update STM32CubeWB to latest version. Scripts: update supported copro binaries version * Scripts: proper version extraction from Cube manifest * bt: add debug application and comment it * bt: fix stop advertising command * bt: debug on f7 target * furi-hal-console: add console tx + new line * bt: fix debug trace function Co-authored-by: Aleksandr Kutuzov <alleteam@gmail.com>
This commit is contained in:
@@ -26,6 +26,9 @@ void furi_hal_bt_start_advertising() {
|
||||
void furi_hal_bt_stop_advertising() {
|
||||
if(furi_hal_bt_is_active()) {
|
||||
gap_stop_advertising();
|
||||
while(furi_hal_bt_is_active()) {
|
||||
osDelay(1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -85,7 +88,9 @@ bool furi_hal_bt_lock_flash(bool erase_flag) {
|
||||
|
||||
if(erase_flag) SHCI_C2_FLASH_EraseActivity(ERASE_ACTIVITY_ON);
|
||||
|
||||
while(LL_FLASH_IsActiveFlag_OperationSuspended()) {};
|
||||
while(LL_FLASH_IsActiveFlag_OperationSuspended()) {
|
||||
osDelay(1);
|
||||
};
|
||||
|
||||
__disable_irq();
|
||||
|
||||
|
@@ -41,10 +41,7 @@ void furi_hal_console_init() {
|
||||
FURI_LOG_I("FuriHalConsole", "Init OK");
|
||||
}
|
||||
|
||||
void furi_hal_console_tx(const uint8_t* buffer, size_t buffer_size) {
|
||||
if (!furi_hal_console_alive)
|
||||
return;
|
||||
|
||||
static void furi_hal_console_uart_tx(const uint8_t* buffer, size_t buffer_size) {
|
||||
while(buffer_size > 0) {
|
||||
while (!LL_USART_IsActiveFlag_TXE(USART1));
|
||||
|
||||
@@ -53,8 +50,27 @@ void furi_hal_console_tx(const uint8_t* buffer, size_t buffer_size) {
|
||||
buffer++;
|
||||
buffer_size--;
|
||||
}
|
||||
}
|
||||
|
||||
/* Wait for TC flag to be raised for last char */
|
||||
void furi_hal_console_tx(const uint8_t* buffer, size_t buffer_size) {
|
||||
if (!furi_hal_console_alive)
|
||||
return;
|
||||
|
||||
// Transmit data
|
||||
furi_hal_console_uart_tx(buffer, buffer_size);
|
||||
// Wait for TC flag to be raised for last char
|
||||
while (!LL_USART_IsActiveFlag_TC(USART1));
|
||||
}
|
||||
|
||||
void furi_hal_console_tx_with_new_line(const uint8_t* buffer, size_t buffer_size) {
|
||||
if (!furi_hal_console_alive)
|
||||
return;
|
||||
|
||||
// Transmit data
|
||||
furi_hal_console_uart_tx(buffer, buffer_size);
|
||||
// Transmit new line symbols
|
||||
furi_hal_console_uart_tx((const uint8_t*)"\r\n", 2);
|
||||
// Wait for TC flag to be raised for last char
|
||||
while (!LL_USART_IsActiveFlag_TC(USART1));
|
||||
}
|
||||
|
||||
|
@@ -11,6 +11,8 @@ void furi_hal_console_init();
|
||||
|
||||
void furi_hal_console_tx(const uint8_t* buffer, size_t buffer_size);
|
||||
|
||||
void furi_hal_console_tx_with_new_line(const uint8_t* buffer, size_t buffer_size);
|
||||
|
||||
/**
|
||||
* Printf-like plain uart interface
|
||||
* @warning Will not work in ISR context
|
||||
|
Reference in New Issue
Block a user