Zaboravih, u donjoj funkciji postoji greška zbog koje se ne ispisuje posledji red karaktera duple veličine
Code:
void OLED::draw_bytes(uint_fast8_t x, uint_fast8_t y, const uint8_t* data, uint_fast8_t size, tSize scaling, tColor color, bool useProgmem)
{
for (uint_fast8_t column = 0; column < size; column++)
{
uint8_t b;
if (useProgmem)
{
b = pgm_read_byte(data);
}
else
{
b = *data;
}
data++;
if (scaling == DOUBLE_SIZE)
{
// Stretch vertically
uint16_t w = 0;
for (uint_fast8_t bit = 0; bit < 7; bit++)
{
if (b & (1 << bit))
{
uint_fast8_t pos = bit << 1;
w |= ((1 << pos) | (1 << (pos + 1)));
}
}
// Output 2 times to strech hozizontally
draw_byte(x, y, w & 0xFF, color);
draw_byte(x, y + 8, (w >> 8), color);
x++;
draw_byte(x, y, w & 0xFF, color);
draw_byte(x, y + 8, (w >> 8), color);
x++;
}
else // NORMAL_SIZE
{
draw_byte(x++, y, b, color);
}
}
}
Umesto
Code:
for (uint_fast8_t bit = 0; bit < 7; bit++)
treba
Code:
for (uint_fast8_t bit = 0; bit < 8; bit++)