Give ThinkNode-m4 a heartbeat (#10408)

This commit is contained in:
Jonathan Bennett
2026-05-07 13:17:29 -05:00
committed by GitHub
parent b246bcd72e
commit 0f854862e7
4 changed files with 21 additions and 1 deletions

View File

@@ -106,6 +106,19 @@ int32_t StatusLEDModule::runOnce()
}
}
// If we want a LED to be dedicated to the simple hearbeat, we can use that instead of the charge LED
#if defined(LED_HEARTBEAT)
if (!config.device.led_heartbeat_disabled) {
if (HEARTBEAT_LED_state == LED_STATE_ON) {
HEARTBEAT_LED_state = LED_STATE_OFF;
my_interval = 999;
} else {
HEARTBEAT_LED_state = LED_STATE_ON;
my_interval = 1;
}
digitalWrite(LED_HEARTBEAT, HEARTBEAT_LED_state);
}
#endif
if (!config.bluetooth.enabled || PAIRING_LED_starttime + 30 * 1000 < millis() || doing_fast_blink) {
PAIRING_LED_state = LED_STATE_OFF;
} else if (ble_state == unpaired) {

View File

@@ -43,6 +43,9 @@ class StatusLEDModule : private concurrency::OSThread
private:
bool CHARGE_LED_state = LED_STATE_OFF;
bool PAIRING_LED_state = LED_STATE_OFF;
#if defined(LED_HEARTBEAT)
bool HEARTBEAT_LED_state = LED_STATE_OFF;
#endif
uint32_t PAIRING_LED_starttime = 0;
uint32_t lastUserbuttonTime = 0;

View File

@@ -35,6 +35,9 @@ void initVariant()
pinMode(LED_PAIRING, OUTPUT);
ledOff(LED_PAIRING);
pinMode(LED_HEARTBEAT, OUTPUT);
ledOff(LED_HEARTBEAT);
pinMode(Battery_LED_1, OUTPUT);
ledOff(Battery_LED_1);
pinMode(Battery_LED_2, OUTPUT);

View File

@@ -41,7 +41,8 @@ extern "C" {
// LEDs
#define LED_BLUE -1
#define LED_NOTIFICATION (32 + 9)
// #define LED_NOTIFICATION (32 + 9)
#define LED_HEARTBEAT (32 + 9)
#define LED_PAIRING (13)
#define Battery_LED_1 (15)