Skip to content

Commit

Permalink
Fix #161, disable the engine in CF_CFDP_DisableEngine
Browse files Browse the repository at this point in the history
Restores setting a global flag which was mistakenly deleted
in a previous cleanup.
  • Loading branch information
jphickey committed Jan 11, 2022
1 parent b6de205 commit 5900d00
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 5900d00

Please sign in to comment.