From a0d162e03ae1301c64a04b04264b53d0787c1358 Mon Sep 17 00:00:00 2001 From: lokher Date: Thu, 12 Jan 2023 15:50:37 +0800 Subject: change battery voltage meause and battery low indication; update from latest chibios hal --- keyboards/keychron/bluetooth/indicator.h | 32 ++++++++++++++++++++++++++++++-- 1 file changed, 30 insertions(+), 2 deletions(-) (limited to 'keyboards/keychron/bluetooth/indicator.h') diff --git a/keyboards/keychron/bluetooth/indicator.h b/keyboards/keychron/bluetooth/indicator.h index 17bda1e65a..bf408a0c1c 100644 --- a/keyboards/keychron/bluetooth/indicator.h +++ b/keyboards/keychron/bluetooth/indicator.h @@ -49,8 +49,30 @@ # define CONNECTED_BACKLIGHT_OFF_DELAY_TIME 600 #endif -#ifndef LOW_BAT_ON_OFF_DURATION -# define LOW_BAT_ON_OFF_DURATION 1000 +#ifdef BAT_LOW_LED_PIN +/* Uint: ms */ +# ifndef LOW_BAT_LED_BLINK_PERIOD +# define LOW_BAT_LED_BLINK_PERIOD 1000 +# endif + +# ifndef LOW_BAT_LED_BLINK_DURATION +# define LOW_BAT_LED_BLINK_DURATION 10000 +# endif +#endif + +#ifdef LOW_BAT_IND_INDEX +/* Uint: ms */ +# ifndef LOW_BAT_LED_BLINK_PERIOD +# define LOW_BAT_LED_BLINK_PERIOD 500 +# endif + +# ifndef LOW_BAT_LED_BLINK_TIMES +# define LOW_BAT_LED_BLINK_TIMES 3 +# endif + +# ifndef LOW_BAT_LED_TRIG_INTERVAL +# define LOW_BAT_LED_TRIG_INTERVAL 30000 +# endif #endif #if BT_HOST_MAX_COUNT > 6 @@ -82,8 +104,14 @@ void indicator_enable(void); void indicator_disable(void); void indicator_stop(void); void indicator_eeconfig_reload(void); +bool indicator_is_enabled(void); bool indicator_is_running(void); +#ifdef BAT_LOW_LED_PIN void indicator_battery_low_enable(bool enable); +#endif +#if defined(LOW_BAT_IND_INDEX) +void indicator_battery_low_backlit_enable(bool enable); +#endif void indicator_task(void); -- cgit v1.2.3