From 83284620ccc6cf9dd3ce8b2f38724924ede7a4af Mon Sep 17 00:00:00 2001 From: Michael Banther Date: Thu, 5 Dec 2019 16:45:49 +0000 Subject: [PATCH] Explain the need for using the assembler gettime operation instead of an XC timer more fully. --- lib_xua/src/hid/hid.xc | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib_xua/src/hid/hid.xc b/lib_xua/src/hid/hid.xc index 478bfea5..854b78d3 100644 --- a/lib_xua/src/hid/hid.xc +++ b/lib_xua/src/hid/hid.xc @@ -57,7 +57,10 @@ unsigned HidIsSetIdleSilenced( void ) if( s_hidIdleActive ) { unsigned currentTime; - asm volatile( "gettime %0" : "=r" ( currentTime )); // Use inline assembly to access the time without creating a side-effect + // Use inline assembly to access the time without creating a side-effect. + // The mapper complains if the time comes from an XC timer because this function is called in the guard of a select case. + // Appearently the use of a timer creates a side-effect that prohibits the operation of the select functionality. + asm volatile( "gettime %0" : "=r" ( currentTime )); isSilenced = ( s_hidIndefiniteDuration || ( timeafter( s_hidNextReportTime, currentTime ))); }