From 62a4bd8363eb02cf11f12b329db04a97fb5cd7c9 Mon Sep 17 00:00:00 2001 From: Rob Frohne Date: Mon, 13 Feb 2012 20:57:18 -0800 Subject: [PATCH] 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 --- heathkit/hd1780.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/heathkit/hd1780.c b/heathkit/hd1780.c index 05ebcce72..a6c5f098a 100644 --- a/heathkit/hd1780.c +++ b/heathkit/hd1780.c @@ -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 + to signify that everything finished. The HD 1780 * sends a when it is finished rotating. */