Skip to content

Commit b5a6775

Browse files
Update RS485CommClass.cpp
Added RS485Config
1 parent a5727ca commit b5a6775

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/RS485CommClass.cpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ RS485CommClass::RS485CommClass(arduino::UART& uart_itf, PinName rs_tx_pin, PinNa
1717
RS485CommClass::~RS485CommClass()
1818
{ }
1919

20-
void RS485CommClass::begin(unsigned long baudrate, int predelay, int postdelay) {
20+
void RS485CommClass::begin(unsigned long baudrate, uint16_t config = SERIAL_8N1, int predelay, int postdelay) {
2121
/* Pinout configuration */
2222
pinMode(PinNameToIndex(MC_RS485_TX_PIN), OUTPUT);
2323
pinMode(PinNameToIndex(MC_RS485_RX_PIN), OUTPUT);
@@ -45,7 +45,7 @@ void RS485CommClass::begin(unsigned long baudrate, int predelay, int postdelay)
4545
_enable();
4646

4747
/* Call begin() base class to initialize RS485 communication */
48-
RS485Class::begin(baudrate, predelay, postdelay);
48+
RS485Class::begin(baudrate, config, predelay, postdelay);
4949

5050
return;
5151
}
@@ -92,4 +92,4 @@ void RS485CommClass::_disable() {
9292

9393
arduino::UART _UART4_ {MC_RS485_TX_PIN, MC_RS485_RX_PIN, NC, NC};
9494
RS485CommClass MachineControl_RS485Comm(_UART4_);
95-
/**** END OF FILE ****/
95+
/**** END OF FILE ****/

0 commit comments

Comments
 (0)