Skip to content

Commit ba8d04e

Browse files
authored
Merge branch 'release/v3.1.x' into matter_identify_callback
2 parents cd7a775 + 6a6edcb commit ba8d04e

40 files changed

+160
-207
lines changed

Diff for: cores/esp32/esp32-hal-cpu.c

+2-11
Original file line numberDiff line numberDiff line change
@@ -259,18 +259,10 @@ bool setCpuFrequencyMhz(uint32_t cpu_freq_mhz) {
259259
if (apb_change_callbacks) {
260260
triggerApbChangeCallback(APB_AFTER_CHANGE, capb, apb);
261261
}
262-
// clang-format off
263-
#ifdef SOC_CLK_APLL_SUPPORTED
262+
#if defined(SOC_CLK_APLL_SUPPORTED) && !defined(CONFIG_IDF_TARGET_ESP32P4) // APLL not yet supported in ESP32-P4
264263
log_d(
265264
"%s: %u / %u = %u Mhz, APB: %u Hz",
266-
(conf.source == SOC_CPU_CLK_SRC_PLL) ? "PLL"
267-
: ((conf.source == SOC_CPU_CLK_SRC_APLL) ? "APLL"
268-
: ((conf.source == SOC_CPU_CLK_SRC_XTAL) ? "XTAL"
269-
#ifdef CONFIG_IDF_TARGET_ESP32P4
270-
: "17.5M")),
271-
#else
272-
: "8M")),
273-
#endif
265+
(conf.source == SOC_CPU_CLK_SRC_PLL) ? "PLL" : ((conf.source == SOC_CPU_CLK_SRC_APLL) ? "APLL" : ((conf.source == SOC_CPU_CLK_SRC_XTAL) ? "XTAL" : "8M")),
274266
conf.source_freq_mhz, conf.div, conf.freq_mhz, apb
275267
);
276268
#else
@@ -279,7 +271,6 @@ bool setCpuFrequencyMhz(uint32_t cpu_freq_mhz) {
279271
conf.source_freq_mhz, conf.div, conf.freq_mhz, apb
280272
);
281273
#endif
282-
// clang-format on
283274
return true;
284275
}
285276

Diff for: libraries/Matter/examples/MatterColorLight/MatterColorLight.ino

+4-9
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,10 @@
2121
// Color Light Endpoint
2222
MatterColorLight ColorLight;
2323

24+
// WiFi is manually set and started
25+
const char *ssid = "your-ssid"; // Change this to your WiFi SSID
26+
const char *password = "your-password"; // Change this to your WiFi password
27+
2428
// it will keep last OnOff & HSV Color state stored, using Preferences
2529
Preferences matterPref;
2630
const char *onOffPrefKey = "OnOff";
@@ -43,10 +47,6 @@ bool button_state = false; // false = released | true = pres
4347
const uint32_t debouceTime = 250; // button debouncing time (ms)
4448
const uint32_t decommissioningTimeout = 5000; // keep the button pressed for 5s, or longer, to decommission
4549

