Merge pull request #10893 from mikep1998/development

Fix shutter PWM command to include device number and update logging information.
This commit is contained in:
Theo Arends 2021-02-10 13:33:22 +01:00 committed by GitHub
commit 934ace1102
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 7 additions and 2 deletions

View File

@ -429,7 +429,7 @@ void ShutterDecellerateForStop(uint8_t i)
}
void ShutterPowerOff(uint8_t i) {
AddLog(LOG_LEVEL_DEBUG, PSTR("SHT: Stop Shutter %d. Switchmode %d"), i,Shutter[i].switch_mode);
AddLog(LOG_LEVEL_DEBUG, PSTR("SHT: Stop Shutter %d. Switchmode %d"), i+1,Shutter[i].switch_mode); // fix log to indicate correct shutter number
ShutterDecellerateForStop(i);
switch (Shutter[i].switch_mode) {
case SHT_SWITCH:
@ -458,7 +458,12 @@ void ShutterPowerOff(uint8_t i) {
switch (ShutterGlobal.position_mode) {
case SHT_PWM_VALUE:
char scmnd[20];
snprintf_P(scmnd, sizeof(scmnd), PSTR(D_CMND_PWM " %d" ),Shutter[i].pwm_value);
#ifdef SHUTTER_CLEAR_PWM_ONSTOP
// free the PWM servo lock on stop.
snprintf_P(scmnd, sizeof(scmnd), PSTR(D_CMND_PWM "%d 0" ), i+1);
#else
snprintf_P(scmnd, sizeof(scmnd), PSTR(D_CMND_PWM "%d %d" ), i+1,Shutter[i].pwm_value);
#endif
ExecuteCommand(scmnd, SRC_BUTTON);
break;
}