summaryrefslogtreecommitdiff
path: root/firmware/usbstack
diff options
context:
space:
mode:
Diffstat (limited to 'firmware/usbstack')
-rw-r--r--firmware/usbstack/usb_charging_only.c4
-rw-r--r--firmware/usbstack/usb_core.c16
-rw-r--r--firmware/usbstack/usb_hid.c4
-rw-r--r--firmware/usbstack/usb_serial.c4
-rw-r--r--firmware/usbstack/usb_storage.c4
5 files changed, 8 insertions, 24 deletions
diff --git a/firmware/usbstack/usb_charging_only.c b/firmware/usbstack/usb_charging_only.c
index fc6139c1ae..8dd9fdf742 100644
--- a/firmware/usbstack/usb_charging_only.c
+++ b/firmware/usbstack/usb_charging_only.c
@@ -29,8 +29,6 @@
29//#define LOGF_ENABLE 29//#define LOGF_ENABLE
30#include "logf.h" 30#include "logf.h"
31 31
32#ifdef USB_CHARGING_ONLY
33
34/* charging_only interface */ 32/* charging_only interface */
35static struct usb_interface_descriptor __attribute__((aligned(2))) 33static struct usb_interface_descriptor __attribute__((aligned(2)))
36 interface_descriptor = 34 interface_descriptor =
@@ -70,5 +68,3 @@ int usb_charging_only_get_config_descriptor(unsigned char *dest,int max_packet_s
70 68
71 return (dest-orig_dest); 69 return (dest-orig_dest);
72} 70}
73
74#endif /*USB_CHARGING_ONLY*/
diff --git a/firmware/usbstack/usb_core.c b/firmware/usbstack/usb_core.c
index 81333fe0d2..c4450af964 100644
--- a/firmware/usbstack/usb_core.c
+++ b/firmware/usbstack/usb_core.c
@@ -31,19 +31,19 @@
31#include "usb_core.h" 31#include "usb_core.h"
32#include "usb_class_driver.h" 32#include "usb_class_driver.h"
33 33
34#if defined(USB_STORAGE) 34#if defined(USB_ENABLE_STORAGE)
35#include "usb_storage.h" 35#include "usb_storage.h"
36#endif 36#endif
37 37
38#if defined(USB_SERIAL) 38#if defined(USB_ENABLE_SERIAL)
39#include "usb_serial.h" 39#include "usb_serial.h"
40#endif 40#endif
41 41
42#if defined(USB_CHARGING_ONLY) 42#if defined(USB_ENABLE_CHARGING_ONLY)
43#include "usb_charging_only.h" 43#include "usb_charging_only.h"
44#endif 44#endif
45 45
46#if defined(USB_HID) 46#if defined(USB_ENABLE_HID)
47#include "usb_hid.h" 47#include "usb_hid.h"
48#endif 48#endif
49 49
@@ -182,7 +182,7 @@ static struct
182 182
183static struct usb_class_driver drivers[USB_NUM_DRIVERS] = 183static struct usb_class_driver drivers[USB_NUM_DRIVERS] =
184{ 184{
185#ifdef USB_STORAGE 185#ifdef USB_ENABLE_STORAGE
186 [USB_DRIVER_MASS_STORAGE] = { 186 [USB_DRIVER_MASS_STORAGE] = {
187 .enabled = false, 187 .enabled = false,
188 .needs_exclusive_storage = true, 188 .needs_exclusive_storage = true,
@@ -201,7 +201,7 @@ static struct usb_class_driver drivers[USB_NUM_DRIVERS] =
201#endif 201#endif
202 }, 202 },
203#endif 203#endif
204#ifdef USB_SERIAL 204#ifdef USB_ENABLE_SERIAL
205 [USB_DRIVER_SERIAL] = { 205 [USB_DRIVER_SERIAL] = {
206 .enabled = false, 206 .enabled = false,
207 .needs_exclusive_storage = false, 207 .needs_exclusive_storage = false,
@@ -220,7 +220,7 @@ static struct usb_class_driver drivers[USB_NUM_DRIVERS] =
220#endif 220#endif
221 }, 221 },
222#endif 222#endif
223#ifdef USB_CHARGING_ONLY 223#ifdef USB_ENABLE_CHARGING_ONLY
224 [USB_DRIVER_CHARGING_ONLY] = { 224 [USB_DRIVER_CHARGING_ONLY] = {
225 .enabled = false, 225 .enabled = false,
226 .needs_exclusive_storage = false, 226 .needs_exclusive_storage = false,
@@ -239,7 +239,7 @@ static struct usb_class_driver drivers[USB_NUM_DRIVERS] =
239#endif 239#endif
240 }, 240 },
241#endif 241#endif
242#ifdef USB_HID 242#ifdef USB_ENABLE_HID
243 [USB_DRIVER_HID] = { 243 [USB_DRIVER_HID] = {
244 .enabled = false, 244 .enabled = false,
245 .needs_exclusive_storage = false, 245 .needs_exclusive_storage = false,
diff --git a/firmware/usbstack/usb_hid.c b/firmware/usbstack/usb_hid.c
index 0c35da2acb..31554eed48 100644
--- a/firmware/usbstack/usb_hid.c
+++ b/firmware/usbstack/usb_hid.c
@@ -28,8 +28,6 @@
28//#define LOGF_ENABLE 28//#define LOGF_ENABLE
29#include "logf.h" 29#include "logf.h"
30 30
31#ifdef USB_HID
32
33#define CONCAT(low, high) ((high << 8) | low) 31#define CONCAT(low, high) ((high << 8) | low)
34#define PACK_VAL1(dest, val) *(dest)++ = (val) & 0xff 32#define PACK_VAL1(dest, val) *(dest)++ = (val) & 0xff
35#define PACK_VAL2(dest, val) PACK_VAL1((dest), (val)); \ 33#define PACK_VAL2(dest, val) PACK_VAL1((dest), (val)); \
@@ -392,5 +390,3 @@ void usb_hid_send_consumer_usage(consumer_usage_page_t id)
392 390
393 usb_hid_try_send_drv(); 391 usb_hid_try_send_drv();
394} 392}
395
396#endif /*USB_HID*/
diff --git a/firmware/usbstack/usb_serial.c b/firmware/usbstack/usb_serial.c
index 246938a1ef..6c654ad898 100644
--- a/firmware/usbstack/usb_serial.c
+++ b/firmware/usbstack/usb_serial.c
@@ -28,8 +28,6 @@
28//#define LOGF_ENABLE 28//#define LOGF_ENABLE
29#include "logf.h" 29#include "logf.h"
30 30
31#ifdef USB_SERIAL
32
33/* serial interface */ 31/* serial interface */
34static struct usb_interface_descriptor __attribute__((aligned(2))) 32static struct usb_interface_descriptor __attribute__((aligned(2)))
35 interface_descriptor = 33 interface_descriptor =
@@ -240,5 +238,3 @@ void usb_serial_transfer_complete(int ep,int dir, int status, int length)
240 break; 238 break;
241 } 239 }
242} 240}
243
244#endif /*USB_SERIAL*/
diff --git a/firmware/usbstack/usb_storage.c b/firmware/usbstack/usb_storage.c
index b498311014..63ff4f059b 100644
--- a/firmware/usbstack/usb_storage.c
+++ b/firmware/usbstack/usb_storage.c
@@ -33,8 +33,6 @@
33#include "usb_storage.h" 33#include "usb_storage.h"
34 34
35 35
36#ifdef USB_STORAGE
37
38/* Enable the following define to export only the SD card slot. This 36/* Enable the following define to export only the SD card slot. This
39 * is useful for USBCV MSC tests, as those are destructive. 37 * is useful for USBCV MSC tests, as those are destructive.
40 * This won't work right if the device doesn't have a card slot. 38 * This won't work right if the device doesn't have a card slot.
@@ -1158,5 +1156,3 @@ static void fill_inquiry(IF_MV_NONVOID(int lun))
1158 tb.inquiry->DeviceTypeModifier = DEVICE_REMOVABLE; 1156 tb.inquiry->DeviceTypeModifier = DEVICE_REMOVABLE;
1159#endif 1157#endif
1160} 1158}
1161
1162#endif /* USB_STORAGE */