Wrapping the receive configuration functions together

This commit is contained in:
2024-09-25 18:47:40 +08:00
parent 2c96ee7848
commit c7902a1722
4 changed files with 11 additions and 16 deletions

View File

@@ -123,12 +123,9 @@ void TIMER15_IRQHandler(void) {
if (timer_interrupt_flag_get(TIMER15, TIMER_INT_FLAG_UP) == SET)
{
timer_interrupt_flag_clear(TIMER15, TIMER_INT_FLAG_UP);
exti_interrupt_enable(EXTI_0); // turn on hardware external input interrupt
timer_counter_value_config(TIMER16, 0);
timer_enable(TIMER16); // turn on timer to calculate the first ultrasonic echo time
timer_disable(TIMER15);
}
}
@@ -137,13 +134,8 @@ void EXTI0_1_IRQHandler(void) {
if (exti_interrupt_flag_get(EXTI_0) == SET)
{
exti_interrupt_flag_clear(EXTI_0);
capture_value = timer_channel_capture_value_register_read(TIMER16, TIMER_CH_0);
// printf("aaa\n");
timer_disable(TIMER16);
exti_interrupt_disable(EXTI_0);
}
}