ESPectro32 Library
Library for using ESPectro32 board
 All Classes Functions Variables Enumerations Enumerator Pages
Classes | Public Types | Public Member Functions | Private Member Functions | Private Attributes | List of all members
Animator Class Reference
Inheritance diagram for Animator:
Task

Classes

struct  AnimationParam
 

Public Types

enum  AnimationState { AnimationState_Started, AnimationState_Progress, AnimationState_Completed }
 
typedef std::function< void(const
AnimationParam &param)> 
AnimationUpdateCallback
 
typedef std::function< void()> AnimationFinishedCallback
 

Public Member Functions

void start (AnimationUpdateCallback animUpdateCallback, AnimationFinishedCallback animFinishedCallback, uint16_t duration=0, uint16_t updateInterval=0, bool repeat=false)
 
void stop ()
 
void run ()
 
void runAsync (void *data)
 Body of the task to execute. More...
 
boolean isRunning ()
 
int getStep (long elapsed, long t, int v)
 
float getStepFloat (long elapsed, long t, float v)
 

Private Member Functions

void doRepeat ()
 
- Private Member Functions inherited from Task
 Task (std::string taskName="Task", uint16_t stackSize=2048, UBaseType_t priority=5)
 
 Task (BaseType_t coreId, std::string taskName="Task", uint16_t stackSize=2048, UBaseType_t priority=5)
 
void setStackSize (uint16_t stackSize)
 
void setPriority (UBaseType_t priority)
 
void setTaskName (std::string &taskN)
 
void start (void *taskData=nullptr)
 Start an instance of the task. More...
 
void stop ()
 
void delay (int ms)
 Suspend the task for the specified milliseconds. More...
 

Private Attributes

AnimationUpdateCallback animationUpdateCallback_ = NULL
 
AnimationFinishedCallback animationFinishedCallback_ = NULL
 
boolean running_ = false
 
uint16_t updateInterval_ = 100
 
uint16_t elapsed_ = 0
 
uint16_t duration_ = 0
 
uint32_t lastUpdated_ = 0
 
bool repeat_ = false
 

Member Function Documentation

void Animator::runAsync ( void *  data)
virtual

Body of the task to execute.

This function must be implemented in the subclass that represents the actual task to run. When a task is started by calling start(), this is the code that is executed in the newly created task.

Parameters
[in]dataThe data passed in to the newly started task.

Implements Task.


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