#pragma once #include "board.h" #include "Arduino.h" #include "JC_Button.h" #include "sensor.h" #include "audio.h" #include "ota.h" #include "led.h" #define TIMEOUT_POWER (7 * 1000 * 60) // 7 minutes timeout #define POWERBUTTONDELAY 1000 //#define BATTERYMEASUREDELAY 60000 #define POWERBUTTONOTADELAY 7000 #define POWEROFFOFFDELAY 3000 typedef enum { off, poweringOn, poweringOn2, powerinit, on, poweringOff, poweringOff2, timeOut, lowBatt, overTheAir, overTheAir2 } POWERSTATES; POWERSTATES getPowerState( void ); void PowerKeepAlive(void); void initBattery(void); bool handleBattery(void); Button* getPowerButton(); void initPower(void); void handlePower(void);