Skip to content

Commit

Permalink
Fix wait is blocking for ESP8266
Browse files Browse the repository at this point in the history
  • Loading branch information
luc-github committed Sep 2, 2024
1 parent 9745529 commit 86d33bd
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
10 changes: 5 additions & 5 deletions esp3d/configuration.h
Original file line number Diff line number Diff line change
Expand Up @@ -283,14 +283,14 @@
* ESP_SHARED_SD //Printer SD Card is also connected to ESP3D
* Does your system has SD card and how it is connected to your ESP3D
*/
#define SD_DEVICE_CONNECTION ESP_DIRECT_SD
//#define SD_DEVICE_CONNECTION ESP_DIRECT_SD

/* SD card library
* ESP_SD_NATIVE //esp32 / esp8266
* ESP_SDIO //esp32 only
* ESP_SDFAT2 //esp8266 / esp32
*/
#define SD_DEVICE ESP_SDFAT2
//#define SD_DEVICE ESP_SDFAT2


// #define SD_CARD_TYPE ESP_FYSETC_WIFI_PRO_SDCARD
Expand Down Expand Up @@ -629,9 +629,9 @@
// LOG_OUTPUT_SERIAL2
// LOG_OUTPUT_TELNET
// LOG_OUTPUT_WEBSOCKET
//#define ESP_LOG_FEATURE LOG_OUTPUT_SERIAL0
//#define ESP_LOG_FEATURE LOG_OUTPUT_SERIAL0

//#define ESP3D_DEBUG_LEVEL LOG_LEVEL_VERBOSE
//#define ESP3D_DEBUG_LEVEL LOG_LEVEL_DEBUG

#ifdef ESP_LOG_FEATURE
#define LOG_ESP3D_BAUDRATE 115200
Expand All @@ -642,7 +642,7 @@
// #define ESP_BENCHMARK_FEATURE

// Disable sanity check at compilation
//#define ESP_NO_SANITY_CHECK
// #define ESP_NO_SANITY_CHECK

/************************************
*
Expand Down
5 changes: 5 additions & 0 deletions esp3d/src/core/esp3d_hal.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -207,10 +207,15 @@ void ESP3DHal::wdtFeed() {

// wait function
void ESP3DHal::wait(uint32_t milliseconds) {
#ifdef ARDUINO_ARCH_ESP32
uint32_t timeout = millis();
while ((millis() - timeout) < milliseconds) {
wdtFeed();
}
#endif // CONFIG_IDF_TARGET_ESP32
#ifdef ARDUINO_ARCH_ESP8266
delay(milliseconds);
#endif // ARDUINO_ARCH_ESP8266
}

uint16_t ESP3DHal::getChipID() {
Expand Down

0 comments on commit 86d33bd

Please sign in to comment.