Reset PWM limit to maximum when reaching minimum
This commit is contained in:
parent
a17313246d
commit
11d0878864
|
@ -741,8 +741,11 @@ int main(void)
|
||||||
nextState = ConvMPP;
|
nextState = ConvMPP;
|
||||||
mpp_state.testIdx = -1;
|
mpp_state.testIdx = -1;
|
||||||
|
|
||||||
if(mpp_state.mppMaxPWM > CONV_PWM_MAX/10) {
|
if(mpp_state.mppMaxPWM > CONV_PWM_MAX/50) {
|
||||||
mpp_state.mppMaxPWM -= 10;
|
mpp_state.mppMaxPWM -= 10;
|
||||||
|
} else {
|
||||||
|
// limit has gone too low -> retry at maximum
|
||||||
|
mpp_state.mppMaxPWM = CONV_PWM_MAX;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue