diff --git a/inc/Services/TimeManagementService.hpp b/inc/Services/TimeManagementService.hpp index bcbb6add642c22d2ecd7ab69a932e05974415e56..ede1b64bc66284ca93e263d70668236ac7638a4e 100644 --- a/inc/Services/TimeManagementService.hpp +++ b/inc/Services/TimeManagementService.hpp @@ -50,7 +50,7 @@ public: void cdsTimeReport(struct TimeAndDate &TimeInfo); - /** + /** * TC[9,128] CDS time request * * This function is a custom subservice(mission specific) with message type 128(as defined @@ -58,12 +58,11 @@ public: * time-management telecommand packet. This data is formatted according to the CDS time code * format(check class `TimeHelper` for the format) * - * @param timeData the data of the parsed space packet for the ST[09] time management - * @param length the size of the time data + * @param timeData the data of the parsed space packet for the ST[09] time management + * @param length the size of the time data */ struct TimeAndDate cdsTimeRequest(Message &message); }; #endif //ECSS_SERVICES_TIMEMANAGEMENTSERVICE_HPP - diff --git a/src/Helpers/TimeHelper.cpp b/src/Helpers/TimeHelper.cpp index efda93d55807d44fa4c1d2d62361424996a31319..130f92132b3dd84efa39683536dc43197e1f8c83 100644 --- a/src/Helpers/TimeHelper.cpp +++ b/src/Helpers/TimeHelper.cpp @@ -36,7 +36,7 @@ struct TimeAndDate TimeHelper::utcTime(uint32_t seconds) { TimeInfo.second = 0; // calculate years - while (seconds >= (IsLeapYear(TimeInfo.year) ? 366 : 365) * SecondsPerDay ) { + while (seconds >= (IsLeapYear(TimeInfo.year) ? 366 : 365) * SecondsPerDay) { TimeInfo.year++; seconds -= (IsLeapYear(TimeInfo.year) ? 366 : 365) * SecondsPerDay; } @@ -45,9 +45,9 @@ struct TimeAndDate TimeHelper::utcTime(uint32_t seconds) { uint8_t i = 0; while (seconds >= (DaysOfMonth[i] * SecondsPerDay)) { TimeInfo.month++; - seconds -= (DaysOfMonth[i] * SecondsPerDay); + seconds -= (DaysOfMonth[i] * SecondsPerDay); i++; - if (i == 1 && (seconds >= (IsLeapYear(TimeInfo.year) ? 29 : 28) * SecondsPerDay)) { + if (i == 1 && (seconds >= (IsLeapYear(TimeInfo.year) ? 29 : 28) * SecondsPerDay)) { TimeInfo.month++; seconds -= (IsLeapYear(TimeInfo.year) ? 29 : 28) * SecondsPerDay; i++; @@ -55,19 +55,19 @@ struct TimeAndDate TimeHelper::utcTime(uint32_t seconds) { } // calculate days - while(seconds >= SecondsPerDay){ + while (seconds >= SecondsPerDay) { TimeInfo.day++; seconds -= SecondsPerDay; } // calculate hours - while(seconds >= SecondsPerHour){ + while (seconds >= SecondsPerHour) { TimeInfo.hour++; seconds -= SecondsPerHour; } // calculate minutes - while(seconds >= SecondsPerMinute){ + while (seconds >= SecondsPerMinute) { TimeInfo.minute++; seconds -= SecondsPerMinute; }