Fix type cast for LCD_BUFF.

We should cast to (volatile uint32_t*) here, because attempt to refer to volatile
object through use of an lvalue with non-volatile-qualified type will result in
undefined behavior.

Change-Id: I1b2e9688af11d3dcba518a5e31865d703b54b635
This commit is contained in:
Andrew Ryabinin 2012-09-27 12:56:41 +04:00
parent 1e5e022a39
commit 82d882e1e2

View file

@ -113,7 +113,7 @@ static void lcdctrl_init(void)
* on second lcd_update call * on second lcd_update call
*/ */
for (i=0; i<2048; i++) for (i=0; i<2048; i++)
*((uint32_t *)LCD_BUFF + i) = 0; *((volatile uint32_t *)LCD_BUFF + i) = 0;
/* Setup buffered writes to lcd controler */ /* Setup buffered writes to lcd controler */
MCU_CTRL = MCU_CTRL_RS_HIGH|MCU_CTRL_BUFF_WRITE|MCU_CTRL_BUFF_START; MCU_CTRL = MCU_CTRL_RS_HIGH|MCU_CTRL_BUFF_WRITE|MCU_CTRL_BUFF_START;