Correct previous patch setting limits

I should have done more testing on my last patch for you.  I found a
bug, in that it wouldn't rotate for [0,-180).  That is now fixed in
this hd1780.c enclosed.

Signed-off-by: Nate Bargmann <n0nb@n0nb.us>
Hamlib-3.0
Rob Frohne 2012-02-13 20:57:18 -08:00 zatwierdzone przez Nate Bargmann
rodzic b6a9206fc2
commit 62a4bd8363
1 zmienionych plików z 2 dodań i 3 usunięć

Wyświetl plik

@ -165,10 +165,10 @@ static int hd1780_rot_set_position(ROT *rot, azimuth_t azimuth, elevation_t elev
if (!rot)
return -RIG_EINVAL;
if ((azimuth - 180 < hd1780_rot_caps.min_az) || (azimuth - 180 > hd1780_rot_caps.max_az))
if (azimuth < hd1780_rot_caps.min_az || azimuth > hd1780_rot_caps.max_az)
return -RIG_EINVAL;
if(azimuth < 0) azimuth = azimuth + 360;
sprintf(cmdstr, "%03.0f", azimuth); /* Target bearing */
err = hd1780_send_priv_cmd(rot, cmdstr);
if (err != RIG_OK)
@ -177,7 +177,6 @@ static int hd1780_rot_set_position(ROT *rot, azimuth_t azimuth, elevation_t elev
err = hd1780_send_priv_cmd(rot, execstr); /* Execute command */
if (err != RIG_OK)
return err;
/* We need to look for the <CR> +<LF> to signify that everything finished. The HD 1780
* sends a <CR> when it is finished rotating.
*/