In some cases the limit switch won't trigger properly, so we can't rely
on the current dropping to determine success.
if(active_accessory && off_timeout)
{
- bool success = (monitor.get_peak()>0.35f && monitor.get_current()<monitor.get_peak()-0.2f);
+ bool got_peak = monitor.get_peak()>0.0f;
+ bool success = monitor.get_peak()>0.42f;
+ bool complete = (success && monitor.get_current()<monitor.get_peak()-0.2f);
Time::TimeStamp t = Time::now();
- if(t>off_timeout || success)
+ if((t>off_timeout && got_peak) || complete)
{
Accessory &acc = *active_accessory;