diff --git a/Android.mk b/Android.mk index 1abfaccae..e6bec8d1b 100644 --- a/Android.mk +++ b/Android.mk @@ -47,6 +47,7 @@ include $(TOP_PATH)/rotators/prosistel/Android.mk include $(TOP_PATH)/rotators/rotorez/Android.mk include $(TOP_PATH)/rotators/sartek/Android.mk include $(TOP_PATH)/rotators/satel/Android.mk +include $(TOP_PATH)/rotators/skywatcher/Android.mk include $(TOP_PATH)/rotators/spid/Android.mk include $(TOP_PATH)/rotators/ts7400/Android.mk include $(TOP_PATH)/rotators/radant/Android.mk diff --git a/rotators/skywatcher/skywatcher.c b/rotators/skywatcher/skywatcher.c index 6c82e11e6..a05fd3563 100644 --- a/rotators/skywatcher/skywatcher.c +++ b/rotators/skywatcher/skywatcher.c @@ -1,3 +1,24 @@ +/* + * Hamlib Rotator backend - SkyWatcher + * Copyright (c) 2024 by Andrey Rodionov + * + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + */ + #include #include "skywatcher.h" #include "register.h" @@ -100,7 +121,7 @@ int skywatcher_get_motor_position(ROT *rot, int motor_index, float *result) { char req[16]; SNPRINTF(req, sizeof(req), ":j%d\r", motor_index); ERROR_CHECK(skywatcher_cmd(rot, req, str, sizeof(str))); - long motor_ticks = skywatcher_convert24bit(strtol(str, NULL, 16)) - 0x800000; + long motor_ticks = skywatcher_convert24bit(strtol(str, NULL, 16)) ^ 0x800000; uint32_t cpr; ERROR_CHECK(skywatcher_get_spr(rot, motor_index, &cpr)); double ticks_per_angle = (double) cpr / 360.0; diff --git a/rotators/skywatcher/skywatcher.h b/rotators/skywatcher/skywatcher.h index d45f42506..2164098ff 100644 --- a/rotators/skywatcher/skywatcher.h +++ b/rotators/skywatcher/skywatcher.h @@ -1,5 +1,5 @@ /* - * Hamlib Rotator backend - Celestron interface protocol + * Hamlib Rotator backend - SkyWatcher interface protocol * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -16,6 +16,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * */ + #ifndef HAMLIB_SKYWATCHER_H #define HAMLIB_SKYWATCHER_H 1