moved TCScheduling Service to use timeval internally #735

Open
mohr wants to merge 7 commits from mohr/timetag_fix into development
1 changed files with 4 additions and 1 deletions
Showing only changes of commit cf47d2079f - Show all commits

View File

@ -167,7 +167,10 @@ inline ReturnValue_t Service11TelecommandScheduling<MAX_NUM_TCS>::doInsertActivi
Clock::getClock_timeval(&tNow);
timeval timeDifference = scheduledTime - tNow;
// round subseconds up
if (timeDifference.tv_sec + 1 <= RELEASE_TIME_MARGIN_SECONDS) {
if (timeDifference.tv_usec != 0) {

Is timeval guaranteed to be signed?
This also rounds up when subsecond micros are 0, is this intended?

Is timeval guaranteed to be signed? This also rounds up when subsecond micros are 0, is this intended?
Outdated
Review
  1. Yes, timeval is using time_t in unixoides and long in windows.
  2. Admittedly I was lazy, I will change it so that 0 does not round up.
1) Yes, timeval is using time_t in unixoides and long in windows. 2) Admittedly I was lazy, I will change it so that 0 does not round up.

Can we use timestamp <= tNow.tv_sec + RELEASE_TIME_MARGIN_SECONDS compare logic instead?

That is a bit more readable in my opinion.

Can we use `timestamp <= tNow.tv_sec + RELEASE_TIME_MARGIN_SECONDS` compare logic instead? That is a bit more readable in my opinion.
Outdated
Review

Changed rounding to be correct.
The unreadable comparison is removed with this PR.

Changed rounding to be correct. The unreadable comparison is removed with this PR.
timeDifference.tv_sec++;
}
if (timeDifference.tv_sec <= RELEASE_TIME_MARGIN_SECONDS) {
#if FSFW_CPP_OSTREAM_ENABLED == 1
sif::warning << "Service11TelecommandScheduling::doInsertActivity: Release time too close to "
"current time"