Device Parent Class.
More...
#include <system.hpp>
Device Parent Class.
Motor and Addrled objects derive from this
◆ Device()
sylib::Device::Device |
( |
int |
interval = 2 , |
|
|
int |
offset = 0 |
|
) |
| |
Creates a Device object.
- Parameters
-
interval | The number of frames to wait between updates. A frame is 2ms, so this value multiplied by 2 is the approximate time between updates. It can be off by +/- 1ms |
offset | The number of frames to shift the excecution of the update function |
◆ ~Device()
sylib::Device::~Device |
( |
| ) |
|
◆ getSubTaskID()
int sylib::Device::getSubTaskID |
( |
| ) |
|
Gets the subtask ID of the device's update function.
- Returns
- ID number
◆ getSubTaskPaused()
bool sylib::Device::getSubTaskPaused |
( |
| ) |
|
Gets whether or not the device update function is paused.
- Returns
- True or False
◆ getUpdateFrequency()
int sylib::Device::getUpdateFrequency |
( |
| ) |
|
Gets the number of frames delayed between updates.
- Returns
- Sylib frame count
◆ getUpdateOffset()
int sylib::Device::getUpdateOffset |
( |
| ) |
|
Gets the number of frames the update function is offset by.
- Returns
- Sylib frame count
◆ isSubTaskRunning()
bool sylib::Device::isSubTaskRunning |
( |
| ) |
|
Gets whether or not the device update function is running.
- Returns
- True or False
◆ killSubTask()
void sylib::Device::killSubTask |
( |
| ) |
|
Permanently ends the device update function.
◆ pauseSubTask()
void sylib::Device::pauseSubTask |
( |
| ) |
|
Pauses the device update function.
◆ resumeSubTask()
void sylib::Device::resumeSubTask |
( |
| ) |
|
Resumes the device update function.
◆ setUpdateFrequency()
void sylib::Device::setUpdateFrequency |
( |
int |
interval | ) |
|
Sets the number of frames to wait between updates.
- Parameters
-
interval | Sylib frame count |
◆ setUpdateOffset()
void sylib::Device::setUpdateOffset |
( |
int |
offset | ) |
|
Sets the number of frames to shift the excecution of the update function.
- Parameters
-
interval | Sylib frame count |
◆ update()
virtual void sylib::Device::update |
( |
| ) |
|
|
pure virtual |
Default device update function. This is overridden by classes that inherit from Device for their own specific needs.
Implemented in sylib::Addrled, and sylib::Motor.
◆ mutex
Mutex to prevent multiple threads from performing operations on important system things at once.