PlatformIO package of the Teensy core framework compatible with GCC 10 & C++20
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

FlexiTimer2.h 586B

123456789101112131415161718192021222324252627
  1. #ifndef FlexiTimer2_h
  2. #define FlexiTimer2_h
  3. #ifdef __AVR__
  4. #include <avr/interrupt.h>
  5. #elif defined(__arm__) && defined(TEENSYDUINO)
  6. #include <Arduino.h>
  7. #else
  8. #error FlexiTimer2 library only works on AVR architecture
  9. #endif
  10. namespace FlexiTimer2 {
  11. extern unsigned long time_units;
  12. extern void (*func)();
  13. extern volatile unsigned long count;
  14. extern volatile char overflowing;
  15. extern volatile unsigned int tcnt2;
  16. void set(unsigned long ms, void (*f)());
  17. void set(unsigned long units, double resolution, void (*f)());
  18. void start();
  19. void stop();
  20. void _overflow();
  21. }
  22. #endif