File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed
Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -821,7 +821,7 @@ int8_t Modbus::poll( uint16_t *regs, uint8_t u8size )
821821void Modbus::init (uint8_t u8id, uint8_t u8serno, uint8_t u8txenpin)
822822{
823823 this ->u8id = u8id;
824- this ->u8serno = (u8serno > 3 ) ? 0 : u8serno;
824+ this ->u8serno = u8serno;
825825 this ->u8txenpin = u8txenpin;
826826 this ->u16timeOut = 1000 ;
827827}
@@ -920,9 +920,10 @@ void Modbus::sendTxBuffer()
920920 break ;
921921#endif
922922 case 0 :
923- default :
924923 UCSR0A=UCSR0A |(1 << TXC0);
925924 break ;
925+ default :
926+ break ;
926927 }
927928 digitalWrite ( u8txenpin, HIGH );
928929 }
@@ -956,9 +957,10 @@ void Modbus::sendTxBuffer()
956957 break ;
957958#endif
958959 case 0 :
959- default :
960960 while (!(UCSR0A & (1 << TXC0)));
961961 break ;
962+ default :
963+ break ;
962964 }
963965
964966 // return RS485 transceiver to receive mode
You can’t perform that action at this time.
0 commit comments