Fixed mppMaxPWM limits

This commit is contained in:
Thomas Kolb 2016-08-21 19:45:05 +02:00
parent 6fc5a0e2c9
commit a17313246d

View file

@ -731,7 +731,7 @@ int main(void)
timer_set_oc_value(TIM1, TIM_CH_CONV, pwm);
if((mpp_state.mppMaxPWM < CONV_PWM_MAX) && (mpp_state.mppMaxPWM > CONV_PWM_MAX/10) &&
if((mpp_state.mppMaxPWM < CONV_PWM_MAX) &&
time_in_state > 5000 && ((time_in_state % 3000) == 10)) {
mpp_state.mppMaxPWM++;
}
@ -740,8 +740,11 @@ int main(void)
operState = Bootstrap;
nextState = ConvMPP;
mpp_state.testIdx = -1;
if(mpp_state.mppMaxPWM > CONV_PWM_MAX/10) {
mpp_state.mppMaxPWM -= 10;
}
}
if(power_state.vout_avg > MAX_VOLTAGE) {
operState = ConvConstVoltage;