46-
// WiFi is manually set and started
47-
const char *ssid = "your-ssid"; // Change this to your WiFi SSID
48-
const char *password = "your-password"; // Change this to your WiFi password
49-
5050
// Set the RGB LED Light based on the current state of the Color Light
5151
bool setLightState(bool state, espHsvColor_t colorHSV) {
5252

@@ -76,15 +76,10 @@ void setup() {
7676
pinMode(ledPin, OUTPUT);
7777

7878
Serial.begin(115200);
79-
while (!Serial) {
80-
delay(100);
81-
}
8279

8380
// We start by connecting to a WiFi network
8481
Serial.print("Connecting to ");
8582
Serial.println(ssid);
86-
// enable IPv6
87-
WiFi.enableIPv6(true);
8883
// Manually connect to WiFi
8984
WiFi.begin(ssid, password);
9085
// Wait for connection

Diff for: libraries/Matter/examples/MatterCommissionTest/MatterCommissionTest.ino

-5
Original file line numberDiff line numberDiff line change
@@ -26,15 +26,10 @@ const char *password = "your-password"; // Change this to your WiFi password
2626

2727
void setup() {
2828
Serial.begin(115200);
29-
while (!Serial) {
30-
delay(100);
31-
}
3229

3330
// We start by connecting to a WiFi network
3431
Serial.print("Connecting to ");
3532
Serial.println(ssid);
36-
// enable IPv6
37-
WiFi.enableIPv6(true);
3833
// Manually connect to WiFi
3934
WiFi.begin(ssid, password);
4035
// Wait for connection

Diff for: libraries/Matter/examples/MatterComposedLights/MatterComposedLights.ino

-5
Original file line numberDiff line numberDiff line change
@@ -55,15 +55,10 @@ void setup() {
5555
pinMode(buttonPin, INPUT_PULLUP);
5656

5757
Serial.begin(115200);
58-
while (!Serial) {
59-
delay(100);
60-
}
6158

6259
// We start by connecting to a WiFi network
6360
Serial.print("Connecting to ");
6461
Serial.println(ssid);
65-
// enable IPv6
66-
WiFi.enableIPv6(true);
6762
// Manually connect to WiFi
6863
WiFi.begin(ssid, password);
6964
// Wait for connection

Diff for: libraries/Matter/examples/MatterContactSensor/MatterContactSensor.ino

+4-4
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,10 @@
3636
// Matter Contact Sensor Endpoint
3737
MatterContactSensor ContactSensor;
3838

39+
// WiFi is manually set and started
40+
const char *ssid = "your-ssid"; // Change this to your WiFi SSID
41+
const char *password = "your-password"; // Change this to your WiFi password
42+
3943
// LED will be used to indicate the Contact Sensor state
4044
// set your board RGB LED pin here
4145
#ifdef RGB_BUILTIN
@@ -48,10 +52,6 @@ const uint8_t ledPin = 2; // Set your pin here if your board has not defined LE
4852
// set your board USER BUTTON pin here - decommissioning and Manual Contact Sensor toggle button
4953
const uint8_t buttonPin = BOOT_PIN; // Set your pin here. Using BOOT Button.
5054

51-
// WiFi is manually set and started
52-
const char *ssid = "your-ssid"; // Change this to your WiFi SSID
53-
const char *password = "your-password"; // Change this to your WiFi password
54-
5555
// Button control
5656
uint32_t button_time_stamp = 0; // debouncing control
5757
bool button_state = false; // false = released | true = pressed

Diff for: libraries/Matter/examples/MatterDimmableLight/MatterDimmableLight.ino

+4-9
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,10 @@
2121
// Dimmable Light Endpoint
2222
MatterDimmableLight DimmableLight;
2323

24+
// WiFi is manually set and started
25+
const char *ssid = "your-ssid"; // Change this to your WiFi SSID
26+
const char *password = "your-password"; // Change this to your WiFi password
27+
2428
// it will keep last OnOff & Brightness state stored, using Preferences
2529
Preferences matterPref;
2630
const char *onOffPrefKey = "OnOff";
@@ -43,10 +47,6 @@ bool button_state = false; // false = released | true = pres
4347
const uint32_t debouceTime = 250; // button debouncing time (ms)
4448
const uint32_t decommissioningTimeout = 5000; // keep the button pressed for 5s, or longer, to decommission
4549

46-
// WiFi is manually set and started
47-
const char *ssid = "your-ssid"; // Change this to your WiFi SSID
48-
const char *password = "your-password"; // Change this to your WiFi password
49-
5050
// Set the RGB LED Light based on the current state of the Dimmable Light
5151
bool setLightState(bool state, uint8_t brightness) {
5252
if (state) {
@@ -72,15 +72,10 @@ void setup() {
7272
pinMode(ledPin, OUTPUT);
7373

7474
Serial.begin(115200);
75-
while (!Serial) {
76-
delay(100);
77-
}
7875

7976
// We start by connecting to a WiFi network
8077
Serial.print("Connecting to ");
8178
Serial.println(ssid);
82-
// enable IPv6
83-
WiFi.enableIPv6(true);
8479
// Manually connect to WiFi
8580
WiFi.begin(ssid, password);
8681
// Wait for connection

Diff for: libraries/Matter/examples/MatterEnhancedColorLight/MatterEnhancedColorLight.ino

+4-9
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,10 @@
2121
// Color Light Endpoint
2222
MatterEnhancedColorLight EnhancedColorLight;
2323

24+
// WiFi is manually set and started
25+
const char *ssid = "your-ssid"; // Change this to your WiFi SSID
26+
const char *password = "your-password"; // Change this to your WiFi password
27+
2428
// It will use HSV color to control all Matter Attribute Changes
2529
HsvColor_t currentHSVColor = {0, 0, 0};
2630

@@ -46,10 +50,6 @@ bool button_state = false; // false = released | true = pres
4650
const uint32_t debouceTime = 250; // button debouncing time (ms)
4751
const uint32_t decommissioningTimeout = 5000; // keep the button pressed for 5s, or longer, to decommission
4852

49-
// WiFi is manually set and started
50-
const char *ssid = "your-ssid"; // Change this to your WiFi SSID
51-
const char *password = "your-password"; // Change this to your WiFi password
52-
5353
// Set the RGB LED Light based on the current state of the Enhanced Color Light
5454
bool setLightState(bool state, espHsvColor_t colorHSV, uint8_t brighteness, uint16_t temperature_Mireds) {
5555

@@ -80,15 +80,10 @@ void setup() {
8080
pinMode(ledPin, OUTPUT);
8181

8282
Serial.begin(115200);
83-
while (!Serial) {
84-
delay(100);
85-
}
8683

8784
// We start by connecting to a WiFi network
8885
Serial.print("Connecting to ");
8986
Serial.println(ssid);
90-
// enable IPv6
91-
WiFi.enableIPv6(true);
9287
// Manually connect to WiFi
9388
WiFi.begin(ssid, password);
9489
// Wait for connection

Diff for: libraries/Matter/examples/MatterFan/MatterFan.ino

+4-9
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,10 @@
2020
// Fan Endpoint - On/Off control + Speed Percent Control + Fan Modes
2121
MatterFan Fan;
2222

23+
// WiFi is manually set and started
24+
const char *ssid = "your-ssid"; // Change this to your WiFi SSID
25+
const char *password = "your-password"; // Change this to your WiFi password
26+
2327
// set your board USER BUTTON pin here - used for toggling On/Off and decommission the Matter Node
2428
const uint8_t buttonPin = BOOT_PIN; // Set your pin here. Using BOOT Button.
2529

@@ -41,10 +45,6 @@ const uint8_t dcMotorPin = 2; // Set your pin here if your board has not define
4145
#warning "Do not forget to set the RGB LED pin"
4246
#endif
4347

44-
// WiFi is manually set and started
45-
const char *ssid = "your-ssid"; // Change this to your WiFi SSID
46-
const char *password = "your-password"; // Change this to your WiFi password
47-
4848
void fanDCMotorDrive(bool fanState, uint8_t speedPercent) {
4949
// drive the Fan DC motor
5050
if (fanState == false) {
@@ -71,15 +71,10 @@ void setup() {
7171
pinMode(dcMotorPin, OUTPUT);
7272

7373
Serial.begin(115200);
74-
while (!Serial) {
75-
delay(100);
76-
}
7774

7875
// We start by connecting to a WiFi network
7976
Serial.print("Connecting to ");
8077
Serial.println(ssid);
81-
// enable IPv6
82-
WiFi.enableIPv6(true);
8378
// Manually connect to WiFi
8479
WiFi.begin(ssid, password);
8580
// Wait for connection

Diff for: libraries/Matter/examples/MatterHumiditySensor/MatterHumiditySensor.ino

+3-3
Original file line numberDiff line numberDiff line change
@@ -27,13 +27,13 @@
2727
// Matter Humidity Sensor Endpoint
2828
MatterHumiditySensor SimulatedHumiditySensor;
2929

30-
// set your board USER BUTTON pin here - decommissioning button
31-
const uint8_t buttonPin = BOOT_PIN; // Set your pin here. Using BOOT Button.
32-
3330
// WiFi is manually set and started
3431
const char *ssid = "your-ssid"; // Change this to your WiFi SSID
3532
const char *password = "your-password"; // Change this to your WiFi password
3633

34+
// set your board USER BUTTON pin here - decommissioning button
35+
const uint8_t buttonPin = BOOT_PIN; // Set your pin here. Using BOOT Button.
36+
3737
// Button control - decommision the Matter Node
3838
uint32_t button_time_stamp = 0; // debouncing control
3939
bool button_state = false; // false = released | true = pressed

Diff for: libraries/Matter/examples/MatterMinimum/MatterMinimum.ino

+6-7
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,10 @@
2828
// Single On/Off Light Endpoint - at least one per node
2929
MatterOnOffLight OnOffLight;
3030

31+
// WiFi is manually set and started
32+
const char *ssid = "your-ssid"; // Change this to your WiFi SSID
33+
const char *password = "your-password"; // Change this to your WiFi password
34+
3135
// Light GPIO that can be controlled by Matter APP
3236
#ifdef LED_BUILTIN
3337
const uint8_t ledPin = LED_BUILTIN;
@@ -44,23 +48,18 @@ bool button_state = false; // false = released | true = pres
4448
const uint32_t decommissioningTimeout = 5000; // keep the button pressed for 5s, or longer, to decommission
4549

4650
// Matter Protocol Endpoint (On/OFF Light) Callback
47-
bool matterCB(bool state) {
51+
bool onOffLightCallback(bool state) {
4852
digitalWrite(ledPin, state ? HIGH : LOW);
4953
// This callback must return the success state to Matter core
5054
return true;
5155
}
5256

53-
// WiFi is manually set and started
54-
const char *ssid = "your-ssid"; // Change this to your WiFi SSID
55-
const char *password = "your-password"; // Change this to your WiFi password
56-
5757
void setup() {
5858
// Initialize the USER BUTTON (Boot button) that will be used to decommission the Matter Node
5959
pinMode(buttonPin, INPUT_PULLUP);
6060
// Initialize the LED GPIO
6161
pinMode(ledPin, OUTPUT);
6262

63-
WiFi.enableIPv6(true);
6463
// Manually connect to WiFi
6564
WiFi.begin(ssid, password);
6665
// Wait for connection
@@ -72,7 +71,7 @@ void setup() {
7271
OnOffLight.begin();
7372

7473
// Associate a callback to the Matter Controller
75-
OnOffLight.onChange(matterCB);
74+
OnOffLight.onChange(onOffLightCallback);
7675

7776
// Matter beginning - Last step, after all EndPoints are initialized
7877
Matter.begin();

Diff for: libraries/Matter/examples/MatterOccupancySensor/MatterOccupancySensor.ino

+3-3
Original file line numberDiff line numberDiff line change
@@ -34,13 +34,13 @@
3434
// Matter Occupancy Sensor Endpoint
3535
MatterOccupancySensor OccupancySensor;
3636

37-
// set your board USER BUTTON pin here - decommissioning only
38-
const uint8_t buttonPin = BOOT_PIN; // Set your pin here. Using BOOT Button.
39-
4037
// WiFi is manually set and started
4138
const char *ssid = "your-ssid"; // Change this to your WiFi SSID
4239
const char *password = "your-password"; // Change this to your WiFi password
4340

41+
// set your board USER BUTTON pin here - decommissioning only
42+
const uint8_t buttonPin = BOOT_PIN; // Set your pin here. Using BOOT Button.
43+
4444
// Button control
4545
uint32_t button_time_stamp = 0; // debouncing control
4646
bool button_state = false; // false = released | true = pressed

Diff for: libraries/Matter/examples/MatterOnOffLight/MatterOnOffLight.ino

+4-9
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,10 @@
1717
#include <WiFi.h>
1818
#include <Preferences.h>
1919

20+
// WiFi is manually set and started
21+
const char *ssid = "your-ssid"; // Change this to your WiFi SSID
22+
const char *password = "your-password"; // Change this to your WiFi password
23+
2024
// List of Matter Endpoints for this Node
2125
// On/Off Light Endpoint
2226
MatterOnOffLight OnOffLight;
@@ -42,10 +46,6 @@ bool button_state = false; // false = released | true = pres
4246
const uint32_t debouceTime = 250; // button debouncing time (ms)
4347
const uint32_t decommissioningTimeout = 5000; // keep the button pressed for 5s, or longer, to decommission
4448

45-
// WiFi is manually set and started
46-
const char *ssid = "your-ssid"; // Change this to your WiFi SSID
47-
const char *password = "your-password"; // Change this to your WiFi password
48-
4949
// Matter Protocol Endpoint Callback
5050
bool setLightOnOff(bool state) {
5151
Serial.printf("User Callback :: New Light State = %s\r\n", state ? "ON" : "OFF");
@@ -67,15 +67,10 @@ void setup() {
6767
pinMode(ledPin, OUTPUT);
6868

6969
Serial.begin(115200);
70-
while (!Serial) {
71-
delay(100);
72-
}
7370

7471
// We start by connecting to a WiFi network
7572
Serial.print("Connecting to ");
7673
Serial.println(ssid);
77-
// enable IPv6
78-
WiFi.enableIPv6(true);
7974
// Manually connect to WiFi
8075
WiFi.begin(ssid, password);
8176
// Wait for connection

Diff for: libraries/Matter/examples/MatterOnOffPlugin/MatterOnOffPlugin.ino

+4-4
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,10 @@
2121
// On/Off Plugin Endpoint
2222
MatterOnOffPlugin OnOffPlugin;
2323

24+
// WiFi is manually set and started
25+
const char *ssid = "your-ssid"; // Change this to your WiFi SSID
26+
const char *password = "your-password"; // Change this to your WiFi password
27+
2428
// it will keep last OnOff state stored, using Preferences
2529
Preferences matterPref;
2630
const char *onOffPrefKey = "OnOff";
@@ -41,10 +45,6 @@ uint32_t button_time_stamp = 0; // debouncing control
4145
bool button_state = false; // false = released | true = pressed
4246
const uint32_t decommissioningTimeout = 5000; // keep the button pressed for 5s, or longer, to decommission
4347

44-
// WiFi is manually set and started
45-
const char *ssid = "your-ssid"; // Change this to your WiFi SSID
46-
const char *password = "your-password"; // Change this to your WiFi password
47-
4848
// Matter Protocol Endpoint Callback
4949
bool setPluginOnOff(bool state) {
5050
Serial.printf("User Callback :: New Plugin State = %s\r\n", state ? "ON" : "OFF");

Diff for: libraries/Matter/examples/MatterPressureSensor/MatterPressureSensor.ino

+3-3
Original file line numberDiff line numberDiff line change
@@ -27,13 +27,13 @@
2727
// Matter Pressure Sensor Endpoint
2828
MatterPressureSensor SimulatedPressureSensor;
2929

30-
// set your board USER BUTTON pin here - decommissioning button
31-
const uint8_t buttonPin = BOOT_PIN; // Set your pin here. Using BOOT Button.
32-
3330
// WiFi is manually set and started
3431
const char *ssid = "your-ssid"; // Change this to your WiFi SSID
3532
const char *password = "your-password"; // Change this to your WiFi password
3633

34+
// set your board USER BUTTON pin here - decommissioning button
35+
const uint8_t buttonPin = BOOT_PIN; // Set your pin here. Using BOOT Button.
36+
3737
// Button control - decommision the Matter Node
3838
uint32_t button_time_stamp = 0; // debouncing control
3939
bool button_state = false; // false = released | true = pressed

0 commit comments

Comments
 (0)