contiki-ng / mspsim

Official MSPSim git repository
BSD 3-Clause "New" or "Revised" License
66 stars 83 forks source link

No CCU Interrupt when tccr=65535 #24

Open roy77 opened 10 years ago

roy77 commented 10 years ago

if(counter<tccr)... in Timer.java is not working if counter is wrapped

A solution is to use the "bigcounter". Calculate bigcounter Subtraction tccr-bigCounter Wrap the result with modulo Operation (the current timer wrap value) => get the correct div

Also the timer in Updown Mode results in problems.

I probably solve all in my fork.