From a3d6a85516db6a7c1ecb82f146d10af26145fcf9 Mon Sep 17 00:00:00 2001 From: Shaun Reed Date: Sat, 1 Mar 2025 16:51:57 -0500 Subject: [PATCH] Includes. --- esp/cpp/07_lcd-panel-i2c/README.md | 4 ++-- esp/cpp/07_lcd-panel-i2c/main/display.cpp | 6 +----- esp/cpp/07_lcd-panel-i2c/main/panel_device.cpp | 2 -- esp/cpp/07_lcd-panel-i2c/main/panel_device.h | 2 +- esp/cpp/07_lcd-panel-i2c/main/time_keeper.h | 6 ++---- 5 files changed, 6 insertions(+), 14 deletions(-) diff --git a/esp/cpp/07_lcd-panel-i2c/README.md b/esp/cpp/07_lcd-panel-i2c/README.md index c98e8cc..5643678 100644 --- a/esp/cpp/07_lcd-panel-i2c/README.md +++ b/esp/cpp/07_lcd-panel-i2c/README.md @@ -2,8 +2,6 @@ Using the ESP IDF for drawing to a LCD screen over I2C. -For instructions on setting up the ESP-IDF see [04_-esp-idf-arduino](./../04_esp-idf-arduino) - [ESP IDF - I2C](https://docs.espressif.com/projects/esp-idf/en/v5.3.2/esp32/api-reference/peripherals/i2c.html) [ESP IDF - LCD](https://docs.espressif.com/projects/esp-idf/en/v5.3.2/esp32/api-reference/peripherals/lcd/index.html) @@ -14,6 +12,8 @@ For instructions on setting up the ESP-IDF see [04_-esp-idf-arduino](./../04_esp ![example](./example.gif) +For instructions on setting up the ESP-IDF see [04_-esp-idf-arduino](./../04_esp-idf-arduino) + To build this example run the following commands. ```bash diff --git a/esp/cpp/07_lcd-panel-i2c/main/display.cpp b/esp/cpp/07_lcd-panel-i2c/main/display.cpp index 7c9e44c..0177461 100644 --- a/esp/cpp/07_lcd-panel-i2c/main/display.cpp +++ b/esp/cpp/07_lcd-panel-i2c/main/display.cpp @@ -5,12 +5,8 @@ ## Contact: shaunrd0@gmail.com | URL: www.shaunreed.com ## ############################################################################## */ -#include - #include -#include - #include "display.h" // Static TimeKeeper for managing ESP timers across all displays. @@ -49,7 +45,7 @@ void Display::set_text(const char *text, } auto obj = lv_objects_[name]; - // Circular scroll. + // Set text and long mode. lv_label_set_long_mode(obj, long_mode); lv_label_set_text(obj, text); diff --git a/esp/cpp/07_lcd-panel-i2c/main/panel_device.cpp b/esp/cpp/07_lcd-panel-i2c/main/panel_device.cpp index 9ea5085..78c9b0e 100644 --- a/esp/cpp/07_lcd-panel-i2c/main/panel_device.cpp +++ b/esp/cpp/07_lcd-panel-i2c/main/panel_device.cpp @@ -7,8 +7,6 @@ */ #include "panel_device.h" #include "display.h" -#include "scoped_lock.h" -#include "time_keeper.h" bool IPanelDevice::lvgl_flush_ready_cb(esp_lcd_panel_io_handle_t, esp_lcd_panel_io_event_data_t *, diff --git a/esp/cpp/07_lcd-panel-i2c/main/panel_device.h b/esp/cpp/07_lcd-panel-i2c/main/panel_device.h index da4e386..da9d10d 100644 --- a/esp/cpp/07_lcd-panel-i2c/main/panel_device.h +++ b/esp/cpp/07_lcd-panel-i2c/main/panel_device.h @@ -218,7 +218,7 @@ public: esp_lcd_panel_del(panel); } - ESP_LOGI(TAG, "Install SSD1306 panel driver"); + ESP_LOGI(TAG, "Installing vendor panel driver"); // Call pure virtual method responsible for initializing the panel handle. init_panel(config, io, panel); } diff --git a/esp/cpp/07_lcd-panel-i2c/main/time_keeper.h b/esp/cpp/07_lcd-panel-i2c/main/time_keeper.h index cd39e32..71eafbb 100644 --- a/esp/cpp/07_lcd-panel-i2c/main/time_keeper.h +++ b/esp/cpp/07_lcd-panel-i2c/main/time_keeper.h @@ -18,7 +18,6 @@ * In general Timers should be used via the TimeKeeper interface only. * * Timers cannot be copied, and are only created by a TimeKeeper instance. - * The public way to access a Timer is by obtaining a TimerHandle (Timer *). * The TimeKeeper can delete existing Timers, calling it's destructor. * The ESP timer will be deleted when this class desctructor is called. */ @@ -133,9 +132,8 @@ struct TimeKeeper { } /// Create a Timer with the ESP args and call esp_timer_start_once. - [[maybe_unused]] void - start_new_timer_once(esp_timer_create_args_t args, - uint64_t timeout_us) + [[maybe_unused]] void start_new_timer_once(esp_timer_create_args_t args, + uint64_t timeout_us) { start_timer_once(create_timer(args)->args_.name, timeout_us); }