From a212d3b04925265375d09653fcb832552d3e254a Mon Sep 17 00:00:00 2001 From: Luc <8822552+luc-github@users.noreply.github.com> Date: Sat, 3 Oct 2020 19:50:54 +0200 Subject: [PATCH] Fix Wrong error code if ack timeout Fix do not retry if time out in ack Increase default timeout --- esp3d/src/core/espcmd/ESP700.cpp | 2 +- esp3d/src/include/version.h | 2 +- esp3d/src/modules/gcode_host/gcode_host.cpp | 5 +++-- esp3d/src/modules/gcode_host/gcode_host.h | 2 +- 4 files changed, 6 insertions(+), 5 deletions(-) diff --git a/esp3d/src/core/espcmd/ESP700.cpp b/esp3d/src/core/espcmd/ESP700.cpp index 410dd00f..2adbf219 100644 --- a/esp3d/src/core/espcmd/ESP700.cpp +++ b/esp3d/src/core/espcmd/ESP700.cpp @@ -41,7 +41,7 @@ bool Commands::ESP700(const char* cmd_params, level_authenticate_type auth_type, (void)auth_type; #endif //AUTHENTICATION_FEATURE { - esp3d_gcode_host.processFile(parameter.c_str(), auth_type, output); + esp3d_gcode_host.processFSFile(parameter.c_str(), auth_type, output); output->printMSG("ok"); } return response; diff --git a/esp3d/src/include/version.h b/esp3d/src/include/version.h index 05760086..d33874dc 100644 --- a/esp3d/src/include/version.h +++ b/esp3d/src/include/version.h @@ -22,7 +22,7 @@ #define _VERSION_ESP3D_H //version and sources location -#define FW_VERSION "3.0.0.a58" +#define FW_VERSION "3.0.0.a59" #define REPOSITORY "https://github.com/luc-github/ESP3D/tree/3.0" #endif //_VERSION_ESP3D_H diff --git a/esp3d/src/modules/gcode_host/gcode_host.cpp b/esp3d/src/modules/gcode_host/gcode_host.cpp index 02623ec3..d7dec70f 100644 --- a/esp3d/src/modules/gcode_host/gcode_host.cpp +++ b/esp3d/src/modules/gcode_host/gcode_host.cpp @@ -163,7 +163,7 @@ bool GcodeHost::wait_for_ack(uint32_t timeout, bool checksum, const char * ack) Hal::wait (0); //minimum delay is 10 actually } - _error = ERROR_ACK_NUMBER; + _error = ERROR_TIME_OUT; return false; } @@ -209,7 +209,7 @@ bool GcodeHost::sendCommand(const char* command, bool checksum, bool wait4ack, c //what is the error ? log_esp3d("Error: %d", _error); //no need to retry for this one - if (_error == ERROR_MEMORY_PROBLEM) { + if ((_error == ERROR_MEMORY_PROBLEM) || (_error == ERROR_TIME_OUT)) { return false; } //need to resend command @@ -224,6 +224,7 @@ bool GcodeHost::sendCommand(const char* command, bool checksum, bool wait4ack, c } } } + Hal::wait(0); } } if (_error == ERROR_NO_ERROR) { diff --git a/esp3d/src/modules/gcode_host/gcode_host.h b/esp3d/src/modules/gcode_host/gcode_host.h index 922060fe..5b687133 100644 --- a/esp3d/src/modules/gcode_host/gcode_host.h +++ b/esp3d/src/modules/gcode_host/gcode_host.h @@ -27,7 +27,7 @@ #include "../authentication/authentication_service.h" class ESP3DOutput; -#define DEFAULT_TIMOUT 2000 +#define DEFAULT_TIMOUT 16000 #define MAX_TRY_2_SEND 5 #define ERROR_NO_ERROR 0 #define ERROR_TIME_OUT 1