1 #include "promethium.h"
6 float battery_percentage(void) {
7 float voltage = analogRead(BATTERY_PIN) * 2 * 3.3 / 1024;
8 float percentage = (voltage - 3.5) * 143;
9 if (percentage > 100) {
11 } else if (percentage < 0) {
18 __attribute__ ((weak))
19 void battery_poll(float percentage) {
22 void matrix_init_kb(void) {
26 void matrix_scan_kb(void) {
27 static uint16_t counter = BATTERY_POLL;
30 if (counter > BATTERY_POLL) {
32 battery_poll(battery_percentage());