Skip to content

Commit fe5a615

Browse files
committed
feat(conf): update
1 parent e6f2c5a commit fe5a615

File tree

6 files changed

+88
-79
lines changed

6 files changed

+88
-79
lines changed

src/ESP_Panel.cpp

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,12 @@
44
* SPDX-License-Identifier: Apache-2.0
55
*/
66

7-
#include "ESP_Panel_Conf_Internal.h"
7+
#include "ESP_Panel_Library.h"
88

99
#ifdef ESP_PANEL_USE_BOARD
1010
#include <iostream>
1111
#include <memory>
12-
#include "ESP_PanelLog.h"
1312
#include "driver/gpio.h"
14-
#include <ESP_IOExpander_Library.h>
15-
#include "ESP_Panel_Library.h"
1613

1714
using namespace std;
1815

src/ESP_Panel.h

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,10 @@
55
*/
66
#pragma once
77

8-
#include "ESP_Panel_Conf_Internal.h"
8+
#include "ESP_Panel_Library.h"
99

1010
#ifdef ESP_PANEL_USE_BOARD
1111
#include <memory>
12-
#include <ESP_IOExpander_Library.h>
13-
#include "host/ESP_PanelHost.h"
14-
#include "bus/ESP_PanelBus.h"
15-
#include "lcd/ESP_PanelLcd.h"
16-
#include "touch/ESP_PanelTouch.h"
17-
#include "backlight/ESP_PanelBacklight.h"
1812

1913
/**
2014
* @brief Panel device class

src/ESP_PanelVersions.h

Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
/*
2+
* SPDX-FileCopyrightText: 2024 Espressif Systems (Shanghai) CO LTD
3+
*
4+
* SPDX-License-Identifier: Apache-2.0
5+
*/
6+
#pragma once
7+
8+
#include "ESP_Panel_Conf_Internal.h"
9+
#include "ESP_Panel_Board_Internal.h"
10+
11+
/* Library Version */
12+
#define ESP_PANEL_VERSION_MAJOR 0
13+
#define ESP_PANEL_VERSION_MINOR 1
14+
#define ESP_PANEL_VERSION_PATCH 3
15+
16+
/* File `ESP_Panel_Conf.h` */
17+
#define ESP_PANEL_CONF_VERSION_MAJOR 1
18+
#define ESP_PANEL_CONF_VERSION_MINOR 1
19+
#define ESP_PANEL_CONF_VERSION_PATCH 0
20+
21+
/* File `ESP_Panel_Board_Custom.h` */
22+
#define ESP_PANEL_BOARD_CUSTOM_VERSION_MAJOR 1
23+
#define ESP_PANEL_BOARD_CUSTOM_VERSION_MINOR 1
24+
#define ESP_PANEL_BOARD_CUSTOM_VERSION_PATCH 0
25+
26+
/* File `ESP_Panel_Board_Supported.h` */
27+
#define ESP_PANEL_BOARD_SUPPORTED_VERSION_MAJOR 1
28+
#define ESP_PANEL_BOARD_SUPPORTED_VERSION_MINOR 1
29+
#define ESP_PANEL_BOARD_SUPPORTED_VERSION_PATCH 0
30+
31+
/* Check if the current configuration file version is compatible with the library version */
32+
// File `ESP_Panel_Conf.h`
33+
// If the version is not defined, set it to `1.0.0`
34+
#if !defined(ESP_PANEL_CONF_FILE_VERSION_MAJOR) && \
35+
!defined(ESP_PANEL_CONF_FILE_VERSION_MINOR) && \
36+
!defined(ESP_PANEL_CONF_FILE_VERSION_PATCH)
37+
#define ESP_PANEL_CONF_FILE_VERSION_MAJOR 1
38+
#define ESP_PANEL_CONF_FILE_VERSION_MINOR 0
39+
#define ESP_PANEL_CONF_FILE_VERSION_PATCH 0
40+
#endif
41+
// Check if the current configuration file version is compatible with the library version
42+
#if ESP_PANEL_CONF_FILE_VERSION_MAJOR != ESP_PANEL_CONF_VERSION_MAJOR
43+
#error "The file `ESP_Panel_Conf.h` version is not compatible. Please update it with the file from the library"
44+
#elif ESP_PANEL_CONF_FILE_VERSION_MINOR < ESP_PANEL_CONF_VERSION_MINOR
45+
#warning "The file `ESP_Panel_Conf.h` version is outdated. Some new configurations might be missing"
46+
#endif /* ESP_PANEL_CONF_INCLUDE_INSIDE */
47+
48+
// File `ESP_Panel_Board_Custom.h` & `ESP_Panel_Board_Supported.h`
49+
#ifdef ESP_PANEL_USE_BOARD
50+
/* For using a supported board */
51+
#if CONFIG_ESP_PANEL_USE_SUPPORTED_BOARD || ESP_PANEL_USE_SUPPORTED_BOARD
52+
// If the version is not defined, set it to `1.0.0`
53+
#if !defined(ESP_PANEL_BOARD_SUPPORTED_FILE_VERSION_MAJOR) && \
54+
!defined(ESP_PANEL_BOARD_SUPPORTED_FILE_VERSION_MINOR) && \
55+
!defined(ESP_PANEL_BOARD_SUPPORTED_FILE_VERSION_PATCH)
56+
#define ESP_PANEL_BOARD_SUPPORTED_FILE_VERSION_MAJOR 1
57+
#define ESP_PANEL_BOARD_SUPPORTED_FILE_VERSION_MINOR 0
58+
#define ESP_PANEL_BOARD_SUPPORTED_FILE_VERSION_PATCH 0
59+
#endif
60+
// Check if the current configuration file version is compatible with the library version
61+
#if ESP_PANEL_BOARD_SUPPORTED_FILE_VERSION_MAJOR != ESP_PANEL_BOARD_SUPPORTED_VERSION_MAJOR
62+
#error "The file `ESP_Panel_Board_Supported.h` version is not compatible. Please update it with the file from the library"
63+
#elif ESP_PANEL_BOARD_SUPPORTED_FILE_VERSION_MINOR < ESP_PANEL_BOARD_SUPPORTED_VERSION_MINOR
64+
#warning "The file `ESP_Panel_Board_Supported.h` version is outdated. Some new configurations might be missing"
65+
#endif
66+
67+
#else /* For using a custom board */
68+
69+
// If the version is not defined, set it to `1.0.0`
70+
#if !defined(ESP_PANEL_BOARD_CUSTOM_FILE_VERSION_MAJOR) && \
71+
!defined(ESP_PANEL_BOARD_CUSTOM_FILE_VERSION_MINOR) && \
72+
!defined(ESP_PANEL_BOARD_CUSTOM_FILE_VERSION_PATCH)
73+
#define ESP_PANEL_BOARD_CUSTOM_FILE_VERSION_MAJOR 1
74+
#define ESP_PANEL_BOARD_CUSTOM_FILE_VERSION_MINOR 0
75+
#define ESP_PANEL_BOARD_CUSTOM_FILE_VERSION_PATCH 0
76+
#endif
77+
// Check if the current configuration file version is compatible with the library version
78+
#if ESP_PANEL_BOARD_CUSTOM_FILE_VERSION_MAJOR != ESP_PANEL_BOARD_CUSTOM_VERSION_MAJOR
79+
#error "The file `ESP_Panel_Board_Custom.h` version is not compatible. Please update it with the file from the library"
80+
#elif ESP_PANEL_BOARD_CUSTOM_FILE_VERSION_MINOR < ESP_PANEL_BOARD_CUSTOM_VERSION_MINOR
81+
#warning "The file `ESP_Panel_Board_Custom.h` version is outdated. Some new configurations might be missing"
82+
#endif
83+
#endif /* CONFIG_ESP_PANEL_USE_SUPPORTED_BOARD || ESP_PANEL_USE_SUPPORTED_BOARD */
84+
#endif /* ESP_PANEL_USE_BOARD */

