Skip to content

Commit 1d71449

Browse files
committed
Fixed headers inclusion to compile with all architectures
1 parent 0542763 commit 1d71449

6 files changed

+6
-20
lines changed

Diff for: src/ModbusT1SClient.cpp

+1-3
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,7 @@
1616
License along with this library; if not, write to the Free Software
1717
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
1818
*/
19-
20-
#if (defined(ARDUINO_UNOR4_WIFI) || defined(ARDUINO_UNOR4_MINIMA))
19+
2120
#include <errno.h>
2221

2322
extern "C" {
@@ -502,4 +501,3 @@ void ModbusT1SClientClass::disablePOE() {
502501
}
503502

504503
ModbusT1SClientClass ModbusT1SClient;
505-
#endif

Diff for: src/ModbusT1SClient.h

-3
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,6 @@
1919

2020
#ifndef _MODBUS_T1S_CLIENT_H_INCLUDED
2121
#define _MODBUS_T1S_CLIENT_H_INCLUDED
22-
#if (defined(ARDUINO_UNOR4_WIFI) || defined(ARDUINO_UNOR4_MINIMA))
23-
2422

2523
#include "ModbusClient.h"
2624
#include <ArduinoRS485.h>
@@ -271,4 +269,3 @@ void disablePOE();
271269

272270
extern ModbusT1SClientClass ModbusT1SClient;
273271
#endif
274-
#endif

Diff for: src/ModbusT1SCommon.cpp

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
11
#include "ModbusT1SCommon.h"
2-
#if (defined(ARDUINO_UNOR4_WIFI) || defined(ARDUINO_UNOR4_MINIMA))
2+
33
INIT_TC6(SPI, CS_PIN, RESET_PIN, IRQ_PIN);
4-
#endif

Diff for: src/ModbusT1SServer.cpp

+2-7
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
License along with this library; if not, write to the Free Software
1717
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
1818
*/
19-
#if (defined(ARDUINO_UNOR4_WIFI) || defined(ARDUINO_UNOR4_MINIMA))
19+
2020
#include <errno.h>
2121

2222
extern "C" {
@@ -388,14 +388,10 @@ static void default_OnPlcaStatus(bool success, bool plcaStatus)
388388
{
389389
if (!success)
390390
{
391-
Serial.println("PLCA status register read failed");
392391
return;
393392
}
394393

395-
if (plcaStatus) {
396-
Serial.println("PLCA Mode active");
397-
} else {
398-
Serial.println("CSMA/CD fallback");
394+
if (!plcaStatus) {
399395
tc6_inst->enablePlca();
400396
}
401397
}
@@ -415,4 +411,3 @@ void ModbusT1SServerClass::setGatwayIP(IPAddress ip) {
415411
}
416412

417413
ModbusT1SServerClass ModbusT1SServer;
418-
#endif

Diff for: src/ModbusT1SServer.h

+1-4
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919

2020
#ifndef _MODBUS_T1S_SERVER_H_INCLUDED
2121
#define _MODBUS_T1S_SERVER_H_INCLUDED
22-
#if (defined(ARDUINO_UNOR4_WIFI) || defined(ARDUINO_UNOR4_MINIMA))
2322

2423
#include "ModbusServer.h"
2524
#include <ArduinoRS485.h>
@@ -28,8 +27,7 @@
2827
#include "ModbusT1SCommon.h"
2928
#include <SPI.h>
3029

31-
32-
static void OnPlcaStatus_server(bool success, bool plcaStatus);
30+
3331
using callback_f = void (*)(bool, bool);
3432
class ModbusT1SServerClass : public ModbusServer {
3533
public:
@@ -178,4 +176,3 @@ class ModbusT1SServerClass : public ModbusServer {
178176
extern ModbusT1SServerClass ModbusT1SServer;
179177

180178
#endif
181-
#endif

Diff for: src/libmodbus/modbus-private.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
#ifndef _MSC_VER
1212
# include <stdint.h>
13-
#if defined(ARDUINO) && (defined(__AVR__) || (ARDUINO_UNOR4_WIFI) || defined(ARDUINO_UNOR4_MINIMA))
13+
#if defined(ARDUINO) && (defined(__AVR__) || defined(ARDUINO_ARCH_RENESAS))
1414
#define ssize_t unsigned long
1515

1616
#define fd_set void*

0 commit comments

Comments
 (0)