distortos  v0.4.0
object-oriented C++ RTOS for microcontrollers
distortos::test::anonymous_namespace{SoftwareTimerPeriodicTestCase.cpp} Namespace Reference


void softwareTimerFunction (SequenceAsserter &sequenceAsserter, uint32_t &counter, const uint8_t period)
 Function executed by software timers during the test case. More...


constexpr TickClock::duration testCaseDuration {100}
 duration of whole test case More...
constexpr size_t totalSoftwareTimers {8}
 total number of software timers used in test case More...

Function Documentation

◆ softwareTimerFunction()

void distortos::test::anonymous_namespace{SoftwareTimerPeriodicTestCase.cpp}::softwareTimerFunction ( SequenceAsserter sequenceAsserter,
uint32_t &  counter,
const uint8_t  period 

Function executed by software timers during the test case.

Calculates next sequence point using its own period and cycle counter. The calculation of sequence point assumes that timers with longer period have priority over timers with shorter period (they were queued earlier). Own period and own counter are used to calculate global iteration count. This value can be used to calculate how many times this function was already executed:

  • for timers with longer period - global iteration count divided by period of analyzed timer
  • for timers with shorter or equal period - global iteration count minus one, divided by period of analyzed timer

Next sequence point is the sum of times this function was executed for all analyzed timers.

Expected sequence looks like this: [global iteration]: [periods of timers that will be executed] 1: 1 2: 2, 1 3: 3, 1 4: 4, 2, 1 5: 5, 1 6: 6, 3, 2, 1 7: 7, 1 8: 8, 4, 2, 1 ...

[in]sequenceAsserteris a reference to SequenceAsserter shared object
[in]counteris a reference to counter for this instance
[in]periodis the period of this instance, system ticks
Here is the call graph for this function:
Here is the caller graph for this function:

Variable Documentation

◆ testCaseDuration

constexpr TickClock::duration distortos::test::anonymous_namespace{SoftwareTimerPeriodicTestCase.cpp}::testCaseDuration {100}

duration of whole test case

◆ totalSoftwareTimers

constexpr size_t distortos::test::anonymous_namespace{SoftwareTimerPeriodicTestCase.cpp}::totalSoftwareTimers {8}

total number of software timers used in test case