|
|
@ -46,15 +46,15 @@ static uint32_t m_fan0_cnt; |
|
|
|
static uint32_t m_fan1_cnt; |
|
|
|
|
|
|
|
extern "C" { |
|
|
|
void HAL_GPIO_EXTI_Callback(uint16_t GPIO_Pin) { |
|
|
|
if (GPIO_Pin == m_fan0_state.pin) { |
|
|
|
m_fan0_cnt++; |
|
|
|
} |
|
|
|
|
|
|
|
else if (GPIO_Pin == m_fan1_state.pin) { |
|
|
|
m_fan1_cnt++; |
|
|
|
} |
|
|
|
} |
|
|
|
// void HAL_GPIO_EXTI_Callback(uint16_t GPIO_Pin) {
|
|
|
|
// if (GPIO_Pin == m_fan0_state.pin) {
|
|
|
|
// m_fan0_cnt++;
|
|
|
|
// }
|
|
|
|
|
|
|
|
// else if (GPIO_Pin == m_fan1_state.pin) {
|
|
|
|
// m_fan1_cnt++;
|
|
|
|
// }
|
|
|
|
// }
|
|
|
|
} |
|
|
|
|
|
|
|
void debug_light_ctrl() { |
|
|
@ -162,11 +162,11 @@ void umain() { |
|
|
|
|
|
|
|
extern_if_service_init(); |
|
|
|
|
|
|
|
zaf_gpio_init_as_output(&m_fan0_power, PD0, kxs_gpio_pullup, true, false); |
|
|
|
zaf_gpio_init_as_output(&m_fan1_power, PD1, kxs_gpio_pullup, true, false); |
|
|
|
// zaf_gpio_init_as_output(&m_fan0_power, PD0, kxs_gpio_pullup, true, false);
|
|
|
|
// zaf_gpio_init_as_output(&m_fan1_power, PD1, kxs_gpio_pullup, true, false);
|
|
|
|
|
|
|
|
zaf_gpio_init_as_input(&m_fan0_state, PD5, kxs_gpio_pullup, kxs_gpio_rising_irq, false); |
|
|
|
zaf_gpio_init_as_input(&m_fan1_state, PD6, kxs_gpio_pullup, kxs_gpio_rising_irq, false); |
|
|
|
// zaf_gpio_init_as_input(&m_fan0_state, PD5, kxs_gpio_pullup, kxs_gpio_rising_irq, false);
|
|
|
|
// zaf_gpio_init_as_input(&m_fan1_state, PD6, kxs_gpio_pullup, kxs_gpio_rising_irq, false);
|
|
|
|
|
|
|
|
ZLOGI(TAG, "system init done"); |
|
|
|
int32_t count = 0; |
|
|
@ -180,7 +180,7 @@ void umain() { |
|
|
|
} |
|
|
|
|
|
|
|
if (count % 100 == 0) { |
|
|
|
ZLOGI(TAG, "fan0:%d, fan1:%d", m_fan0_cnt, m_fan1_cnt); |
|
|
|
// ZLOGI(TAG, "fan0:%d, fan1:%d", m_fan0_cnt, m_fan1_cnt);
|
|
|
|
} |
|
|
|
} |
|
|
|
} |