Skip to content

Commit

Permalink
Merge pull request nasa#162 from jphickey/fix-161-disable-engine
Browse files Browse the repository at this point in the history
Fix nasa#161, disable the engine in CF_CFDP_DisableEngine
  • Loading branch information
astrogeco authored Jan 11, 2022
2 parents b6de205 + 5900d00 commit c0b1f53
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions fsw/src/cf_cfdp.c
Original file line number Diff line number Diff line change
Expand Up @@ -1921,6 +1921,8 @@ void CF_CFDP_DisableEngine(void)
static const CF_QueueIdx_t CLOSE_QUEUES[] = {CF_QueueIdx_RX, CF_QueueIdx_TXA, CF_QueueIdx_TXW};
CF_Channel_t *c;

CF_AppData.engine.enabled = 0;

for (i = 0; i < CF_NUM_CHANNELS; ++i)
{
c = &CF_AppData.engine.channels[i];
Expand Down
2 changes: 2 additions & 0 deletions unit-test/cf_cfdp_tests.c
Original file line number Diff line number Diff line change
Expand Up @@ -1351,8 +1351,10 @@ void Test_CF_CFDP_DisableEngine(void)
*/

/* nominal call */
CF_AppData.engine.enabled = 1;
UtAssert_VOIDCALL(CF_CFDP_DisableEngine());
UtAssert_STUB_COUNT(CFE_SB_DeletePipe, CF_NUM_CHANNELS);
UtAssert_BOOL_FALSE(CF_AppData.engine.enabled);

/* nominal call with playbacks and polls active */
CF_AppData.engine.channels[UT_CFDP_CHANNEL].playback[0].busy = 1;
Expand Down

0 comments on commit c0b1f53

Please sign in to comment.