Did some more splitting of responsibilities in the code

This commit is contained in:
Doug Brown 2011-12-26 15:02:39 -08:00
parent e8999cfc54
commit 147c2bfda3
3 changed files with 43 additions and 21 deletions

29
cdc_device_definition.c Normal file
View File

@ -0,0 +1,29 @@
/*
* cdc_device_definition.c
*
* Created on: Dec 26, 2011
* Author: Doug
*/
#include "LUFA/Drivers/USB/USB.h"
#include "Descriptors.h"
USB_ClassInfo_CDC_Device_t VirtualSerial_CDC_Interface =
{
.Config =
{
.ControlInterfaceNumber = 0,
.DataINEndpointNumber = CDC_TX_EPNUM,
.DataINEndpointSize = CDC_TXRX_EPSIZE,
.DataINEndpointDoubleBank = true,
.DataOUTEndpointNumber = CDC_RX_EPNUM,
.DataOUTEndpointSize = CDC_TXRX_EPSIZE,
.DataOUTEndpointDoubleBank = true,
.NotificationEndpointNumber = CDC_NOTIFICATION_EPNUM,
.NotificationEndpointSize = CDC_NOTIFICATION_EPSIZE,
.NotificationEndpointDoubleBank = false,
},
};

13
cdc_device_definition.h Normal file
View File

@ -0,0 +1,13 @@
/*
* cdc_device_definition.h
*
* Created on: Dec 26, 2011
* Author: Doug
*/
#ifndef CDC_DEVICE_DEFINITION_H_
#define CDC_DEVICE_DEFINITION_H_
extern USB_ClassInfo_CDC_Device_t VirtualSerial_CDC_Interface;
#endif /* CDC_DEVICE_DEFINITION_H_ */

View File

@ -7,7 +7,7 @@
#include "usb_serial.h"
#include "../LUFA/Drivers/USB/USB.h"
#include "../Descriptors.h"
#include "../cdc_device_definition.h"
#include "../external_mem.h"
#include "../tests/simm_electrical_test.h"
#include "../programmer_protocol.h"
@ -22,26 +22,6 @@
#error Write chunk size should be a multiple of 4 bytes
#endif
USB_ClassInfo_CDC_Device_t VirtualSerial_CDC_Interface =
{
.Config =
{
.ControlInterfaceNumber = 0,
.DataINEndpointNumber = CDC_TX_EPNUM,
.DataINEndpointSize = CDC_TXRX_EPSIZE,
.DataINEndpointDoubleBank = true,
.DataOUTEndpointNumber = CDC_RX_EPNUM,
.DataOUTEndpointSize = CDC_TXRX_EPSIZE,
.DataOUTEndpointDoubleBank = true,
.NotificationEndpointNumber = CDC_NOTIFICATION_EPNUM,
.NotificationEndpointSize = CDC_NOTIFICATION_EPSIZE,
.NotificationEndpointDoubleBank = false,
},
};
void USBSerial_Init(void)
{
USB_Init();