diff options
author | Drashna Jaelre <drashna@live.com> | 2022-02-06 14:01:04 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-02-06 22:01:04 +0000 |
commit | 9124f5dc2d2f17eb327924d38add7f194dd4d54a (patch) | |
tree | a53ab1c9d62be1fff6edf11b18a6acd3b56991e3 /quantum | |
parent | 3b60e71f07ac3a1ba8d46c3ecb9de8198ad9b945 (diff) | |
download | qmk_firmware-9124f5dc2d2f17eb327924d38add7f194dd4d54a.tar.gz qmk_firmware-9124f5dc2d2f17eb327924d38add7f194dd4d54a.zip |
Add layout change callbacks to VIA (#16087)
* Add layout change callbacks to VIA
* Update worklouder example
Diffstat (limited to 'quantum')
-rw-r--r-- | quantum/via.c | 4 | ||||
-rw-r--r-- | quantum/via.h | 1 |
2 files changed, 5 insertions, 0 deletions
diff --git a/quantum/via.c b/quantum/via.c index 7c8aa753e7..a3bd82d9b3 100644 --- a/quantum/via.c +++ b/quantum/via.c @@ -96,6 +96,7 @@ void via_init(void) { // Let keyboard level test EEPROM valid state, // but not set it valid, it is done here. via_init_kb(); + via_set_layout_options_kb(via_get_layout_options()); // If the EEPROM has the magic, the data is good. // OK to load from EEPROM. @@ -131,7 +132,10 @@ uint32_t via_get_layout_options(void) { return value; } +__attribute__((weak)) void via_set_layout_options_kb(uint32_t value) {} + void via_set_layout_options(uint32_t value) { + via_set_layout_options_kb(value); // Start at the least significant byte void *target = (void *)(VIA_EEPROM_LAYOUT_OPTIONS_ADDR + VIA_EEPROM_LAYOUT_OPTIONS_SIZE - 1); for (uint8_t i = 0; i < VIA_EEPROM_LAYOUT_OPTIONS_SIZE; i++) { diff --git a/quantum/via.h b/quantum/via.h index 3db318a454..5d16917dfa 100644 --- a/quantum/via.h +++ b/quantum/via.h @@ -159,6 +159,7 @@ void via_init(void); // Used by VIA to store and retrieve the layout options. uint32_t via_get_layout_options(void); void via_set_layout_options(uint32_t value); +void via_set_layout_options_kb(uint32_t value); // Called by QMK core to process VIA-specific keycodes. bool process_record_via(uint16_t keycode, keyrecord_t *record); |