turn of axp led while sleeping

1.2-legacy
geeksville 2020-02-02 13:55:44 -08:00
rodzic ef4e7911f5
commit 74adc06f89
3 zmienionych plików z 14 dodań i 6 usunięć

Wyświetl plik

@ -13,7 +13,7 @@
typedef int ErrorCode;
typedef uint8_t NodeNum;
#define MAX_TX_QUEUE 4 // max number of packets which can be waiting for transmission
#define MAX_TX_QUEUE 8 // max number of packets which can be waiting for transmission
/**

Wyświetl plik

@ -37,8 +37,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
// -----------------------------------------------------------------------------
// Select which T-Beam board is being used. Only uncomment one.
// #define T_BEAM_V10 // AKA Rev1 (second board released)
#define HELTEC_LORA32
#define T_BEAM_V10 // AKA Rev1 (second board released)
// #define HELTEC_LORA32
#define DEBUG_PORT Serial // Serial debug port
#define SERIAL_BAUD 115200 // Serial debug baud rate

Wyświetl plik

@ -79,7 +79,7 @@ void doDeepSleep(uint64_t msecToWake)
#ifdef T_BEAM_V10
if (axp192_found)
{
// turn on after initial testing with real hardware
axp.setChgLEDMode(AXP20X_LED_OFF); // turn off the AXP LED
// No need to turn this off if the power draw in sleep mode really is just 0.2uA and turning it off would
// leave floating input for the IRQ line
@ -360,7 +360,7 @@ void setup()
service.init();
BLEServer *serve = initBLE(getDeviceName()); // FIXME, use a real name based on the macaddr
BLEService *bts = createMeshBluetoothService(serve);
createMeshBluetoothService(serve);
}
void loop()
@ -370,11 +370,19 @@ void loop()
service.loop();
loopBLE();
static bool ledon;
ledon ^= 1;
#ifdef LED_PIN
// toggle the led so we can get some rough sense of how often loop is pausing
digitalWrite(LED_PIN, digitalRead(LED_PIN) ? 0 : 1);
digitalWrite(LED_PIN, ledon);
#endif
if(axp192_found) {
// blink the axp led
axp.setChgLEDMode(ledon ? AXP20X_LED_LOW_LEVEL : AXP20X_LED_OFF);
}
#ifdef BUTTON_PIN
// if user presses button for more than 3 secs, discard our network prefs and reboot (FIXME, use a debounce lib instead of this boilerplate)
static bool wasPressed = false;