diff options
author | lokher <lokher@gmail.com> | 2022-12-06 17:10:48 +0800 |
---|---|---|
committer | lokher <lokher@gmail.com> | 2022-12-07 15:50:49 +0800 |
commit | a336c2c5005251e4cb0f3a62ccabdb4cfccad915 (patch) | |
tree | 3c948b631a5e3b6f940dabe02fad3c7487e6f350 /keyboards/handwired/promethium/promethium.c | |
parent | 27fc28fd2ff52e079a5bc58d6aaea4c752420615 (diff) |
Merge upstream master to 2022 Q4 breaking change
Diffstat (limited to 'keyboards/handwired/promethium/promethium.c')
-rw-r--r-- | keyboards/handwired/promethium/promethium.c | 30 |
1 files changed, 0 insertions, 30 deletions
diff --git a/keyboards/handwired/promethium/promethium.c b/keyboards/handwired/promethium/promethium.c deleted file mode 100644 index e9df7dfe87..0000000000 --- a/keyboards/handwired/promethium/promethium.c +++ /dev/null @@ -1,30 +0,0 @@ -#include "promethium.h" -#include "analog.h" -#include "timer.h" -#include "matrix.h" -#include "bluefruit_le.h" - -// cubic fit {3.3, 0}, {3.5, 2.9}, {3.6, 5}, {3.7, 8.6}, {3.8, 36}, {3.9, 62}, {4.0, 73}, {4.05, 83}, {4.1, 89}, {4.15, 94}, {4.2, 100} - -uint8_t battery_level(void) { - float voltage = bluefruit_le_read_battery_voltage() * 2 * 3.3 / 1024; - if (voltage < MIN_VOLTAGE) return 0; - if (voltage > MAX_VOLTAGE) return 255; - return (voltage - MIN_VOLTAGE) / (MAX_VOLTAGE - MIN_VOLTAGE) * 255; -} - -__attribute__ ((weak)) -void battery_poll(uint8_t level) { -} - -void matrix_scan_kb(void) { - static uint16_t counter = BATTERY_POLL; - counter++; - - if (counter > BATTERY_POLL) { - counter = 0; - battery_poll(battery_level()); - } - - matrix_scan_user(); -} |