app: minor, make line select more secure

This commit is contained in:
King Kévin 2022-07-25 15:41:51 +02:00
parent 9d415ed449
commit 8bfccb86a0
1 changed files with 1 additions and 1 deletions

View File

@ -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)
}
}