added running to position on initial connection and safeguard against starting a run without calibration
This commit is contained in:
@@ -219,7 +219,8 @@ void servoServerListen() {
|
||||
|
||||
void runToAppPos(uint8_t appPos) {
|
||||
// manual control takes precedence over remote control, always.
|
||||
if (runningManual) return;
|
||||
// also do not begin operation if not calibrated;
|
||||
if (runningManual || !calib.getCalibrated()) return;
|
||||
servoOff();
|
||||
|
||||
// allow servo position to settle
|
||||
|
||||
@@ -94,6 +94,7 @@ static void socketio_event_handler(void *handler_args, esp_event_base_t base,
|
||||
bool deviceCalibrated = calib.getCalibrated();
|
||||
emitCalibStatus(deviceCalibrated);
|
||||
printf(" Reported calibrated=%d for port %d\n", deviceCalibrated, port);
|
||||
runToAppPos(lastPos);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user