From 8c0474bfc9059fa10f50792680b683b3266413e6 Mon Sep 17 00:00:00 2001 From: patacongo Date: Tue, 20 Nov 2012 13:36:07 +0000 Subject: 0001-some-fixes-for-FreeMODBUS-and-MODBUS-example.patch from Freddi Chopin git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@5372 42af7a65-404d-4744-a932-0658087f49c3 --- apps/examples/modbus/modbus_main.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'apps/examples/modbus') 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 -- cgit v1.2.3