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

Commit c50784b

Browse files
authored
Add files via upload
1 parent 92a54e6 commit c50784b

File tree

1 file changed

+13
-8
lines changed

1 file changed

+13
-8
lines changed

TimerInterrupt.cpp

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
#define TIMSK1 TIMSK
3333
#endif
3434

35-
#define TIMER_INTERRUPT_DEBUG 1
35+
#define TIMER_INTERRUPT_DEBUG 0
3636

3737

3838
void TimerInterrupt::init(int8_t timer)
@@ -579,9 +579,11 @@ TimerInterrupt ITimer2(HW_TIMER_2);
579579

580580
ISR(TIMER1_COMPA_vect)
581581
{
582-
unsigned long countLocal = ITimer1.getCount();
583-
584-
Serial.println("ITimer1, count = " + String(ITimer1.getCount()));
582+
long countLocal = ITimer1.getCount();
583+
584+
#if (TIMER_INTERRUPT_DEBUG > 1)
585+
Serial.println("T1 count = " + String(countLocal));
586+
#endif
585587

586588
if (ITimer1.getTimer() == 1)
587589
{
@@ -604,7 +606,7 @@ ISR(TIMER1_COMPA_vect)
604606

605607
ISR(TIMER2_COMPA_vect)
606608
{
607-
unsigned long countLocal = ITimer2.getCount();
609+
long countLocal = ITimer2.getCount();
608610

609611
#if (TIMER_INTERRUPT_DEBUG > 1)
610612
Serial.println("T2 count = " +String(countLocal));
@@ -638,7 +640,8 @@ TimerInterrupt ITimer5(HW_TIMER_5);
638640

639641
ISR(TIMER3_COMPA_vect)
640642
{
641-
unsigned long countLocal = ITimer3.getCount();
643+
long countLocal = ITimer3.getCount();
644+
642645
if (ITimer3.getTimer() == 3)
643646
{
644647
if (countLocal != 0)
@@ -660,7 +663,8 @@ ISR(TIMER3_COMPA_vect)
660663

661664
ISR(TIMER4_COMPA_vect)
662665
{
663-
unsigned long countLocal = ITimer4.getCount();
666+
long countLocal = ITimer4.getCount();
667+
664668
if (ITimer4.getTimer() == 4)
665669
{
666670
if (countLocal != 0)
@@ -682,7 +686,8 @@ ISR(TIMER4_COMPA_vect)
682686

683687
ISR(TIMER5_COMPA_vect)
684688
{
685-
unsigned long countLocal = ITimer5.getCount();
689+
long countLocal = ITimer5.getCount();
690+
686691
if (ITimer5.getTimer() == 5)
687692
{
688693
if (countLocal != 0)

0 commit comments

Comments
 (0)