File tree Expand file tree Collapse file tree 1 file changed +2
-2
lines changed
Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -1278,7 +1278,7 @@ int CSE_ModbusRTU_Server:: poll() {
12781278 uint8_t byteCount = request.getByte (MODBUS_RTU_ADU_DATA_INDEX + 4 ); // Get the byte count
12791279
12801280 // Now we need to copy the coil data from the request ADU
1281- for (int i, j = 0 ; i < byteCount; i++) {
1281+ for (int i = 0 , j = 0 ; i < byteCount; i++) {
12821282 for (int k = 0 ; ((k < 8 ) && (j < request.getQuantity ())); k++) {
12831283 coilData [j] = (request.getByte (MODBUS_RTU_ADU_DATA_INDEX + 5 + i) >> k) & 0x01 ;
12841284 j++;
@@ -1331,7 +1331,7 @@ int CSE_ModbusRTU_Server:: poll() {
13311331 uint8_t byteCount = request.getByte (MODBUS_RTU_ADU_DATA_INDEX + 4 ); // Get the byte count
13321332
13331333 // Now we need to copy the holding register data from the request ADU
1334- for (int i, j = 0 ; i < byteCount; i += 2 ) {
1334+ for (int i = 0 , j = 0 ; i < byteCount; i += 2 ) {
13351335 holdingRegisterData [j] = request.getWord (MODBUS_RTU_ADU_DATA_INDEX + 5 + i);
13361336 j++;
13371337 }
You can’t perform that action at this time.
0 commit comments