TaskManagerIO
Loading...
Searching...
No Matches
SimulatedTaskManager Class Reference

#include <MockTaskManager.h>

Inheritance diagram for SimulatedTaskManager:
TaskManager

Public Member Functions

void reset ()
void yieldForMicros (uint32_t micros) override
int getNumberOfYieldCalls ()
uint32_t getYieldTime (int i)
int getMaxTaskNo ()
InterruptFn getInterruptFunction ()
Public Member Functions inherited from TaskManager
 TaskManager ()
taskid_t execute (TimerFn workToDo)
taskid_t execute (Executable *execToDo, bool deleteWhenDone=false)
taskid_t schedule (const TimePeriod &when, TimerFn timerFunction)
taskid_t schedule (const TimePeriod &when, Executable *execRef, bool deleteWhenDone=false)
taskid_t scheduleOnce (uint32_t when, TimerFn timerFunction, TimerUnit timeUnit=TIME_MILLIS)
taskid_t scheduleOnce (uint32_t when, Executable *execRef, TimerUnit timeUnit=TIME_MILLIS, bool deleteWhenDone=false)
taskid_t scheduleFixedRate (uint32_t when, TimerFn timerFunction, TimerUnit timeUnit=TIME_MILLIS)
taskid_t scheduleFixedRate (uint32_t when, Executable *execRef, TimerUnit timeUnit=TIME_MILLIS, bool deleteWhenDone=false)
taskid_t registerEvent (BaseEvent *eventToAdd, bool deleteWhenDone=false)
ISR_ATTR void triggerEvents ()
void addInterrupt (InterruptAbstraction *interruptAbstraction, pintype_t pin, uint8_t mode)
void setInterruptCallback (InterruptFn handler)
void cancelTask (taskid_t task)
void setTaskEnabled (taskid_t task, bool ena)
void runLoop ()
void reset ()
char * checkAvailableSlots (char *slotData, size_t slotDataSize) const
TimerTaskgetFirstTask ()
TimerTaskgetTask (taskid_t task)
uint32_t microsToNextTask ()
TimerTaskgetRunningTask ()

Additional Inherited Members

Static Public Member Functions inherited from TaskManager
static void markInterrupted (pintype_t interruptNo)
Protected Attributes inherited from TaskManager
TaskBlock *volatile taskBlocks [DEFAULT_TASK_BLOCKS]
volatile taskid_t numberOfBlocks
tm_internal::TimerTaskAtomicPtr first
volatile pintype_t lastInterruptTrigger
volatile bool interrupted
volatile InterruptFn interruptCallback
tm_internal::TmAtomicBool memLockerFlag
tm_internal::TimerTaskAtomicPtr runningTask

Detailed Description

This adds a few extra capabilities to task manager for testing. Never call the runLoop method, as it will try and schedule directly. Instead manually use the helper methods to run the scheduled tasks manually during test running.

Member Function Documentation

◆ yieldForMicros()

void SimulatedTaskManager::yieldForMicros ( uint32_t micros)
inlineoverridevirtual

Use instead of delays or wait loops inside code that needs to perform timing functions. It will not call back until at least micros time has passed.

Parameters
microsthe number of microseconds to wait.

Reimplemented from TaskManager.


The documentation for this class was generated from the following file: