finish practical work 2

Time between sending and receiving event :
- Waveforms : 19us
- TraceAnalyzer : 18us
This commit is contained in:
Rémi Heredero 2024-04-10 16:59:15 +02:00
parent 8ad28e5e39
commit 2f20ebeba4

7
main.c
View File

@ -51,7 +51,8 @@ void EXTI2_IRQHandler(void)
void HAL_GPIO_EXTI_Callback(uint16_t GPIO_PIN)
{
//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 (;;) {
osEventFlagsWait(evt_id);
osEventFlagsClear(evt_id, );
osEventFlagsWait(evt_id, 0x1U, osFlagsWaitAny, osWaitForever);
HAL_GPIO_WritePin(GPIOF, GPIO_PIN_9, 0);
}
}