Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Per review by @earlephilhower
  • Loading branch information
dok-net committed Dec 23, 2022
commit d3bf7f974e967bd43d79f07984dd17de6e4aa71c
6 changes: 3 additions & 3 deletions cores/esp8266/core_esp8266_i2s.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,7 @@ static bool _i2s_write_sample(uint32_t sample, bool nb) {
if (tx->slc_queue_len > 0) {
break;
} else {
optimistic_yield(1000);
optimistic_yield(10000);
}
}
}
Expand Down Expand Up @@ -362,7 +362,7 @@ static uint16_t _i2s_write_buffer(const int16_t *frames, uint16_t frame_count, b
if (tx->slc_queue_len > 0) {
break;
} else {
optimistic_yield(1000);
optimistic_yield(10000);
}
}
}
Expand Down Expand Up @@ -422,7 +422,7 @@ bool i2s_read_sample(int16_t *left, int16_t *right, bool blocking) {
if (rx->slc_queue_len > 0){
break;
} else {
optimistic_yield(1000);
optimistic_yield(10000);
}
}
}
Expand Down
6 changes: 3 additions & 3 deletions cores/esp8266/flash_hal.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ extern "C" {
}

int32_t flash_hal_read(uint32_t addr, uint32_t size, uint8_t *dst) {
optimistic_yield(1000);
optimistic_yield(10000);

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

int32_t flash_hal_write(uint32_t addr, uint32_t size, const uint8_t *src) {
optimistic_yield(1000);
optimistic_yield(10000);

// We use flashWrite overload that handles proper alignment
if (ESP.flashWrite(addr, src, size)) {
Expand All @@ -60,7 +60,7 @@ int32_t flash_hal_erase(uint32_t addr, uint32_t size) {
const uint32_t sector = addr / SPI_FLASH_SEC_SIZE;
const uint32_t sectorCount = size / SPI_FLASH_SEC_SIZE;
for (uint32_t i = 0; i < sectorCount; ++i) {
optimistic_yield(1000);
optimistic_yield(10000);
if (!ESP.flashEraseSector(sector + i)) {
DEBUGV("_spif_erase addr=%x size=%d i=%d\r\n", addr, size, i);
return FLASH_HAL_ERASE_ERROR;
Expand Down
2 changes: 1 addition & 1 deletion cores/esp8266/uart.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -512,7 +512,7 @@ uart_do_write_char(const int uart_nr, char c)
{
while(uart_tx_fifo_full(uart_nr))
{
optimistic_yield(1000UL);
optimistic_yield(10000UL);
}

USF(uart_nr) = c;
Expand Down
2 changes: 1 addition & 1 deletion libraries/ESP8266WiFi/src/WiFiClient.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@ int WiFiClient::available()
int result = _client->getSize();

if (!result) {
optimistic_yield(10000);
optimistic_yield(100);
}
return result;
}
Expand Down
4 changes: 2 additions & 2 deletions libraries/ESP8266WiFi/src/WiFiUdp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ int WiFiUDP::available() {
if (!result) {
// yielding here will not make more data "available",
// but it will prevent the system from going into WDT reset
optimistic_yield(10000);
optimistic_yield(100UL);
}

return result;
Expand Down Expand Up @@ -194,7 +194,7 @@ int WiFiUDP::parsePacket()
return 0;

if (!_ctx->next()) {
optimistic_yield(1000);
optimistic_yield(100UL);
return 0;
}

Expand Down
2 changes: 1 addition & 1 deletion libraries/Wire/Wire.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ int TwoWire::available(void)
{
// yielding here will not make more data "available",
// but it will prevent the system from going into WDT reset
optimistic_yield(10000UL);
optimistic_yield(100UL);
}

return result;
Expand Down