Remove hacky workaround. Turns out we can keep BTN0 :-)

This commit is contained in:
Stefan `Sec` Zehl 2011-06-26 11:45:05 +02:00
parent 878092c569
commit 31584b0a4d
3 changed files with 12 additions and 9 deletions

View File

@ -19,13 +19,10 @@ uint8_t getInput(void) {
result += BTN_ENTER; result += BTN_ENTER;
} }
if(IOCON_PIO0_1 & 1 == 1){ if (gpioGetValue(RB_BTN0)==0) {
; // disable left while(gpioGetValue(RB_BTN0)==0);
}else result += BTN_LEFT;
if (gpioGetValue(RB_BTN0)==0) { }
while(gpioGetValue(RB_BTN0)==0);
result += BTN_LEFT;
}
if (gpioGetValue(RB_BTN1)==0) { if (gpioGetValue(RB_BTN1)==0) {
while(gpioGetValue(RB_BTN1)==0); while(gpioGetValue(RB_BTN1)==0);

View File

@ -42,8 +42,9 @@ void usbMSCInit(void) {
SCB_USBCLKSEL = SCB_USBCLKSEL_SOURCE_USBPLLOUT; SCB_USBCLKSEL = SCB_USBCLKSEL_SOURCE_USBPLLOUT;
// Set USB pin functions // Set USB pin functions
IOCON_PIO0_1 &= ~IOCON_PIO0_1_FUNC_MASK; // bsx says, its only needed for usb-hid. And it conflicts with btn_0
IOCON_PIO0_1 |= IOCON_PIO0_1_FUNC_CLKOUT; // CLK OUT // IOCON_PIO0_1 &= ~IOCON_PIO0_1_FUNC_MASK;
// IOCON_PIO0_1 |= IOCON_PIO0_1_FUNC_CLKOUT; // CLK OUT
IOCON_PIO0_3 &= ~IOCON_PIO0_3_FUNC_MASK; IOCON_PIO0_3 &= ~IOCON_PIO0_3_FUNC_MASK;
IOCON_PIO0_3 |= IOCON_PIO0_3_FUNC_USB_VBUS; // VBus IOCON_PIO0_3 |= IOCON_PIO0_3_FUNC_USB_VBUS; // VBus
IOCON_PIO0_6 &= ~IOCON_PIO0_6_FUNC_MASK; IOCON_PIO0_6 &= ~IOCON_PIO0_6_FUNC_MASK;
@ -91,3 +92,7 @@ void USB_IRQHandler() {
} }
#endif #endif
void usbMSCOff(void) {
(*rom)->pUSBD->connect(false); /* USB Disconnect */
}

View File

@ -42,5 +42,6 @@
void usbMSCWrite(uint32_t offset, uint8_t src[], uint32_t length); void usbMSCWrite(uint32_t offset, uint8_t src[], uint32_t length);
void usbMSCRead(uint32_t offset, uint8_t dst[], uint32_t length); void usbMSCRead(uint32_t offset, uint8_t dst[], uint32_t length);
void usbMSCInit(void); void usbMSCInit(void);
void usbMSCOff(void);
#endif #endif