mirror of
https://github.com/esphome/esphome.git
synced 2025-09-02 19:32:19 +01:00
fix ble logger
This commit is contained in:
@@ -42,7 +42,9 @@ void BLENUS::send_enabled_callback_(bt_nus_send_status status) {
|
|||||||
case BT_NUS_SEND_STATUS_ENABLED:
|
case BT_NUS_SEND_STATUS_ENABLED:
|
||||||
atomic_set(&global_ble_nus->tx_status_, TX_ENABLED);
|
atomic_set(&global_ble_nus->tx_status_, TX_ENABLED);
|
||||||
#ifdef USE_LOGGER
|
#ifdef USE_LOGGER
|
||||||
App.schedule_dump_config();
|
if (global_ble_nus->expose_log_) {
|
||||||
|
App.schedule_dump_config();
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
ESP_LOGD(TAG, "NUS notification has been enabled");
|
ESP_LOGD(TAG, "NUS notification has been enabled");
|
||||||
break;
|
break;
|
||||||
@@ -101,7 +103,9 @@ void BLENUS::loop() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!atomic_cas(&tx_status_, TX_ENABLED, TX_BUSY)) {
|
if (!atomic_cas(&tx_status_, TX_ENABLED, TX_BUSY)) {
|
||||||
ring_buf_reset(&tx_ringbuf_);
|
if (atomic_get(&tx_status_) == TX_DISABLED) {
|
||||||
|
ring_buf_reset(&tx_ringbuf_);
|
||||||
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user