Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

celestronaux: flipped focuser direction (#889) #890

Merged
merged 1 commit into from
Jan 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions indi-celestronaux/celestronaux.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -593,7 +593,7 @@ bool CelestronAUX::updateProperties()
syncDriverInfo();

getFocusPosition();
FocusAbsPosN->value = m_FocusTarget = m_FocusPosition - m_FocusLimitMin;
FocusAbsPosN->value = m_FocusLimitMax - m_FocusPosition;
FocusAbsPosNP.s = IPS_OK;

m_FocusEnabled = true;
Expand Down Expand Up @@ -1323,10 +1323,10 @@ IPState CelestronAUX::MoveAbsFocuser(uint32_t targetTicks)
}

getFocusPosition();
if (targetTicks == m_FocusPosition - m_FocusLimitMin)
if (targetTicks == m_FocusLimitMax - m_FocusPosition)
return IPS_OK;
else{
focusTo(m_FocusTarget = targetTicks + m_FocusLimitMin);
focusTo(m_FocusLimitMax - targetTicks);
return IPS_BUSY;
}
}
Expand Down Expand Up @@ -2001,7 +2001,7 @@ void CelestronAUX::TimerHit()
getFocusPosition();

// update client only if changed to reduce traffic
uint32_t newFocusAbsPos = m_FocusPosition - m_FocusLimitMin;
uint32_t newFocusAbsPos = m_FocusLimitMax - m_FocusPosition;
if (newFocusAbsPos != FocusAbsPosN->value){
FocusAbsPosN->value = newFocusAbsPos;
IDSetNumber(&FocusAbsPosNP, nullptr);
Expand Down
1 change: 0 additions & 1 deletion indi-celestronaux/celestronaux.h
Original file line number Diff line number Diff line change
Expand Up @@ -343,7 +343,6 @@ class CelestronAUX :

// Focus
bool m_FocusEnabled {false};
uint32_t m_FocusTarget {0};
uint32_t m_FocusPosition {0};
uint32_t m_FocusLimitMax {0};
uint32_t m_FocusLimitMin {0xffffffff};
Expand Down
Loading