diff options
author | Kevin O'Connor <kevin@koconnor.net> | 2021-12-19 10:07:21 -0500 |
---|---|---|
committer | Kevin O'Connor <kevin@koconnor.net> | 2021-12-23 22:15:25 -0500 |
commit | 7d2c96624124ef7eb5f41fb55b86d14fe1766b20 (patch) | |
tree | c449fea2b3db98fbdfe1978476202d27f1d35ff8 /src/stm32/usbfs.c | |
parent | 6e8f28117b25a19c865b9ac8660c22339b2e2b76 (diff) | |
download | kutter-7d2c96624124ef7eb5f41fb55b86d14fe1766b20.tar.gz kutter-7d2c96624124ef7eb5f41fb55b86d14fe1766b20.tar.xz kutter-7d2c96624124ef7eb5f41fb55b86d14fe1766b20.zip |
stm32: Simplify irq declaration in usbfs.c
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Diffstat (limited to 'src/stm32/usbfs.c')
-rw-r--r-- | src/stm32/usbfs.c | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/src/stm32/usbfs.c b/src/stm32/usbfs.c index aadc4027..baaa0c2b 100644 --- a/src/stm32/usbfs.c +++ b/src/stm32/usbfs.c @@ -16,17 +16,21 @@ #include "internal.h" // GPIO #include "sched.h" // DECL_INIT +#if CONFIG_MACH_STM32F103 + // Transfer memory is accessed with 32bits, but contains only 16bits of data + typedef volatile uint32_t epmword_t; + #define USBx_IRQn USB_LP_IRQn +#elif CONFIG_MACH_STM32F0 + // Transfer memory is accessed with 16bits and contains 16bits of data + typedef volatile uint16_t epmword_t; + #define USBx_IRQn USB_IRQn +#endif + /**************************************************************** * USB transfer memory ****************************************************************/ -#if CONFIG_MACH_STM32F103 -typedef volatile uint32_t epmword_t; -#else -typedef volatile uint16_t epmword_t; -#endif - struct ep_desc { epmword_t addr_tx, count_tx, addr_rx, count_rx; }; @@ -293,10 +297,6 @@ usb_init(void) USB->DADDR = 0; USB->CNTR = USB_CNTR_RESETM; USB->ISTR = 0; -#if CONFIG_MACH_STM32F103 - armcm_enable_irq(USB_IRQHandler, USB_LP_IRQn, 1); -#elif CONFIG_MACH_STM32F0 - armcm_enable_irq(USB_IRQHandler, USB_IRQn, 1); -#endif + armcm_enable_irq(USB_IRQHandler, USBx_IRQn, 1); } DECL_INIT(usb_init); |