Call continuous function even if there is no data

This commit is contained in:
Mario Hüttel 2020-04-27 17:49:10 +02:00
parent ebf65d7448
commit b17dd06733
1 changed files with 20 additions and 0 deletions

View File

@ -401,6 +401,26 @@ shellmatta_retCode_t shellmatta_processData(shellmatta_handle_t handle,
ret = cmdRet;
}
}
/** -# call continuous function even if there is no data */
else if((0u != size) && (NULL != inst->continuousCmd))
{
/** -# just call the function until it is not busy anymore */
cmdRet = inst->continuousCmd->cmdFct(handle, inst->buffer, size);
if(SHELLMATTA_CONTINUE == cmdRet)
{
ret = cmdRet;
}
else if(SHELLMATTA_BUSY == cmdRet)
{
inst->busyCmd = inst->continuousCmd;
inst->continuousCmd = NULL;
}
else
{
utils_terminateInput(inst);
}
}
/** -# process byte wise */
for (; (inst->byteCounter < size) && (NULL == inst->busyCmd); inst->byteCounter++)