Skip to content

Commit

Permalink
celestronaux: flipped focuser direction (indilib#889)
Browse files Browse the repository at this point in the history
  • Loading branch information
ijessen committed Jan 24, 2024
1 parent d88b4b6 commit a8d3eaa
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
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

0 comments on commit a8d3eaa

Please sign in to comment.