From bfb14dd948bf19ebfc868132a2621f27dce545d4 Mon Sep 17 00:00:00 2001 From: olikraus Date: Sun, 3 Jan 2016 18:30:19 +0100 Subject: [PATCH] R3 --- csrc/u8g2_setup.c | 24 +++++++++---------- .../u8g2_page_buffer/U8g2Logo/U8g2Logo.ino | 2 +- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/csrc/u8g2_setup.c b/csrc/u8g2_setup.c index fd4a8b6c..a26d3cc2 100644 --- a/csrc/u8g2_setup.c +++ b/csrc/u8g2_setup.c @@ -73,7 +73,8 @@ static void u8g2_update_dimension_common(u8g2_t *u8g2) t *= 8; u8g2->pixel_buf_height = t; - t = u8g2_GetU8x8(u8g2)->display_info->pixel_width; + t = u8g2_GetU8x8(u8g2)->display_info->tile_width; + t *= 8; u8g2->pixel_buf_width = t; t = u8g2->tile_curr_row; @@ -90,9 +91,8 @@ static void u8g2_update_dimension_common(u8g2_t *u8g2) u8g2->buf_y1 = u8g2->buf_y0; u8g2->buf_y1 += t; - u8g2->width = u8g2->pixel_buf_width; - t = u8g2_GetU8x8(u8g2)->display_info->pixel_height; - u8g2->height = t; + u8g2->width = u8g2_GetU8x8(u8g2)->display_info->pixel_width; + u8g2->height = u8g2_GetU8x8(u8g2)->display_info->pixel_height; } void u8g2_update_dimension_r0(u8g2_t *u8g2) @@ -113,9 +113,9 @@ void u8g2_update_dimension_r1(u8g2_t *u8g2) { u8g2_update_dimension_common(u8g2); - u8g2->width = u8g2->height; - u8g2->height = u8g2->pixel_buf_width; - + u8g2->height = u8g2_GetU8x8(u8g2)->display_info->pixel_width; + u8g2->width = u8g2_GetU8x8(u8g2)->display_info->pixel_height; + u8g2->user_x0 = u8g2->buf_y0; u8g2->user_x1 = u8g2->buf_y1; @@ -144,11 +144,11 @@ void u8g2_update_dimension_r3(u8g2_t *u8g2) { u8g2_update_dimension_common(u8g2); - u8g2->width = u8g2->height; - u8g2->height = u8g2->pixel_buf_width; + u8g2->height = u8g2_GetU8x8(u8g2)->display_info->pixel_width; + u8g2->width = u8g2_GetU8x8(u8g2)->display_info->pixel_height; - u8g2->user_x0 = u8g2->height - u8g2->buf_y1; - u8g2->user_x1 = u8g2->height - u8g2->buf_y0; + u8g2->user_x0 = u8g2->width - u8g2->buf_y1; + u8g2->user_x1 = u8g2->width - u8g2->buf_y0; u8g2->user_y0 = 0; u8g2->user_y1 = u8g2->pixel_buf_width; @@ -204,7 +204,7 @@ void u8g2_draw_l90_r3(u8g2_t *u8g2, u8g2_uint_t x, u8g2_uint_t y, u8g2_uint_t le xx = y; - yy = u8g2->height; + yy = u8g2->width; yy -= x; yy--; diff --git a/sys/arduino/u8g2_page_buffer/U8g2Logo/U8g2Logo.ino b/sys/arduino/u8g2_page_buffer/U8g2Logo/U8g2Logo.ino index d6a13478..d76abfe1 100644 --- a/sys/arduino/u8g2_page_buffer/U8g2Logo/U8g2Logo.ino +++ b/sys/arduino/u8g2_page_buffer/U8g2Logo/U8g2Logo.ino @@ -52,7 +52,7 @@ //U8G2_SSD1306_128X64_NONAME_1_SW_I2C u8g2(U8G2_R0, /* clock=*/ 13, /* data=*/ 11, /* reset=*/ 8); //U8G2_SSD1306_128X64_NONAME_1_6800 u8g2(U8G2_R0, 13, 11, 2, 3, 4, 5, 6, A4, /*enable=*/ 7, /*cs=*/ 10, /*dc=*/ 9, /*reset=*/ 8); //U8G2_SSD1306_128X64_NONAME_1_8080 u8g2(U8G2_R0, 13, 11, 2, 3, 4, 5, 6, A4, /*enable=*/ 7, /*cs=*/ 10, /*dc=*/ 9, /*reset=*/ 8); -U8G2_UC1701_DOGS102_1_4W_SW_SPI u8g2(U8G2_R2, /* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); +U8G2_UC1701_DOGS102_1_4W_SW_SPI u8g2(U8G2_R0, /* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); //U8G2_UC1701_DOGS102_1_4W_HW_SPI u8g2(U8G2_R0, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8); //#define MINI_LOGO