From 5900d00aedd8004b7d0507e28b165090ead29426 Mon Sep 17 00:00:00 2001 From: Joseph Hickey Date: Tue, 11 Jan 2022 11:08:22 -0500 Subject: [PATCH] Fix #161, disable the engine in CF_CFDP_DisableEngine Restores setting a global flag which was mistakenly deleted in a previous cleanup. --- fsw/src/cf_cfdp.c | 2 ++ unit-test/cf_cfdp_tests.c | 2 ++ 2 files changed, 4 insertions(+) diff --git a/fsw/src/cf_cfdp.c b/fsw/src/cf_cfdp.c index 4196a4db..24ed0a28 100644 --- a/fsw/src/cf_cfdp.c +++ b/fsw/src/cf_cfdp.c @@ -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]; diff --git a/unit-test/cf_cfdp_tests.c b/unit-test/cf_cfdp_tests.c index 7925ceb9..242fceff 100644 --- a/unit-test/cf_cfdp_tests.c +++ b/unit-test/cf_cfdp_tests.c @@ -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;