X-Git-Url: https://git.gag.com/?a=blobdiff_plain;f=ao-bringup%2Fturnon_teledongle;h=983f1010340004b69b1c7e0a74f2d5e61118a5e6;hb=cdbc29d6d86c69e70b0f105d273ee8ddd7ae290e;hp=d17e2b96caae76fef6281e3e35cee58af506a4e5;hpb=773b23c48f67564eec83fc3ee085862c547ad160;p=fw%2Faltos diff --git a/ao-bringup/turnon_teledongle b/ao-bringup/turnon_teledongle index d17e2b96..983f1010 100755 --- a/ao-bringup/turnon_teledongle +++ b/ao-bringup/turnon_teledongle @@ -28,8 +28,21 @@ echo "\t$PRODUCT_NAME v$VERSION powered from USB" echo "\t\twith ST-Link-V2 cabled to debug header" echo "\t\twith coax from UHF to frequency counter" echo -echo -n "$PRODUCT_NAME-$VERSION serial number: " -read SERIAL + +case $# in + 1) + SERIAL="$1" + echo "$PRODUCT-$VERSION serial number: $SERIAL" + ;; + 0) + echo -n "$PRODUCT-$VERSION serial number: " + read SERIAL + ;; + *) + echo "Usage: $0 " 1>&2 + exit 1; + ;; +esac BINARIES=$HOME/altusmetrumllc/Binaries @@ -58,7 +71,9 @@ esac echo 'E 0' > $dev -SERIAL=$SERIAL ./cal-freq $dev +CALFILE=cal-$SERIAL.txt + +../ao-tools/ao-cal-freq/ao-cal-freq --verbose --nosave --output=$CALFILE --tty=$dev case $? in 0) @@ -69,7 +84,7 @@ case $? in ;; esac -CAL_VALUE=`grep "^$SERIAL," cal_values | tail -1 | sed 's/^[^,]*,//'` +CAL_VALUE=`cat $CALFILE` case "$CAL_VALUE" in [1-9]*) @@ -80,6 +95,8 @@ case "$CAL_VALUE" in ;; esac +echo $SERIAL","$CAL_VALUE >> cal_values + echo "Reflashing with calibration: $CAL_VALUE" $USBLOAD --cal=$CAL_VALUE --tty=$dev $ALTOS || exit 1