diff --git a/Command.ino b/Command.ino index d5c4fd69..91f147dd 100644 --- a/Command.ino +++ b/Command.ino @@ -752,7 +752,7 @@ void processCommands() { reply[i++]='0'+getPulseGuideRate(); // provide guide rate - reply[i++]='0'+getGuideRate(); + if (currentGuideRate == -1) reply[i++]='9'; else reply[i++]='0'+currentGuideRate; // provide general error reply[i++]='0'+generalError; @@ -812,7 +812,7 @@ void processCommands() { #endif reply[5]=parkStatus|0b10000000; // Park status: 0 not parked, 1 parking in-progress, 2 parked, 3 park failed reply[6]=getPulseGuideRate()|0b10000000; // Pulse-guide rate - reply[7]=getGuideRate()|0b10000000; // Guide rate + if (currentGuideRate == -1) reply[7]=9|0b10000000; else reply[7]=currentGuideRate|0b10000000; // Guide rate reply[8]=generalError|0b10000000; // General error reply[9]=0; boolReply=false; @@ -1481,7 +1481,7 @@ void processCommands() { if (¶meter[0] != conv_end) { if (f < 0.001/60.0/60.0) f=0.001/60.0/60.0; if (f > maxStepsPerSecond/axis1Settings.stepsPerMeasure) f=maxStepsPerSecond/axis1Settings.stepsPerMeasure; - customGuideRateAxis1(f*240.0,GUIDE_TIME_LIMIT*1000); + customGuideRateAxis1(f*240.0); } boolReply=false; } else @@ -1493,7 +1493,7 @@ void processCommands() { if (¶meter[0] != conv_end) { if (f < 0.001/60.0/60.0) f=0.001/60.0/60.0; if (f > maxStepsPerSecond/axis2Settings.stepsPerMeasure) f=maxStepsPerSecond/axis2Settings.stepsPerMeasure; - customGuideRateAxis2(f*240.0,GUIDE_TIME_LIMIT*1000); + customGuideRateAxis2(f*240.0); } boolReply=false; } else diff --git a/Globals.h b/Globals.h index 231da34e..1ccf335d 100644 --- a/Globals.h +++ b/Globals.h @@ -373,7 +373,7 @@ double guideRates[10]={3.75,7.5,15,30,60,120,300,720, 720, 720}; #define GuideRateDefault 6 #endif #define GuideRateNone 255 -byte currentGuideRate = GuideRateDefault; +int currentGuideRate = GuideRateDefault; byte currentPulseGuideRate = GuideRate1x; volatile byte activeGuideRate = GuideRateNone; diff --git a/Guide.ino b/Guide.ino index e7546124..3401215b 100644 --- a/Guide.ino +++ b/Guide.ino @@ -337,29 +337,16 @@ void guideSpiralPoll() { } // custom guide rate in RA or Azm, rate is in x-sidereal, guideDuration is in ms (0 to ignore) -bool customGuideRateAxis1(double rate, long guideDuration) { +bool customGuideRateAxis1(double rate) { guideTimerCustomRateAxis1=rate; - enableGuideRate(-1); - if ((parkStatus == NotParked) && (trackingState != TrackingMoveTo) && (axis1Enabled) && (guideDirAxis1)) { - guideTimeThisIntervalAxis1=micros(); - guideTimeRemainingAxis1=guideDuration*1000L; - if (guideDirAxis1 == 'e') { cli(); guideTimerRateAxis1=-guideTimerBaseRateAxis1; sei(); } - if (guideDirAxis1 == 'w') { cli(); guideTimerRateAxis1= guideTimerBaseRateAxis1; sei(); } - } else return false; + currentGuideRate=-1; return true; } // custom guide rate in Dec or Alt, rate is in x-sidereal, guideDuration is in ms (0 to ignore) -bool customGuideRateAxis2(double rate, long guideDuration) { +bool customGuideRateAxis2(double rate) { guideTimerCustomRateAxis2=rate; - enableGuideRate(-1); - if ((parkStatus == NotParked) && (trackingState != TrackingMoveTo) && (axis2Enabled) && (guideDirAxis2)) { - guideTimeThisIntervalAxis2=micros(); - guideTimeRemainingAxis2=guideDuration*1000L; - if (guideDirAxis2 == 's') { cli(); guideTimerRateAxis2=-guideTimerBaseRateAxis2; sei(); } - if (guideDirAxis2 == 'n') { cli(); guideTimerRateAxis2= guideTimerBaseRateAxis2; sei(); } - if (getInstrPierSide() == PierSideWest) { cli(); guideTimerRateAxis2=-guideTimerRateAxis2; sei(); } - } else return false; + currentGuideRate=-1; return true; } @@ -371,11 +358,6 @@ void setGuideRate(int g) { guideTimerCustomRateAxis2=0.0; } -// gets the rate for guide commands -int getGuideRate() { - return currentGuideRate; -} - // gets the rate for pulse-guide commands int getPulseGuideRate() { #if SEPARATE_PULSE_GUIDE_RATE == ON