Skip to content

Commit

Permalink
Fix nasa#2084, Add support for fractional seconds in epoch
Browse files Browse the repository at this point in the history
  • Loading branch information
Jonathan Brandenburg committed Apr 20, 2022
1 parent 1725460 commit 8fece66
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions modules/time/fsw/src/cfe_time_api.c
Original file line number Diff line number Diff line change
Expand Up @@ -622,10 +622,10 @@ void CFE_TIME_Print(char *PrintBuffer, CFE_TIME_SysTime_t TimeToPrint)
NumberOfMicros = CFE_TIME_Sub2MicroSecs(TimeToPrint.Subseconds) + CFE_MISSION_TIME_EPOCH_MICROS;

NumberOfMinutes = (NumberOfMicros / 60000000) + (TimeToPrint.Seconds / 60) + CFE_MISSION_TIME_EPOCH_MINUTE;
NumberOfMicros = NumberOfMicros % 60000000;
NumberOfMicros = NumberOfMicros % 60000000;

NumberOfSeconds = (NumberOfMicros / 1000000) + (TimeToPrint.Seconds % 60) + CFE_MISSION_TIME_EPOCH_SECOND;
NumberOfMicros = NumberOfMicros % 1000000;
NumberOfMicros = NumberOfMicros % 1000000;
/*
** Adding the epoch "seconds" after computing the minutes avoids
** overflow problems when the input time value (seconds) is
Expand Down

0 comments on commit 8fece66

Please sign in to comment.