summaryrefslogtreecommitdiffstats
path: root/keyboards/keychron/bluetooth/battery.h
diff options
context:
space:
mode:
authorlokher <lokher@gmail.com>2023-01-12 15:50:37 +0800
committerlokher <lokher@gmail.com>2023-01-12 15:50:37 +0800
commita0d162e03ae1301c64a04b04264b53d0787c1358 (patch)
treeadb31f18f533845f83011de41423b1c01a511c1c /keyboards/keychron/bluetooth/battery.h
parentbbe437487d4da158376a9f55c589acebc3396ff0 (diff)
change battery voltage meause and battery low indication; update from latest chibios hal
Diffstat (limited to 'keyboards/keychron/bluetooth/battery.h')
-rw-r--r--keyboards/keychron/bluetooth/battery.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/keyboards/keychron/bluetooth/battery.h b/keyboards/keychron/bluetooth/battery.h
index 5d00a529c6..45de2bc23a 100644
--- a/keyboards/keychron/bluetooth/battery.h
+++ b/keyboards/keychron/bluetooth/battery.h
@@ -38,6 +38,14 @@ enum {
# define VOLTAGE_MEASURE_INTERVAL 3000
#endif
+#ifndef VOLTAGE_POWER_ON_MEASURE_COUNT
+# define VOLTAGE_POWER_ON_MEASURE_COUNT 15
+#endif
+
+#ifndef BACKLIGHT_OFF_VOLTAGE_MEASURE_INTERVAL
+# define BACKLIGHT_OFF_VOLTAGE_MEASURE_INTERVAL 200
+#endif
+
void battery_init(void);
void battery_measure(void);
void battery_calculte_voltage(uint16_t value);
@@ -47,5 +55,6 @@ uint8_t battery_get_percentage(void);
void indicator_battery_low_enable(bool enable);
bool battery_is_empty(void);
bool battery_is_critical_low(void);
+bool battery_power_on_sample(void);
void battery_task(void);