Rename usb_report_item_macros.h to usb_api.h, include the whole USB API into it, and include it from every file where it's needed.
This commit is contained in:
@@ -185,6 +185,11 @@
|
||||
<type>1</type>
|
||||
<locationURI>PARENT-2-PROJECT_LOC/main.c</locationURI>
|
||||
</link>
|
||||
<link>
|
||||
<name>sources/usb_api.h</name>
|
||||
<type>1</type>
|
||||
<locationURI>PARENT-2-PROJECT_LOC/usb_api.h</locationURI>
|
||||
</link>
|
||||
<link>
|
||||
<name>sources/usb_composite_device.c</name>
|
||||
<type>1</type>
|
||||
@@ -300,11 +305,6 @@
|
||||
<type>1</type>
|
||||
<locationURI>PARENT-2-PROJECT_LOC/usb_interface_mouse.h</locationURI>
|
||||
</link>
|
||||
<link>
|
||||
<name>sources/usb_report_item_macros.h</name>
|
||||
<type>1</type>
|
||||
<locationURI>PARENT-2-PROJECT_LOC/usb_report_item_macros.h</locationURI>
|
||||
</link>
|
||||
<link>
|
||||
<name>startup/startup_MK22F51212.S</name>
|
||||
<type>1</type>
|
||||
|
||||
@@ -3,6 +3,12 @@
|
||||
|
||||
// Includes:
|
||||
|
||||
#include "usb_device_config.h"
|
||||
#include "usb.h"
|
||||
#include "usb_device.h"
|
||||
#include "include/usb/usb_device_class.h"
|
||||
#include "include/usb/usb_device_hid.h"
|
||||
|
||||
#include "include/lufa/Common.h"
|
||||
#include "include/lufa/HIDClassCommon.h"
|
||||
|
||||
@@ -1,21 +1,8 @@
|
||||
#include "usb_device_config.h"
|
||||
#include "usb.h"
|
||||
#include "usb_device.h"
|
||||
#include "include/usb/usb_device_class.h"
|
||||
#include "include/usb/usb_device_hid.h"
|
||||
#include "include/usb/usb_device_ch9.h"
|
||||
#include "usb_descriptor_device.h"
|
||||
#include "usb_composite_device.h"
|
||||
#include "usb_interface_keyboard.h"
|
||||
#include "usb_interface_mouse.h"
|
||||
#include "usb_interface_generic_hid.h"
|
||||
#include "fsl_device_registers.h"
|
||||
#include "fsl_debug_console.h"
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include "fsl_common.h"
|
||||
#include "usb_descriptor_strings.h"
|
||||
#include "usb_api.h"
|
||||
#include "usb_composite_device.h"
|
||||
#include "usb_descriptor_hid.h"
|
||||
#include "usb_descriptor_strings.h"
|
||||
|
||||
static usb_status_t UsbDeviceCallback(usb_device_handle handle, uint32_t event, void *param);
|
||||
usb_composite_device_t UsbCompositeDevice;
|
||||
@@ -104,12 +91,12 @@ static usb_status_t UsbDeviceCallback(usb_device_handle handle, uint32_t event,
|
||||
return error;
|
||||
}
|
||||
|
||||
void USB0_IRQHandler(void)
|
||||
void USB0_IRQHandler()
|
||||
{
|
||||
USB_DeviceKhciIsrFunction(UsbCompositeDevice.deviceHandle);
|
||||
}
|
||||
|
||||
void USB_DeviceApplicationInit(void)
|
||||
void USB_DeviceApplicationInit()
|
||||
{
|
||||
uint8_t usbDeviceKhciIrq[] = USB_IRQS;
|
||||
uint8_t irqNumber = usbDeviceKhciIrq[CONTROLLER_ID - kUSB_ControllerKhci0];
|
||||
|
||||
@@ -28,6 +28,6 @@
|
||||
|
||||
//Functions:
|
||||
|
||||
extern void USB_DeviceApplicationInit(void);
|
||||
extern void USB_DeviceApplicationInit();
|
||||
|
||||
#endif
|
||||
|
||||
@@ -1,14 +1,7 @@
|
||||
#include "usb_device_config.h"
|
||||
#include "usb.h"
|
||||
#include "usb_device.h"
|
||||
#include "include/usb/usb_device_class.h"
|
||||
#include "include/usb/usb_device_hid.h"
|
||||
#include "usb_descriptor_device.h"
|
||||
#include "usb_api.h"
|
||||
#include "usb_composite_device.h"
|
||||
#include "usb_descriptor_keyboard_report.h"
|
||||
#include "usb_descriptor_mouse_report.h"
|
||||
#include "usb_descriptor_generic_hid_report.h"
|
||||
#include "usb_descriptor_configuration.h"
|
||||
|
||||
uint8_t UsbConfigurationDescriptor[USB_CONFIGURATION_DESCRIPTOR_TOTAL_LENGTH] = {
|
||||
|
||||
|
||||
@@ -1,9 +1,4 @@
|
||||
#include "usb_device_config.h"
|
||||
#include "usb.h"
|
||||
#include "usb_device.h"
|
||||
#include "include/usb/usb_device_class.h"
|
||||
#include "include/usb/usb_device_hid.h"
|
||||
#include "usb_descriptor_device.h"
|
||||
#include "usb_api.h"
|
||||
#include "usb_composite_device.h"
|
||||
#include "usb_descriptor_strings.h"
|
||||
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
#include <stdint.h>
|
||||
#include "usb_report_item_macros.h"
|
||||
#include "usb_api.h"
|
||||
#include "usb_interface_generic_hid.h"
|
||||
#include "usb_descriptor_generic_hid_report.h"
|
||||
|
||||
|
||||
@@ -1,8 +1,4 @@
|
||||
#include "usb_device_config.h"
|
||||
#include "usb.h"
|
||||
#include "usb_device.h"
|
||||
#include "include/usb/usb_device_class.h"
|
||||
#include "include/usb/usb_device_hid.h"
|
||||
#include "usb_api.h"
|
||||
#include "usb_descriptor_hid.h"
|
||||
#include "usb_descriptor_mouse_report.h"
|
||||
#include "usb_descriptor_generic_hid_report.h"
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#include <stdint.h>
|
||||
#include "usb_report_item_macros.h"
|
||||
#include "usb_api.h"
|
||||
#include "usb_descriptor_keyboard_report.h"
|
||||
|
||||
uint8_t UsbKeyboardReportDescriptor[USB_KEYBOARD_REPORT_DESCRIPTOR_LENGTH] = {
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
#include <stdint.h>
|
||||
#include "usb_report_item_macros.h"
|
||||
#include "usb_api.h"
|
||||
#include "usb_descriptor_mouse_report.h"
|
||||
|
||||
uint8_t UsbMouseReportDescriptor[USB_MOUSE_REPORT_DESCRIPTOR_LENGTH] = {
|
||||
|
||||
@@ -1,8 +1,4 @@
|
||||
#include "usb_device_config.h"
|
||||
#include "usb.h"
|
||||
#include "usb_device.h"
|
||||
#include "include/usb/usb_device_class.h"
|
||||
#include "include/usb/usb_device_hid.h"
|
||||
#include "usb_api.h"
|
||||
#include "usb_descriptor_strings.h"
|
||||
|
||||
uint8_t UsbLanguageListStringDescriptor[USB_LANGUAGE_LIST_STRING_DESCRIPTOR_LENGTH] = {
|
||||
|
||||
@@ -1,13 +1,5 @@
|
||||
#include "include/board/board.h"
|
||||
#include "fsl_gpio.h"
|
||||
#include "usb_device_config.h"
|
||||
#include "usb.h"
|
||||
#include "usb_device.h"
|
||||
#include "include/usb/usb_device_class.h"
|
||||
#include "include/usb/usb_device_hid.h"
|
||||
#include "include/usb/usb_device_ch9.h"
|
||||
#include "usb_interface_generic_hid.h"
|
||||
#include "usb_descriptor_configuration.h"
|
||||
#include "usb_api.h"
|
||||
#include "usb_composite_device.h"
|
||||
|
||||
static usb_device_endpoint_struct_t UsbGenericHidEndpoints[USB_GENERIC_HID_ENDPOINT_COUNT] =
|
||||
|
||||
@@ -3,11 +3,7 @@
|
||||
|
||||
// Includes:
|
||||
|
||||
#include "usb_device_config.h"
|
||||
#include "usb.h"
|
||||
#include "usb_device.h"
|
||||
#include "include/usb/usb_device_class.h"
|
||||
#include "include/usb/usb_device_hid.h"
|
||||
#include "usb_api.h"
|
||||
#include "usb_descriptor_device.h"
|
||||
|
||||
// Macros:
|
||||
|
||||
@@ -3,12 +3,7 @@
|
||||
|
||||
// Includes:
|
||||
|
||||
#include "usb_device_config.h"
|
||||
#include "usb.h"
|
||||
#include "usb_device.h"
|
||||
#include "include/usb/usb_device_class.h"
|
||||
#include "include/usb/usb_device_hid.h"
|
||||
#include "include/usb/usb_device_ch9.h"
|
||||
#include "usb_api.h"
|
||||
#include "usb_descriptor_keyboard_report.h"
|
||||
|
||||
// Macros:
|
||||
|
||||
@@ -1,15 +1,6 @@
|
||||
#include "include/board/board.h"
|
||||
#include "fsl_gpio.h"
|
||||
#include "usb_device_config.h"
|
||||
#include "usb.h"
|
||||
#include "usb_device.h"
|
||||
#include "include/usb/usb_device_class.h"
|
||||
#include "include/usb/usb_device_hid.h"
|
||||
#include "include/usb/usb_device_ch9.h"
|
||||
#include "usb_api.h"
|
||||
#include "usb_composite_device.h"
|
||||
#include "usb_interface_mouse.h"
|
||||
#include "usb_descriptor_configuration.h"
|
||||
|
||||
|
||||
static usb_device_endpoint_struct_t UsbMouseEndpoints[USB_MOUSE_ENDPOINT_COUNT] = {{
|
||||
USB_MOUSE_ENDPOINT_ID | (USB_IN << USB_DESCRIPTOR_ENDPOINT_ADDRESS_DIRECTION_SHIFT),
|
||||
|
||||
@@ -1,15 +1,6 @@
|
||||
#ifndef __USB_INTERFACE_MOUSE_H__
|
||||
#define __USB_INTERFACE_MOUSE_H__
|
||||
|
||||
// Includes:
|
||||
|
||||
#include "usb_device_config.h"
|
||||
#include "usb.h"
|
||||
#include "usb_device.h"
|
||||
#include "include/usb/usb_device_class.h"
|
||||
#include "include/usb/usb_device_hid.h"
|
||||
#include "include/usb/usb_device_ch9.h"
|
||||
|
||||
// Macros:
|
||||
|
||||
#define USB_MOUSE_CLASS 0x03
|
||||
|
||||
Reference in New Issue
Block a user