modbus_tcp

fix casting of registers from payload
This commit is contained in:
2023-11-28 18:24:19 +01:00
parent 3fcb117b73
commit 5812dce80b

View File

@@ -62,7 +62,7 @@ static err_t modbus_incoming_data(void* arg, struct tcp_pcb* pcb, struct pbuf* p
// Putting the buffer in the register array
for (uint16_t i = 0; i < p->tot_len && i < MAX_REG; i++) {
registers[i] = ((uint*)p->payload)[i];
registers[i] = ((uint8_t*)p->payload)[i];
}
if (registers[MODBUS_MODE] == MULTIPLE_REG) {