Battery percentage display

This commit is contained in:
Klaus K Wilting committed 2020-04-11 21:30:09 +02:00
1 parent 90a004ec79
commit f4e8c67117
6 files changed
+76 -53

No files matched your search

+2 -2
View File
@@ -123,8 +123,8 @@ extern std::array<uint64_t, 0xff> beacons;
extern configData_t cfg; // current device configuration
extern char lmic_event_msg[LMIC_EVENTMSG_LEN]; // display buffer
extern uint8_t volatile channel; // wifi channel rotation counter
extern uint16_t volatile macs_total, macs_wifi, macs_ble,
batt_voltage; // display values
extern uint8_t batt_level; // display value
extern uint16_t volatile macs_total, macs_wifi, macs_ble; // display values
extern bool volatile TimePulseTick; // 1sec pps flag set by GPS or RTC
extern timesource_t timeSource;
extern hw_timer_t *displayIRQ, *matrixDisplayIRQ, *ppsIRQ;
+5 -1
View File
@@ -12,10 +12,14 @@
#define NO_OF_SAMPLES 64 // we do some multisampling to get better values
#ifndef BAT_MAX_VOLTAGE
#define BAT_MAX_VOLTAGE 4100 // millivolts
#define BAT_MAX_VOLTAGE 4200 // millivolts
#endif
#ifndef BAT_MIN_VOLTAGE
#define BAT_MIN_VOLTAGE 3100 // millivolts
#endif
uint16_t read_voltage(void);
uint8_t read_battlevel(void);
void calibrate_voltage(void);
bool batt_sufficient(void);