Skip to content

Commit

Permalink
minor cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
digant73 committed Aug 24, 2023
1 parent 9c75720 commit d8f67af
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 12 deletions.
2 changes: 1 addition & 1 deletion TFT/src/User/API/SerialConnection.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ static inline void Serial_InitPrimary(void)
{
setReminderMsg(LABEL_UNCONNECTED, SYS_STATUS_DISCONNECTED);

initInfoHost(false); // initialize infoHost when disconnected
InfoHost_Init(false); // initialize infoHost when disconnected

Serial_Config(serialPort[PORT_1].port, serialPort[PORT_1].cacheSize, baudrateValues[infoSettings.serial_port[PORT_1]]);
}
Expand Down
14 changes: 7 additions & 7 deletions TFT/src/User/API/parseACK.c
Original file line number Diff line number Diff line change
Expand Up @@ -417,7 +417,7 @@ void parseACK(void)

requestCommandInfo.inJson = false;

initInfoHost(true); // re-initialize infoHost when connected
InfoHost_Init(true); // re-initialize infoHost when connected
}

//----------------------------------------
Expand Down Expand Up @@ -493,10 +493,10 @@ void parseACK(void)
if (requestCommandInfo.done) // if command parsing is completed
{
// if RepRap or "ok" (e.g. in Marlin) is used as stop magic keyword,
// proceed with regular OK response ("ok\n") handling to update nfoHost.tx_slots and infoHost.tx_count
// proceed with regular OK response ("ok\n") handling to update infoHost.tx_slots and infoHost.tx_count
//
if (infoMachineSettings.firmwareType == FW_REPRAPFW || ack_starts_with("ok"))
handleOkAck();
InfoHost_HandleOkAck();
}

goto parse_end;
Expand All @@ -520,8 +520,8 @@ void parseACK(void)
else
rrfParseACK(ack_cache);

// proceed with regular OK response ("ok\n") handling to update nfoHost.tx_slots and infoHost.tx_count
handleOkAck();
// proceed with regular OK response ("ok\n") handling to update infoHost.tx_slots and infoHost.tx_count
InfoHost_HandleOkAck();

goto parse_end;
}
Expand All @@ -533,8 +533,8 @@ void parseACK(void)
// it is checked first (and not later on) because it is the most frequent response during printing
if (ack_starts_with("ok"))
{
// proceed with regular OK response ("ok\n") handling to update nfoHost.tx_slots and infoHost.tx_count
handleOkAck();
// proceed with regular OK response ("ok\n") handling to update infoHost.tx_slots and infoHost.tx_count
InfoHost_HandleOkAck();

// if regular OK response ("ok\n"), nothing else to do
if (ack_cache[ack_index] == '\n')
Expand Down
4 changes: 2 additions & 2 deletions TFT/src/User/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@ MENU infoMenu; // Menu structure
HOST infoHost; // Information interaction with Marlin
CLOCKS mcuClocks; // System clocks: SYSCLK, AHB, APB1, APB2, APB1_Timer, APB2_Timer2

void initInfoHost(bool isConnected)
void InfoHost_Init(bool isConnected)
{
infoHost.tx_slots = infoSettings.tx_slots;
infoHost.tx_count = 0;
infoHost.connected = isConnected;
infoHost.status = HOST_STATUS_IDLE;
}

void handleOkAck(void)
void InfoHost_HandleOkAck(void)
{
// 1 buffer just became available
infoHost.tx_slots = MIN(infoHost.tx_slots + 1, infoSettings.tx_slots);
Expand Down
4 changes: 2 additions & 2 deletions TFT/src/User/main.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@ extern MENU infoMenu;
extern HOST infoHost;
extern CLOCKS mcuClocks;

void initInfoHost(bool isConnected);
void handleOkAck(void);
void InfoHost_Init(bool isConnected);
void InfoHost_HandleOkAck(void);

#ifdef __cplusplus
}
Expand Down

0 comments on commit d8f67af

Please sign in to comment.