Skip to content

Commit

Permalink
feat(underglow): Disable saving underglow state
Browse files Browse the repository at this point in the history
Half the flash saving functions are unnecessary and the other half are overridden anyway. This will save on flash wear
  • Loading branch information
ReFil committed Oct 20, 2023
1 parent b508919 commit 00483fe
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions app/src/rgb_underglow.c
Original file line number Diff line number Diff line change
Expand Up @@ -635,7 +635,6 @@ static int zmk_rgb_underglow_init(const struct device *_arg) {
k_work_init_delayable(&led_update_work, zmk_rgb_underglow_central_send);
#endif

zmk_rgb_underglow_save_state();
k_work_submit_to_queue(zmk_workqueue_lowprio_work_q(), &underglow_tick_work);
zmk_rgb_underglow_off();
if (IS_ENABLED(CONFIG_ZMK_RGB_UNDERGLOW_ON_START))
Expand Down Expand Up @@ -669,7 +668,7 @@ int zmk_rgb_underglow_on() {
state.animation_step = 0;
k_timer_start(&underglow_tick, K_NO_WAIT, K_MSEC(50));

return zmk_rgb_underglow_save_state();
return 0;
}

static void zmk_rgb_underglow_off_handler(struct k_work *work) {
Expand Down Expand Up @@ -700,7 +699,7 @@ int zmk_rgb_underglow_off() {
k_timer_stop(&underglow_tick);
state.on = false;

return zmk_rgb_underglow_save_state();
return 0;
}

int zmk_rgb_underglow_calc_effect(int direction) {
Expand All @@ -718,7 +717,7 @@ int zmk_rgb_underglow_select_effect(int effect) {
state.current_effect = effect;
state.animation_step = 0;

return zmk_rgb_underglow_save_state();
return 0;
}

int zmk_rgb_underglow_cycle_effect(int direction) {
Expand Down

0 comments on commit 00483fe

Please sign in to comment.