File tree Expand file tree Collapse file tree 1 file changed +3
-2
lines changed
freemodbus/tcp_master/port Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -236,7 +236,6 @@ static BOOL xMBTCPPortMasterCloseConnection(MbSlaveInfo_t *pxInfo)
236236static void xMBTCPPortMasterShutdown (void )
237237{
238238 xSemaphoreGive (xShutdownSema );
239- xMbPortConfig .xMbTcpTaskHandle = NULL ;
240239
241240 for (USHORT ucCnt = 0 ; ucCnt < MB_TCP_PORT_MAX_CONN ; ucCnt ++ ) {
242241 MbSlaveInfo_t * pxInfo = xMbPortConfig .pxMbSlaveInfo [ucCnt ];
@@ -251,6 +250,7 @@ static void xMBTCPPortMasterShutdown(void)
251250 }
252251 free (xMbPortConfig .pxMbSlaveInfo );
253252 vTaskDelete (NULL );
253+ xMbPortConfig .xMbTcpTaskHandle = NULL ;
254254}
255255
256256void vMBTCPPortMasterSetNetOpt (void * pvNetIf , eMBPortIpVer xIpVersion , eMBPortProto xProto )
@@ -754,7 +754,8 @@ static void vMBTCPPortMasterTask(void *pvParameters)
754754 break ;
755755 }
756756 putchar (ucDot );
757- vTaskDelay (pdMS_TO_TICKS (100 )); /* if we don't yield we run the risk of hogging CPU */
757+ // if we don't yield we run the risk of hogging CPU
758+ vTaskDelay (pdMS_TO_TICKS (MB_TCP_CONNECTION_TIMEOUT_MS ));
758759 xErr = xMBTCPPortMasterConnect (pxInfo );
759760 switch (xErr )
760761 {
You can’t perform that action at this time.
0 commit comments