diff --git a/lvgl_tft/GC9A01.c b/lvgl_tft/GC9A01.c index 81a71d3..27902b5 100644 --- a/lvgl_tft/GC9A01.c +++ b/lvgl_tft/GC9A01.c @@ -221,12 +221,6 @@ static void GC9A01_set_orientation(uint8_t orientation) { assert(orientation < 4); - const char *orientation_str[] = { - "PORTRAIT", "PORTRAIT_INVERTED", "LANDSCAPE", "LANDSCAPE_INVERTED" - }; - - LV_LOG_INFO("Display orientation: %s", orientation_str[orientation]); - #if defined CONFIG_LV_PREDEFINED_DISPLAY_M5STACK const uint8_t data[] = {0x68, 0x68, 0x08, 0x08}; #elif defined (CONFIG_LV_PREDEFINED_DISPLAY_WROVER4) @@ -235,7 +229,14 @@ static void GC9A01_set_orientation(uint8_t orientation) const uint8_t data[] = {0x08, 0xC8, 0x68, 0xA8}; #endif +#if (LV_USE_LOG == 1); + const char *orientation_str[] = { + "PORTRAIT", "PORTRAIT_INVERTED", "LANDSCAPE", "LANDSCAPE_INVERTED" + }; + + LV_LOG_INFO("Display orientation: %s", orientation_str[orientation]); LV_LOG_INFO("0x36 command value: 0x%02X", data[orientation]); +#endif GC9A01_send_cmd(0x36); GC9A01_send_data((void *) &data[orientation], 1); diff --git a/lvgl_tft/ili9163c.c b/lvgl_tft/ili9163c.c index 56b9fca..0db6592 100644 --- a/lvgl_tft/ili9163c.c +++ b/lvgl_tft/ili9163c.c @@ -223,11 +223,12 @@ static void ili9163c_set_orientation(uint8_t orientation) { assert(orientation < 4); +#if (LV_USE_LOG == 1) const char *orientation_str[] = { "PORTRAIT", "PORTRAIT_INVERTED", "LANDSCAPE", "LANDSCAPE_INVERTED"}; LV_LOG_INFO("Display orientation: %s", orientation_str[orientation]); - +#endif uint8_t data[] = {0x48, 0x88, 0xA8, 0x68}; ili9163c_send_cmd(ILI9163C_MADCTL); diff --git a/lvgl_tft/ili9486.c b/lvgl_tft/ili9486.c index b4e3a0a..2283e54 100644 --- a/lvgl_tft/ili9486.c +++ b/lvgl_tft/ili9486.c @@ -165,15 +165,16 @@ static void ili9486_set_orientation(uint8_t orientation) { assert(orientation < 4); + const uint8_t data[] = {0x48, 0x88, 0x28, 0xE8}; + +#if (LV_USE_LOG == 1) const char *orientation_str[] = { "PORTRAIT", "PORTRAIT_INVERTED", "LANDSCAPE", "LANDSCAPE_INVERTED" }; LV_LOG_INFO("Display orientation: %s", orientation_str[orientation]); - - const uint8_t data[] = {0x48, 0x88, 0x28, 0xE8}; - LV_LOG_INFO("0x36 command value: 0x%02X", data[orientation]); +#endif ili9486_send_cmd(0x36); ili9486_send_data((void *) &data[orientation], 1); diff --git a/lvgl_tft/ili9488.c b/lvgl_tft/ili9488.c index 1f67391..8a02eef 100644 --- a/lvgl_tft/ili9488.c +++ b/lvgl_tft/ili9488.c @@ -188,16 +188,16 @@ static void ili9488_send_color(lv_disp_drv_t * drv, void * data, uint16_t length static void ili9488_set_orientation(lv_disp_drv_t * drv, uint8_t orientation) { assert(orientation < 4); + const uint8_t data[] = {0x48, 0x88, 0x28, 0xE8}; +#if (LV_USE_LOG == 1) const char *orientation_str[] = { "PORTRAIT", "PORTRAIT_INVERTED", "LANDSCAPE", "LANDSCAPE_INVERTED" }; LV_LOG_INFO("Display orientation: %s", orientation_str[orientation]); - - const uint8_t data[] = {0x48, 0x88, 0x28, 0xE8}; - LV_LOG_INFO("0x36 command value: 0x%02X", data[orientation]); +#endif ili9488_send_cmd(drv, 0x36); ili9488_send_data(drv, (void *) &data[orientation], 1); diff --git a/lvgl_tft/st7735s.c b/lvgl_tft/st7735s.c index 0f23a29..c2786a1 100644 --- a/lvgl_tft/st7735s.c +++ b/lvgl_tft/st7735s.c @@ -205,11 +205,7 @@ static void st7735s_send_color(void * data, uint16_t length) static void st7735s_set_orientation(uint8_t orientation) { - const char *orientation_str[] = { - "PORTRAIT", "PORTRAIT_INVERTED", "LANDSCAPE", "LANDSCAPE_INVERTED" - }; - - LV_LOG_INFO("Display orientation: %s", orientation_str[orientation]); + assert(orientation < 4); /* Portrait: 0xC8 = ST77XX_MADCTL_MX | ST77XX_MADCTL_MY | ST77XX_MADCTL_BGR @@ -218,7 +214,14 @@ static void st7735s_set_orientation(uint8_t orientation) */ uint8_t data[] = {0xC8, 0xC8, 0xA8, 0xA8}; +#if (LV_USE_LOG == 1) + const char *orientation_str[] = { + "PORTRAIT", "PORTRAIT_INVERTED", "LANDSCAPE", "LANDSCAPE_INVERTED" + }; + + LV_LOG_INFO("Display orientation: %s", orientation_str[orientation]); LV_LOG_INFO("0x36 command value: 0x%02X", data[orientation]); +#endif st7735s_send_cmd(ST7735_MADCTL); st7735s_send_data((void *) &data[orientation], 1); diff --git a/lvgl_tft/st7796s.c b/lvgl_tft/st7796s.c index 8bc07e5..75e9bd2 100644 --- a/lvgl_tft/st7796s.c +++ b/lvgl_tft/st7796s.c @@ -189,11 +189,6 @@ static void st7796s_set_orientation(uint8_t orientation) { assert(orientation < 4); - const char *orientation_str[] = { - "PORTRAIT", "PORTRAIT_INVERTED", "LANDSCAPE", "LANDSCAPE_INVERTED"}; - - LV_LOG_INFO("Display orientation: %s", orientation_str[orientation]); - #if defined CONFIG_LV_PREDEFINED_DISPLAY_M5STACK const uint8_t data[] = {0x68, 0x68, 0x08, 0x08}; #elif defined(CONFIG_LV_PREDEFINED_DISPLAY_WROVER4) @@ -204,7 +199,13 @@ static void st7796s_set_orientation(uint8_t orientation) const uint8_t data[] = {0x48, 0x88, 0x28, 0xE8}; #endif +#if (LV_USE_LOG == 1) + const char *orientation_str[] = { + "PORTRAIT", "PORTRAIT_INVERTED", "LANDSCAPE", "LANDSCAPE_INVERTED"}; + + LV_LOG_INFO("Display orientation: %s", orientation_str[orientation]); LV_LOG_INFO("0x36 command value: 0x%02X", data[orientation]); +#endif st7796s_send_cmd(0x36); st7796s_send_data((void *)&data[orientation], 1);