Created
December 18, 2013 14:42
-
-
Save fboris/8023424 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void EXTI9_5_IRQHandler(void) | |
{ | |
long lHigherPriorityTaskWoken = pdFALSE; | |
/* Only line 6 is enabled, so there is no need to test which line generated | |
the interrupt. */ | |
EXTI_ClearITPendingBit( EXTI_Line6 ); | |
/* This interrupt does nothing more than demonstrate how to synchronise a | |
task with an interrupt. First the handler releases a semaphore. | |
lHigherPriorityTaskWoken has been initialised to zero. */ | |
xSemaphoreGiveFromISR( xTestSemaphore, &lHigherPriorityTaskWoken ); | |
/* If there was a task that was blocked on the semaphore, and giving the | |
semaphore caused the task to unblock, and the unblocked task has a priority | |
higher than the currently executing task (the task that this interrupt | |
interrupted), then lHigherPriorityTaskWoken will have been set to pdTRUE. | |
Passing pdTRUE into the following macro call will cause this interrupt to | |
return directly to the unblocked, higher priority, task. */ | |
portEND_SWITCHING_ISR( lHigherPriorityTaskWoken ); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment