aboutsummaryrefslogtreecommitdiffstats
path: root/libmaple/usb/usb_hardware.h
diff options
context:
space:
mode:
authorMarti Bolivar <mbolivar@leaflabs.com>2011-06-15 17:11:41 -0400
committerMarti Bolivar <mbolivar@leaflabs.com>2011-10-18 13:30:17 -0400
commitd85462d0517baac39f3c316924162cca3d9c785a (patch)
tree08a3417acacbae3f4666f0ee0cad893cfe3f8a8c /libmaple/usb/usb_hardware.h
parentc6c959682084c8493a0c39754374e7dbe6cf1708 (diff)
downloadlibrambutan-d85462d0517baac39f3c316924162cca3d9c785a.tar.gz
librambutan-d85462d0517baac39f3c316924162cca3d9c785a.zip
usb: Replace duplicated code with nvic.h API.
Replace calls to usbEnbISR()/usbDsbISR() with nvic_irq_enable()/nvic_irq_disable(). Remove ST-style code. Use nvic_sys_reset() instead of systemHardReset(). Rename some conflicting #defines that including nvic.h created. Signed-off-by: Marti Bolivar <mbolivar@leaflabs.com>
Diffstat (limited to 'libmaple/usb/usb_hardware.h')
-rw-r--r--libmaple/usb/usb_hardware.h19
1 files changed, 2 insertions, 17 deletions
diff --git a/libmaple/usb/usb_hardware.h b/libmaple/usb/usb_hardware.h
index cfead1a..6f347bb 100644
--- a/libmaple/usb/usb_hardware.h
+++ b/libmaple/usb/usb_hardware.h
@@ -36,9 +36,8 @@
#define USB_PACKET_BUFFER ((u32)0x40006000)
-#define SCS_BASE ((u32)0xE000E000)
-#define NVIC_BASE (SCS_BASE + 0x0100)
-#define SCB_BASE (SCS_BASE + 0x0D00)
+#define SCS_BASE_ADDR ((u32)0xE000E000)
+#define SCB_BASE_ADDR (SCS_BASE_ADDR + 0x0D00)
#define SCS 0xE000E000
#define NVIC (SCS+0x100)
@@ -86,20 +85,6 @@ typedef struct
#define pRCC ((RCC_RegStruct *) RCC_BASE)
typedef struct {
- vu32 ISER[2];
- u32 RESERVED0[30];
- vu32 ICER[2];
- u32 RSERVED1[30];
- vu32 ISPR[2];
- u32 RESERVED2[30];
- vu32 ICPR[2];
- u32 RESERVED3[30];
- vu32 IABR[2];
- u32 RESERVED4[62];
- vu32 IPR[15];
-} NVIC_TypeDef;
-
-typedef struct {
u8 NVIC_IRQChannel;
u8 NVIC_IRQChannelPreemptionPriority;
u8 NVIC_IRQChannelSubPriority;