I have moved to gcc 4.6.3 recently and porting all my projects to that version.
The follwing snippet of code compiles OK on msp430-gcc 3.2.3 always.
'Always' means two different apps using the code below.
When compiled with msp430-gcc 4.6.3 one app stopped working correctly. The DRAM value was incorrectly calculated.
I guess 'const uint8 LineMap' array was not populated correctly ( I think it i using memcpy).
Once I added 'static' qualifier to const uint8 LineMap it was working OK on 4.6.3 as well.
#define LCD_LINE1_ADDR 0x00
#define LCD_LINE2_ADDR 0x40
#define LCD_LINE3_ADDR 0x14
#define LCD_LINE4_ADDR 0x54
#define LCD_DDRAM_SET 0x80
void LCDSetPosition (uint8 x, uint8 y)
const uint8 LineMap =
LCD_LINE1_ADDR - 1,
LCD_LINE2_ADDR - 1,
LCD_LINE3_ADDR - 1,
LCD_LINE4_ADDR - 1,
uint8 DDRAM = LineMap[(y-1) & 0x03] + x;
DDRAM |= LCD_DDRAM_SET;
* Set data address
Log in to post a comment.