mahmoud2 / pinguino32

Automatically exported from code.google.com/p/pinguino32
0 stars 0 forks source link

Patch for /trunk/x.3/p32/include/pinguino/core/millis.c #38

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
There is bug in the millis() function for the mx220 target. The initial TMR2 
value is correct but in the interrupt you must update this value with TMR2 = 
65535 - _tmr2, not with _tmr2. The impact is 5x on the millis impact, since the 
timer restarts to count from initial value to 65535, giving us the 1mS.  The 
correction is in line 54.  

The PR2 works on the PIC32MX220F032B , but better be like this

Original issue reported on code.google.com by fabio.malagas@gmail.com on 6 Feb 2013 at 1:31

Attachments:

GoogleCodeExporter commented 9 years ago

Original comment by rblanchot@gmail.com on 23 Apr 2013 at 8:11