Skip to content

Commit

Permalink
Replaced periodic with oneshot timer to store mapped status
Browse files Browse the repository at this point in the history
  • Loading branch information
leanfrancucci committed Oct 20, 2020
1 parent 0c13f62 commit 54ca36b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
12 changes: 6 additions & 6 deletions src/Collector/src/CollectorAct.c
Original file line number Diff line number Diff line change
Expand Up @@ -326,9 +326,9 @@ Mapping_enStopped(Mapping *const me)
RKH_SET_STATIC_EVENT(&me->syncStoppedTmr, evToutSyncStopped);
RKH_TMR_INIT(&me->syncStoppedTmr.tmr,
RKH_UPCAST(RKH_EVT_T, &me->syncStoppedTmr), NULL);
RKH_TMR_PERIODIC(&me->syncStoppedTmr.tmr,
RKH_UPCAST(RKH_SMA_T, me->itsCollector),
nTicks, nTicks);
RKH_TMR_ONESHOT(&me->syncStoppedTmr.tmr,
RKH_UPCAST(RKH_SMA_T, me->itsCollector),
nTicks);
setMappingStatus(me, MAPPING_STOP);
bsp_workStatusLed(SEQ_NO_LIT);
}
Expand All @@ -342,9 +342,9 @@ Mapping_enRunning(Mapping *const me)
RKH_SET_STATIC_EVENT(&me->syncRunningTmr.evt, evToutSyncRunning);
RKH_TMR_INIT(&me->syncRunningTmr.tmr,
RKH_UPCAST(RKH_EVT_T, &me->syncRunningTmr), NULL);
RKH_TMR_PERIODIC(&me->syncRunningTmr.tmr,
RKH_UPCAST(RKH_SMA_T, me->itsCollector),
nTicks, nTicks);
RKH_TMR_ONESHOT(&me->syncRunningTmr.tmr,
RKH_UPCAST(RKH_SMA_T, me->itsCollector),
nTicks);
setMappingStatus(me, MAPPING_RUNNING);
bsp_workStatusLed(SEQ_LIT);
}
Expand Down
4 changes: 2 additions & 2 deletions src/Collector/test/test_CollectorAct.c
Original file line number Diff line number Diff line change
Expand Up @@ -380,7 +380,7 @@ test_StartAndStopSyncStoppedTmr(void)
RKH_UPCAST(RKH_EVT_T, &region->syncStoppedTmr));
rkh_tmr_start_Expect(&region->syncStoppedTmr.tmr,
RKH_UPCAST(RKH_SMA_T, me),
RKH_TIME_SEC(60), RKH_TIME_SEC(60));
RKH_TIME_SEC(60), 0);
bsp_workStatusLed_Expect(SEQ_NO_LIT);

Mapping_enStopped(region);
Expand Down Expand Up @@ -432,7 +432,7 @@ test_StartAndStopSyncRunningTmr(void)
RKH_UPCAST(RKH_EVT_T, &region->syncRunningTmr));
rkh_tmr_start_Expect(&region->syncRunningTmr.tmr,
RKH_UPCAST(RKH_SMA_T, me),
RKH_TIME_SEC(3), RKH_TIME_SEC(3));
RKH_TIME_SEC(3), 0);
bsp_workStatusLed_Expect(SEQ_LIT);

Mapping_enRunning(region);
Expand Down

0 comments on commit 54ca36b

Please sign in to comment.