From b6e16c4f2c83b3189d69ce5298d24b51e7295c07 Mon Sep 17 00:00:00 2001 From: JX <572673807@qq.com> Date: Thu, 15 Jul 2021 13:00:20 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E7=99=BD=E9=BC=A069=E4=B8=BA?= =?UTF-8?q?spi=E9=A9=B1=E5=8A=A8=E9=9C=80=E8=A6=81=E6=9B=B4=E6=94=B9spi?= =?UTF-8?q?=E7=9A=84=E9=A2=91=E7=8E=87=EF=BC=8Cqmk=E7=9A=84bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- keyboards/yandrstudio/r65ble/halconf.h | 2 +- .../rainbow65/keymaps/via/keymap.c | 3 ++- keyboards/yandrstudio/rainbow65/rules.mk | 3 --- keyboards/yandrstudio/whiteMouse28T/rules.mk | 2 +- .../yandrstudio/whiteMouse69/f401/config.h | 25 +++++++++++-------- .../yandrstudio/whiteMouse69/f401/halconf.h | 7 ++++-- .../yandrstudio/whiteMouse69/f401/mcuconf.h | 7 ++++-- .../yandrstudio/whiteMouse69/f401/rules.mk | 6 ++++- .../whiteMouse69/keymaps/via/keymap.c | 12 +++++++++ keyboards/yandrstudio/whiteMouse69/rules.mk | 8 +++--- 10 files changed, 49 insertions(+), 26 deletions(-) diff --git a/keyboards/yandrstudio/r65ble/halconf.h b/keyboards/yandrstudio/r65ble/halconf.h index af7fec1e28aa..5b504740c9a6 100644 --- a/keyboards/yandrstudio/r65ble/halconf.h +++ b/keyboards/yandrstudio/r65ble/halconf.h @@ -30,4 +30,4 @@ #define HAL_USE_I2C TRUE #undef HAL_USE_SPI -#define HAL_USE_SPI TRUE +#define HAL_USE_SPI TRUE diff --git a/keyboards/yandrstudio/rainbow65/keymaps/via/keymap.c b/keyboards/yandrstudio/rainbow65/keymaps/via/keymap.c index 158cb8e7fcab..94a73ac491d1 100644 --- a/keyboards/yandrstudio/rainbow65/keymaps/via/keymap.c +++ b/keyboards/yandrstudio/rainbow65/keymaps/via/keymap.c @@ -86,7 +86,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { #ifdef ENCODER_ENABLE -void encoder_update_user(uint8_t index, bool clockwise) { +bool encoder_update_user(uint8_t index, bool clockwise) { uprintf("%ud raw g_rgb_time\n", g_rgb_timer); uprintf("%ud rgb speed\n", rgb_matrix_config.speed); @@ -106,6 +106,7 @@ void encoder_update_user(uint8_t index, bool clockwise) { tap_code16(keycode); } } + return false; } #endif diff --git a/keyboards/yandrstudio/rainbow65/rules.mk b/keyboards/yandrstudio/rainbow65/rules.mk index e119b8a3189e..182e33681dca 100755 --- a/keyboards/yandrstudio/rainbow65/rules.mk +++ b/keyboards/yandrstudio/rainbow65/rules.mk @@ -13,10 +13,7 @@ NKRO_ENABLE = yes # USB Nkey Rollover RGB_MATRIX_ENABLE = yes RGB_MATRIX_DRIVER = WS2812 WS2812_DRIVER = spi -# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE -SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend WPM_ENABLE = yes # Show APM. ENCODER_ENABLE = yes AUTO_SHIFT_ENABLE = no VELOCIKEY_ENABLE = yes -# TAP_DANCE_ENABLE = yes diff --git a/keyboards/yandrstudio/whiteMouse28T/rules.mk b/keyboards/yandrstudio/whiteMouse28T/rules.mk index a037a7e81008..81b838aa2084 100644 --- a/keyboards/yandrstudio/whiteMouse28T/rules.mk +++ b/keyboards/yandrstudio/whiteMouse28T/rules.mk @@ -6,7 +6,7 @@ KEYBOARD_SHARED_EP = yes # Free up some extra endpoints - needed if console+m MOUSEKEY_ENABLE = yes # Mouse keys EXTRAKEY_ENABLE = yes # Audio control and System control CONSOLE_ENABLE = no # Console for debug -COMMAND_ENABLE = yes # Commands for debug and configuration +COMMAND_ENABLE = no # Commands for debug and configuration # Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend # if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work diff --git a/keyboards/yandrstudio/whiteMouse69/f401/config.h b/keyboards/yandrstudio/whiteMouse69/f401/config.h index 37ae539874b1..b8a61e4e9bfb 100644 --- a/keyboards/yandrstudio/whiteMouse69/f401/config.h +++ b/keyboards/yandrstudio/whiteMouse69/f401/config.h @@ -36,12 +36,10 @@ # define RGBLED_NUM 72 # define DRIVER_LED_TOTAL RGBLED_NUM -# define WS2812_PWM_DRIVER PWMD1 // default: PWMD2 -# define WS2812_PWM_CHANNEL 3 // default: 2 -# define WS2812_PWM_PAL_MODE 1 // Pin "alternate function", see the respective datasheet for the appropriate values for your MCU. default: 2 -# define WS2812_DMA_STREAM STM32_DMA2_STREAM5 // DMA Stream for TIMx_UP, see the respective reference manual for the appropriate values for your MCU. -# define WS2812_DMA_CHANNEL 6 // DMA Channel for TIMx_UP, see the respective reference manual for the appropriate values for your MCU. - +# define WS2812_SPI SPID2 // default: SPID1 +# define WS2812_SPI_MOSI_PAL_MODE 5 +# define WS2812_SPI_USE_CIRCULAR_BUFFER +// # define WS2812_SPI_DIVISOR 8 # define RGB_MATRIX_MAXIMUM_BRIGHTNESS 150 # define RGBLIGHT_VAL_STEP 15 @@ -61,12 +59,17 @@ # define RGB_DI_PIN B15 # define RGBLED_NUM 72 # define DRIVER_LED_TOTAL RGBLED_NUM +# define RGBLIGHT_SLEEP + +// # define WS2812_PWM_DRIVER PWMD1 // default: PWMD2 +// # define WS2812_PWM_CHANNEL 3 // default: 2 +// # define WS2812_PWM_PAL_MODE 1 // Pin "alternate function", see the respective datasheet for the appropriate values for your MCU. default: 2 +// # define WS2812_DMA_STREAM STM32_DMA2_STREAM5 // DMA Stream for TIMx_UP, see the respective reference manual for the appropriate values for your MCU. +// # define WS2812_DMA_CHANNEL 6 // DMA Channel for TIMx_UP, see the respective reference manual for the appropriate values for your MCU. -# define WS2812_PWM_DRIVER PWMD1 // default: PWMD2 -# define WS2812_PWM_CHANNEL 3 // default: 2 -# define WS2812_PWM_PAL_MODE 1 // Pin "alternate function", see the respective datasheet for the appropriate values for your MCU. default: 2 -# define WS2812_DMA_STREAM STM32_DMA2_STREAM5 // DMA Stream for TIMx_UP, see the respective reference manual for the appropriate values for your MCU. -# define WS2812_DMA_CHANNEL 6 // DMA Channel for TIMx_UP, see the respective reference manual for the appropriate values for your MCU. +// # define WS2812_SPI SPID2 // default: SPID1 +// # define WS2812_SPI_MOSI_PAL_MODE 5 +// # define WS2812_SPI_DIVISOR 8 // # define WS2812_BYTE_ORDER WS2812_BYTE_ORDER_RGB diff --git a/keyboards/yandrstudio/whiteMouse69/f401/halconf.h b/keyboards/yandrstudio/whiteMouse69/f401/halconf.h index c03bc49506d1..91a69efd0476 100644 --- a/keyboards/yandrstudio/whiteMouse69/f401/halconf.h +++ b/keyboards/yandrstudio/whiteMouse69/f401/halconf.h @@ -18,8 +18,11 @@ #pragma once #include_next -#undef HAL_USE_PWM -#define HAL_USE_PWM TRUE +// #undef HAL_USE_PWM +// #define HAL_USE_PWM TRUE + +#undef HAL_USE_SPI +#define HAL_USE_SPI TRUE #undef SERIAL_USB_BUFFERS_SIZE #define SERIAL_USB_BUFFERS_SIZE 256 diff --git a/keyboards/yandrstudio/whiteMouse69/f401/mcuconf.h b/keyboards/yandrstudio/whiteMouse69/f401/mcuconf.h index 474f1741794c..40f78dccbae8 100644 --- a/keyboards/yandrstudio/whiteMouse69/f401/mcuconf.h +++ b/keyboards/yandrstudio/whiteMouse69/f401/mcuconf.h @@ -18,8 +18,11 @@ #include_next -#undef STM32_PWM_USE_TIM1 -#define STM32_PWM_USE_TIM1 TRUE +// #undef STM32_PWM_USE_TIM1 +// #define STM32_PWM_USE_TIM1 TRUE + +#undef STM32_SPI_USE_SPI2 +#define STM32_SPI_USE_SPI2 TRUE #undef STM32_NO_INIT #undef STM32_HSI_ENABLED diff --git a/keyboards/yandrstudio/whiteMouse69/f401/rules.mk b/keyboards/yandrstudio/whiteMouse69/f401/rules.mk index f53c722fc8c7..e4d53e71a9fa 100644 --- a/keyboards/yandrstudio/whiteMouse69/f401/rules.mk +++ b/keyboards/yandrstudio/whiteMouse69/f401/rules.mk @@ -15,7 +15,7 @@ RGB_MATRIX_ENABLE = yes RGB_MATRIX_DRIVER = WS2812 # RGBLIGHT_ENABLE = yes # RGBLIGHT_DRIVER = WS2812 -WS2812_DRIVER = pwm +WS2812_DRIVER = spi # EEPROM_DRIVER = spi EEPROM_DRIVER = custom @@ -23,3 +23,7 @@ SRC += eep/eeprom_stm32.c SRC += eep/flash_stm32.c OPT_DEFS += -DEEPROM_EMU_STM32F401xC COMMON_VPATH += keyboards/yandrstudio/whiteMouse28T/f401/eep + + +# Enter lower-power sleep mode when on the ChibiOS idle thread +OPT_DEFS += -DCORTEX_ENABLE_WFI_IDLE=TRUE diff --git a/keyboards/yandrstudio/whiteMouse69/keymaps/via/keymap.c b/keyboards/yandrstudio/whiteMouse69/keymaps/via/keymap.c index cd0667e2095d..64782a812246 100644 --- a/keyboards/yandrstudio/whiteMouse69/keymaps/via/keymap.c +++ b/keyboards/yandrstudio/whiteMouse69/keymaps/via/keymap.c @@ -29,5 +29,17 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, RESET, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_END, KC_TRNS, KC_PGDN, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_INS, KC_DEL), + LAYOUT( + TO(0), KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), + LAYOUT( + TO(0), KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS) }; diff --git a/keyboards/yandrstudio/whiteMouse69/rules.mk b/keyboards/yandrstudio/whiteMouse69/rules.mk index 0adb9a0508b1..24fe138d7d7b 100644 --- a/keyboards/yandrstudio/whiteMouse69/rules.mk +++ b/keyboards/yandrstudio/whiteMouse69/rules.mk @@ -5,10 +5,10 @@ BOOTMAGIC_ENABLE = lite # Virtual DIP switch configuration KEYBOARD_SHARED_EP = yes # Free up some extra endpoints - needed if console+mouse+extra MOUSEKEY_ENABLE = yes # Mouse keys EXTRAKEY_ENABLE = yes # Audio control and System control -CONSOLE_ENABLE = no # Console for debug -COMMAND_ENABLE = yes # Commands for debug and configuration -# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE -SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend +CONSOLE_ENABLE = yes # Console for debug +# COMMAND_ENABLE = yes # Commands for debug and configuration # if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work NKRO_ENABLE = yes # USB Nkey Rollover +NO_USB_STARTUP_CHECK = no # Disable initialization only when usb is plugged in +