diff options
author | Nick Brassel <nick@tzarc.org> | 2021-01-28 10:52:59 +1100 |
---|---|---|
committer | Nick Brassel <nick@tzarc.org> | 2021-01-28 10:52:59 +1100 |
commit | d65db68f9f2614b91e3cb565086166b01400e473 (patch) | |
tree | 7477dbd7666a170444ffbf2ad29aa6d25189bf50 | |
parent | 99f3df28939d89b7fc2d2e7c0ee21b0879c7813f (diff) | |
parent | bad9592a18494e3f678c2a117a526ca5f2f2280d (diff) | |
download | qmk_firmware-d65db68f9f2614b91e3cb565086166b01400e473.tar.gz qmk_firmware-d65db68f9f2614b91e3cb565086166b01400e473.zip |
Merge remote-tracking branch 'upstream/master' into develop
-rw-r--r-- | common_features.mk | 2 | ||||
-rw-r--r-- | docs/feature_rgblight.md | 1 | ||||
-rw-r--r-- | docs/newbs_getting_started.md | 2 | ||||
-rw-r--r-- | quantum/rgblight.c | 11 | ||||
-rw-r--r-- | quantum/rgblight.h | 3 | ||||
-rw-r--r-- | tmk_core/common/keyboard.c | 11 | ||||
-rw-r--r-- | tmk_core/common/keyboard.h | 2 |
7 files changed, 30 insertions, 2 deletions
diff --git a/common_features.mk b/common_features.mk index 95b59937c..fa92a8482 100644 --- a/common_features.mk +++ b/common_features.mk | |||
@@ -24,6 +24,8 @@ QUANTUM_SRC += \ | |||
24 | ifeq ($(strip $(DEBUG_MATRIX_SCAN_RATE_ENABLE)), yes) | 24 | ifeq ($(strip $(DEBUG_MATRIX_SCAN_RATE_ENABLE)), yes) |
25 | OPT_DEFS += -DDEBUG_MATRIX_SCAN_RATE | 25 | OPT_DEFS += -DDEBUG_MATRIX_SCAN_RATE |
26 | CONSOLE_ENABLE = yes | 26 | CONSOLE_ENABLE = yes |
27 | else ifeq ($(strip $(DEBUG_MATRIX_SCAN_RATE_ENABLE)), api) | ||
28 | OPT_DEFS += -DDEBUG_MATRIX_SCAN_RATE | ||
27 | endif | 29 | endif |
28 | 30 | ||
29 | ifeq ($(strip $(API_SYSEX_ENABLE)), yes) | 31 | ifeq ($(strip $(API_SYSEX_ENABLE)), yes) |
diff --git a/docs/feature_rgblight.md b/docs/feature_rgblight.md index c49c308d1..b5a2b179d 100644 --- a/docs/feature_rgblight.md +++ b/docs/feature_rgblight.md | |||
@@ -370,6 +370,7 @@ rgblight_sethsv(HSV_GREEN, 2); // led 2 | |||
370 | |`rgblight_step_noeeprom()` |Change the mode to the next RGB animation in the list of enabled RGB animations (not written to EEPROM) | | 370 | |`rgblight_step_noeeprom()` |Change the mode to the next RGB animation in the list of enabled RGB animations (not written to EEPROM) | |
371 | |`rgblight_step_reverse()` |Change the mode to the previous RGB animation in the list of enabled RGB animations | | 371 | |`rgblight_step_reverse()` |Change the mode to the previous RGB animation in the list of enabled RGB animations | |
372 | |`rgblight_step_reverse_noeeprom()` |Change the mode to the previous RGB animation in the list of enabled RGB animations (not written to EEPROM) | | 372 | |`rgblight_step_reverse_noeeprom()` |Change the mode to the previous RGB animation in the list of enabled RGB animations (not written to EEPROM) | |
373 | |`rgblight_reload_from_eeprom()` |Reload the effect configuration (enabled, mode and color) from EEPROM | | ||
373 | 374 | ||
374 | #### effects mode disable/enable | 375 | #### effects mode disable/enable |
375 | |Function |Description | | 376 | |Function |Description | |
diff --git a/docs/newbs_getting_started.md b/docs/newbs_getting_started.md index 1c72911d9..3cb63e569 100644 --- a/docs/newbs_getting_started.md +++ b/docs/newbs_getting_started.md | |||
@@ -168,6 +168,8 @@ Once that completes, re-run `qmk setup` to complete the setup and checks. | |||
168 | 168 | ||
169 | <!-- tabs:end --> | 169 | <!-- tabs:end --> |
170 | 170 | ||
171 | ?> The qmk home folder can be specified at setup with `qmk setup -H <path>`, and modified afterwards using the [cli configuration](cli_configuration.md?id=single-key-example) and the variable `user.qmk_home`. For all available options run `qmk setup --help`. | ||
172 | |||
171 | ?> If you already know [how to use GitHub](getting_started_github.md), we recommend that you create your own fork and use `qmk setup <github_username>/qmk_firmware` to clone your personal fork. If you don't know what that means you can safely ignore this message. | 173 | ?> If you already know [how to use GitHub](getting_started_github.md), we recommend that you create your own fork and use `qmk setup <github_username>/qmk_firmware` to clone your personal fork. If you don't know what that means you can safely ignore this message. |
172 | 174 | ||
173 | ## 4. Test Your Build Environment | 175 | ## 4. Test Your Build Environment |
diff --git a/quantum/rgblight.c b/quantum/rgblight.c index 44e9eade5..7d7d015ba 100644 --- a/quantum/rgblight.c +++ b/quantum/rgblight.c | |||
@@ -237,6 +237,17 @@ void rgblight_init(void) { | |||
237 | is_rgblight_initialized = true; | 237 | is_rgblight_initialized = true; |
238 | } | 238 | } |
239 | 239 | ||
240 | void rgblight_reload_from_eeprom(void) { | ||
241 | /* Reset back to what we have in eeprom */ | ||
242 | rgblight_config.raw = eeconfig_read_rgblight(); | ||
243 | RGBLIGHT_SPLIT_SET_CHANGE_MODEHSVS; | ||
244 | rgblight_check_config(); | ||
245 | eeconfig_debug_rgblight(); // display current eeprom values | ||
246 | if (rgblight_config.enable) { | ||
247 | rgblight_mode_noeeprom(rgblight_config.mode); | ||
248 | } | ||
249 | } | ||
250 | |||
240 | uint32_t rgblight_read_dword(void) { return rgblight_config.raw; } | 251 | uint32_t rgblight_read_dword(void) { return rgblight_config.raw; } |
241 | 252 | ||
242 | void rgblight_update_dword(uint32_t dword) { | 253 | void rgblight_update_dword(uint32_t dword) { |
diff --git a/quantum/rgblight.h b/quantum/rgblight.h index b9306e4d2..028b3ea41 100644 --- a/quantum/rgblight.h +++ b/quantum/rgblight.h | |||
@@ -347,6 +347,9 @@ uint8_t rgblight_get_speed(void); | |||
347 | void rgblight_set_speed(uint8_t speed); | 347 | void rgblight_set_speed(uint8_t speed); |
348 | void rgblight_set_speed_noeeprom(uint8_t speed); | 348 | void rgblight_set_speed_noeeprom(uint8_t speed); |
349 | 349 | ||
350 | /* reset */ | ||
351 | void rgblight_reload_from_eeprom(void); | ||
352 | |||
350 | /* query */ | 353 | /* query */ |
351 | uint8_t rgblight_get_mode(void); | 354 | uint8_t rgblight_get_mode(void); |
352 | uint8_t rgblight_get_hue(void); | 355 | uint8_t rgblight_get_hue(void); |
diff --git a/tmk_core/common/keyboard.c b/tmk_core/common/keyboard.c index 0ca454612..1250c45ae 100644 --- a/tmk_core/common/keyboard.c +++ b/tmk_core/common/keyboard.c | |||
@@ -112,21 +112,28 @@ uint32_t last_encoder_activity_elapsed(void) { return timer_elapsed32(las | |||
112 | void last_encoder_activity_trigger(void) { last_encoder_modification_time = last_input_modification_time = timer_read32(); } | 112 | void last_encoder_activity_trigger(void) { last_encoder_modification_time = last_input_modification_time = timer_read32(); } |
113 | 113 | ||
114 | // Only enable this if console is enabled to print to | 114 | // Only enable this if console is enabled to print to |
115 | #if defined(DEBUG_MATRIX_SCAN_RATE) && defined(CONSOLE_ENABLE) | 115 | #if defined(DEBUG_MATRIX_SCAN_RATE) |
116 | static uint32_t matrix_timer = 0; | 116 | static uint32_t matrix_timer = 0; |
117 | static uint32_t matrix_scan_count = 0; | 117 | static uint32_t matrix_scan_count = 0; |
118 | static uint32_t last_matrix_scan_count = 0; | ||
118 | 119 | ||
119 | void matrix_scan_perf_task(void) { | 120 | void matrix_scan_perf_task(void) { |
120 | matrix_scan_count++; | 121 | matrix_scan_count++; |
121 | 122 | ||
122 | uint32_t timer_now = timer_read32(); | 123 | uint32_t timer_now = timer_read32(); |
123 | if (TIMER_DIFF_32(timer_now, matrix_timer) > 1000) { | 124 | if (TIMER_DIFF_32(timer_now, matrix_timer) > 1000) { |
125 | # if defined(CONSOLE_ENABLE) | ||
124 | dprintf("matrix scan frequency: %d\n", matrix_scan_count); | 126 | dprintf("matrix scan frequency: %d\n", matrix_scan_count); |
125 | 127 | # endif | |
128 | last_matrix_scan_count = matrix_scan_count; | ||
126 | matrix_timer = timer_now; | 129 | matrix_timer = timer_now; |
127 | matrix_scan_count = 0; | 130 | matrix_scan_count = 0; |
128 | } | 131 | } |
129 | } | 132 | } |
133 | |||
134 | uint32_t get_matrix_scan_rate(void) { | ||
135 | return last_matrix_scan_count; | ||
136 | } | ||
130 | #else | 137 | #else |
131 | # define matrix_scan_perf_task() | 138 | # define matrix_scan_perf_task() |
132 | #endif | 139 | #endif |
diff --git a/tmk_core/common/keyboard.h b/tmk_core/common/keyboard.h index 88b3896e9..eaf74bac5 100644 --- a/tmk_core/common/keyboard.h +++ b/tmk_core/common/keyboard.h | |||
@@ -82,6 +82,8 @@ uint32_t last_matrix_activity_elapsed(void); // Number of milliseconds since th | |||
82 | uint32_t last_encoder_activity_time(void); // Timestamp of the last encoder activity | 82 | uint32_t last_encoder_activity_time(void); // Timestamp of the last encoder activity |
83 | uint32_t last_encoder_activity_elapsed(void); // Number of milliseconds since the last encoder activity | 83 | uint32_t last_encoder_activity_elapsed(void); // Number of milliseconds since the last encoder activity |
84 | 84 | ||
85 | uint32_t get_matrix_scan_rate(void); | ||
86 | |||
85 | #ifdef __cplusplus | 87 | #ifdef __cplusplus |
86 | } | 88 | } |
87 | #endif | 89 | #endif |