ST7789: Cleanup

Remove logging and unneccesary includes
This commit is contained in:
C47D 2021-09-08 23:01:01 -05:00
parent dfe54e8573
commit d79b68bdf6

View file

@ -4,9 +4,6 @@
* Mostly taken from lbthomsen/esp-idf-littlevgl github. * Mostly taken from lbthomsen/esp-idf-littlevgl github.
*/ */
#include "sdkconfig.h"
#include "esp_log.h"
#include "st7789.h" #include "st7789.h"
#include "disp_spi.h" #include "disp_spi.h"
@ -88,8 +85,6 @@ void st7789_init(lv_disp_drv_t *drv)
st7789_reset(drv); st7789_reset(drv);
ESP_LOGI(TAG, "Initialization.\n");
//Send all the commands //Send all the commands
uint16_t cmd = 0; uint16_t cmd = 0;
while (st7789_init_cmds[cmd].databytes!=0xff) { while (st7789_init_cmds[cmd].databytes!=0xff) {
@ -103,13 +98,13 @@ void st7789_init(lv_disp_drv_t *drv)
st7789_enable_backlight(drv, true); st7789_enable_backlight(drv, true);
st7789_set_orientation(drv, CONFIG_LV_DISPLAY_ORIENTATION); /* FIXME We're setting up the initial orientation in the cmd array */
st7789_set_orientation(drv, ST7789_INITIAL_ORIENTATION);
} }
void st7789_enable_backlight(lv_disp_drv_t *drv, bool backlight) void st7789_enable_backlight(lv_disp_drv_t *drv, bool backlight)
{ {
#if ST7789_ENABLE_BACKLIGHT_CONTROL #if ST7789_ENABLE_BACKLIGHT_CONTROL
ESP_LOGI(TAG, "%s backlight.\n", backlight ? "Enabling" : "Disabling");
uint32_t tmp = 0; uint32_t tmp = 0;
#if (ST7789_BCKL_ACTIVE_LVL==1) #if (ST7789_BCKL_ACTIVE_LVL==1)
@ -211,12 +206,6 @@ static void st7789_reset(lv_disp_drv_t *drv)
static void st7789_set_orientation(lv_disp_drv_t *drv, uint8_t orientation) static void st7789_set_orientation(lv_disp_drv_t *drv, uint8_t orientation)
{ {
const char *orientation_str[] = {
"PORTRAIT", "PORTRAIT_INVERTED", "LANDSCAPE", "LANDSCAPE_INVERTED"
};
ESP_LOGI(TAG, "Display orientation: %s", orientation_str[orientation]);
uint8_t data[] = uint8_t data[] =
{ {
#if CONFIG_LV_PREDEFINED_DISPLAY_TTGO #if CONFIG_LV_PREDEFINED_DISPLAY_TTGO
@ -226,8 +215,6 @@ static void st7789_set_orientation(lv_disp_drv_t *drv, uint8_t orientation)
#endif #endif
}; };
ESP_LOGI(TAG, "0x36 command value: 0x%02X", data[orientation]);
st7789_send_cmd(drv, ST7789_MADCTL); st7789_send_cmd(drv, ST7789_MADCTL);
st7789_send_data(drv, (void *) &data[orientation], 1); st7789_send_data(drv, (void *) &data[orientation], 1);
} }