Open doegox opened 5 years ago
Not just GetTickCount has these kinds of issues. One popular click-death was just the darkside attack in iso14443a.c was based on this kind of bug.
GetTickCountDelta was added and used everywhere. Where else to look at ? Or first we need to identify & document these clocks?
I would suggest we identfy and document these clocks. Especially which that can't be mixed / used together.
Was playing with iclass timing, since they are kind of crap, it uses SspClk and SpinDelayUS.. I thought it would be a good thing to test WaitUS... haha, not, because it uses the same clocks TC0,TC1, TC2 as Ssp ...
Eg
doesn't take into account when RTTC_RTVR wraps around. Better to have some GetTickDelta(uint32_t start_tick) that does the job properly.