Skip to content

Commit cba9b95

Browse files
committed
Optimistic_yield interval changes from PR esp8266#7832, these need intense review.
1 parent 684d70c commit cba9b95

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

Diff for: 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(10000);
316+
optimistic_yield(1000);
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(10000);
365+
optimistic_yield(1000);
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(10000);
425+
optimistic_yield(1000);
426426
}
427427
}
428428
}

Diff for: cores/esp8266/core_esp8266_wiring_pulse.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ extern uint32_t xthal_get_ccount();
3131
if (xthal_get_ccount() - start_cycle_count > timeout_cycles) { \
3232
return 0; \
3333
} \
34-
optimistic_yield(5000); \
34+
optimistic_yield(1000); \
3535
}
3636

3737
// max timeout is 27 seconds at 160MHz clock and 54 seconds at 80MHz clock

Diff for: 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(10000);
33+
optimistic_yield(1000);
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(10000);
44+
optimistic_yield(1000);
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(10000);
63+
optimistic_yield(1000);
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;

0 commit comments

Comments
 (0)