mirror of
https://github.com/meshtastic/firmware.git
synced 2025-12-21 18:22:32 +00:00
don't shutdown bluetooth if we didn't start it
This commit is contained in:
@@ -2,11 +2,7 @@
|
|||||||
|
|
||||||
You probably don't care about this section - skip to the next one.
|
You probably don't care about this section - skip to the next one.
|
||||||
|
|
||||||
* disable bluetooth while wifi is active
|
|
||||||
* failed adding https service
|
|
||||||
* fix wifi connections for mqtt
|
|
||||||
* send debug info 'in-band'
|
* send debug info 'in-band'
|
||||||
|
|
||||||
* usb lora dongle from pine64
|
* usb lora dongle from pine64
|
||||||
* turn on watchdog reset if app hangs on nrf52 or esp32
|
* turn on watchdog reset if app hangs on nrf52 or esp32
|
||||||
* list portduino on platformio
|
* list portduino on platformio
|
||||||
|
|||||||
@@ -21,6 +21,8 @@
|
|||||||
static bool pinShowing;
|
static bool pinShowing;
|
||||||
static uint32_t doublepressed;
|
static uint32_t doublepressed;
|
||||||
|
|
||||||
|
static bool bluetoothActive;
|
||||||
|
|
||||||
static void startCb(uint32_t pin)
|
static void startCb(uint32_t pin)
|
||||||
{
|
{
|
||||||
pinShowing = true;
|
pinShowing = true;
|
||||||
@@ -52,6 +54,9 @@ void updateBatteryLevel(uint8_t level)
|
|||||||
|
|
||||||
void deinitBLE()
|
void deinitBLE()
|
||||||
{
|
{
|
||||||
|
if (bluetoothActive) {
|
||||||
|
bluetoothActive = false;
|
||||||
|
|
||||||
// DEBUG_MSG("Shutting down bluetooth\n");
|
// DEBUG_MSG("Shutting down bluetooth\n");
|
||||||
// ble_gatts_show_local();
|
// ble_gatts_show_local();
|
||||||
|
|
||||||
@@ -70,6 +75,7 @@ void deinitBLE()
|
|||||||
|
|
||||||
DEBUG_MSG("Done shutting down bluetooth\n");
|
DEBUG_MSG("Done shutting down bluetooth\n");
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void loopBLE()
|
void loopBLE()
|
||||||
{
|
{
|
||||||
@@ -479,6 +485,8 @@ void disablePin()
|
|||||||
doublepressed = millis();
|
doublepressed = millis();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// This routine is called multiple times, once each time we come back from sleep
|
// This routine is called multiple times, once each time we come back from sleep
|
||||||
void reinitBluetooth()
|
void reinitBluetooth()
|
||||||
{
|
{
|
||||||
@@ -536,6 +544,7 @@ void reinitBluetooth()
|
|||||||
ble_store_config_init();
|
ble_store_config_init();
|
||||||
|
|
||||||
nimble_port_freertos_init(ble_host_task);
|
nimble_port_freertos_init(ble_host_task);
|
||||||
|
bluetoothActive = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool bluetoothOn;
|
bool bluetoothOn;
|
||||||
|
|||||||
Reference in New Issue
Block a user