Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
A micros() function
16-11-2012, 01:38 AM,
A micros() function
I just got my Pinguino 32 Micro and the first thing I missed was a micros() function.

So I made my own, feel free to include it, I just put it in millis.c with no other modifications. It's not the fastest with all the mulling and diving going on but better than nothing.
u32 micros()
    #ifdef PIC32_PINGUINO_220
        // I don't have a 220 so I can't test if this actually works
        return 1000*_millis + (1000*(65535-TMR2))/_tmr2;
        return 1000*_millis + (1000*TMR2)/PR2;
16-11-2012, 08:07 AM,
RE: A micros() function

Thanks, very useful.

Bye Bye, Moreno
18-11-2012, 07:30 PM,
RE: A micros() function
I've added this function to the repository with a note that it has not been tested on a 220.
Can anyone confirm that it works on a 220?

Forum Jump:

Users browsing this thread: 1 Guest(s)