This is a little bit more of a C question, but I am trying to emulate the functionality of the arduino millis() command which returns how long the program has been on in milliseconds. I figure to do that I would want to use the PIT_IP to increment a global variable every millisecond, but I am having the issue that for a simple delay function where I call a function to return the value to set the starting point like I would with OsIf_GetCounter, the value will update when the timer does, rather than holding the current value of the timer.
As a result the delay function I want to make does not work as well as other functions I have that want to use the current value as a timestamp in a similar function OsIf_GetCounter.
pb632146_0-1737692102722.png
The interrupt works, I just do not know how to disconnect the variable's value from directly referencing the global.
pb632146_1-1737692160853.png
pb632146_2-1737692167414.png
Are there alternatives to this? I want to avoid OsIf_GetCounter as it only uses 32 bits at the real clock speed which would overflow too often for my needs.