Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ESP32: fix compile errors related to screen framwork #25588

Merged
merged 3 commits into from
Mar 10, 2023
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions config/esp32/components/chip/idf_component.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@ dependencies:
version: "^1.0.3"
rules:
- if: "idf_version >=5.0"
- if: "target != esp32h2"
2 changes: 2 additions & 0 deletions examples/all-clusters-app/esp32/main/AppTask.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,9 @@
#include "DeviceWithDisplay.h"
#include "Globals.h"
#include "LEDWidget.h"
#if CONFIG_HAVE_DISPLAY
#include "ScreenManager.h"
#endif
#include "driver/gpio.h"
#include "esp_idf_version.h"
#include "esp_log.h"
Expand Down
5 changes: 3 additions & 2 deletions examples/all-clusters-app/esp32/main/BluetoothWidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,13 @@
* connection on display.
*/

#include "ScreenManager.h"

#include "BluetoothWidget.h"

#include "esp_log.h"
#include "esp_system.h"
#if CONFIG_HAVE_DISPLAY
#include "ScreenManager.h"
#endif

extern const char * TAG;

Expand Down
1 change: 0 additions & 1 deletion examples/all-clusters-app/esp32/main/Button.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@
#include "AppTask.h"
#include "Button.h"
#include "Globals.h"
#include "ScreenManager.h"
#include <lib/support/CodeUtils.h>
#include <platform/CHIPDeviceLayer.h>
#include <vector>
Expand Down
11 changes: 4 additions & 7 deletions examples/all-clusters-app/esp32/main/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -108,15 +108,12 @@ set(SRC_DIRS_LIST "${SRC_DIRS_LIST}"
)
endif (CONFIG_ENABLE_PW_RPC)

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"))
list(APPEND PRIV_INCLUDE_DIRS_LIST
"${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/examples/common/screen-framework/include")
set(PRIV_REQUIRES_LIST chip QRCode bt)
elseif(("${CONFIG_DEVICE_TYPE_M5STACK}" STREQUAL "y") OR ("${CONFIG_DEVICE_TYPE_ESP32_WROVER_KIT}" STREQUAL "y"))
set(PRIV_REQUIRES_LIST chip QRCode bt tft spidrier screen-framework)
set(PRIV_REQUIRES_LIST chip QRCode bt driver app_update nvs_flash spi_flash openthread)
if(CONFIG_HAVE_DISPLAY)
list(APPEND PRIV_REQUIRES_LIST tft spidrier screen-framework)
endif()

if("${CONFIG_DEVICE_TYPE_ESP32_C3_DEVKITM}" STREQUAL "y")
if(CONFIG_DEVICE_TYPE_ESP32_C3_DEVKITM)
list(APPEND PRIV_REQUIRES_LIST led_strip)
endif()

Expand Down
5 changes: 5 additions & 0 deletions examples/all-clusters-app/esp32/main/Kconfig.projbuild
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,11 @@ menu "Demo"
default 3 if DEVICE_TYPE_M5STACK
default 4 if DEVICE_TYPE_ESP32_WROVER_KIT

config HAVE_DISPLAY
bool
default y if DEVICE_TYPE_M5STACK || DEVICE_TYPE_ESP32_WROVER_KIT
default n if !(DEVICE_TYPE_M5STACK || DEVICE_TYPE_ESP32_WROVER_KIT)

config RENDEZVOUS_MODE
int
range 0 8
Expand Down
4 changes: 2 additions & 2 deletions examples/all-clusters-app/esp32/main/LEDWidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@
*/

#include "LEDWidget.h"

#if CONFIG_HAVE_DISPLAY
#include "ScreenManager.h"

#endif
#include "esp_log.h"
#include "esp_system.h"
#include "esp_timer.h"
Expand Down
5 changes: 3 additions & 2 deletions examples/all-clusters-app/esp32/main/WiFiWidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,13 @@
* connection on display.
*/

#include "ScreenManager.h"

#include "WiFiWidget.h"

#include "esp_log.h"
#include "esp_system.h"
#if CONFIG_HAVE_DISPLAY
#include "ScreenManager.h"
#endif

extern const char * TAG;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@

#pragma once

#include "Display.h"

#include "freertos/FreeRTOS.h"
#include "freertos/task.h"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,8 @@

#include "Button.h"
#include "DeviceCallbacks.h"
#include "Display.h"
#include "Globals.h"
#include "ListScreen.h"
#include "QRCodeScreen.h"
#include "ScreenManager.h"
#include "StatusScreen.h"
#include "esp_check.h"
#include "esp_log.h"
Expand All @@ -40,6 +37,12 @@
#include <app/server/OnboardingCodesUtil.h>
#include <app/server/Server.h>

#if CONFIG_HAVE_DISPLAY
#include "Display.h"
#include "ListScreen.h"
#include "ScreenManager.h"
#endif

