Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update comment in the example for declaration of xTimerReset #1133

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 13 additions & 10 deletions include/timers.h
Original file line number Diff line number Diff line change
Expand Up @@ -737,14 +737,18 @@ TaskHandle_t xTimerGetTimerDaemonTaskHandle( void ) PRIVILEGED_FUNCTION;
* // 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, 100 ) != pdPASS )
* // 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.
* if( xTimerReset( xBacklightTimer, 10 ) == pdPASS )
* {
* // The reset command was not executed successfully. Take appropriate
* // Turn on the LCD back-light. It will be turned off in the
* // vBacklightTimerCallback after 5 seconds of key inactivity.
* vSetBacklightState( BACKLIGHT_ON );
* }
* else
* {
* // The reset command was not executed successfully. Take appropriate
* // action here.
* }
*
Expand All @@ -753,16 +757,15 @@ TaskHandle_t xTimerGetTimerDaemonTaskHandle( void ) PRIVILEGED_FUNCTION;
*
* void main( void )
* {
* int32_t x;
*
* // Create then start the one-shot timer that is responsible for turning
* // the back-light off if no keys are pressed within a 5 second period.
* xBacklightTimer = xTimerCreate( "BacklightTimer", // Just a text name, not used by the kernel.
* ( 5000 / portTICK_PERIOD_MS), // The timer period in ticks.
* pdMS_TO_TICKS( 5000 ), // The timer period in ticks.
* pdFALSE, // The timer is a one-shot timer.
* 0, // The id is not used by the callback so can take any value.
* vBacklightTimerCallback // The callback function that switches the LCD back-light off.
* );
* );
*
* if( xBacklightTimer == NULL )
* {
Expand Down
Loading