@@ -1036,15 +1036,14 @@ void Mount::loop() {
1036
1036
1037
1037
if (_stepperWasRunning) {
1038
1038
#ifdef DEBUG_MODE
1039
- logv (" Loop: Reached target." );
1039
+ logv (" Loop: Reached target." );
1040
1040
#endif
1041
1041
// Mount is at Target!
1042
1042
// If we we're parking, we just reached home. Clear the flag, reset the motors and stop tracking.
1043
1043
if (isParking ()) {
1044
1044
#ifdef DEBUG_MODE
1045
- logv (" Loop: Was Parking." );
1045
+ logv (" Loop: Was Parking, stop tracking and set home ." );
1046
1046
#endif
1047
- _mountStatus &= ~STATUS_PARKING;
1048
1047
stopSlewing (TRACKING);
1049
1048
setHome ();
1050
1049
}
@@ -1053,29 +1052,40 @@ void Mount::loop() {
1053
1052
_currentRAStepperPosition = _stepperRA->currentPosition ();
1054
1053
if (_correctForBacklash) {
1055
1054
#ifdef DEBUG_MODE
1056
- logv (" Loop: Reached target at %d. Compensating by %d" , _currentRAStepperPosition, _backlashCorrectionSteps);
1055
+ logv (" Loop: Reached target at %d. Compensating by %d" , _currentRAStepperPosition, _backlashCorrectionSteps);
1057
1056
#endif
1058
1057
_currentRAStepperPosition += _backlashCorrectionSteps;
1059
1058
_stepperRA->runToNewPosition (_currentRAStepperPosition);
1060
1059
_correctForBacklash = false ;
1061
1060
#ifdef DEBUG_MODE
1062
- logv (" Loop: Backlash correction done. Pos: %d" , _currentRAStepperPosition);
1061
+ logv (" Loop: Backlash correction done. Pos: %d" , _currentRAStepperPosition);
1063
1062
#endif
1064
1063
}
1065
1064
else
1066
1065
{
1067
1066
#ifdef DEBUG_MODE
1068
- logv (" Loop: Reached target at %d, no backlash compensation needed" , _currentRAStepperPosition);
1067
+ logv (" Loop: Reached target at %d, no backlash compensation needed" , _currentRAStepperPosition);
1069
1068
#endif
1070
1069
}
1071
1070
1072
1071
if (_slewingToHome) {
1073
1072
#ifdef DEBUG_MODE
1074
- logv (" Loop: Was Slewing home, so setting stepper RA and TRK to zero." );
1073
+ logv (" Loop: Was Slewing home, so setting stepper RA and TRK to zero." );
1075
1074
#endif
1076
1075
_stepperRA->setCurrentPosition (0 );
1077
1076
_stepperTRK->setCurrentPosition (0 );
1078
- startSlewing (TRACKING);
1077
+ if (isParking ()) {
1078
+ #ifdef DEBUG_MODE
1079
+ logv (" Loop: Was parking, so no tracking." );
1080
+ #endif
1081
+ _mountStatus &= ~STATUS_PARKING;
1082
+ }
1083
+ else {
1084
+ #ifdef DEBUG_MODE
1085
+ logv (" Loop: Restart tracking." );
1086
+ #endif
1087
+ startSlewing (TRACKING);
1088
+ }
1079
1089
_slewingToHome = false ;
1080
1090
}
1081
1091
_totalDECMove = _totalRAMove = 0 ;
0 commit comments