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

This commit is contained in:
gdisirio 2012-07-02 18:47:09 +00:00
parent d21d98e5bf
commit ec9736a27d
1 changed files with 5 additions and 5 deletions

View File

@ -322,12 +322,12 @@ void sduDataTransmitted(USBDriver *usbp, usbep_t ep) {
so it is safe to transmit without a check.*/ so it is safe to transmit without a check.*/
chSysUnlockFromIsr(); chSysUnlockFromIsr();
usbPrepareQueuedTransmit(sdup->config->usbp, usbPrepareQueuedTransmit(usbp,
USB_CDC_DATA_REQUEST_EP, USB_CDC_DATA_REQUEST_EP,
&sdup->oqueue, n); &sdup->oqueue, n);
chSysLockFromIsr(); chSysLockFromIsr();
usbStartTransmitI(sdup->config->usbp, USB_CDC_DATA_REQUEST_EP); usbStartTransmitI(usbp, USB_CDC_DATA_REQUEST_EP);
} }
chSysUnlockFromIsr(); chSysUnlockFromIsr();
@ -352,19 +352,19 @@ void sduDataReceived(USBDriver *usbp, usbep_t ep) {
/* Writes to the input queue can only happen when there is enough space /* Writes to the input queue can only happen when there is enough space
to hold at least one packet.*/ to hold at least one packet.*/
maxsize = sdup->config->usbp->epc[USB_CDC_DATA_AVAILABLE_EP]->out_maxsize; maxsize = usbp->epc[USB_CDC_DATA_AVAILABLE_EP]->out_maxsize;
if ((n = chIQGetEmptyI(&sdup->iqueue)) >= maxsize) { if ((n = chIQGetEmptyI(&sdup->iqueue)) >= maxsize) {
/* The endpoint cannot be busy, we are in the context of the callback, /* The endpoint cannot be busy, we are in the context of the callback,
so a packet is in the buffer for sure.*/ so a packet is in the buffer for sure.*/
chSysUnlockFromIsr(); chSysUnlockFromIsr();
n = (n / maxsize) * maxsize; n = (n / maxsize) * maxsize;
usbPrepareQueuedReceive(sdup->config->usbp, usbPrepareQueuedReceive(usbp,
USB_CDC_DATA_AVAILABLE_EP, USB_CDC_DATA_AVAILABLE_EP,
&sdup->iqueue, n); &sdup->iqueue, n);
chSysLockFromIsr(); chSysLockFromIsr();
usbStartReceiveI(sdup->config->usbp, USB_CDC_DATA_AVAILABLE_EP); usbStartReceiveI(usbp, USB_CDC_DATA_AVAILABLE_EP);
} }
chSysUnlockFromIsr(); chSysUnlockFromIsr();