@@ -31,27 +31,30 @@ void checkHome() {
31
31
if (findHomeMode == FH_DONE && guideDirAxis1 == 0 && guideDirAxis2 == 0 ) {
32
32
findHomeMode=FH_OFF;
33
33
34
- #if AXIS2_TANGENT_ARM == ON
35
- trackingState=abortTrackingState;
36
- cli ();
37
- targetAxis2.part .m = 0 ; targetAxis2.part .f = 0 ;
38
- posAxis2 = 0 ;
39
- sei ();
40
- #else
41
- // at the polar home position
42
- InitStartPosition ();
43
- atHome=true ;
44
- #endif
34
+ VLF (" MSG: Homing done" );
35
+ #if AXIS2_TANGENT_ARM == ON
36
+ trackingState=abortTrackingState;
37
+ cli ();
38
+ targetAxis2.part .m = 0 ; targetAxis2.part .f = 0 ;
39
+ posAxis2 = 0 ;
40
+ sei ();
41
+ #else
42
+ // at the polar home position
43
+ InitStartPosition ();
44
+ atHome=true ;
45
+ #endif
45
46
}
46
47
}
47
48
48
49
void StopAxis1 () {
49
50
guideDirAxis1=' b' ;
51
+ VLF (" MSG: Homing limit detected, stopping guide on Axis1" );
50
52
if (guideDirAxis2 != ' n' && guideDirAxis2 != ' s' ) { if (findHomeMode == FH_SLOW) findHomeMode=FH_DONE; if (findHomeMode == FH_FAST) findHomeMode=FH_IDLE; }
51
53
}
52
54
53
55
void StopAxis2 () {
54
56
guideDirAxis2=' b' ;
57
+ VLF (" MSG: Homing limit detected, stopping guide on Axis2" );
55
58
if (guideDirAxis1 != ' e' && guideDirAxis1 != ' w' ) { if (findHomeMode == FH_SLOW) findHomeMode=FH_DONE; if (findHomeMode == FH_FAST) findHomeMode=FH_IDLE; }
56
59
}
57
60
#endif
@@ -82,11 +85,11 @@ CommandErrors goHome(boolean fast) {
82
85
83
86
// start guides
84
87
if (fast) {
88
+ #if AXIS2_TANGENT_ARM != ON
89
+ // make sure tracking is disabled
90
+ trackingState=TrackingNone;
91
+ #endif
85
92
86
- #if AXIS2_TANGENT_ARM != ON
87
- // make sure tracking is disabled
88
- trackingState=TrackingNone;
89
- #endif
90
93
// make sure motors are powered on
91
94
enableStepperDrivers ();
92
95
@@ -95,19 +98,21 @@ CommandErrors goHome(boolean fast) {
95
98
findHomeTimeout=millis ()+(unsigned long )(secPerDeg*180.0 *1000.0 );
96
99
97
100
// 8=HalfMaxRate
98
- #if AXIS2_TANGENT_ARM != ON
99
- e=startGuideAxis1 (a1,8 ,0 );
100
- #endif
101
- if (e == CE_NONE) e=startGuideAxis2 (a2,8 ,0 ,true );
101
+ #if AXIS2_TANGENT_ARM != ON
102
+ e=startGuideAxis1 (a1,8 ,0 );
103
+ #endif
104
+
105
+ if (e == CE_NONE) { VLF (" MSG: Homing started phase 1" ); e=startGuideAxis2 (a2,8 ,0 ,true ); } else { stopGuideAxis1 (); VLF (" MSG: Homing failed" ); }
102
106
} else {
103
107
findHomeMode=FH_SLOW;
104
108
findHomeTimeout=millis ()+30000UL ;
105
109
106
110
// 7=48x sidereal
107
- #if AXIS2_TANGENT_ARM != ON
108
- e=startGuideAxis1 (a1,7 ,0 );
109
- #endif
110
- if (e == CE_NONE) e=startGuideAxis2 (a2,7 ,0 ,true );
111
+ #if AXIS2_TANGENT_ARM != ON
112
+ e=startGuideAxis1 (a1,7 ,0 );
113
+ #endif
114
+
115
+ if (e == CE_NONE) { e=startGuideAxis2 (a2,7 ,0 ,true ); VLF (" MSG: Homing started phase 2" ); } else { stopGuideAxis1 (); VLF (" MSG: Homing failed" ); }
111
116
}
112
117
if (e != CE_NONE) stopSlewing ();
113
118
return e;
@@ -127,7 +132,7 @@ CommandErrors goHome(boolean fast) {
127
132
e=goTo (homePositionAxis1,homePositionAxis2,homePositionAxis1,homePositionAxis2,PierSideEast);
128
133
#endif
129
134
130
- if (e == CE_NONE) homeMount=true ; else trackingState=abortTrackingState;
135
+ if (e == CE_NONE) { VLF ( " MSG: Homing started " ); homeMount=true ; } else { VLF ( " MSG: Homing failed " ); trackingState=abortTrackingState; }
131
136
return e;
132
137
#endif
133
138
}
@@ -161,13 +166,13 @@ CommandErrors setHome() {
161
166
162
167
// reset PEC, unless we have an index to recover from this
163
168
pecRecorded=nv.read (EE_pecRecorded);
164
- if (pecRecorded != true && pecRecorded != false ) { pecRecorded=false ; DL (" ERR, setHome(): bad NV pecRecorded" ); }
169
+ if (pecRecorded != true && pecRecorded != false ) { pecRecorded=false ; DLF (" ERR, setHome(): bad NV pecRecorded" ); }
165
170
#if PEC_SENSE == OFF
166
171
pecStatus=IgnorePEC;
167
172
nv.write (EE_pecStatus,pecStatus);
168
173
#else
169
174
pecStatus=nv.read (EE_pecStatus);
170
- if (pecStatus < PEC_STATUS_FIRST || pecStatus > PEC_STATUS_LAST) { pecStatus=IgnorePEC; DL (" ERR, setHome(): bad NV pecStatus" ); }
175
+ if (pecStatus < PEC_STATUS_FIRST || pecStatus > PEC_STATUS_LAST) { pecStatus=IgnorePEC; DLF (" ERR, setHome(): bad NV pecStatus" ); }
171
176
#endif
172
177
if (!pecRecorded) pecStatus=IgnorePEC;
173
178
0 commit comments