summaryrefslogtreecommitdiffstats
path: root/app/oled.c
diff options
context:
space:
mode:
Diffstat (limited to 'app/oled.c')
-rw-r--r--app/oled.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/app/oled.c b/app/oled.c
index e5edfed..63a47fc 100644
--- a/app/oled.c
+++ b/app/oled.c
@@ -148,6 +148,17 @@ oled_blit_strip (uint8_t *vram, int x, int xe, uint8_t mask, int shift,
{
uint8_t r, s;
+ while (x < 0) {
+ x++;
+ src++;
+ };
+
+ if (xe < 0) xe = 0;
+
+ if (x > SSD1306_VRAM_SIZE) xe = SSD1306_VRAM_SIZE;
+
+ if (xe > SSD1306_VRAM_SIZE) xe = SSD1306_VRAM_SIZE;
+
if (shift > 0) {
for (x++; x <= xe; ++x) {