mirror of
https://github.com/meshcore-dev/MeshCore.git
synced 2026-04-20 22:13:47 +00:00
Merge upstream/dev into rak-ethernet
Resolve conflicts: keep both Ethernet CLI and SenseCAP power-off button code in repeater, keep both Ethernet docs and power management CLI docs. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
commit
eba2446747
17 changed files with 305 additions and 167 deletions
|
|
@ -31,6 +31,11 @@ static char ethernet_command[160];
|
|||
unsigned long lastActive = 0; // mark last active time
|
||||
unsigned long nextSleepinSecs = 120; // next sleep in seconds. The first sleep (if enabled) is after 2 minutes from boot
|
||||
|
||||
#if defined(PIN_USER_BTN) && defined(_SEEED_SENSECAP_SOLAR_H_)
|
||||
static unsigned long userBtnDownAt = 0;
|
||||
#define USER_BTN_HOLD_OFF_MILLIS 1500
|
||||
#endif
|
||||
|
||||
void setup() {
|
||||
Serial.begin(115200);
|
||||
delay(1000);
|
||||
|
|
@ -163,6 +168,21 @@ void loop() {
|
|||
}
|
||||
#endif
|
||||
|
||||
#if defined(PIN_USER_BTN) && defined(_SEEED_SENSECAP_SOLAR_H_)
|
||||
// Hold the user button to power off the SenseCAP Solar repeater.
|
||||
int btnState = digitalRead(PIN_USER_BTN);
|
||||
if (btnState == LOW) {
|
||||
if (userBtnDownAt == 0) {
|
||||
userBtnDownAt = millis();
|
||||
} else if ((unsigned long)(millis() - userBtnDownAt) >= USER_BTN_HOLD_OFF_MILLIS) {
|
||||
Serial.println("Powering off...");
|
||||
board.powerOff(); // does not return
|
||||
}
|
||||
} else {
|
||||
userBtnDownAt = 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
the_mesh.loop();
|
||||
sensors.loop();
|
||||
#ifdef DISPLAY_CLASS
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue