From 1d1a8ae55d48ace408ca904cbfee04791f8c9e01 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Soja?= Date: Mon, 29 Jul 2024 19:45:28 +0200 Subject: [PATCH] ZWO AM5 Save home position in the mount (#2093) --- drivers/telescope/lx200am5.cpp | 16 ++++++++++++++++ drivers/telescope/lx200am5.h | 1 + 2 files changed, 17 insertions(+) diff --git a/drivers/telescope/lx200am5.cpp b/drivers/telescope/lx200am5.cpp index 23127966d2..c75177ff32 100644 --- a/drivers/telescope/lx200am5.cpp +++ b/drivers/telescope/lx200am5.cpp @@ -417,6 +417,16 @@ bool LX200AM5::goHome() return sendCommand(":hC#"); } +///////////////////////////////////////////////////////////////////////////// +/// +///////////////////////////////////////////////////////////////////////////// +bool LX200AM5::setHome() +{ + const char cmd[] = ":SOa#"; + char status ='0'; + return sendCommand(cmd, &status, strlen(cmd), sizeof(status)) && status == '1'; +} + ///////////////////////////////////////////////////////////////////////////// /// ///////////////////////////////////////////////////////////////////////////// @@ -651,6 +661,12 @@ IPState LX200AM5::ExecuteHomeAction(TelescopeHomeAction action) else return IPS_ALERT; + case HOME_SET: + if (setHome()) + return IPS_OK; + else + return IPS_ALERT; + default: return IPS_ALERT; diff --git a/drivers/telescope/lx200am5.h b/drivers/telescope/lx200am5.h index 5eb7ac4cc0..35ba04414e 100644 --- a/drivers/telescope/lx200am5.h +++ b/drivers/telescope/lx200am5.h @@ -112,6 +112,7 @@ class LX200AM5 : public LX200Generic // Homing bool goHome(); + bool setHome(); // Guide Rate bool setGuideRate(double value);