Skip to content

Commit fca8348

Browse files
ESP32: fix compile errors related to screen framwork (project-chip#25588)
* ESP32: fix compile errors related to screen framwork * Restyled by clang-format * fix errors in all-clusters-minimal-app and use ESP32-H2-MP now --------- Co-authored-by: Restyled.io <commits@restyled.io>
1 parent 624ce71 commit fca8348

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+139
-136
lines changed

config/esp32/components/chip/CMakeLists.txt

+1-3
Original file line numberDiff line numberDiff line change
@@ -292,9 +292,7 @@ if(CONFIG_BT_ENABLED)
292292
if("${CONFIG_IDF_TARGET}" STREQUAL "esp32h2")
293293
idf_component_get_property(bt_dir bt COMPONENT_DIR)
294294
list(APPEND chip_libraries $<TARGET_FILE:${bt_lib}>)
295-
if(CONFIG_IDF_TARGET_ESP32H2_BETA_VERSION_2)
296-
list(APPEND chip_libraries ${bt_dir}/controller/lib_esp32h2/esp32h2-bt-lib/beta2/libble_app.a)
297-
endif()
295+
list(APPEND chip_libraries ${bt_dir}/controller/lib_esp32h2/esp32h2-bt-lib/libble_app.a)
298296
elseif("${CONFIG_IDF_TARGET}" STREQUAL "esp32c2")
299297
idf_component_get_property(bt_dir bt COMPONENT_DIR)
300298
list(APPEND chip_libraries $<TARGET_FILE:${bt_lib}>)

config/esp32/components/chip/idf_component.yml

+1
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,4 @@ dependencies:
44
version: "^1.0.3"
55
rules:
66
- if: "idf_version >=5.0"
7+
- if: "target != esp32h2"

docs/guides/esp32/setup_idf_chip.md

+3-14
Original file line numberDiff line numberDiff line change
@@ -39,23 +39,12 @@ step.
3939
$ ./install.sh
4040
```
4141
42-
- For ESP32H2, please checkout tag
43-
[v5.0](https://github.com/espressif/esp-idf/tree/v5.0), currently only
44-
lighting-app is supported on H2
42+
- For ESP32C6 & ESP32H2, please use commit
43+
[47852846d3](https://github.com/espressif/esp-idf/tree/47852846d3).
4544
4645
```
4746
$ cd esp-idf
48-
$ git checkout v5.0-beta1
49-
$ git submodule update --init
50-
$ ./install.sh
51-
```
52-
53-
- For ESP32C6, please use commit
54-
[afbdb0f3e](https://github.com/espressif/esp-idf/tree/afbdb0f3e).
55-
56-
```
57-
$ cd esp-idf
58-
$ git checkout afbdb0f3e
47+
$ git checkout 47852846d3
5948
$ git submodule update --init
6049
$ ./install.sh
6150
```

examples/all-clusters-app/esp32/main/AppTask.cpp

+2
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,9 @@
2121
#include "DeviceWithDisplay.h"
2222
#include "Globals.h"
2323
#include "LEDWidget.h"
24+
#if CONFIG_HAVE_DISPLAY
2425
#include "ScreenManager.h"
26+
#endif
2527
#include "driver/gpio.h"
2628
#include "esp_idf_version.h"
2729
#include "esp_log.h"

examples/all-clusters-app/esp32/main/BluetoothWidget.cpp

+3-2
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,13 @@
2323
* connection on display.
2424
*/
2525

26-
#include "ScreenManager.h"
27-
2826
#include "BluetoothWidget.h"
2927

3028
#include "esp_log.h"
3129
#include "esp_system.h"
30+
#if CONFIG_HAVE_DISPLAY
31+
#include "ScreenManager.h"
32+
#endif
3233

3334
extern const char * TAG;
3435

examples/all-clusters-app/esp32/main/Button.cpp

-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@
3131
#include "AppTask.h"
3232
#include "Button.h"
3333
#include "Globals.h"
34-
#include "ScreenManager.h"
3534
#include <lib/support/CodeUtils.h>
3635
#include <platform/CHIPDeviceLayer.h>
3736
#include <vector>

examples/all-clusters-app/esp32/main/CMakeLists.txt

+4-11
Original file line numberDiff line numberDiff line change
@@ -108,22 +108,15 @@ set(SRC_DIRS_LIST "${SRC_DIRS_LIST}"
108108
)
109109
endif (CONFIG_ENABLE_PW_RPC)
110110

111-
if(("${CONFIG_DEVICE_TYPE_ESP32_DEVKITC}" STREQUAL "y") OR ("${CONFIG_DEVICE_TYPE_ESP32_C3_DEVKITM}" STREQUAL "y") OR ("${CONFIG_DEVICE_TYPE_ESP32_C2_DEVKITM}" STREQUAL "y") OR ("${CONFIG_DEVICE_TYPE_ESP32_C6_DEVKITC}" STREQUAL "y"))
112-
list(APPEND PRIV_INCLUDE_DIRS_LIST
113-
"${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/examples/common/screen-framework/include")
114-
set(PRIV_REQUIRES_LIST chip QRCode bt)
115-
elseif(("${CONFIG_DEVICE_TYPE_M5STACK}" STREQUAL "y") OR ("${CONFIG_DEVICE_TYPE_ESP32_WROVER_KIT}" STREQUAL "y"))
116-
set(PRIV_REQUIRES_LIST chip QRCode bt tft spidrier screen-framework)
111+
set(PRIV_REQUIRES_LIST chip QRCode bt driver app_update nvs_flash spi_flash openthread)
112+
if(CONFIG_HAVE_DISPLAY)
113+
list(APPEND PRIV_REQUIRES_LIST tft spidrier screen-framework)
117114
endif()
118115

119-
if("${CONFIG_DEVICE_TYPE_ESP32_C3_DEVKITM}" STREQUAL "y")
116+
if(CONFIG_DEVICE_TYPE_ESP32_C3_DEVKITM)
120117
list(APPEND PRIV_REQUIRES_LIST led_strip)
121118
endif()
122119

123-
if (CONFIG_OPENTHREAD_ENABLED)
124-
list(APPEND PRIV_REQUIRES_LIST openthread)
125-
endif()
126-
127120
idf_component_register(PRIV_INCLUDE_DIRS ${PRIV_INCLUDE_DIRS_LIST}
128121
SRC_DIRS ${SRC_DIRS_LIST}
129122
EXCLUDE_SRCS ${EXCLUDE_SRCS_LIST}

examples/all-clusters-app/esp32/main/Kconfig.projbuild

+5
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,11 @@ menu "Demo"
8989
default 3 if DEVICE_TYPE_M5STACK
9090
default 4 if DEVICE_TYPE_ESP32_WROVER_KIT
9191

92+
config HAVE_DISPLAY
93+
bool
94+
default y if DEVICE_TYPE_M5STACK || DEVICE_TYPE_ESP32_WROVER_KIT
95+
default n if !(DEVICE_TYPE_M5STACK || DEVICE_TYPE_ESP32_WROVER_KIT)
96+
9297
config RENDEZVOUS_MODE
9398
int
9499
range 0 8

examples/all-clusters-app/esp32/main/LEDWidget.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,9 @@
2424
*/
2525

2626
#include "LEDWidget.h"
27-
27+
#if CONFIG_HAVE_DISPLAY
2828
#include "ScreenManager.h"
29-
29+
#endif
3030
#include "esp_log.h"
3131
#include "esp_system.h"
3232
#include "esp_timer.h"

examples/all-clusters-app/esp32/main/WiFiWidget.cpp

+3-2
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,13 @@
2323
* connection on display.
2424
*/
2525

26-
#include "ScreenManager.h"
27-
2826
#include "WiFiWidget.h"
2927

3028
#include "esp_log.h"
3129
#include "esp_system.h"
30+
#if CONFIG_HAVE_DISPLAY
31+
#include "ScreenManager.h"
32+
#endif
3233

3334
extern const char * TAG;
3435

examples/all-clusters-app/esp32/main/include/BluetoothWidget.h

-2
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,6 @@
1818

1919
#pragma once
2020

21-
#include "Display.h"
22-
2321
#include "freertos/FreeRTOS.h"
2422
#include "freertos/task.h"
2523

examples/all-clusters-app/esp32/main/include/DeviceWithDisplay.h

+6-3
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,8 @@
2020

2121
#include "Button.h"
2222
#include "DeviceCallbacks.h"
23-
#include "Display.h"
2423
#include "Globals.h"
25-
#include "ListScreen.h"
2624
#include "QRCodeScreen.h"
27-
#include "ScreenManager.h"
2825
#include "StatusScreen.h"
2926
#include "esp_check.h"
3027
#include "esp_log.h"
@@ -40,6 +37,12 @@
4037
#include <app/server/OnboardingCodesUtil.h>
4138
#include <app/server/Server.h>
4239

40+
#if CONFIG_HAVE_DISPLAY
41+
#include "Display.h"
42+
#include "ListScreen.h"
43+
#include "ScreenManager.h"
44+
#endif
45+
4346
#if CONFIG_DEVICE_TYPE_M5STACK
4447
#define BUTTON_1_GPIO_NUM ((gpio_num_t) 39) // Left button on M5Stack
4548
#define BUTTON_2_GPIO_NUM ((gpio_num_t) 38) // Middle button on M5Stack

examples/all-clusters-app/esp32/main/include/LEDWidget.h

-2
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,6 @@
1919

2020
#pragma once
2121

22-
#include "Display.h"
23-
2422
#include "driver/gpio.h"
2523

2624
#include "freertos/FreeRTOS.h"

examples/all-clusters-app/esp32/main/include/QRCodeScreen.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,11 @@
2525

2626
#pragma once
2727

28+
#include "sdkconfig.h"
29+
#if CONFIG_HAVE_DISPLAY
2830
#include "Screen.h"
2931
#include "ScreenManager.h"
3032

31-
#if CONFIG_HAVE_DISPLAY
32-
3333
#include <cstdint>
3434
#include <vector>
3535

examples/all-clusters-app/esp32/main/include/StatusScreen.h

+3-2
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,11 @@
2525

2626
#pragma once
2727

28-
#include "ListScreen.h"
29-
#include "ScreenManager.h"
28+
#include <sdkconfig.h>
3029

3130
#if CONFIG_HAVE_DISPLAY
31+
#include "ListScreen.h"
32+
#include "ScreenManager.h"
3233

3334
#include <cstdint>
3435
#include <vector>

examples/all-clusters-app/esp32/main/include/WiFiWidget.h

-2
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,6 @@
1818

1919
#pragma once
2020

21-
#include "Display.h"
22-
2321
#include "freertos/FreeRTOS.h"
2422
#include "freertos/task.h"
2523

examples/all-clusters-minimal-app/esp32/main/AppTask.cpp

+2
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,9 @@
2121
#include "DeviceWithDisplay.h"
2222
#include "Globals.h"
2323
#include "LEDWidget.h"
24+
#if CONFIG_HAVE_DISPLAY
2425
#include "ScreenManager.h"
26+
#endif
2527
#include "driver/gpio.h"
2628
#include "esp_idf_version.h"
2729
#include "esp_log.h"

examples/all-clusters-minimal-app/esp32/main/BluetoothWidget.cpp

+3-2
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,13 @@
2323
* connection on display.
2424
*/
2525

26-
#include "ScreenManager.h"
27-
2826
#include "BluetoothWidget.h"
2927

3028
#include "esp_log.h"
3129
#include "esp_system.h"
30+
#if CONFIG_HAVE_DISPLAY
31+
#include "ScreenManager.h"
32+
#endif
3233

3334
extern const char * TAG;
3435

examples/all-clusters-minimal-app/esp32/main/Button.cpp

+2
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,9 @@
3131
#include "AppTask.h"
3232
#include "Button.h"
3333
#include "Globals.h"
34+
#if CONFIG_HAVE_DISPLAY
3435
#include "ScreenManager.h"
36+
#endif
3537
#include <lib/support/CodeUtils.h>
3638
#include <platform/CHIPDeviceLayer.h>
3739
#include <vector>

examples/all-clusters-minimal-app/esp32/main/CMakeLists.txt

+9-16
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,9 @@ set(SRC_DIRS_LIST
3838
"${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/application-basic-server"
3939
"${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/test-cluster-server"
4040
"${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/descriptor"
41-
"${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/fan-control-server"
41+
"${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/fan-control-server"
4242
"${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/fixed-label-server"
43-
"${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/user-label-server"
43+
"${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/user-label-server"
4444
"${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/on-off-server"
4545
"${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/level-control"
4646
"${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/identify-server"
@@ -65,7 +65,7 @@ set(SRC_DIRS_LIST
6565
"${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/target-navigator-server"
6666
"${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/thermostat-server"
6767
"${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/thermostat-user-interface-configuration-server"
68-
"${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/thread-network-diagnostics-server"
68+
"${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/thread-network-diagnostics-server"
6969
"${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/channel-server"
7070
"${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/scenes"
7171
"${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/software-diagnostics-server"
@@ -80,8 +80,8 @@ set(SRC_DIRS_LIST
8080
"${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/ethernet-network-diagnostics-server"
8181
"${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/localization-configuration-server"
8282
"${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/time-format-localization-server"
83-
"${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/wifi-network-diagnostics-server"
84-
"${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/wake-on-lan-server"
83+
"${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/wifi-network-diagnostics-server"
84+
"${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/wake-on-lan-server"
8585
"${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/pump-configuration-and-control-server"
8686
"${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/power-source-configuration-server"
8787
"${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/power-source-server"
@@ -105,22 +105,15 @@ set(SRC_DIRS_LIST "${SRC_DIRS_LIST}"
105105
)
106106
endif (CONFIG_ENABLE_PW_RPC)
107107

108-
if(("${CONFIG_DEVICE_TYPE_ESP32_DEVKITC}" STREQUAL "y") OR ("${CONFIG_DEVICE_TYPE_ESP32_C3_DEVKITM}" STREQUAL "y") OR ("${CONFIG_DEVICE_TYPE_ESP32_C2_DEVKITM}" STREQUAL "y"))
109-
list(APPEND PRIV_INCLUDE_DIRS_LIST
110-
"${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/examples/common/screen-framework/include")
111-
set(PRIV_REQUIRES_LIST chip QRCode bt)
112-
elseif(("${CONFIG_DEVICE_TYPE_M5STACK}" STREQUAL "y") OR ("${CONFIG_DEVICE_TYPE_ESP32_WROVER_KIT}" STREQUAL "y"))
113-
set(PRIV_REQUIRES_LIST chip QRCode bt tft spidrier screen-framework)
108+
set(PRIV_REQUIRES_LIST chip QRCode bt driver app_update nvs_flash spi_flash openthread)
109+
if(CONFIG_HAVE_DISPLAY)
110+
list(APPEND PRIV_REQUIRES_LIST tft spidrier screen-framework)
114111
endif()
115112

116-
if("${CONFIG_DEVICE_TYPE_ESP32_C3_DEVKITM}" STREQUAL "y")
113+
if(CONFIG_DEVICE_TYPE_ESP32_C3_DEVKITM)
117114
list(APPEND PRIV_REQUIRES_LIST led_strip)
118115
endif()
119116

120-
if (CONFIG_OPENTHREAD_ENABLED)
121-
list(APPEND PRIV_REQUIRES_LIST openthread)
122-
endif()
123-
124117
idf_component_register(PRIV_INCLUDE_DIRS ${PRIV_INCLUDE_DIRS_LIST}
125118
SRC_DIRS ${SRC_DIRS_LIST}
126119
PRIV_REQUIRES ${PRIV_REQUIRES_LIST})

examples/all-clusters-minimal-app/esp32/main/Kconfig.projbuild

+5
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,11 @@ menu "Demo"
8181
default 3 if DEVICE_TYPE_M5STACK
8282
default 4 if DEVICE_TYPE_ESP32_WROVER_KIT
8383

84+
config HAVE_DISPLAY
85+
bool
86+
default y if DEVICE_TYPE_M5STACK || DEVICE_TYPE_ESP32_WROVER_KIT
87+
default n if !(DEVICE_TYPE_M5STACK || DEVICE_TYPE_ESP32_WROVER_KIT)
88+
8489
config RENDEZVOUS_MODE
8590
int
8691
range 0 8

examples/all-clusters-minimal-app/esp32/main/LEDWidget.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,9 @@
2424
*/
2525

2626
#include "LEDWidget.h"
27-
27+
#if CONFIG_HAVE_DISPLAY
2828
#include "ScreenManager.h"
29-
29+
#endif
3030
#include "esp_log.h"
3131
#include "esp_system.h"
3232
#include "esp_timer.h"

examples/all-clusters-minimal-app/esp32/main/WiFiWidget.cpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,13 @@
2323
* connection on display.
2424
*/
2525

26-
#include "ScreenManager.h"
27-
2826
#include "WiFiWidget.h"
2927

3028
#include "esp_log.h"
3129
#include "esp_system.h"
32-
30+
#if CONFIG_HAVE_DISPLAY
31+
#include "ScreenManager.h"
32+
#endif
3333
extern const char * TAG;
3434

3535
void WiFiWidget::Init()

examples/all-clusters-minimal-app/esp32/main/include/BluetoothWidget.h

-2
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,6 @@
1818

1919
#pragma once
2020

21-
#include "Display.h"
22-
2321
#include "freertos/FreeRTOS.h"
2422
#include "freertos/task.h"
2523

examples/all-clusters-minimal-app/esp32/main/include/DeviceWithDisplay.h

+3-1
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,14 @@
2020

2121
#include "Button.h"
2222
#include "DeviceCallbacks.h"
23-
#include "Display.h"
2423
#include "Globals.h"
24+
#if CONFIG_HAVE_DISPLAY
25+
#include "Display.h"
2526
#include "ListScreen.h"
2627
#include "QRCodeScreen.h"
2728
#include "ScreenManager.h"
2829
#include "StatusScreen.h"
30+
#endif
2931
#include "esp_check.h"
3032
#include "esp_log.h"
3133
#include "esp_system.h"

examples/all-clusters-minimal-app/esp32/main/include/LEDWidget.h

-2
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,6 @@
1919

2020
#pragma once
2121

22-
#include "Display.h"
23-
2422
#include "driver/gpio.h"
2523

2624
#include "freertos/FreeRTOS.h"

0 commit comments

Comments
 (0)