From: Keith Packard Date: Wed, 16 Jul 2014 05:52:35 +0000 (-0700) Subject: altos/flash-loader: On STM, don't include ao_usb_disable X-Git-Tag: 1.8.6~1^2~103 X-Git-Url: https://git.gag.com/?p=fw%2Faltos;a=commitdiff_plain;h=b47796991cb6c2edb85f9201a53515b4dd28b946;hp=b478d3c3569d2f9df50b0030197468d14af67688 altos/flash-loader: On STM, don't include ao_usb_disable This saves a bit of space, keeping the flash loader under 4k on fox Signed-off-by: Keith Packard --- diff --git a/src/product/ao_flash_pins.h b/src/product/ao_flash_pins.h index ff8d3273..019b5425 100644 --- a/src/product/ao_flash_pins.h +++ b/src/product/ao_flash_pins.h @@ -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 diff --git a/src/stm/ao_usb_stm.c b/src/stm/ao_usb_stm.c index e436d264..b06814d2 100644 --- a/src/stm/ao_usb_stm.c +++ b/src/stm/ao_usb_stm.c @@ -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)