finished freertos unittests, valgrind not happy yet
This commit is contained in:
@ -110,11 +110,13 @@ ReturnValue_t Clock::convertTimeOfDayToTimeval(const TimeOfDay_t* from, timeval*
|
||||
time_tm.tm_min = from->minute;
|
||||
time_tm.tm_sec = from->second;
|
||||
|
||||
time_t seconds = mktime(&time_tm);
|
||||
time_tm.tm_isdst = 0;
|
||||
|
||||
time_t seconds = timegm(&time_tm);
|
||||
|
||||
to->tv_sec = seconds;
|
||||
to->tv_usec = from->usecond;
|
||||
// Fails in 2038..
|
||||
|
||||
return returnvalue::OK;
|
||||
}
|
||||
|
||||
|
@ -552,10 +552,7 @@ ReturnValue_t CCSDSTime::convertFromCDS(timeval* to, const CCSDSTime::CDS_short*
|
||||
if (to == nullptr or from == nullptr) {
|
||||
return returnvalue::FAILED;
|
||||
}
|
||||
uint16_t days = (from->dayMSB << 8) + from->dayLSB;
|
||||
if (days <= DAYS_CCSDS_TO_UNIX_EPOCH) {
|
||||
return INVALID_TIME_FORMAT;
|
||||
}
|
||||
int32_t days = (from->dayMSB << 8) + from->dayLSB;
|
||||
days -= DAYS_CCSDS_TO_UNIX_EPOCH;
|
||||
to->tv_sec = days * SECONDS_PER_DAY;
|
||||
uint32_t msDay =
|
||||
|
Reference in New Issue
Block a user