34 lines
531 B
C
34 lines
531 B
C
#pragma once
|
|
|
|
#include "board.h"
|
|
#include "Arduino.h"
|
|
#include "JC_Button.h"
|
|
#include "Battery.h"
|
|
#include "sensor.h"
|
|
#include "audio.h"
|
|
|
|
|
|
#define TIMEOUT_POWER (5 * 1000 * 60) //5minutes timeout
|
|
#define POWERBUTTONDELAY 1000
|
|
#define BATTERYMEASUREDELAY 60000
|
|
|
|
typedef enum
|
|
{
|
|
off,
|
|
poweringOn,
|
|
poweringOn2,
|
|
powerinit,
|
|
on,
|
|
poweringOff,
|
|
poweringOff2,
|
|
timeOut,
|
|
lowBatt
|
|
} POWERSTATES;
|
|
|
|
POWERSTATES getPowerState( void );
|
|
|
|
void initBattery(void);
|
|
bool handleBattery(void);
|
|
|
|
void initPower(void);
|
|
void handlePower(void); |