你最后搞通了么?我也在弄modbus一直编译失败,用的 arduinomodbus.h 库
C:\Users\zhaom\Documents\Arduino\libraries\ArduinoRS485\src\RS485.cpp: In member function 'virtual void RS485Class::begin(long unsigned int, uint16_t)':
C:\Users\zhaom\Documents\Arduino\libraries\ArduinoRS485\src\RS485.cpp:53:34: error: invalid conversion from 'uint16_t {aka short unsigned int}' to 'SerialConfig' [-fpermissive]
_serial->begin(baudrate, config);
^
In file included from C:\Users\zhaom\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.6.3\cores\esp8266/Arduino.h:244:0,
from C:\Users\zhaom\Documents\Arduino\libraries\ArduinoRS485\src\RS485.h:23,
from C:\Users\zhaom\Documents\Arduino\libraries\ArduinoRS485\src\RS485.cpp:20:
C:\Users\zhaom\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.6.3\cores\esp8266/HardwareSerial.h:78:10: error: initializing argument 2 of 'void HardwareSerial::begin(long unsigned int, SerialConfig)' [-fpermissive]
void begin(unsigned long baud, SerialConfig config)
^
C:\Users\zhaom\Documents\Arduino\libraries\ArduinoRS485\src\RS485.cpp: In member function 'void RS485Class::sendBreak(unsigned int)':
C:\Users\zhaom\Documents\Arduino\libraries\ArduinoRS485\src\RS485.cpp:149:36: error: invalid conversion from 'uint16_t {aka short unsigned int}' to 'SerialConfig' [-fpermissive]
_serial->begin(_baudrate, _config);
^
In file included from C:\Users\zhaom\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.6.3\cores\esp8266/Arduino.h:244:0,
from C:\Users\zhaom\Documents\Arduino\libraries\ArduinoRS485\src\RS485.h:23,
from C:\Users\zhaom\Documents\Arduino\libraries\ArduinoRS485\src\RS485.cpp:20:
C:\Users\zhaom\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.6.3\cores\esp8266/HardwareSerial.h:78:10: error: initializing argument 2 of 'void HardwareSerial::begin(long unsigned int, SerialConfig)' [-fpermissive]
void begin(unsigned long baud, SerialConfig config)
^
C:\Users\zhaom\Documents\Arduino\libraries\ArduinoRS485\src\RS485.cpp: In member function 'void RS485Class::sendBreakMicroseconds(unsigned int)':
C:\Users\zhaom\Documents\Arduino\libraries\ArduinoRS485\src\RS485.cpp:159:36: error: invalid conversion from 'uint16_t {aka short unsigned int}' to 'SerialConfig' [-fpermissive]
_serial->begin(_baudrate, _config);
^
In file included from C:\Users\zhaom\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.6.3\cores\esp8266/Arduino.h:244:0,
from C:\Users\zhaom\Documents\Arduino\libraries\ArduinoRS485\src\RS485.h:23,
from C:\Users\zhaom\Documents\Arduino\libraries\ArduinoRS485\src\RS485.cpp:20:
C:\Users\zhaom\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.6.3\cores\esp8266/HardwareSerial.h:78:10: error: initializing argument 2 of 'void HardwareSerial::begin(long unsigned int, SerialConfig)' [-fpermissive]
void begin(unsigned long baud, SerialConfig config)
^
In file included from C:\Users\zhaom\Documents\Arduino\libraries\ArduinoRS485\src\RS485.cpp:20:0:
C:\Users\zhaom\Documents\Arduino\libraries\ArduinoRS485\src\RS485.cpp: At global scope:
C:\Users\zhaom\Documents\Arduino\libraries\ArduinoRS485\src\RS485.h:35:30: error: 'A6' was not declared in this scope
#define RS845_DEFAULT_DE_PIN A6
^
C:\Users\zhaom\Documents\Arduino\libraries\ArduinoRS485\src\RS485.cpp:169:62: note: in expansion of macro 'RS845_DEFAULT_DE_PIN'
RS485Class RS485(SERIAL_PORT_HARDWARE, RS485_DEFAULT_TX_PIN, RS845_DEFAULT_DE_PIN, RS845_DEFAULT_RE_PIN);
^
C:\Users\zhaom\Documents\Arduino\libraries\ArduinoRS485\src\RS485.h:36:30: error: 'A5' was not declared in this scope
#define RS845_DEFAULT_RE_PIN A5
^
C:\Users\zhaom\Documents\Arduino\libraries\ArduinoRS485\src\RS485.cpp:169:84: note: in expansion of macro 'RS845_DEFAULT_RE_PIN'
RS485Class RS485(SERIAL_PORT_HARDWARE, RS485_DEFAULT_TX_PIN, RS845_DEFAULT_DE_PIN, RS845_DEFAULT_RE_PIN);
^
exit status 1
为开发板 Generic ESP8266 Module 编译时出错。 |