From 6e785eea7b7a14ec8c1e69cad2c88836a9b1943e Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Mon, 8 Oct 2018 19:40:32 -0700 Subject: ao-bringup: Use new ao-cal-freq options when flashing teledongle v3.0 Use --nosave and --output to get the value needed to reflash the device. Signed-off-by: Keith Packard --- ao-bringup/turnon_teledongle | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/ao-bringup/turnon_teledongle b/ao-bringup/turnon_teledongle index 0cdbde7a..983f1010 100755 --- a/ao-bringup/turnon_teledongle +++ b/ao-bringup/turnon_teledongle @@ -71,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) @@ -82,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]*) @@ -93,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 -- cgit v1.2.3 From e7136c6b413c8464d32cdc4afc28c93ba1f17a3b Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Mon, 8 Oct 2018 19:42:09 -0700 Subject: altos/lpc: Make sure USB pull-up is held low at boot for 'a while' Add a delay loop to make sure the host sees the pull-up low for long enough. Signed-off-by: Keith Packard --- src/lpc/ao_usb_lpc.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/lpc/ao_usb_lpc.c b/src/lpc/ao_usb_lpc.c index c50e7528..d26a1437 100644 --- a/src/lpc/ao_usb_lpc.c +++ b/src/lpc/ao_usb_lpc.c @@ -1013,7 +1013,11 @@ void ao_usb_init(void) { #if HAS_USB_PULLUP + int i; ao_enable_output(AO_USB_PULLUP_PORT, AO_USB_PULLUP_PIN, AO_USB_PULLUP, 0); + + for (i = 0; i < 40000; i++) + ao_arch_nop(); #endif ao_usb_enable(); -- cgit v1.2.3