summaryrefslogtreecommitdiff
path: root/users/drashna/readme.md
diff options
context:
space:
mode:
authorDrashna Jaelre <drashna@live.com>2018-05-02 08:39:46 -0700
committerJack Humbert <jack.humb@gmail.com>2018-05-02 11:39:46 -0400
commite5540dd055b16eaebb28e25e0cb9b314e397e854 (patch)
tree798a05c6335c11ad55231337883003ea248b4df9 /users/drashna/readme.md
parent9b8fc6f1c0129ee119965a2a4d025b0f5c9c613b (diff)
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
Diffstat (limited to 'users/drashna/readme.md')
-rw-r--r--users/drashna/readme.md28
1 files changed, 28 insertions, 0 deletions
diff --git a/users/drashna/readme.md b/users/drashna/readme.md
index c4e305e15b..79758e7e56 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 `<name>.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.