diff options
| author | Drashna Jaelre <drashna@live.com> | 2018-12-01 08:21:06 -0800 |
|---|---|---|
| committer | MechMerlin <30334081+mechmerlin@users.noreply.github.com> | 2018-12-01 08:21:06 -0800 |
| commit | 75a51659abfbc68874f2e9326f0adf1258fc5458 (patch) | |
| tree | 217221b3cd4eec84a416f781c32e401bcbe6f896 /docs/faq_keymap.md | |
| parent | 5803012eda70d2ad85434e53820f2c93c310f92e (diff) | |
| download | qmk_firmware-75a51659abfbc68874f2e9326f0adf1258fc5458.tar.gz qmk_firmware-75a51659abfbc68874f2e9326f0adf1258fc5458.zip | |
Add tap_random_base64 and software timer info to Useful Functions doc (#4360)
* Update docs
* Add security caveat
Co-Authored-By: drashna <drashna@live.com>
* Wordsmithing
Co-Authored-By: drashna <drashna@live.com>
* Update docs/ref_functions.md
Co-Authored-By: drashna <drashna@live.com>
Diffstat (limited to 'docs/faq_keymap.md')
| -rw-r--r-- | docs/faq_keymap.md | 17 |
1 files changed, 0 insertions, 17 deletions
diff --git a/docs/faq_keymap.md b/docs/faq_keymap.md index 4e842d363..ae01e9387 100644 --- a/docs/faq_keymap.md +++ b/docs/faq_keymap.md | |||
| @@ -211,20 +211,3 @@ here real_mods lost state for 'physical left shift'. | |||
| 211 | 211 | ||
| 212 | weak_mods is ORed with real_mods when keyboard report is sent. | 212 | weak_mods is ORed with real_mods when keyboard report is sent. |
| 213 | https://github.com/tmk/tmk_core/blob/master/common/action_util.c#L57 | 213 | https://github.com/tmk/tmk_core/blob/master/common/action_util.c#L57 |
| 214 | |||
| 215 | ## Timer Functionality | ||
| 216 | |||
| 217 | It's possible to start timers and read values for time-specific events - here's an example: | ||
| 218 | |||
| 219 | ```c | ||
| 220 | static uint16_t key_timer; | ||
| 221 | key_timer = timer_read(); | ||
| 222 | |||
| 223 | if (timer_elapsed(key_timer) < 100) { | ||
| 224 | // do something if less than 100ms have passed | ||
| 225 | } else { | ||
| 226 | // do something if 100ms or more have passed | ||
| 227 | } | ||
| 228 | ``` | ||
| 229 | |||
| 230 | It's best to declare the `static uint16_t key_timer;` at the top of the file, outside of any code blocks you're using it in. | ||
