Skip to content

Commit

Permalink
更新白鼠69为spi驱动需要更改spi的频率,qmk的bug
Browse files Browse the repository at this point in the history
  • Loading branch information
jiaxin96 committed Jul 15, 2021
1 parent be78933 commit b6e16c4
Show file tree
Hide file tree
Showing 10 changed files with 49 additions and 26 deletions.
2 changes: 1 addition & 1 deletion keyboards/yandrstudio/r65ble/halconf.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,4 @@
#define HAL_USE_I2C TRUE

#undef HAL_USE_SPI
#define HAL_USE_SPI TRUE
#define HAL_USE_SPI TRUE
3 changes: 2 additions & 1 deletion keyboards/yandrstudio/rainbow65/keymaps/via/keymap.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand All @@ -106,6 +106,7 @@ void encoder_update_user(uint8_t index, bool clockwise) {
tap_code16(keycode);
}
}
return false;
}
#endif

Expand Down
3 changes: 0 additions & 3 deletions keyboards/yandrstudio/rainbow65/rules.mk
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion keyboards/yandrstudio/whiteMouse28T/rules.mk
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
25 changes: 14 additions & 11 deletions keyboards/yandrstudio/whiteMouse69/f401/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
7 changes: 5 additions & 2 deletions keyboards/yandrstudio/whiteMouse69/f401/halconf.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,11 @@
#pragma once
#include_next <halconf.h>

#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
Expand Down
7 changes: 5 additions & 2 deletions keyboards/yandrstudio/whiteMouse69/f401/mcuconf.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,11 @@

#include_next <mcuconf.h>

#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
Expand Down
6 changes: 5 additions & 1 deletion keyboards/yandrstudio/whiteMouse69/f401/rules.mk
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,15 @@ 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
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
12 changes: 12 additions & 0 deletions keyboards/yandrstudio/whiteMouse69/keymaps/via/keymap.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
};

8 changes: 4 additions & 4 deletions keyboards/yandrstudio/whiteMouse69/rules.mk
Original file line number Diff line number Diff line change
Expand Up @@ -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


0 comments on commit b6e16c4

Please sign in to comment.