Get a basic USB device working
It enumerates, takes its address, gets configured, and then Linux kind
of gives up because it has no endpoints.
Change-Id: I01f75acee419b585e455f428ee45bcd37f0ce189
diff --git a/motors/usb/BUILD b/motors/usb/BUILD
index ddb1bcc..55b1790 100644
--- a/motors/usb/BUILD
+++ b/motors/usb/BUILD
@@ -1,5 +1,7 @@
+load("//tools:environments.bzl", "mcu_cpus")
+
cc_library(
- name = 'usb',
+ name = 'legacy',
visibility = ['//visibility:public'],
hdrs = [
'usb_desc.h',
@@ -21,5 +23,42 @@
deps = [
'//motors/core',
],
- restricted_to = ['//tools:cortex-m4f'],
+ restricted_to = mcu_cpus,
+)
+
+cc_library(
+ name = 'usb',
+ visibility = ['//visibility:public'],
+ hdrs = [
+ 'usb.h',
+ ],
+ srcs = [
+ 'usb.cc',
+ ],
+ deps = [
+ ':constants',
+ '//aos/common:macros',
+ '//motors/core',
+ '//motors:util',
+ ],
+ restricted_to = mcu_cpus,
+)
+
+cc_library(
+ name = 'constants',
+ hdrs = [
+ 'constants.h',
+ ],
+ compatible_with = mcu_cpus,
+)
+
+cc_test(
+ name = 'constants_test',
+ srcs = [
+ 'constants_test.cc',
+ ],
+ deps = [
+ ':constants',
+ '//aos/testing:googletest',
+ ],
)