Skip to content

Commit 87cce35

Browse files
ci(pre-commit): Apply automatic fixes
1 parent 29a1edc commit 87cce35

File tree

3 files changed

+16
-18
lines changed

3 files changed

+16
-18
lines changed

cores/esp32/esp32-hal-rmt.c

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -303,7 +303,7 @@ static bool _rmtWrite(int pin, rmt_data_t *data, size_t num_rmt_symbols, bool bl
303303
}
304304
}
305305

306-
#if ARDUHAL_LOG_LEVEL >= ARDUHAL_LOG_LEVEL_VERBOSE
306+
#if ARDUHAL_LOG_LEVEL >= ARDUHAL_LOG_LEVEL_VERBOSE
307307
log_v("GPIO: %d - Request: %d RMT Symbols - %s - Timeout: %d", pin, num_rmt_symbols, blocking ? "Blocking" : "Non-Blocking", timeout_ms);
308308
// loop parameter semantics:
309309
// loop == 0: no looping (single transmission)
@@ -313,14 +313,12 @@ static bool _rmtWrite(int pin, rmt_data_t *data, size_t num_rmt_symbols, bool bl
313313
char buf[17]; // placeholder for up to maximum uint32_t value (4294967295) = 10 digits + " times" (6 chars) + null terminator (17 bytes)
314314
snprintf(buf, sizeof(buf), "%lu times", loop);
315315
log_v(
316-
"GPIO: %d - Currently in Loop Mode: [%s] | Loop Request: [%s], LoopCancel: [%s]", pin,
317-
bus->rmt_ch_is_looping ? "YES" : "NO",
318-
loop == 0 ? "NO" : (loop == 1 ? "FOREVER" : buf),
319-
loopCancel ? "YES" : "NO"
316+
"GPIO: %d - Currently in Loop Mode: [%s] | Loop Request: [%s], LoopCancel: [%s]", pin, bus->rmt_ch_is_looping ? "YES" : "NO",
317+
loop == 0 ? "NO" : (loop == 1 ? "FOREVER" : buf), loopCancel ? "YES" : "NO"
320318
);
321319
}
322-
#endif
323-
320+
#endif
321+
324322
if ((xEventGroupGetBits(bus->rmt_events) & RMT_FLAG_TX_DONE) == 0) {
325323
log_v("GPIO %d - RMT Write still pending to be completed.", pin);
326324
return false;
@@ -363,7 +361,7 @@ static bool _rmtWrite(int pin, rmt_data_t *data, size_t num_rmt_symbols, bool bl
363361
if (loop > 0) {
364362
// rmt_ch_is_looping is used as a flag to indicate that RMT is in looping execution in order to
365363
// be cancelled whenever a new _rmtWrite() is executed while it is looping
366-
bus->rmt_ch_is_looping = true;
364+
bus->rmt_ch_is_looping = true;
367365
} else {
368366
if (blocking) {
369367
// wait for transmission confirmation | timeout

cores/esp32/esp32-hal-rmt.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -124,9 +124,9 @@ bool rmtWrite(int pin, rmt_data_t *data, size_t num_rmt_symbols, uint32_t timeou
124124
bool rmtWriteAsync(int pin, rmt_data_t *data, size_t num_rmt_symbols);
125125

126126
/**
127-
Writing data up to the reserved memsize, looping continuously (rmtWriteLooping()) or fixed
128-
number of <loop_count> times (rmtWriteRepeated())
129-
127+
Writing data up to the reserved memsize, looping continuously (rmtWriteLooping()) or fixed
128+
number of <loop_count> times (rmtWriteRepeated())
129+
130130
<rmt_symbol> is a 32 bits structure as defined by rmt_data_t type.
131131
It is possible to use the macro RMT_SYMBOLS_OF(data), if data is an array of rmt_data_t
132132

libraries/ESP32/examples/RMT/RMT_LED_Blink/RMT_LED_Blink.ino

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ rmt_data_t blink_1s_rmt_data[] = {
128128
0,
129129
},
130130
// Looping mode needs a Zero ending data to mark the EOF
131-
{ 0, 0, 0, 0 }
131+
{0, 0, 0, 0}
132132
};
133133

134134
// RMT is at 400KHz with a 2.5us tick
@@ -185,7 +185,7 @@ rmt_data_t blink_500ms_rmt_data[] = {
185185
0,
186186
},
187187
// Looping mode needs a Zero ending data to mark the EOF
188-
{ 0, 0, 0, 0 }
188+
{0, 0, 0, 0}
189189
};
190190

191191
// RMT is at 400KHz with a 2.5us tick
@@ -218,7 +218,7 @@ rmt_data_t blink_250ms_rmt_data[] = {
218218
0,
219219
},
220220
// Looping mode needs a Zero ending data to mark the EOF
221-
{ 0, 0, 0, 0 }
221+
{0, 0, 0, 0}
222222
};
223223

224224
void RMT_Mixed_Write_Blink() {
@@ -269,7 +269,7 @@ void RMT_Loop_Write_Blink() {
269269
delay(5000);
270270

271271
Serial.println("Blinking OFF for 2 seconds");
272-
rmt_data_t blink_STOP_rmt_data[] = { { 0, 0, 0, 0 } };
272+
rmt_data_t blink_STOP_rmt_data[] = {{0, 0, 0, 0}};
273273
if (!rmtWrite(BLINK_GPIO, blink_STOP_rmt_data, RMT_SYMBOLS_OF(blink_STOP_rmt_data), RMT_WAIT_FOR_EVER)) {
274274
Serial.println("===> rmtWrite Blink STOP Error!");
275275
}
@@ -283,19 +283,19 @@ void RMT_Repeated_Write_Blink() {
283283
if (!rmtWriteRepeated(BLINK_GPIO, blink_1s_rmt_data, RMT_SYMBOLS_OF(blink_1s_rmt_data), 2)) {
284284
Serial.println("===> rmtWrite Blink 1s Error!");
285285
}
286-
delay(4000 + 1000); // it should blink 2 times and stop automatically
286+
delay(4000 + 1000); // it should blink 2 times and stop automatically
287287
Serial.println("Blinking at 500ms on + 500ms off :: 4 blinks");
288288
// repeating blink_500ms_rmt_data (500ms on + 500ms off) 4 times for 4 blinks
289289
if (!rmtWriteRepeated(BLINK_GPIO, blink_500ms_rmt_data, RMT_SYMBOLS_OF(blink_500ms_rmt_data), 4)) {
290290
Serial.println("===> rmtWrite Blink 0.5s Error!");
291291
}
292-
delay(4000 + 1000); // it should blink 4 times and stop automatically
292+
delay(4000 + 1000); // it should blink 4 times and stop automatically
293293
Serial.println("Blinking at 250ms on + 250ms off :: 8 blinks");
294294
// repeating blink_250ms_rmt_data (250ms on + 250ms off) 8 times for 8 blinks
295295
if (!rmtWriteRepeated(BLINK_GPIO, blink_250ms_rmt_data, RMT_SYMBOLS_OF(blink_250ms_rmt_data), 8)) {
296296
Serial.println("===> rmtWrite Blink 0.25s Error!");
297297
}
298-
delay(4000 + 1000); // it should blink 8 times and stop automatically
298+
delay(4000 + 1000); // it should blink 8 times and stop automatically
299299
Serial.println("Blinking is OFF for 2 seconds");
300300
delay(2000);
301301
}

0 commit comments

Comments
 (0)