finish practical work 2
Time between sending and receiving event : - Waveforms : 19us - TraceAnalyzer : 18us
This commit is contained in:
		
							
								
								
									
										7
									
								
								main.c
									
									
									
									
									
								
							
							
						
						
									
										7
									
								
								main.c
									
									
									
									
									
								
							| @@ -51,7 +51,8 @@ void EXTI2_IRQHandler(void) | |||||||
| void HAL_GPIO_EXTI_Callback(uint16_t GPIO_PIN) | void HAL_GPIO_EXTI_Callback(uint16_t GPIO_PIN) | ||||||
| { | { | ||||||
| 	//button interrupt | 	//button interrupt | ||||||
| 	HAL_GPIO_TogglePin(GPIOF, GPIO_PIN_9); | 	HAL_GPIO_WritePin(GPIOF, GPIO_PIN_9, 1); | ||||||
|  | 	osEventFlagsSet(evt_id, 0x1U); | ||||||
| } | } | ||||||
|   |   | ||||||
|  |  | ||||||
| @@ -62,8 +63,8 @@ __NO_RETURN static void taskCounter(void *argument) { | |||||||
|  |  | ||||||
| 	 | 	 | ||||||
| 	for (;;) { | 	for (;;) { | ||||||
| 		osEventFlagsWait(evt_id); | 		osEventFlagsWait(evt_id, 0x1U, osFlagsWaitAny, osWaitForever); | ||||||
| 		osEventFlagsClear(evt_id, ); | 		HAL_GPIO_WritePin(GPIOF, GPIO_PIN_9, 0); | ||||||
| 	} | 	} | ||||||
| } | } | ||||||
|  |  | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user