diff --git a/fsw/src/cf_cfdp.c b/fsw/src/cf_cfdp.c index 8bda16bf..7cba8603 100644 --- a/fsw/src/cf_cfdp.c +++ b/fsw/src/cf_cfdp.c @@ -1479,21 +1479,19 @@ static void CF_CFDP_ProcessPlaybackDirectories(CF_Channel_t *chan) *-----------------------------------------------------------------*/ void CF_CFDP_ProcessPollingDirectories(CF_Channel_t *chan) { - CF_Poll_t * poll; + CF_Poll_t *poll; CF_ChannelConfig_t *cc; - CF_PollDir_t * pd; + CF_PollDir_t *pd; int i; int chan_index; - int count_check; - int ret; + + chan_index = (chan - CF_AppData.engine.channels); + cc = &CF_AppData.config_table->chan[chan_index]; for (i = 0; i < CF_MAX_POLLING_DIR_PER_CHAN; ++i) { - poll = &chan->poll[i]; - chan_index = (chan - CF_AppData.engine.channels); - cc = &CF_AppData.config_table->chan[chan_index]; - pd = &cc->polldir[i]; - count_check = 0; + poll = &chan->poll[i]; + pd = &cc->polldir[i]; if (pd->enabled) { @@ -1508,9 +1506,8 @@ void CF_CFDP_ProcessPollingDirectories(CF_Channel_t *chan) else if (CF_Timer_Expired(&poll->interval_timer)) { /* the timer has expired */ - ret = CF_CFDP_PlaybackDir_Initiate(&poll->pb, pd->src_dir, pd->dst_dir, pd->cfdp_class, 0, - chan_index, pd->priority, pd->dest_eid); - if (!ret) + if (!CF_CFDP_PlaybackDir_Initiate(&poll->pb, pd->src_dir, pd->dst_dir, pd->cfdp_class, 0, + chan_index, pd->priority, pd->dest_eid)) { poll->timer_set = 0; } @@ -1532,11 +1529,9 @@ void CF_CFDP_ProcessPollingDirectories(CF_Channel_t *chan) /* playback is active, so step it */ CF_CFDP_ProcessPlaybackDirectory(chan, &poll->pb); } - - count_check = 1; } - CF_CFDP_UpdatePollPbCounted(&poll->pb, count_check, &CF_AppData.hk.Payload.channel_hk[chan_index].poll_counter); + CF_CFDP_UpdatePollPbCounted(&poll->pb, pd->enabled, &CF_AppData.hk.Payload.channel_hk[chan_index].poll_counter); } } @@ -1902,4 +1897,4 @@ void CF_CFDP_MoveFile(const char *src, const char *dest_dir) { OS_remove(src); } -} \ No newline at end of file +}