git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@4568 35acf78f-673a-0410-8e92-d51de3d6d3f4

master
gdisirio 2012-08-14 14:24:06 +00:00
parent 452f77011d
commit 0bae886788
2 changed files with 13 additions and 4 deletions

View File

@ -681,8 +681,12 @@ void usb_lld_start(USBDriver *usbp) {
OTG->DIEPMSK = 0; OTG->DIEPMSK = 0;
OTG->DOEPMSK = 0; OTG->DOEPMSK = 0;
OTG->DAINTMSK = 0; OTG->DAINTMSK = 0;
OTG->GINTMSK = GINTMSK_ENUMDNEM | GINTMSK_USBRSTM | /*GINTMSK_USBSUSPM | if (usbp->config->sof_cb == NULL)
GINTMSK_ESUSPM |*/ GINTMSK_SOFM; OTG->GINTMSK = GINTMSK_ENUMDNEM | GINTMSK_USBRSTM /*| GINTMSK_USBSUSPM |
GINTMSK_ESUSPM |*/;
else
OTG->GINTMSK = GINTMSK_ENUMDNEM | GINTMSK_USBRSTM /*| GINTMSK_USBSUSPM |
GINTMSK_ESUSPM */ | GINTMSK_SOFM;
OTG->GINTSTS = 0xFFFFFFFF; /* Clears all pending IRQs, if any. */ OTG->GINTSTS = 0xFFFFFFFF; /* Clears all pending IRQs, if any. */
/* Global interrupts enable.*/ /* Global interrupts enable.*/

View File

@ -421,7 +421,9 @@ static void cmd_write(BaseSequentialStream *chp, int argc, char *argv[]) {
while (chnGetTimeout((BaseChannel *)chp, TIME_IMMEDIATE) == Q_TIMEOUT) { while (chnGetTimeout((BaseChannel *)chp, TIME_IMMEDIATE) == Q_TIMEOUT) {
chSequentialStreamWrite(&SDU1, buf, sizeof buf - 1); chSequentialStreamWrite(&SDU1, buf, sizeof buf - 1);
palTogglePad(GPIOD, GPIOD_LED4);
} }
palClearPad(GPIOD, GPIOD_LED4);
chprintf(chp, "\r\n\nstopped\r\n"); chprintf(chp, "\r\n\nstopped\r\n");
} }
@ -451,10 +453,13 @@ static msg_t Thread1(void *arg) {
(void)arg; (void)arg;
chRegSetThreadName("blinker"); chRegSetThreadName("blinker");
while (TRUE) { while (TRUE) {
systime_t time;
time = USBD1.state == USB_ACTIVE ? 250 : 500;
palClearPad(GPIOD, GPIOD_LED6); palClearPad(GPIOD, GPIOD_LED6);
chThdSleepMilliseconds(500); chThdSleepMilliseconds(time);
palSetPad(GPIOD, GPIOD_LED6); palSetPad(GPIOD, GPIOD_LED6);
chThdSleepMilliseconds(500); chThdSleepMilliseconds(time);
} }
} }