Merge pull request #7364 from stefanbode/patch-9

Fixed infinite loop bug
This commit is contained in:
Theo Arends 2019-12-29 10:32:29 +01:00 committed by GitHub
commit d627de5d76
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -188,7 +188,7 @@ void ShutterInit(void)
}
} else {
Shutter.mode = SHT_OFF_ON__OPEN_CLOSE;
if (pin[GPIO_PWM1+i] < 99 && pin[GPIO_CNTR1+i]) {
if (pin[GPIO_PWM1+i] < 99 && pin[GPIO_CNTR1+i] < 99) {
Shutter.mode = SHT_OFF_ON__OPEN_CLOSE_STEPPER;
Shutter.pwm_frequency = 0;
analogWriteFreq(Shutter.pwm_frequency);
@ -394,7 +394,7 @@ void ShutterWaitForMotorStop(uint8_t i)
{
AddLog_P2(LOG_LEVEL_INFO, PSTR("SHT: Wait for Motorstop.."));
if (Shutter.mode == SHT_OFF_ON__OPEN_CLOSE || Shutter.mode == SHT_OFF_ON__OPEN_CLOSE_STEPPER) {
if ( Shutter.mode = SHT_OFF_ON__OPEN_CLOSE_STEPPER) {
if ( Shutter.mode == SHT_OFF_ON__OPEN_CLOSE_STEPPER) {
//AddLog_P2(LOG_LEVEL_INFO, PSTR("SHT: Frequency change %d"), Shutter.pwm_frequency);
while (Shutter.pwm_frequency > 0) {
Shutter.accelerator[i] = 0;