mirror of
https://github.com/mikecarper/MeshCore.git
synced 2026-10-23 03:01:27 +00:00
Add get leds and set leds on|off for Companion, repeater, room server and sensor builds. Preserve the setting across reboots and cover GPIO, RGB, Bluetooth, notification and expander indicators without changing radio amplifier controls or screen backlights. RAK Companions blink while advertising and keep the Bluetooth LED off once connected, including late timer callbacks. Adapted from meshcore-dev/MeshCore#3605 and #2694. Validated with host regressions and firmware builds for SenseCAP Solar, RAK4631, T096, Heltec V4, T-Beam, Xiao S3, Pico W and Wio E5 Mini. Co-authored-by: R0ck <develop@hectospark.co.uk> Co-authored-by: Nick Dunklee <nick@dunklee.org>
26 lines
608 B
C++
26 lines
608 B
C++
#pragma once
|
|
|
|
#include <Arduino.h>
|
|
#include <helpers/RefCountedDigitalPin.h>
|
|
#include <helpers/ESP32Board.h>
|
|
#include "variant.h"
|
|
#include "NullDisplayDriver.h"
|
|
#include "MomentaryButton.h"
|
|
|
|
class ThinkNodeM7Board : public ESP32Board {
|
|
|
|
public:
|
|
void begin();
|
|
const char* getManufacturerName() const override;
|
|
void applyLedPolicy() override {
|
|
if (!mesh::leds::enabled()) digitalWrite(P_LORA_TX_LED, HIGH);
|
|
}
|
|
|
|
void onBeforeTransmit() override {
|
|
if (mesh::leds::enabled()) digitalWrite(P_LORA_TX_LED, LOW);
|
|
}
|
|
void onAfterTransmit() override {
|
|
digitalWrite(P_LORA_TX_LED, HIGH);
|
|
}
|
|
};
|