diff --git a/examples/page_buffer/FPS/FPS.ino b/examples/page_buffer/FPS/FPS.ino index 1a1b87d5..5b30b2a1 100644 --- a/examples/page_buffer/FPS/FPS.ino +++ b/examples/page_buffer/FPS/FPS.ino @@ -167,7 +167,7 @@ 26.Nov 2016 U8G2_ST7920_128X64_1_8080 Uno Clip=13.5 Box=12.1 @=3.6 Pix=5.9 atmega&arduino optimized - U8G2_ST7920_128X64_1_SW_SPI Uno Clip=12.9 Box=11.0 @=3.5 Pix=5.4 issue 87 + U8G2_ST7920_128X64_1_SW_SPI Uno Clip=13.2 Box=11.4 @=3.5 Pix=5.6 issue 87 U8G2_SSD1306_128X64_NONAME_1_4W_SW_SPI Uno Clip=21.7 Box=46.8 @=4.0 Pix=7.1 U8G2_SSD1306_128X64_NONAME_1_4W_HW_SPI Uno Clip=25.8 Box=84.2 @=4.2 Pix=7.8 U8G2_SSD1306_128X64_NONAME_1_8080 Uno Clip=16.1 Box=29.1 @=3.9 Pix=6.6 diff --git a/extras/ChangeLog b/extras/ChangeLog index d1d1338a..dba3bc74 100644 --- a/extras/ChangeLog +++ b/extras/ChangeLog @@ -53,8 +53,9 @@ https://github.com/olikraus/u8g2 ChangeLog * Screen mirror option for U8g2 (issue 76) * Added support for second wire interface (Constructor postfix 2ND_HW_I2C) * Added support for UC1611 (EA DOGM240 and EA DOGXL240, issue 66) -2016-xx-xx v2.7.x olikraus@gmail.com +2016-11-28 v2.7.5 olikraus@gmail.com * Added support for 0.66" 64x48 SSD1306 OLED (issue 89) * Support for UC1608 (issue 92) * Speed improvements for SW SPI und 8080 mode (issues 87, 90 and 95) * Fixed issue with ST7920 not using the optimized SW SPI procedures (issue 87) + * Direct buffer API (issue 93) diff --git a/library.properties b/library.properties index dbaf4e5e..bfbcde12 100644 --- a/library.properties +++ b/library.properties @@ -1,5 +1,5 @@ name=U8g2 -version=2.7.2 +version=2.7.5 author=oliver maintainer=oliver sentence=Library for monochrome LCDs and OLEDs. Successor of U8glib. Features: UTF8, >700 fonts, all Arduino Boards supported diff --git a/src/U8g2lib.h b/src/U8g2lib.h index ff90d0ff..99fa0550 100644 --- a/src/U8g2lib.h +++ b/src/U8g2lib.h @@ -154,8 +154,8 @@ class U8G2 : public Print uint8_t *getBufferPtr(void) { return u8g2_GetBufferPtr(&u8g2); } uint8_t getBufferTileHeight(void) { return u8g2_GetBufferTileHeight(&u8g2); } uint8_t getBufferTileWidth(void) { return u8g2_GetBufferTileWidth(&u8g2); } - uint8_t getBufferCurrTileRow(void) { return u8g2_GetBufferCurrTileRow(&u8g2); } - void setBufferCurrTileRow(uint8_t row) { u8g2_SetBufferCurrTileRow(&u8g2, row); } + uint8_t getPageCurrTileRow(void) { return u8g2_GetPageCurrTileRow(&u8g2); } + void setPageCurrTileRow(uint8_t row) { u8g2_SetPageCurrTileRow(&u8g2, row); } void setAutoPageClear(uint8_t mode) { u8g2_SetAutoPageClear(&u8g2, mode); } diff --git a/src/U8x8lib.cpp b/src/U8x8lib.cpp index c9858d04..e4983c38 100644 --- a/src/U8x8lib.cpp +++ b/src/U8x8lib.cpp @@ -211,8 +211,77 @@ extern "C" uint8_t u8x8_byte_arduino_4wire_sw_spi(u8x8_t *u8x8, uint8_t msg, uin switch(msg) { case U8X8_MSG_BYTE_SEND: - data = (uint8_t *)arg_ptr; - + + data = (uint8_t *)arg_ptr; + if ( takeover_edge == 0 ) + { + while( arg_int > 0 ) + { + b = *data; + data++; + arg_int--; + if ( b == 0 ) + { + *arduino_data_port &= arduino_data_n_mask; + for( i = 0; i < 8; i++ ) + { + *arduino_clock_port |= arduino_clock_mask; + *arduino_clock_port &= arduino_clock_n_mask; + } + } + else + { + for( i = 0; i < 8; i++ ) + { + if ( b & 128 ) + *arduino_data_port |= arduino_data_mask; + else + *arduino_data_port &= arduino_data_n_mask; + + *arduino_clock_port |= arduino_clock_mask; + b <<= 1; + *arduino_clock_port &= arduino_clock_n_mask; + } + } + } + } + else + { + while( arg_int > 0 ) + { + b = *data; + data++; + arg_int--; + if ( b == 0 ) + { + *arduino_data_port &= arduino_data_n_mask; + for( i = 0; i < 8; i++ ) + { + *arduino_clock_port &= arduino_clock_n_mask; + *arduino_clock_port |= arduino_clock_mask; + } + } + else + { + for( i = 0; i < 8; i++ ) + { + if ( b & 128 ) + *arduino_data_port |= arduino_data_mask; + else + *arduino_data_port &= arduino_data_n_mask; + + *arduino_clock_port &= arduino_clock_n_mask; + b <<= 1; + *arduino_clock_port |= arduino_clock_mask; + } + } + } + } + + +#ifdef NOTUSED + + data = (uint8_t *)arg_ptr; while( arg_int > 0 ) { b = *data; @@ -273,7 +342,7 @@ extern "C" uint8_t u8x8_byte_arduino_4wire_sw_spi(u8x8_t *u8x8, uint8_t msg, uin } } - +#endif break; diff --git a/src/clib/u8g2.h b/src/clib/u8g2.h index 6a10f8dd..96d3bd21 100644 --- a/src/clib/u8g2.h +++ b/src/clib/u8g2.h @@ -586,7 +586,7 @@ void u8g2_Setup_a2printer_384x240_f(u8g2_t *u8g2, const u8g2_cb_t *rotation, u8x void u8g2_SendBuffer(u8g2_t *u8g2); void u8g2_ClearBuffer(u8g2_t *u8g2); -void u8g2_SetBufferCurrTileRow(u8g2_t *u8g2, uint8_t row) U8G2_NOINLINE; +void u8g2_SetPageCurrTileRow(u8g2_t *u8g2, uint8_t row) U8G2_NOINLINE; void u8g2_FirstPage(u8g2_t *u8g2); uint8_t u8g2_NextPage(u8g2_t *u8g2); @@ -594,7 +594,7 @@ uint8_t u8g2_NextPage(u8g2_t *u8g2); #define u8g2_GetBufferTileHeight(u8g2) ((u8g2)->tile_buf_height) #define u8g2_GetBufferTileWidth(u8g2) (u8g2_GetU8x8(u8g2)->display_info->tile_width) /* the following variable is only valid after calling u8g2_FirstPage */ -#define u8g2_GetBufferCurrTileRow(u8g2) ((u8g2)->tile_curr_row) +#define u8g2_GetPageCurrTileRow(u8g2) ((u8g2)->tile_curr_row) /*==========================================*/ /* u8g2_ll_hvline.c */