void baro_go() { state = IDLE; tim4_isr(); timer_enable_counter(TIM4); }
static void rt_isr_event_entry(void* parameter) { rt_err_t err; rt_uint32_t e; printf_syn("rt_isr_event_entry()\n"); say_thread_start(); while (1) { err = rt_event_recv(&isr_event_set , EVENT_BIT_NEED_RUN_TIM2_IRQ | EVENT_BIT_NEED_RUN_TIM4_IRQ | EVENT_BIT_NEED_RUN_SI4432_MAC_EXTI_IRQ , RT_EVENT_FLAG_OR | RT_EVENT_FLAG_CLEAR, RT_WAITING_FOREVER, &e); if (RT_EOK != err) { printf_syn("recv isr event error(%d)", err); } else { #if RT_USING_SI4432_MAC if (is_bit_set(isr_event_var_flag, EVENT_BIT_NEED_RUN_SI4432_MAC_EXTI_IRQ)) { clr_bit(isr_event_var_flag, EVENT_BIT_NEED_RUN_SI4432_MAC_EXTI_IRQ); si4432_mac_exti_isr(); } #endif #if RT_USING_ADE7880 if (is_bit_set(isr_event_var_flag, EVENT_BIT_NEED_RUN_TIM4_IRQ)) { clr_bit(isr_event_var_flag, EVENT_BIT_NEED_RUN_TIM4_IRQ); #if 0 == ADE7880_USE_I2C_HSDC tim4_isr(); #endif } #endif #if RT_USING_SI4432_MAC if (is_bit_set(isr_event_var_flag, EVENT_BIT_NEED_RUN_SI4432_MAC_EXTI_IRQ)) { clr_bit(isr_event_var_flag, EVENT_BIT_NEED_RUN_SI4432_MAC_EXTI_IRQ); si4432_mac_exti_isr(); } if (is_bit_set(isr_event_var_flag, EVENT_BIT_NEED_RUN_TIM2_IRQ)) { clr_bit(isr_event_var_flag, EVENT_BIT_NEED_RUN_TIM2_IRQ); tim2_isr(); } #endif } } return; }