diff --git a/csrc/u8g2.h b/csrc/u8g2.h index b6bfa3b8..1b1016e0 100644 --- a/csrc/u8g2.h +++ b/csrc/u8g2.h @@ -4,7 +4,7 @@ call sequence - u8g2_Setup_XYZ + u8g2_SetupBuffer_XYZ u8x8_Setup_XYZ u8x8_SetupDefaults(u8g2); assign u8x8 callbacks @@ -246,6 +246,20 @@ struct u8g2_struct #define u8g2_GetU8x8(u8g2) ((u8x8_t *)(u8g2)) +/*==========================================*/ +/* u8x8 wrapper */ + +#define u8g2_SetupDisplay(u8g2, display_cb, cad_cb, byte_cb, gpio_and_delay_cb) \ + u8x8_Setup(u8g2_GetU8x8(u8g2), (display_cb), (cad_cb), (byte_cb), (gpio_and_delay_cb)) + +#define u8g2_InitDisplay(u8g2) u8x8_InitDisplay(u8g2_GetU8x8(u8g2)) +#define u8g2_SetPowerSave(u8g2, is_enable) u8x8_SetPowerSave(u8g2_GetU8x8(u8g2), (is_enable)) +#define u8g2_SetFlipMode(u8g2, mode) u8x8_SetFlipMode(u8g2_GetU8x8(u8g2), (mode)) +#define u8g2_SetContrast(u8g2, value) u8x8_SetContrast(u8g2_GetU8x8(u8g2), (value)) +#define u8g2_ClearDisplay(u8g2) u8x8_ClearDisplay(u8g2_GetU8x8(u8g2)) + + + /*==========================================*/ /* u8g2_setup.c */ @@ -254,7 +268,7 @@ extern const u8g2_cb_t u8g2_cb_r1; extern const u8g2_cb_t u8g2_cb_r2; extern const u8g2_cb_t u8g2_cb_r3; -void u8g2_Setup(u8g2_t *u8g2, uint8_t *buf, uint8_t tile_buf_height, const u8g2_cb_t *u8g2_cb); +void u8g2_SetupBuffer(u8g2_t *u8g2, uint8_t *buf, uint8_t tile_buf_height, const u8g2_cb_t *u8g2_cb); @@ -311,13 +325,13 @@ u8g2_uint_t u8g2_GetUTF8Width(u8g2_t *u8g2, const char *str); /*==========================================*/ /* u8x8_d_sdl_128x64.c */ -void u8g2_Setup_SDL_128x64(u8g2_t *u8g2, const u8g2_cb_t *u8g2_cb); -void u8g2_Setup_SDL_128x64_4(u8g2_t *u8g2, const u8g2_cb_t *u8g2_cb); +void u8g2_SetupBuffer_SDL_128x64(u8g2_t *u8g2, const u8g2_cb_t *u8g2_cb); +void u8g2_SetupBuffer_SDL_128x64_4(u8g2_t *u8g2, const u8g2_cb_t *u8g2_cb); /*==========================================*/ /* u8x8_d_tga.c */ -void u8g2_Setup_TGA_DESC(u8g2_t *u8g2, const u8g2_cb_t *u8g2_cb); -void u8g2_Setup_TGA_LCD(u8g2_t *u8g2, const u8g2_cb_t *u8g2_cb); +void u8g2_SetupBuffer_TGA_DESC(u8g2_t *u8g2, const u8g2_cb_t *u8g2_cb); +void u8g2_SetupBuffer_TGA_LCD(u8g2_t *u8g2, const u8g2_cb_t *u8g2_cb); diff --git a/csrc/u8g2_setup.c b/csrc/u8g2_setup.c index 34b0600c..d0c26474 100644 --- a/csrc/u8g2_setup.c +++ b/csrc/u8g2_setup.c @@ -9,7 +9,7 @@ /*============================================*/ -void u8g2_Setup(u8g2_t *u8g2, uint8_t *buf, uint8_t tile_buf_height, const u8g2_cb_t *u8g2_cb) +void u8g2_SetupBuffer(u8g2_t *u8g2, uint8_t *buf, uint8_t tile_buf_height, const u8g2_cb_t *u8g2_cb) { u8g2->tile_buf_ptr = buf; u8g2->tile_buf_height = tile_buf_height; diff --git a/csrc/u8x8.h b/csrc/u8x8.h index 3c665511..0059a6ec 100644 --- a/csrc/u8x8.h +++ b/csrc/u8x8.h @@ -352,11 +352,13 @@ uint8_t u8x8_DrawTile(u8x8_t *u8x8, uint8_t x, uint8_t y, uint8_t cnt, uint8_t * /* After a call to u8x8_SetupDefaults, setup u8x8 memory structures & inform callbacks + This function is also called from u8x8_Setup(), so do not call u8x8_SetupMemory() + directly, but use u8x8_Setup() instead. */ void u8x8_SetupMemory(u8x8_t *u8x8); /* - After calling u8x8_SetupMemory(), init the display hardware itself. + After calling u8x8_SetupMemory()/u8x8_Setup(), init the display hardware itself. This will will the first time, u8x8 talks to the display. It will init the display, but keep display in power save mode. Usually this command must be followed by u8x8_SetPowerSave() diff --git a/sys/arduino/text/text.ino b/sys/arduino/text/text.ino index 5a5254a3..b5404f70 100644 --- a/sys/arduino/text/text.ino +++ b/sys/arduino/text/text.ino @@ -333,13 +333,13 @@ void u8x8_Setup_SSD1306_128x64_NONAME(u8x8_t *u8x8) u8x8_SetupMemory(u8x8); } -void u8g2_Setup_SSD1306_128x64_NONAME_1(u8g2_t *u8g2, const u8g2_cb_t *u8g2_cb) +void u8g2_SetupBuffer_SSD1306_128x64_NONAME_1(u8g2_t *u8g2, const u8g2_cb_t *u8g2_cb) { static uint8_t buf[128*8]; u8x8_Setup_SSD1306_128x64_NONAME(u8g2_GetU8x8(u8g2)); - u8g2_Setup(u8g2, buf, 1, u8g2_cb); + u8g2_SetupBuffer(u8g2, buf, 1, u8g2_cb); } @@ -350,7 +350,7 @@ uint8_t tile[8] = { 0x0f, 0x0f, 0x0f, 0x0f, 0xf0, 0xf0, 0xf0, 0xf0 }; void setup(void) { //u8x8_Setup_UC1701_DOGS102(&u8g2); - u8g2_Setup_SSD1306_128x64_NONAME_1(&u8g2, &u8g2_cb_r0); + u8g2_SetupBuffer_SSD1306_128x64_NONAME_1(&u8g2, &u8g2_cb_r0); u8x8_InitDisplay(u8g2_GetU8x8(&u8g2)); u8x8_SetPowerSave(u8g2_GetU8x8(&u8g2), 0); u8g2_SetFont(&u8g2, u8g2_font_helvB18_tr); diff --git a/sys/sdl/common/u8x8_d_sdl_128x64.c b/sys/sdl/common/u8x8_d_sdl_128x64.c index 69557867..b2830695 100644 --- a/sys/sdl/common/u8x8_d_sdl_128x64.c +++ b/sys/sdl/common/u8x8_d_sdl_128x64.c @@ -267,23 +267,23 @@ void u8x8_Setup_SDL_128x64(u8x8_t *u8x8) u8x8_SetupMemory(u8x8); } -void u8g2_Setup_SDL_128x64(u8g2_t *u8g2, const u8g2_cb_t *u8g2_cb) +void u8g2_SetupBuffer_SDL_128x64(u8g2_t *u8g2, const u8g2_cb_t *u8g2_cb) { static uint8_t buf[128*8]; u8x8_Setup_SDL_128x64(u8g2_GetU8x8(u8g2)); - u8g2_Setup(u8g2, buf, 8, u8g2_cb); + u8g2_SetupBuffer(u8g2, buf, 8, u8g2_cb); } -void u8g2_Setup_SDL_128x64_4(u8g2_t *u8g2, const u8g2_cb_t *u8g2_cb) +void u8g2_SetupBuffer_SDL_128x64_4(u8g2_t *u8g2, const u8g2_cb_t *u8g2_cb) { static uint8_t buf[128*3]; u8x8_Setup_SDL_128x64(u8g2_GetU8x8(u8g2)); - u8g2_Setup(u8g2, buf, 3, u8g2_cb); + u8g2_SetupBuffer(u8g2, buf, 3, u8g2_cb); } diff --git a/sys/sdl/hello_numeric/main.c b/sys/sdl/hello_numeric/main.c index f0ee51cf..8aed2c96 100644 --- a/sys/sdl/hello_numeric/main.c +++ b/sys/sdl/hello_numeric/main.c @@ -11,7 +11,7 @@ int main(void) int k; int i; - u8g2_Setup_SDL_128x64_4(&u8g2, &u8g2_cb_r0); + u8g2_SetupBuffer_SDL_128x64_4(&u8g2, &u8g2_cb_r0); u8x8_InitDisplay(u8g2_GetU8x8(&u8g2)); u8x8_SetPowerSave(u8g2_GetU8x8(&u8g2), 0); diff --git a/sys/sdl/hvline/main.c b/sys/sdl/hvline/main.c index 341f47bd..1d9e3e69 100644 --- a/sys/sdl/hvline/main.c +++ b/sys/sdl/hvline/main.c @@ -56,7 +56,7 @@ u8g2_t u8g2; int main(void) { - u8g2_Setup_SDL_128x64(&u8g2, &u8g2_cb_r0); + u8g2_SetupBuffer_SDL_128x64(&u8g2, &u8g2_cb_r0); u8x8_InitDisplay(u8g2_GetU8x8(&u8g2)); u8x8_SetPowerSave(u8g2_GetU8x8(&u8g2), 0); diff --git a/sys/sdl/string_width/main.c b/sys/sdl/string_width/main.c index 7797bc87..dc5487d3 100644 --- a/sys/sdl/string_width/main.c +++ b/sys/sdl/string_width/main.c @@ -11,7 +11,7 @@ int main(void) int k; int i; - u8g2_Setup_SDL_128x64_4(&u8g2, &u8g2_cb_r0); + u8g2_SetupBuffer_SDL_128x64_4(&u8g2, &u8g2_cb_r0); u8x8_InitDisplay(u8g2_GetU8x8(&u8g2)); u8x8_SetPowerSave(u8g2_GetU8x8(&u8g2), 0); u8g2_SetFont(&u8g2, u8g2_font_helvB18_tr); diff --git a/sys/sdl/text_full_buffer/main.c b/sys/sdl/text_full_buffer/main.c index 2dd7a8b1..92fc9a1c 100644 --- a/sys/sdl/text_full_buffer/main.c +++ b/sys/sdl/text_full_buffer/main.c @@ -202,7 +202,7 @@ int main(void) int x, y; int k; - u8g2_Setup_SDL_128x64(&u8g2, &u8g2_cb_r0); + u8g2_SetupBuffer_SDL_128x64(&u8g2, &u8g2_cb_r0); u8x8_InitDisplay(u8g2_GetU8x8(&u8g2)); u8x8_SetPowerSave(u8g2_GetU8x8(&u8g2), 0); u8g2_SetFont(&u8g2, u8g2_font_helvB18_tr); diff --git a/sys/sdl/text_picture_loop/main.c b/sys/sdl/text_picture_loop/main.c index 3cb9c955..faf9d08d 100644 --- a/sys/sdl/text_picture_loop/main.c +++ b/sys/sdl/text_picture_loop/main.c @@ -11,7 +11,7 @@ int main(void) int k; int i; - u8g2_Setup_SDL_128x64_4(&u8g2, &u8g2_cb_r0); + u8g2_SetupBuffer_SDL_128x64_4(&u8g2, &u8g2_cb_r0); u8x8_InitDisplay(u8g2_GetU8x8(&u8g2)); u8x8_SetPowerSave(u8g2_GetU8x8(&u8g2), 0); diff --git a/sys/sdl/text_unicode/main.c b/sys/sdl/text_unicode/main.c index 918babb1..0a4b17dc 100644 --- a/sys/sdl/text_unicode/main.c +++ b/sys/sdl/text_unicode/main.c @@ -296,7 +296,7 @@ int main(void) int k; int i; - u8g2_Setup_SDL_128x64_4(&u8g2, &u8g2_cb_r0); + u8g2_SetupBuffer_SDL_128x64_4(&u8g2, &u8g2_cb_r0); u8x8_InitDisplay(u8g2_GetU8x8(&u8g2)); u8x8_SetPowerSave(u8g2_GetU8x8(&u8g2), 0); //u8g2_SetFont(&u8g2, u8g2_font_helvB18_tr); diff --git a/sys/stdio/test.c b/sys/stdio/test.c index 3a49fa57..293dae4f 100644 --- a/sys/stdio/test.c +++ b/sys/stdio/test.c @@ -58,7 +58,7 @@ const uint8_t bdf_font[762] U8G2_FONT_SECTION("bdf_font") = { int main(void) { uint8_t tile[8] = { 0x0f, 0x0f, 0x0f, 0x0f, 0xf0, 0xf0, 0xf0, 0xf0 }; - u8g2_SetupStdio(&u8g2); + u8g2_SetupBufferStdio(&u8g2); u8g2_display_Init(&u8g2); u8g2_display_PowerUp(&u8g2); diff --git a/sys/tga/common/u8x8_d_tga.c b/sys/tga/common/u8x8_d_tga.c index ee8b4acb..8887118c 100644 --- a/sys/tga/common/u8x8_d_tga.c +++ b/sys/tga/common/u8x8_d_tga.c @@ -284,12 +284,12 @@ void u8x8_Setup_TGA_DESC(u8x8_t *u8x8) u8x8_SetupMemory(u8x8); } -void u8g2_Setup_TGA_DESC(u8g2_t *u8g2, const u8g2_cb_t *u8g2_cb) +void u8g2_SetupBuffer_TGA_DESC(u8g2_t *u8g2, const u8g2_cb_t *u8g2_cb) { static uint8_t buf[(XOFFSET+DEFAULT_WIDTH)*8]; u8x8_Setup_TGA_DESC(u8g2_GetU8x8(u8g2)); - u8g2_Setup(u8g2, buf, 1, u8g2_cb); + u8g2_SetupBuffer(u8g2, buf, 1, u8g2_cb); } /*==========================================*/ @@ -393,12 +393,12 @@ void u8x8_Setup_TGA_LCD(u8x8_t *u8x8) u8x8_SetupMemory(u8x8); } -void u8g2_Setup_TGA_LCD(u8g2_t *u8g2, const u8g2_cb_t *u8g2_cb) +void u8g2_SetupBuffer_TGA_LCD(u8g2_t *u8g2, const u8g2_cb_t *u8g2_cb) { static uint8_t buf[(DEFAULT_WIDTH/FACTOR)*8]; u8x8_Setup_TGA_LCD(u8g2_GetU8x8(u8g2)); - u8g2_Setup(u8g2, buf, 1, u8g2_cb); + u8g2_SetupBuffer(u8g2, buf, 1, u8g2_cb); } diff --git a/sys/tga/example/main.c b/sys/tga/example/main.c index 06231139..6c68533b 100644 --- a/sys/tga/example/main.c +++ b/sys/tga/example/main.c @@ -61,7 +61,7 @@ int main(void) int k; int i; - u8g2_Setup_TGA_LCD(&u8g2, &u8g2_cb_r0); + u8g2_SetupBuffer_TGA_LCD(&u8g2, &u8g2_cb_r0); u8x8_InitDisplay(u8g2_GetU8x8(&u8g2)); u8x8_SetPowerSave(u8g2_GetU8x8(&u8g2), 0); u8g2_SetFont(&u8g2, u8g2_font_helvB18_tr); diff --git a/sys/tga/ref_man_pics_8x8/main.c b/sys/tga/ref_man_pics_8x8/main.c index b4d65633..13e3e4f0 100644 --- a/sys/tga/ref_man_pics_8x8/main.c +++ b/sys/tga/ref_man_pics_8x8/main.c @@ -81,7 +81,7 @@ int main(void) u8x8_DrawString(&desc, 0, 0, "Description"); */ - u8g2_Setup_TGA_DESC(&desc, &u8g2_cb_r0); + u8g2_SetupBuffer_TGA_DESC(&desc, &u8g2_cb_r0); u8x8_InitDisplay(u8g2_GetU8x8(&desc)); u8x8_SetPowerSave(u8g2_GetU8x8(&desc), 0); u8x8_ClearDisplay(u8g2_GetU8x8(&desc)); diff --git a/sys/tga/text_picture_loop/main.c b/sys/tga/text_picture_loop/main.c index 2ed8b1b9..b70e5301 100644 --- a/sys/tga/text_picture_loop/main.c +++ b/sys/tga/text_picture_loop/main.c @@ -12,7 +12,7 @@ int main(void) int k; int i; - u8g2_Setup_TGA_DESC(&u8g2, &u8g2_cb_r0); + u8g2_SetupBuffer_TGA_DESC(&u8g2, &u8g2_cb_r0); u8x8_InitDisplay(u8g2_GetU8x8(&u8g2)); u8x8_SetPowerSave(u8g2_GetU8x8(&u8g2), 0); u8g2_SetFont(&u8g2, u8g2_font_helvB18_tr); diff --git a/tools/codebuild/codebuild.c b/tools/codebuild/codebuild.c index 8a883bd1..1d6acd09 100644 --- a/tools/codebuild/codebuild.c +++ b/tools/codebuild/codebuild.c @@ -22,14 +22,14 @@ struct controller struct controller controller_list[] = { { - "SSD1306", 16, 8, "u8x8_cad_001", + "ssd1306", 16, 8, "u8x8_cad_001", { { "128x64_noname" }, { NULL } } }, { - "UC1701", 9, 8, "u8x8_cad_001", + "uc1701", 9, 8, "u8x8_cad_001", { { "dogs102" }, { NULL } @@ -43,11 +43,20 @@ char *strlowercase(const char *s) { int i, len = strlen(s); static char buf[1024]; - for( i = 0; i < len; i++ ) + for( i = 0; i <= len; i++ ) buf[i] = tolower(s[i]); return buf; } +char *struppercase(const char *s) +{ + int i, len = strlen(s); + static char buf[1024]; + for( i = 0; i <= len; i++ ) + buf[i] = toupper(s[i]); + return buf; +} + /*===========================================*/ FILE *buf_code_fp; @@ -58,6 +67,22 @@ FILE *setup_code_fp; /*===========================================*/ +void do_display(int controller_idx, int display_idx, const char *postfix) +{ + fprintf(setup_code_fp, "uint8_t *u8g2_Setup_"); + fprintf(setup_code_fp, "%s_", strlowercase(controller_list[controller_idx].name)); + fprintf(setup_code_fp, "%s_", strlowercase(controller_list[controller_idx].display_list[display_idx].name)); + fprintf(setup_code_fp, "%s(uint8_t *u8g2, u8x8_msg_cb byte_cb, u8x8_msg_cb gpio_and_delay_cb)\n", postfix); + fprintf(setup_code_fp, "{\n"); + fprintf(setup_code_fp, " u8g2_SetupDisplay(u8x8_d_"); + fprintf(setup_code_fp, "%s_", strlowercase(controller_list[controller_idx].name)); + fprintf(setup_code_fp, "%s, ", strlowercase(controller_list[controller_idx].display_list[display_idx].name)); + fprintf(setup_code_fp, "%s, ", controller_list[controller_idx].cad); + fprintf(setup_code_fp, "byte_cb, gpio_and_delay_cb);"); + + fprintf(setup_code_fp, "}\n"); +} + void do_controller_buffer_code(int idx, const char *postfix, int buf_len, int rows) { int display_idx; @@ -77,6 +102,7 @@ void do_controller_buffer_code(int idx, const char *postfix, int buf_len, int ro while( controller_list[idx].display_list[display_idx].name != NULL ) { printf("%s\n", controller_list[idx].display_list[display_idx].name); + do_display(idx, display_idx, postfix); display_idx++; } @@ -105,7 +131,7 @@ int main(void) fprintf(buf_header_fp, "/* start of generated code, codebuild, u8g2 project */\n"); setup_code_fp = fopen("u8g2_setup.c", "w"); - fprintf(buf_code_fp, "/* start of generated code, codebuild, u8g2 project */\n"); + fprintf(setup_code_fp, "/* start of generated code, codebuild, u8g2 project */\n"); do_controller_list(); @@ -114,6 +140,9 @@ int main(void) fprintf(buf_header_fp, "/* end of generated code */\n"); fclose(buf_header_fp); + + fprintf(setup_code_fp, "/* end of generated code */\n"); + fclose(setup_code_fp); return 0; } diff --git a/tools/font/build/build.c b/tools/font/build/build.c index 2f73f937..b8da2256 100644 --- a/tools/font/build/build.c +++ b/tools/font/build/build.c @@ -14,7 +14,7 @@ extern const uint8_t *u8g2_font_list[] ; extern char *u8g2_font_names[] ; #ifdef BUILD2 -extern void u8g2_Setup_TGA(u8g2_t *u8g2, const u8g2_cb_t *u8g2_cb); +extern void u8g2_SetupBuffer_TGA(u8g2_t *u8g2, const u8g2_cb_t *u8g2_cb); extern void tga_save(const char *name); #endif @@ -664,7 +664,7 @@ void overviewpic(int i, int fm, char *fms, int bm, char *bms, int mm, char *mms) { printf("8x8 font overview picture %s\n", target_font_identifier); - u8g2_Setup_TGA(&u8g2, &u8g2_cb_r0); + u8g2_SetupBuffer_TGA(&u8g2, &u8g2_cb_r0); u8x8_InitDisplay(u8g2_GetU8x8(&u8g2)); u8x8_SetPowerSave(u8g2_GetU8x8(&u8g2), 0); //u8x8_ClearDisplay(u8g2_GetU8x8(&u8g2)); @@ -700,7 +700,7 @@ void overviewpic(int i, int fm, char *fms, int bm, char *bms, int mm, char *mms) else if ( fm == FM_C ) { printf("overview picture %s\n", target_font_identifier); - u8g2_Setup_TGA(&u8g2, &u8g2_cb_r0); + u8g2_SetupBuffer_TGA(&u8g2, &u8g2_cb_r0); u8x8_InitDisplay(u8g2_GetU8x8(&u8g2)); u8x8_SetPowerSave(u8g2_GetU8x8(&u8g2), 0); //u8g2_SetFont(&u8g2, u8g2_font_helvB14_tr); @@ -733,7 +733,7 @@ void overviewshortpic(int i, int fm, char *fms, int bm, char *bms, int mm, char if ( fm == FM_8 ) { printf("8x8 font short overview picture %s\n", target_font_identifier); - u8g2_Setup_TGA(&u8g2, &u8g2_cb_r0); + u8g2_SetupBuffer_TGA(&u8g2, &u8g2_cb_r0); u8x8_InitDisplay(u8g2_GetU8x8(&u8g2)); u8x8_SetPowerSave(u8g2_GetU8x8(&u8g2), 0); //u8x8_ClearDisplay(u8g2_GetU8x8(&u8g2)); @@ -756,7 +756,7 @@ void overviewshortpic(int i, int fm, char *fms, int bm, char *bms, int mm, char else if ( fm == FM_C ) { printf("short overview picture %s\n", target_font_identifier); - u8g2_Setup_TGA(&u8g2, &u8g2_cb_r0); + u8g2_SetupBuffer_TGA(&u8g2, &u8g2_cb_r0); u8x8_InitDisplay(u8g2_GetU8x8(&u8g2)); u8x8_SetPowerSave(u8g2_GetU8x8(&u8g2), 0); //u8g2_SetFont(&u8g2, u8g2_font_helvB14_tr); @@ -807,7 +807,7 @@ void generate_font_list(int i, int fm, char *fms, int bm, char *bms, int mm, cha } else if ( fm == FM_C ) { - u8g2_Setup_TGA(&u8g2, &u8g2_cb_r0); + u8g2_SetupBuffer_TGA(&u8g2, &u8g2_cb_r0); u8x8_InitDisplay(u8g2_GetU8x8(&u8g2)); u8x8_SetPowerSave(u8g2_GetU8x8(&u8g2), 0); if ( u8g2_font_list[u8g2_fnt_cnt] != NULL ) diff --git a/tools/font/build/u8g2_d_tga.c b/tools/font/build/u8g2_d_tga.c index 1343ba6d..0746ed81 100644 --- a/tools/font/build/u8g2_d_tga.c +++ b/tools/font/build/u8g2_d_tga.c @@ -261,11 +261,11 @@ void u8x8_Setup_TGA(u8x8_t *u8x8) u8x8_SetupMemory(u8x8); } -void u8g2_Setup_TGA(u8g2_t *u8g2, const u8g2_cb_t *u8g2_cb) +void u8g2_SetupBuffer_TGA(u8g2_t *u8g2, const u8g2_cb_t *u8g2_cb) { static uint8_t buf[(DEFAULT_WIDTH)*8*8]; u8x8_Setup_TGA(u8g2_GetU8x8(u8g2)); - u8g2_Setup(u8g2, buf, 8, u8g2_cb); + u8g2_SetupBuffer(u8g2, buf, 8, u8g2_cb); }