forked from PAWPAW-Mirror/lib_xua
Explain the need for using the assembler gettime operation instead of an XC timer more fully.
This commit is contained in:
@@ -57,7 +57,10 @@ unsigned HidIsSetIdleSilenced( void )
|
|||||||
|
|
||||||
if( s_hidIdleActive ) {
|
if( s_hidIdleActive ) {
|
||||||
unsigned currentTime;
|
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 )));
|
isSilenced = ( s_hidIndefiniteDuration || ( timeafter( s_hidNextReportTime, currentTime )));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user