40 #if defined(ARDUINO_ARCH_ESP8266) || defined(ARDUINO_ARCH_ESP32) 47 #define UTIMERLIB_TYPE_OFF 0 51 #define UTIMERLIB_TYPE_TIMEOUT 1 55 #define UTIMERLIB_TYPE_INTERVAL 2 57 #ifdef _VARIANT_ARDUINO_STM32_ 58 #include "HardwareTimer.h" 66 extern HardwareTimer Timer3;
93 #ifdef _VARIANT_ARDUINO_STM32_ 96 static void interrupt(HardwareTimer*);
100 static void interrupt();
104 #if defined(ARDUINO_ARCH_ESP8266) || defined(ARDUINO_ARCH_ESP32) 105 #pragma message "ESP8266 / ESP32 can only reach a ms resolution so any us interrupt will be rounded to that" 106 static void interrupt();
110 TcCount16* _TC = (TcCount16*) TC3;
114 #pragma message "SAMD51 support is still experimental" 120 unsigned long int _overflows = 0;
121 unsigned long int __overflows = 0;
122 #ifdef ARDUINO_ARCH_AVR 123 unsigned char _remaining = 0;
124 unsigned char __remaining = 0;
126 unsigned long int _remaining = 0;
127 unsigned long int __remaining = 0;
129 void (*_cb)() = NULL;
132 void _loadRemaining();
134 void _attachInterrupt_us(
unsigned long int);
135 void _attachInterrupt_s(
unsigned long int);
137 #ifdef _VARIANT_ARDUINO_STM32_ 142 HardwareTimer *Timer3 =
new HardwareTimer(TIM3);
149 #if defined(ARDUINO_ARCH_ESP8266) || defined(ARDUINO_ARCH_ESP32) void clearTimer()
Loads last bit of time needed to precisely count until desired time (non complete loop) ...
void setInterval_us(void(*)(), unsigned long int)
Attaches a callback function to be executed each us microseconds.
Definition: uTimerLib.cpp:58
#define UTIMERLIB_TYPE_OFF
Internal status.
Definition: uTimerLib.h:47
void setInterval_s(void(*)(), unsigned long int)
Attaches a callback function to be executed each s seconds.
Definition: uTimerLib.cpp:86
void _interrupt()
Internal intermediate function to control timer interrupts.
Arduino tiny and cross-device compatible timer library.
Definition: uTimerLib.h:70
uTimerLib()
Constructor.
Definition: uTimerLib.cpp:45
void setTimeout_s(void(*)(), unsigned long int)
Attaches a callback function to be executed once when s seconds have passed.
Definition: uTimerLib.cpp:100
void setTimeout_us(void(*)(), unsigned long int)
Attaches a callback function to be executed once when us microseconds have passed.
Definition: uTimerLib.cpp:72