summaryrefslogtreecommitdiff
path: root/ao-bringup
diff options
context:
space:
mode:
authorKeith Packard <keithp@keithp.com>2010-03-12 10:35:12 -0800
committerKeith Packard <keithp@keithp.com>2010-03-12 10:35:12 -0800
commit93df98898f8cd199ae13158bc4f65e3494c954ad (patch)
tree1206218556ed9c92aa298be70ada13e13450a940 /ao-bringup
parent6e61170d42936c18cd6efba6f4c14af616a30745 (diff)
Round radio calibration value instead of truncating
The radio calibration function in the bring-up code was truncating the radio calibration value which caused the resulting frequency to always measure above the target frequency, instead of trying to get as close as possible. This change will result in a closer frequency match, but may sometimes be below the target frequency. Signed-off-by: Keith Packard <keithp@keithp.com>
Diffstat (limited to 'ao-bringup')
-rwxr-xr-xao-bringup/turnon_teledongle2
1 files changed, 1 insertions, 1 deletions
diff --git a/ao-bringup/turnon_teledongle b/ao-bringup/turnon_teledongle
index 1786f251..97c1e419 100755
--- a/ao-bringup/turnon_teledongle
+++ b/ao-bringup/turnon_teledongle
@@ -19,7 +19,7 @@ sleep 5
echo -n "Generating RF carrier. Please enter measured frequency: "
read FREQ
-CAL_VALUE=`nickle -e "ceil(434.55 / $FREQ * 1186611)"`
+CAL_VALUE=`nickle -e "floor(434.55 / $FREQ * 1186611 + 0.5)"`
echo "Programming flash with cal value " $CAL_VALUE
ao-load --cal $CAL_VALUE /usr/share/altos/teledongle-v0.2.ihx $SERIAL