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

Commit

Permalink
v1.10.0 to avoid conflict with Servo library
Browse files Browse the repository at this point in the history
### Releases v1.10.0

1. Avoid conflict with Servo library. Check [Cannot use TimerInterrupt_Generic Library in the same time than Servo Library #11](khoih-prog/TimerInterrupt_Generic#11)
2. Prevent overflow of TCx by flagging error
3. Modify all examples
4. Update `Packages_Patches`
  • Loading branch information
khoih-prog authored Sep 29, 2022
1 parent 22df0e3 commit f56782b
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/SAMDTimerInterrupt_Impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -273,10 +273,12 @@
{
TISR_LOGDEBUG1(F("_timerNumber ="), _timerNumber);

// (65536 * 1024) / 48 = 1,398,101.33us
if (_period > 1398101.3f)
// maxPermittedPeriod = 1,398,101.33us for 48MHz clock
float maxPermittedPeriod = (65536.0f * 1024) / (F_CPU / 1000000.0f );

if (_period > maxPermittedPeriod )
{
TISR_LOGERROR1(F("Max permissible _period = 1,398,101.33us, current _period ="), _period);
TISR_LOGERROR3(F("Max permissible _period (us) ="), maxPermittedPeriod, F(", current _period (us) ="), _period);
return false;
}

Expand Down

0 comments on commit f56782b

Please sign in to comment.