Update xdrv_27_shutter.ino

This commit is contained in:
stefanbode 2021-11-15 18:12:14 +01:00 committed by GitHub
parent 6d47bfc46e
commit 0cc6f85634
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 2 deletions

View File

@ -102,6 +102,7 @@ struct SHUTTER {
uint16_t venetian_delay = 0; // Delay in steps before venetian shutter start physical moving. Based on tilt position
uint16_t min_realPositionChange = 0; // minimum change of the position before the shutter operates. different for PWM and time based operations
uint16_t min_TiltChange = 0; // minimum change of the tilt before the shutter operates. different for PWM and time based operations
uint16_t missed_steps =0;
} Shutter[MAX_SHUTTERS];
struct SHUTTERGLOBAL {
@ -530,10 +531,10 @@ void ShutterUpdatePosition(void)
ShutterGlobal.start_reported = 1;
}
AddLog(LOG_LEVEL_DEBUG_MORE, PSTR("SHT: Time %d(%d), cStop %d, cVelo %d, mVelo %d, aVelo %d, mRun %d, aPos %d, aPos2 %d, nStop %d, Trgt %d, mVelo %d, Dir %d, Tilt %d, TrgtTilt: %d, Tiltmove: %d"),
Shutter[i].time, Shutter[i].time-Shutter[i].pwm_value,current_stop_way, current_pwm_velocity, velocity_max, Shutter[i].accelerator, min_runtime_ms, current_real_position,Shutter[i].real_position,
Shutter[i].time, Shutter[i].time-Shutter[i].missed_steps,current_stop_way, current_pwm_velocity, velocity_max, Shutter[i].accelerator, min_runtime_ms, current_real_position,Shutter[i].real_position,
next_possible_stop_position, Shutter[i].target_position, velocity_change_per_step_max, Shutter[i].direction,Shutter[i].tilt_real_pos, Shutter[i].tilt_target_pos,
Shutter[i].tiltmoving);
Shutter[i].pwm_value = Shutter[i].time;
Shutter[i].missed_steps = Shutter[i].time+1;
if ( ((Shutter[i].real_position * Shutter[i].direction >= Shutter[i].target_position * Shutter[i].direction && Shutter[i].tiltmoving==0) ||
((int16_t)Shutter[i].tilt_real_pos * Shutter[i].direction * Shutter[i].tilt_config[2] >= (int16_t)Shutter[i].tilt_target_pos * Shutter[i].direction * Shutter[i].tilt_config[2] && Shutter[i].tiltmoving==1))
|| (ShutterGlobal.position_mode == SHT_COUNTER && Shutter[i].accelerator <0 && Shutter[i].pwm_velocity+Shutter[i].accelerator<PWM_MIN)) {
@ -623,6 +624,7 @@ void ShutterStartInit(uint32_t i, int32_t direction, int32_t target_pos)
ShutterAllowPreStartProcedure(i);
Shutter[i].time = 0;
Shutter[i].direction = direction;
Shutter[i].missed_steps = 1;
ShutterGlobal.skip_relay_change = 0;
TasmotaGlobal.rules_flag.shutter_moved = 0;
ShutterGlobal.start_reported = 0;