aboutsummaryrefslogtreecommitdiff
path: root/keyboards/matrix
diff options
context:
space:
mode:
authoryulei <yuleiz@gmail.com>2020-03-07 21:19:06 +0800
committerGitHub <noreply@github.com>2020-03-07 13:19:06 +0000
commite0d15e6182a331ed27535f81539f2d7243d02bc0 (patch)
treea56d2c479654151aaf3bedd253db705a81c54b9b /keyboards/matrix
parent3a303bd2aec57fd2d4d0f6d3e5583d746367d6e1 (diff)
downloadqmk_firmware-e0d15e6182a331ed27535f81539f2d7243d02bc0.tar.gz
qmk_firmware-e0d15e6182a331ed27535f81539f2d7243d02bc0.zip
fixed #8259 (#8333)
Diffstat (limited to 'keyboards/matrix')
-rw-r--r--keyboards/matrix/noah/boards/noah_bd/board.mk4
-rw-r--r--keyboards/matrix/noah/config.h16
-rw-r--r--keyboards/matrix/noah/halconf.h4
-rw-r--r--keyboards/matrix/noah/matrix.c2
-rw-r--r--keyboards/matrix/noah/mcuconf.h61
-rw-r--r--keyboards/matrix/noah/noah.c27
-rw-r--r--keyboards/matrix/noah/rules.mk10
7 files changed, 52 insertions, 72 deletions
diff --git a/keyboards/matrix/noah/boards/noah_bd/board.mk b/keyboards/matrix/noah/boards/noah_bd/board.mk
index e4cd10acf..185f9e1e9 100644
--- a/keyboards/matrix/noah/boards/noah_bd/board.mk
+++ b/keyboards/matrix/noah/boards/noah_bd/board.mk
@@ -3,3 +3,7 @@ BOARDSRC = $(BOARD_PATH)/boards/noah_bd/board.c
3 3
4# Required include directories 4# Required include directories
5BOARDINC = $(BOARD_PATH)/boards/noah_bd 5BOARDINC = $(BOARD_PATH)/boards/noah_bd
6
7# Shared variables
8ALLCSRC += $(BOARDSRC)
9ALLINC += $(BOARDINC)
diff --git a/keyboards/matrix/noah/config.h b/keyboards/matrix/noah/config.h
index ccedd43cc..796e45e2f 100644
--- a/keyboards/matrix/noah/config.h
+++ b/keyboards/matrix/noah/config.h
@@ -17,8 +17,12 @@
17#define MATRIX_ROWS 5 17#define MATRIX_ROWS 5
18#define MATRIX_COLS 15 18#define MATRIX_COLS 15
19 19
20#define MATRIX_ROW_PINS { B0, A1, C14, C13, A0}
21#define MATRIX_COL_PINS { C15, B10, B7, B6, B5, B4, A15, A10, A9, A8, B15, B14, B13, B12, B2}
22#define UNUSED_PINS
23
20#define DIODE_DIRECTION COL2ROW 24#define DIODE_DIRECTION COL2ROW
21#define DEBOUNCING_DELAY 5 25#define DEBOUNCE 5
22 26
23// i2c setting 27// i2c setting
24#define USE_I2CV1 28#define USE_I2CV1
@@ -37,13 +41,11 @@
37#define DRIVER_LED_TOTAL (DRIVER_1_LED_TOTAL + DRIVER_2_LED_TOTAL) 41#define DRIVER_LED_TOTAL (DRIVER_1_LED_TOTAL + DRIVER_2_LED_TOTAL)
38 42
39/* indicator rgb */ 43/* indicator rgb */
40#define WS2812_LED_N 7 44#define RGBLED_NUM 7
41#define RGBLED_NUM WS2812_LED_N
42#define RGB_DI_PIN B1 45#define RGB_DI_PIN B1
43#define RGBLIGHT_ANIMATIONS 46#define RGBLIGHT_ANIMATIONS
44//#define WS2812_EXTERNAL_PULLUP
45 47
46// tapping setting 48// tapping setting
47#define TAPPING_TERM 200 49//#define TAPPING_TERM 200
48#define RETRO_TAPPING 50//#define RETRO_TAPPING
49#define PERMISSIVE_HOLD 51//#define PERMISSIVE_HOLD
diff --git a/keyboards/matrix/noah/halconf.h b/keyboards/matrix/noah/halconf.h
index 2fccb45e1..34501edfd 100644
--- a/keyboards/matrix/noah/halconf.h
+++ b/keyboards/matrix/noah/halconf.h
@@ -72,7 +72,7 @@
72 * @brief Enables the GPT subsystem. 72 * @brief Enables the GPT subsystem.
73 */ 73 */
74#if !defined(HAL_USE_GPT) || defined(__DOXYGEN__) 74#if !defined(HAL_USE_GPT) || defined(__DOXYGEN__)
75#define HAL_USE_GPT TRUE 75#define HAL_USE_GPT FALSE
76#endif 76#endif
77 77
78/** 78/**
@@ -114,7 +114,7 @@
114 * @brief Enables the PWM subsystem. 114 * @brief Enables the PWM subsystem.
115 */ 115 */
116#if !defined(HAL_USE_PWM) || defined(__DOXYGEN__) 116#if !defined(HAL_USE_PWM) || defined(__DOXYGEN__)
117#define HAL_USE_PWM TRUE 117#define HAL_USE_PWM FALSE
118#endif 118#endif
119 119
120/** 120/**
diff --git a/keyboards/matrix/noah/matrix.c b/keyboards/matrix/noah/matrix.c
index 02861a8e3..737f570c1 100644
--- a/keyboards/matrix/noah/matrix.c
+++ b/keyboards/matrix/noah/matrix.c
@@ -130,7 +130,7 @@ uint8_t matrix_scan(void)
130 } 130 }
131 } 131 }
132 132
133 if (debouncing && timer_elapsed(debouncing_time) > DEBOUNCING_DELAY) { 133 if (debouncing && timer_elapsed(debouncing_time) > DEBOUNCE) {
134 for (int row = 0; row < MATRIX_ROWS; row++) { 134 for (int row = 0; row < MATRIX_ROWS; row++) {
135 matrix[row] = 0; 135 matrix[row] = 0;
136 for (int col = 0; col < MATRIX_COLS; col++) { 136 for (int col = 0; col < MATRIX_COLS; col++) {
diff --git a/keyboards/matrix/noah/mcuconf.h b/keyboards/matrix/noah/mcuconf.h
index 8405d61e1..54a1f2661 100644
--- a/keyboards/matrix/noah/mcuconf.h
+++ b/keyboards/matrix/noah/mcuconf.h
@@ -1,5 +1,5 @@
1/* 1/*
2 ChibiOS - Copyright (C) 2006..2016 Giovanni Di Sirio 2 ChibiOS - Copyright (C) 2006..2018 Giovanni Di Sirio
3 3
4 Licensed under the Apache License, Version 2.0 (the "License"); 4 Licensed under the Apache License, Version 2.0 (the "License");
5 you may not use this file except in compliance with the License. 5 you may not use this file except in compliance with the License.
@@ -57,14 +57,32 @@
57#define STM32_MCO1PRE STM32_MCO1PRE_DIV1 57#define STM32_MCO1PRE STM32_MCO1PRE_DIV1
58#define STM32_MCO2SEL STM32_MCO2SEL_SYSCLK 58#define STM32_MCO2SEL STM32_MCO2SEL_SYSCLK
59#define STM32_MCO2PRE STM32_MCO2PRE_DIV5 59#define STM32_MCO2PRE STM32_MCO2PRE_DIV5
60#define STM32_I2SSRC STM32_I2SSRC_PLLI2S 60#define STM32_I2SSRC STM32_I2SSRC_CKIN
61#define STM32_PLLI2SN_VALUE 192 61#define STM32_PLLI2SN_VALUE 192
62#define STM32_PLLI2SR_VALUE 2 62#define STM32_PLLI2SR_VALUE 5
63#define STM32_PVD_ENABLE FALSE 63#define STM32_PVD_ENABLE FALSE
64#define STM32_PLS STM32_PLS_LEV0 64#define STM32_PLS STM32_PLS_LEV0
65#define STM32_BKPRAM_ENABLE FALSE 65#define STM32_BKPRAM_ENABLE FALSE
66 66
67/* 67/*
68 * IRQ system settings.
69 */
70#define STM32_IRQ_EXTI0_PRIORITY 6
71#define STM32_IRQ_EXTI1_PRIORITY 6
72#define STM32_IRQ_EXTI2_PRIORITY 6
73#define STM32_IRQ_EXTI3_PRIORITY 6
74#define STM32_IRQ_EXTI4_PRIORITY 6
75#define STM32_IRQ_EXTI5_9_PRIORITY 6
76#define STM32_IRQ_EXTI10_15_PRIORITY 6
77#define STM32_IRQ_EXTI16_PRIORITY 6
78#define STM32_IRQ_EXTI17_PRIORITY 15
79#define STM32_IRQ_EXTI18_PRIORITY 6
80#define STM32_IRQ_EXTI19_PRIORITY 6
81#define STM32_IRQ_EXTI20_PRIORITY 6
82#define STM32_IRQ_EXTI21_PRIORITY 15
83#define STM32_IRQ_EXTI22_PRIORITY 15
84
85/*
68 * ADC driver system settings. 86 * ADC driver system settings.
69 */ 87 */
70#define STM32_ADC_ADCPRE ADC_CCR_ADCPRE_DIV4 88#define STM32_ADC_ADCPRE ADC_CCR_ADCPRE_DIV4
@@ -75,22 +93,6 @@
75#define STM32_ADC_ADC1_DMA_IRQ_PRIORITY 6 93#define STM32_ADC_ADC1_DMA_IRQ_PRIORITY 6
76 94
77/* 95/*
78 * EXT driver system settings.
79 */
80#define STM32_EXT_EXTI0_IRQ_PRIORITY 6
81#define STM32_EXT_EXTI1_IRQ_PRIORITY 6
82#define STM32_EXT_EXTI2_IRQ_PRIORITY 6
83#define STM32_EXT_EXTI3_IRQ_PRIORITY 6
84#define STM32_EXT_EXTI4_IRQ_PRIORITY 6
85#define STM32_EXT_EXTI5_9_IRQ_PRIORITY 6
86#define STM32_EXT_EXTI10_15_IRQ_PRIORITY 6
87#define STM32_EXT_EXTI16_IRQ_PRIORITY 6
88#define STM32_EXT_EXTI17_IRQ_PRIORITY 15
89#define STM32_EXT_EXTI18_IRQ_PRIORITY 6
90#define STM32_EXT_EXTI19_IRQ_PRIORITY 6
91#define STM32_EXT_EXTI22_IRQ_PRIORITY 15
92
93/*
94 * GPT driver system settings. 96 * GPT driver system settings.
95 */ 97 */
96#define STM32_GPT_USE_TIM1 FALSE 98#define STM32_GPT_USE_TIM1 FALSE
@@ -164,9 +166,9 @@
164 * PWM driver system settings. 166 * PWM driver system settings.
165 */ 167 */
166#define STM32_PWM_USE_ADVANCED FALSE 168#define STM32_PWM_USE_ADVANCED FALSE
167#define STM32_PWM_USE_TIM1 TRUE 169#define STM32_PWM_USE_TIM1 FALSE
168#define STM32_PWM_USE_TIM2 FALSE 170#define STM32_PWM_USE_TIM2 FALSE
169#define STM32_PWM_USE_TIM3 TRUE 171#define STM32_PWM_USE_TIM3 FALSE
170#define STM32_PWM_USE_TIM4 FALSE 172#define STM32_PWM_USE_TIM4 FALSE
171#define STM32_PWM_USE_TIM5 FALSE 173#define STM32_PWM_USE_TIM5 FALSE
172#define STM32_PWM_USE_TIM9 FALSE 174#define STM32_PWM_USE_TIM9 FALSE
@@ -182,11 +184,9 @@
182 */ 184 */
183#define STM32_SERIAL_USE_USART1 FALSE 185#define STM32_SERIAL_USE_USART1 FALSE
184#define STM32_SERIAL_USE_USART2 FALSE 186#define STM32_SERIAL_USE_USART2 FALSE
185#define STM32_SERIAL_USE_USART3 FALSE
186#define STM32_SERIAL_USE_USART6 FALSE 187#define STM32_SERIAL_USE_USART6 FALSE
187#define STM32_SERIAL_USART1_PRIORITY 12 188#define STM32_SERIAL_USART1_PRIORITY 12
188#define STM32_SERIAL_USART2_PRIORITY 12 189#define STM32_SERIAL_USART2_PRIORITY 12
189#define STM32_SERIAL_USART3_PRIORITY 12
190#define STM32_SERIAL_USART6_PRIORITY 12 190#define STM32_SERIAL_USART6_PRIORITY 12
191 191
192/* 192/*
@@ -195,28 +195,18 @@
195#define STM32_SPI_USE_SPI1 TRUE 195#define STM32_SPI_USE_SPI1 TRUE
196#define STM32_SPI_USE_SPI2 FALSE 196#define STM32_SPI_USE_SPI2 FALSE
197#define STM32_SPI_USE_SPI3 FALSE 197#define STM32_SPI_USE_SPI3 FALSE
198#define STM32_SPI_USE_SPI4 FALSE
199#define STM32_SPI_USE_SPI5 FALSE
200#define STM32_SPI_SPI1_RX_DMA_STREAM STM32_DMA_STREAM_ID(2, 0) 198#define STM32_SPI_SPI1_RX_DMA_STREAM STM32_DMA_STREAM_ID(2, 0)
201#define STM32_SPI_SPI1_TX_DMA_STREAM STM32_DMA_STREAM_ID(2, 3) 199#define STM32_SPI_SPI1_TX_DMA_STREAM STM32_DMA_STREAM_ID(2, 3)
202#define STM32_SPI_SPI2_RX_DMA_STREAM STM32_DMA_STREAM_ID(1, 3) 200#define STM32_SPI_SPI2_RX_DMA_STREAM STM32_DMA_STREAM_ID(1, 3)
203#define STM32_SPI_SPI2_TX_DMA_STREAM STM32_DMA_STREAM_ID(1, 4) 201#define STM32_SPI_SPI2_TX_DMA_STREAM STM32_DMA_STREAM_ID(1, 4)
204#define STM32_SPI_SPI3_RX_DMA_STREAM STM32_DMA_STREAM_ID(1, 0) 202#define STM32_SPI_SPI3_RX_DMA_STREAM STM32_DMA_STREAM_ID(1, 0)
205#define STM32_SPI_SPI3_TX_DMA_STREAM STM32_DMA_STREAM_ID(1, 7) 203#define STM32_SPI_SPI3_TX_DMA_STREAM STM32_DMA_STREAM_ID(1, 7)
206#define STM32_SPI_SPI4_RX_DMA_STREAM STM32_DMA_STREAM_ID(2, 4)
207#define STM32_SPI_SPI4_TX_DMA_STREAM STM32_DMA_STREAM_ID(2, 1)
208#define STM32_SPI_SPI5_RX_DMA_STREAM STM32_DMA_STREAM_ID(2, 5)
209#define STM32_SPI_SPI5_TX_DMA_STREAM STM32_DMA_STREAM_ID(2, 6)
210#define STM32_SPI_SPI1_DMA_PRIORITY 1 204#define STM32_SPI_SPI1_DMA_PRIORITY 1
211#define STM32_SPI_SPI2_DMA_PRIORITY 1 205#define STM32_SPI_SPI2_DMA_PRIORITY 1
212#define STM32_SPI_SPI3_DMA_PRIORITY 1 206#define STM32_SPI_SPI3_DMA_PRIORITY 1
213#define STM32_SPI_SPI4_DMA_PRIORITY 1
214#define STM32_SPI_SPI5_DMA_PRIORITY 1
215#define STM32_SPI_SPI1_IRQ_PRIORITY 10 207#define STM32_SPI_SPI1_IRQ_PRIORITY 10
216#define STM32_SPI_SPI2_IRQ_PRIORITY 10 208#define STM32_SPI_SPI2_IRQ_PRIORITY 10
217#define STM32_SPI_SPI3_IRQ_PRIORITY 10 209#define STM32_SPI_SPI3_IRQ_PRIORITY 10
218#define STM32_SPI_SPI4_IRQ_PRIORITY 10
219#define STM32_SPI_SPI5_IRQ_PRIORITY 10
220#define STM32_SPI_DMA_ERROR_HOOK(spip) osalSysHalt("DMA failure") 210#define STM32_SPI_DMA_ERROR_HOOK(spip) osalSysHalt("DMA failure")
221 211
222/* 212/*
@@ -230,23 +220,18 @@
230 */ 220 */
231#define STM32_UART_USE_USART1 FALSE 221#define STM32_UART_USE_USART1 FALSE
232#define STM32_UART_USE_USART2 FALSE 222#define STM32_UART_USE_USART2 FALSE
233#define STM32_UART_USE_USART3 FALSE
234#define STM32_UART_USE_USART6 FALSE 223#define STM32_UART_USE_USART6 FALSE
235#define STM32_UART_USART1_RX_DMA_STREAM STM32_DMA_STREAM_ID(2, 5) 224#define STM32_UART_USART1_RX_DMA_STREAM STM32_DMA_STREAM_ID(2, 5)
236#define STM32_UART_USART1_TX_DMA_STREAM STM32_DMA_STREAM_ID(2, 7) 225#define STM32_UART_USART1_TX_DMA_STREAM STM32_DMA_STREAM_ID(2, 7)
237#define STM32_UART_USART2_RX_DMA_STREAM STM32_DMA_STREAM_ID(1, 5) 226#define STM32_UART_USART2_RX_DMA_STREAM STM32_DMA_STREAM_ID(1, 5)
238#define STM32_UART_USART2_TX_DMA_STREAM STM32_DMA_STREAM_ID(1, 6) 227#define STM32_UART_USART2_TX_DMA_STREAM STM32_DMA_STREAM_ID(1, 6)
239#define STM32_UART_USART3_RX_DMA_STREAM STM32_DMA_STREAM_ID(1, 1)
240#define STM32_UART_USART3_TX_DMA_STREAM STM32_DMA_STREAM_ID(1, 3)
241#define STM32_UART_USART6_RX_DMA_STREAM STM32_DMA_STREAM_ID(2, 2) 228#define STM32_UART_USART6_RX_DMA_STREAM STM32_DMA_STREAM_ID(2, 2)
242#define STM32_UART_USART6_TX_DMA_STREAM STM32_DMA_STREAM_ID(2, 7) 229#define STM32_UART_USART6_TX_DMA_STREAM STM32_DMA_STREAM_ID(2, 7)
243#define STM32_UART_USART1_IRQ_PRIORITY 12 230#define STM32_UART_USART1_IRQ_PRIORITY 12
244#define STM32_UART_USART2_IRQ_PRIORITY 12 231#define STM32_UART_USART2_IRQ_PRIORITY 12
245#define STM32_UART_USART3_IRQ_PRIORITY 12
246#define STM32_UART_USART6_IRQ_PRIORITY 12 232#define STM32_UART_USART6_IRQ_PRIORITY 12
247#define STM32_UART_USART1_DMA_PRIORITY 0 233#define STM32_UART_USART1_DMA_PRIORITY 0
248#define STM32_UART_USART2_DMA_PRIORITY 0 234#define STM32_UART_USART2_DMA_PRIORITY 0
249#define STM32_UART_USART3_DMA_PRIORITY 0
250#define STM32_UART_USART6_DMA_PRIORITY 0 235#define STM32_UART_USART6_DMA_PRIORITY 0
251#define STM32_UART_DMA_ERROR_HOOK(uartp) osalSysHalt("DMA failure") 236#define STM32_UART_DMA_ERROR_HOOK(uartp) osalSysHalt("DMA failure")
252 237
diff --git a/keyboards/matrix/noah/noah.c b/keyboards/matrix/noah/noah.c
index 64069148e..cf3340443 100644
--- a/keyboards/matrix/noah/noah.c
+++ b/keyboards/matrix/noah/noah.c
@@ -50,29 +50,20 @@ void rgblight_set(void) {
50} 50}
51#endif 51#endif
52 52
53void matrix_scan_kb(void) { matrix_scan_user(); } 53void matrix_init_kb(void) { matrix_init_user(); }
54 54
55void matrix_init_kb(void) {
56 matrix_init_user();
57}
58__attribute__((weak)) 55__attribute__((weak))
59void matrix_init_user(void) { 56void matrix_init_user(void) { }
60#ifdef RGBLIGHT_ENABLE
61 rgblight_enable();
62#endif
63 57
64#ifdef RGB_MATRIX_ENABLE 58void matrix_scan_kb(void) {
65 rgb_matrix_disable();
66#endif
67}
68
69__attribute__((weak))
70void matrix_scan_user(void) {
71#ifdef RGBLIGHT_ENABLE 59#ifdef RGBLIGHT_ENABLE
72 rgblight_task(); 60 rgblight_task();
73#endif 61#endif
62 matrix_scan_user();
74} 63}
75 64
65__attribute__((weak))
66void matrix_scan_user(void) { }
76 67
77#ifdef RGB_MATRIX_ENABLE 68#ifdef RGB_MATRIX_ENABLE
78const is31_led g_is31_leds[DRIVER_LED_TOTAL] = { 69const is31_led g_is31_leds[DRIVER_LED_TOTAL] = {
@@ -184,9 +175,9 @@ led_config_t g_led_config = {
184 { 20, 16},{ 42, 32}, 175 { 20, 16},{ 42, 32},
185 { 45, 16},{ 50, 16},{ 65, 16},{ 80, 16},{ 95, 16},{ 70, 32},{ 84, 32},{ 98, 32}, 176 { 45, 16},{ 50, 16},{ 65, 16},{ 80, 16},{ 95, 16},{ 70, 32},{ 84, 32},{ 98, 32},
186 177
187 { 14, 32},{ 56, 32},{ 50, 48},{ 80, 48},{110, 48},{ 95, 48},{100, 64},{112, 64}, 178 { 14, 32},{ 56, 32},{ 65, 48},{ 80, 48},{110, 48},{ 95, 48},{112, 64},{100, 64},
188 { 42, 32},{ 38, 64}, 179 { 42, 32},{ 38, 64},
189 { 0, 32},{ 10, 48},{ 0, 48},{ 20, 48},{ 35, 48},{ 65, 48},{ 0, 64},{ 19, 64}, 180 { 0, 32},{ 10, 48},{ 0, 48},{ 20, 48},{ 35, 48},{ 50, 48},{ 0, 64},{ 19, 64},
190 181
191 {105, 0},{120, 0},{135, 0},{150, 0},{165, 0},{180, 0},{202, 0},{224, 0}, 182 {105, 0},{120, 0},{135, 0},{150, 0},{165, 0},{180, 0},{202, 0},{224, 0},
192 {110, 16},{224, 16}, 183 {110, 16},{224, 16},
diff --git a/keyboards/matrix/noah/rules.mk b/keyboards/matrix/noah/rules.mk
index c24cfd906..80854e67e 100644
--- a/keyboards/matrix/noah/rules.mk
+++ b/keyboards/matrix/noah/rules.mk
@@ -37,20 +37,18 @@ OPT_DEFS =
37# comment out to disable the options. 37# comment out to disable the options.
38# 38#
39BOOTMAGIC_ENABLE = yes # Virtual DIP switch configuration 39BOOTMAGIC_ENABLE = yes # Virtual DIP switch configuration
40MOUSEKEY_ENABLE = no # Mouse keys 40MOUSEKEY_ENABLE = yes # Mouse keys
41EXTRAKEY_ENABLE = yes # Audio control and System control 41EXTRAKEY_ENABLE = yes # Audio control and System control
42CONSOLE_ENABLE = no # Console for debug 42CONSOLE_ENABLE = no # Console for debug
43COMMAND_ENABLE = no # Commands for debug and configuration 43COMMAND_ENABLE = no # Commands for debug and configuration
44NKRO_ENABLE = no # USB Nkey Rollover 44NKRO_ENABLE = no # USB Nkey Rollover
45NO_USB_STARTUP_CHECK = yes # Disable initialization only when usb is plugged in 45NO_USB_STARTUP_CHECK = yes # Disable initialization only when usb is plugged in
46 46
47CUSTOM_MATRIX = yes
48RGB_MATRIX_ENABLE = yes 47RGB_MATRIX_ENABLE = yes
49 48
50RGBLIGHT_ENABLE = yes 49RGBLIGHT_ENABLE = yes
51RGBLIGHT_CUSTOM_DRIVER = yes 50RGBLIGHT_CUSTOM_DRIVER = yes
52 51
52CUSTOM_MATRIX = yes
53# project specific files 53# project specific files
54SRC += \ 54SRC += ws2812.c matrix.c
55 matrix.c \
56 ws2812.c