|
|
@@ -22,7 +22,7 @@ typedef struct io_timer{
|
|
|
#define io_debounce_time 50
|
|
|
|
|
|
static void io_timer_handler(shark_timer_t *t);
|
|
|
-static io_timer_t hall_io = {._timer.handler = io_timer_handler, .debounce_time_zero = 100, .debounce_time_one = 100};
|
|
|
+static io_timer_t hall_io = {._timer.handler = io_timer_handler, .debounce_time_zero = 500, .debounce_time_one = 50};
|
|
|
static io_timer_t charger_io = {._timer.handler = io_timer_handler, .debounce_time_zero = 50, .debounce_time_one = 50};
|
|
|
static io_timer_t aux_short_io = {._timer.handler = io_timer_handler, .debounce_time_zero = 50, .debounce_time_one = 50};
|
|
|
static io_timer_t dcdc_pwr_io = {._timer.handler = io_timer_handler, .debounce_time_zero = 50, .debounce_time_one = 50};
|
|
|
@@ -36,10 +36,10 @@ void iostate_log(void){
|
|
|
|
|
|
void io_state_init(void){
|
|
|
set_log_level(MOD_IO, L_debug);
|
|
|
- _io_state.hall_detect = IS_HALL1_DETECTED()|| IS_HALL2_DETECTED();
|
|
|
- _io_state.charger_detect = IS_CHARGER_IN();
|
|
|
- _io_state.dcdc_good_detect= IS_DCDC_POWER_GOOD();
|
|
|
- _io_state.aux_lock_detect = IS_AUX_VOL_LOCKED() && AUX_VOL_IS_OPEN();
|
|
|
+ hall_io.value = _io_state.hall_detect = IS_HALL1_DETECTED()|| IS_HALL2_DETECTED();
|
|
|
+ charger_io.value = _io_state.charger_detect = IS_CHARGER_IN();
|
|
|
+ dcdc_pwr_io.value = _io_state.dcdc_good_detect= IS_DCDC_POWER_GOOD();
|
|
|
+ aux_short_io.value = _io_state.aux_lock_detect = IS_AUX_VOL_LOCKED() && AUX_VOL_IS_OPEN();
|
|
|
|
|
|
shark_timer_post(&hall_io._timer, io_detect_intv_time);
|
|
|
shark_timer_post(&charger_io._timer, io_detect_intv_time);
|