A3 doing fine

This commit is contained in:
Jack Humbert 2018-06-23 16:49:30 -04:00
parent 11a34b988c
commit 955ea5c7fb
2 changed files with 3 additions and 4 deletions

View File

@ -12,7 +12,7 @@ static uint8_t *fb;
static int sLeds;
static stm32_gpio_t *sPort;
static uint32_t sMask;
uint8_t* dma_source;
uint16_t* dma_source;
void setColor(uint8_t color, uint8_t *buf,uint32_t mask){
int i;
@ -77,8 +77,7 @@ void ledDriverInit(int leds, stm32_gpio_t *port, uint32_t mask, uint8_t **o_fb)
*o_fb=fb;
int j;
for (j = 0; j < (sLeds) * 24; j++) fb[j] = 0;
dma_source[0] = sMask & 0xFF;
dma_source[1] = sMask >> 8;
dma_source[0] = sMask;
// DMA stream 2, triggered by channel3 pwm signal. if FB indicates, reset output value early to indicate "0" bit to ws2812
dmaStreamAllocate(STM32_DMA1_STREAM2, 10, NULL, NULL);
dmaStreamSetPeripheral(STM32_DMA1_STREAM2, &(sPort->BSRR.H.clear));

View File

@ -19,7 +19,7 @@
uint8_t *o_fb;
void matrix_init_kb(void) {
ledDriverInit(1, GPIOA, 0b100000000, &o_fb);
ledDriverInit(1, GPIOA, 0b1000, &o_fb);
testPatternFB(o_fb);
matrix_init_user();