ws2812 takes normal config now

arm_rgb
Jack Humbert 6 years ago
parent 16110aff6f
commit b87dd45ae0

@ -7,6 +7,7 @@
#include "ws2812.h"
#include "stdlib.h"
#include "quantum.h"
static uint8_t *fb;
static int sLeds;
@ -49,7 +50,8 @@ void WS2812_init(void) {
static uint8_t * p;
//uint32_t port = RGBLED_PORT;
//ledDriverInit(RGBLED_NUM, (stm32_gpio_t *)(port & 0xFFF0), 1 << (port & 0xF), &p);
ledDriverInit(RGBLED_NUM, GPIOA, 0b00000010, &p);
pin_t rgb_pin = RGB_DI_PIN;
ledDriverInit(RGBLED_NUM, PAL_PORT(rgb_pin), 1 << PAL_PAD(rgb_pin), &p);
}
void ledDriverInit(int leds, stm32_gpio_t *port, uint32_t mask, uint8_t **o_fb) {

@ -131,20 +131,10 @@
#define RGBLIGHT_ANIMATIONS
#define WS2812_LED_N 9
#define RGBLED_NUM WS2812_LED_N
#define RGBLED_PORT ((uint32_t)GPIOA | 1)
#define RGBLED_NUM 9
#define RGB_DI_PIN A1
#define DRIVER_LED_TOTAL RGBLED_NUM
#define RGB_MATRIX_KEYPRESSES
#define WS2812_TIM_N 2
#define WS2812_TIM_CH 2
#define PORT_WS2812 GPIOA
#define PIN_WS2812 1
#define WS2812_DMA_STREAM STM32_DMA1_STREAM2 // DMA stream for TIMx_UP (look up in reference manual under DMA Channel selection)
//#define WS2812_DMA_CHANNEL 7 // DMA channel for TIMx_UP
//#define WS2812_EXTERNAL_PULLUP
#endif

Loading…
Cancel
Save