From a173eda6d28bd09b2d59448a6532edb7a6c8e358 Mon Sep 17 00:00:00 2001 From: Wilba6582 Date: Fri, 28 Sep 2018 14:09:14 +1000 Subject: Improved dynamic keymaps (#3972) * Improved dynamic keymaps * K&R sucks --- keyboards/zeal60/zeal60.c | 9 ++++----- keyboards/zeal60/zeal60_api.h | 2 +- 2 files changed, 5 insertions(+), 6 deletions(-) (limited to 'keyboards/zeal60') diff --git a/keyboards/zeal60/zeal60.c b/keyboards/zeal60/zeal60.c index e516c4dbfc..092235ca61 100644 --- a/keyboards/zeal60/zeal60.c +++ b/keyboards/zeal60/zeal60.c @@ -81,9 +81,9 @@ void raw_hid_receive( uint8_t *data, uint8_t length ) dynamic_keymap_set_keycode( command_data[0], command_data[1], command_data[2], ( command_data[3] << 8 ) | command_data[4] ); break; } - case id_dynamic_keymap_clear_all: + case id_dynamic_keymap_reset: { - dynamic_keymap_clear_all(); + dynamic_keymap_reset(); break; } #endif // DYNAMIC_KEYMAP_ENABLE @@ -171,9 +171,8 @@ void matrix_init_kb(void) #endif // RGB_BACKLIGHT_ENABLED #ifdef DYNAMIC_KEYMAP_ENABLE - // This saves "empty" keymaps so it falls back to the keymaps - // in the firmware (aka. progmem/flash) - dynamic_keymap_clear_all(); + // This resets the keymaps in EEPROM to what is in flash. + dynamic_keymap_reset(); #endif // Save the magic number last, in case saving was interrupted diff --git a/keyboards/zeal60/zeal60_api.h b/keyboards/zeal60/zeal60_api.h index baa8ac09f8..eaac3ad7ce 100644 --- a/keyboards/zeal60/zeal60_api.h +++ b/keyboards/zeal60/zeal60_api.h @@ -24,7 +24,7 @@ enum zeal60_command_id id_set_keyboard_value, id_dynamic_keymap_get_keycode, id_dynamic_keymap_set_keycode, - id_dynamic_keymap_clear_all, + id_dynamic_keymap_reset, id_backlight_config_set_value, id_backlight_config_get_value, id_backlight_config_save, -- cgit v1.2.3