From a86ec7c81d7ad2037e900899a0b32c5592cae7c0 Mon Sep 17 00:00:00 2001 From: AJM Date: Thu, 22 Apr 2010 23:27:09 -0400 Subject: c++ ified all of the usb_core files, added the auto-reset feature to the virtual com port, got the descriptors in functional although not pretty order that can be fixed using the attribute packing --- core/usb/usb_hardware.h | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'core/usb/usb_hardware.h') diff --git a/core/usb/usb_hardware.h b/core/usb/usb_hardware.h index e60567d..d7e4ff0 100644 --- a/core/usb/usb_hardware.h +++ b/core/usb/usb_hardware.h @@ -25,8 +25,7 @@ #ifndef __HARDWARE_H #define __HARDWARE_H -#include "stm32f10x_type.h" -#include "cortexm3_macro.h" +#include "usb_type.h" /* macro'd register and peripheral definitions */ #define RCC ((u32)0x40021000) @@ -74,6 +73,9 @@ #define SET_REG(addr,val) *(vu32*)(addr)=val #define GET_REG(addr) *(vu32*)(addr) +#if defined(__cplusplus) +extern "C" { +#endif /* todo: there must be some major misunderstanding in how we access regs. The direct access approach (GET_REG) causes the usb init to fail upon trying to activate RCC_APB1 |= 0x00800000. However, using the struct approach @@ -111,7 +113,7 @@ typedef struct { u8 NVIC_IRQChannel; u8 NVIC_IRQChannelPreemptionPriority; u8 NVIC_IRQChannelSubPriority; - bool NVIC_IRQChannelCmd; /* TRUE for enable */ + USB_Bool NVIC_IRQChannelCmd; /* TRUE for enable */ } NVIC_InitTypeDef; typedef struct { @@ -142,4 +144,8 @@ void setupCLK (void); void nvicInit (NVIC_InitTypeDef*); void nvicDisableInterrupts(void); +#if defined(__cplusplus) +} +#endif + #endif -- cgit v1.2.3