LightLib
PROS library for VEX V5: EKF/MCL localization, RAMSETE path following, high-level chassis API
Loading...
Searching...
No Matches
okapi::Rate Class Reference

#include <rate.hpp>

Inheritance diagram for okapi::Rate:
okapi::AbstractRate

Public Member Functions

 Rate ()
 
void delay (QFrequency ihz) override
 Delay the current task such that it runs at the given frequency.
 
void delayUntil (QTime itime) override
 Delay the current task until itime has passed.
 
void delayUntil (uint32_t ims) override
 Delay the current task until ims milliseconds have passed.
 
- Public Member Functions inherited from okapi::AbstractRate
virtual ~AbstractRate ()
 

Protected Attributes

std::uint32_t lastTime {0}
 

Detailed Description

Definition at line 11 of file rate.hpp.

Constructor & Destructor Documentation

◆ Rate()

okapi::Rate::Rate ( )

Member Function Documentation

◆ delay()

void okapi::Rate::delay ( QFrequency  ihz)
overridevirtual

Delay the current task such that it runs at the given frequency.

The first delay will run for 1000/(ihz). Subsequent delays will adjust according to the previous runtime of the task.

Parameters
ihzthe frequency

Implements okapi::AbstractRate.

◆ delayUntil() [1/2]

void okapi::Rate::delayUntil ( QTime  itime)
overridevirtual

Delay the current task until itime has passed.

This method can be used by periodic tasks to ensure a consistent execution frequency.

Parameters
itimethe time period

Implements okapi::AbstractRate.

◆ delayUntil() [2/2]

void okapi::Rate::delayUntil ( uint32_t  ims)
overridevirtual

Delay the current task until ims milliseconds have passed.

This method can be used by periodic tasks to ensure a consistent execution frequency.

Parameters
imsthe time period

Implements okapi::AbstractRate.

Member Data Documentation

◆ lastTime

std::uint32_t okapi::Rate::lastTime {0}
protected

Definition at line 40 of file rate.hpp.


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