Skip to content

Commit

Permalink
Merge pull request thiagoralves#171 from koztkozt/patch-2
Browse files Browse the repository at this point in the history
Fix "floating point exception" error
  • Loading branch information
thiagoralves authored Mar 22, 2022
2 parents d8853e0 + 950ce6b commit e6c38a4
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion webserver/core/modbus_master.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -418,7 +418,14 @@ void *querySlaveDevices(void *arg)

struct timespec ts;
ts.tv_sec = 0;
ts.tv_nsec = (1000*1000*1000*28)/mb_devices[i].rtu_baud;
if (mb_devices[i].protocol == MB_RTU)
{
ts.tv_nsec = (1000*1000*1000*28)/mb_devices[i].rtu_baud;
}
else
{
ts.tv_nsec = 0;
}

//Read discrete inputs
if (mb_devices[i].discrete_inputs.num_regs != 0)
Expand Down

0 comments on commit e6c38a4

Please sign in to comment.