From c08253111022e46d834f42e91efd47cb3a775596 Mon Sep 17 00:00:00 2001 From: iceman1001 Date: Sun, 29 Jul 2018 18:20:39 +0200 Subject: [PATCH] fix: potential implicit type cast issue (Thanks to @drandreas for pointing it out) --- armsrc/ticks.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/armsrc/ticks.c b/armsrc/ticks.c index 3c485e072..f084e3364 100644 --- a/armsrc/ticks.c +++ b/armsrc/ticks.c @@ -91,7 +91,7 @@ void StartCountUS(void) { uint32_t RAMFUNC GetCountUS(void){ //return (AT91C_BASE_TC1->TC_CV * 0x8000) + ((AT91C_BASE_TC0->TC_CV / 15) * 10); // By suggestion from PwPiwi, http://www.proxmark.org/forum/viewtopic.php?pid=17548#p17548 - return (AT91C_BASE_TC1->TC_CV * 0x8000) + ((AT91C_BASE_TC0->TC_CV * 2) / 3); + return ((uint32_t)AT91C_BASE_TC1->TC_CV) * 0x8000 + (((uint32_t)AT91C_BASE_TC0->TC_CV) * 2) / 3; } // -------------------------------------------------------------------------