From 5d771ca9332245c30e1c75439b207810713d2d12 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Konstantin=20=C4=90or=C4=91evi=C4=87?= Date: Tue, 23 Oct 2018 19:35:24 +0200 Subject: [PATCH] Add an option for making cycle changes persistent --- quantum/process_keycode/process_unicode_common.c | 3 +++ quantum/process_keycode/process_unicode_common.h | 5 +++++ 2 files changed, 8 insertions(+) diff --git a/quantum/process_keycode/process_unicode_common.c b/quantum/process_keycode/process_unicode_common.c index a9fbd11b0f4..af37f12fc64 100644 --- a/quantum/process_keycode/process_unicode_common.c +++ b/quantum/process_keycode/process_unicode_common.c @@ -65,6 +65,9 @@ void cycle_unicode_input_mode(void) { unicode_input_mode_init(); // Init selected_index selected_index = (selected_index + 1) % selected_count; input_mode = selected[selected_index]; +# if UNICODE_CYCLE_PERSIST + eeprom_update_byte(EECONFIG_UNICODEMODE, input_mode); +# endif #endif } diff --git a/quantum/process_keycode/process_unicode_common.h b/quantum/process_keycode/process_unicode_common.h index 390d6b5e819..0d4830958bb 100644 --- a/quantum/process_keycode/process_unicode_common.h +++ b/quantum/process_keycode/process_unicode_common.h @@ -25,6 +25,11 @@ #define UNICODE_SELECTED_MODES -1 #endif +// Whether input mode changes in cycle should be written to EEPROM +#ifndef UNICODE_CYCLE_PERSIST +#define UNICODE_CYCLE_PERSIST true +#endif + #ifndef UNICODE_TYPE_DELAY #define UNICODE_TYPE_DELAY 10 #endif