summaryrefslogtreecommitdiffstats
path: root/Linux_x86
diff options
context:
space:
mode:
authorJan Brands <jan.r.brands@nxp.com>2011-02-17 21:15:45 +0100
committerNick Pelly <npelly@google.com>2011-02-18 02:09:28 -0800
commit29e144ebf81b0f09b3fe4c26b67485ce836909c6 (patch)
treece3a8fbe8e6b748a57970762d465668205fa7934 /Linux_x86
parenta61bf7e2cb6cf80f1deea680613423a477ac4fb8 (diff)
downloadexternal_libnfc-nxp-29e144ebf81b0f09b3fe4c26b67485ce836909c6.zip
external_libnfc-nxp-29e144ebf81b0f09b3fe4c26b67485ce836909c6.tar.gz
external_libnfc-nxp-29e144ebf81b0f09b3fe4c26b67485ce836909c6.tar.bz2
Fix to prevent accidental stopping of timers.
Time-out value of 0 is used to indicate minimum value, see e.g. PH_HAL4NFC_RECV_CB_TIMEOUT in phHal4Nfc_P2P.c where it is used with P2P target receive in case data has already been received by the PN544 Change-Id: I9f15f2135ca003b848590fc87265edb39d85bf4c
Diffstat (limited to 'Linux_x86')
-rw-r--r--Linux_x86/phOsalNfc_Timer.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/Linux_x86/phOsalNfc_Timer.c b/Linux_x86/phOsalNfc_Timer.c
index da39586..94190e7 100644
--- a/Linux_x86/phOsalNfc_Timer.c
+++ b/Linux_x86/phOsalNfc_Timer.c
@@ -224,6 +224,11 @@ void phOsalNfc_Timer_Start(uint32_t TimerId,
its.it_interval.tv_nsec = 0;
its.it_value.tv_sec = RegTimeCnt / 1000;
its.it_value.tv_nsec = 1000000 * (RegTimeCnt % 1000);
+ if(its.it_value.tv_sec == 0 && its.it_value.tv_nsec == 0)
+ {
+ // this would inadvertently stop the timer
+ its.it_value.tv_nsec = 1;
+ }
timers[TimerId].callback = Application_callback;
timers[TimerId].pContext = pContext;