khoih-prog / SAMD_TimerInterrupt

This library enables you to use Interrupt from Hardware Timers on an SAMD-based board. These SAMD 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. SAMD21 now can use 6 Timers
MIT License
34 stars 15 forks source link

Multiple Definition Error Not fixed by swapping src_cpp or src_h with src #9

Closed WillPowellUk closed 3 years ago

WillPowellUk commented 3 years ago

Please see the stack overflow question I posted on this bug. I have tried switching the src_cpp and src_h but the SAMDTimerInterrupt.h files are identical on all 3!

I have tried a forward declare and including it as a cpp file instead of a header file but no luck.

Please could you adjust the src_cpp or src_h files to prevent this linker error

P.s. apart from this, the library is amazing and I am thankful for your work :)

khoih-prog commented 3 years ago

Hi @will63powell

Thanks for your interest in the library and your nice words.

Check the previous issue The src_cpp->src/src_h->src hack from the README will not avoid multiple definitions when SAMD_TimerInterrupt.h is included in multiple project files. #8

Good Luck,

WillPowellUk commented 3 years ago

Thanks for the quick reply. I have split the .h file into a .cpp and .h (attached) Can you upload this to the SAMD_TimerInterrrupt/SRC_CPP for others to use as currently there is no .cpp for SAMDTimerInterrupt SAMDTimerInterrupt.zip ?

khoih-prog commented 2 years ago

Hi @will63powell

The new SAMD_TimerInterrupt releases v1.6.0 has just been published thanks to your bug report.

Your contribution is noted in Contributions and Thanks.

Best Regards,


Releases v1.6.0

  1. Fix multiple-definitions linker error. Drop src_cpp and src_h directories
  2. Add example multiFileProject to demo for multiple-file project.
  3. Add support to many more boards, such as SAMD21E1xA, SAMD21G1xA andSAMD21J1xA
  4. Optimize library code by using reference-passing instead of value-passing
  5. Update all examples
  6. Update Packages_Patches
WillPowellUk commented 2 years ago

Greatly appreciated. This timer interrupt library plays a big part in one of my projects.

On Fri, 21 Jan 2022, 05:54 Khoi Hoang, @.***> wrote:

Hi @will63powell https://github.com/will63powell

The new SAMD_TimerInterrupt releases v1.6.0 https://github.com/khoih-prog/SAMD_TimerInterrupt/releases/tag/v1.6.0 has just been published thanks to your bug report.

Your contribution is noted in Contributions and Thanks https://github.com/khoih-prog/SAMD_TimerInterrupt#contributions-and-thanks .

Best Regards,

Releases v1.6.0

  1. Fix multiple-definitions linker error. Drop src_cpp and src_h directories
  2. Add example multiFileProject http://examples/multiFileProject to demo for multiple-file project.
  3. Add support to many more boards, such as SAMD21E1xA, SAMD21G1xA and SAMD21J1xA
  4. Optimize library code by using reference-passing instead of value-passing
  5. Update all examples
  6. Update Packages_Patches

— Reply to this email directly, view it on GitHub https://github.com/khoih-prog/SAMD_TimerInterrupt/issues/9#issuecomment-1018203764, or unsubscribe https://github.com/notifications/unsubscribe-auth/APMW3ZWY5Y3FFBME2CKQFILUXDYLFANCNFSM5IYGIG6A . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

You are receiving this because you were mentioned.Message ID: @.***>