| 42 | : mLatchMs(latchMs), mRisingTime(risingTime), mFallingTime(fallingTime) {} |
| 43 | |
| 44 | bool TimeRamp::isActive(u32 now) const FL_NOEXCEPT { |
| 45 | |
| 46 | bool not_started = (mFinishedRisingTime == 0) && |
| 47 | (mFinishedPlateauTime == 0) && |
| 48 | (mFinishedFallingTime == 0); |
| 49 | if (not_started) { |
| 50 | // if we have not started, we are not active |
| 51 | return false; |
| 52 | } |
| 53 | |
| 54 | if (now < mStart) { |
| 55 | // if the time is before the start, we are not active |
| 56 | return false; |
| 57 | } |
| 58 | |
| 59 | if (now > mFinishedFallingTime) { |
| 60 | // if the time is after the finished rising, we are not active |
| 61 | return false; |
| 62 | } |
| 63 | |
| 64 | return true; |
| 65 | } |
| 66 | |
| 67 | RampPhase TimeRamp::getCurrentPhase(u32 now) const FL_NOEXCEPT { |
| 68 | if (!isActive(now)) { |
no outgoing calls
no test coverage detected