altos: Make debug telemini firmware a bit easier to build
authorKeith Packard <keithp@keithp.com>
Thu, 23 Jan 2020 22:32:10 +0000 (14:32 -0800)
committerKeith Packard <keithp@keithp.com>
Thu, 23 Jan 2020 22:32:10 +0000 (14:32 -0800)
To enable debugging, we need to stop using the SWD GPIO pins, which
are normally used to trigger boot-time firmware behavior -- SWDIO is
used to force entry to the boot loader while SWDCLK is used to force
default frequency and callsign.

This patch makes it easy to edit ao_pins.h to disable the default
frequency option.

Signed-off-by: Keith Packard <keithp@keithp.com>
src/telemini-v3.0/ao_telemini.c

index bb3bc05424e2083eee81bc61cbde082a8b5a8876..d571d340f38919ee46f9ed6dd2f8ab1dd013b903 100644 (file)
@@ -19,6 +19,7 @@
 #include <ao.h>
 #include <ao_exti.h>
 
+#if HAS_FORCE_FREQ
 static void
 ao_check_recovery(void)
 {
@@ -33,11 +34,14 @@ ao_check_recovery(void)
        ao_gpio_set_mode(AO_RECOVERY_PORT, AO_RECOVERY_PIN, 0);
        ao_disable_port(AO_RECOVERY_PORT);
 }
+#endif
 
 int
 main(void)
 {
+#if HAS_FORCE_FREQ
        ao_check_recovery();
+#endif
 
        ao_clock_init();
        ao_task_init();