diff options
author | Sylvain Fonteneau <sylvain.fonteneau@trusted-logic.com> | 2010-10-27 15:53:56 +0200 |
---|---|---|
committer | Nick Pelly <npelly@google.com> | 2010-10-28 10:13:06 -0700 |
commit | 99eeb8ab747ce32a0b99a9abfe1c06eb6d583abc (patch) | |
tree | f0f9298aac93675e9965fc3f503230bd2f8be1d2 /Linux_x86 | |
parent | e7f38d39c75da44b181ef924d215411e048a5848 (diff) | |
download | external_libnfc-nxp-99eeb8ab747ce32a0b99a9abfe1c06eb6d583abc.zip external_libnfc-nxp-99eeb8ab747ce32a0b99a9abfe1c06eb6d583abc.tar.gz external_libnfc-nxp-99eeb8ab747ce32a0b99a9abfe1c06eb6d583abc.tar.bz2 |
Avoid overrun when setting timer.
Change-Id: I27ef4ab66c1b3a9ed4eb668125cda36f7cccd4a7
Diffstat (limited to 'Linux_x86')
-rw-r--r-- | Linux_x86/phOsalNfc_Timer.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Linux_x86/phOsalNfc_Timer.c b/Linux_x86/phOsalNfc_Timer.c index e448f20..da39586 100644 --- a/Linux_x86/phOsalNfc_Timer.c +++ b/Linux_x86/phOsalNfc_Timer.c @@ -222,8 +222,8 @@ void phOsalNfc_Timer_Start(uint32_t TimerId, its.it_interval.tv_sec = 0; its.it_interval.tv_nsec = 0; - its.it_value.tv_sec = (RegTimeCnt * NSECS) / 1000000000; - its.it_value.tv_nsec = ((long)RegTimeCnt * NSECS) % 1000000000; + its.it_value.tv_sec = RegTimeCnt / 1000; + its.it_value.tv_nsec = 1000000 * (RegTimeCnt % 1000); timers[TimerId].callback = Application_callback; timers[TimerId].pContext = pContext; |