Updated:
		Added check for values greater than 359.4999 and adjust
		it to 0 for compatibility with DCU-1


git-svn-id: https://hamlib.svn.sourceforge.net/svnroot/hamlib/trunk@1347 7ae35d74-ebe9-4afe-98af-79ac388436b8
Hamlib-1.1.4
Nate Bargmann, N0NB 2003-01-12 14:59:46 +00:00
rodzic f8748e3817
commit 81be20c293
1 zmienionych plików z 5 dodań i 2 usunięć

Wyświetl plik

@ -9,7 +9,7 @@
* supports the Hy-Gain DCU-1.
*
*
* $Id: rotorez.c,v 1.2 2003-01-12 14:29:14 n0nb Exp $
* $Id: rotorez.c,v 1.3 2003-01-12 14:59:46 n0nb Exp $
*
*
* This library is free software; you can redistribute it and/or
@ -242,7 +242,7 @@ static int rotorez_rot_cleanup(ROT *rot) {
/*
* Set position
* DCU protocol supports azimuth only--elevation is ignored
* Range is an integer, 0 to 360 degrees
* Range is converted to an integer string, 0 to 360 degrees
*/
static int rotorez_rot_set_position(ROT *rot, azimuth_t azimuth, elevation_t elevation) {
@ -258,6 +258,9 @@ static int rotorez_rot_set_position(ROT *rot, azimuth_t azimuth, elevation_t ele
if (azimuth < 0 || azimuth > 360)
return -RIG_EINVAL;
if (azimuth > 359.4999) /* DCU-1 compatibility */
azimuth = 0;
sprintf(cmdstr, "AP1%03.0f;", azimuth); /* Target bearing */
err = rotorez_send_priv_cmd(rot, cmdstr);
if (err != RIG_OK)