RSeries astromech firmware
DelayCall Class Reference

#include <core/DelayCall.h>

Detailed Description

Schedules a function to be called at a later time.

Example Usage:

// Open all servos in 4 seconds
DelayCall::schedule([] { servoDispatch.moveServosTo(ALL_DOME_PANELS_MASK, 150, 100, 700); }, 4000);
/ Close all servos in 8 seconds
DelayCall::schedule([] { servoDispatch.moveServosTo(ALL_DOME_PANELS_MASK, 150, 100, 2400); }, 8000);
+ Inheritance diagram for DelayCall:
+ Collaboration diagram for DelayCall:

Public Member Functions

virtual void animate ()
 Call any pending delay call if its delay timer has expired. More...
 
- Public Member Functions inherited from AnimatedEvent
 AnimatedEvent ()
 Default Constructor. More...
 
void setLoopDoneCallback (AnimatedLoopDone loopProc)
 

Static Public Member Functions

static void schedule (DelayCallPtr callptr, uint32_t delayMillis)
 Schedules a function to be called after "delayMillis" milliseconds. More...
 
- Static Public Member Functions inherited from AnimatedEvent
static void process ()
 Calls animate() for each created AnimatedEvent subclass. More...
 

Member Function Documentation

◆ animate()

virtual void DelayCall::animate ( )
inlinevirtual

Call any pending delay call if its delay timer has expired.

Implements AnimatedEvent.

◆ schedule()

static void DelayCall::schedule ( DelayCallPtr  callptr,
uint32_t  delayMillis 
)
inlinestatic

Schedules a function to be called after "delayMillis" milliseconds.


The documentation for this class was generated from the following file:
DelayCall::schedule
static void schedule(DelayCallPtr callptr, uint32_t delayMillis)
Schedules a function to be called after "delayMillis" milliseconds.
Definition: DelayCall.h:34