Skip to content

SSD1306 fixes #549

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions examples/parts/ssd1306_glut.c
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ ssd1306_gl_put_pixel_column (uint8_t block_pixel_column, float pixel_opacity,

for (int i = 0; i < 8; ++i)
{
if (block_pixel_column & (1 << i))
if (block_pixel_column & (1 << (7 - i)))
{
glVertex2f (pix_size_g, pix_size_g * (i + 1));
glVertex2f (0, pix_size_g * (i + 1));
Expand Down Expand Up @@ -123,7 +123,7 @@ ssd1306_gl_draw_pixels (ssd1306_t *part, float opacity, uint8_t invert)
glPushMatrix ();
for (int c = 0; c < part->columns; c++)
{
uint8_t vram_byte = ssd1306_gl_get_vram_byte (part, p, c);
uint8_t vram_byte = ssd1306_gl_get_vram_byte (part, part->pages - p - 1, part->columns - c - 1);
ssd1306_gl_put_pixel_column (vram_byte, opacity, invert);
// Next column
glTranslatef (pix_size_g + pix_gap_g, 0, 0);
Expand Down
4 changes: 2 additions & 2 deletions examples/parts/ssd1306_virt.c
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,10 @@ ssd1306_write_data (ssd1306_t *part)
case SSD1306_ADDR_MODE_VERT:
if (++(part->cursor.page) > part->write_cursor_end.page)
{
part->cursor.page = part->write_cursor_start.column;
part->cursor.page = part->write_cursor_start.page;
if (++(part->cursor.column) > part->write_cursor_end.column)
{
part->cursor.column = part->write_cursor_start.page;
part->cursor.column = part->write_cursor_start.column;
}
}
break;
Expand Down