Example #1
0
void EXTI1_IRQHandler(void)
{    
		EXTI->IMR &= ~USER_BUTTON_EXTI_LINE1;     //close the EXTI_Line
		EXTI->EMR &= ~USER_BUTTON_EXTI_LINE1;  
		Mearuse_time();
		STM32vldiscovery_LEDToggle(LED4);
    Sonic_dely(0x1f00);
		EXTI->IMR |= USER_BUTTON_EXTI_LINE1; //open the EXIT_Line
		EXTI->EMR |= USER_BUTTON_EXTI_LINE1; 
    EXTI_ClearITPendingBit(USER_BUTTON_EXTI_LINE1);
}
Example #2
0
static void prvQueueReceiveTask( void *pvParameters )
{
unsigned long ulReceivedValue;

	for( ;; )
	{
		/* Wait until something arrives in the queue - this task will block
		indefinitely provided INCLUDE_vTaskSuspend is set to 1 in
		FreeRTOSConfig.h. */
		xQueueReceive( xQueue, &ulReceivedValue, portMAX_DELAY );

		/*  To get here something must have been received from the queue, but
		is it the expected value?  If it is, toggle the green LED. */
		if( ulReceivedValue == 100UL )
		{
			/* NOTE - accessing the LED port should use a critical section
			because it is accessed from multiple tasks, and the button interrupt 
			- in this trivial case, for simplicity, the critical section is 
			omitted. */
			STM32vldiscovery_LEDToggle( LED3 );
		}
	}
}