#if CONFIG_DEVICE_TYPE_M5STACK
#define BUTTON_1_GPIO_NUM ((gpio_num_t) 39) // Left button on M5Stack
#define BUTTON_2_GPIO_NUM ((gpio_num_t) 38) // Middle button on M5Stack
Expand Down
2 changes: 0 additions & 2 deletions examples/all-clusters-app/esp32/main/include/LEDWidget.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@

#pragma once

#include "Display.h"

#include "driver/gpio.h"

#include "freertos/FreeRTOS.h"
Expand Down
4 changes: 2 additions & 2 deletions examples/all-clusters-app/esp32/main/include/QRCodeScreen.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,11 @@

#pragma once

#include "sdkconfig.h"
#if CONFIG_HAVE_DISPLAY
#include "Screen.h"
#include "ScreenManager.h"

#if CONFIG_HAVE_DISPLAY

#include <cstdint>
#include <vector>

Expand Down
5 changes: 3 additions & 2 deletions examples/all-clusters-app/esp32/main/include/StatusScreen.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,11 @@

#pragma once

#include "ListScreen.h"
#include "ScreenManager.h"
#include <sdkconfig.h>

#if CONFIG_HAVE_DISPLAY
#include "ListScreen.h"
#include "ScreenManager.h"

#include <cstdint>
#include <vector>
Expand Down
2 changes: 0 additions & 2 deletions examples/all-clusters-app/esp32/main/include/WiFiWidget.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@

#pragma once

#include "Display.h"

#include "freertos/FreeRTOS.h"
#include "freertos/task.h"

Expand Down
15 changes: 2 additions & 13 deletions examples/common/screen-framework/include/Display.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,25 +28,14 @@

#include "esp_system.h"

#if CONFIG_DEVICE_TYPE_M5STACK
#if CONFIG_HAVE_DISPLAY

#define CONFIG_HAVE_DISPLAY 1
// for some reason this is backwards (turns out this is because of a 2019 update to the m5stack hw)
#if CONFIG_DEVICE_TYPE_M5STACK
#define INVERT_DISPLAY INVERT_ON

#elif CONFIG_DEVICE_TYPE_ESP32_WROVER_KIT

#define CONFIG_HAVE_DISPLAY 1
#define INVERT_DISPLAY INVERT_OFF

#else

#define CONFIG_HAVE_DISPLAY 0

#endif

#if CONFIG_HAVE_DISPLAY

