mirror of https://github.com/meshcore-dev/MeshCore
Browse Source
The long press already reached board.powerOff(), but nothing armed a wake source, so the board stayed dead until a reset or a USB reconnect. Arm the user button (pull-up + SENSE_LOW) before entering SYSTEMOFF, after waiting for the release: SENSE is level triggered and a still pressed button wakes the board up immediately. If the button is never released, reboot instead: SYSTEMOFF would wake up right away anyway, so make the reset explicit. GPIO output latches survive SYSTEMOFF, so shut the switched rails down as well (GNSS, RGB led supply, EEPROM, battery divider, EN1/EN2, PWR_EN), in a shutdownPeripherals() override so they go down after the radio and the GNSS receiver. Give pins 36 and 34 a name while there. Tested on a ThinkNode M3 companion_radio_ble: a long press powers the board off (the USB device disappears and stays away), a short press brings it back, and holding the button past the timeout reboots.pull/3068/head
4 changed files with 44 additions and 13 deletions
Loading…
Reference in new issue