src/ESP_Panel_Board_Internal.h

Lines changed: 1 addition & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -8,16 +8,6 @@
88

99
// *INDENT-OFF*
1010

11-
/* Versions */
12-
// File `ESP_Panel_Board_Custom.h`
13-
#define ESP_PANEL_BOARD_CUSTOM_VERSION_MAJOR 0
14-
#define ESP_PANEL_BOARD_CUSTOM_VERSION_MINOR 1
15-
#define ESP_PANEL_BOARD_CUSTOM_VERSION_PATCH 0
16-
// File `ESP_Panel_Board_Supported.h`
17-
#define ESP_PANEL_BOARD_SUPPORTED_VERSION_MAJOR 0
18-
#define ESP_PANEL_BOARD_SUPPORTED_VERSION_MINOR 1
19-
#define ESP_PANEL_BOARD_SUPPORTED_VERSION_PATCH 0
20-
2111
/* Handle special Kconfig options */
2212
#ifndef ESP_PANEL_KCONFIG_IGNORE
2313
#include "sdkconfig.h"
@@ -86,44 +76,12 @@
8676
#define ESP_PANEL_USE_BOARD
8777
#endif
8878

89-
#if ESP_PANEL_USE_BOARD
79+
#ifdef ESP_PANEL_USE_BOARD
9080
/* For using a supported board */
9181
#if CONFIG_ESP_PANEL_USE_SUPPORTED_BOARD || ESP_PANEL_USE_SUPPORTED_BOARD
9282
// Include the supported board header file
9383
#include "board/ESP_PanelBoard.h"
94-
95-
// If the version is not defined, set it to `0.1.0`
96-
#if !defined(ESP_PANEL_BOARD_SUPPORTED_FILE_VERSION_MAJOR) && \
97-
!defined(ESP_PANEL_BOARD_SUPPORTED_FILE_VERSION_MINOR) && \
98-
!defined(ESP_PANEL_BOARD_SUPPORTED_FILE_VERSION_PATCH)
99-
#define ESP_PANEL_BOARD_SUPPORTED_FILE_VERSION_MAJOR 0
100-
#define ESP_PANEL_BOARD_SUPPORTED_FILE_VERSION_MINOR 1
101-
#define ESP_PANEL_BOARD_SUPPORTED_FILE_VERSION_PATCH 0
102-
#endif
103-
// Check if the current configuration file version is compatible with the library version
104-
#if ESP_PANEL_BOARD_SUPPORTED_FILE_VERSION_MAJOR != ESP_PANEL_BOARD_SUPPORTED_VERSION_MAJOR
105-
#error "The current file version is not compatible. Please update it with the file from the library"
106-
#elif ESP_PANEL_BOARD_SUPPORTED_FILE_VERSION_MINOR != ESP_PANEL_BOARD_SUPPORTED_VERSION_MINOR
107-
#warning "The current file version is outdated. Some new configurations might be missing"
108-
#endif
109-
110-
#else /* For using a custom board */
111-
112-
// If the version is not defined, set it to `0.1.0`
113-
#if !defined(ESP_PANEL_BOARD_CUSTOM_FILE_VERSION_MAJOR) && \
114-
!defined(ESP_PANEL_BOARD_CUSTOM_FILE_VERSION_MINOR) && \
115-
!defined(ESP_PANEL_BOARD_CUSTOM_FILE_VERSION_PATCH)
116-
#define ESP_PANEL_BOARD_CUSTOM_FILE_VERSION_MAJOR 0
117-
#define ESP_PANEL_BOARD_CUSTOM_FILE_VERSION_MINOR 1
118-
#define ESP_PANEL_BOARD_CUSTOM_FILE_VERSION_PATCH 0
119-
#endif
120-
// Check if the current configuration file version is compatible with the library version
121-
#if ESP_PANEL_BOARD_CUSTOM_FILE_VERSION_MAJOR != ESP_PANEL_BOARD_CUSTOM_VERSION_MAJOR
122-
#error "The current file version is not compatible. Please update it with the file from the library"
123-
#elif ESP_PANEL_BOARD_CUSTOM_FILE_VERSION_MINOR != ESP_PANEL_BOARD_CUSTOM_VERSION_MINOR
124-
#warning "The current file version is outdated. Some new configurations might be missing"
12584
#endif
126-
#endif /* CONFIG_ESP_PANEL_USE_SUPPORTED_BOARD || ESP_PANEL_USE_SUPPORTED_BOARD */
12785

