mirror of https://github.com/rusefi/bldc.git
Timer struct init fix
This commit is contained in:
parent
452b8e9506
commit
b6d957acf6
9
mcpwm.c
9
mcpwm.c
|
@ -418,10 +418,11 @@ void mcpwm_init(void) {
|
||||||
|
|
||||||
// ADC sampling locations
|
// ADC sampling locations
|
||||||
stop_pwm_hw();
|
stop_pwm_hw();
|
||||||
timer_struct.top = TIM1->ARR;
|
mc_timer_struct timer_tmp;
|
||||||
timer_struct.duty = TIM1->ARR / 2;
|
timer_tmp.top = TIM1->ARR;
|
||||||
update_adc_sample_pos((mc_timer_struct*)&timer_struct);
|
timer_tmp.duty = TIM1->ARR / 2;
|
||||||
set_next_timer_settings((mc_timer_struct*)&timer_struct);
|
update_adc_sample_pos(&timer_tmp);
|
||||||
|
set_next_timer_settings(&timer_tmp);
|
||||||
|
|
||||||
utils_sys_unlock_cnt();
|
utils_sys_unlock_cnt();
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue