khoih-prog / TimerInterrupt_Generic

This library enables you to use Interrupt from Hardware Timers on supported Arduino boards such as AVR, ESP8266, ESP32, SAMD, SAM DUE, nRF52, Teensy, etc. These Hardware Timers, using Interrupt, still work even if other functions are blocking. Moreover, they are much more precise (certainly depending on clock frequency accuracy) than other software timers using millis() or micros(). That's mandatory if you need to measure some data requiring better accuracy. It now supports 16 ISR-based Timers, while consuming only 1 Hardware Timer. Timers' interval is very long (ulong millisecs). The most important feature is they're ISR-based Timers. Therefore, their executions are not blocked by bad-behaving functions or tasks. This important feature is absolutely necessary for mission-critical tasks.
MIT License
38 stars 5 forks source link

remove then reinstall? #7

Closed tbillion closed 2 years ago

tbillion commented 2 years ago

when i initially came across this timer code i came across the rp2040 only version which has the archived github page, would it be recommended to remove that and install this?

also i see every where in the documentation that before using a timer you should see if it is used elsewhere , how do i go about doing that ?

khoih-prog commented 2 years ago

Hi @tbillion

Thanks for your interest and usage of the libraries.

This library enables you to use Interrupt from Hardware Timers on supported Arduino boards such as AVR, Mega-AVR, ESP8266, ESP32, SAMD, SAM DUE, nRF52, STM32F/L/H/G/WB/MP1, Teensy, Nano-33-BLE, etc.

As you know, this TimerInterrupt_Generic library is the merge of the TimerInterrupt libraries, such as RPI_PICO_TimerInterrupt, MBED_RPI_PICO_TimerInterrupt, etc.


The pros:

  1. To manage only one library, instead of so many
  2. Correct TimerInterrupt type in auto-selected according to your board, core.

The cons:

  1. Not always as updated as the individual TimerInterrupt libraries. To check if suspected
  2. More complex if necessary to read / debug the library code
  3. Some new TimerInterrupt library might be not included yet


would it be recommended to remove that and install this?

Those TimerInterrupt and this TimerInterrupt_Generic can coexist. So you don't need to remove any library.


also i see every where in the documentation that before using a timer you should see if it is used elsewhere , how do i go about doing that ?

Using TimerInterrupt requires better hardware-related knowledge and skills.

If you suspect something wrong with a Timer, try to change to another one and see if OK.

Read the core or libraries documentation to know if any Timer has been used and verify your assumption. There is no way anybody can know if a Timer has been used or not, without knowing more info (such as libraries in use, internal core usage, etc.)

In the extreme case when you couldn't find any doc, run the minimal code, then debug print the suspected Timer Registers and see if it has been used.

As this is not an issue or bug of this library, I'm closing now and suggest to use the Discussions if not a library's bug.