diff options
author | Drashna Jael're <drashna@live.com> | 2020-04-24 19:10:28 -0700 |
---|---|---|
committer | Florian Didron <fdidron@users.noreply.github.com> | 2020-06-02 16:22:32 +0900 |
commit | 4e98025d2eadfdedc28952460905be60f78f8675 (patch) | |
tree | 75780f138c4a7c09fdf4b7ee3600f1b31d37bb5c | |
parent | f6949c1eaca260731d4b01d931d5fcdeff1f06ab (diff) |
Enable LED Blinking for Dynamic Macro Recording status for Planck EZ
-rw-r--r-- | keyboards/planck/ez/ez.c | 37 |
1 files changed, 36 insertions, 1 deletions
diff --git a/keyboards/planck/ez/ez.c b/keyboards/planck/ez/ez.c index 2fd462548c..3855622481 100644 --- a/keyboards/planck/ez/ez.c +++ b/keyboards/planck/ez/ez.c @@ -328,8 +328,26 @@ bool music_mask_kb(uint16_t keycode) { #ifdef ORYX_ENABLE static uint16_t loops = 0; static bool is_on = false; +#endif + +#ifdef DYNAMIC_MACRO_ENABLE +static bool is_dynamic_recording = false; +static uint16_t dynamic_loop_timer; + +void dynamic_macro_record_start_user(void) { + is_dynamic_recording = true; + dynamic_loop_timer = timer_read(); + planck_ez_left_led_on(); +} + +void dynamic_macro_record_end_user(int8_t direction) { + is_dynamic_recording = false; + layer_state_set_kb(layer_state); +} +#endif void matrix_scan_kb(void) { +#ifdef ORYX_ENABLE if(webusb_state.pairing == true) { if(loops == 0) { //lights off @@ -358,5 +376,22 @@ void matrix_scan_kb(void) { planck_ez_left_led_off(); planck_ez_right_led_off(); } -} #endif +#ifdef DYNAMIC_MACRO_ENABLE + if (is_dynamic_recording) { + if (timer_elapsed(dynamic_loop_timer) > 1) + { + static uint8_t counter; + counter++; + if (counter > 100) { + planck_ez_left_led_on(); + } else { + planck_ez_left_led_off(); + + } + dynamic_loop_timer = timer_read(); + } + } +#endif + matrix_scan_user(); +} |