mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2026-10-22 21:53:50 +00:00
Off by one in GetTickCountDelta (FIXes #301)
FIXes #301 and prevent a `-1`aka`UINT_MAX` delta.
This commit is contained in:
1 parent
733a7d836d
commit
b4e004abc2
1 file changed
+1
-1
+1
-1
@@ -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;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user