Skip to content

Commit 2d60381

Browse files
Merge develop
1 parent 400a3cc commit 2d60381

File tree

2 files changed

+28
-12
lines changed

2 files changed

+28
-12
lines changed

Configuration_adv.hpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -391,7 +391,9 @@
391391
#define ALT_ROD_PITCH 1.0 // mm/rev
392392
#endif
393393
// the Circumference of the AZ rotation. 209.1mm radius.
394-
#define ALT_CIRCUMFERENCE 209.1 * 2 * PI
394+
#ifndef ALT_CIRCUMFERENCE
395+
#define ALT_CIRCUMFERENCE 209.1 * 2 * PI
396+
#endif
395397
#define ALTITUDE_STEPS_PER_REV \
396398
(ALT_CORRECTION_FACTOR * (ALT_CIRCUMFERENCE / ALT_ROD_PITCH) * ALT_STEPPER_SPR * ALT_MICROSTEPPING) // Actually u-steps/rev
397399

src/Mount.cpp

Lines changed: 25 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3182,13 +3182,27 @@ void Mount::setupInfoDisplay()
31823182
void Mount::updateInfoDisplay()
31833183
{
31843184
#if (INFO_DISPLAY_TYPE != INFO_DISPLAY_TYPE_NONE)
3185-
_loops++;
3186-
// Update display every 8 cycles
3187-
if (_loops % 8 == 0)
3185+
// If we update this display too often while slewing, the serial port is unable to process commands fast enough. Which makes the driver
3186+
// timeout, causing ASCOM errors.
3187+
// We will update at 30Hz when idle, 5Hz when slewing one axis and skip updates when slewing both.
3188+
int refreshRateHz = 30;
3189+
long now = millis();
3190+
if ((slewStatus() & (SLEWING_DEC | SLEWING_RA)) == (SLEWING_DEC | SLEWING_RA))
3191+
{
3192+
return;
3193+
}
3194+
3195+
if (isSlewingRAorDEC())
3196+
{
3197+
refreshRateHz = 5;
3198+
}
3199+
3200+
if (now - _lastInfoUpdate > (1000 / refreshRateHz))
31883201
{
31893202
LOG(DEBUG_DISPLAY, "[DISPLAY]: Render state to OLED ...");
31903203
infoDisplay->render(this);
31913204
LOG(DEBUG_DISPLAY, "[DISPLAY]: Rendered state to OLED ...");
3205+
_lastInfoUpdate = now;
31923206
}
31933207
#endif
31943208
}
@@ -4011,14 +4025,14 @@ DayTime Mount::calculateLst()
40114025
DayTime timeUTC = getUtcTime();
40124026
LocalDate localDate = getLocalDate();
40134027
DayTime lst = Sidereal::calculateByDateAndTime(longitude().getTotalHours(), localDate.year, localDate.month, localDate.day, &timeUTC);
4014-
LOG(DEBUG_INFO,
4015-
"[MOUNT]: Calculating LST. UTC time: %s. Date: %d-%d-%d. Longitude: %s",
4016-
timeUTC.ToString(),
4017-
localDate.year,
4018-
localDate.month,
4019-
localDate.day,
4020-
longitude().ToString());
4021-
LOG(DEBUG_INFO, "[MOUNT]: LST is: %s", lst.ToString());
4028+
// LOG(DEBUG_INFO,
4029+
// "[MOUNT]: Calculating LST. UTC time: %s. Date: %d-%d-%d. Longitude: %s",
4030+
// timeUTC.ToString(),
4031+
// localDate.year,
4032+
// localDate.month,
4033+
// localDate.day,
4034+
// longitude().ToString());
4035+
// LOG(DEBUG_INFO, "[MOUNT]: LST is: %s", lst.ToString());
40224036
return lst;
40234037
}
40244038

0 commit comments

Comments
 (0)