electroRF
Member
Hi,
I got the following problem.
Many Tasks in the uC use the LogPrint Function I wrote, to print logs into memory.
Every time the LogPrint function is called, it reads a 5MHz Counter, in order to attach a time-stamp to each message.
The problem is that there's a certain Task A, which sometimes turns off that Counter for some-time, and then turn it on again.
Therefore, while the 5MHz Timer is Off, I read wrong values (Zeros, or same Value again and again).
I got other 32KHz Timer I could use while the 5MHz Timer is Off.
My question is, how to neatly notify the LogPrint Function that Task A turned-off the 5MHz Timer and hasn't turned it on yet?
Additionally, it'd mean that the LogPrint Function would have to have an 'if (5MHz_Timer == ON)', which would cost me 'Branch' Cycles each time the LogPrint Function is called, even when the 5MHz Timer is turned on.
Can it be done without this Cycle cost?
I got the following problem.
Many Tasks in the uC use the LogPrint Function I wrote, to print logs into memory.
Every time the LogPrint function is called, it reads a 5MHz Counter, in order to attach a time-stamp to each message.
The problem is that there's a certain Task A, which sometimes turns off that Counter for some-time, and then turn it on again.
Therefore, while the 5MHz Timer is Off, I read wrong values (Zeros, or same Value again and again).
I got other 32KHz Timer I could use while the 5MHz Timer is Off.
My question is, how to neatly notify the LogPrint Function that Task A turned-off the 5MHz Timer and hasn't turned it on yet?
Additionally, it'd mean that the LogPrint Function would have to have an 'if (5MHz_Timer == ON)', which would cost me 'Branch' Cycles each time the LogPrint Function is called, even when the 5MHz Timer is turned on.
Can it be done without this Cycle cost?