From 21d6285de9b563f4cfe85598b3df3ae11f2f1a76 Mon Sep 17 00:00:00 2001 From: lilian Date: Wed, 7 Dec 2016 08:34:02 +0100 Subject: [PATCH] Quick fix initial --- extras/ssd1306/ssd1306.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/extras/ssd1306/ssd1306.c b/extras/ssd1306/ssd1306.c index df79d6e..f975b6c 100644 --- a/extras/ssd1306/ssd1306.c +++ b/extras/ssd1306/ssd1306.c @@ -14,7 +14,7 @@ #if (SSD1306_I2C_SUPPORT) #include #endif -#if (SSD1306_SPI4_SUPPORT) +#if (SSD1306_SPI4_SUPPORT) || (SSD1306_SPI3_SUPPORT) #include #endif #include @@ -234,7 +234,7 @@ int ssd1306_init(const ssd1306_t *dev) } static int sh1106_go_coordinate(const ssd1306_t *dev, uint8_t x, uint8_t y) { - if (x >= dev->width || y >= dev->height) return -EINVAL; + if (x >= dev->width || y >= (dev->height/8)) return -EINVAL; int err = 0; x+=2 ; //offset : panel is 128 ; RAM is 132 for sh1106 if ((err = ssd1306_command(dev, SH1106_SET_PAGE_ADDRESS + y))) // Set row