ACS ACR89U-A1 User Manual Page 113

  • Download
  • Add to my manuals
  • Print
  • Page
    / 115
  • Table of contents
  • BOOKMARKS
  • Rated. / 5. Based on customer reviews
Page view 112
Document Title Here
Document Title Here
Document Title Here
ACR89U-A1 Application Programming Interface
Version 1.00
Page 113 of 115
info@acs.com.hk
www.acs.com.hk
Returns:
portBASE_TYPE
pdFAIL will be returned if the reset command could not be sent to the timer command
queue even after xBlockTime ticks had passed. pdPASS will be returned if the
command was successfully sent to the timer command queue. When the command is
actually processed will depend on the priority of the timer service/daemon task
relative to other tasks in the system, although the timers expiry time is relative to
when xTimerReset() is actually called.
Example usage:
/* When a key is pressed, an LCD back-light is switched on. If 5 seconds
pass
without a key being pressed, then the LCD back-light is switched off. In
this case, the timer is a one-shot timer. */
xTimerHandle xBacklightTimer = NULL;
/* The callback function assigned to the one-shot timer. In this case the
parameter is not used. */
void vBacklightTimerCallback( xTimerHandle pxTimer )
{
/* The timer expired, therefore 5 seconds must have passed since a key
was pressed. Switch off the LCD back-light. */
vSetBacklightState( BACKLIGHT_OFF );
}
/* The key press event handler. */
void vKeyPressEventHandler( char cKey )
{
/* Ensure the LCD back-light is on, then reset the timer that is
responsible for turning the back-light off after 5 seconds of
key inactivity. Wait 10 ticks for the command to be successfully sent
if it cannot be sent immediately. */
vSetBacklightState( BACKLIGHT_ON );
if( xTimerReset( xBacklightTimer, 10 ) != pdPASS )
{
/* The reset command was not executed successfully. Take appropriate
action here. */
}
/* Perform the rest of the key processing here. */
}
Page view 112
1 2 ... 108 109 110 111 112 113 114 115

Comments to this Manuals

No comments