From c27f16158d3f9524bb2d608ef4918783e7551637 Mon Sep 17 00:00:00 2001 From: Takeshi ISHII <2170248+mtei@users.noreply.github.com> Date: Thu, 28 Jan 2021 02:34:50 +0900 Subject: [PATCH 1/3] add get_matrix_scan_rate() to tmk_core/common/keyboard.c (#11489) --- common_features.mk | 2 ++ tmk_core/common/keyboard.c | 11 +++++++++-- tmk_core/common/keyboard.h | 2 ++ 3 files changed, 13 insertions(+), 2 deletions(-) diff --git a/common_features.mk b/common_features.mk index 8ac53ec45a..b9cd084d29 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/tmk_core/common/keyboard.c b/tmk_core/common/keyboard.c index 8c7bdc8b55..b35620e7fd 100644 --- a/tmk_core/common/keyboard.c +++ b/tmk_core/common/keyboard.c @@ -97,21 +97,28 @@ along with this program. If not, see . #endif // 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 d04e685cdb..70e8f7e2c7 100644 --- a/tmk_core/common/keyboard.h +++ b/tmk_core/common/keyboard.h @@ -73,6 +73,8 @@ void keyboard_post_init_user(void); void housekeeping_task_kb(void); void housekeeping_task_user(void); +uint32_t get_matrix_scan_rate(void); + #ifdef __cplusplus } #endif From 162842f16ee2e064f826712c3cd0c4d24445732e Mon Sep 17 00:00:00 2001 From: glanchow Date: Wed, 27 Jan 2021 18:39:58 +0100 Subject: [PATCH 2/3] [Docs] add qmk setup home parameter (#11451) --- docs/newbs_getting_started.md | 2 ++ 1 file changed, 2 insertions(+) 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. +?> The qmk home folder can be specified at setup with `qmk setup -H `, 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 /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 From bad9592a18494e3f678c2a117a526ca5f2f2280d Mon Sep 17 00:00:00 2001 From: Joshua Diamond Date: Wed, 27 Jan 2021 12:42:03 -0500 Subject: [PATCH 3/3] Add rgblight_reload_from_eeprom() (#11411) * Add rgblight_reset_from_eeprom() * reset->reload --- docs/feature_rgblight.md | 1 + quantum/rgblight.c | 11 +++++++++++ quantum/rgblight.h | 3 +++ 3 files changed, 15 insertions(+) diff --git a/docs/feature_rgblight.md b/docs/feature_rgblight.md index 0d3e666701..755fd769e6 100644 --- a/docs/feature_rgblight.md +++ b/docs/feature_rgblight.md @@ -361,6 +361,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/quantum/rgblight.c b/quantum/rgblight.c index d856f6d6c8..ac4ff9bfda 100644 --- a/quantum/rgblight.c +++ b/quantum/rgblight.c @@ -234,6 +234,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 efbffa7fdb..1854fee999 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);