git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@2724 35acf78f-673a-0410-8e92-d51de3d6d3f4
parent
77934792d5
commit
3c6e54a52e
|
@ -208,7 +208,7 @@ CH_IRQ_HANDLER(USB_LP_IRQHandler) {
|
|||
if (epr & EPR_CTR_RX) {
|
||||
EPR_CLEAR_CTR_RX(ep);
|
||||
/* OUT endpoint, receive.*/
|
||||
if (epcp->flags & USB_EP_FLAGS_IN_PACKET_MODE) {
|
||||
if (epcp->flags & USB_EP_FLAGS_OUT_PACKET_MODE) {
|
||||
/* Packet mode, just invokes the callback.*/
|
||||
(usbp)->ep[ep]->receiving = FALSE;
|
||||
epcp->out_cb(usbp, ep);
|
||||
|
@ -397,7 +397,7 @@ void usb_lld_init_endpoint(USBDriver *usbp, usbep_t ep) {
|
|||
/* OUT endpoint settings. If the endpoint is in packet mode then it must
|
||||
start ready to accept data else it must start in NAK mode.*/
|
||||
if (epcp->out_cb) {
|
||||
if (epcp->flags & USB_EP_FLAGS_IN_PACKET_MODE) {
|
||||
if (epcp->flags & USB_EP_FLAGS_OUT_PACKET_MODE) {
|
||||
usbp->ep[ep]->receiving = TRUE;
|
||||
epr |= EPR_STAT_RX_VALID;
|
||||
}
|
||||
|
|
|
@ -333,41 +333,6 @@ static const SerialUSBConfig serusbcfg = {
|
|||
INTERRUPT_REQUEST_EP
|
||||
};
|
||||
|
||||
#if 0
|
||||
#include "usb_cdc.h"
|
||||
static cdc_linecoding_t linecoding = {
|
||||
{0x00, 0x96, 0x00, 0x00}, /* 38400. */
|
||||
LC_STOP_1, LC_PARITY_NONE, 8
|
||||
};
|
||||
bool_t sduRequestsHook(USBDriver *usbp) {
|
||||
|
||||
if ((usbp->setup[0] & USB_RTYPE_TYPE_MASK) == USB_RTYPE_TYPE_CLASS) {
|
||||
switch (usbp->setup[1]) {
|
||||
case CDC_GET_LINE_CODING:
|
||||
usbSetupTransfer(usbp, (uint8_t *)&linecoding, sizeof(linecoding));
|
||||
return TRUE;
|
||||
case CDC_SET_LINE_CODING:
|
||||
usbSetupTransfer(usbp, (uint8_t *)&linecoding, sizeof(linecoding));
|
||||
return TRUE;
|
||||
case CDC_SET_CONTROL_LINE_STATE:
|
||||
/* Nothing to do, there are no control lines.*/
|
||||
usbSetupTransfer(usbp, NULL, 0);
|
||||
return TRUE;
|
||||
default:
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
#endif
|
||||
|
||||
USBConfig usbconfig = {
|
||||
usb_event,
|
||||
get_descriptor,
|
||||
sduRequestsHook,
|
||||
NULL
|
||||
};
|
||||
|
||||
/*===========================================================================*/
|
||||
/* Generic code. */
|
||||
/*===========================================================================*/
|
||||
|
@ -425,7 +390,6 @@ int main(void) {
|
|||
/*
|
||||
* Activates the USB driver and then the USB bus pull-up on D+.
|
||||
*/
|
||||
// usbStart(&USBD1, &usbconfig);
|
||||
sduObjectInit(&SDU1);
|
||||
sduStart(&SDU1, &serusbcfg);
|
||||
palClearPad(GPIOC, GPIOC_USB_DISC);
|
||||
|
|
Loading…
Reference in New Issue