1
0
Fork 0

Fix off by one error with oled_write_raw_P (#9045)

This commit is contained in:
Brian Mock 2020-05-09 20:14:07 -07:00 committed by GitHub
parent 640d12d070
commit 8ca4ed9a98
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -479,7 +479,7 @@ void oled_write_ln_P(const char *data, bool invert) {
void oled_write_raw_P(const char *data, uint16_t size) { void oled_write_raw_P(const char *data, uint16_t size) {
if (size > OLED_MATRIX_SIZE) size = OLED_MATRIX_SIZE; if (size > OLED_MATRIX_SIZE) size = OLED_MATRIX_SIZE;
for (uint16_t i = 0; i < size; i++) { for (uint16_t i = 0; i < size; i++) {
uint8_t c = pgm_read_byte(++data); uint8_t c = pgm_read_byte(data++);
if (oled_buffer[i] == c) continue; if (oled_buffer[i] == c) continue;
oled_buffer[i] = c; oled_buffer[i] = c;
oled_dirty |= (1 << (i / OLED_BLOCK_SIZE)); oled_dirty |= (1 << (i / OLED_BLOCK_SIZE));