aboutsummaryrefslogtreecommitdiff
path: root/drivers/oled/oled_driver.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/oled/oled_driver.c')
-rw-r--r--drivers/oled/oled_driver.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/drivers/oled/oled_driver.c b/drivers/oled/oled_driver.c
index eedaedcd3..977b70178 100644
--- a/drivers/oled/oled_driver.c
+++ b/drivers/oled/oled_driver.c
@@ -462,6 +462,19 @@ void oled_write_raw(const char *data, uint16_t size) {
462 } 462 }
463} 463}
464 464
465void oled_write_pixel(uint8_t x, uint8_t y, bool on) {
466 if (x >= OLED_DISPLAY_WIDTH || y >= OLED_DISPLAY_HEIGHT) {
467 return;
468 }
469 uint16_t index = x + (y / 8) * OLED_DISPLAY_WIDTH;
470 if (on) {
471 oled_buffer[index] |= (1 << (y % 8));
472 } else {
473 oled_buffer[index] &= ~(1 << (y % 8));
474 }
475 oled_dirty |= (1 << (index / OLED_BLOCK_SIZE));
476}
477
465#if defined(__AVR__) 478#if defined(__AVR__)
466void oled_write_P(const char *data, bool invert) { 479void oled_write_P(const char *data, bool invert) {
467 uint8_t c = pgm_read_byte(data); 480 uint8_t c = pgm_read_byte(data);