From de115e2be32bdd1890071ec0e834de9feb30af1f Mon Sep 17 00:00:00 2001 From: Liu Zhongwei Date: Thu, 23 May 2024 23:06:45 +0800 Subject: [PATCH 1/2] feat(touch): add i2c st1633 Closes https://github.com/esp-arduino-libs/ESP32_Display_Panel/issues/22 --- ESP_Panel_Board_Custom.h | 2 +- .../LVGL/v8/Porting/ESP_Panel_Board_Custom.h | 2 +- .../LVGL/v8/Rotation/ESP_Panel_Board_Custom.h | 2 +- .../Panel/PanelTest/ESP_Panel_Board_Custom.h | 2 +- .../v8/Porting/ESP_Panel_Board_Custom.h | 2 +- .../v8/WiFiClock/ESP_Panel_Board_Custom.h | 2 +- examples/Touch/I2C/I2C.ino | 8 +- src/ESP_Panel_Library.h | 1 + src/touch/ST1633.cpp | 46 ++++ src/touch/ST1633.h | 50 ++++ src/touch/base/esp_lcd_touch_st1633.c | 239 ++++++++++++++++++ src/touch/base/esp_lcd_touch_st1633.h | 54 ++++ 12 files changed, 400 insertions(+), 10 deletions(-) create mode 100644 src/touch/ST1633.cpp create mode 100644 src/touch/ST1633.h create mode 100644 src/touch/base/esp_lcd_touch_st1633.c create mode 100644 src/touch/base/esp_lcd_touch_st1633.h diff --git a/ESP_Panel_Board_Custom.h b/ESP_Panel_Board_Custom.h index 7e4dc5d3..9916371a 100644 --- a/ESP_Panel_Board_Custom.h +++ b/ESP_Panel_Board_Custom.h @@ -214,7 +214,7 @@ * - CST816S * - FT5x06 * - GT911, GT1151 - * - ST7123 + * - ST1633, ST7123 * - TT21100 * - XPT2046 */ diff --git a/examples/LVGL/v8/Porting/ESP_Panel_Board_Custom.h b/examples/LVGL/v8/Porting/ESP_Panel_Board_Custom.h index 7e4dc5d3..9916371a 100644 --- a/examples/LVGL/v8/Porting/ESP_Panel_Board_Custom.h +++ b/examples/LVGL/v8/Porting/ESP_Panel_Board_Custom.h @@ -214,7 +214,7 @@ * - CST816S * - FT5x06 * - GT911, GT1151 - * - ST7123 + * - ST1633, ST7123 * - TT21100 * - XPT2046 */ diff --git a/examples/LVGL/v8/Rotation/ESP_Panel_Board_Custom.h b/examples/LVGL/v8/Rotation/ESP_Panel_Board_Custom.h index 7e4dc5d3..9916371a 100644 --- a/examples/LVGL/v8/Rotation/ESP_Panel_Board_Custom.h +++ b/examples/LVGL/v8/Rotation/ESP_Panel_Board_Custom.h @@ -214,7 +214,7 @@ * - CST816S * - FT5x06 * - GT911, GT1151 - * - ST7123 + * - ST1633, ST7123 * - TT21100 * - XPT2046 */ diff --git a/examples/Panel/PanelTest/ESP_Panel_Board_Custom.h b/examples/Panel/PanelTest/ESP_Panel_Board_Custom.h index 7e4dc5d3..9916371a 100644 --- a/examples/Panel/PanelTest/ESP_Panel_Board_Custom.h +++ b/examples/Panel/PanelTest/ESP_Panel_Board_Custom.h @@ -214,7 +214,7 @@ * - CST816S * - FT5x06 * - GT911, GT1151 - * - ST7123 + * - ST1633, ST7123 * - TT21100 * - XPT2046 */ diff --git a/examples/SquareLine/v8/Porting/ESP_Panel_Board_Custom.h b/examples/SquareLine/v8/Porting/ESP_Panel_Board_Custom.h index 7e4dc5d3..9916371a 100644 --- a/examples/SquareLine/v8/Porting/ESP_Panel_Board_Custom.h +++ b/examples/SquareLine/v8/Porting/ESP_Panel_Board_Custom.h @@ -214,7 +214,7 @@ * - CST816S * - FT5x06 * - GT911, GT1151 - * - ST7123 + * - ST1633, ST7123 * - TT21100 * - XPT2046 */ diff --git a/examples/SquareLine/v8/WiFiClock/ESP_Panel_Board_Custom.h b/examples/SquareLine/v8/WiFiClock/ESP_Panel_Board_Custom.h index 7e4dc5d3..9916371a 100644 --- a/examples/SquareLine/v8/WiFiClock/ESP_Panel_Board_Custom.h +++ b/examples/SquareLine/v8/WiFiClock/ESP_Panel_Board_Custom.h @@ -214,7 +214,7 @@ * - CST816S * - FT5x06 * - GT911, GT1151 - * - ST7123 + * - ST1633, ST7123 * - TT21100 * - XPT2046 */ diff --git a/examples/Touch/I2C/I2C.ino b/examples/Touch/I2C/I2C.ino index bc34da5a..edd04b8d 100644 --- a/examples/Touch/I2C/I2C.ino +++ b/examples/Touch/I2C/I2C.ino @@ -2,8 +2,8 @@ * | Supported ESP SoCs | ESP32 | ESP32-C3 | ESP32-C6 | ESP32-H2 | ESP32-S2 | ESP32-S3 | * | ------------------ | ----- | -------- | -------- | -------- | -------- | -------- | * - * | Supported Touch Controllers | CST816S | FT5x06 | GT911 | GT1151 | ST7123 | TT21100 | - * | --------------------------- | ------- | ------ | ----- | ------ | ------ | ------- | + * | Supported Touch Controllers | CST816S | FT5x06 | GT911 | GT1151 | ST1633 | ST7123 | TT21100 | + * | --------------------------- | ------- | ------ | ----- | ------ | ------ | ------- | ------- | * * # I2C Touch Example * @@ -50,9 +50,9 @@ * - FT5x06 * - GT911, GT1151 * - TT21100 - * - ST7123 + * - ST1633, ST7123 */ -#define EXAMPLE_TOUCH_NAME GT911 +#define EXAMPLE_TOUCH_NAME ST1633 #define EXAMPLE_TOUCH_WIDTH (480) #define EXAMPLE_TOUCH_HEIGHT (480) #define EXAMPLE_TOUCH_I2C_FREQ_HZ (400 * 1000) diff --git a/src/ESP_Panel_Library.h b/src/ESP_Panel_Library.h index 61229dff..33c0f090 100644 --- a/src/ESP_Panel_Library.h +++ b/src/ESP_Panel_Library.h @@ -42,6 +42,7 @@ #include "touch/FT5x06.h" #include "touch/GT1151.h" #include "touch/GT911.h" +#include "touch/ST1633.h" #include "touch/ST7123.h" #include "touch/TT21100.h" #include "touch/XPT2046.h" diff --git a/src/touch/ST1633.cpp b/src/touch/ST1633.cpp new file mode 100644 index 00000000..3b43989a --- /dev/null +++ b/src/touch/ST1633.cpp @@ -0,0 +1,46 @@ +/* + * SPDX-FileCopyrightText: 2024 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#include "ESP_PanelLog.h" +#include "ST1633.h" + +static const char *TAG = "ST1633_CPP"; + +ESP_PanelTouch_ST1633::ESP_PanelTouch_ST1633(ESP_PanelBus *bus, uint16_t width, uint16_t height, + int rst_io, int int_io): + ESP_PanelTouch(bus, width, height, rst_io, int_io) +{ +} + +ESP_PanelTouch_ST1633::ESP_PanelTouch_ST1633(ESP_PanelBus *bus, const esp_lcd_touch_config_t &config): + ESP_PanelTouch(bus, config) +{ +} + +ESP_PanelTouch_ST1633::~ESP_PanelTouch_ST1633() +{ + ESP_PANEL_ENABLE_TAG_DEBUG_LOG(); + + if (handle == NULL) { + goto end; + } + + if (!del()) { + ESP_LOGE(TAG, "Delete device failed"); + } + +end: + ESP_LOGD(TAG, "Destroyed"); +} + +bool ESP_PanelTouch_ST1633::begin(void) +{ + ESP_PANEL_CHECK_NULL_RET(bus, false, "Invalid bus"); + + ESP_PANEL_CHECK_ERR_RET(esp_lcd_touch_new_i2c_st1633(bus->getHandle(), &config, &handle), false, "New driver failed"); + + return true; +} diff --git a/src/touch/ST1633.h b/src/touch/ST1633.h new file mode 100644 index 00000000..6ffef84e --- /dev/null +++ b/src/touch/ST1633.h @@ -0,0 +1,50 @@ +/* + * SPDX-FileCopyrightText: 2024 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#pragma once + +#include "base/esp_lcd_touch_st1633.h" +#include "ESP_PanelTouch.h" + +/** + * @brief ST1633 touch device object class + * + * @note This class is a derived class of `ESP_PanelTouch`, user can use it directly + */ +class ESP_PanelTouch_ST1633 : public ESP_PanelTouch { +public: + /** + * @brief Construct a new touch device in a simple way, the `init()` function should be called after this function + * + * @param bus Pointer to panel bus + * @param width The width of the touch screen + * @param height The height of the touch screen + * @param rst_io The reset pin of the touch screen, set to `-1` if not used + * @param int_io The interrupt pin of the touch screen, set to `-1` if not used + */ + ESP_PanelTouch_ST1633(ESP_PanelBus *bus, uint16_t width, uint16_t height, int rst_io = -1, int int_io = -1); + + /** + * @brief Construct a new touch device in a complex way, the `init()` function should be called after this function + * + * @param bus Pointer to panel bus + * @param config Touch device configuration + */ + ESP_PanelTouch_ST1633(ESP_PanelBus *bus, const esp_lcd_touch_config_t &config); + + /** + * @brief Destroy the LCD device + * + */ + ~ESP_PanelTouch_ST1633() override; + + /** + * @brief Startup the touch device + * + * @return true if success, otherwise false + */ + bool begin(void) override; +}; diff --git a/src/touch/base/esp_lcd_touch_st1633.c b/src/touch/base/esp_lcd_touch_st1633.c new file mode 100644 index 00000000..a7a8775a --- /dev/null +++ b/src/touch/base/esp_lcd_touch_st1633.c @@ -0,0 +1,239 @@ +/* + * SPDX-FileCopyrightText: 2023-2024 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#include "ESP_PanelLog.h" + +#include +#include +#include +#include +#include +#include "esp_system.h" +#include "esp_err.h" +#include "esp_log.h" +#include "esp_check.h" +#include "freertos/FreeRTOS.h" +#include "freertos/task.h" +#include "driver/gpio.h" +#include "driver/i2c.h" +#include "esp_lcd_panel_io.h" +#include "esp_lcd_touch.h" + +#include "esp_lcd_touch_st1633.h" + +#define FW_VERSION_REG (0x00) +#define XY_RES_H_REG (0x04) +#define FW_REVISION_REG (0x0C) +#define ADVANCED_INFO_REG (0x10) + +#define MAX_TOUCH_NUM (10) +#define MAX_READ_TOUCH_NUM (MAX(MAX_TOUCH_NUM, CONFIG_ESP_LCD_TOUCH_MAX_POINTS)) + +static const char *TAG = "ST1633"; + +static esp_err_t read_data(esp_lcd_touch_handle_t tp); +static bool get_xy(esp_lcd_touch_handle_t tp, uint16_t *x, uint16_t *y, uint16_t *strength, uint8_t *point_num, uint8_t max_point_num); +static esp_err_t del(esp_lcd_touch_handle_t tp); +static esp_err_t reset(esp_lcd_touch_handle_t tp); + +static esp_err_t i2c_read_bytes(esp_lcd_touch_handle_t tp, uint16_t reg, uint8_t *data, uint8_t len); +static esp_err_t read_fw_info(esp_lcd_touch_handle_t tp); + +esp_err_t esp_lcd_touch_new_i2c_st1633(const esp_lcd_panel_io_handle_t io, const esp_lcd_touch_config_t *config, esp_lcd_touch_handle_t *tp) +{ + ESP_RETURN_ON_FALSE(io, ESP_ERR_INVALID_ARG, TAG, "Invalid io"); + ESP_RETURN_ON_FALSE(config, ESP_ERR_INVALID_ARG, TAG, "Invalid config"); + ESP_RETURN_ON_FALSE(tp, ESP_ERR_INVALID_ARG, TAG, "Invalid touch handle"); + + ESP_PANEL_ENABLE_TAG_DEBUG_LOG(); + + /* Prepare main structure */ + esp_err_t ret = ESP_OK; + esp_lcd_touch_handle_t st1633 = (esp_lcd_touch_handle_t)calloc(1, sizeof(esp_lcd_touch_t)); + ESP_GOTO_ON_FALSE(st1633, ESP_ERR_NO_MEM, err, TAG, "Touch handle malloc failed"); + + /* Communication interface */ + st1633->io = io; + /* Only supported callbacks are set */ + st1633->read_data = read_data; + st1633->get_xy = get_xy; + st1633->del = del; + /* Mutex */ + st1633->data.lock.owner = portMUX_FREE_VAL; + /* Save config */ + memcpy(&st1633->config, config, sizeof(esp_lcd_touch_config_t)); + + /* Prepare pin for touch interrupt */ + if (config->int_gpio_num != GPIO_NUM_NC) { + const gpio_config_t int_gpio_config = { + .mode = GPIO_MODE_INPUT, + .intr_type = (config->levels.interrupt) ? GPIO_INTR_POSEDGE : GPIO_INTR_NEGEDGE, + .pin_bit_mask = BIT64(config->int_gpio_num) + }; + ESP_GOTO_ON_ERROR(gpio_config(&int_gpio_config), err, TAG, "GPIO intr config failed"); + + /* Register interrupt callback */ + if (config->interrupt_callback) { + esp_lcd_touch_register_interrupt_callback(st1633, config->interrupt_callback); + } + } + /* Prepare pin for touch controller reset */ + if (config->rst_gpio_num != GPIO_NUM_NC) { + const gpio_config_t rst_gpio_config = { + .mode = GPIO_MODE_OUTPUT, + .pin_bit_mask = BIT64(config->rst_gpio_num) + }; + ESP_GOTO_ON_ERROR(gpio_config(&rst_gpio_config), err, TAG, "GPIO reset config failed"); + } + /* Reset controller */ + ESP_GOTO_ON_ERROR(reset(st1633), err, TAG, "Reset failed"); + ESP_GOTO_ON_ERROR(read_fw_info(st1633), err, TAG, "Read version failed"); + + ESP_LOGI(TAG, "Touch panel create success, version: %d.%d.%d", ESP_LCD_TOUCH_ST1633_VER_MAJOR, + ESP_LCD_TOUCH_ST1633_VER_MINOR, ESP_LCD_TOUCH_ST1633_VER_PATCH); + + *tp = st1633; + + return ESP_OK; +err: + if (st1633) { + del(st1633); + } + ESP_LOGE(TAG, "Initialization failed!"); + return ret; +} + +static esp_err_t read_data(esp_lcd_touch_handle_t tp) +{ + typedef struct { + uint8_t y_h: 3; + uint8_t reserved_3: 1; + uint8_t x_h: 3; + uint8_t valid: 1; + uint8_t x_l; + uint8_t y_l; + uint8_t reserved_24_31; + } xy_coord_t; + typedef struct { + uint8_t gesture_type: 4; + uint8_t reserved_4: 1; + uint8_t water_flag: 1; + uint8_t prox_flag: 1; + uint8_t reserved_7: 1; + uint8_t keys; + xy_coord_t xy_coord[MAX_READ_TOUCH_NUM]; + } tp_report_t; + static_assert((sizeof(xy_coord_t) == 4) && (sizeof(tp_report_t) == 42), "Invalid size of tp xy_coord_t or_report_t"); + + tp_report_t tp_report = { 0 }; + ESP_RETURN_ON_ERROR(i2c_read_bytes(tp, ADVANCED_INFO_REG, (uint8_t *)&tp_report, sizeof(tp_report)), TAG, "Read advanced info failed"); + + uint16_t x = 0; + uint16_t y = 0; + portENTER_CRITICAL(&tp->data.lock); + int j = 0; + /* Fill all coordinates */ + for (int i = 0; i < MAX_READ_TOUCH_NUM; i++) { + x = (((uint16_t)tp_report.xy_coord[i].x_h) << 8) | tp_report.xy_coord[i].x_l; + y = (((uint16_t)tp_report.xy_coord[i].y_h) << 8) | tp_report.xy_coord[i].y_l; + if (((x == 0) && (y == 0)) || (x > tp->config.x_max) || (y > tp->config.y_max)) { + continue; + } + tp->data.coords[j].x = x; + tp->data.coords[j].y = y; + j++; + } + /* Expect Number of touched points */ + tp->data.points = j; + portEXIT_CRITICAL(&tp->data.lock); + + return ESP_OK; +} + +static bool get_xy(esp_lcd_touch_handle_t tp, uint16_t *x, uint16_t *y, uint16_t *strength, uint8_t *point_num, uint8_t max_point_num) +{ + portENTER_CRITICAL(&tp->data.lock); + /* Count of points */ + *point_num = (tp->data.points > max_point_num ? max_point_num : tp->data.points); + for (size_t i = 0; i < *point_num; i++) { + x[i] = tp->data.coords[i].x; + y[i] = tp->data.coords[i].y; + + if (strength) { + strength[i] = tp->data.coords[i].strength; + } + } + /* Clear available touch points count */ + tp->data.points = 0; + portEXIT_CRITICAL(&tp->data.lock); + + return (*point_num > 0); +} + +static esp_err_t del(esp_lcd_touch_handle_t tp) +{ + /* Reset GPIO pin settings */ + if (tp->config.int_gpio_num != GPIO_NUM_NC) { + gpio_reset_pin(tp->config.int_gpio_num); + } + if (tp->config.rst_gpio_num != GPIO_NUM_NC) { + gpio_reset_pin(tp->config.rst_gpio_num); + if (tp->config.interrupt_callback) { + gpio_isr_handler_remove(tp->config.int_gpio_num); + } + } + /* Release memory */ + free(tp); + + return ESP_OK; +} + +static esp_err_t reset(esp_lcd_touch_handle_t tp) +{ + if (tp->config.rst_gpio_num != GPIO_NUM_NC) { + vTaskDelay(pdMS_TO_TICKS(10)); + ESP_RETURN_ON_ERROR(gpio_set_level(tp->config.rst_gpio_num, tp->config.levels.reset), TAG, "GPIO set level failed"); + vTaskDelay(pdMS_TO_TICKS(10)); + ESP_RETURN_ON_ERROR(gpio_set_level(tp->config.rst_gpio_num, !tp->config.levels.reset), TAG, "GPIO set level failed"); + vTaskDelay(pdMS_TO_TICKS(10)); + } + + return ESP_OK; +} + +static esp_err_t i2c_read_bytes(esp_lcd_touch_handle_t tp, uint16_t reg, uint8_t *data, uint8_t len) +{ + ESP_RETURN_ON_FALSE((len == 0) || (data != NULL), ESP_ERR_INVALID_ARG, TAG, "Invalid data"); + + ESP_RETURN_ON_ERROR(esp_lcd_panel_io_rx_param(tp->io, reg, data, len), TAG, "Read param failed"); + + return ESP_OK; +} + +static esp_err_t read_fw_info(esp_lcd_touch_handle_t tp) +{ + uint8_t version = 0; + uint8_t revision[4] = { 0 }; + struct { + uint8_t y_res_h: 3; + uint8_t reserved_3: 1; + uint8_t x_res_h: 3; + uint8_t reserved_7: 1; + uint8_t x_res_l; + uint8_t y_res_l; + } xy_res; + static_assert(sizeof(xy_res) == 3, "Invalid size of info"); + + ESP_RETURN_ON_ERROR(i2c_read_bytes(tp, FW_VERSION_REG, &version, 1), TAG, "Read version failed"); + ESP_RETURN_ON_ERROR(i2c_read_bytes(tp, FW_REVISION_REG, (uint8_t *)&revision[0], sizeof(revision)), TAG, "Read revision failed"); + ESP_RETURN_ON_ERROR(i2c_read_bytes(tp, XY_RES_H_REG, (uint8_t *)&xy_res, sizeof(xy_res)), TAG, "Read XY Resolution failed"); + + ESP_LOGI(TAG, "Firmware version: %d(%d.%d.%d.%d), Max.X: %d, Max.Y: %d", version, revision[3], revision[2], + revision[1], revision[0], (((uint16_t)xy_res.x_res_h) << 8) | xy_res.x_res_l, + (((uint16_t)xy_res.y_res_h) << 8) | xy_res.y_res_l); + + return ESP_OK; +} diff --git a/src/touch/base/esp_lcd_touch_st1633.h b/src/touch/base/esp_lcd_touch_st1633.h new file mode 100644 index 00000000..c3a06840 --- /dev/null +++ b/src/touch/base/esp_lcd_touch_st1633.h @@ -0,0 +1,54 @@ +/* + * SPDX-FileCopyrightText: 2023-2024 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ +#pragma once + +#include "esp_lcd_touch.h" + +#ifdef __cplusplus +extern "C" { +#endif + +#define ESP_LCD_TOUCH_ST1633_VER_MAJOR (0) +#define ESP_LCD_TOUCH_ST1633_VER_MINOR (1) +#define ESP_LCD_TOUCH_ST1633_VER_PATCH (0) + +/** + * @brief Create a new ST1633 touch driver + * + * @note The I2C communication should be initialized before use this function. + * + * @param io LCD panel IO handle, it should be created by `esp_lcd_new_panel_io_i2c()` + * @param config Touch panel configuration + * @param tp Touch panel handle + * @return + * - ESP_OK: on success + */ +esp_err_t esp_lcd_touch_new_i2c_st1633(const esp_lcd_panel_io_handle_t io, const esp_lcd_touch_config_t *config, esp_lcd_touch_handle_t *tp); + +/** + * @brief I2C address of the ST1633 controller + * + */ +#define ESP_LCD_TOUCH_IO_I2C_ST1633_ADDRESS (0x55) + +/** + * @brief Touch IO configuration structure + * + */ +#define ESP_LCD_TOUCH_IO_I2C_ST1633_CONFIG() \ + { \ + .dev_addr = ESP_LCD_TOUCH_IO_I2C_ST1633_ADDRESS, \ + .control_phase_bytes = 1, \ + .lcd_cmd_bits = 8, \ + .flags = \ + { \ + .disable_control_phase = 1, \ + } \ + } + +#ifdef __cplusplus +} +#endif From 8552bdc34ef1636cac2b38f9c3a19c9fe6612ce1 Mon Sep 17 00:00:00 2001 From: Liu Zhongwei Date: Sat, 1 Jun 2024 17:17:27 +0800 Subject: [PATCH 2/2] feat(pre-commit): support to check file versions --- ...heck_versions.sh => check_lib_versions.sh} | 0 ...ck_versions.yml => check_lib_versions.yml} | 4 +- .pre-commit-config.yaml | 10 +- CHANGELOG.md | 4 +- ESP_Panel_Board_Custom.h | 2 +- ESP_Panel_Conf.h | 26 +-- examples/LCD/3wireSPI_RGB/ESP_Panel_Conf.h | 26 +-- examples/LCD/QSPI/ESP_Panel_Conf.h | 26 +-- examples/LCD/RGB/ESP_Panel_Conf.h | 26 +-- examples/LCD/SPI/ESP_Panel_Conf.h | 26 +-- .../LVGL/v8/Porting/ESP_Panel_Board_Custom.h | 2 +- examples/LVGL/v8/Porting/ESP_Panel_Conf.h | 26 +-- .../LVGL/v8/Rotation/ESP_Panel_Board_Custom.h | 2 +- examples/LVGL/v8/Rotation/ESP_Panel_Conf.h | 26 +-- .../Panel/PanelTest/ESP_Panel_Board_Custom.h | 2 +- examples/Panel/PanelTest/ESP_Panel_Conf.h | 26 +-- .../v8/Porting/ESP_Panel_Board_Custom.h | 2 +- .../SquareLine/v8/Porting/ESP_Panel_Conf.h | 26 +-- .../v8/WiFiClock/ESP_Panel_Board_Custom.h | 2 +- .../SquareLine/v8/WiFiClock/ESP_Panel_Conf.h | 26 +-- examples/Touch/I2C/ESP_Panel_Conf.h | 26 +-- examples/Touch/SPI/ESP_Panel_Conf.h | 26 +-- src/ESP_PanelVersions.h | 16 +- src/touch/README.md | 1 + tools/check_file_version.py | 157 ++++++++++++++++++ {.github/ci => tools}/sync_conf_files.py | 1 - 26 files changed, 357 insertions(+), 160 deletions(-) rename .github/scripts/{check_versions.sh => check_lib_versions.sh} (100%) rename .github/workflows/{check_versions.yml => check_lib_versions.yml} (88%) create mode 100644 tools/check_file_version.py rename {.github/ci => tools}/sync_conf_files.py (99%) diff --git a/.github/scripts/check_versions.sh b/.github/scripts/check_lib_versions.sh similarity index 100% rename from .github/scripts/check_versions.sh rename to .github/scripts/check_lib_versions.sh diff --git a/.github/workflows/check_versions.yml b/.github/workflows/check_lib_versions.yml similarity index 88% rename from .github/workflows/check_versions.yml rename to .github/workflows/check_lib_versions.yml index eb2d1168..a70f5403 100644 --- a/.github/workflows/check_versions.yml +++ b/.github/workflows/check_lib_versions.yml @@ -1,4 +1,4 @@ -name: Check Versions +name: Check Library Versions on: pull_request: @@ -26,5 +26,5 @@ jobs: echo "prerelease: ${{ steps.last_release.outputs.prerelease }}" echo "url: ${{ steps.last_release.outputs.url }}" - name: Check & Compare versions - run: bash ./.github/scripts/check_versions.sh ${{ steps.last_release.outputs.tag_name }} + run: bash ./.github/scripts/check_lib_versions.sh ${{ steps.last_release.outputs.tag_name }} diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 61a876c2..c0bfffa1 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -39,6 +39,14 @@ repos: hooks: - id: sync-conf-files name: Update when configuration files change - entry: python .github/ci/sync_conf_files.py ./ + entry: python tools/sync_conf_files.py ./ language: system files: '.*ESP_Panel_(Board_Custom|Board_Supported|Conf)\.h' + + - repo: local + hooks: + - id: check-file-versions + name: Update when versions change + entry: python tools/check_file_version.py ./ + language: system + files: '(.*ESP_Panel_(Board_Custom|Board_Supported|Conf)\.h|library.properties|.*ESP_PanelVersions.h)' diff --git a/CHANGELOG.md b/CHANGELOG.md index 97e3bfe6..354bf6b5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,10 +1,12 @@ # ChangeLog -## v0.1.2 - 2024-05-27 +## v0.1.2 - 2024-06-01 ### Enhancements: * feat(config): add version control for all configuration files by @lzw655 (#32) +* feat(touch): add i2c st1633 by @lzw655 (#22) +* feat(pre-commit): support to check file versions ### Bugfixes: diff --git a/ESP_Panel_Board_Custom.h b/ESP_Panel_Board_Custom.h index 9916371a..dfa8f855 100644 --- a/ESP_Panel_Board_Custom.h +++ b/ESP_Panel_Board_Custom.h @@ -362,7 +362,7 @@ */ #define ESP_PANEL_BOARD_CUSTOM_FILE_VERSION_MAJOR 0 #define ESP_PANEL_BOARD_CUSTOM_FILE_VERSION_MINOR 1 -#define ESP_PANEL_BOARD_CUSTOM_FILE_VERSION_PATCH 0 +#define ESP_PANEL_BOARD_CUSTOM_FILE_VERSION_PATCH 1 #endif /* ESP_PANEL_USE_CUSTOM_BOARD */ diff --git a/ESP_Panel_Conf.h b/ESP_Panel_Conf.h index 07e7d69c..e90f8ccd 100644 --- a/ESP_Panel_Conf.h +++ b/ESP_Panel_Conf.h @@ -6,28 +6,27 @@ #pragma once -/** - * Debug configurations - * - */ +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +///////////////////////////////////////////////// Debug Configurations ///////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// /* Set to 1 if assert on error. Otherwise print error message */ #define ESP_PANEL_CHECK_RESULT_ASSERT (0) // 0/1 /* Set to 1 if print log message for debug */ #define ESP_PANEL_ENABLE_LOG (0) // 0/1 -/** - * Touch driver configurations - * - */ +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +///////////////////////////////////////////// Touch Driver Configurations ////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// /* Maximum point number */ #define ESP_PANEL_TOUCH_MAX_POINTS (5) - /* Maximum button number */ #define ESP_PANEL_TOUCH_MAX_BUTTONS (1) -/* Model configurations */ -// XPT2046 +/** + * XPT2046 related + * + */ #define ESP_PANEL_TOUCH_XPT2046_Z_THRESHOLD (400) // Minimum Z pressure threshold /** * Enable Interrupt (PENIRQ) output, also called Full Power Mode. @@ -59,6 +58,9 @@ */ #define ESP_PANEL_TOUCH_XPT2046_ENABLE_LOCKING (0) // 0/1 +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +/////////////////////////////////////////////// File Version /////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// /** * Do not change the following versions, they are used to check if the configurations in this file are compatible with * the current version of `ESP_Panel_Board_Custom.h` in the library. The detailed rules are as follows: @@ -72,4 +74,4 @@ */ #define ESP_PANEL_CONF_FILE_VERSION_MAJOR 0 #define ESP_PANEL_CONF_FILE_VERSION_MINOR 1 -#define ESP_PANEL_CONF_FILE_VERSION_PATCH 0 +#define ESP_PANEL_CONF_FILE_VERSION_PATCH 1 diff --git a/examples/LCD/3wireSPI_RGB/ESP_Panel_Conf.h b/examples/LCD/3wireSPI_RGB/ESP_Panel_Conf.h index 07e7d69c..e90f8ccd 100644 --- a/examples/LCD/3wireSPI_RGB/ESP_Panel_Conf.h +++ b/examples/LCD/3wireSPI_RGB/ESP_Panel_Conf.h @@ -6,28 +6,27 @@ #pragma once -/** - * Debug configurations - * - */ +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +///////////////////////////////////////////////// Debug Configurations ///////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// /* Set to 1 if assert on error. Otherwise print error message */ #define ESP_PANEL_CHECK_RESULT_ASSERT (0) // 0/1 /* Set to 1 if print log message for debug */ #define ESP_PANEL_ENABLE_LOG (0) // 0/1 -/** - * Touch driver configurations - * - */ +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +///////////////////////////////////////////// Touch Driver Configurations ////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// /* Maximum point number */ #define ESP_PANEL_TOUCH_MAX_POINTS (5) - /* Maximum button number */ #define ESP_PANEL_TOUCH_MAX_BUTTONS (1) -/* Model configurations */ -// XPT2046 +/** + * XPT2046 related + * + */ #define ESP_PANEL_TOUCH_XPT2046_Z_THRESHOLD (400) // Minimum Z pressure threshold /** * Enable Interrupt (PENIRQ) output, also called Full Power Mode. @@ -59,6 +58,9 @@ */ #define ESP_PANEL_TOUCH_XPT2046_ENABLE_LOCKING (0) // 0/1 +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +/////////////////////////////////////////////// File Version /////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// /** * Do not change the following versions, they are used to check if the configurations in this file are compatible with * the current version of `ESP_Panel_Board_Custom.h` in the library. The detailed rules are as follows: @@ -72,4 +74,4 @@ */ #define ESP_PANEL_CONF_FILE_VERSION_MAJOR 0 #define ESP_PANEL_CONF_FILE_VERSION_MINOR 1 -#define ESP_PANEL_CONF_FILE_VERSION_PATCH 0 +#define ESP_PANEL_CONF_FILE_VERSION_PATCH 1 diff --git a/examples/LCD/QSPI/ESP_Panel_Conf.h b/examples/LCD/QSPI/ESP_Panel_Conf.h index 07e7d69c..e90f8ccd 100644 --- a/examples/LCD/QSPI/ESP_Panel_Conf.h +++ b/examples/LCD/QSPI/ESP_Panel_Conf.h @@ -6,28 +6,27 @@ #pragma once -/** - * Debug configurations - * - */ +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +///////////////////////////////////////////////// Debug Configurations ///////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// /* Set to 1 if assert on error. Otherwise print error message */ #define ESP_PANEL_CHECK_RESULT_ASSERT (0) // 0/1 /* Set to 1 if print log message for debug */ #define ESP_PANEL_ENABLE_LOG (0) // 0/1 -/** - * Touch driver configurations - * - */ +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +///////////////////////////////////////////// Touch Driver Configurations ////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// /* Maximum point number */ #define ESP_PANEL_TOUCH_MAX_POINTS (5) - /* Maximum button number */ #define ESP_PANEL_TOUCH_MAX_BUTTONS (1) -/* Model configurations */ -// XPT2046 +/** + * XPT2046 related + * + */ #define ESP_PANEL_TOUCH_XPT2046_Z_THRESHOLD (400) // Minimum Z pressure threshold /** * Enable Interrupt (PENIRQ) output, also called Full Power Mode. @@ -59,6 +58,9 @@ */ #define ESP_PANEL_TOUCH_XPT2046_ENABLE_LOCKING (0) // 0/1 +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +/////////////////////////////////////////////// File Version /////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// /** * Do not change the following versions, they are used to check if the configurations in this file are compatible with * the current version of `ESP_Panel_Board_Custom.h` in the library. The detailed rules are as follows: @@ -72,4 +74,4 @@ */ #define ESP_PANEL_CONF_FILE_VERSION_MAJOR 0 #define ESP_PANEL_CONF_FILE_VERSION_MINOR 1 -#define ESP_PANEL_CONF_FILE_VERSION_PATCH 0 +#define ESP_PANEL_CONF_FILE_VERSION_PATCH 1 diff --git a/examples/LCD/RGB/ESP_Panel_Conf.h b/examples/LCD/RGB/ESP_Panel_Conf.h index 07e7d69c..e90f8ccd 100644 --- a/examples/LCD/RGB/ESP_Panel_Conf.h +++ b/examples/LCD/RGB/ESP_Panel_Conf.h @@ -6,28 +6,27 @@ #pragma once -/** - * Debug configurations - * - */ +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +///////////////////////////////////////////////// Debug Configurations ///////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// /* Set to 1 if assert on error. Otherwise print error message */ #define ESP_PANEL_CHECK_RESULT_ASSERT (0) // 0/1 /* Set to 1 if print log message for debug */ #define ESP_PANEL_ENABLE_LOG (0) // 0/1 -/** - * Touch driver configurations - * - */ +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +///////////////////////////////////////////// Touch Driver Configurations ////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// /* Maximum point number */ #define ESP_PANEL_TOUCH_MAX_POINTS (5) - /* Maximum button number */ #define ESP_PANEL_TOUCH_MAX_BUTTONS (1) -/* Model configurations */ -// XPT2046 +/** + * XPT2046 related + * + */ #define ESP_PANEL_TOUCH_XPT2046_Z_THRESHOLD (400) // Minimum Z pressure threshold /** * Enable Interrupt (PENIRQ) output, also called Full Power Mode. @@ -59,6 +58,9 @@ */ #define ESP_PANEL_TOUCH_XPT2046_ENABLE_LOCKING (0) // 0/1 +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +/////////////////////////////////////////////// File Version /////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// /** * Do not change the following versions, they are used to check if the configurations in this file are compatible with * the current version of `ESP_Panel_Board_Custom.h` in the library. The detailed rules are as follows: @@ -72,4 +74,4 @@ */ #define ESP_PANEL_CONF_FILE_VERSION_MAJOR 0 #define ESP_PANEL_CONF_FILE_VERSION_MINOR 1 -#define ESP_PANEL_CONF_FILE_VERSION_PATCH 0 +#define ESP_PANEL_CONF_FILE_VERSION_PATCH 1 diff --git a/examples/LCD/SPI/ESP_Panel_Conf.h b/examples/LCD/SPI/ESP_Panel_Conf.h index 07e7d69c..e90f8ccd 100644 --- a/examples/LCD/SPI/ESP_Panel_Conf.h +++ b/examples/LCD/SPI/ESP_Panel_Conf.h @@ -6,28 +6,27 @@ #pragma once -/** - * Debug configurations - * - */ +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +///////////////////////////////////////////////// Debug Configurations ///////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// /* Set to 1 if assert on error. Otherwise print error message */ #define ESP_PANEL_CHECK_RESULT_ASSERT (0) // 0/1 /* Set to 1 if print log message for debug */ #define ESP_PANEL_ENABLE_LOG (0) // 0/1 -/** - * Touch driver configurations - * - */ +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +///////////////////////////////////////////// Touch Driver Configurations ////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// /* Maximum point number */ #define ESP_PANEL_TOUCH_MAX_POINTS (5) - /* Maximum button number */ #define ESP_PANEL_TOUCH_MAX_BUTTONS (1) -/* Model configurations */ -// XPT2046 +/** + * XPT2046 related + * + */ #define ESP_PANEL_TOUCH_XPT2046_Z_THRESHOLD (400) // Minimum Z pressure threshold /** * Enable Interrupt (PENIRQ) output, also called Full Power Mode. @@ -59,6 +58,9 @@ */ #define ESP_PANEL_TOUCH_XPT2046_ENABLE_LOCKING (0) // 0/1 +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +/////////////////////////////////////////////// File Version /////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// /** * Do not change the following versions, they are used to check if the configurations in this file are compatible with * the current version of `ESP_Panel_Board_Custom.h` in the library. The detailed rules are as follows: @@ -72,4 +74,4 @@ */ #define ESP_PANEL_CONF_FILE_VERSION_MAJOR 0 #define ESP_PANEL_CONF_FILE_VERSION_MINOR 1 -#define ESP_PANEL_CONF_FILE_VERSION_PATCH 0 +#define ESP_PANEL_CONF_FILE_VERSION_PATCH 1 diff --git a/examples/LVGL/v8/Porting/ESP_Panel_Board_Custom.h b/examples/LVGL/v8/Porting/ESP_Panel_Board_Custom.h index 9916371a..dfa8f855 100644 --- a/examples/LVGL/v8/Porting/ESP_Panel_Board_Custom.h +++ b/examples/LVGL/v8/Porting/ESP_Panel_Board_Custom.h @@ -362,7 +362,7 @@ */ #define ESP_PANEL_BOARD_CUSTOM_FILE_VERSION_MAJOR 0 #define ESP_PANEL_BOARD_CUSTOM_FILE_VERSION_MINOR 1 -#define ESP_PANEL_BOARD_CUSTOM_FILE_VERSION_PATCH 0 +#define ESP_PANEL_BOARD_CUSTOM_FILE_VERSION_PATCH 1 #endif /* ESP_PANEL_USE_CUSTOM_BOARD */ diff --git a/examples/LVGL/v8/Porting/ESP_Panel_Conf.h b/examples/LVGL/v8/Porting/ESP_Panel_Conf.h index 07e7d69c..e90f8ccd 100644 --- a/examples/LVGL/v8/Porting/ESP_Panel_Conf.h +++ b/examples/LVGL/v8/Porting/ESP_Panel_Conf.h @@ -6,28 +6,27 @@ #pragma once -/** - * Debug configurations - * - */ +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +///////////////////////////////////////////////// Debug Configurations ///////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// /* Set to 1 if assert on error. Otherwise print error message */ #define ESP_PANEL_CHECK_RESULT_ASSERT (0) // 0/1 /* Set to 1 if print log message for debug */ #define ESP_PANEL_ENABLE_LOG (0) // 0/1 -/** - * Touch driver configurations - * - */ +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +///////////////////////////////////////////// Touch Driver Configurations ////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// /* Maximum point number */ #define ESP_PANEL_TOUCH_MAX_POINTS (5) - /* Maximum button number */ #define ESP_PANEL_TOUCH_MAX_BUTTONS (1) -/* Model configurations */ -// XPT2046 +/** + * XPT2046 related + * + */ #define ESP_PANEL_TOUCH_XPT2046_Z_THRESHOLD (400) // Minimum Z pressure threshold /** * Enable Interrupt (PENIRQ) output, also called Full Power Mode. @@ -59,6 +58,9 @@ */ #define ESP_PANEL_TOUCH_XPT2046_ENABLE_LOCKING (0) // 0/1 +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +/////////////////////////////////////////////// File Version /////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// /** * Do not change the following versions, they are used to check if the configurations in this file are compatible with * the current version of `ESP_Panel_Board_Custom.h` in the library. The detailed rules are as follows: @@ -72,4 +74,4 @@ */ #define ESP_PANEL_CONF_FILE_VERSION_MAJOR 0 #define ESP_PANEL_CONF_FILE_VERSION_MINOR 1 -#define ESP_PANEL_CONF_FILE_VERSION_PATCH 0 +#define ESP_PANEL_CONF_FILE_VERSION_PATCH 1 diff --git a/examples/LVGL/v8/Rotation/ESP_Panel_Board_Custom.h b/examples/LVGL/v8/Rotation/ESP_Panel_Board_Custom.h index 9916371a..dfa8f855 100644 --- a/examples/LVGL/v8/Rotation/ESP_Panel_Board_Custom.h +++ b/examples/LVGL/v8/Rotation/ESP_Panel_Board_Custom.h @@ -362,7 +362,7 @@ */ #define ESP_PANEL_BOARD_CUSTOM_FILE_VERSION_MAJOR 0 #define ESP_PANEL_BOARD_CUSTOM_FILE_VERSION_MINOR 1 -#define ESP_PANEL_BOARD_CUSTOM_FILE_VERSION_PATCH 0 +#define ESP_PANEL_BOARD_CUSTOM_FILE_VERSION_PATCH 1 #endif /* ESP_PANEL_USE_CUSTOM_BOARD */ diff --git a/examples/LVGL/v8/Rotation/ESP_Panel_Conf.h b/examples/LVGL/v8/Rotation/ESP_Panel_Conf.h index 07e7d69c..e90f8ccd 100644 --- a/examples/LVGL/v8/Rotation/ESP_Panel_Conf.h +++ b/examples/LVGL/v8/Rotation/ESP_Panel_Conf.h @@ -6,28 +6,27 @@ #pragma once -/** - * Debug configurations - * - */ +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +///////////////////////////////////////////////// Debug Configurations ///////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// /* Set to 1 if assert on error. Otherwise print error message */ #define ESP_PANEL_CHECK_RESULT_ASSERT (0) // 0/1 /* Set to 1 if print log message for debug */ #define ESP_PANEL_ENABLE_LOG (0) // 0/1 -/** - * Touch driver configurations - * - */ +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +///////////////////////////////////////////// Touch Driver Configurations ////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// /* Maximum point number */ #define ESP_PANEL_TOUCH_MAX_POINTS (5) - /* Maximum button number */ #define ESP_PANEL_TOUCH_MAX_BUTTONS (1) -/* Model configurations */ -// XPT2046 +/** + * XPT2046 related + * + */ #define ESP_PANEL_TOUCH_XPT2046_Z_THRESHOLD (400) // Minimum Z pressure threshold /** * Enable Interrupt (PENIRQ) output, also called Full Power Mode. @@ -59,6 +58,9 @@ */ #define ESP_PANEL_TOUCH_XPT2046_ENABLE_LOCKING (0) // 0/1 +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +/////////////////////////////////////////////// File Version /////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// /** * Do not change the following versions, they are used to check if the configurations in this file are compatible with * the current version of `ESP_Panel_Board_Custom.h` in the library. The detailed rules are as follows: @@ -72,4 +74,4 @@ */ #define ESP_PANEL_CONF_FILE_VERSION_MAJOR 0 #define ESP_PANEL_CONF_FILE_VERSION_MINOR 1 -#define ESP_PANEL_CONF_FILE_VERSION_PATCH 0 +#define ESP_PANEL_CONF_FILE_VERSION_PATCH 1 diff --git a/examples/Panel/PanelTest/ESP_Panel_Board_Custom.h b/examples/Panel/PanelTest/ESP_Panel_Board_Custom.h index 9916371a..dfa8f855 100644 --- a/examples/Panel/PanelTest/ESP_Panel_Board_Custom.h +++ b/examples/Panel/PanelTest/ESP_Panel_Board_Custom.h @@ -362,7 +362,7 @@ */ #define ESP_PANEL_BOARD_CUSTOM_FILE_VERSION_MAJOR 0 #define ESP_PANEL_BOARD_CUSTOM_FILE_VERSION_MINOR 1 -#define ESP_PANEL_BOARD_CUSTOM_FILE_VERSION_PATCH 0 +#define ESP_PANEL_BOARD_CUSTOM_FILE_VERSION_PATCH 1 #endif /* ESP_PANEL_USE_CUSTOM_BOARD */ diff --git a/examples/Panel/PanelTest/ESP_Panel_Conf.h b/examples/Panel/PanelTest/ESP_Panel_Conf.h index 07e7d69c..e90f8ccd 100644 --- a/examples/Panel/PanelTest/ESP_Panel_Conf.h +++ b/examples/Panel/PanelTest/ESP_Panel_Conf.h @@ -6,28 +6,27 @@ #pragma once -/** - * Debug configurations - * - */ +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +///////////////////////////////////////////////// Debug Configurations ///////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// /* Set to 1 if assert on error. Otherwise print error message */ #define ESP_PANEL_CHECK_RESULT_ASSERT (0) // 0/1 /* Set to 1 if print log message for debug */ #define ESP_PANEL_ENABLE_LOG (0) // 0/1 -/** - * Touch driver configurations - * - */ +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +///////////////////////////////////////////// Touch Driver Configurations ////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// /* Maximum point number */ #define ESP_PANEL_TOUCH_MAX_POINTS (5) - /* Maximum button number */ #define ESP_PANEL_TOUCH_MAX_BUTTONS (1) -/* Model configurations */ -// XPT2046 +/** + * XPT2046 related + * + */ #define ESP_PANEL_TOUCH_XPT2046_Z_THRESHOLD (400) // Minimum Z pressure threshold /** * Enable Interrupt (PENIRQ) output, also called Full Power Mode. @@ -59,6 +58,9 @@ */ #define ESP_PANEL_TOUCH_XPT2046_ENABLE_LOCKING (0) // 0/1 +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +/////////////////////////////////////////////// File Version /////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// /** * Do not change the following versions, they are used to check if the configurations in this file are compatible with * the current version of `ESP_Panel_Board_Custom.h` in the library. The detailed rules are as follows: @@ -72,4 +74,4 @@ */ #define ESP_PANEL_CONF_FILE_VERSION_MAJOR 0 #define ESP_PANEL_CONF_FILE_VERSION_MINOR 1 -#define ESP_PANEL_CONF_FILE_VERSION_PATCH 0 +#define ESP_PANEL_CONF_FILE_VERSION_PATCH 1 diff --git a/examples/SquareLine/v8/Porting/ESP_Panel_Board_Custom.h b/examples/SquareLine/v8/Porting/ESP_Panel_Board_Custom.h index 9916371a..dfa8f855 100644 --- a/examples/SquareLine/v8/Porting/ESP_Panel_Board_Custom.h +++ b/examples/SquareLine/v8/Porting/ESP_Panel_Board_Custom.h @@ -362,7 +362,7 @@ */ #define ESP_PANEL_BOARD_CUSTOM_FILE_VERSION_MAJOR 0 #define ESP_PANEL_BOARD_CUSTOM_FILE_VERSION_MINOR 1 -#define ESP_PANEL_BOARD_CUSTOM_FILE_VERSION_PATCH 0 +#define ESP_PANEL_BOARD_CUSTOM_FILE_VERSION_PATCH 1 #endif /* ESP_PANEL_USE_CUSTOM_BOARD */ diff --git a/examples/SquareLine/v8/Porting/ESP_Panel_Conf.h b/examples/SquareLine/v8/Porting/ESP_Panel_Conf.h index 07e7d69c..e90f8ccd 100644 --- a/examples/SquareLine/v8/Porting/ESP_Panel_Conf.h +++ b/examples/SquareLine/v8/Porting/ESP_Panel_Conf.h @@ -6,28 +6,27 @@ #pragma once -/** - * Debug configurations - * - */ +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +///////////////////////////////////////////////// Debug Configurations ///////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// /* Set to 1 if assert on error. Otherwise print error message */ #define ESP_PANEL_CHECK_RESULT_ASSERT (0) // 0/1 /* Set to 1 if print log message for debug */ #define ESP_PANEL_ENABLE_LOG (0) // 0/1 -/** - * Touch driver configurations - * - */ +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +///////////////////////////////////////////// Touch Driver Configurations ////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// /* Maximum point number */ #define ESP_PANEL_TOUCH_MAX_POINTS (5) - /* Maximum button number */ #define ESP_PANEL_TOUCH_MAX_BUTTONS (1) -/* Model configurations */ -// XPT2046 +/** + * XPT2046 related + * + */ #define ESP_PANEL_TOUCH_XPT2046_Z_THRESHOLD (400) // Minimum Z pressure threshold /** * Enable Interrupt (PENIRQ) output, also called Full Power Mode. @@ -59,6 +58,9 @@ */ #define ESP_PANEL_TOUCH_XPT2046_ENABLE_LOCKING (0) // 0/1 +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +/////////////////////////////////////////////// File Version /////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// /** * Do not change the following versions, they are used to check if the configurations in this file are compatible with * the current version of `ESP_Panel_Board_Custom.h` in the library. The detailed rules are as follows: @@ -72,4 +74,4 @@ */ #define ESP_PANEL_CONF_FILE_VERSION_MAJOR 0 #define ESP_PANEL_CONF_FILE_VERSION_MINOR 1 -#define ESP_PANEL_CONF_FILE_VERSION_PATCH 0 +#define ESP_PANEL_CONF_FILE_VERSION_PATCH 1 diff --git a/examples/SquareLine/v8/WiFiClock/ESP_Panel_Board_Custom.h b/examples/SquareLine/v8/WiFiClock/ESP_Panel_Board_Custom.h index 9916371a..dfa8f855 100644 --- a/examples/SquareLine/v8/WiFiClock/ESP_Panel_Board_Custom.h +++ b/examples/SquareLine/v8/WiFiClock/ESP_Panel_Board_Custom.h @@ -362,7 +362,7 @@ */ #define ESP_PANEL_BOARD_CUSTOM_FILE_VERSION_MAJOR 0 #define ESP_PANEL_BOARD_CUSTOM_FILE_VERSION_MINOR 1 -#define ESP_PANEL_BOARD_CUSTOM_FILE_VERSION_PATCH 0 +#define ESP_PANEL_BOARD_CUSTOM_FILE_VERSION_PATCH 1 #endif /* ESP_PANEL_USE_CUSTOM_BOARD */ diff --git a/examples/SquareLine/v8/WiFiClock/ESP_Panel_Conf.h b/examples/SquareLine/v8/WiFiClock/ESP_Panel_Conf.h index 07e7d69c..e90f8ccd 100644 --- a/examples/SquareLine/v8/WiFiClock/ESP_Panel_Conf.h +++ b/examples/SquareLine/v8/WiFiClock/ESP_Panel_Conf.h @@ -6,28 +6,27 @@ #pragma once -/** - * Debug configurations - * - */ +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +///////////////////////////////////////////////// Debug Configurations ///////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// /* Set to 1 if assert on error. Otherwise print error message */ #define ESP_PANEL_CHECK_RESULT_ASSERT (0) // 0/1 /* Set to 1 if print log message for debug */ #define ESP_PANEL_ENABLE_LOG (0) // 0/1 -/** - * Touch driver configurations - * - */ +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +///////////////////////////////////////////// Touch Driver Configurations ////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// /* Maximum point number */ #define ESP_PANEL_TOUCH_MAX_POINTS (5) - /* Maximum button number */ #define ESP_PANEL_TOUCH_MAX_BUTTONS (1) -/* Model configurations */ -// XPT2046 +/** + * XPT2046 related + * + */ #define ESP_PANEL_TOUCH_XPT2046_Z_THRESHOLD (400) // Minimum Z pressure threshold /** * Enable Interrupt (PENIRQ) output, also called Full Power Mode. @@ -59,6 +58,9 @@ */ #define ESP_PANEL_TOUCH_XPT2046_ENABLE_LOCKING (0) // 0/1 +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +/////////////////////////////////////////////// File Version /////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// /** * Do not change the following versions, they are used to check if the configurations in this file are compatible with * the current version of `ESP_Panel_Board_Custom.h` in the library. The detailed rules are as follows: @@ -72,4 +74,4 @@ */ #define ESP_PANEL_CONF_FILE_VERSION_MAJOR 0 #define ESP_PANEL_CONF_FILE_VERSION_MINOR 1 -#define ESP_PANEL_CONF_FILE_VERSION_PATCH 0 +#define ESP_PANEL_CONF_FILE_VERSION_PATCH 1 diff --git a/examples/Touch/I2C/ESP_Panel_Conf.h b/examples/Touch/I2C/ESP_Panel_Conf.h index 07e7d69c..e90f8ccd 100644 --- a/examples/Touch/I2C/ESP_Panel_Conf.h +++ b/examples/Touch/I2C/ESP_Panel_Conf.h @@ -6,28 +6,27 @@ #pragma once -/** - * Debug configurations - * - */ +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +///////////////////////////////////////////////// Debug Configurations ///////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// /* Set to 1 if assert on error. Otherwise print error message */ #define ESP_PANEL_CHECK_RESULT_ASSERT (0) // 0/1 /* Set to 1 if print log message for debug */ #define ESP_PANEL_ENABLE_LOG (0) // 0/1 -/** - * Touch driver configurations - * - */ +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +///////////////////////////////////////////// Touch Driver Configurations ////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// /* Maximum point number */ #define ESP_PANEL_TOUCH_MAX_POINTS (5) - /* Maximum button number */ #define ESP_PANEL_TOUCH_MAX_BUTTONS (1) -/* Model configurations */ -// XPT2046 +/** + * XPT2046 related + * + */ #define ESP_PANEL_TOUCH_XPT2046_Z_THRESHOLD (400) // Minimum Z pressure threshold /** * Enable Interrupt (PENIRQ) output, also called Full Power Mode. @@ -59,6 +58,9 @@ */ #define ESP_PANEL_TOUCH_XPT2046_ENABLE_LOCKING (0) // 0/1 +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +/////////////////////////////////////////////// File Version /////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// /** * Do not change the following versions, they are used to check if the configurations in this file are compatible with * the current version of `ESP_Panel_Board_Custom.h` in the library. The detailed rules are as follows: @@ -72,4 +74,4 @@ */ #define ESP_PANEL_CONF_FILE_VERSION_MAJOR 0 #define ESP_PANEL_CONF_FILE_VERSION_MINOR 1 -#define ESP_PANEL_CONF_FILE_VERSION_PATCH 0 +#define ESP_PANEL_CONF_FILE_VERSION_PATCH 1 diff --git a/examples/Touch/SPI/ESP_Panel_Conf.h b/examples/Touch/SPI/ESP_Panel_Conf.h index 07e7d69c..e90f8ccd 100644 --- a/examples/Touch/SPI/ESP_Panel_Conf.h +++ b/examples/Touch/SPI/ESP_Panel_Conf.h @@ -6,28 +6,27 @@ #pragma once -/** - * Debug configurations - * - */ +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +///////////////////////////////////////////////// Debug Configurations ///////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// /* Set to 1 if assert on error. Otherwise print error message */ #define ESP_PANEL_CHECK_RESULT_ASSERT (0) // 0/1 /* Set to 1 if print log message for debug */ #define ESP_PANEL_ENABLE_LOG (0) // 0/1 -/** - * Touch driver configurations - * - */ +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +///////////////////////////////////////////// Touch Driver Configurations ////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// /* Maximum point number */ #define ESP_PANEL_TOUCH_MAX_POINTS (5) - /* Maximum button number */ #define ESP_PANEL_TOUCH_MAX_BUTTONS (1) -/* Model configurations */ -// XPT2046 +/** + * XPT2046 related + * + */ #define ESP_PANEL_TOUCH_XPT2046_Z_THRESHOLD (400) // Minimum Z pressure threshold /** * Enable Interrupt (PENIRQ) output, also called Full Power Mode. @@ -59,6 +58,9 @@ */ #define ESP_PANEL_TOUCH_XPT2046_ENABLE_LOCKING (0) // 0/1 +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +/////////////////////////////////////////////// File Version /////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// /** * Do not change the following versions, they are used to check if the configurations in this file are compatible with * the current version of `ESP_Panel_Board_Custom.h` in the library. The detailed rules are as follows: @@ -72,4 +74,4 @@ */ #define ESP_PANEL_CONF_FILE_VERSION_MAJOR 0 #define ESP_PANEL_CONF_FILE_VERSION_MINOR 1 -#define ESP_PANEL_CONF_FILE_VERSION_PATCH 0 +#define ESP_PANEL_CONF_FILE_VERSION_PATCH 1 diff --git a/src/ESP_PanelVersions.h b/src/ESP_PanelVersions.h index a5108cf2..b2b0844f 100644 --- a/src/ESP_PanelVersions.h +++ b/src/ESP_PanelVersions.h @@ -16,12 +16,12 @@ /* File `ESP_Panel_Conf.h` */ #define ESP_PANEL_CONF_VERSION_MAJOR 0 #define ESP_PANEL_CONF_VERSION_MINOR 1 -#define ESP_PANEL_CONF_VERSION_PATCH 0 +#define ESP_PANEL_CONF_VERSION_PATCH 1 /* File `ESP_Panel_Board_Custom.h` */ #define ESP_PANEL_BOARD_CUSTOM_VERSION_MAJOR 0 #define ESP_PANEL_BOARD_CUSTOM_VERSION_MINOR 1 -#define ESP_PANEL_BOARD_CUSTOM_VERSION_PATCH 0 +#define ESP_PANEL_BOARD_CUSTOM_VERSION_PATCH 1 /* File `ESP_Panel_Board_Supported.h` */ #define ESP_PANEL_BOARD_SUPPORTED_VERSION_MAJOR 0 @@ -42,7 +42,9 @@ #if ESP_PANEL_CONF_FILE_VERSION_MAJOR != ESP_PANEL_CONF_VERSION_MAJOR #error "The file `ESP_Panel_Conf.h` version is not compatible. Please update it with the file from the library" #elif ESP_PANEL_CONF_FILE_VERSION_MINOR < ESP_PANEL_CONF_VERSION_MINOR -#warning "The file `ESP_Panel_Conf.h` version is outdated. Some new configurations might be missing" +#warning "The file `ESP_Panel_Conf.h` version is outdated. Some new configurations are missing" +#elif ESP_PANEL_CONF_FILE_VERSION_MINOR > ESP_PANEL_CONF_VERSION_MINOR +#warning "The file `ESP_Panel_Conf.h` version is newer than the library. Some new configurations are not supported" #endif /* ESP_PANEL_CONF_INCLUDE_INSIDE */ // File `ESP_Panel_Board_Custom.h` & `ESP_Panel_Board_Supported.h` @@ -61,7 +63,9 @@ #if ESP_PANEL_BOARD_SUPPORTED_FILE_VERSION_MAJOR != ESP_PANEL_BOARD_SUPPORTED_VERSION_MAJOR #error "The file `ESP_Panel_Board_Supported.h` version is not compatible. Please update it with the file from the library" #elif ESP_PANEL_BOARD_SUPPORTED_FILE_VERSION_MINOR < ESP_PANEL_BOARD_SUPPORTED_VERSION_MINOR -#warning "The file `ESP_Panel_Board_Supported.h` version is outdated. Some new configurations might be missing" +#warning "The file `ESP_Panel_Board_Supported.h` version is outdated. Some new configurations are missing" +#elif ESP_PANEL_BOARD_SUPPORTED_FILE_VERSION_MINOR > ESP_PANEL_BOARD_SUPPORTED_VERSION_MINOR +#warning "The file `ESP_Panel_Board_Supported.h` version is newer than the library. Some new configurations are not supported" #endif #else /* For using a custom board */ @@ -78,7 +82,9 @@ #if ESP_PANEL_BOARD_CUSTOM_FILE_VERSION_MAJOR != ESP_PANEL_BOARD_CUSTOM_VERSION_MAJOR #error "The file `ESP_Panel_Board_Custom.h` version is not compatible. Please update it with the file from the library" #elif ESP_PANEL_BOARD_CUSTOM_FILE_VERSION_MINOR < ESP_PANEL_BOARD_CUSTOM_VERSION_MINOR -#warning "The file `ESP_Panel_Board_Custom.h` version is outdated. Some new configurations might be missing" +#warning "The file `ESP_Panel_Board_Custom.h` version is outdated. Some new configurations are missing" +#elif ESP_PANEL_BOARD_CUSTOM_FILE_VERSION_MINOR > ESP_PANEL_BOARD_CUSTOM_VERSION_MINOR +#warning "The file `ESP_Panel_Board_Custom.h` version is newer than the library. Some new configurations are not supported" #endif #endif /* CONFIG_ESP_PANEL_USE_SUPPORTED_BOARD || ESP_PANEL_USE_SUPPORTED_BOARD */ #endif /* ESP_PANEL_USE_BOARD */ diff --git a/src/touch/README.md b/src/touch/README.md index ed006b9c..b0827937 100644 --- a/src/touch/README.md +++ b/src/touch/README.md @@ -7,6 +7,7 @@ | [FT5x06](https://components.espressif.com/components/espressif/esp_lcd_touch_ft5x06) | 1.0.6 | | [GT911](https://components.espressif.com/components/espressif/esp_lcd_touch_gt911) | 1.1.0 | | [GT1151](https://components.espressif.com/components/espressif/esp_lcd_touch_gt1151) | 1.0.5~1 | +| ST1633 | 0.1.0 | | [ST7123](https://components.espressif.com/components/espressif/esp_lcd_touch_st7123) | 0.0.1 | | [TT21100](https://components.espressif.com/components/espressif/esp_lcd_touch_tt21100) | 1.1.0 | | [XPT2046](https://components.espressif.com/components/atanisoft/esp_lcd_touch_xpt2046) | 1.0.4 | diff --git a/tools/check_file_version.py b/tools/check_file_version.py new file mode 100644 index 00000000..9f0cb223 --- /dev/null +++ b/tools/check_file_version.py @@ -0,0 +1,157 @@ +# SPDX-FileCopyrightText: 2024 Espressif Systems (Shanghai) CO LTD +# SPDX-License-Identifier: Apache-2.0 + +import os +import sys +import re + +internal_version_file = "src/ESP_PanelVersions.h" +internal_version_macross = [ + { + "file": "library.properties", + "macro": { + "major": "ESP_PANEL_VERSION_MAJOR", + "minor": "ESP_PANEL_VERSION_MINOR", + "patch": "ESP_PANEL_VERSION_PATCH" + }, + }, + { + "file": "ESP_Panel_Conf.h", + "macro": { + "major": "ESP_PANEL_CONF_VERSION_MAJOR", + "minor": "ESP_PANEL_CONF_VERSION_MINOR", + "patch": "ESP_PANEL_CONF_VERSION_PATCH" + }, + }, + { + "file": "ESP_Panel_Board_Custom.h", + "macro": { + "major": "ESP_PANEL_BOARD_CUSTOM_VERSION_MAJOR", + "minor": "ESP_PANEL_BOARD_CUSTOM_VERSION_MINOR", + "patch": "ESP_PANEL_BOARD_CUSTOM_VERSION_PATCH" + }, + }, + { + "file": "ESP_Panel_Board_Supported.h", + "macro": { + "major": "ESP_PANEL_BOARD_SUPPORTED_VERSION_MAJOR", + "minor": "ESP_PANEL_BOARD_SUPPORTED_VERSION_MINOR", + "patch": "ESP_PANEL_BOARD_SUPPORTED_VERSION_PATCH" + }, + }, +] +file_version_macros = [ + { + "file": "ESP_Panel_Conf.h", + "macro": { + "major": "ESP_PANEL_CONF_FILE_VERSION_MAJOR", + "minor": "ESP_PANEL_CONF_FILE_VERSION_MINOR", + "patch": "ESP_PANEL_CONF_FILE_VERSION_PATCH" + }, + }, + { + "file": "ESP_Panel_Board_Custom.h", + "macro": { + "major": "ESP_PANEL_BOARD_CUSTOM_FILE_VERSION_MAJOR", + "minor": "ESP_PANEL_BOARD_CUSTOM_FILE_VERSION_MINOR", + "patch": "ESP_PANEL_BOARD_CUSTOM_FILE_VERSION_PATCH" + }, + }, + { + "file": "ESP_Panel_Board_Supported.h", + "macro": { + "major": "ESP_PANEL_BOARD_SUPPORTED_FILE_VERSION_MAJOR", + "minor": "ESP_PANEL_BOARD_SUPPORTED_FILE_VERSION_MINOR", + "patch": "ESP_PANEL_BOARD_SUPPORTED_FILE_VERSION_PATCH" + }, + }, +] +arduino_version_file = "library.properties" + + +def extract_file_version(file_path, version_dict): + file_contents = [] + content_str = "" + with open(file_path, 'r') as file: + file_contents.append(file.readlines()) + for content in file_contents: + content_str = ''.join(content) + + version_macro = version_dict['macro'] + major_version = re.search(r'#define ' + version_macro["major"] + r' (\d+)', content_str) + minor_version = re.search(r'#define ' + version_macro["minor"] + r' (\d+)', content_str) + patch_version = re.search(r'#define ' + version_macro["patch"] + r' (\d+)', content_str) + + if major_version and minor_version and patch_version: + return {"file": version_dict['file'], "version": major_version.group(1) + '.' + minor_version.group(1) + '.' + patch_version.group(1)} + + return None + + +def extract_arduino_version(file_path): + file_contents = [] + content_str = "" + with open(file_path, 'r') as file: + file_contents.append(file.readlines()) + for content in file_contents: + content_str = ''.join(content) + + version = re.search(r'version=(\d+\.\d+\.\d+)', content_str) + + if version: + return {"file": os.path.basename(file_path), "version": version.group(1)} + + return None + + +if __name__ == "__main__": + if len(sys.argv) >= 3: + search_directory = sys.argv[1] + + # Extract internal versions + internal_version_path = os.path.join(search_directory, internal_version_file) + internal_versions = [] + print(f"Internal version extracted from '{internal_version_path}") + for internal_version_macros in internal_version_macross: + version = extract_file_version(internal_version_path, internal_version_macros) + if version: + print(f"Internal version: '{internal_version_macros['file']}': {version}") + internal_versions.append(version) + else: + print(f"'{internal_version_macros['file']}' version not found") + sys.exit(1) + + # Check file versions + for i in range(2, len(sys.argv)): + file_path = sys.argv[i] + + if file_path in internal_version_file: + print(f"Skipping '{file_path}'") + continue + + src_file = os.path.join(search_directory, os.path.basename(file_path)) + for file_version in file_version_macros: + versions = extract_file_version(src_file, file_version) + if versions: + print(f"File version extracted from '{src_file}': {versions}") + for internal_version in internal_versions: + if (internal_version['file'] == versions['file']) and (internal_version['version'] != versions['version']): + print(f"Version mismatch: '{internal_version['file']}'") + sys.exit(1) + print(f"Version matched") + + # Extract arduino version + arduino_version_path = os.path.join(search_directory, arduino_version_file) + arduino_version = extract_arduino_version(arduino_version_path) + print(f"Arduino version extracted from '{arduino_version_path}") + if arduino_version: + print(f"Arduino version: {arduino_version}") + else: + print(f"Arduino version not found") + + # Check arduino version + for internal_version in internal_versions: + if (internal_version['file'] == arduino_version_file) and (internal_version['version'] != arduino_version['version']): + print(f"Arduino version mismatch: '{internal_version['file']}'") + sys.exit(1) + print(f"Arduino Version matched") diff --git a/.github/ci/sync_conf_files.py b/tools/sync_conf_files.py similarity index 99% rename from .github/ci/sync_conf_files.py rename to tools/sync_conf_files.py index 657ed4b6..503c1da9 100644 --- a/.github/ci/sync_conf_files.py +++ b/tools/sync_conf_files.py @@ -5,7 +5,6 @@ import sys import shutil - exclude_dirs = ["./build"]