// 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
// I2C Initialisation
#if defined SSD1306_BUS_I2C
- // Set all pins to output
- gpioSetDir(SSD1306_RST_PORT, SSD1306_RST_PORT, gpioDirection_Output);
-
- // Reset the LCD
- gpioSetValue(SSD1306_RST_PORT, SSD1306_RST_PIN, 1);
- DELAY(1);
- gpioSetValue(SSD1306_RST_PORT, SSD1306_RST_PIN, 0);
- DELAY(10);
- gpioSetValue(SSD1306_RST_PORT, SSD1306_RST_PIN, 1);
-
#if defined SSD1306_128_32
// Init sequence taken from datasheet for UG-2832HSWEG04 (128x32 OLED module)
ssd1306SendCommand(SSD1306_DISPLAYOFF); // 0xAE
/**************************************************************************/
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]);
}