From 0f25243eb65751058129658b83eb2e77b9b38a54 Mon Sep 17 00:00:00 2001 From: 0xPIT <karl@pitrich.com> Date: Fri, 6 Jan 2017 22:53:41 +0100 Subject: [PATCH] change pixel data to be unsigned --- OLEDDisplay.cpp | 4 ++-- OLEDDisplay.h | 2 +- examples/SSD1306ClockDemo/images.h | 4 ++-- examples/SSD1306SimpleDemo/images.h | 2 +- examples/SSD1306UiDemo/images.h | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/OLEDDisplay.cpp b/OLEDDisplay.cpp index f8fc226..77915b8 100644 --- a/OLEDDisplay.cpp +++ b/OLEDDisplay.cpp @@ -525,7 +525,7 @@ void OLEDDisplay::setTextAlignment(OLEDDISPLAY_TEXT_ALIGNMENT textAlignment) { this->textAlignment = textAlignment; } -void OLEDDisplay::setFont(const char *fontData) { +void OLEDDisplay::setFont(const unsigned char *fontData) { this->fontData = fontData; } @@ -692,7 +692,7 @@ void OLEDDisplay::sendInitCommands(void) { sendCommand(DISPLAYON); } -void inline OLEDDisplay::drawInternal(int16_t xMove, int16_t yMove, int16_t width, int16_t height, const char *data, uint16_t offset, uint16_t bytesInData) { +void inline OLEDDisplay::drawInternal(int16_t xMove, int16_t yMove, int16_t width, int16_t height, const unsigned char *data, uint16_t offset, uint16_t bytesInData) { if (width < 0 || height < 0) return; if (yMove + height < 0 || yMove > DISPLAY_HEIGHT) return; if (xMove + width < 0 || xMove > DISPLAY_WIDTH) return; diff --git a/OLEDDisplay.h b/OLEDDisplay.h index e551e0b..096bcce 100644 --- a/OLEDDisplay.h +++ b/OLEDDisplay.h @@ -259,7 +259,7 @@ class OLEDDisplay : public Print { static char* utf8ascii(String s); static byte utf8ascii(byte ascii); - void inline drawInternal(int16_t xMove, int16_t yMove, int16_t width, int16_t height, const char *data, uint16_t offset, uint16_t bytesInData) __attribute__((always_inline)); + void inline drawInternal(int16_t xMove, int16_t yMove, int16_t width, int16_t height, const unsigned char *data, uint16_t offset, uint16_t bytesInData) __attribute__((always_inline)); void drawStringInternal(int16_t xMove, int16_t yMove, char* text, uint16_t textLength, uint16_t textWidth); diff --git a/examples/SSD1306ClockDemo/images.h b/examples/SSD1306ClockDemo/images.h index a220a27..1889188 100644 --- a/examples/SSD1306ClockDemo/images.h +++ b/examples/SSD1306ClockDemo/images.h @@ -1,4 +1,4 @@ -const char activeSymbol[] PROGMEM = { +const unsigned char activeSymbol[] PROGMEM = { B00000000, B00000000, B00011000, @@ -9,7 +9,7 @@ const char activeSymbol[] PROGMEM = { B00011000 }; -const char inactiveSymbol[] PROGMEM = { +const unsigned char inactiveSymbol[] PROGMEM = { B00000000, B00000000, B00000000, diff --git a/examples/SSD1306SimpleDemo/images.h b/examples/SSD1306SimpleDemo/images.h index 9daf8c1..5526ed4 100644 --- a/examples/SSD1306SimpleDemo/images.h +++ b/examples/SSD1306SimpleDemo/images.h @@ -1,6 +1,6 @@ #define WiFi_Logo_width 60 #define WiFi_Logo_height 36 -const char WiFi_Logo_bits[] PROGMEM = { +const unsigned char WiFi_Logo_bits[] PROGMEM = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xF8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xFF, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0xE0, 0xFF, 0x1F, 0x00, 0x00, 0x00, 0x00, 0x00, 0xF8, 0xFF, diff --git a/examples/SSD1306UiDemo/images.h b/examples/SSD1306UiDemo/images.h index 8b876a3..ccc778e 100644 --- a/examples/SSD1306UiDemo/images.h +++ b/examples/SSD1306UiDemo/images.h @@ -1,6 +1,6 @@ #define WiFi_Logo_width 60 #define WiFi_Logo_height 36 -const char WiFi_Logo_bits[] PROGMEM = { +const unsigned char WiFi_Logo_bits[] PROGMEM = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xF8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xFF, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0xE0, 0xFF, 0x1F, 0x00, 0x00, 0x00, 0x00, 0x00, 0xF8, 0xFF, -- GitLab