Skip to content

Commit 5b31f48

Browse files
ci(pre-commit): Apply automatic fixes
1 parent 6ab941d commit 5b31f48

File tree

2 files changed

+16
-20
lines changed

2 files changed

+16
-20
lines changed

cores/esp32/esp32-hal-hosted.c

Lines changed: 12 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -47,24 +47,18 @@ static sdio_pin_config_t sdio_pin_config = {
4747
#endif
4848
};
4949

50-
static esp_hosted_coprocessor_fwver_t slave_version_struct = {
51-
.major1 = 0,
52-
.minor1 = 0,
53-
.patch1 = 0
54-
};
50+
static esp_hosted_coprocessor_fwver_t slave_version_struct = {.major1 = 0, .minor1 = 0, .patch1 = 0};
5551
static esp_hosted_coprocessor_fwver_t host_version_struct = {
56-
.major1 = ESP_HOSTED_VERSION_MAJOR_1,
57-
.minor1 = ESP_HOSTED_VERSION_MINOR_1,
58-
.patch1 = ESP_HOSTED_VERSION_PATCH_1
52+
.major1 = ESP_HOSTED_VERSION_MAJOR_1, .minor1 = ESP_HOSTED_VERSION_MINOR_1, .patch1 = ESP_HOSTED_VERSION_PATCH_1
5953
};
6054

61-
void hostedGetHostVersion(uint32_t * major, uint32_t * minor, uint32_t * patch) {
55+
void hostedGetHostVersion(uint32_t *major, uint32_t *minor, uint32_t *patch) {
6256
*major = host_version_struct.major1;
6357
*minor = host_version_struct.minor1;
6458
*patch = host_version_struct.patch1;
6559
}
6660

67-
void hostedGetSlaveVersion(uint32_t * major, uint32_t * minor, uint32_t * patch) {
61+
void hostedGetSlaveVersion(uint32_t *major, uint32_t *minor, uint32_t *patch) {
6862
*major = slave_version_struct.major1;
6963
*minor = slave_version_struct.minor1;
7064
*patch = slave_version_struct.patch1;
@@ -73,14 +67,14 @@ void hostedGetSlaveVersion(uint32_t * major, uint32_t * minor, uint32_t * patch)
7367
bool hostedHasUpdate() {
7468
uint32_t host_version = ESP_HOSTED_VERSION_VAL(host_version_struct.major1, host_version_struct.minor1, host_version_struct.patch1);
7569
uint32_t slave_version = 0;
76-
70+
7771
esp_err_t ret = esp_hosted_get_coprocessor_fwversion(&slave_version_struct);
7872
if (ret != ESP_OK) {
7973
log_e("Could not get slave firmware version: %s", esp_err_to_name(ret));
8074
} else {
8175
slave_version = ESP_HOSTED_VERSION_VAL(slave_version_struct.major1, slave_version_struct.minor1, slave_version_struct.patch1);
8276
}
83-
77+
8478
log_i("Host firmware version: %" PRIu32 ".%" PRIu32 ".%" PRIu32, host_version_struct.major1, host_version_struct.minor1, host_version_struct.patch1);
8579
log_i("Slave firmware version: %" PRIu32 ".%" PRIu32 ".%" PRIu32, slave_version_struct.major1, slave_version_struct.minor1, slave_version_struct.patch1);
8680

@@ -100,11 +94,13 @@ bool hostedHasUpdate() {
10094
return false;
10195
}
10296

103-
char * hostedGetUpdateURL() {
97+
char *hostedGetUpdateURL() {
10498
// https://espressif.github.io/arduino-esp32/hosted/esp32c6-v1.2.3.bin
10599
static char url[92] = {0};
106-
snprintf(url, 92, "https://espressif.github.io/arduino-esp32/hosted/%s-v%" PRIu32 ".%" PRIu32 ".%" PRIu32 ".bin",
107-
CONFIG_ESP_HOSTED_IDF_SLAVE_TARGET, host_version_struct.major1, host_version_struct.minor1, host_version_struct.patch1);
100+
snprintf(
101+
url, 92, "https://espressif.github.io/arduino-esp32/hosted/%s-v%" PRIu32 ".%" PRIu32 ".%" PRIu32 ".bin", CONFIG_ESP_HOSTED_IDF_SLAVE_TARGET,
102+
host_version_struct.major1, host_version_struct.minor1, host_version_struct.patch1
103+
);
108104
return url;
109105
}
110106

@@ -116,7 +112,7 @@ bool hostedBeginUpdate() {
116112
return err == ESP_OK;
117113
}
118114

119-
bool hostedWriteUpdate(uint8_t* buf, uint32_t len) {
115+
bool hostedWriteUpdate(uint8_t *buf, uint32_t len) {
120116
esp_err_t err = esp_hosted_slave_ota_write(buf, len);
121117
if (err != ESP_OK) {
122118
log_e("Failed to write Update: %s", esp_err_to_name(err));

cores/esp32/esp32-hal-hosted.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,12 +44,12 @@ bool hostedIsBLEActive();
4444
bool hostedIsWiFiActive();
4545
bool hostedSetPins(int8_t clk, int8_t cmd, int8_t d0, int8_t d1, int8_t d2, int8_t d3, int8_t rst);
4646
void hostedGetPins(int8_t *clk, int8_t *cmd, int8_t *d0, int8_t *d1, int8_t *d2, int8_t *d3, int8_t *rst);
47-
void hostedGetHostVersion(uint32_t * major, uint32_t * minor, uint32_t * patch);
48-
void hostedGetSlaveVersion(uint32_t * major, uint32_t * minor, uint32_t * patch);
47+
void hostedGetHostVersion(uint32_t *major, uint32_t *minor, uint32_t *patch);
48+
void hostedGetSlaveVersion(uint32_t *major, uint32_t *minor, uint32_t *patch);
4949
bool hostedHasUpdate();
50-
char * hostedGetUpdateURL();
50+
char *hostedGetUpdateURL();
5151
bool hostedBeginUpdate();
52-
bool hostedWriteUpdate(uint8_t* buf, uint32_t len);
52+
bool hostedWriteUpdate(uint8_t *buf, uint32_t len);
5353
bool hostedEndUpdate();
5454
bool hostedActivateUpdate();
5555

0 commit comments

Comments
 (0)