Skip to content

Commit 044dd0e

Browse files
authored
Fix Matter Arduino as an component of IDF example
1 parent b4d0e71 commit 044dd0e

14 files changed

+556
-828
lines changed
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,15 @@
1-
cmake_minimum_required(VERSION 3.16.0)
2-
include($ENV{IDF_PATH}/tools/cmake/project.cmake)
1+
# The following lines of boilerplate have to be in your project's
2+
# CMakeLists in this exact order for cmake to work correctly
3+
cmake_minimum_required(VERSION 3.5)
4+
35
set(PROJECT_VER "1.0")
46
set(PROJECT_VER_NUMBER 1)
57

6-
project(matter-light)
8+
# This should be done before using the IDF_TARGET variable.
9+
include($ENV{IDF_PATH}/tools/cmake/project.cmake)
710

11+
idf_build_set_property(MINIMAL_BUILD ON)
12+
project(arduino_managed_component_light)
813

914
# WARNING: This is just an example for using key for decrypting the encrypted OTA image
1015
# Please do not use it as is.
@@ -16,8 +21,8 @@ if(CONFIG_IDF_TARGET_ESP32C2)
1621
include(relinker)
1722
endif()
1823

19-
idf_build_set_property(CXX_COMPILE_OPTIONS "-std=gnu++17;-Os;-DCHIP_HAVE_CONFIG_H" APPEND)
24+
idf_build_set_property(CXX_COMPILE_OPTIONS "-std=gnu++2a;-Os;-DCHIP_HAVE_CONFIG_H" APPEND)
2025
idf_build_set_property(C_COMPILE_OPTIONS "-Os" APPEND)
2126
# For RISCV chips, project_include.cmake sets -Wno-format, but does not clear various
2227
# flags that depend on -Wformat
23-
idf_build_set_property(COMPILE_OPTIONS "-Wno-format-nonliteral;-Wno-format-security" APPEND)
28+
idf_build_set_property(COMPILE_OPTIONS "-Wno-format-nonliteral;-Wno-format-security" APPEND)

examples/espidf-arduino-matter-light/main/Kconfig.projbuild

+18-78
Original file line numberDiff line numberDiff line change
@@ -3,100 +3,40 @@ menu "Light Matter Accessory"
33
config BUTTON_PIN
44
int
55
prompt "Button 1 GPIO"
6-
default ENV_GPIO_BOOT_BUTTON
6+
default 9 if IDF_TARGET_ESP32C3 || IDF_TARGET_ESP32C6
7+
default 0
78
range -1 ENV_GPIO_IN_RANGE_MAX
89
help
910
The GPIO pin for button that will be used to turn on/off the Matter Light. It shall be connected to a push button. It can use the BOOT button of the development board.
1011
endmenu
1112

12-
1313
menu "LEDs"
1414
config WS2812_PIN
1515
int
1616
prompt "WS2812 RGB LED GPIO"
17-
default ENV_GPIO_RGB_LED
17+
default 8 if IDF_TARGET_ESP32C3 || IDF_TARGET_ESP32C6
18+
default 48
1819
range -1 ENV_GPIO_OUT_RANGE_MAX
1920
help
2021
The GPIO pin for the Matter Light that will be driven by RMT. It shall be connected to one single WS2812 RGB LED.
2122
endmenu
2223

23-
# TARGET CONFIGURATION
24-
if IDF_TARGET_ESP32C3
25-
config ENV_GPIO_RANGE_MIN
26-
int
27-
default 0
28-
29-
config ENV_GPIO_RANGE_MAX
30-
int
31-
default 19
32-
# GPIOs 20/21 are always used by UART in examples
33-
34-
config ENV_GPIO_IN_RANGE_MAX
35-
int
36-
default ENV_GPIO_RANGE_MAX
37-
38-
config ENV_GPIO_OUT_RANGE_MAX
39-
int
40-
default ENV_GPIO_RANGE_MAX
41-
42-
config ENV_GPIO_BOOT_BUTTON
43-
int
44-
default 9
45-
46-
config ENV_GPIO_RGB_LED
47-
int
48-
default 8
49-
endif
50-
if IDF_TARGET_ESP32C6
51-
config ENV_GPIO_RANGE_MIN
52-
int
53-
default 0
24+
config ENV_GPIO_RANGE_MIN
25+
int
26+
default 0
5427

55-
config ENV_GPIO_RANGE_MAX
56-
int
57-
default 30
58-
# GPIOs 16/17 are always used by UART in examples
28+
config ENV_GPIO_RANGE_MAX
29+
int
30+
default 19 if IDF_TARGET_ESP32C3
31+
default 30 if IDF_TARGET_ESP32C6
32+
default 48
5933

60-
config ENV_GPIO_IN_RANGE_MAX
61-
int
62-
default ENV_GPIO_RANGE_MAX
34+
config ENV_GPIO_IN_RANGE_MAX
35+
int
36+
default ENV_GPIO_RANGE_MAX
6337

64-
config ENV_GPIO_OUT_RANGE_MAX
65-
int
66-
default ENV_GPIO_RANGE_MAX
67-
68-
config ENV_GPIO_BOOT_BUTTON
69-
int
70-
default 9
71-
72-
config ENV_GPIO_RGB_LED
73-
int
74-
default 8
75-
endif
76-
if IDF_TARGET_ESP32S3
77-
config ENV_GPIO_RANGE_MIN
78-
int
79-
default 0
80-
81-
config ENV_GPIO_RANGE_MAX
82-
int
83-
default 48
84-
85-
config ENV_GPIO_IN_RANGE_MAX
86-
int
87-
default ENV_GPIO_RANGE_MAX
88-
89-
config ENV_GPIO_OUT_RANGE_MAX
90-
int
91-
default ENV_GPIO_RANGE_MAX
92-
93-
config ENV_GPIO_BOOT_BUTTON
94-
int
95-
default 0
96-
97-
config ENV_GPIO_RGB_LED
98-
int
99-
default 48
100-
endif
38+
config ENV_GPIO_OUT_RANGE_MAX
39+
int
40+
default ENV_GPIO_RANGE_MAX
10141

10242
endmenu

0 commit comments

Comments
 (0)