0001-some-fixes-for-FreeMODBUS-and-MODBUS-example.patch from Freddi Chopin

git-svn-id: http://svn.code.sf.net/p/nuttx/code/trunk@5372 42af7a65-404d-4744-a932-0658087f49c3
This commit is contained in:
patacongo 2012-11-20 13:36:07 +00:00
parent 2754c39e6e
commit 6833671f0c
2 changed files with 4 additions and 2 deletions

View File

@ -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

View File

@ -99,7 +99,7 @@ static xMBFunctionHandler xFuncHandlers[CONFIG_MB_FUNC_HANDLERS_MAX] = {
#ifdef CONFIG_MB_FUNC_OTHER_REP_SLAVEID_ENABLED
{MB_FUNC_OTHER_REPORT_SLAVEID, eMBFuncReportSlaveID},
#endif
#ifdef CONFIG_MB_FUNC_READ_INPUT_ENABLE
#ifdef CONFIG_MB_FUNC_READ_INPUT_ENABLED
{MB_FUNC_READ_INPUT_REGISTER, eMBFuncReadInputRegister},
#endif
#ifdef CONFIG_MB_FUNC_READ_HOLDING_ENABLED