12886
#include "ESP_PanelTypes.h"
12987

src/ESP_Panel_Conf_Internal.h

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,6 @@
88

99
// *INDENT-OFF*
1010

11-
/* Versions */
12-
#define ESP_PANEL_CONF_VERSION_MAJOR 0
13-
#define ESP_PANEL_CONF_VERSION_MINOR 1
14-
#define ESP_PANEL_CONF_VERSION_PATCH 0
15-
1611
/* Handle special Kconfig options */
1712
#ifndef ESP_PANEL_KCONFIG_IGNORE
1813
#include "sdkconfig.h"
@@ -54,21 +49,6 @@
5449
#endif
5550

5651
#if !ESP_PANEL_CONF_INCLUDE_INSIDE
57-
// If the version is not defined, set it to `0.1.0`
58-
#if !defined(ESP_PANEL_CONF_FILE_VERSION_MAJOR) && \
59-
!defined(ESP_PANEL_CONF_FILE_VERSION_MINOR) && \
60-
!defined(ESP_PANEL_CONF_FILE_VERSION_PATCH)
61-
#define ESP_PANEL_CONF_FILE_VERSION_MAJOR 0
62-
#define ESP_PANEL_CONF_FILE_VERSION_MINOR 1
63-
#define ESP_PANEL_CONF_FILE_VERSION_PATCH 0
64-
#endif
65-
// Check if the current configuration file version is compatible with the library version
66-
#if ESP_PANEL_CONF_FILE_VERSION_MAJOR != ESP_PANEL_CONF_VERSION_MAJOR
67-
#error "The current file version is not compatible. Please update it with the file from the library"
68-
#elif ESP_PANEL_CONF_FILE_VERSION_MINOR != ESP_PANEL_CONF_VERSION_MINOR
69-
#warning "The current file version is outdated. Some new configurations might be missing"
70-
#endif
71-
7252
/* Supplement macro definitions based on sdkconfig, use default values if not defined */
7353
/*-------------------------------- Debug configurations --------------------------------*/
7454
#ifndef ESP_PANEL_CHECK_RESULT_ASSERT

src/ESP_Panel_Library.h

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,12 @@
55
*/
66
#pragma once
77

8-
/* Versions */
9-
#define ESP_PANEL_VERSION_MAJOR 0
10-
#define ESP_PANEL_VERSION_MINOR 1
11-
#define ESP_PANEL_VERSION_PATCH 3
12-
138
/* Drivers */
149
#include "ESP_Panel_Conf_Internal.h"
1510
#include "ESP_Panel_Board_Internal.h"
1611
#include "ESP_PanelLog.h"
1712
#include "ESP_PanelTypes.h"
13+
#include "ESP_PanelVersions.h"
1814

1915
/* Host */
2016
#include "host/ESP_PanelHost.h"

0 commit comments

Comments
 (0)