From 90f4eab5f8fd5bfe476467e6a5ae735c39534d05 Mon Sep 17 00:00:00 2001 From: digant73 Date: Tue, 5 Sep 2023 12:51:57 +0200 Subject: [PATCH] minor cleanup --- TFT/src/User/API/Gcode/gcode.c | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/TFT/src/User/API/Gcode/gcode.c b/TFT/src/User/API/Gcode/gcode.c index 8835e7e115..7862592472 100644 --- a/TFT/src/User/API/Gcode/gcode.c +++ b/TFT/src/User/API/Gcode/gcode.c @@ -3,7 +3,7 @@ REQUEST_COMMAND_INFO requestCommandInfo = {0}; -void waitResponse(void) +void waitForResponse(void) { TASK_LOOP_WHILE(!requestCommandInfo.done); } @@ -51,7 +51,7 @@ static void resetRequestCommandInfo( if (string_error2) requestCommandInfo.error_num = 3; - TASK_LOOP_WHILE(isNotEmptyCmdQueue()); // wait for the communication to be clean before requestCommand + TASK_LOOP_WHILE(isNotEmptyCmdQueue()); // wait for the communication to be clean requestCommandInfo.stream_handler = NULL; requestCommandInfo.inWaitResponse = true; @@ -77,8 +77,7 @@ bool request_M21(void) mustStoreCmd((infoMachineSettings.multiVolume == ENABLED) ? ((infoFile.onboardSource == BOARD_SD) ? "M21 S\n" : "M21 U\n") : "M21\n"); - // Wait for response - waitResponse(); + waitForResponse(); // wait for response clearRequestCommandInfo(); @@ -99,8 +98,7 @@ char * request_M20(void) else mustStoreCmd("M20\n"); - // Wait for response - waitResponse(); + waitForResponse(); // wait for response //clearRequestCommandInfo(); // shall be call after copying the buffer ... return requestCommandInfo.cmd_rev_buf; @@ -125,8 +123,7 @@ char * request_M33(const char * filename) else mustStoreCmd("M33 %s\n", filename); - // Wait for response - waitResponse(); + waitForResponse(); // wait for response //clearRequestCommandInfo(); // shall be call after copying the buffer return requestCommandInfo.cmd_rev_buf; @@ -177,8 +174,7 @@ long request_M23_M36(const char * filename) sizeTag = "size\":"; // reprap firmware reports size JSON } - // Wait for response - waitResponse(); + waitForResponse(); // wait for response if (requestCommandInfo.inError) { @@ -278,5 +274,5 @@ void request_M20_rrf(const char * nextdir, bool with_ts, FP_STREAM_HANDLER handl mustStoreCmd("M20 S%d P\"/%s\"\n", with_ts ? 3 : 2, nextdir); - waitResponse(); + waitForResponse(); // wait for response }