diff options
author | Priyadi Iman Nurcahyo <priyadi@priyadi.net> | 2017-02-10 21:28:46 +0700 |
---|---|---|
committer | Priyadi Iman Nurcahyo <priyadi@priyadi.net> | 2017-02-10 21:28:46 +0700 |
commit | 5944ab246a981d6ceca94b0972345277a746c2d3 (patch) | |
tree | 01c240c2dd6a39cc44157e51287a7b194c6b4017 /keyboards/handwired/promethium/keymaps/priyadi | |
parent | 07879bf66b29535214a147b1797f96767b1faa58 (diff) |
Implement battery level indicator
Diffstat (limited to 'keyboards/handwired/promethium/keymaps/priyadi')
-rw-r--r-- | keyboards/handwired/promethium/keymaps/priyadi/keymap.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/keyboards/handwired/promethium/keymaps/priyadi/keymap.c b/keyboards/handwired/promethium/keymaps/priyadi/keymap.c index 65fa14dd35..469d7a5d80 100644 --- a/keyboards/handwired/promethium/keymaps/priyadi/keymap.c +++ b/keyboards/handwired/promethium/keymaps/priyadi/keymap.c @@ -25,6 +25,7 @@ enum glow_modes { GLOW_MIN, GLOW_FULL }; + uint8_t glow_mode = GLOW_MIN; extern keymap_config_t keymap_config; @@ -505,11 +506,6 @@ void led_init(void) { rgbsps_set(LED_TRACKPOINT2, 0, 0, 15); rgbsps_set(LED_TRACKPOINT3, 15, 0, 0); - // // hardcode indicator for now - rgbsps_set(LED_IND_BLUETOOTH, 0, 0, 15); - rgbsps_set(LED_IND_USB, 15, 15, 15); - rgbsps_set(LED_IND_BATTERY, 0, 15, 0); - led_layer_normal(); } @@ -996,6 +992,11 @@ void matrix_init_user(void) { } } +void battery_poll(float percentage) { + rgbsps_sethsv(LED_IND_BATTERY, percentage*120/100, 255, 15); + rgbsps_send(); +} + void ps2_mouse_init_user() { uint8_t rcv; |