| Line | Branch | Exec | Source |
|---|---|---|---|
| 1 | // ====================================================================== | ||
| 2 | // \title ProcTime.cpp | ||
| 3 | // \author tumbar | ||
| 4 | // \brief cpp file for ProcTime component implementation class | ||
| 5 | // ====================================================================== | ||
| 6 | |||
| 7 | #include "fprime-samd/Svc/ProcTime/ProcTime.hpp" | ||
| 8 | #include "Fw/Time/Time.hpp" | ||
| 9 | #include "Fw/Time/TimeInterval.hpp" | ||
| 10 | #include "Fw/Types/Assert.hpp" | ||
| 11 | #include "Os/RawTime.hpp" | ||
| 12 | #include "config/OsSelection.hpp" | ||
| 13 | |||
| 14 | namespace Samd21 { | ||
| 15 | |||
| 16 | // ---------------------------------------------------------------------- | ||
| 17 | // Component construction and destruction | ||
| 18 | // ---------------------------------------------------------------------- | ||
| 19 | |||
| 20 | 3 | ProcTime::ProcTime(const char* const compName) : ProcTimeComponentBase(compName) {} | |
| 21 | |||
| 22 | 6 | ProcTime::~ProcTime() {} | |
| 23 | |||
| 24 | // ---------------------------------------------------------------------- | ||
| 25 | // Handler implementations for typed input ports | ||
| 26 | // ---------------------------------------------------------------------- | ||
| 27 | |||
| 28 | 103 | void ProcTime::getTime_handler(FwIndexType portNum, Fw::Time& time) { | |
| 29 |
1/2✓ Branch 2 taken 103 times.
✗ Branch 3 not taken.
|
103 | Os::RawTime now; |
| 30 |
1/2✓ Branch 2 taken 103 times.
✗ Branch 3 not taken.
|
103 | auto status = now.now(); |
| 31 |
1/2✗ Branch 0 not taken.
✓ Branch 1 taken 103 times.
|
103 | FW_ASSERT(status == Os::RawTimeInterface::Status::OP_OK, status); |
| 32 | |||
| 33 |
1/2✓ Branch 2 taken 103 times.
✗ Branch 3 not taken.
|
103 | const Os::RawTime ref_time; |
| 34 | |||
| 35 |
1/2✓ Branch 2 taken 103 times.
✗ Branch 3 not taken.
|
103 | Fw::TimeInterval proc_time; |
| 36 |
1/2✓ Branch 2 taken 103 times.
✗ Branch 3 not taken.
|
103 | status = now.getTimeInterval(ref_time, proc_time); |
| 37 |
1/2✗ Branch 0 not taken.
✓ Branch 1 taken 103 times.
|
103 | FW_ASSERT(status == Os::RawTimeInterface::Status::OP_OK, status); |
| 38 | |||
| 39 |
5/10✓ Branch 3 taken 103 times.
✗ Branch 4 not taken.
✓ Branch 7 taken 103 times.
✗ Branch 8 not taken.
✓ Branch 11 taken 103 times.
✗ Branch 12 not taken.
✓ Branch 14 taken 103 times.
✗ Branch 15 not taken.
✓ Branch 21 taken 103 times.
✗ Branch 22 not taken.
|
103 | time = Fw::Time(TimeBase::TB_PROC_TIME, proc_time.getSeconds(), proc_time.getUSeconds()); |
| 40 | 206 | } | |
| 41 | |||
| 42 | } // namespace Samd21 | ||
| 43 |