From e5540dd055b16eaebb28e25e0cb9b314e397e854 Mon Sep 17 00:00:00 2001 From: Drashna Jaelre Date: Wed, 2 May 2018 08:39:46 -0700 Subject: Update to drashna keymaps and userspace (#2876) * Fix Unicode sample * Add irony mark * Remove unpretty keymaps * Add QMK DFU and Conditional Music Mode * Unicode fixes * Unicode fixes * Make layer indication more modular * Finish removing Faux Click * Cleanup of UserSpace and addition of 'update_tri_layer_state' function * Add modifier status indicators to Orthodox * Remove tri layer function * Minor tweaks * Remove the Orthodox's Indicator's reliance on layer_state_set * Add custom EEPROM settings * Make EEPROM config more efficient * Viterbi Config * Add Iris Keyboard layout and Userspace cleanup * Iris keyboard tweaks * Use Grave Escape on Iris * Update Readmes --- users/drashna/readme.md | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) (limited to 'users/drashna/readme.md') diff --git a/users/drashna/readme.md b/users/drashna/readme.md index c4e305e15..79758e7e5 100644 --- a/users/drashna/readme.md +++ b/users/drashna/readme.md @@ -146,3 +146,31 @@ endif ``` Then, if you run `make keyboard:name NO_SECRETS=yes`, it will default to the test strings in your `.c` file, rather than reading from your file. + + +Userspace EEPROM config +----------------------- + +This adds EEPROM support fo the userspace, so that certain values are configurable in such a way that persists when power is lost. Namely, just the clicky feature and the Overwatch macro option ("is_overwatch"). This is done by reading and saving the structure from EEPROM. + +To implement this, first you need to specify the location: + +```c +#define EECONFIG_USERSPACE (uint8_t *)20 +``` +This tells us where in the EEPROM that the data structure is located, and this specifies that it's a byte (8 bits). However, to maximize it's usage, we want to specify a data structure here, so that we can use multiple settings. To do that: + +```c +typedef union { + uint32_t raw; + struct { + bool clicky_enable :1; + bool is_overwatch :1; + }; +} userspace_config_t; +``` +Then, in your C file, you want to add: `userspace_config_t userspace_config;`, and in your `matrix_init_*` function, you want to add `userspace_config.raw = eeprom_read_byte(EECONFIG_USERSPACE);` + +From there, you'd want to use the data structure (such as `userspace_config.is_overwatch`) when you want to check this value. + +And if you want to update it, update directly and then use `eeprom_update_byte(EECONFIG_USERSPACE, userspace_config.raw);` to write the value back to the EEPROM. -- cgit v1.2.3