From 8bfccb86a074eea677787395467bdb42c4215256 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?King=20K=C3=A9vin?= Date: Mon, 25 Jul 2022 15:41:51 +0200 Subject: [PATCH] app: minor, make line select more secure --- application.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/application.c b/application.c index 69a1f66..62b4063 100644 --- a/application.c +++ b/application.c @@ -1229,7 +1229,7 @@ void RGBMATRIX_ISR(void) { if (dma_get_interrupt_flag(RGBMATRIX_DMA, RGBMATRIX_STREAM, DMA_TCIF)) { dma_clear_interrupt_flags(RGBMATRIX_DMA, RGBMATRIX_STREAM, DMA_TCIF); - GPIOB_ODR = (GPIOB_ODR & 0xfff0) + rgbmatrix_line; // select line (line on lower and upper half are updated at once) + GPIOB_ODR = (GPIOB_ODR & 0xfff0) | (rgbmatrix_line & 0xf); // select line (line on lower and upper half are updated at once) rgbmatrix_line = (rgbmatrix_line + 1) % (RGBMATRIX_HEIGHT / 2); // go to next line (two lines are updated at once) } }