// Retrieve appropriate columns from font data
for (col = 0; col < font.u8Width; col++)
{
- column[col] = font.au8FontTable[((c - 32) * font.u8Width) + col]; // Get first column of appropriate character
+ column[col] = font.au8FontTable[((c - font.u8FirstChar) * font.u8Width) + col]; // Get first column of appropriate character
}
}
else
/**************************************************************************/
void ssd1306ClearScreen()
{
- memset(_ssd1306buffer, 0, 1024);
+ memset(_ssd1306buffer, 0x00, sizeof(_ssd1306buffer));
}
/**************************************************************************/
CMD(SSD1306_SETSTARTLINE | 0x0); // line #0
uint16_t i;
- for (i=0; i<1024; i++)
+ for (i = 0; i < sizeof(_ssd1306buffer); i++)
{
DATA(_ssd1306buffer[i]);
}
ssd1306SendCommand(SSD1306_SETSTARTLINE | 0x0); // line #0
uint16_t i;
- for (i=0; i<1024; i++)
+ for (i = 0; i < sizeof(_ssd1306buffer); i++)
{
ssd1306SendData(_ssd1306buffer[i]);
}