Skip to content

Commit a6d1d20

Browse files
committed
fix(pre-commit): Fix and apply pre-commit hooks
1 parent 9ecb6f3 commit a6d1d20

File tree

14 files changed

+696
-698
lines changed

14 files changed

+696
-698
lines changed

Diff for: .pre-commit-config.yaml

+1
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ repos:
2626
- id: trailing-whitespace
2727
args: [--markdown-linebreak-ext=md]
2828
- id: pretty-format-json
29+
stages: [manual]
2930
args: [--autofix]
3031
types_or: [json]
3132
exclude: |

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

+7-8
Original file line numberDiff line numberDiff line change
@@ -287,15 +287,14 @@ enum {
287287
VENDOR_REQUEST_MICROSOFT = 2
288288
};
289289

290-
static uint8_t const tinyusb_bos_descriptor[] = {
291-
// total length, number of device caps
292-
TUD_BOS_DESCRIPTOR(BOS_TOTAL_LEN, 2),
290+
static uint8_t const tinyusb_bos_descriptor[] = {// total length, number of device caps
291+
TUD_BOS_DESCRIPTOR(BOS_TOTAL_LEN, 2),
293292

294-
// Vendor Code, iLandingPage
295-
TUD_BOS_WEBUSB_DESCRIPTOR(VENDOR_REQUEST_WEBUSB, 1),
293+
// Vendor Code, iLandingPage
294+
TUD_BOS_WEBUSB_DESCRIPTOR(VENDOR_REQUEST_WEBUSB, 1),
296295

297-
// Microsoft OS 2.0 descriptor
298-
TUD_BOS_MS_OS_20_DESCRIPTOR(MS_OS_20_DESC_LEN, VENDOR_REQUEST_MICROSOFT)
296+
// Microsoft OS 2.0 descriptor
297+
TUD_BOS_MS_OS_20_DESCRIPTOR(MS_OS_20_DESC_LEN, VENDOR_REQUEST_MICROSOFT)
299298
};
300299

301300
/*
@@ -831,7 +830,7 @@ esp_err_t tinyusb_init(tinyusb_device_config_t *config) {
831830
periph_ll_enable_clk_clear_rst(PERIPH_USB_MODULE);
832831
}
833832
#endif
834-
833+
835834
tinyusb_config_t tusb_cfg = {
836835
.external_phy = false // In the most cases you need to use a `false` value
837836
};
Original file line numberDiff line numberDiff line change
@@ -1,65 +1,65 @@
1-
// Matter Manager
2-
#include <Matter.h>
3-
#include <WiFi.h>
4-
5-
// List of Matter Endpoints for this Node
6-
// On/Off Light Endpoint
7-
#include <MatterOnOffLight.h>
8-
MatterOnOffLight OnOffLight;
9-
10-
// WiFi is manually set and started
11-
12-
const char *ssid = "your-ssid"; // Change this to your WiFi SSID
13-
const char *password = "your-password"; // Change this to your WiFi password
14-
15-
void setup() {
16-
Serial.begin(115200);
17-
while (!Serial) {
18-
delay(100);
19-
}
20-
21-
// We start by connecting to a WiFi network
22-
Serial.print("Connecting to ");
23-
Serial.println(ssid);
24-
// enable IPv6
25-
WiFi.enableIPv6(true);
26-
// Manually connect to WiFi
27-
WiFi.begin(ssid, password);
28-
// Wait for connection
29-
while (WiFi.status() != WL_CONNECTED) {
30-
delay(500);
31-
Serial.print(".");
32-
}
33-
Serial.println("\r\nWiFi connected");
34-
Serial.println("IP address: ");
35-
Serial.println(WiFi.localIP());
36-
delay(500);
37-
38-
// Initialize at least one Matter EndPoint
39-
OnOffLight.begin();
40-
41-
// Matter begining - Last step, after all EndPoints are initialized
42-
Matter.begin();
43-
}
44-
45-
void loop() {
46-
// Check Matter Commissioning state
47-
if (!Matter.isDeviceCommissioned()) {
48-
Serial.println("");
49-
Serial.println("Matter Node is not commissioned yet.");
50-
Serial.println("Initiate the device discovery in your Matter environment.");
51-
Serial.println("Commission it to your Matter hub with the manual pairing code or QR code");
52-
Serial.printf("Manual pairing code: %s\r\n", Matter.getManualPairingCode().c_str());
53-
Serial.printf("QR code URL: %s\r\n", Matter.getOnboardingQRCodeUrl().c_str());
54-
// waits for Matter Light Commissioning.
55-
while (!Matter.isDeviceCommissioned()) {
56-
delay(5000);
57-
Serial.println("Matter Fabric not commissioned yet. Waiting for commissioning.");
58-
}
59-
}
60-
Serial.println("Matter Node is commissioned and connected to Wi-Fi.");
61-
Serial.println("====> Decommissioning in 30 seconds. <====");
62-
delay(30000);
63-
Matter.decommission();
64-
Serial.println("Matter Node is decommissioned. Commsssioning widget shall start over.");
65-
}
1+
// Matter Manager
2+
#include <Matter.h>
3+
#include <WiFi.h>
4+
5+
// List of Matter Endpoints for this Node
6+
// On/Off Light Endpoint
7+
#include <MatterOnOffLight.h>
8+
MatterOnOffLight OnOffLight;
9+
10+
// WiFi is manually set and started
11+
12+
const char *ssid = "your-ssid"; // Change this to your WiFi SSID
13+
const char *password = "your-password"; // Change this to your WiFi password
14+
15+
void setup() {
16+
Serial.begin(115200);
17+
while (!Serial) {
18+
delay(100);
19+
}
20+
21+
// We start by connecting to a WiFi network
22+
Serial.print("Connecting to ");
23+
Serial.println(ssid);
24+
// enable IPv6
25+
WiFi.enableIPv6(true);
26+
// Manually connect to WiFi
27+
WiFi.begin(ssid, password);
28+
// Wait for connection
29+
while (WiFi.status() != WL_CONNECTED) {
30+
delay(500);
31+
Serial.print(".");
32+
}
33+
Serial.println("\r\nWiFi connected");
34+
Serial.println("IP address: ");
35+
Serial.println(WiFi.localIP());
36+
delay(500);
37+
38+
// Initialize at least one Matter EndPoint
39+
OnOffLight.begin();
40+
41+
// Matter beginning - Last step, after all EndPoints are initialized
42+
Matter.begin();
43+
}
44+
45+
void loop() {
46+
// Check Matter Commissioning state
47+
if (!Matter.isDeviceCommissioned()) {
48+
Serial.println("");
49+
Serial.println("Matter Node is not commissioned yet.");
50+
Serial.println("Initiate the device discovery in your Matter environment.");
51+
Serial.println("Commission it to your Matter hub with the manual pairing code or QR code");
52+
Serial.printf("Manual pairing code: %s\r\n", Matter.getManualPairingCode().c_str());
53+
Serial.printf("QR code URL: %s\r\n", Matter.getOnboardingQRCodeUrl().c_str());
54+
// waits for Matter Light Commissioning.
55+
while (!Matter.isDeviceCommissioned()) {
56+
delay(5000);
57+
Serial.println("Matter Fabric not commissioned yet. Waiting for commissioning.");
58+
}
59+
}
60+
Serial.println("Matter Node is commissioned and connected to Wi-Fi.");
61+
Serial.println("====> Decommissioning in 30 seconds. <====");
62+
delay(30000);
63+
Matter.decommission();
64+
Serial.println("Matter Node is decommissioned. Commsssioning widget shall start over.");
65+
}
+7-8
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
1-
{
2-
"fqbn_append": "PartitionScheme=huge_app",
3-
"requires": [
4-
"CONFIG_SOC_WIFI_SUPPORTED=y",
5-
"CONFIG_ESP_MATTER_ENABLE_DATA_MODEL=y"
6-
]
7-
}
8-
1+
{
2+
"fqbn_append": "PartitionScheme=huge_app",
3+
"requires": [
4+
"CONFIG_SOC_WIFI_SUPPORTED=y",
5+
"CONFIG_ESP_MATTER_ENABLE_DATA_MODEL=y"
6+
]
7+
}
Original file line numberDiff line numberDiff line change
@@ -1,94 +1,94 @@
1-
// Matter Manager
2-
#include <Matter.h>
3-
#include <WiFi.h>
4-
5-
// List of Matter Endpoints for this Node
6-
// There will be 3 On/Off Light Endpoints in the same Node
7-
#include <MatterOnOffLight.h>
8-
MatterOnOffLight OnOffLight1;
9-
MatterOnOffLight OnOffLight2;
10-
MatterOnOffLight OnOffLight3;
11-
12-
// Matter Protocol Endpoint Callback for each Light Accessory
13-
bool setLightOnOff1(bool state) {
14-
Serial.printf("CB-Light1 changed state to: %s\r\n", state ? "ON" : "OFF");
15-
return true;
16-
}
17-
18-
bool setLightOnOff2(bool state) {
19-
Serial.printf("CB-Light2 changed state to: %s\r\n", state ? "ON" : "OFF");
20-
return true;
21-
}
22-
23-
bool setLightOnOff3(bool state) {
24-
Serial.printf("CB-Light3 changed state to: %s\r\n", state ? "ON" : "OFF");
25-
return true;
26-
}
27-
28-
// WiFi is manually set and started
29-
30-
const char *ssid = "your-ssid"; // Change this to your WiFi SSID
31-
const char *password = "your-password"; // Change this to your WiFi password
32-
33-
void setup() {
34-
Serial.begin(115200);
35-
while (!Serial) {
36-
delay(100);
37-
}
38-
39-
// We start by connecting to a WiFi network
40-
Serial.print("Connecting to ");
41-
Serial.println(ssid);
42-
// enable IPv6
43-
WiFi.enableIPv6(true);
44-
// Manually connect to WiFi
45-
WiFi.begin(ssid, password);
46-
// Wait for connection
47-
while (WiFi.status() != WL_CONNECTED) {
48-
delay(500);
49-
Serial.print(".");
50-
}
51-
Serial.println("\r\nWiFi connected");
52-
Serial.println("IP address: ");
53-
Serial.println(WiFi.localIP());
54-
delay(500);
55-
56-
// Initialize all 3 Matter EndPoints
57-
OnOffLight1.begin();
58-
OnOffLight2.begin();
59-
OnOffLight3.begin();
60-
OnOffLight1.onChangeOnOff(setLightOnOff1);
61-
OnOffLight2.onChangeOnOff(setLightOnOff2);
62-
OnOffLight3.onChangeOnOff(setLightOnOff3);
63-
64-
// Matter begining - Last step, after all EndPoints are initialized
65-
Matter.begin();
66-
}
67-
68-
void loop() {
69-
// Check Matter Light Commissioning state
70-
if (!Matter.isDeviceCommissioned()) {
71-
Serial.println("");
72-
Serial.println("Matter Node is not commissioned yet.");
73-
Serial.println("Initiate the device discovery in your Matter environment.");
74-
Serial.println("Commission it to your Matter hub with the manual pairing code or QR code");
75-
Serial.printf("Manual pairing code: %s\r\n", Matter.getManualPairingCode().c_str());
76-
Serial.printf("QR code URL: %s\r\n", Matter.getOnboardingQRCodeUrl().c_str());
77-
// waits for Matter Light Commissioning.
78-
uint32_t timeCount = 0;
79-
while (!Matter.isDeviceCommissioned()) {
80-
delay(100);
81-
if ((timeCount++ % 50) == 0) { // 50*100ms = 5 sec
82-
Serial.println("Matter Node not commissioned yet. Waiting for commissioning.");
83-
}
84-
}
85-
Serial.println("Matter Node is commissioned and connected to Wi-Fi. Ready for use.");
86-
}
87-
88-
//displays the Light state every 3 seconds
89-
Serial.println("======================");
90-
Serial.printf("Matter Light #1 is %s\r\n", OnOffLight1.getOnOff() ? "ON" : "OFF");
91-
Serial.printf("Matter Light #2 is %s\r\n", OnOffLight2.getOnOff() ? "ON" : "OFF");
92-
Serial.printf("Matter Light #3 is %s\r\n", OnOffLight3.getOnOff() ? "ON" : "OFF");
93-
delay(3000);
94-
}
1+
// Matter Manager
2+
#include <Matter.h>
3+
#include <WiFi.h>
4+
5+
// List of Matter Endpoints for this Node
6+
// There will be 3 On/Off Light Endpoints in the same Node
7+
#include <MatterOnOffLight.h>
8+
MatterOnOffLight OnOffLight1;
9+
MatterOnOffLight OnOffLight2;
10+
MatterOnOffLight OnOffLight3;
11+
12+
// Matter Protocol Endpoint Callback for each Light Accessory
13+
bool setLightOnOff1(bool state) {
14+
Serial.printf("CB-Light1 changed state to: %s\r\n", state ? "ON" : "OFF");
15+
return true;
16+
}
17+
18+
bool setLightOnOff2(bool state) {
19+
Serial.printf("CB-Light2 changed state to: %s\r\n", state ? "ON" : "OFF");
20+
return true;
21+
}
22+
23+
bool setLightOnOff3(bool state) {
24+
Serial.printf("CB-Light3 changed state to: %s\r\n", state ? "ON" : "OFF");
25+
return true;
26+
}
27+
28+
// WiFi is manually set and started
29+
30+
const char *ssid = "your-ssid"; // Change this to your WiFi SSID
31+
const char *password = "your-password"; // Change this to your WiFi password
32+
33+
void setup() {
34+
Serial.begin(115200);
35+
while (!Serial) {
36+
delay(100);
37+
}
38+
39+
// We start by connecting to a WiFi network
40+
Serial.print("Connecting to ");
41+
Serial.println(ssid);
42+
// enable IPv6
43+
WiFi.enableIPv6(true);
44+
// Manually connect to WiFi
45+
WiFi.begin(ssid, password);
46+
// Wait for connection
47+
while (WiFi.status() != WL_CONNECTED) {
48+
delay(500);
49+
Serial.print(".");
50+
}
51+
Serial.println("\r\nWiFi connected");
52+
Serial.println("IP address: ");
53+
Serial.println(WiFi.localIP());
54+
delay(500);
55+
56+
// Initialize all 3 Matter EndPoints
57+
OnOffLight1.begin();
58+
OnOffLight2.begin();
59+
OnOffLight3.begin();
60+
OnOffLight1.onChangeOnOff(setLightOnOff1);
61+
OnOffLight2.onChangeOnOff(setLightOnOff2);
62+
OnOffLight3.onChangeOnOff(setLightOnOff3);
63+
64+
// Matter beginning - Last step, after all EndPoints are initialized
65+
Matter.begin();
66+
}
67+
68+
void loop() {
69+
// Check Matter Light Commissioning state
70+
if (!Matter.isDeviceCommissioned()) {
71+
Serial.println("");
72+
Serial.println("Matter Node is not commissioned yet.");
73+
Serial.println("Initiate the device discovery in your Matter environment.");
74+
Serial.println("Commission it to your Matter hub with the manual pairing code or QR code");
75+
Serial.printf("Manual pairing code: %s\r\n", Matter.getManualPairingCode().c_str());
76+
Serial.printf("QR code URL: %s\r\n", Matter.getOnboardingQRCodeUrl().c_str());
77+
// waits for Matter Light Commissioning.
78+
uint32_t timeCount = 0;
79+
while (!Matter.isDeviceCommissioned()) {
80+
delay(100);
81+
if ((timeCount++ % 50) == 0) { // 50*100ms = 5 sec
82+
Serial.println("Matter Node not commissioned yet. Waiting for commissioning.");
83+
}
84+
}
85+
Serial.println("Matter Node is commissioned and connected to Wi-Fi. Ready for use.");
86+
}
87+
88+
//displays the Light state every 3 seconds
89+
Serial.println("======================");
90+
Serial.printf("Matter Light #1 is %s\r\n", OnOffLight1.getOnOff() ? "ON" : "OFF");
91+
Serial.printf("Matter Light #2 is %s\r\n", OnOffLight2.getOnOff() ? "ON" : "OFF");
92+
Serial.printf("Matter Light #3 is %s\r\n", OnOffLight3.getOnOff() ? "ON" : "OFF");
93+
delay(3000);
94+
}
+7-7
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
{
2-
"fqbn_append": "PartitionScheme=huge_app",
3-
"requires": [
4-
"CONFIG_SOC_WIFI_SUPPORTED=y",
5-
"CONFIG_ESP_MATTER_ENABLE_DATA_MODEL=y"
6-
]
7-
}
1+
{
2+
"fqbn_append": "PartitionScheme=huge_app",
3+
"requires": [
4+
"CONFIG_SOC_WIFI_SUPPORTED=y",
5+
"CONFIG_ESP_MATTER_ENABLE_DATA_MODEL=y"
6+
]
7+
}

0 commit comments

Comments
 (0)