Skip to content
Snippets Groups Projects
Unverified Commit 6378561a authored by Valtteri Koskivuori's avatar Valtteri Koskivuori
Browse files

Enable USB HID commands to address all 128 display columns

The ColumnAddr (0x21) command in matrix_render_direct() was erroneously
setting the column end address to 125 instead of 127, which made it
impossible to address the rightmost two columns of pixels on the display
from USB HID 'WBIT' commands.

The 126 pixel limit exists for text and graphics drawn by the keyboard
firmware to simplify text drawing, since the firmware font width is 6px
per character, and 126 / 6 == 21, a nice round number.
I see no reason to impose this limit on arbitrary bitmap content drawn
by commands from the operating system.
parent d59c540d
No related branches found
No related tags found
No related merge requests found
......@@ -323,15 +323,15 @@ void matrix_render_direct(uint8_t* bitmap) {
gfx_on();
// Move to the home position
send_cmd3(PageAddr, 0, MatrixRows - 1);
send_cmd3(ColumnAddr, 0, (MatrixCols * FontWidth) - 1);
send_cmd3(PageAddr, 0, (DisplayHeight / 8) - 1);
send_cmd3(ColumnAddr, 0, DisplayWidth - 1);
i2c_start_write(SSD1306_ADDRESS);
i2c_master_write(0x40);
int c = 0;
for (uint16_t y=0; y<4; y++) {
for (uint16_t x=0; x<126; x++) {
for (uint16_t x=0; x<128; x++) {
i2c_master_write(bitmap[c++]);
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment