altos/flash-loader: On STM, don't include ao_usb_disable
authorKeith Packard <keithp@keithp.com>
Wed, 16 Jul 2014 05:52:35 +0000 (22:52 -0700)
committerKeith Packard <keithp@keithp.com>
Fri, 27 Apr 2018 02:24:21 +0000 (19:24 -0700)
This saves a bit of space, keeping the flash loader under 4k on fox

Signed-off-by: Keith Packard <keithp@keithp.com>
src/product/ao_flash_pins.h
src/stm/ao_usb_stm.c

index ff8d3273c03147c038a781e4144f3904295b5c06..019b542529807103d8a16b09c82a1bd227630504 100644 (file)
@@ -25,6 +25,7 @@
 
 #define HAS_USB                        1
 #define USE_USB_STDIO          0
+#define HAS_USB_DISABLE                0
 #define HAS_BEEP               0
 #define HAS_TASK               0
 #define HAS_ECHO               0
index e436d264088221aa2f84f0b05cb316f238dde2e0..b06814d23184fcf992b7df4fc880fd598986c31c 100644 (file)
@@ -970,6 +970,11 @@ ao_usb_getchar(void)
        return c;
 }
 
+#ifndef HAS_USB_DISABLE
+#define HAS_USB_DISABLE 1
+#endif
+
+#if HAS_USB_DISABLE
 void
 ao_usb_disable(void)
 {
@@ -987,6 +992,7 @@ ao_usb_disable(void)
        stm_rcc.apb1enr &= ~(1 << STM_RCC_APB1ENR_USBEN);
        ao_arch_release_interrupts();
 }
+#endif
 
 void
 ao_usb_enable(void)