Browse Source

fixed ymodem poll cycles

stefan 9 months ago
parent
commit
f85d99b8a1
2 changed files with 1 additions and 3 deletions
  1. 1 1
      src/shellmatta_ymodem.c
  2. 0 2
      test/integrationtest/test_integration_ymodem.cpp

+ 1 - 1
src/shellmatta_ymodem.c

@@ -292,7 +292,7 @@ shellmatta_retCode_t shellmatta_ymodem_poll(shellmatta_handle_t handle)
         ret = SHELLMATTA_OK;
         ret = SHELLMATTA_OK;
         break;
         break;
     case SHELLMATTA_YMODEM_WAIT_FOR_END:
     case SHELLMATTA_YMODEM_WAIT_FOR_END:
-        if(0u != inst->ymodem.pollCyclesLeft)
+        if(inst->ymodem.pollCyclesLeft > 1u)
         {
         {
             inst->ymodem.pollCyclesLeft --;
             inst->ymodem.pollCyclesLeft --;
         }
         }

+ 0 - 2
test/integrationtest/test_integration_ymodem.cpp

@@ -209,8 +209,6 @@ SCENARIO("Test successful transmissions in ymodem")
                         CHECK(ret == SHELLMATTA_OK);
                         CHECK(ret == SHELLMATTA_OK);
                         ret = shellmatta_processData(handle, (char*)"", 0);
                         ret = shellmatta_processData(handle, (char*)"", 0);
                         CHECK(ret == SHELLMATTA_OK);
                         CHECK(ret == SHELLMATTA_OK);
-                        ret = shellmatta_processData(handle, (char*)"", 0);
-                        CHECK(ret == SHELLMATTA_OK);
 
 
                         THEN("The transmission finishes successfully")
                         THEN("The transmission finishes successfully")
                         {
                         {