From b17dd0673300dd9b1019ea054819f6e90f2784f5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mario=20H=C3=BCttel?= Date: Mon, 27 Apr 2020 17:49:10 +0200 Subject: [PATCH] Call continuous function even if there is no data --- src/shellmatta.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/src/shellmatta.c b/src/shellmatta.c index 7ad8ea6..d13d7d4 100644 --- a/src/shellmatta.c +++ b/src/shellmatta.c @@ -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++)