Skip to content
This repository has been archived by the owner on Jan 29, 2023. It is now read-only.

change variable period from unsigned long to float #7

Merged
merged 1 commit into from
Oct 8, 2021

Conversation

generationmake
Copy link
Contributor

In my application I need interrupt frequencies of 12000 Hz and 12050 Hz. With the current library this was not possible because both values led to the same interrupt frequency.
My solution is to change the variable period from unsigned long to float. This gives more resolution at high interrupt frequencies.

Unfortunately I don't know if this affects other functions...

Could you please have a look on this.

@khoih-prog
Copy link
Owner

Hi @generationmake

Thanks for the PR which is looking perfect to me.

I'm merging it now and will publish a new release, certainly with a note about your contrbution.

It seems that this drawback can happen to many other TimerInterrupt-related libraries of mine. I'll spend some time to go thru all of them and fix / improve.

Looking forward to receiving more contributions from you.

Best Regards,

@khoih-prog khoih-prog merged commit 88fb548 into khoih-prog:main Oct 8, 2021
khoih-prog added a commit that referenced this pull request Oct 8, 2021
### Releases v1.5.0

1. Improve frequency precision by using float instead of ulong, Check PR [change variable period from unsigned long to float #7](#7)
2. Remove compiler warnings
3. Update `Packages' Patches`
4. Add `strict` option for PIO `lib_compat_mode`
5. Split `changelog.log` from `README.md`
khoih-prog added a commit that referenced this pull request Oct 8, 2021
### Releases v1.5.0

1. Improve frequency precision by using float instead of ulong, Check PR [change variable period from unsigned long to float #7](#7)
2. Remove compiler warnings
3. Update `Packages' Patches`
4. Add `strict` option for PIO `lib_compat_mode`
5. Split `changelog.log` from `README.md`
khoih-prog added a commit that referenced this pull request Oct 8, 2021
### Releases v1.5.0

1. Improve frequency precision by using float instead of ulong, Check PR [change variable period from unsigned long to float #7](#7)
2. Remove compiler warnings
3. Update `Packages' Patches`
4. Add `strict` option for PIO `lib_compat_mode`
5. Split `changelog.log` from `README.md`
@khoih-prog
Copy link
Owner

Hi @generationmake

The new SAMD_TimerInterrupt releases v1.5.0 has just been published.

Your contribution is noted in Contributions and Thanks

Best Regards,


Releases v1.5.0

  1. Improve frequency precision by using float instead of ulong, Check PR change variable period from unsigned long to float #7
  2. Remove compiler warnings
  3. Update Packages' Patches
  4. Add strict option for PIO lib_compat_mode
  5. Split changelog.log from README.md

This pull request was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants