mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2024-12-31 04:39:49 +08:00
Off by one in GetTickCountDelta (FIXes #301)
FIXes #301 and prevent a `-1`aka`UINT_MAX` delta.
This commit is contained in:
parent
733a7d836d
commit
b4e004abc2
1 changed files with 1 additions and 1 deletions
|
@ -64,7 +64,7 @@ uint32_t RAMFUNC GetTickCount(void) {
|
|||
|
||||
uint32_t RAMFUNC GetTickCountDelta(uint32_t start_ticks) {
|
||||
uint32_t stop_ticks = AT91C_BASE_RTTC->RTTC_RTVR;
|
||||
if (stop_ticks > start_ticks)
|
||||
if (stop_ticks >= start_ticks)
|
||||
return stop_ticks - start_ticks;
|
||||
return (UINT32_MAX - start_ticks) + stop_ticks;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue