add compile time checks for MB_MASTER_TCP_ENABLED

Signed-off-by: AshUK <github.AshUK@outlook.com>
pull/7441/head
Alex Lisitsyn 2021-08-12 22:39:21 +08:00
rodzic 2c49af9e75
commit 1aa7f27468
4 zmienionych plików z 16 dodań i 0 usunięć

Wyświetl plik

@ -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
@ -714,3 +716,5 @@ esp_err_t mbc_tcp_master_create(void** handler)
return ESP_OK;
}
#endif //#if MB_MASTER_TCP_ENABLED

Wyświetl plik

@ -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
@ -945,3 +947,5 @@ xMBMasterTCPTimerExpired(void)
return xNeedPoll;
}
#endif //#if MB_MASTER_TCP_ENABLED

Wyświetl plik

@ -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

Wyświetl plik

@ -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
@ -728,3 +730,5 @@ xMBTCPPortSendResponse( UCHAR * pucMBTCPFrame, USHORT usTCPLength )
}
return bFrameSent;
}
#endif //#if MB_TCP_ENABLED