From 6ad9a82f54cc8e2a25d291d922d3bc3d27fbafcf Mon Sep 17 00:00:00 2001 From: Martijn Berntsen Date: Sat, 2 Mar 2013 19:14:54 +0100 Subject: [PATCH] fixed drawing extended ascii characters fixed wrong bounding box calculation in 'drawchar' function --- ST7565/ST7565.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ST7565/ST7565.cpp b/ST7565/ST7565.cpp index 802aac3..b7ccf8c 100644 --- a/ST7565/ST7565.cpp +++ b/ST7565/ST7565.cpp @@ -180,11 +180,11 @@ void ST7565::drawstring_P(uint8_t x, uint8_t line, const char *str) { void ST7565::drawchar(uint8_t x, uint8_t line, char c) { for (uint8_t i =0; i<5; i++ ) { - st7565_buffer[x + (line*128) ] = pgm_read_byte(font+(c*5)+i); + st7565_buffer[x + (line*128) ] = pgm_read_byte(font+((unsigned char)c*5)+i); x++; } - updateBoundingBox(x, line*8, x+5, line*8 + 8); + updateBoundingBox(x-5, line*8, x-1, line*8 + 8); }