aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJames Young <18669334+noroadsleft@users.noreply.github.com>2021-05-29 13:53:10 -0700
committerJames Young <18669334+noroadsleft@users.noreply.github.com>2021-05-29 13:53:10 -0700
commit7d1194de01ea94f065bd5176607b4d66279ef51b (patch)
tree337ab0498a929285a234518fee34a4d9dcf51656
parente628051505cca7674c37b417ba91af1c69dbbd86 (diff)
downloadqmk_firmware-7d1194de01ea94f065bd5176607b4d66279ef51b.tar.gz
qmk_firmware-7d1194de01ea94f065bd5176607b4d66279ef51b.zip
run: qmk cformat --core-only
-rw-r--r--drivers/chibios/analog.c2
-rw-r--r--drivers/chibios/serial_usart.h20
-rw-r--r--quantum/led_matrix_animations/alpha_mods_anim.h2
-rw-r--r--quantum/led_matrix_animations/band_anim.h6
-rw-r--r--quantum/led_matrix_animations/band_pinwheel_anim.h10
-rw-r--r--quantum/led_matrix_animations/band_spiral_anim.h10
-rw-r--r--quantum/led_matrix_animations/breathing_anim.h2
-rw-r--r--quantum/led_matrix_animations/cycle_left_right_anim.h10
-rw-r--r--quantum/led_matrix_animations/cycle_out_in_anim.h10
-rw-r--r--quantum/led_matrix_animations/cycle_up_down_anim.h10
-rw-r--r--quantum/led_matrix_animations/dual_beacon_anim.h10
-rw-r--r--quantum/led_matrix_animations/solid_reactive_cross.h12
-rw-r--r--quantum/led_matrix_animations/solid_reactive_nexus.h12
-rw-r--r--quantum/led_matrix_animations/solid_reactive_simple_anim.h12
-rw-r--r--quantum/led_matrix_animations/solid_reactive_wide.h12
-rw-r--r--quantum/led_matrix_animations/solid_splash_anim.h12
-rw-r--r--quantum/led_matrix_animations/wave_left_right_anim.h10
-rw-r--r--quantum/led_matrix_animations/wave_up_down_anim.h10
-rw-r--r--quantum/led_matrix_drivers.c2
-rw-r--r--quantum/quantum_keycodes.h12
-rw-r--r--quantum/rgb_matrix_drivers.c6
-rw-r--r--quantum/rgblight.c8
-rw-r--r--quantum/split_common/transport.c34
-rw-r--r--tmk_core/common/action.c83
-rw-r--r--tmk_core/common/action.h2
-rw-r--r--tmk_core/common/chibios/sleep_led.c4
-rw-r--r--tmk_core/common/keyboard.h6
27 files changed, 139 insertions, 190 deletions
diff --git a/drivers/chibios/analog.c b/drivers/chibios/analog.c
index b1081623d..8c476fcac 100644
--- a/drivers/chibios/analog.c
+++ b/drivers/chibios/analog.c
@@ -123,7 +123,7 @@ static ADCConversionGroup adcConversionGroup = {
123 .smpr = ADC_SAMPLING_RATE, 123 .smpr = ADC_SAMPLING_RATE,
124#elif defined(USE_ADCV2) 124#elif defined(USE_ADCV2)
125# if !defined(STM32F1XX) 125# if !defined(STM32F1XX)
126 .cr2 = ADC_CR2_SWSTART, // F103 seem very unhappy with, F401 seems very unhappy without... 126 .cr2 = ADC_CR2_SWSTART, // F103 seem very unhappy with, F401 seems very unhappy without...
127# endif 127# endif
128 .smpr2 = ADC_SMPR2_SMP_AN0(ADC_SAMPLING_RATE) | ADC_SMPR2_SMP_AN1(ADC_SAMPLING_RATE) | ADC_SMPR2_SMP_AN2(ADC_SAMPLING_RATE) | ADC_SMPR2_SMP_AN3(ADC_SAMPLING_RATE) | ADC_SMPR2_SMP_AN4(ADC_SAMPLING_RATE) | ADC_SMPR2_SMP_AN5(ADC_SAMPLING_RATE) | ADC_SMPR2_SMP_AN6(ADC_SAMPLING_RATE) | ADC_SMPR2_SMP_AN7(ADC_SAMPLING_RATE) | ADC_SMPR2_SMP_AN8(ADC_SAMPLING_RATE) | ADC_SMPR2_SMP_AN9(ADC_SAMPLING_RATE), 128 .smpr2 = ADC_SMPR2_SMP_AN0(ADC_SAMPLING_RATE) | ADC_SMPR2_SMP_AN1(ADC_SAMPLING_RATE) | ADC_SMPR2_SMP_AN2(ADC_SAMPLING_RATE) | ADC_SMPR2_SMP_AN3(ADC_SAMPLING_RATE) | ADC_SMPR2_SMP_AN4(ADC_SAMPLING_RATE) | ADC_SMPR2_SMP_AN5(ADC_SAMPLING_RATE) | ADC_SMPR2_SMP_AN6(ADC_SAMPLING_RATE) | ADC_SMPR2_SMP_AN7(ADC_SAMPLING_RATE) | ADC_SMPR2_SMP_AN8(ADC_SAMPLING_RATE) | ADC_SMPR2_SMP_AN9(ADC_SAMPLING_RATE),
129 .smpr1 = ADC_SMPR1_SMP_AN10(ADC_SAMPLING_RATE) | ADC_SMPR1_SMP_AN11(ADC_SAMPLING_RATE) | ADC_SMPR1_SMP_AN12(ADC_SAMPLING_RATE) | ADC_SMPR1_SMP_AN13(ADC_SAMPLING_RATE) | ADC_SMPR1_SMP_AN14(ADC_SAMPLING_RATE) | ADC_SMPR1_SMP_AN15(ADC_SAMPLING_RATE), 129 .smpr1 = ADC_SMPR1_SMP_AN10(ADC_SAMPLING_RATE) | ADC_SMPR1_SMP_AN11(ADC_SAMPLING_RATE) | ADC_SMPR1_SMP_AN12(ADC_SAMPLING_RATE) | ADC_SMPR1_SMP_AN13(ADC_SAMPLING_RATE) | ADC_SMPR1_SMP_AN14(ADC_SAMPLING_RATE) | ADC_SMPR1_SMP_AN15(ADC_SAMPLING_RATE),
diff --git a/drivers/chibios/serial_usart.h b/drivers/chibios/serial_usart.h
index d35b5d12c..fee7b4d15 100644
--- a/drivers/chibios/serial_usart.h
+++ b/drivers/chibios/serial_usart.h
@@ -40,13 +40,25 @@
40#endif 40#endif
41 41
42#if defined(USART1_REMAP) 42#if defined(USART1_REMAP)
43# define USART_REMAP do { (AFIO->MAPR |= AFIO_MAPR_USART1_REMAP); } while(0) 43# define USART_REMAP \
44 do { \
45 (AFIO->MAPR |= AFIO_MAPR_USART1_REMAP); \
46 } while (0)
44#elif defined(USART2_REMAP) 47#elif defined(USART2_REMAP)
45# define USART_REMAP do { (AFIO->MAPR |= AFIO_MAPR_USART2_REMAP); } while(0) 48# define USART_REMAP \
49 do { \
50 (AFIO->MAPR |= AFIO_MAPR_USART2_REMAP); \
51 } while (0)
46#elif defined(USART3_PARTIALREMAP) 52#elif defined(USART3_PARTIALREMAP)
47# define USART_REMAP do { (AFIO->MAPR |= AFIO_MAPR_USART3_REMAP_PARTIALREMAP); } while(0) 53# define USART_REMAP \
54 do { \
55 (AFIO->MAPR |= AFIO_MAPR_USART3_REMAP_PARTIALREMAP); \
56 } while (0)
48#elif defined(USART3_FULLREMAP) 57#elif defined(USART3_FULLREMAP)
49# define USART_REMAP do { (AFIO->MAPR |= AFIO_MAPR_USART3_REMAP_FULLREMAP); } while(0) 58# define USART_REMAP \
59 do { \
60 (AFIO->MAPR |= AFIO_MAPR_USART3_REMAP_FULLREMAP); \
61 } while (0)
50#endif 62#endif
51 63
52#ifndef SELECT_SOFT_SERIAL_SPEED 64#ifndef SELECT_SOFT_SERIAL_SPEED
diff --git a/quantum/led_matrix_animations/alpha_mods_anim.h b/quantum/led_matrix_animations/alpha_mods_anim.h
index a4638fde6..6f69f6892 100644
--- a/quantum/led_matrix_animations/alpha_mods_anim.h
+++ b/quantum/led_matrix_animations/alpha_mods_anim.h
@@ -21,4 +21,4 @@ bool ALPHAS_MODS(effect_params_t* params) {
21} 21}
22 22
23# endif // LED_MATRIX_CUSTOM_EFFECT_IMPLS 23# endif // LED_MATRIX_CUSTOM_EFFECT_IMPLS
24#endif // DISABLE_LED_MATRIX_ALPHAS_MODS 24#endif // DISABLE_LED_MATRIX_ALPHAS_MODS
diff --git a/quantum/led_matrix_animations/band_anim.h b/quantum/led_matrix_animations/band_anim.h
index 4a2b746a7..523dba1b7 100644
--- a/quantum/led_matrix_animations/band_anim.h
+++ b/quantum/led_matrix_animations/band_anim.h
@@ -7,9 +7,7 @@ static uint8_t BAND_math(uint8_t val, uint8_t i, uint8_t time) {
7 return scale8(v < 0 ? 0 : v, val); 7 return scale8(v < 0 ? 0 : v, val);
8} 8}
9 9
10bool BAND(effect_params_t* params) { 10bool BAND(effect_params_t* params) { return effect_runner_i(params, &BAND_math); }
11 return effect_runner_i(params, &BAND_math);
12}
13 11
14# endif // LED_MATRIX_CUSTOM_EFFECT_IMPLS 12# endif // LED_MATRIX_CUSTOM_EFFECT_IMPLS
15#endif // DISABLE_LED_MATRIX_BAND 13#endif // DISABLE_LED_MATRIX_BAND
diff --git a/quantum/led_matrix_animations/band_pinwheel_anim.h b/quantum/led_matrix_animations/band_pinwheel_anim.h
index 9836320d2..fb3b835ca 100644
--- a/quantum/led_matrix_animations/band_pinwheel_anim.h
+++ b/quantum/led_matrix_animations/band_pinwheel_anim.h
@@ -2,13 +2,9 @@
2LED_MATRIX_EFFECT(BAND_PINWHEEL) 2LED_MATRIX_EFFECT(BAND_PINWHEEL)
3# ifdef LED_MATRIX_CUSTOM_EFFECT_IMPLS 3# ifdef LED_MATRIX_CUSTOM_EFFECT_IMPLS
4 4
5static uint8_t BAND_PINWHEEL_math(uint8_t val, int16_t dx, int16_t dy, uint8_t time) { 5static uint8_t BAND_PINWHEEL_math(uint8_t val, int16_t dx, int16_t dy, uint8_t time) { return scale8(val - time - atan2_8(dy, dx) * 3, val); }
6 return scale8(val - time - atan2_8(dy, dx) * 3, val);
7}
8 6
9bool BAND_PINWHEEL(effect_params_t* params) { 7bool BAND_PINWHEEL(effect_params_t* params) { return effect_runner_dx_dy(params, &BAND_PINWHEEL_math); }
10 return effect_runner_dx_dy(params, &BAND_PINWHEEL_math);
11}
12 8
13# endif // LED_MATRIX_CUSTOM_EFFECT_IMPLS 9# endif // LED_MATRIX_CUSTOM_EFFECT_IMPLS
14#endif // DISABLE_LED_MATRIX_BAND_PINWHEEL 10#endif // DISABLE_LED_MATRIX_BAND_PINWHEEL
diff --git a/quantum/led_matrix_animations/band_spiral_anim.h b/quantum/led_matrix_animations/band_spiral_anim.h
index be17c03aa..fca22aad9 100644
--- a/quantum/led_matrix_animations/band_spiral_anim.h
+++ b/quantum/led_matrix_animations/band_spiral_anim.h
@@ -2,13 +2,9 @@
2LED_MATRIX_EFFECT(BAND_SPIRAL) 2LED_MATRIX_EFFECT(BAND_SPIRAL)
3# ifdef LED_MATRIX_CUSTOM_EFFECT_IMPLS 3# ifdef LED_MATRIX_CUSTOM_EFFECT_IMPLS
4 4
5static uint8_t BAND_SPIRAL_math(uint8_t val, int16_t dx, int16_t dy, uint8_t dist, uint8_t time) { 5static uint8_t BAND_SPIRAL_math(uint8_t val, int16_t dx, int16_t dy, uint8_t dist, uint8_t time) { return scale8(val + dist - time - atan2_8(dy, dx), val); }
6 return scale8(val + dist - time - atan2_8(dy, dx), val);
7}
8 6
9bool BAND_SPIRAL(effect_params_t* params) { 7bool BAND_SPIRAL(effect_params_t* params) { return effect_runner_dx_dy_dist(params, &BAND_SPIRAL_math); }
10 return effect_runner_dx_dy_dist(params, &BAND_SPIRAL_math);
11}
12 8
13# endif // LED_MATRIX_CUSTOM_EFFECT_IMPLS 9# endif // LED_MATRIX_CUSTOM_EFFECT_IMPLS
14#endif // DISABLE_LED_MATRIX_BAND_SPIRAL 10#endif // DISABLE_LED_MATRIX_BAND_SPIRAL
diff --git a/quantum/led_matrix_animations/breathing_anim.h b/quantum/led_matrix_animations/breathing_anim.h
index 4f49f5069..00310e3f6 100644
--- a/quantum/led_matrix_animations/breathing_anim.h
+++ b/quantum/led_matrix_animations/breathing_anim.h
@@ -16,4 +16,4 @@ bool BREATHING(effect_params_t* params) {
16} 16}
17 17
18# endif // LED_MATRIX_CUSTOM_EFFECT_IMPLS 18# endif // LED_MATRIX_CUSTOM_EFFECT_IMPLS
19#endif // DISABLE_LED_MATRIX_BREATHING 19#endif // DISABLE_LED_MATRIX_BREATHING
diff --git a/quantum/led_matrix_animations/cycle_left_right_anim.h b/quantum/led_matrix_animations/cycle_left_right_anim.h
index 404fda26f..51e81d57c 100644
--- a/quantum/led_matrix_animations/cycle_left_right_anim.h
+++ b/quantum/led_matrix_animations/cycle_left_right_anim.h
@@ -2,13 +2,9 @@
2LED_MATRIX_EFFECT(CYCLE_LEFT_RIGHT) 2LED_MATRIX_EFFECT(CYCLE_LEFT_RIGHT)
3# ifdef LED_MATRIX_CUSTOM_EFFECT_IMPLS 3# ifdef LED_MATRIX_CUSTOM_EFFECT_IMPLS
4 4
5static uint8_t CYCLE_LEFT_RIGHT_math(uint8_t val, uint8_t i, uint8_t time) { 5static uint8_t CYCLE_LEFT_RIGHT_math(uint8_t val, uint8_t i, uint8_t time) { return scale8(g_led_config.point[i].x - time, val); }
6 return scale8(g_led_config.point[i].x - time, val);
7}
8 6
9bool CYCLE_LEFT_RIGHT(effect_params_t* params) { 7bool CYCLE_LEFT_RIGHT(effect_params_t* params) { return effect_runner_i(params, &CYCLE_LEFT_RIGHT_math); }
10 return effect_runner_i(params, &CYCLE_LEFT_RIGHT_math);
11}
12 8
13# endif // LED_MATRIX_CUSTOM_EFFECT_IMPLS 9# endif // LED_MATRIX_CUSTOM_EFFECT_IMPLS
14#endif // DISABLE_LED_MATRIX_CYCLE_LEFT_RIGHT 10#endif // DISABLE_LED_MATRIX_CYCLE_LEFT_RIGHT
diff --git a/quantum/led_matrix_animations/cycle_out_in_anim.h b/quantum/led_matrix_animations/cycle_out_in_anim.h
index 3f5fc5b18..f62061552 100644
--- a/quantum/led_matrix_animations/cycle_out_in_anim.h
+++ b/quantum/led_matrix_animations/cycle_out_in_anim.h
@@ -2,13 +2,9 @@
2LED_MATRIX_EFFECT(CYCLE_OUT_IN) 2LED_MATRIX_EFFECT(CYCLE_OUT_IN)
3# ifdef LED_MATRIX_CUSTOM_EFFECT_IMPLS 3# ifdef LED_MATRIX_CUSTOM_EFFECT_IMPLS
4 4
5static uint8_t CYCLE_OUT_IN_math(uint8_t val, int16_t dx, int16_t dy, uint8_t dist, uint8_t time) { 5static uint8_t CYCLE_OUT_IN_math(uint8_t val, int16_t dx, int16_t dy, uint8_t dist, uint8_t time) { return scale8(3 * dist / 2 + time, val); }
6 return scale8(3 * dist / 2 + time, val);
7}
8 6
9bool CYCLE_OUT_IN(effect_params_t* params) { 7bool CYCLE_OUT_IN(effect_params_t* params) { return effect_runner_dx_dy_dist(params, &CYCLE_OUT_IN_math); }
10 return effect_runner_dx_dy_dist(params, &CYCLE_OUT_IN_math);
11}
12 8
13# endif // LED_MATRIX_CUSTOM_EFFECT_IMPLS 9# endif // LED_MATRIX_CUSTOM_EFFECT_IMPLS
14#endif // DISABLE_LED_MATRIX_CYCLE_OUT_IN 10#endif // DISABLE_LED_MATRIX_CYCLE_OUT_IN
diff --git a/quantum/led_matrix_animations/cycle_up_down_anim.h b/quantum/led_matrix_animations/cycle_up_down_anim.h
index 25fc211b1..bd1d12567 100644
--- a/quantum/led_matrix_animations/cycle_up_down_anim.h
+++ b/quantum/led_matrix_animations/cycle_up_down_anim.h
@@ -2,13 +2,9 @@
2LED_MATRIX_EFFECT(CYCLE_UP_DOWN) 2LED_MATRIX_EFFECT(CYCLE_UP_DOWN)
3# ifdef LED_MATRIX_CUSTOM_EFFECT_IMPLS 3# ifdef LED_MATRIX_CUSTOM_EFFECT_IMPLS
4 4
5static uint8_t CYCLE_UP_DOWN_math(uint8_t val, uint8_t i, uint8_t time) { 5static uint8_t CYCLE_UP_DOWN_math(uint8_t val, uint8_t i, uint8_t time) { return scale8(g_led_config.point[i].y - time, val); }
6 return scale8(g_led_config.point[i].y - time, val);
7}
8 6
9bool CYCLE_UP_DOWN(effect_params_t* params) { 7bool CYCLE_UP_DOWN(effect_params_t* params) { return effect_runner_i(params, &CYCLE_UP_DOWN_math); }
10 return effect_runner_i(params, &CYCLE_UP_DOWN_math);
11}
12 8
13# endif // LED_MATRIX_CUSTOM_EFFECT_IMPLS 9# endif // LED_MATRIX_CUSTOM_EFFECT_IMPLS
14#endif // DISABLE_LED_MATRIX_CYCLE_UP_DOWN 10#endif // DISABLE_LED_MATRIX_CYCLE_UP_DOWN
diff --git a/quantum/led_matrix_animations/dual_beacon_anim.h b/quantum/led_matrix_animations/dual_beacon_anim.h
index 1fa1df139..9b8a7877c 100644
--- a/quantum/led_matrix_animations/dual_beacon_anim.h
+++ b/quantum/led_matrix_animations/dual_beacon_anim.h
@@ -2,13 +2,9 @@
2LED_MATRIX_EFFECT(DUAL_BEACON) 2LED_MATRIX_EFFECT(DUAL_BEACON)
3# ifdef LED_MATRIX_CUSTOM_EFFECT_IMPLS 3# ifdef LED_MATRIX_CUSTOM_EFFECT_IMPLS
4 4
5static uint8_t DUAL_BEACON_math(uint8_t val, int8_t sin, int8_t cos, uint8_t i, uint8_t time) { 5static uint8_t DUAL_BEACON_math(uint8_t val, int8_t sin, int8_t cos, uint8_t i, uint8_t time) { return scale8(((g_led_config.point[i].y - k_led_matrix_center.y) * cos + (g_led_config.point[i].x - k_led_matrix_center.x) * sin) / 128, val); }
6 return scale8(((g_led_config.point[i].y - k_led_matrix_center.y) * cos + (g_led_config.point[i].x - k_led_matrix_center.x) * sin) / 128, val);
7}
8 6
9bool DUAL_BEACON(effect_params_t* params) { 7bool DUAL_BEACON(effect_params_t* params) { return effect_runner_sin_cos_i(params, &DUAL_BEACON_math); }
10 return effect_runner_sin_cos_i(params, &DUAL_BEACON_math);
11}
12 8
13# endif // LED_MATRIX_CUSTOM_EFFECT_IMPLS 9# endif // LED_MATRIX_CUSTOM_EFFECT_IMPLS
14#endif // DISABLE_LED_MATRIX_DUAL_BEACON 10#endif // DISABLE_LED_MATRIX_DUAL_BEACON
diff --git a/quantum/led_matrix_animations/solid_reactive_cross.h b/quantum/led_matrix_animations/solid_reactive_cross.h
index a50d1fc62..f402d99b3 100644
--- a/quantum/led_matrix_animations/solid_reactive_cross.h
+++ b/quantum/led_matrix_animations/solid_reactive_cross.h
@@ -23,17 +23,13 @@ static uint8_t SOLID_REACTIVE_CROSS_math(uint8_t val, int16_t dx, int16_t dy, ui
23} 23}
24 24
25# ifndef DISABLE_LED_MATRIX_SOLID_REACTIVE_CROSS 25# ifndef DISABLE_LED_MATRIX_SOLID_REACTIVE_CROSS
26bool SOLID_REACTIVE_CROSS(effect_params_t* params) { 26bool SOLID_REACTIVE_CROSS(effect_params_t* params) { return effect_runner_reactive_splash(qsub8(g_last_hit_tracker.count, 1), params, &SOLID_REACTIVE_CROSS_math); }
27 return effect_runner_reactive_splash(qsub8(g_last_hit_tracker.count, 1), params, &SOLID_REACTIVE_CROSS_math);
28}
29# endif 27# endif
30 28
31# ifndef DISABLE_LED_MATRIX_SOLID_REACTIVE_MULTICROSS 29# ifndef DISABLE_LED_MATRIX_SOLID_REACTIVE_MULTICROSS
32bool SOLID_REACTIVE_MULTICROSS(effect_params_t* params) { 30bool SOLID_REACTIVE_MULTICROSS(effect_params_t* params) { return effect_runner_reactive_splash(0, params, &SOLID_REACTIVE_CROSS_math); }
33 return effect_runner_reactive_splash(0, params, &SOLID_REACTIVE_CROSS_math);
34}
35# endif 31# endif
36 32
37# endif // LED_MATRIX_CUSTOM_EFFECT_IMPLS 33# endif // LED_MATRIX_CUSTOM_EFFECT_IMPLS
38# endif // !defined(DISABLE_LED_MATRIX_SOLID_REACTIVE_CROSS) || !defined(DISABLE_LED_MATRIX_SOLID_REACTIVE_MULTICROSS) 34# endif // !defined(DISABLE_LED_MATRIX_SOLID_REACTIVE_CROSS) || !defined(DISABLE_LED_MATRIX_SOLID_REACTIVE_MULTICROSS)
39#endif // LED_MATRIX_KEYREACTIVE_ENABLED 35#endif // LED_MATRIX_KEYREACTIVE_ENABLED
diff --git a/quantum/led_matrix_animations/solid_reactive_nexus.h b/quantum/led_matrix_animations/solid_reactive_nexus.h
index 4638aac5a..4d0d25226 100644
--- a/quantum/led_matrix_animations/solid_reactive_nexus.h
+++ b/quantum/led_matrix_animations/solid_reactive_nexus.h
@@ -20,17 +20,13 @@ static uint8_t SOLID_REACTIVE_NEXUS_math(uint8_t val, int16_t dx, int16_t dy, ui
20} 20}
21 21
22# ifndef DISABLE_LED_MATRIX_SOLID_REACTIVE_NEXUS 22# ifndef DISABLE_LED_MATRIX_SOLID_REACTIVE_NEXUS
23bool SOLID_REACTIVE_NEXUS(effect_params_t* params) { 23bool SOLID_REACTIVE_NEXUS(effect_params_t* params) { return effect_runner_reactive_splash(qsub8(g_last_hit_tracker.count, 1), params, &SOLID_REACTIVE_NEXUS_math); }
24 return effect_runner_reactive_splash(qsub8(g_last_hit_tracker.count, 1), params, &SOLID_REACTIVE_NEXUS_math);
25}
26# endif 24# endif
27 25
28# ifndef DISABLE_LED_MATRIX_SOLID_REACTIVE_MULTINEXUS 26# ifndef DISABLE_LED_MATRIX_SOLID_REACTIVE_MULTINEXUS
29bool SOLID_REACTIVE_MULTINEXUS(effect_params_t* params) { 27bool SOLID_REACTIVE_MULTINEXUS(effect_params_t* params) { return effect_runner_reactive_splash(0, params, &SOLID_REACTIVE_NEXUS_math); }
30 return effect_runner_reactive_splash(0, params, &SOLID_REACTIVE_NEXUS_math);
31}
32# endif 28# endif
33 29
34# endif // LED_MATRIX_CUSTOM_EFFECT_IMPLS 30# endif // LED_MATRIX_CUSTOM_EFFECT_IMPLS
35# endif // !defined(DISABLE_LED_MATRIX_SOLID_REACTIVE_NEXUS) || !defined(DISABLE_LED_MATRIX_SOLID_REACTIVE_MULTINEXUS) 31# endif // !defined(DISABLE_LED_MATRIX_SOLID_REACTIVE_NEXUS) || !defined(DISABLE_LED_MATRIX_SOLID_REACTIVE_MULTINEXUS)
36#endif // LED_MATRIX_KEYREACTIVE_ENABLED 32#endif // LED_MATRIX_KEYREACTIVE_ENABLED
diff --git a/quantum/led_matrix_animations/solid_reactive_simple_anim.h b/quantum/led_matrix_animations/solid_reactive_simple_anim.h
index e1166a4fb..30e2527f6 100644
--- a/quantum/led_matrix_animations/solid_reactive_simple_anim.h
+++ b/quantum/led_matrix_animations/solid_reactive_simple_anim.h
@@ -3,14 +3,10 @@
3LED_MATRIX_EFFECT(SOLID_REACTIVE_SIMPLE) 3LED_MATRIX_EFFECT(SOLID_REACTIVE_SIMPLE)
4# ifdef LED_MATRIX_CUSTOM_EFFECT_IMPLS 4# ifdef LED_MATRIX_CUSTOM_EFFECT_IMPLS
5 5
6static uint8_t SOLID_REACTIVE_SIMPLE_math(uint8_t val, uint16_t offset) { 6static uint8_t SOLID_REACTIVE_SIMPLE_math(uint8_t val, uint16_t offset) { return scale8(255 - offset, val); }
7 return scale8(255 - offset, val);
8}
9 7
10bool SOLID_REACTIVE_SIMPLE(effect_params_t* params) { 8bool SOLID_REACTIVE_SIMPLE(effect_params_t* params) { return effect_runner_reactive(params, &SOLID_REACTIVE_SIMPLE_math); }
11 return effect_runner_reactive(params, &SOLID_REACTIVE_SIMPLE_math);
12}
13 9
14# endif // LED_MATRIX_CUSTOM_EFFECT_IMPLS 10# endif // LED_MATRIX_CUSTOM_EFFECT_IMPLS
15# endif // DISABLE_LED_MATRIX_SOLID_REACTIVE_SIMPLE 11# endif // DISABLE_LED_MATRIX_SOLID_REACTIVE_SIMPLE
16#endif // LED_MATRIX_KEYREACTIVE_ENABLED 12#endif // LED_MATRIX_KEYREACTIVE_ENABLED
diff --git a/quantum/led_matrix_animations/solid_reactive_wide.h b/quantum/led_matrix_animations/solid_reactive_wide.h
index 4bcaba331..34a230c25 100644
--- a/quantum/led_matrix_animations/solid_reactive_wide.h
+++ b/quantum/led_matrix_animations/solid_reactive_wide.h
@@ -18,17 +18,13 @@ static uint8_t SOLID_REACTIVE_WIDE_math(uint8_t val, int16_t dx, int16_t dy, uin
18} 18}
19 19
20# ifndef DISABLE_LED_MATRIX_SOLID_REACTIVE_WIDE 20# ifndef DISABLE_LED_MATRIX_SOLID_REACTIVE_WIDE
21bool SOLID_REACTIVE_WIDE(effect_params_t* params) { 21bool SOLID_REACTIVE_WIDE(effect_params_t* params) { return effect_runner_reactive_splash(qsub8(g_last_hit_tracker.count, 1), params, &SOLID_REACTIVE_WIDE_math); }
22 return effect_runner_reactive_splash(qsub8(g_last_hit_tracker.count, 1), params, &SOLID_REACTIVE_WIDE_math);
23}
24# endif 22# endif
25 23
26# ifndef DISABLE_LED_MATRIX_SOLID_REACTIVE_MULTIWIDE 24# ifndef DISABLE_LED_MATRIX_SOLID_REACTIVE_MULTIWIDE
27bool SOLID_REACTIVE_MULTIWIDE(effect_params_t* params) { 25bool SOLID_REACTIVE_MULTIWIDE(effect_params_t* params) { return effect_runner_reactive_splash(0, params, &SOLID_REACTIVE_WIDE_math); }
28 return effect_runner_reactive_splash(0, params, &SOLID_REACTIVE_WIDE_math);
29}
30# endif 26# endif
31 27
32# endif // LED_MATRIX_CUSTOM_EFFECT_IMPLS 28# endif // LED_MATRIX_CUSTOM_EFFECT_IMPLS
33# endif // !defined(DISABLE_LED_MATRIX_SOLID_REACTIVE_WIDE) || !defined(DISABLE_LED_MATRIX_SOLID_REACTIVE_MULTIWIDE) 29# endif // !defined(DISABLE_LED_MATRIX_SOLID_REACTIVE_WIDE) || !defined(DISABLE_LED_MATRIX_SOLID_REACTIVE_MULTIWIDE)
34#endif // LED_MATRIX_KEYREACTIVE_ENABLED 30#endif // LED_MATRIX_KEYREACTIVE_ENABLED
diff --git a/quantum/led_matrix_animations/solid_splash_anim.h b/quantum/led_matrix_animations/solid_splash_anim.h
index 3e9046640..4f6ba3d34 100644
--- a/quantum/led_matrix_animations/solid_splash_anim.h
+++ b/quantum/led_matrix_animations/solid_splash_anim.h
@@ -18,17 +18,13 @@ uint8_t SOLID_SPLASH_math(uint8_t val, int16_t dx, int16_t dy, uint8_t dist, uin
18} 18}
19 19
20# ifndef DISABLE_LED_MATRIX_SOLID_SPLASH 20# ifndef DISABLE_LED_MATRIX_SOLID_SPLASH
21bool SOLID_SPLASH(effect_params_t* params) { 21bool SOLID_SPLASH(effect_params_t* params) { return effect_runner_reactive_splash(qsub8(g_last_hit_tracker.count, 1), params, &SOLID_SPLASH_math); }
22 return effect_runner_reactive_splash(qsub8(g_last_hit_tracker.count, 1), params, &SOLID_SPLASH_math);
23}
24# endif 22# endif
25 23
26# ifndef DISABLE_LED_MATRIX_SOLID_MULTISPLASH 24# ifndef DISABLE_LED_MATRIX_SOLID_MULTISPLASH
27bool SOLID_MULTISPLASH(effect_params_t* params) { 25bool SOLID_MULTISPLASH(effect_params_t* params) { return effect_runner_reactive_splash(0, params, &SOLID_SPLASH_math); }
28 return effect_runner_reactive_splash(0, params, &SOLID_SPLASH_math);
29}
30# endif 26# endif
31 27
32# endif // LED_MATRIX_CUSTOM_EFFECT_IMPLS 28# endif // LED_MATRIX_CUSTOM_EFFECT_IMPLS
33# endif // !defined(DISABLE_LED_MATRIX_SPLASH) && !defined(DISABLE_LED_MATRIX_MULTISPLASH) 29# endif // !defined(DISABLE_LED_MATRIX_SPLASH) && !defined(DISABLE_LED_MATRIX_MULTISPLASH)
34#endif // LED_MATRIX_KEYREACTIVE_ENABLED 30#endif // LED_MATRIX_KEYREACTIVE_ENABLED
diff --git a/quantum/led_matrix_animations/wave_left_right_anim.h b/quantum/led_matrix_animations/wave_left_right_anim.h
index d547c72ce..736f22ddc 100644
--- a/quantum/led_matrix_animations/wave_left_right_anim.h
+++ b/quantum/led_matrix_animations/wave_left_right_anim.h
@@ -2,13 +2,9 @@
2LED_MATRIX_EFFECT(WAVE_LEFT_RIGHT) 2LED_MATRIX_EFFECT(WAVE_LEFT_RIGHT)
3# ifdef LED_MATRIX_CUSTOM_EFFECT_IMPLS 3# ifdef LED_MATRIX_CUSTOM_EFFECT_IMPLS
4 4
5static uint8_t WAVE_LEFT_RIGHT_math(uint8_t val, uint8_t i, uint8_t time) { 5static uint8_t WAVE_LEFT_RIGHT_math(uint8_t val, uint8_t i, uint8_t time) { return scale8(sin8(g_led_config.point[i].x - time), val); }
6 return scale8(sin8(g_led_config.point[i].x - time), val);
7}
8 6
9bool WAVE_LEFT_RIGHT(effect_params_t* params) { 7bool WAVE_LEFT_RIGHT(effect_params_t* params) { return effect_runner_i(params, &WAVE_LEFT_RIGHT_math); }
10 return effect_runner_i(params, &WAVE_LEFT_RIGHT_math);
11}
12 8
13# endif // LED_MATRIX_CUSTOM_EFFECT_IMPLS 9# endif // LED_MATRIX_CUSTOM_EFFECT_IMPLS
14#endif // DISABLE_LED_MATRIX_WAVE_LEFT_RIGHT 10#endif // DISABLE_LED_MATRIX_WAVE_LEFT_RIGHT
diff --git a/quantum/led_matrix_animations/wave_up_down_anim.h b/quantum/led_matrix_animations/wave_up_down_anim.h
index b68ff9bbc..3cab0597d 100644
--- a/quantum/led_matrix_animations/wave_up_down_anim.h
+++ b/quantum/led_matrix_animations/wave_up_down_anim.h
@@ -2,13 +2,9 @@
2LED_MATRIX_EFFECT(WAVE_UP_DOWN) 2LED_MATRIX_EFFECT(WAVE_UP_DOWN)
3# ifdef LED_MATRIX_CUSTOM_EFFECT_IMPLS 3# ifdef LED_MATRIX_CUSTOM_EFFECT_IMPLS
4 4
5static uint8_t WAVE_UP_DOWN_math(uint8_t val, uint8_t i, uint8_t time) { 5static uint8_t WAVE_UP_DOWN_math(uint8_t val, uint8_t i, uint8_t time) { return scale8(sin8(g_led_config.point[i].y - time), val); }
6 return scale8(sin8(g_led_config.point[i].y - time), val);
7}
8 6
9bool WAVE_UP_DOWN(effect_params_t* params) { 7bool WAVE_UP_DOWN(effect_params_t* params) { return effect_runner_i(params, &WAVE_UP_DOWN_math); }
10 return effect_runner_i(params, &WAVE_UP_DOWN_math);
11}
12 8
13# endif // LED_MATRIX_CUSTOM_EFFECT_IMPLS 9# endif // LED_MATRIX_CUSTOM_EFFECT_IMPLS
14#endif // DISABLE_LED_MATRIX_WAVE_UP_DOWN 10#endif // DISABLE_LED_MATRIX_WAVE_UP_DOWN
diff --git a/quantum/led_matrix_drivers.c b/quantum/led_matrix_drivers.c
index f3d4bc896..1d46b2c50 100644
--- a/quantum/led_matrix_drivers.c
+++ b/quantum/led_matrix_drivers.c
@@ -145,7 +145,7 @@ const led_matrix_driver_t led_matrix_driver = {
145 .set_value = IS31FL3731_set_value, 145 .set_value = IS31FL3731_set_value,
146 .set_value_all = IS31FL3731_set_value_all, 146 .set_value_all = IS31FL3731_set_value_all,
147# else 147# else
148 .set_value = IS31FL3733_set_value, 148 .set_value = IS31FL3733_set_value,
149 .set_value_all = IS31FL3733_set_value_all, 149 .set_value_all = IS31FL3733_set_value_all,
150# endif 150# endif
151}; 151};
diff --git a/quantum/quantum_keycodes.h b/quantum/quantum_keycodes.h
index 26021598a..316c20fce 100644
--- a/quantum/quantum_keycodes.h
+++ b/quantum/quantum_keycodes.h
@@ -760,12 +760,12 @@ enum quantum_keycodes {
760#define CMD_T(kc) LCMD_T(kc) 760#define CMD_T(kc) LCMD_T(kc)
761#define WIN_T(kc) LWIN_T(kc) 761#define WIN_T(kc) LWIN_T(kc)
762 762
763#define C_S_T(kc) MT(MOD_LCTL | MOD_LSFT, kc) // Left Control + Shift e.g. for gnome-terminal 763#define C_S_T(kc) MT(MOD_LCTL | MOD_LSFT, kc) // Left Control + Shift e.g. for gnome-terminal
764#define MEH_T(kc) MT(MOD_LCTL | MOD_LSFT | MOD_LALT, kc) // Meh is a less hyper version of the Hyper key -- doesn't include GUI, so just Left Control + Shift + Alt 764#define MEH_T(kc) MT(MOD_LCTL | MOD_LSFT | MOD_LALT, kc) // Meh is a less hyper version of the Hyper key -- doesn't include GUI, so just Left Control + Shift + Alt
765#define LCAG_T(kc) MT(MOD_LCTL | MOD_LALT | MOD_LGUI, kc) // Left Control + Alt + GUI 765#define LCAG_T(kc) MT(MOD_LCTL | MOD_LALT | MOD_LGUI, kc) // Left Control + Alt + GUI
766#define RCAG_T(kc) MT(MOD_RCTL | MOD_RALT | MOD_RGUI, kc) // Right Control + Alt + GUI 766#define RCAG_T(kc) MT(MOD_RCTL | MOD_RALT | MOD_RGUI, kc) // Right Control + Alt + GUI
767#define HYPR_T(kc) MT(MOD_LCTL | MOD_LSFT | MOD_LALT | MOD_LGUI, kc) // see http://brettterpstra.com/2012/12/08/a-useful-caps-lock-key/ 767#define HYPR_T(kc) MT(MOD_LCTL | MOD_LSFT | MOD_LALT | MOD_LGUI, kc) // see http://brettterpstra.com/2012/12/08/a-useful-caps-lock-key/
768#define SGUI_T(kc) MT(MOD_LGUI | MOD_LSFT, kc) // Left Shift + GUI 768#define SGUI_T(kc) MT(MOD_LGUI | MOD_LSFT, kc) // Left Shift + GUI
769#define SCMD_T(kc) SGUI_T(kc) 769#define SCMD_T(kc) SGUI_T(kc)
770#define SWIN_T(kc) SGUI_T(kc) 770#define SWIN_T(kc) SGUI_T(kc)
771#define LCA_T(kc) MT(MOD_LCTL | MOD_LALT, kc) // Left Control + Alt 771#define LCA_T(kc) MT(MOD_LCTL | MOD_LALT, kc) // Left Control + Alt
@@ -792,7 +792,7 @@ enum quantum_keycodes {
792 792
793#define UC_M_MA UNICODE_MODE_MAC 793#define UC_M_MA UNICODE_MODE_MAC
794#define UNICODE_MODE_OSX UNICODE_MODE_MAC // Deprecated alias 794#define UNICODE_MODE_OSX UNICODE_MODE_MAC // Deprecated alias
795#define UC_M_OS UNICODE_MODE_MAC // Deprecated alias 795#define UC_M_OS UNICODE_MODE_MAC // Deprecated alias
796#define UC_M_LN UNICODE_MODE_LNX 796#define UC_M_LN UNICODE_MODE_LNX
797#define UC_M_WI UNICODE_MODE_WIN 797#define UC_M_WI UNICODE_MODE_WIN
798#define UC_M_BS UNICODE_MODE_BSD 798#define UC_M_BS UNICODE_MODE_BSD
diff --git a/quantum/rgb_matrix_drivers.c b/quantum/rgb_matrix_drivers.c
index a4db86d19..896fa6d0e 100644
--- a/quantum/rgb_matrix_drivers.c
+++ b/quantum/rgb_matrix_drivers.c
@@ -146,9 +146,9 @@ static void flush(void) {
146} 146}
147 147
148const rgb_matrix_driver_t rgb_matrix_driver = { 148const rgb_matrix_driver_t rgb_matrix_driver = {
149 .init = init, 149 .init = init,
150 .flush = flush, 150 .flush = flush,
151 .set_color = IS31FL3733_set_color, 151 .set_color = IS31FL3733_set_color,
152 .set_color_all = IS31FL3733_set_color_all, 152 .set_color_all = IS31FL3733_set_color_all,
153}; 153};
154# elif defined(IS31FL3737) 154# elif defined(IS31FL3737)
diff --git a/quantum/rgblight.c b/quantum/rgblight.c
index e4c4d555e..baa10ec41 100644
--- a/quantum/rgblight.c
+++ b/quantum/rgblight.c
@@ -727,13 +727,11 @@ static uint16_t _repeat_timer;
727static uint8_t _times_remaining; 727static uint8_t _times_remaining;
728static uint16_t _dur; 728static uint16_t _dur;
729 729
730void rgblight_blink_layer(uint8_t layer, uint16_t duration_ms) { 730void rgblight_blink_layer(uint8_t layer, uint16_t duration_ms) { rgblight_blink_layer_repeat(layer, duration_ms, 1); }
731 rgblight_blink_layer_repeat(layer, duration_ms, 1);
732}
733 731
734void rgblight_blink_layer_repeat(uint8_t layer, uint16_t duration_ms, uint8_t times) { 732void rgblight_blink_layer_repeat(uint8_t layer, uint16_t duration_ms, uint8_t times) {
735 _times_remaining = times * 2; 733 _times_remaining = times * 2;
736 _dur = duration_ms; 734 _dur = duration_ms;
737 735
738 rgblight_set_layer_state(layer, true); 736 rgblight_set_layer_state(layer, true);
739 _times_remaining--; 737 _times_remaining--;
@@ -892,7 +890,7 @@ void rgblight_update_sync(rgblight_syncinfo_t *syncinfo, bool write_to_eeprom) {
892 animation_status.restart = true; 890 animation_status.restart = true;
893 } 891 }
894# endif /* RGBLIGHT_SPLIT_NO_ANIMATION_SYNC */ 892# endif /* RGBLIGHT_SPLIT_NO_ANIMATION_SYNC */
895# endif /* RGBLIGHT_USE_TIMER */ 893# endif /* RGBLIGHT_USE_TIMER */
896} 894}
897#endif /* RGBLIGHT_SPLIT */ 895#endif /* RGBLIGHT_SPLIT */
898 896
diff --git a/quantum/split_common/transport.c b/quantum/split_common/transport.c
index bf942c526..9ed0f7591 100644
--- a/quantum/split_common/transport.c
+++ b/quantum/split_common/transport.c
@@ -240,38 +240,38 @@ typedef struct _Serial_s2m_buffer_t {
240 matrix_row_t smatrix[ROWS_PER_HAND]; 240 matrix_row_t smatrix[ROWS_PER_HAND];
241 241
242# ifdef ENCODER_ENABLE 242# ifdef ENCODER_ENABLE
243 uint8_t encoder_state[NUMBER_OF_ENCODERS]; 243 uint8_t encoder_state[NUMBER_OF_ENCODERS];
244# endif 244# endif
245 245
246} Serial_s2m_buffer_t; 246} Serial_s2m_buffer_t;
247 247
248typedef struct _Serial_m2s_buffer_t { 248typedef struct _Serial_m2s_buffer_t {
249# ifdef SPLIT_MODS_ENABLE 249# ifdef SPLIT_MODS_ENABLE
250 uint8_t real_mods; 250 uint8_t real_mods;
251 uint8_t weak_mods; 251 uint8_t weak_mods;
252# ifndef NO_ACTION_ONESHOT 252# ifndef NO_ACTION_ONESHOT
253 uint8_t oneshot_mods; 253 uint8_t oneshot_mods;
254# endif 254# endif
255# endif 255# endif
256# ifndef DISABLE_SYNC_TIMER 256# ifndef DISABLE_SYNC_TIMER
257 uint32_t sync_timer; 257 uint32_t sync_timer;
258# endif 258# endif
259# ifdef SPLIT_TRANSPORT_MIRROR 259# ifdef SPLIT_TRANSPORT_MIRROR
260 matrix_row_t mmatrix[ROWS_PER_HAND]; 260 matrix_row_t mmatrix[ROWS_PER_HAND];
261# endif 261# endif
262# ifdef BACKLIGHT_ENABLE 262# ifdef BACKLIGHT_ENABLE
263 uint8_t backlight_level; 263 uint8_t backlight_level;
264# endif 264# endif
265# ifdef WPM_ENABLE 265# ifdef WPM_ENABLE
266 uint8_t current_wpm; 266 uint8_t current_wpm;
267# endif 267# endif
268# if defined(LED_MATRIX_ENABLE) && defined(LED_MATRIX_SPLIT) 268# if defined(LED_MATRIX_ENABLE) && defined(LED_MATRIX_SPLIT)
269 led_eeconfig_t led_matrix; 269 led_eeconfig_t led_matrix;
270 bool led_suspend_state; 270 bool led_suspend_state;
271# endif 271# endif
272# if defined(RGB_MATRIX_ENABLE) && defined(RGB_MATRIX_SPLIT) 272# if defined(RGB_MATRIX_ENABLE) && defined(RGB_MATRIX_SPLIT)
273 rgb_config_t rgb_matrix; 273 rgb_config_t rgb_matrix;
274 bool rgb_suspend_state; 274 bool rgb_suspend_state;
275# endif 275# endif
276} Serial_m2s_buffer_t; 276} Serial_m2s_buffer_t;
277 277
@@ -363,7 +363,7 @@ bool transport_master(matrix_row_t master_matrix[], matrix_row_t slave_matrix[])
363 363
364 // TODO: if MATRIX_COLS > 8 change to unpack() 364 // TODO: if MATRIX_COLS > 8 change to unpack()
365 for (int i = 0; i < ROWS_PER_HAND; ++i) { 365 for (int i = 0; i < ROWS_PER_HAND; ++i) {
366 slave_matrix[i] = serial_s2m_buffer.smatrix[i]; 366 slave_matrix[i] = serial_s2m_buffer.smatrix[i];
367# ifdef SPLIT_TRANSPORT_MIRROR 367# ifdef SPLIT_TRANSPORT_MIRROR
368 serial_m2s_buffer.mmatrix[i] = master_matrix[i]; 368 serial_m2s_buffer.mmatrix[i] = master_matrix[i];
369# endif 369# endif
@@ -380,14 +380,14 @@ bool transport_master(matrix_row_t master_matrix[], matrix_row_t slave_matrix[])
380 380
381# ifdef WPM_ENABLE 381# ifdef WPM_ENABLE
382 // Write wpm to slave 382 // Write wpm to slave
383 serial_m2s_buffer.current_wpm = get_current_wpm(); 383 serial_m2s_buffer.current_wpm = get_current_wpm();
384# endif 384# endif
385 385
386# ifdef SPLIT_MODS_ENABLE 386# ifdef SPLIT_MODS_ENABLE
387 serial_m2s_buffer.real_mods = get_mods(); 387 serial_m2s_buffer.real_mods = get_mods();
388 serial_m2s_buffer.weak_mods = get_weak_mods(); 388 serial_m2s_buffer.weak_mods = get_weak_mods();
389# ifndef NO_ACTION_ONESHOT 389# ifndef NO_ACTION_ONESHOT
390 serial_m2s_buffer.oneshot_mods = get_oneshot_mods(); 390 serial_m2s_buffer.oneshot_mods = get_oneshot_mods();
391# endif 391# endif
392# endif 392# endif
393 393
@@ -401,7 +401,7 @@ bool transport_master(matrix_row_t master_matrix[], matrix_row_t slave_matrix[])
401# endif 401# endif
402 402
403# ifndef DISABLE_SYNC_TIMER 403# ifndef DISABLE_SYNC_TIMER
404 serial_m2s_buffer.sync_timer = sync_timer_read32() + SYNC_TIMER_OFFSET; 404 serial_m2s_buffer.sync_timer = sync_timer_read32() + SYNC_TIMER_OFFSET;
405# endif 405# endif
406 return true; 406 return true;
407} 407}
@@ -416,7 +416,7 @@ void transport_slave(matrix_row_t master_matrix[], matrix_row_t slave_matrix[])
416 for (int i = 0; i < ROWS_PER_HAND; ++i) { 416 for (int i = 0; i < ROWS_PER_HAND; ++i) {
417 serial_s2m_buffer.smatrix[i] = slave_matrix[i]; 417 serial_s2m_buffer.smatrix[i] = slave_matrix[i];
418# ifdef SPLIT_TRANSPORT_MIRROR 418# ifdef SPLIT_TRANSPORT_MIRROR
419 master_matrix[i] = serial_m2s_buffer.mmatrix[i]; 419 master_matrix[i] = serial_m2s_buffer.mmatrix[i];
420# endif 420# endif
421 } 421 }
422# ifdef BACKLIGHT_ENABLE 422# ifdef BACKLIGHT_ENABLE
diff --git a/tmk_core/common/action.c b/tmk_core/common/action.c
index f41665b06..bd41d28b6 100644
--- a/tmk_core/common/action.c
+++ b/tmk_core/common/action.c
@@ -773,10 +773,9 @@ void register_code(uint8_t code) {
773 } 773 }
774#endif 774#endif
775 775
776 else if 776 else if IS_KEY (code) {
777 IS_KEY(code) { 777 // TODO: should push command_proc out of this block?
778 // TODO: should push command_proc out of this block? 778 if (command_proc(code)) return;
779 if (command_proc(code)) return;
780 779
781#ifndef NO_ACTION_ONESHOT 780#ifndef NO_ACTION_ONESHOT
782/* TODO: remove 781/* TODO: remove
@@ -793,35 +792,33 @@ void register_code(uint8_t code) {
793 } else 792 } else
794*/ 793*/
795#endif 794#endif
796 { 795 {
797 // Force a new key press if the key is already pressed 796 // Force a new key press if the key is already pressed
798 // without this, keys with the same keycode, but different 797 // without this, keys with the same keycode, but different
799 // modifiers will be reported incorrectly, see issue #1708 798 // modifiers will be reported incorrectly, see issue #1708
800 if (is_key_pressed(keyboard_report, code)) { 799 if (is_key_pressed(keyboard_report, code)) {
801 del_key(code); 800 del_key(code);
802 send_keyboard_report();
803 }
804 add_key(code);
805 send_keyboard_report(); 801 send_keyboard_report();
806 } 802 }
807 } 803 add_key(code);
808 else if
809 IS_MOD(code) {
810 add_mods(MOD_BIT(code));
811 send_keyboard_report(); 804 send_keyboard_report();
812 } 805 }
806 } else if IS_MOD (code) {
807 add_mods(MOD_BIT(code));
808 send_keyboard_report();
809 }
813#ifdef EXTRAKEY_ENABLE 810#ifdef EXTRAKEY_ENABLE
814 else if 811 else if IS_SYSTEM (code) {
815 IS_SYSTEM(code) { host_system_send(KEYCODE2SYSTEM(code)); } 812 host_system_send(KEYCODE2SYSTEM(code));
816 else if 813 } else if IS_CONSUMER (code) {
817 IS_CONSUMER(code) { host_consumer_send(KEYCODE2CONSUMER(code)); } 814 host_consumer_send(KEYCODE2CONSUMER(code));
815 }
818#endif 816#endif
819#ifdef MOUSEKEY_ENABLE 817#ifdef MOUSEKEY_ENABLE
820 else if 818 else if IS_MOUSEKEY (code) {
821 IS_MOUSEKEY(code) { 819 mousekey_on(code);
822 mousekey_on(code); 820 mousekey_send();
823 mousekey_send(); 821 }
824 }
825#endif 822#endif
826} 823}
827 824
@@ -866,26 +863,22 @@ void unregister_code(uint8_t code) {
866 } 863 }
867#endif 864#endif
868 865
869 else if 866 else if IS_KEY (code) {
870 IS_KEY(code) { 867 del_key(code);
871 del_key(code); 868 send_keyboard_report();
872 send_keyboard_report(); 869 } else if IS_MOD (code) {
873 } 870 del_mods(MOD_BIT(code));
874 else if 871 send_keyboard_report();
875 IS_MOD(code) { 872 } else if IS_SYSTEM (code) {
876 del_mods(MOD_BIT(code)); 873 host_system_send(0);
877 send_keyboard_report(); 874 } else if IS_CONSUMER (code) {
878 } 875 host_consumer_send(0);
879 else if 876 }
880 IS_SYSTEM(code) { host_system_send(0); }
881 else if
882 IS_CONSUMER(code) { host_consumer_send(0); }
883#ifdef MOUSEKEY_ENABLE 877#ifdef MOUSEKEY_ENABLE
884 else if 878 else if IS_MOUSEKEY (code) {
885 IS_MOUSEKEY(code) { 879 mousekey_off(code);
886 mousekey_off(code); 880 mousekey_send();
887 mousekey_send(); 881 }
888 }
889#endif 882#endif
890} 883}
891 884
diff --git a/tmk_core/common/action.h b/tmk_core/common/action.h
index 6c8456178..8cb4722c6 100644
--- a/tmk_core/common/action.h
+++ b/tmk_core/common/action.h
@@ -77,7 +77,7 @@ extern bool disable_action_cache;
77 77
78/* Code for handling one-handed key modifiers. */ 78/* Code for handling one-handed key modifiers. */
79#ifdef SWAP_HANDS_ENABLE 79#ifdef SWAP_HANDS_ENABLE
80extern bool swap_hands; 80extern bool swap_hands;
81extern const keypos_t PROGMEM hand_swap_config[MATRIX_ROWS][MATRIX_COLS]; 81extern const keypos_t PROGMEM hand_swap_config[MATRIX_ROWS][MATRIX_COLS];
82# if (MATRIX_COLS <= 8) 82# if (MATRIX_COLS <= 8)
83typedef uint8_t swap_state_row_t; 83typedef uint8_t swap_state_row_t;
diff --git a/tmk_core/common/chibios/sleep_led.c b/tmk_core/common/chibios/sleep_led.c
index 477056a45..1c65016a4 100644
--- a/tmk_core/common/chibios/sleep_led.c
+++ b/tmk_core/common/chibios/sleep_led.c
@@ -65,7 +65,7 @@ void sleep_led_timer_callback(void) {
65 65
66/* LPTMR clock options */ 66/* LPTMR clock options */
67# define LPTMR_CLOCK_MCGIRCLK 0 /* 4MHz clock */ 67# define LPTMR_CLOCK_MCGIRCLK 0 /* 4MHz clock */
68# define LPTMR_CLOCK_LPO 1 /* 1kHz clock */ 68# define LPTMR_CLOCK_LPO 1 /* 1kHz clock */
69# define LPTMR_CLOCK_ERCLK32K 2 /* external 32kHz crystal */ 69# define LPTMR_CLOCK_ERCLK32K 2 /* external 32kHz crystal */
70# define LPTMR_CLOCK_OSCERCLK 3 /* output from OSC */ 70# define LPTMR_CLOCK_OSCERCLK 3 /* output from OSC */
71 71
@@ -121,7 +121,7 @@ void sleep_led_init(void) {
121 MCG->C2 |= MCG_C2_IRCS; // fast (4MHz) internal ref clock 121 MCG->C2 |= MCG_C2_IRCS; // fast (4MHz) internal ref clock
122# if defined(KL27) // divide the 8MHz IRC by 2, to have the same MCGIRCLK speed as others 122# if defined(KL27) // divide the 8MHz IRC by 2, to have the same MCGIRCLK speed as others
123 MCG->MC |= MCG_MC_LIRC_DIV2_DIV2; 123 MCG->MC |= MCG_MC_LIRC_DIV2_DIV2;
124# endif /* KL27 */ 124# endif /* KL27 */
125 MCG->C1 |= MCG_C1_IRCLKEN; // enable internal ref clock 125 MCG->C1 |= MCG_C1_IRCLKEN; // enable internal ref clock
126 // to work in stop mode, also MCG_C1_IREFSTEN 126 // to work in stop mode, also MCG_C1_IREFSTEN
127 // Divide 4MHz by 2^N (N=6) => 62500 irqs/sec => 127 // Divide 4MHz by 2^N (N=6) => 62500 irqs/sec =>
diff --git a/tmk_core/common/keyboard.h b/tmk_core/common/keyboard.h
index 779973f1d..08f4e84f9 100644
--- a/tmk_core/common/keyboard.h
+++ b/tmk_core/common/keyboard.h
@@ -70,9 +70,9 @@ void keyboard_pre_init_user(void);
70void keyboard_post_init_kb(void); 70void keyboard_post_init_kb(void);
71void keyboard_post_init_user(void); 71void keyboard_post_init_user(void);
72 72
73void housekeeping_task(void); // To be executed by the main loop in each backend TMK protocol 73void housekeeping_task(void); // To be executed by the main loop in each backend TMK protocol
74void housekeeping_task_kb(void); // To be overridden by keyboard-level code 74void housekeeping_task_kb(void); // To be overridden by keyboard-level code
75void housekeeping_task_user(void); // To be overridden by user/keymap-level code 75void housekeeping_task_user(void); // To be overridden by user/keymap-level code
76 76
77uint32_t last_input_activity_time(void); // Timestamp of the last matrix or encoder activity 77uint32_t last_input_activity_time(void); // Timestamp of the last matrix or encoder activity
78uint32_t last_input_activity_elapsed(void); // Number of milliseconds since the last matrix or encoder activity 78uint32_t last_input_activity_elapsed(void); // Number of milliseconds since the last matrix or encoder activity