Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
OnTimer1() and OnTimer3() 4x too fast on 25k50
22-06-2015, 02:55 PM,
#1
OnTimer1() and OnTimer3() 4x too fast on 25k50
OnTimer1() and OnTimer3() interrupts are called 4X as frequently as they should be.  For example, with this program:

Code:
void read_data()
{    
   toggle(USERLED);    
   CDC.printf("l: %lu\r\n", millis());
}

void setup()
{    
   // print millis() every 4 seconds
   OnTimer1(read_data, INT_SEC, 4);
}

void loop()
{
}

I'm getting:

l: 3001
l: 4005
l: 5009
l: 6011
...

It's printing once each second instead of every four seconds.

-Jim
Reply
25-06-2015, 05:40 PM, (This post was last modified: 25-06-2015, 05:41 PM by regis.)
#2
RE: OnTimer1() and OnTimer3() 4x too fast on 25k50
Fixed for OnTimer1, 3 and 5 (Pinguino 47J53).
Please update your copy.
Thank you for this report.
It is easier to complain than it is to do, but it is better to do than it is to complain.
Reply
26-06-2015, 01:08 PM,
#3
RE: OnTimer1() and OnTimer3() 4x too fast on 25k50
Thank you for fixing it. I was going to suggest a patch, but your fix is simpler and more elegant. :-).

-Jim
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)