diff options
25 files changed, 96 insertions, 71 deletions
diff --git a/keyboards/aeboards/ext65/rev2/config.h b/keyboards/aeboards/ext65/rev2/config.h index 541f07ee9..dc1bfb71c 100644 --- a/keyboards/aeboards/ext65/rev2/config.h +++ b/keyboards/aeboards/ext65/rev2/config.h | |||
@@ -74,3 +74,5 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. | |||
74 | #define BACKLIGHT_LEVELS 6 | 74 | #define BACKLIGHT_LEVELS 6 |
75 | #define BACKLIGHT_BREATHING | 75 | #define BACKLIGHT_BREATHING |
76 | #define BREATHING_PERIOD 6 | 76 | #define BREATHING_PERIOD 6 |
77 | |||
78 | #define SLEEP_LED_GPT_DRIVER GPTD1 | ||
diff --git a/keyboards/aeboards/ext65/rev2/halconf.h b/keyboards/aeboards/ext65/rev2/halconf.h index 6e2f53640..9fa1eca60 100644 --- a/keyboards/aeboards/ext65/rev2/halconf.h +++ b/keyboards/aeboards/ext65/rev2/halconf.h | |||
@@ -27,5 +27,7 @@ | |||
27 | 27 | ||
28 | #define HAL_USE_SPI TRUE | 28 | #define HAL_USE_SPI TRUE |
29 | 29 | ||
30 | #define HAL_USE_GPT TRUE | ||
31 | |||
30 | #include_next <halconf.h> | 32 | #include_next <halconf.h> |
31 | 33 | ||
diff --git a/keyboards/aeboards/ext65/rev2/mcuconf.h b/keyboards/aeboards/ext65/rev2/mcuconf.h index 26ce80615..43d53d4f2 100644 --- a/keyboards/aeboards/ext65/rev2/mcuconf.h +++ b/keyboards/aeboards/ext65/rev2/mcuconf.h | |||
@@ -32,3 +32,5 @@ | |||
32 | #undef STM32_SPI_USE_SPI2 | 32 | #undef STM32_SPI_USE_SPI2 |
33 | #define STM32_SPI_USE_SPI2 TRUE | 33 | #define STM32_SPI_USE_SPI2 TRUE |
34 | 34 | ||
35 | #undef STM32_GPT_USE_TIM1 | ||
36 | #define STM32_GPT_USE_TIM1 TRUE | ||
diff --git a/keyboards/cannonkeys/an_c/rules.mk b/keyboards/cannonkeys/an_c/rules.mk index 8ed2d0ead..7309744d1 100644 --- a/keyboards/cannonkeys/an_c/rules.mk +++ b/keyboards/cannonkeys/an_c/rules.mk | |||
@@ -11,7 +11,7 @@ MOUSEKEY_ENABLE = yes # Mouse keys | |||
11 | EXTRAKEY_ENABLE = yes # Audio control and System control | 11 | EXTRAKEY_ENABLE = yes # Audio control and System control |
12 | CONSOLE_ENABLE = yes # Console for debug | 12 | CONSOLE_ENABLE = yes # Console for debug |
13 | COMMAND_ENABLE = yes # Commands for debug and configuration | 13 | COMMAND_ENABLE = yes # Commands for debug and configuration |
14 | SLEEP_LED_ENABLE = yes # Breathing sleep LED during USB suspend | 14 | SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend |
15 | NKRO_ENABLE = yes # USB Nkey Rollover | 15 | NKRO_ENABLE = yes # USB Nkey Rollover |
16 | CUSTOM_MATRIX = no # Custom matrix file | 16 | CUSTOM_MATRIX = no # Custom matrix file |
17 | BACKLIGHT_ENABLE = yes | 17 | BACKLIGHT_ENABLE = yes |
diff --git a/keyboards/cannonkeys/chimera65/rules.mk b/keyboards/cannonkeys/chimera65/rules.mk index 4d940da78..a08f2fa49 100644 --- a/keyboards/cannonkeys/chimera65/rules.mk +++ b/keyboards/cannonkeys/chimera65/rules.mk | |||
@@ -11,7 +11,7 @@ MOUSEKEY_ENABLE = yes # Mouse keys | |||
11 | EXTRAKEY_ENABLE = yes # Audio control and System control | 11 | EXTRAKEY_ENABLE = yes # Audio control and System control |
12 | CONSOLE_ENABLE = yes # Console for debug | 12 | CONSOLE_ENABLE = yes # Console for debug |
13 | COMMAND_ENABLE = yes # Commands for debug and configuration | 13 | COMMAND_ENABLE = yes # Commands for debug and configuration |
14 | SLEEP_LED_ENABLE = yes # Breathing sleep LED during USB suspend | 14 | SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend |
15 | NKRO_ENABLE = yes # USB Nkey Rollover | 15 | NKRO_ENABLE = yes # USB Nkey Rollover |
16 | CUSTOM_MATRIX = no # Custom matrix file | 16 | CUSTOM_MATRIX = no # Custom matrix file |
17 | BACKLIGHT_ENABLE = yes | 17 | BACKLIGHT_ENABLE = yes |
diff --git a/keyboards/cannonkeys/instant60/rules.mk b/keyboards/cannonkeys/instant60/rules.mk index 0973ad954..e5ba2903b 100644 --- a/keyboards/cannonkeys/instant60/rules.mk +++ b/keyboards/cannonkeys/instant60/rules.mk | |||
@@ -10,7 +10,7 @@ MOUSEKEY_ENABLE = yes # Mouse keys | |||
10 | EXTRAKEY_ENABLE = yes # Audio control and System control | 10 | EXTRAKEY_ENABLE = yes # Audio control and System control |
11 | CONSOLE_ENABLE = yes # Console for debug | 11 | CONSOLE_ENABLE = yes # Console for debug |
12 | COMMAND_ENABLE = yes # Commands for debug and configuration | 12 | COMMAND_ENABLE = yes # Commands for debug and configuration |
13 | SLEEP_LED_ENABLE = yes # Breathing sleep LED during USB suspend | 13 | SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend |
14 | NKRO_ENABLE = yes # USB Nkey Rollover | 14 | NKRO_ENABLE = yes # USB Nkey Rollover |
15 | CUSTOM_MATRIX = no # Custom matrix file | 15 | CUSTOM_MATRIX = no # Custom matrix file |
16 | BACKLIGHT_ENABLE = yes | 16 | BACKLIGHT_ENABLE = yes |
diff --git a/keyboards/cannonkeys/iron165/rules.mk b/keyboards/cannonkeys/iron165/rules.mk index 3925458dd..9de75a614 100644 --- a/keyboards/cannonkeys/iron165/rules.mk +++ b/keyboards/cannonkeys/iron165/rules.mk | |||
@@ -9,7 +9,7 @@ MOUSEKEY_ENABLE = yes # Mouse keys | |||
9 | EXTRAKEY_ENABLE = yes # Audio control and System control | 9 | EXTRAKEY_ENABLE = yes # Audio control and System control |
10 | CONSOLE_ENABLE = yes # Console for debug | 10 | CONSOLE_ENABLE = yes # Console for debug |
11 | COMMAND_ENABLE = yes # Commands for debug and configuration | 11 | COMMAND_ENABLE = yes # Commands for debug and configuration |
12 | SLEEP_LED_ENABLE = yes # Breathing sleep LED during USB suspend | 12 | SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend |
13 | NKRO_ENABLE = yes # USB Nkey Rollover | 13 | NKRO_ENABLE = yes # USB Nkey Rollover |
14 | CUSTOM_MATRIX = no # Custom matrix file | 14 | CUSTOM_MATRIX = no # Custom matrix file |
15 | BACKLIGHT_ENABLE = yes | 15 | BACKLIGHT_ENABLE = yes |
diff --git a/keyboards/cannonkeys/satisfaction75/rules.mk b/keyboards/cannonkeys/satisfaction75/rules.mk index e3abea546..3861b4849 100644 --- a/keyboards/cannonkeys/satisfaction75/rules.mk +++ b/keyboards/cannonkeys/satisfaction75/rules.mk | |||
@@ -15,7 +15,7 @@ MOUSEKEY_ENABLE = yes # Mouse keys | |||
15 | EXTRAKEY_ENABLE = yes # Audio control and System control | 15 | EXTRAKEY_ENABLE = yes # Audio control and System control |
16 | CONSOLE_ENABLE = yes # Console for debug | 16 | CONSOLE_ENABLE = yes # Console for debug |
17 | COMMAND_ENABLE = yes # Commands for debug and configuration | 17 | COMMAND_ENABLE = yes # Commands for debug and configuration |
18 | SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend | 18 | SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend |
19 | NKRO_ENABLE = yes # USB Nkey Rollover | 19 | NKRO_ENABLE = yes # USB Nkey Rollover |
20 | CUSTOM_MATRIX = no # Custom matrix file | 20 | CUSTOM_MATRIX = no # Custom matrix file |
21 | ENCODER_ENABLE = yes | 21 | ENCODER_ENABLE = yes |
diff --git a/keyboards/cannonkeys/savage65/rules.mk b/keyboards/cannonkeys/savage65/rules.mk index 8e1b984fd..2454573d2 100644 --- a/keyboards/cannonkeys/savage65/rules.mk +++ b/keyboards/cannonkeys/savage65/rules.mk | |||
@@ -11,7 +11,7 @@ MOUSEKEY_ENABLE = yes # Mouse keys | |||
11 | EXTRAKEY_ENABLE = yes # Audio control and System control | 11 | EXTRAKEY_ENABLE = yes # Audio control and System control |
12 | CONSOLE_ENABLE = yes # Console for debug | 12 | CONSOLE_ENABLE = yes # Console for debug |
13 | COMMAND_ENABLE = yes # Commands for debug and configuration | 13 | COMMAND_ENABLE = yes # Commands for debug and configuration |
14 | SLEEP_LED_ENABLE = yes # Breathing sleep LED during USB suspend | 14 | SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend |
15 | NKRO_ENABLE = yes # USB Nkey Rollover | 15 | NKRO_ENABLE = yes # USB Nkey Rollover |
16 | CUSTOM_MATRIX = no # Custom matrix file | 16 | CUSTOM_MATRIX = no # Custom matrix file |
17 | BACKLIGHT_ENABLE = yes | 17 | BACKLIGHT_ENABLE = yes |
diff --git a/keyboards/cannonkeys/tmov2/rules.mk b/keyboards/cannonkeys/tmov2/rules.mk index 9b29e8fd1..294c873ee 100644 --- a/keyboards/cannonkeys/tmov2/rules.mk +++ b/keyboards/cannonkeys/tmov2/rules.mk | |||
@@ -11,7 +11,7 @@ MOUSEKEY_ENABLE = yes # Mouse keys | |||
11 | EXTRAKEY_ENABLE = yes # Audio control and System control | 11 | EXTRAKEY_ENABLE = yes # Audio control and System control |
12 | CONSOLE_ENABLE = yes # Console for debug | 12 | CONSOLE_ENABLE = yes # Console for debug |
13 | COMMAND_ENABLE = yes # Commands for debug and configuration | 13 | COMMAND_ENABLE = yes # Commands for debug and configuration |
14 | SLEEP_LED_ENABLE = yes # Breathing sleep LED during USB suspend | 14 | SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend |
15 | NKRO_ENABLE = yes # USB Nkey Rollover | 15 | NKRO_ENABLE = yes # USB Nkey Rollover |
16 | CUSTOM_MATRIX = no # Custom matrix file | 16 | CUSTOM_MATRIX = no # Custom matrix file |
17 | BACKLIGHT_ENABLE = yes | 17 | BACKLIGHT_ENABLE = yes |
diff --git a/keyboards/cannonkeys/tsukuyomi/rules.mk b/keyboards/cannonkeys/tsukuyomi/rules.mk index ce881f198..4e7791a79 100644 --- a/keyboards/cannonkeys/tsukuyomi/rules.mk +++ b/keyboards/cannonkeys/tsukuyomi/rules.mk | |||
@@ -10,7 +10,7 @@ EXTRAKEY_ENABLE = yes # Audio control and System control | |||
10 | CONSOLE_ENABLE = yes # Console for debug | 10 | CONSOLE_ENABLE = yes # Console for debug |
11 | COMMAND_ENABLE = yes # Commands for debug and configuration | 11 | COMMAND_ENABLE = yes # Commands for debug and configuration |
12 | # Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE | 12 | # Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE |
13 | SLEEP_LED_ENABLE = yes # Breathing sleep LED during USB suspend | 13 | SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend |
14 | # if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work | 14 | # if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work |
15 | NKRO_ENABLE = yes # USB Nkey Rollover | 15 | NKRO_ENABLE = yes # USB Nkey Rollover |
16 | BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality | 16 | BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality |
diff --git a/keyboards/daji/seis_cinco/rules.mk b/keyboards/daji/seis_cinco/rules.mk index fa34092cd..768e50069 100644 --- a/keyboards/daji/seis_cinco/rules.mk +++ b/keyboards/daji/seis_cinco/rules.mk | |||
@@ -11,7 +11,7 @@ EXTRAKEY_ENABLE = yes # Audio control and System control | |||
11 | CONSOLE_ENABLE = no # Console for debug | 11 | CONSOLE_ENABLE = no # Console for debug |
12 | COMMAND_ENABLE = no # Commands for debug and configuration | 12 | COMMAND_ENABLE = no # Commands for debug and configuration |
13 | # Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE | 13 | # Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE |
14 | SLEEP_LED_ENABLE = yes # Breathing sleep LED during USB suspend | 14 | SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend |
15 | # if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work | 15 | # if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work |
16 | NKRO_ENABLE = yes # USB Nkey Rollover | 16 | NKRO_ENABLE = yes # USB Nkey Rollover |
17 | BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality | 17 | BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality |
diff --git a/keyboards/handwired/ck4x4/rules.mk b/keyboards/handwired/ck4x4/rules.mk index 0709f341b..e5785270b 100644 --- a/keyboards/handwired/ck4x4/rules.mk +++ b/keyboards/handwired/ck4x4/rules.mk | |||
@@ -10,7 +10,7 @@ MOUSEKEY_ENABLE = yes # Mouse keys | |||
10 | EXTRAKEY_ENABLE = yes # Audio control and System control | 10 | EXTRAKEY_ENABLE = yes # Audio control and System control |
11 | CONSOLE_ENABLE = yes # Console for debug | 11 | CONSOLE_ENABLE = yes # Console for debug |
12 | COMMAND_ENABLE = yes # Commands for debug and configuration | 12 | COMMAND_ENABLE = yes # Commands for debug and configuration |
13 | SLEEP_LED_ENABLE = yes # Breathing sleep LED during USB suspend | 13 | SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend |
14 | NKRO_ENABLE = yes # USB Nkey Rollover | 14 | NKRO_ENABLE = yes # USB Nkey Rollover |
15 | CUSTOM_MATRIX = no # Custom matrix file | 15 | CUSTOM_MATRIX = no # Custom matrix file |
16 | 16 | ||
diff --git a/keyboards/handwired/onekey/rules.mk b/keyboards/handwired/onekey/rules.mk index 259050d55..df2ec1ecf 100644 --- a/keyboards/handwired/onekey/rules.mk +++ b/keyboards/handwired/onekey/rules.mk | |||
@@ -7,9 +7,9 @@ EXTRAKEY_ENABLE = yes # Audio control and System control(+450) | |||
7 | CONSOLE_ENABLE = yes # Console for debug(+400) | 7 | CONSOLE_ENABLE = yes # Console for debug(+400) |
8 | COMMAND_ENABLE = no # Commands for debug and configuration | 8 | COMMAND_ENABLE = no # Commands for debug and configuration |
9 | # Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE | 9 | # Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE |
10 | SLEEP_LED_ENABLE = yes # Breathing sleep LED during USB suspend | 10 | SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend |
11 | # if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work | 11 | # if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work |
12 | NKRO_ENABLE = yes # USB Nkey Rollover | 12 | NKRO_ENABLE = yes # USB Nkey Rollover |
13 | BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality on B7 by default | 13 | BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality on B7 by default |
14 | RGBLIGHT_ENABLE = no # Enable keyboard RGB underglow | 14 | RGBLIGHT_ENABLE = no # Enable keyboard RGB underglow |
15 | MIDI_ENABLE = no # MIDI support (+2400 to 4200, depending on config) | 15 | MIDI_ENABLE = no # MIDI support (+2400 to 4200, depending on config) |
diff --git a/keyboards/projectkb/alice/config.h b/keyboards/projectkb/alice/config.h new file mode 100644 index 000000000..95fb682e1 --- /dev/null +++ b/keyboards/projectkb/alice/config.h | |||
@@ -0,0 +1,3 @@ | |||
1 | #pragma once | ||
2 | |||
3 | #define SLEEP_LED_GPT_DRIVER GPTD1 | ||
diff --git a/keyboards/projectkb/alice/halconf.h b/keyboards/projectkb/alice/halconf.h index b17808ffe..0016e53ba 100644 --- a/keyboards/projectkb/alice/halconf.h +++ b/keyboards/projectkb/alice/halconf.h | |||
@@ -27,5 +27,7 @@ | |||
27 | 27 | ||
28 | #define HAL_USE_SPI TRUE | 28 | #define HAL_USE_SPI TRUE |
29 | 29 | ||
30 | #define HAL_USE_GPT TRUE | ||
31 | |||
30 | #include_next <halconf.h> | 32 | #include_next <halconf.h> |
31 | 33 | ||
diff --git a/keyboards/projectkb/alice/mcuconf.h b/keyboards/projectkb/alice/mcuconf.h index 4bfc7f946..6e0f1a50d 100644 --- a/keyboards/projectkb/alice/mcuconf.h +++ b/keyboards/projectkb/alice/mcuconf.h | |||
@@ -32,3 +32,5 @@ | |||
32 | #undef STM32_SPI_USE_SPI2 | 32 | #undef STM32_SPI_USE_SPI2 |
33 | #define STM32_SPI_USE_SPI2 TRUE | 33 | #define STM32_SPI_USE_SPI2 TRUE |
34 | 34 | ||
35 | #undef STM32_GPT_USE_TIM1 | ||
36 | #define STM32_GPT_USE_TIM1 TRUE | ||
diff --git a/keyboards/projectkb/signature87/rules.mk b/keyboards/projectkb/signature87/rules.mk index fe0d976d1..caad4c83c 100644 --- a/keyboards/projectkb/signature87/rules.mk +++ b/keyboards/projectkb/signature87/rules.mk | |||
@@ -9,7 +9,7 @@ MOUSEKEY_ENABLE = yes # Mouse keys | |||
9 | EXTRAKEY_ENABLE = yes # Audio control and System control | 9 | EXTRAKEY_ENABLE = yes # Audio control and System control |
10 | CONSOLE_ENABLE = yes # Console for debug | 10 | CONSOLE_ENABLE = yes # Console for debug |
11 | COMMAND_ENABLE = yes # Commands for debug and configuration | 11 | COMMAND_ENABLE = yes # Commands for debug and configuration |
12 | SLEEP_LED_ENABLE = yes # Breathing sleep LED during USB suspend | 12 | SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend |
13 | NKRO_ENABLE = yes # USB Nkey Rollover | 13 | NKRO_ENABLE = yes # USB Nkey Rollover |
14 | BACKLIGHT_ENABLE = no | 14 | BACKLIGHT_ENABLE = no |
15 | 15 | ||
diff --git a/keyboards/ramonimbao/wete/config.h b/keyboards/ramonimbao/wete/config.h index 5d68a7efd..3d8955009 100644 --- a/keyboards/ramonimbao/wete/config.h +++ b/keyboards/ramonimbao/wete/config.h | |||
@@ -46,6 +46,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. | |||
46 | #define RGBLED_NUM 24 | 46 | #define RGBLED_NUM 24 |
47 | #define RGBLIGHT_ANIMATIONS | 47 | #define RGBLIGHT_ANIMATIONS |
48 | 48 | ||
49 | #define SLEEP_LED_GPT_DRIVER GPTD1 | ||
50 | |||
49 | /* define if matrix has ghost */ | 51 | /* define if matrix has ghost */ |
50 | //#define MATRIX_HAS_GHOST | 52 | //#define MATRIX_HAS_GHOST |
51 | 53 | ||
diff --git a/keyboards/ramonimbao/wete/halconf.h b/keyboards/ramonimbao/wete/halconf.h index c43440a45..b3de873be 100644 --- a/keyboards/ramonimbao/wete/halconf.h +++ b/keyboards/ramonimbao/wete/halconf.h | |||
@@ -23,5 +23,7 @@ | |||
23 | 23 | ||
24 | #define HAL_USE_PWM TRUE | 24 | #define HAL_USE_PWM TRUE |
25 | 25 | ||
26 | #define HAL_USE_GPT TRUE | ||
27 | |||
26 | #include_next <halconf.h> | 28 | #include_next <halconf.h> |
27 | 29 | ||
diff --git a/keyboards/ramonimbao/wete/mcuconf.h b/keyboards/ramonimbao/wete/mcuconf.h index b7f2c481c..7a2e87776 100644 --- a/keyboards/ramonimbao/wete/mcuconf.h +++ b/keyboards/ramonimbao/wete/mcuconf.h | |||
@@ -35,3 +35,5 @@ | |||
35 | #undef STM32_SPI_USE_SPI2 | 35 | #undef STM32_SPI_USE_SPI2 |
36 | #define STM32_SPI_USE_SPI2 TRUE | 36 | #define STM32_SPI_USE_SPI2 TRUE |
37 | 37 | ||
38 | #undef STM32_GPT_USE_TIM1 | ||
39 | #define STM32_GPT_USE_TIM1 TRUE | ||
diff --git a/keyboards/westfoxtrot/prophet/config.h b/keyboards/westfoxtrot/prophet/config.h index 4f447e4ca..0f2ddc1dc 100644 --- a/keyboards/westfoxtrot/prophet/config.h +++ b/keyboards/westfoxtrot/prophet/config.h | |||
@@ -30,3 +30,5 @@ | |||
30 | #define LOCKING_SUPPORT_ENABLE | 30 | #define LOCKING_SUPPORT_ENABLE |
31 | /* Locking resynchronize hack */ | 31 | /* Locking resynchronize hack */ |
32 | #define LOCKING_RESYNC_ENABLE | 32 | #define LOCKING_RESYNC_ENABLE |
33 | |||
34 | #define SLEEP_LED_GPT_DRIVER GPTD1 | ||
diff --git a/keyboards/westfoxtrot/prophet/halconf.h b/keyboards/westfoxtrot/prophet/halconf.h new file mode 100644 index 000000000..cbfd1307f --- /dev/null +++ b/keyboards/westfoxtrot/prophet/halconf.h | |||
@@ -0,0 +1,27 @@ | |||
1 | /* Copyright 2020 QMK | ||
2 | * | ||
3 | * This program is free software: you can redistribute it and/or modify | ||
4 | * it under the terms of the GNU General Public License as published by | ||
5 | * the Free Software Foundation, either version 2 of the License, or | ||
6 | * (at your option) any later version. | ||
7 | * | ||
8 | * This program is distributed in the hope that it will be useful, | ||
9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
11 | * GNU General Public License for more details. | ||
12 | * | ||
13 | * You should have received a copy of the GNU General Public License | ||
14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
15 | */ | ||
16 | |||
17 | /* | ||
18 | * This file was auto-generated by: | ||
19 | * `qmk chibios-confmigrate -i keyboards/projectkb/alice/halconf.h -r platforms/chibios/common/configs/halconf.h` | ||
20 | */ | ||
21 | |||
22 | #pragma once | ||
23 | |||
24 | #define HAL_USE_GPT TRUE | ||
25 | |||
26 | #include_next <halconf.h> | ||
27 | |||
diff --git a/keyboards/westfoxtrot/prophet/mcuconf.h b/keyboards/westfoxtrot/prophet/mcuconf.h index 2665f9c9e..550141af6 100644 --- a/keyboards/westfoxtrot/prophet/mcuconf.h +++ b/keyboards/westfoxtrot/prophet/mcuconf.h | |||
@@ -23,6 +23,5 @@ | |||
23 | 23 | ||
24 | #include_next <mcuconf.h> | 24 | #include_next <mcuconf.h> |
25 | 25 | ||
26 | #undef STM32_PWM_USE_TIM3 | 26 | #undef STM32_GPT_USE_TIM1 |
27 | #define STM32_PWM_USE_TIM3 TRUE | 27 | #define STM32_GPT_USE_TIM1 TRUE |
28 | |||
diff --git a/tmk_core/common/chibios/sleep_led.c b/tmk_core/common/chibios/sleep_led.c index 5595eec0e..477056a45 100644 --- a/tmk_core/common/chibios/sleep_led.c +++ b/tmk_core/common/chibios/sleep_led.c | |||
@@ -9,21 +9,13 @@ | |||
9 | * Use LP timer on Kinetises, TIM14 on STM32F0. | 9 | * Use LP timer on Kinetises, TIM14 on STM32F0. |
10 | */ | 10 | */ |
11 | 11 | ||
12 | #if defined(KL2x) || defined(K20x) | 12 | #ifndef SLEEP_LED_GPT_DRIVER |
13 | 13 | # if defined(STM32F0XX) | |
14 | /* Use Low Power Timer (LPTMR) */ | 14 | # define SLEEP_LED_GPT_DRIVER GPTD14 |
15 | # define TIMER_INTERRUPT_VECTOR KINETIS_LPTMR0_IRQ_VECTOR | 15 | # endif |
16 | # define RESET_COUNTER LPTMR0->CSR |= LPTMRx_CSR_TCF | ||
17 | |||
18 | #elif defined(STM32F0XX) | ||
19 | |||
20 | /* Use TIM14 manually */ | ||
21 | # define TIMER_INTERRUPT_VECTOR STM32_TIM14_HANDLER | ||
22 | # define RESET_COUNTER STM32_TIM14->SR &= ~STM32_TIM_SR_UIF | ||
23 | |||
24 | #endif | 16 | #endif |
25 | 17 | ||
26 | #if defined(KL2x) || defined(K20x) || defined(STM32F0XX) /* common parts for timers/interrupts */ | 18 | #if defined(KL2x) || defined(K20x) || defined(SLEEP_LED_GPT_DRIVER) /* common parts for timers/interrupts */ |
27 | 19 | ||
28 | /* Breathing Sleep LED brighness(PWM On period) table | 20 | /* Breathing Sleep LED brighness(PWM On period) table |
29 | * (64[steps] * 4[duration]) / 64[PWM periods/s] = 4 second breath cycle | 21 | * (64[steps] * 4[duration]) / 64[PWM periods/s] = 4 second breath cycle |
@@ -33,10 +25,7 @@ | |||
33 | */ | 25 | */ |
34 | static const uint8_t breathing_table[64] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 4, 6, 10, 15, 23, 32, 44, 58, 74, 93, 113, 135, 157, 179, 199, 218, 233, 245, 252, 255, 252, 245, 233, 218, 199, 179, 157, 135, 113, 93, 74, 58, 44, 32, 23, 15, 10, 6, 4, 2, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; | 26 | static const uint8_t breathing_table[64] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 4, 6, 10, 15, 23, 32, 44, 58, 74, 93, 113, 135, 157, 179, 199, 218, 233, 245, 252, 255, 252, 245, 233, 218, 199, 179, 157, 135, 113, 93, 74, 58, 44, 32, 23, 15, 10, 6, 4, 2, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; |
35 | 27 | ||
36 | /* interrupt handler */ | 28 | void sleep_led_timer_callback(void) { |
37 | OSAL_IRQ_HANDLER(TIMER_INTERRUPT_VECTOR) { | ||
38 | OSAL_IRQ_PROLOGUE(); | ||
39 | |||
40 | /* Software PWM | 29 | /* Software PWM |
41 | * timer:1111 1111 1111 1111 | 30 | * timer:1111 1111 1111 1111 |
42 | * \_____/\/ \_______/____ count(0-255) | 31 | * \_____/\/ \_______/____ count(0-255) |
@@ -64,17 +53,16 @@ OSAL_IRQ_HANDLER(TIMER_INTERRUPT_VECTOR) { | |||
64 | if (timer.pwm.count == breathing_table[timer.pwm.index]) { | 53 | if (timer.pwm.count == breathing_table[timer.pwm.index]) { |
65 | led_set(0); | 54 | led_set(0); |
66 | } | 55 | } |
67 | |||
68 | /* Reset the counter */ | ||
69 | RESET_COUNTER; | ||
70 | |||
71 | OSAL_IRQ_EPILOGUE(); | ||
72 | } | 56 | } |
73 | 57 | ||
74 | #endif /* common parts for known platforms */ | 58 | #endif /* common parts for known platforms */ |
75 | 59 | ||
76 | #if defined(KL2x) || defined(K20x) /* platform selection: familiar Kinetis chips */ | 60 | #if defined(KL2x) || defined(K20x) /* platform selection: familiar Kinetis chips */ |
77 | 61 | ||
62 | /* Use Low Power Timer (LPTMR) */ | ||
63 | # define TIMER_INTERRUPT_VECTOR KINETIS_LPTMR0_IRQ_VECTOR | ||
64 | # define RESET_COUNTER LPTMR0->CSR |= LPTMRx_CSR_TCF | ||
65 | |||
78 | /* LPTMR clock options */ | 66 | /* LPTMR clock options */ |
79 | # define LPTMR_CLOCK_MCGIRCLK 0 /* 4MHz clock */ | 67 | # define LPTMR_CLOCK_MCGIRCLK 0 /* 4MHz clock */ |
80 | # define LPTMR_CLOCK_LPO 1 /* 1kHz clock */ | 68 | # define LPTMR_CLOCK_LPO 1 /* 1kHz clock */ |
@@ -86,6 +74,18 @@ OSAL_IRQ_HANDLER(TIMER_INTERRUPT_VECTOR) { | |||
86 | # define SIM_SCGC5_LPTMR SIM_SCGC5_LPTIMER | 74 | # define SIM_SCGC5_LPTMR SIM_SCGC5_LPTIMER |
87 | # endif | 75 | # endif |
88 | 76 | ||
77 | /* interrupt handler */ | ||
78 | OSAL_IRQ_HANDLER(TIMER_INTERRUPT_VECTOR) { | ||
79 | OSAL_IRQ_PROLOGUE(); | ||
80 | |||
81 | sleep_led_timer_callback(); | ||
82 | |||
83 | /* Reset the counter */ | ||
84 | RESET_COUNTER; | ||
85 | |||
86 | OSAL_IRQ_EPILOGUE(); | ||
87 | } | ||
88 | |||
89 | /* Initialise the timer */ | 89 | /* Initialise the timer */ |
90 | void sleep_led_init(void) { | 90 | void sleep_led_init(void) { |
91 | /* Make sure the clock to the LPTMR is enabled */ | 91 | /* Make sure the clock to the LPTMR is enabled */ |
@@ -159,45 +159,23 @@ void sleep_led_toggle(void) { | |||
159 | LPTMR0->CSR ^= LPTMRx_CSR_TEN; | 159 | LPTMR0->CSR ^= LPTMRx_CSR_TEN; |
160 | } | 160 | } |
161 | 161 | ||
162 | #elif defined(STM32F0XX) /* platform selection: STM32F0XX */ | 162 | #elif defined(SLEEP_LED_GPT_DRIVER) |
163 | |||
164 | /* Initialise the timer */ | ||
165 | void sleep_led_init(void) { | ||
166 | /* enable clock */ | ||
167 | rccEnableTIM14(FALSE); /* low power enable = FALSE */ | ||
168 | rccResetTIM14(); | ||
169 | |||
170 | /* prescale */ | ||
171 | /* Assuming 48MHz internal clock */ | ||
172 | /* getting cca 65484 irqs/sec */ | ||
173 | STM32_TIM14->PSC = 733; | ||
174 | 163 | ||
175 | /* auto-reload */ | 164 | static void gptTimerCallback(GPTDriver *gptp) { |
176 | /* 0 => interrupt every time */ | 165 | (void)gptp; |
177 | STM32_TIM14->ARR = 3; | 166 | sleep_led_timer_callback(); |
167 | } | ||
178 | 168 | ||
179 | /* enable counter update event interrupt */ | 169 | static const GPTConfig gptcfg = {1000000, gptTimerCallback, 0, 0}; |
180 | STM32_TIM14->DIER |= STM32_TIM_DIER_UIE; | ||
181 | 170 | ||
182 | /* register interrupt vector */ | 171 | /* Initialise the timer */ |
183 | nvicEnableVector(STM32_TIM14_NUMBER, 2); /* vector, priority */ | 172 | void sleep_led_init(void) { gptStart(&SLEEP_LED_GPT_DRIVER, &gptcfg); } |
184 | } | ||
185 | 173 | ||
186 | void sleep_led_enable(void) { | 174 | void sleep_led_enable(void) { gptStartContinuous(&SLEEP_LED_GPT_DRIVER, gptcfg.frequency / 0xFFFF); } |
187 | /* Enable the timer */ | ||
188 | STM32_TIM14->CR1 = STM32_TIM_CR1_CEN | STM32_TIM_CR1_URS; | ||
189 | /* URS => update event only on overflow; setting UG bit disabled */ | ||
190 | } | ||
191 | 175 | ||
192 | void sleep_led_disable(void) { | 176 | void sleep_led_disable(void) { gptStopTimer(&SLEEP_LED_GPT_DRIVER); } |
193 | /* Disable the timer */ | ||
194 | STM32_TIM14->CR1 = 0; | ||
195 | } | ||
196 | 177 | ||
197 | void sleep_led_toggle(void) { | 178 | void sleep_led_toggle(void) { (SLEEP_LED_GPT_DRIVER.state == GPT_READY) ? sleep_led_enable() : sleep_led_disable(); } |
198 | /* Toggle the timer */ | ||
199 | STM32_TIM14->CR1 ^= STM32_TIM_CR1_CEN; | ||
200 | } | ||
201 | 179 | ||
202 | #else /* platform selection: not on familiar chips */ | 180 | #else /* platform selection: not on familiar chips */ |
203 | 181 | ||