From f2728aafb208dbd5cb364d3c90126ff2cc120be9 Mon Sep 17 00:00:00 2001 From: olikraus Date: Mon, 12 Dec 2016 21:14:48 +0100 Subject: [PATCH] 2.8.5 --- examples/page_buffer/FPS/FPS.ino | 2 +- .../page_buffer/GraphicsTest/GraphicsTest.ino | 2 +- extras/ChangeLog | 2 ++ library.properties | 2 +- src/clib/u8g2_hvline.c | 25 ++++++++++--------- 5 files changed, 18 insertions(+), 15 deletions(-) diff --git a/examples/page_buffer/FPS/FPS.ino b/examples/page_buffer/FPS/FPS.ino index 3d9e17d5..db8daf7e 100644 --- a/examples/page_buffer/FPS/FPS.ino +++ b/examples/page_buffer/FPS/FPS.ino @@ -178,7 +178,7 @@ 11 Dec 2016 U8G2_SSD1306_128X64_NONAME_1_4W_HW_SPI Uno Clip=25.8 Box=84.2 @=4.2 Pix=7.8 Old: no pixel optimization - U8G2_SSD1306_128X64_NONAME_1_4W_HW_SPI Uno Clip=26.3 Box=83.3 @=4.4 Pix=9.1 Pixel (len=1) optimization + U8G2_SSD1306_128X64_NONAME_1_4W_HW_SPI Uno Clip=25.9 Box=84.1 @=4.3 Pix=8.3 Pixel (len=1) optimization */ diff --git a/examples/page_buffer/GraphicsTest/GraphicsTest.ino b/examples/page_buffer/GraphicsTest/GraphicsTest.ino index f13ec317..5ea1d09a 100644 --- a/examples/page_buffer/GraphicsTest/GraphicsTest.ino +++ b/examples/page_buffer/GraphicsTest/GraphicsTest.ino @@ -59,7 +59,7 @@ // Please update the pin numbers according to your setup. Use U8X8_PIN_NONE if the reset pin is not connected //U8G2_SSD1306_128X64_NONAME_1_4W_SW_SPI u8g2(U8G2_R0, /* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); //U8G2_SSD1306_128X64_NONAME_1_4W_HW_SPI u8g2(U8G2_R0, /* cs=*/ 12, /* dc=*/ 4, /* reset=*/ 6); // Arduboy (Production, Kickstarter Edition) -//U8G2_SSD1306_128X64_NONAME_1_4W_HW_SPI u8g2(U8G2_R0, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); +//U8G2_SSD1306_128X64_NONAME_1_4W_HW_SPI u8g2(U8G2_R2, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); //U8G2_SSD1306_128X64_NONAME_1_3W_SW_SPI u8g2(U8G2_R0, /* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* reset=*/ 8); //U8G2_SSD1306_128X64_NONAME_1_SW_I2C u8g2(U8G2_R0, /* clock=*/ 13, /* data=*/ 11, /* reset=*/ 8); //U8G2_SSD1306_128X64_NONAME_1_SW_I2C u8g2(U8G2_R0, /* clock=*/ SCL, /* data=*/ SDA, /* reset=*/ U8X8_PIN_NONE); // All Boards without Reset of the Display diff --git a/extras/ChangeLog b/extras/ChangeLog index d578c391..8c5c72f3 100644 --- a/extras/ChangeLog +++ b/extras/ChangeLog @@ -64,3 +64,5 @@ https://github.com/olikraus/u8g2 ChangeLog * Support for KS0108 (issue 88) * Support for UC1608 240x128 (issue 101) * Speed improvement (issue 96) +2016-12-12 v2.8.5 olikraus@gmail.com + * Bugfix for issue 96 (issue 106) diff --git a/library.properties b/library.properties index 2473911c..72241e6d 100644 --- a/library.properties +++ b/library.properties @@ -1,5 +1,5 @@ name=U8g2 -version=2.8.4 +version=2.8.5 author=oliver maintainer=oliver sentence=Library for monochrome LCDs and OLEDs. Controller: SSD1306, SSD1322, SSD1325, SH1106, T6963, RA8835, UC1608, UC1610, UC1611, UC1701, ST7565, ST7920, LD7032, KS0108. diff --git a/src/clib/u8g2_hvline.c b/src/clib/u8g2_hvline.c index 1d3731d3..52b5c569 100644 --- a/src/clib/u8g2_hvline.c +++ b/src/clib/u8g2_hvline.c @@ -170,6 +170,19 @@ void u8g2_draw_hv_line_4dir(u8g2_t *u8g2, u8g2_uint_t x, u8g2_uint_t y, u8g2_uin #ifdef U8G2_WITH_HVLINE_COUNT u8g2->hv_cnt++; #endif /* U8G2_WITH_HVLINE_COUNT */ + + /* additional optimization for one pixel draw */ + /* requires about 60 bytes on the ATMega flash memory */ + /* 20% improvement for single pixel draw test in FPS.ino */ +#ifdef U8G2_WITH_ONE_PIXEL_OPTIMIZATION + if ( len == 1 ) + { + y -= u8g2->tile_curr_row*8; + if ( x < u8g2->pixel_buf_width && y < u8g2->pixel_buf_height ) + u8g2->ll_hvline(u8g2, x, y, len, dir); + return; + } +#endif if ( dir == 2 ) { @@ -196,18 +209,6 @@ void u8g2_draw_hv_line_4dir(u8g2_t *u8g2, u8g2_uint_t x, u8g2_uint_t y, u8g2_uin */ void u8g2_DrawHVLine(u8g2_t *u8g2, u8g2_uint_t x, u8g2_uint_t y, u8g2_uint_t len, uint8_t dir) { - /* additional optimization for one pixel draw */ - /* requires about 60 bytes on the ATMega flash memory */ - /* 20% improvement for single pixel draw test in FPS.ino */ -#ifdef U8G2_WITH_ONE_PIXEL_OPTIMIZATION - if ( len == 1 ) - { - y -= u8g2->tile_curr_row*8; - if ( x < u8g2->pixel_buf_width && y < u8g2->pixel_buf_height ) - u8g2->ll_hvline(u8g2, x, y, len, dir); - return; - } -#endif /* Make a call to the callback function (e.g. u8g2_draw_l90_r0). */