mirror of
				https://github.com/espressif/esp-idf.git
				synced 2025-11-04 14:14:11 +00:00 
			
		
		
		
	Merge branch 'bugfix/modbus_fix_compiler_err_when_tcp_is_disabled_v43' into 'release/v4.3'
freemodbus: fix compiler err when tcp is disabled (backport v4.3) See merge request espressif/esp-idf!14789
This commit is contained in:
		@@ -33,6 +33,8 @@
 | 
			
		||||
#include "mbc_tcp_master.h"         // for tcp master create function and types
 | 
			
		||||
#include "port_tcp_master.h"        // for tcp master port defines and types
 | 
			
		||||
 | 
			
		||||
#if MB_MASTER_TCP_ENABLED
 | 
			
		||||
 | 
			
		||||
/*-----------------------Master mode use these variables----------------------*/
 | 
			
		||||
 | 
			
		||||
// The response time is average processing time + data transmission
 | 
			
		||||
@@ -725,3 +727,5 @@ esp_err_t mbc_tcp_master_create(void** handler)
 | 
			
		||||
 | 
			
		||||
    return ESP_OK;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
#endif //#if MB_MASTER_TCP_ENABLED
 | 
			
		||||
 
 | 
			
		||||
@@ -52,6 +52,8 @@
 | 
			
		||||
#include "mbframe.h"
 | 
			
		||||
#include "port_tcp_master.h"
 | 
			
		||||
 | 
			
		||||
#if MB_MASTER_TCP_ENABLED
 | 
			
		||||
 | 
			
		||||
/* ----------------------- Defines  -----------------------------------------*/
 | 
			
		||||
#define MB_TCP_CONNECTION_TIMEOUT_MS    ( 20 )      // Connection timeout in mS
 | 
			
		||||
#define MB_TCP_RECONNECT_TIMEOUT        ( 5000000 ) // Connection timeout in uS
 | 
			
		||||
@@ -987,3 +989,5 @@ xMBMasterTCPTimerExpired(void)
 | 
			
		||||
 | 
			
		||||
    return xNeedPoll;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
#endif //#if MB_MASTER_TCP_ENABLED
 | 
			
		||||
 
 | 
			
		||||
@@ -28,6 +28,8 @@
 | 
			
		||||
#include "mbc_tcp_slave.h"          // for tcp slave mb controller defines
 | 
			
		||||
#include "port_tcp_slave.h"         // for tcp slave port defines
 | 
			
		||||
 | 
			
		||||
#if MB_TCP_ENABLED
 | 
			
		||||
 | 
			
		||||
// Shared pointer to interface structure
 | 
			
		||||
static mb_slave_interface_t* mbs_interface_ptr = NULL;
 | 
			
		||||
 | 
			
		||||
@@ -221,3 +223,5 @@ esp_err_t mbc_tcp_slave_create(void** handler)
 | 
			
		||||
 | 
			
		||||
    return ESP_OK;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
#endif //#if MB_TCP_ENABLED
 | 
			
		||||
 
 | 
			
		||||
@@ -55,6 +55,8 @@
 | 
			
		||||
#include "port_tcp_slave.h"
 | 
			
		||||
#include "esp_modbus_common.h"      // for common types for network options
 | 
			
		||||
 | 
			
		||||
#if MB_TCP_ENABLED
 | 
			
		||||
 | 
			
		||||
/* ----------------------- Defines  -----------------------------------------*/
 | 
			
		||||
#define MB_TCP_DISCONNECT_TIMEOUT       ( CONFIG_FMB_TCP_CONNECTION_TOUT_SEC * 1000000 ) // disconnect timeout in uS
 | 
			
		||||
#define MB_TCP_RESP_TIMEOUT_MS          ( MB_MASTER_TIMEOUT_MS_RESPOND - 2 ) // slave response time limit
 | 
			
		||||
@@ -708,3 +710,5 @@ xMBTCPPortSendResponse( UCHAR * pucMBTCPFrame, USHORT usTCPLength )
 | 
			
		||||
    }
 | 
			
		||||
    return bFrameSent;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
#endif //#if MB_TCP_ENABLED
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user