Skip to content

Commit

Permalink
minor cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
digant73 committed Sep 5, 2023
1 parent f9021c1 commit 90f4eab
Showing 1 changed file with 7 additions and 11 deletions.
18 changes: 7 additions & 11 deletions TFT/src/User/API/Gcode/gcode.c
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

REQUEST_COMMAND_INFO requestCommandInfo = {0};

void waitResponse(void)
void waitForResponse(void)
{
TASK_LOOP_WHILE(!requestCommandInfo.done);
}
Expand Down Expand Up @@ -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;
Expand All @@ -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();

Expand All @@ -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;
Expand All @@ -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;
Expand Down Expand Up @@ -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)
{
Expand Down Expand Up @@ -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
}

0 comments on commit 90f4eab

Please sign in to comment.