ESPixelStick Firmware
Firmware for the ESPixelStick
Loading...
Searching...
No Matches
FastTimer.hpp
Go to the documentation of this file.
1#pragma once
2/*
3* FastTimer.hpp
4*
5* Project: ESPixelStick - An ESP8266 / ESP32 and E1.31 based pixel driver
6* Copyright (c) 2021, 2022 Shelby Merrick
7* http://www.forkineye.com
8*
9* This program is provided free for you to use in any way that you wish,
10* subject to the laws and regulations where you are using it. Due diligence
11* is strongly suggested before using this code. Please give credit where due.
12*
13* The Author makes no warranty of any kind, express or implied, with regard
14* to this program or the documentation contained in this document. The
15* Author shall not be liable in any event for incidental or consequential
16* damages in connection with, or arising out of, the furnishing, performance
17* or use of these programs.
18*
19*/
20
21#include "ESPixelStick.h"
22
24{
25public:
26 FastTimer ();
27 virtual ~FastTimer ();
28
29 void StartTimer (uint32_t DurationMS, bool continuous);
30 bool IsExpired();
31 void CancelTimer();
32 uint32_t GetTimeRemaining();
33
34private:
35 bool Continuous = false;
36 uint32_t DurationMS = 0;
37 uint64_t EndTimeMS = 0;
38 uint32_t OffsetMS = 0;
39
40protected:
41
42}; // FastTimer
Definition FastTimer.hpp:24
uint32_t DurationMS
Definition FastTimer.hpp:36
bool IsExpired()
Definition FastTimer.cpp:63
uint64_t EndTimeMS
Definition FastTimer.hpp:37
virtual ~FastTimer()
< deallocate any resources and put the output channels into a safe state
Definition FastTimer.cpp:31
void StartTimer(uint32_t DurationMS, bool continuous)
< Start the module
Definition FastTimer.cpp:41
FastTimer()
< Start up the driver and put it into a safe mode
Definition FastTimer.cpp:24
uint32_t OffsetMS
Definition FastTimer.hpp:38
void CancelTimer()
Definition FastTimer.cpp:78
bool Continuous
Definition FastTimer.hpp:35
uint32_t GetTimeRemaining()
Definition FastTimer.cpp:87