make marius the happies man alive

This commit is contained in:
Robin Müller 2024-04-08 10:34:28 +02:00
parent f8e3777c43
commit aff6bb673b
Signed by: muellerr
GPG Key ID: A649FB78196E3849
2 changed files with 5 additions and 3 deletions

View File

@ -52,8 +52,8 @@ ReturnValue_t Service9TimeManagement::handleRequest(uint8_t subservice) {
positiveShift = false;
}
timeval offset{};
offset.tv_sec = std::abs(timeshiftNanos) / 1000000000;
offset.tv_usec = (std::abs(timeshiftNanos) % 1000000000) / 1000;
offset.tv_sec = std::abs(timeshiftNanos) / NANOS_PER_SECOND;
offset.tv_usec = (std::abs(timeshiftNanos) % NANOS_PER_SECOND) / 1000;
timeval newTime;
if (positiveShift) {

View File

@ -7,9 +7,11 @@ class Service9TimeManagement : public PusServiceBase {
public:
static constexpr uint8_t SUBSYSTEM_ID = SUBSYSTEM_ID::PUS_SERVICE_9;
static constexpr uint32_t NANOS_PER_SECOND= 1'000'000'000;
//!< Clock has been set. P1: old timeval seconds. P2: new timeval seconds.
static constexpr Event CLOCK_SET = MAKE_EVENT(0, severity::INFO);
//!< Clock dump event. P1: timeval seconds P2: timeval milliseconds.
//!< Clock dump event. P1: timeval seconds P2: timeval microseconds.
static constexpr Event CLOCK_DUMP = MAKE_EVENT(1, severity::INFO);
//!< Clock could not be set. P1: Returncode.
static constexpr Event CLOCK_SET_FAILURE = MAKE_EVENT(2, severity::LOW);