@@ -41,31 +41,31 @@ void setupUSB (void) {
4141
4242#ifdef HAS_MAPLE_HARDWARE
4343 /* Setup USB DISC pin as output open drain */
44- SET_REG (GPIO_CR (USB_DISC_BANK ,USB_DISC ),(GET_REG (GPIO_CR (USB_DISC_BANK ,USB_DISC )) & crMask (USB_DISC )) | CR_OUTPUT_OD << CR_SHITF (LED_PIN ));
45- gpio_write_bit (USB_DISC_BANK ,USB_DISC ,1 );
44+ SET_REG (GPIO_CR (USB_DISC_BANK ,USB_DISC_PIN ),(GET_REG (GPIO_CR (USB_DISC_BANK ,USB_DISC_PIN )) & crMask (USB_DISC_PIN )) | CR_OUTPUT_OD << CR_SHITF (USB_DISC_PIN ));
45+ gpio_write_bit (USB_DISC_BANK ,USB_DISC_PIN ,1 );
4646
4747 /* turn on the USB clock */
4848 //pRCC->APB1ENR |= RCC_APB1ENR_USB_CLK;// done in setupCLK()
4949
50- gpio_write_bit (USB_DISC_BANK ,USB_DISC ,0 ); /* present ourselves to the host */
50+ gpio_write_bit (USB_DISC_BANK ,USB_DISC_PIN ,0 ); /* present ourselves to the host */
5151#else
5252
5353/* Generic boards don't have disconnect hardware, so we drive PA12 which is connected to the usb D+ line*/
5454#define USB_DISC_BANK GPIOA
55- #define USB_DISC 12
55+ #define USB_DISC_PIN 12
5656
57- SET_REG (GPIO_CR (USB_DISC_BANK ,USB_DISC ),
58- (GET_REG (GPIO_CR (USB_DISC_BANK ,USB_DISC )) & crMask (USB_DISC )) | CR_OUTPUT_PP << CR_SHITF (USB_DISC ));
57+ SET_REG (GPIO_CR (USB_DISC_BANK ,USB_DISC_PIN ),
58+ (GET_REG (GPIO_CR (USB_DISC_BANK ,USB_DISC_PIN )) & crMask (USB_DISC_PIN )) | CR_OUTPUT_PP << CR_SHITF (USB_DISC_PIN ));
5959
60- gpio_write_bit (USB_DISC_BANK ,USB_DISC ,0 ); /* present ourselves to the host */
60+ gpio_write_bit (USB_DISC_BANK ,USB_DISC_PIN ,0 ); /* present ourselves to the host */
6161
6262 volatile unsigned int delay ;
6363 for (delay = 0 ;delay < 256 ;delay ++ );
6464
6565 // volatile unsigned x = 1024; do { ; }while(--x);// wait a moment
6666 /* turn on the USB clock */
67- SET_REG (GPIO_CR (USB_DISC_BANK ,USB_DISC ),
68- (GET_REG (GPIO_CR (USB_DISC_BANK ,USB_DISC )) & crMask (USB_DISC )) | CR_INPUT << CR_SHITF (USB_DISC )); //Sets the PA12 as floating input
67+ SET_REG (GPIO_CR (USB_DISC_BANK ,USB_DISC_PIN ),
68+ (GET_REG (GPIO_CR (USB_DISC_BANK ,USB_DISC_PIN )) & crMask (USB_DISC_PIN )) | CR_INPUT << CR_SHITF (USB_DISC_PIN )); //Sets the PA12 as floating input
6969 // pRCC->APB1ENR |= RCC_APB1ENR_USB_CLK;
7070#endif
7171 /* initialize the usb application */
@@ -85,11 +85,11 @@ void setupUSB (void) {
8585
8686
8787void usbDsbBus (void ) {
88- // setPin(USB_DISC_BANK,USB_DISC );
88+ // setPin(USB_DISC_BANK,USB_DISC_PIN );
8989usbPowerOff ();
9090// SET_REG(USB_DISC_CR,
9191// (GET_REG(USB_DISC_CR) & USB_DISC_CR_MASK) | USB_DISC_CR_OUTPUT);
92- // resetPin(USB_DISC_BANK, USB_DISC ); /* Pull DP+ down */
92+ // resetPin(USB_DISC_BANK, USB_DISC_PIN ); /* Pull DP+ down */
9393// volatile unsigned x = 500000; do { ; }while(--x);
9494// SET_REG(USB_DISC_CR,
9595// (GET_REG(USB_DISC_CR) & USB_DISC_CR_MASK) | USB_DISC_CR_INPUT); //Sets the PA12 as floating input
@@ -264,7 +264,7 @@ RESULT usbPowerOff(void) {
264264
265265 /* note that all weve done here is powerdown the
266266 usb peripheral. we have no disabled the clocks,
267- pulled the usb_disc pin back up, or reset the
267+ pulled the USB_DISC_PIN pin back up, or reset the
268268 application state machines */
269269
270270 return USB_SUCCESS ;
0 commit comments