extern "C" {
#include "tft.h"
#include "tftspi.h"
Expand Down
2 changes: 2 additions & 0 deletions examples/lighting-app/esp32/main/Button.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,9 @@
#include "AppTask.h"
#include "Button.h"
#include "Globals.h"
#if CONFIG_HAVE_DISPLAY
#include "ScreenManager.h"
#endif
#include <lib/support/CodeUtils.h>
#include <platform/CHIPDeviceLayer.h>
#include <vector>
Expand Down
2 changes: 1 addition & 1 deletion examples/lighting-app/esp32/main/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ set(SRC_DIRS_LIST "${SRC_DIRS_LIST}"
)
endif (CONFIG_ENABLE_PW_RPC)

if ("${CONFIG_DEVICE_TYPE_M5STACK}" STREQUAL "y")
if (CONFIG_HAVE_DISPLAY)
list(APPEND PRIV_REQUIRES_LIST tft screen-framework)
endif()

Expand Down
10 changes: 5 additions & 5 deletions examples/lighting-app/esp32/main/DeviceWithDisplay.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,6 @@

#include "Button.h"
#include "DeviceCallbacks.h"
#include "Display.h"
#include "ListScreen.h"
#include "QRCodeScreen.h"
#include "ScreenManager.h"
#include "StatusScreen.h"
#include "esp_check.h"
#include "esp_log.h"
#include "esp_system.h"
Expand All @@ -34,6 +29,11 @@
#include <vector>

#if CONFIG_HAVE_DISPLAY
#include "Display.h"
#include "ListScreen.h"
#include "QRCodeScreen.h"
#include "ScreenManager.h"
#include "StatusScreen.h"

#include <app-common/zap-generated/attributes/Accessors.h>
#include <app/server/Dnssd.h>
Expand Down
16 changes: 13 additions & 3 deletions examples/lighting-app/esp32/main/Kconfig.projbuild
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ menu "Demo"
default DEVICE_TYPE_ESP32_C3_DEVKITM if IDF_TARGET_ESP32C3
default DEVICE_TYPE_ESP32_S3_DEVKITM if IDF_TARGET_ESP32S3
default DEVICE_TYPE_ESP32_C2_DEVKITM if IDF_TARGET_ESP32C2
default DEVICE_TYPE_ESP32_C6_DEVKITC if IDF_TARGET_ESP32C6
default DEVICE_TYPE_ESP32_H2_DEVKITC if IDF_TARGET_ESP32H2
help
Specifies the type of ESP32 device.

Expand Down Expand Up @@ -53,11 +55,14 @@ menu "Demo"
config DEVICE_TYPE_ESP32_C2_DEVKITM
bool "ESP32C2-DevKitM"
depends on IDF_TARGET_ESP32C2
config DEVICE_TYPE_ESP32_C6_DEVKITC
bool "ESP32C6-DevKitC"
depends on IDF_TARGET_ESP32C6
endchoice

choice LED_TYPE
prompt "LED type"
default LED_TYPE_RMT if DEVICE_TYPE_ESP32_C3_DEVKITM || DEVICE_TYPE_ESP32_S3_DEVKITM || DEVICE_TYPE_ESP32H2_DEVKITC
default LED_TYPE_RMT if DEVICE_TYPE_ESP32_C3_DEVKITM || DEVICE_TYPE_ESP32_S3_DEVKITM || DEVICE_TYPE_ESP32H2_DEVKITC || DEVICE_TYPE_ESP32_C6_DEVKITC
default LED_TYPE_GPIO
help
Defines the default LED type used in the example
Expand All @@ -83,7 +88,7 @@ menu "Demo"
int "LED GPIO number"
range 0 48
default 26 if DEVICE_TYPE_ESP32_WROVER_KIT
default 8 if DEVICE_TYPE_ESP32_C3_DEVKITM || DEVICE_TYPE_ESP32H2_DEVKITC || DEVICE_TYPE_ESP32_C2_DEVKITM
default 8 if DEVICE_TYPE_ESP32_C3_DEVKITM || DEVICE_TYPE_ESP32H2_DEVKITC || DEVICE_TYPE_ESP32_C2_DEVKITM || DEVICE_TYPE_ESP32_C6_DEVKITC
default 48 if DEVICE_TYPE_ESP32_S3_DEVKITM
default 5 if DEVICE_TYPE_M5STACK
default 5
Expand Down Expand Up @@ -113,10 +118,15 @@ menu "Demo"
int
range 0 5
default 0 if DEVICE_TYPE_ESP32_DEVKITC
default 0 if DEVICE_TYPE_ESP32_C3_DEVKITM || DEVICE_TYPE_ESP32_C2_DEVKITM
default 0 if DEVICE_TYPE_ESP32_C3_DEVKITM || DEVICE_TYPE_ESP32_C2_DEVKITM || DEVICE_TYPE_ESP32H2_DEVKITC || DEVICE_TYPE_ESP32_C6_DEVKITC
default 3 if DEVICE_TYPE_M5STACK
default 4 if DEVICE_TYPE_ESP32_WROVER_KIT

config HAVE_DISPLAY
bool
default y if DEVICE_TYPE_M5STACK || DEVICE_TYPE_ESP32_WROVER_KIT
default n if !(DEVICE_TYPE_M5STACK || DEVICE_TYPE_ESP32_WROVER_KIT)

config RENDEZVOUS_MODE
int
range 0 8
Expand Down
2 changes: 2 additions & 0 deletions examples/lighting-app/esp32/main/LEDWidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@

#include "LEDWidget.h"
#include "ColorFormat.h"
#if CONFIG_HAVE_DISPLAY
#include "ScreenManager.h"
#endif
#include "led_strip.h"

static const char * TAG = "LEDWidget";
Expand Down
6 changes: 3 additions & 3 deletions examples/lighting-app/esp32/main/WiFiWidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,13 @@
* connection on display.
*/

#include "ScreenManager.h"

#include "WiFiWidget.h"

#include "esp_log.h"
#include "esp_system.h"

#if CONFIG_HAVE_DISPLAY
#include "ScreenManager.h"
#endif
void WiFiWidget::Init()
{
#if CONFIG_HAVE_DISPLAY
Expand Down
5 changes: 3 additions & 2 deletions examples/lighting-app/esp32/main/include/QRCodeScreen.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,11 @@

#pragma once

#include "Screen.h"
#include "ScreenManager.h"
#include "sdkconfig.h"

#if CONFIG_HAVE_DISPLAY
#include "Screen.h"
#include "ScreenManager.h"

#include <cstdint>
#include <vector>
Expand Down
5 changes: 3 additions & 2 deletions examples/lighting-app/esp32/main/include/StatusScreen.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,11 @@

#pragma once

#include "ListScreen.h"
#include "ScreenManager.h"
#include "sdkconfig.h"

#if CONFIG_HAVE_DISPLAY
#include "ListScreen.h"
#include "ScreenManager.h"

#include <cstdint>
#include <vector>
Expand Down
2 changes: 0 additions & 2 deletions examples/lighting-app/esp32/main/include/WiFiWidget.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@

#pragma once

#include "Display.h"

#include "freertos/FreeRTOS.h"
#include "freertos/task.h"

Expand Down
Loading