diff options
Diffstat (limited to 'apps/examples')
-rw-r--r-- | apps/examples/modbus/modbus_main.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/apps/examples/modbus/modbus_main.c b/apps/examples/modbus/modbus_main.c index 13967f6fd..2247fd675 100644 --- a/apps/examples/modbus/modbus_main.c +++ b/apps/examples/modbus/modbus_main.c @@ -217,7 +217,7 @@ static inline int modbus_initialize(void) /* Enable FreeModBus */ mberr = eMBEnable(); - if (mberr == MB_ENOERR) + if (mberr != MB_ENOERR) { fprintf(stderr, "modbus_main: " "ERROR: eMBEnable failed: %d\n", mberr); @@ -267,6 +267,8 @@ static void *modbus_pollthread(void *pvarg) return NULL; } + srand(time(NULL)); + /* Then loop until we are commanded to shutdown */ do |