Mike G- I give... help please?
Rforbes
Posts: 281
Mike (Or anyone else! )
Ok, I give here.... I'm trying to figure out why you're using the value 3932 in one of your methods in the old HTTPServ app.
I understand the syntax, math and the rest of this little method, but... why this particular 3932 value? It's gotta signify something, but I'm stumped on what it is.
Help me out here please?
Robert
Ok, I give here.... I'm trying to figure out why you're using the value 3932 in one of your methods in the old HTTPServ app.
PRI Pause(Duration) waitcnt(((clkfreq / 1_000 * Duration - 3932) #> 381) + cnt) return
I understand the syntax, math and the rest of this little method, but... why this particular 3932 value? It's gotta signify something, but I'm stumped on what it is.
Help me out here please?
Robert
Comments
Enjoy!
Mike
I think I know this one. The 3932 value is the overhead of the call.
With is value subtracted from the delay a call of "Pause(1)" will pause the program exactly one millisecond (give or take a few nanoseconds) if the 3932 correction hadn't been subtracted, the call would have been 3932 clock cycles longer than a millisecond.
Edit: Or what Mike said.
Got it. So the 3932 value would change depending on the *exact* structure of the method, because the command overhead would take a different amount of clock cycles. Appreciate ya's!
Robert