|
|
@ -96,18 +96,37 @@ static void timerCallback(TimerHandle_t xTimer) { |
|
|
|
act_blind_set(1); |
|
|
|
act_blind_set(1); |
|
|
|
if (gState.blind_position >= gSettings.blind_time) { |
|
|
|
if (gState.blind_position >= gSettings.blind_time) { |
|
|
|
act_motor_power_set(gState.set_power); |
|
|
|
act_motor_power_set(gState.set_power); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Stop condition
|
|
|
|
// Stop condition
|
|
|
|
|
|
|
|
if (gState.real_direction == gAct.dir) { |
|
|
|
if (gState.run_time >= gSettings.recup_time) { |
|
|
|
if (gState.run_time >= gSettings.recup_time) { |
|
|
|
// zmena smeru
|
|
|
|
// zmena smeru
|
|
|
|
gState.run_time = 0; |
|
|
|
gState.run_time = 0; |
|
|
|
act_motor_direction_set(1 - gAct.dir); |
|
|
|
act_motor_direction_set(1 - gAct.dir); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
break; |
|
|
|
break; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if (gAct.dir == gState.real_direction && gState.ramp >= gSettings.ramp_time) { |
|
|
|
if (gAct.dir == gState.real_direction && gState.ramp >= gSettings.ramp_time) { |
|
|
|
// Measure temperatures
|
|
|
|
// Measure temperatures
|
|
|
|
|
|
|
|
int16_t t1 = 200; |
|
|
|
|
|
|
|
int16_t t2 = 200; // TODO
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
gState.t_actual_1 = t1; |
|
|
|
|
|
|
|
gState.t_actual_2 = t2; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
switch (gState.real_direction) { |
|
|
|
|
|
|
|
case MOTOR_DIR_IN: |
|
|
|
|
|
|
|
gState.t_outdoor = t2; |
|
|
|
|
|
|
|
gState.t_intake = t1; |
|
|
|
|
|
|
|
break; |
|
|
|
|
|
|
|
case MOTOR_DIR_OUT: |
|
|
|
|
|
|
|
gState.t_indoor = t1; |
|
|
|
|
|
|
|
gState.t_exhaust = t2; |
|
|
|
|
|
|
|
break; |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|