whitespaces instead of tabs
This commit is contained in:
parent
21a7fd621d
commit
d66e486f16
@ -157,8 +157,8 @@ ReturnValue_t CCSDSTime::convertFromASCII(Clock::TimeOfDay_t* to,
|
|||||||
if (length < 19) {
|
if (length < 19) {
|
||||||
return RETURN_FAILED;
|
return RETURN_FAILED;
|
||||||
}
|
}
|
||||||
// Newlib nano can't parse uint8, see SCNu8 documentation and https://sourceware.org/newlib/README
|
// Newlib nano can't parse uint8, see SCNu8 documentation and https://sourceware.org/newlib/README
|
||||||
// Suggestion: use uint16 all the time. This should work on all systems.
|
// Suggestion: use uint16 all the time. This should work on all systems.
|
||||||
#if FSFW_NO_C99_IO == 1
|
#if FSFW_NO_C99_IO == 1
|
||||||
uint16_t year;
|
uint16_t year;
|
||||||
uint16_t month;
|
uint16_t month;
|
||||||
@ -200,8 +200,8 @@ ReturnValue_t CCSDSTime::convertFromASCII(Clock::TimeOfDay_t* to,
|
|||||||
to->usecond = (second - floor(second)) * 1000000;
|
to->usecond = (second - floor(second)) * 1000000;
|
||||||
return RETURN_OK;
|
return RETURN_OK;
|
||||||
}
|
}
|
||||||
// Warning: Compiler/Linker fails ambiguously if library does not implement
|
// Warning: Compiler/Linker fails ambiguously if library does not implement
|
||||||
// C99 I/O
|
// C99 I/O
|
||||||
#else
|
#else
|
||||||
uint16_t year;
|
uint16_t year;
|
||||||
uint8_t month;
|
uint8_t month;
|
||||||
@ -494,7 +494,7 @@ ReturnValue_t CCSDSTime::checkTimeOfDay(const Clock::TimeOfDay_t* time) {
|
|||||||
|
|
||||||
ReturnValue_t CCSDSTime::convertTimevalToTimeOfDay(Clock::TimeOfDay_t* to,
|
ReturnValue_t CCSDSTime::convertTimevalToTimeOfDay(Clock::TimeOfDay_t* to,
|
||||||
timeval* from) {
|
timeval* from) {
|
||||||
//This is rather tricky. Implement only if needed. Also, if so, move to OSAL.
|
//This is rather tricky. Implement only if needed. Also, if so, move to OSAL.
|
||||||
return UNSUPPORTED_TIME_FORMAT;
|
return UNSUPPORTED_TIME_FORMAT;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -502,11 +502,11 @@ ReturnValue_t CCSDSTime::convertFromCDS(timeval* to, const uint8_t* from,
|
|||||||
size_t* foundLength, size_t maxLength) {
|
size_t* foundLength, size_t maxLength) {
|
||||||
uint8_t pField = *from;
|
uint8_t pField = *from;
|
||||||
from++;
|
from++;
|
||||||
//Check epoch
|
//Check epoch
|
||||||
if (pField & 0b1000) {
|
if (pField & 0b1000) {
|
||||||
return NOT_ENOUGH_INFORMATION_FOR_TARGET_FORMAT;
|
return NOT_ENOUGH_INFORMATION_FOR_TARGET_FORMAT;
|
||||||
}
|
}
|
||||||
//Check length
|
//Check length
|
||||||
uint8_t expectedLength = 7; //Including p-Field.
|
uint8_t expectedLength = 7; //Including p-Field.
|
||||||
bool extendedDays = pField & 0b100;
|
bool extendedDays = pField & 0b100;
|
||||||
if (extendedDays) {
|
if (extendedDays) {
|
||||||
@ -523,7 +523,7 @@ ReturnValue_t CCSDSTime::convertFromCDS(timeval* to, const uint8_t* from,
|
|||||||
if (expectedLength > maxLength) {
|
if (expectedLength > maxLength) {
|
||||||
return LENGTH_MISMATCH;
|
return LENGTH_MISMATCH;
|
||||||
}
|
}
|
||||||
//Check and count days
|
//Check and count days
|
||||||
uint32_t days = 0;
|
uint32_t days = 0;
|
||||||
if (extendedDays) {
|
if (extendedDays) {
|
||||||
days = (from[0] << 16) + (from[1] << 8) + from[2];
|
days = (from[0] << 16) + (from[1] << 8) + from[2];
|
||||||
@ -532,7 +532,7 @@ ReturnValue_t CCSDSTime::convertFromCDS(timeval* to, const uint8_t* from,
|
|||||||
days = (from[0] << 8) + from[1];
|
days = (from[0] << 8) + from[1];
|
||||||
from += 2;
|
from += 2;
|
||||||
}
|
}
|
||||||
//Move to POSIX epoch.
|
//Move to POSIX epoch.
|
||||||
if (days <= DAYS_CCSDS_TO_UNIX_EPOCH) {
|
if (days <= DAYS_CCSDS_TO_UNIX_EPOCH) {
|
||||||
return INVALID_TIME_FORMAT;
|
return INVALID_TIME_FORMAT;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user