diff options
author | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2012-11-20 13:36:07 +0000 |
---|---|---|
committer | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2012-11-20 13:36:07 +0000 |
commit | 8c0474bfc9059fa10f50792680b683b3266413e6 (patch) | |
tree | 8890d3b19d49b96252d17192f135ff0823966eba /apps/examples/modbus/modbus_main.c | |
parent | 0f775d5711a3b6cf2815ab3cbd9da580a587d2df (diff) | |
download | nuttx-8c0474bfc9059fa10f50792680b683b3266413e6.tar.gz nuttx-8c0474bfc9059fa10f50792680b683b3266413e6.tar.bz2 nuttx-8c0474bfc9059fa10f50792680b683b3266413e6.zip |
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
Diffstat (limited to 'apps/examples/modbus/modbus_main.c')
-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 |