diff options
-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 95b59937cd..fa92a8482f 100644 --- a/common_features.mk +++ b/common_features.mk @@ -24,6 +24,8 @@ QUANTUM_SRC += \ ifeq ($(strip $(DEBUG_MATRIX_SCAN_RATE_ENABLE)), yes) OPT_DEFS += -DDEBUG_MATRIX_SCAN_RATE CONSOLE_ENABLE = yes +else ifeq ($(strip $(DEBUG_MATRIX_SCAN_RATE_ENABLE)), api) + OPT_DEFS += -DDEBUG_MATRIX_SCAN_RATE endif ifeq ($(strip $(API_SYSEX_ENABLE)), yes) diff --git a/docs/feature_rgblight.md b/docs/feature_rgblight.md index c49c308d1e..b5a2b179d6 100644 --- a/docs/feature_rgblight.md +++ b/docs/feature_rgblight.md @@ -370,6 +370,7 @@ rgblight_sethsv(HSV_GREEN, 2); // led 2 |`rgblight_step_noeeprom()` |Change the mode to the next RGB animation in the list of enabled RGB animations (not written to EEPROM) | |`rgblight_step_reverse()` |Change the mode to the previous RGB animation in the list of enabled RGB animations | |`rgblight_step_reverse_noeeprom()` |Change the mode to the previous RGB animation in the list of enabled RGB animations (not written to EEPROM) | +|`rgblight_reload_from_eeprom()` |Reload the effect configuration (enabled, mode and color) from EEPROM | #### effects mode disable/enable |Function |Description | diff --git a/docs/newbs_getting_started.md b/docs/newbs_getting_started.md index 1c72911d92..3cb63e5692 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. <!-- tabs:end --> +?> 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`. + ?> 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. ## 4. Test Your Build Environment diff --git a/quantum/rgblight.c b/quantum/rgblight.c index 44e9eade53..7d7d015ba0 100644 --- a/quantum/rgblight.c +++ b/quantum/rgblight.c @@ -237,6 +237,17 @@ void rgblight_init(void) { is_rgblight_initialized = true; } +void rgblight_reload_from_eeprom(void) { + /* Reset back to what we have in eeprom */ + rgblight_config.raw = eeconfig_read_rgblight(); + RGBLIGHT_SPLIT_SET_CHANGE_MODEHSVS; + rgblight_check_config(); + eeconfig_debug_rgblight(); // display current eeprom values + if (rgblight_config.enable) { + rgblight_mode_noeeprom(rgblight_config.mode); + } +} + uint32_t rgblight_read_dword(void) { return rgblight_config.raw; } void rgblight_update_dword(uint32_t dword) { diff --git a/quantum/rgblight.h b/quantum/rgblight.h index b9306e4d2c..028b3ea416 100644 --- a/quantum/rgblight.h +++ b/quantum/rgblight.h @@ -347,6 +347,9 @@ uint8_t rgblight_get_speed(void); void rgblight_set_speed(uint8_t speed); void rgblight_set_speed_noeeprom(uint8_t speed); +/* reset */ +void rgblight_reload_from_eeprom(void); + /* query */ uint8_t rgblight_get_mode(void); uint8_t rgblight_get_hue(void); diff --git a/tmk_core/common/keyboard.c b/tmk_core/common/keyboard.c index 0ca4546128..1250c45aec 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 void last_encoder_activity_trigger(void) { last_encoder_modification_time = last_input_modification_time = timer_read32(); } // Only enable this if console is enabled to print to -#if defined(DEBUG_MATRIX_SCAN_RATE) && defined(CONSOLE_ENABLE) +#if defined(DEBUG_MATRIX_SCAN_RATE) static uint32_t matrix_timer = 0; static uint32_t matrix_scan_count = 0; +static uint32_t last_matrix_scan_count = 0; void matrix_scan_perf_task(void) { matrix_scan_count++; uint32_t timer_now = timer_read32(); if (TIMER_DIFF_32(timer_now, matrix_timer) > 1000) { +# if defined(CONSOLE_ENABLE) dprintf("matrix scan frequency: %d\n", matrix_scan_count); - +# endif + last_matrix_scan_count = matrix_scan_count; matrix_timer = timer_now; matrix_scan_count = 0; } } + +uint32_t get_matrix_scan_rate(void) { + return last_matrix_scan_count; +} #else # define matrix_scan_perf_task() #endif diff --git a/tmk_core/common/keyboard.h b/tmk_core/common/keyboard.h index 88b3896e9e..eaf74bac58 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 uint32_t last_encoder_activity_time(void); // Timestamp of the last encoder activity uint32_t last_encoder_activity_elapsed(void); // Number of milliseconds since the last encoder activity +uint32_t get_matrix_scan_rate(void); + #ifdef __cplusplus } #endif |