Skip to content

Commit 6e5a8e2

Browse files
committed
Per review by @earlephilhower
1 parent 015444a commit 6e5a8e2

File tree

6 files changed

+11
-11
lines changed

6 files changed

+11
-11
lines changed

cores/esp8266/core_esp8266_i2s.cpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -313,7 +313,7 @@ static bool _i2s_write_sample(uint32_t sample, bool nb) {
313313
if (tx->slc_queue_len > 0) {
314314
break;
315315
} else {
316-
optimistic_yield(1000);
316+
optimistic_yield(10000);
317317
}
318318
}
319319
}
@@ -362,7 +362,7 @@ static uint16_t _i2s_write_buffer(const int16_t *frames, uint16_t frame_count, b
362362
if (tx->slc_queue_len > 0) {
363363
break;
364364
} else {
365-
optimistic_yield(1000);
365+
optimistic_yield(10000);
366366
}
367367
}
368368
}
@@ -422,7 +422,7 @@ bool i2s_read_sample(int16_t *left, int16_t *right, bool blocking) {
422422
if (rx->slc_queue_len > 0){
423423
break;
424424
} else {
425-
optimistic_yield(1000);
425+
optimistic_yield(10000);
426426
}
427427
}
428428
}

cores/esp8266/flash_hal.cpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ extern "C" {
3030
}
3131

3232
int32_t flash_hal_read(uint32_t addr, uint32_t size, uint8_t *dst) {
33-
optimistic_yield(1000);
33+
optimistic_yield(10000);
3434

3535
// We use flashRead overload that handles proper alignment
3636
if (ESP.flashRead(addr, dst, size)) {
@@ -41,7 +41,7 @@ int32_t flash_hal_read(uint32_t addr, uint32_t size, uint8_t *dst) {
4141
}
4242

4343
int32_t flash_hal_write(uint32_t addr, uint32_t size, const uint8_t *src) {
44-
optimistic_yield(1000);
44+
optimistic_yield(10000);
4545

4646
// We use flashWrite overload that handles proper alignment
4747
if (ESP.flashWrite(addr, src, size)) {
@@ -60,7 +60,7 @@ int32_t flash_hal_erase(uint32_t addr, uint32_t size) {
6060
const uint32_t sector = addr / SPI_FLASH_SEC_SIZE;
6161
const uint32_t sectorCount = size / SPI_FLASH_SEC_SIZE;
6262
for (uint32_t i = 0; i < sectorCount; ++i) {
63-
optimistic_yield(1000);
63+
optimistic_yield(10000);
6464
if (!ESP.flashEraseSector(sector + i)) {
6565
DEBUGV("_spif_erase addr=%x size=%d i=%d\r\n", addr, size, i);
6666
return FLASH_HAL_ERASE_ERROR;

cores/esp8266/uart.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -512,7 +512,7 @@ uart_do_write_char(const int uart_nr, char c)
512512
{
513513
while(uart_tx_fifo_full(uart_nr))
514514
{
515-
optimistic_yield(1000UL);
515+
optimistic_yield(10000UL);
516516
}
517517

518518
USF(uart_nr) = c;

libraries/ESP8266WiFi/src/WiFiClient.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -253,7 +253,7 @@ int WiFiClient::available()
253253
int result = _client->getSize();
254254

255255
if (!result) {
256-
optimistic_yield(10000);
256+
optimistic_yield(100);
257257
}
258258
return result;
259259
}

libraries/ESP8266WiFi/src/WiFiUdp.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ int WiFiUDP::available() {
118118
if (!result) {
119119
// yielding here will not make more data "available",
120120
// but it will prevent the system from going into WDT reset
121-
optimistic_yield(10000);
121+
optimistic_yield(100UL);
122122
}
123123

124124
return result;
@@ -195,7 +195,7 @@ int WiFiUDP::parsePacket()
195195
return 0;
196196

197197
if (!_ctx->next()) {
198-
optimistic_yield(1000);
198+
optimistic_yield(100UL);
199199
return 0;
200200
}
201201

libraries/Wire/Wire.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,7 @@ int TwoWire::available(void)
227227
{
228228
// yielding here will not make more data "available",
229229
// but it will prevent the system from going into WDT reset
230-
optimistic_yield(10000UL);
230+
optimistic_yield(100UL);
231231
}
232232

233233
return result;

0 commit comments

Comments
 (0)