Explain the need for using the assembler gettime operation instead of an XC timer more fully.

This commit is contained in:
Michael Banther
2019-12-05 16:45:49 +00:00
parent 255e9f75b5
commit 83284620cc

View File

@@ -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 )));
}