diff --git a/matlab_stm_emulate b/matlab_stm_emulate index 08719ff..ea8bdbc 160000 --- a/matlab_stm_emulate +++ b/matlab_stm_emulate @@ -1 +1 @@ -Subproject commit 08719ffc055e27b3b22a9c37742add86ece43ea4 +Subproject commit ea8bdbc185777a1321e8dedcfb76bfeb7f74b94c diff --git a/mcu_project/upp/Core/upp/upp.c b/mcu_project/upp/Core/upp/upp.c index 39cf054..9d61be4 100644 --- a/mcu_project/upp/Core/upp/upp.c +++ b/mcu_project/upp/Core/upp/upp.c @@ -10,27 +10,28 @@ void upp_main(void) upp_phase_routine(&phase_B); upp_phase_routine(&phase_C); - upp_phase_control(&phase_A); - upp_phase_control(&phase_B); - upp_phase_control(&phase_C); +// upp_phase_control(&phase_A); +// upp_phase_control(&phase_B); +// upp_phase_control(&phase_C); } void upp_phase_control(Phase_t *phase) { - if(is_zero_cross(&phase->zc_detector)) - { - tiristor_start_angle_delay(&phase->ctrl); - - if (phase->ctrl.f.TiristorIsEnable) - tiristor_disable(&phase->ctrl); - } + tiristor_angle_control(&phase->ctrl); + tiristor_control(&phase->ctrl); } void upp_phase_routine(Phase_t *phase) { - tiristor_angle_control(&phase->ctrl); - tiristor_control(&phase->ctrl); zero_cross_update(&phase->zc_detector); + if(is_zero_cross(&phase->zc_detector)) + { + phase->ctrl.gpiox->ODR ^= phase->ctrl.gpio_pin; +// tiristor_start_angle_delay(&phase->ctrl); + +// if (phase->ctrl.f.TiristorIsEnable) +// tiristor_disable(&phase->ctrl); + } } void upp_init(void)