You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The oled_write_raw function reads from the data buffer and copies to oled_buffer, but it incorrectly offsets reads from data if the oled_cursor isn't at the start of the buffer. This means it reads beyond the end of the data buffer and corrupts the display.
PR #10800 updated oled_write_raw and oled_write_raw_P to respect the cursor position, but it looks like it also introduced this bug. It only happens for the non-PROGMEM variant of the function, which I suspect is why it hasn't been caught before. (Most folks probably use the PROGMEM variant on AVR boards, but I'm on an ARM board where oled_write_raw_P is just an alias for oled_write_raw.)
The fix is straightforward enough: use the oled_cursor offset for the write to oled_buffer, but not the read from data.
Describe the Bug
The
oled_write_raw
function reads from thedata
buffer and copies tooled_buffer
, but it incorrectly offsets reads fromdata
if theoled_cursor
isn't at the start of the buffer. This means it reads beyond the end of thedata
buffer and corrupts the display.PR #10800 updated
oled_write_raw
andoled_write_raw_P
to respect the cursor position, but it looks like it also introduced this bug. It only happens for the non-PROGMEM
variant of the function, which I suspect is why it hasn't been caught before. (Most folks probably use thePROGMEM
variant on AVR boards, but I'm on an ARM board whereoled_write_raw_P
is just an alias foroled_write_raw
.)The fix is straightforward enough: use the
oled_cursor
offset for the write tooled_buffer
, but not the read fromdata
.System Information
f411
Linux wiggin 5.4.72-microsoft-standard-WSL2 #1 SMP Wed Oct 28 23:40:43 UTC 2020 x86_64 GNU/Linux
)version: avr-gcc (GCC) 5.4.0
arm-none-eabi-gcc (15:7-2018-q2-6) 7.3.1 20180622 (release) [ARM/embedded-7-branch revision 261907]
0.13.2
Additional Context
The text was updated successfully, but these errors were encountered: