Skip to content

Commit

Permalink
Properly control LEDs during BT connect and shutdown
Browse files Browse the repository at this point in the history
  • Loading branch information
nseidle committed Jul 18, 2024
1 parent 6f31cb3 commit 703a66d
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
3 changes: 1 addition & 2 deletions Firmware/RTK_Everywhere/Bluetooth.ino
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ void bluetoothCallback(esp_spp_cb_event_t event, esp_spp_cb_param_t *param)
{
systemPrintln("BT client Connected");
bluetoothState = BT_CONNECTED;
bluetoothLedOn();
//LED is controlled by tickerBluetoothLedUpdate()
}

if (event == ESP_SPP_CLOSE_EVT)
Expand All @@ -58,7 +58,6 @@ void bluetoothCallback(esp_spp_cb_event_t event, esp_spp_cb_param_t *param)
printEndpoint = PRINT_ENDPOINT_SERIAL;

bluetoothState = BT_NOTCONNECTED;
bluetoothLedOff();
}
}

Expand Down
8 changes: 8 additions & 0 deletions Firmware/RTK_Everywhere/Tasks.ino
Original file line number Diff line number Diff line change
Expand Up @@ -1456,8 +1456,13 @@ void buttonCheckTask(void *e)
// Beep shortly before the shutdown IC takes over
else if (userBtn->pressedFor(2100))
{
systemPrintln("Shutting down");

tickerStop(); // Stop controlling LEDs via ticker task

pinMode(pin_gnssStatusLED, OUTPUT);
pinMode(pin_bluetoothStatusLED, OUTPUT);

gnssStatusLedOn();
bluetoothLedOn();

Expand All @@ -1470,6 +1475,9 @@ void buttonCheckTask(void *e)
delay(500); // We will be shutting off during this delay but this prevents another beepMultiple()
// from firing
}

while(1)
;
}
} // End productVariant == Torch
else // RTK EVK, RTK Facet v2, RTK Facet mosaic
Expand Down

0 comments on commit 703a66d

Please sign in to comment.