summaryrefslogtreecommitdiff
path: root/src/common
diff options
context:
space:
mode:
Diffstat (limited to 'src/common')
-rw-r--r--src/common/tusb_common.h2
-rw-r--r--src/common/tusb_compiler.h8
-rw-r--r--src/common/tusb_types.h10
-rw-r--r--src/common/tusb_verify.h3
4 files changed, 19 insertions, 4 deletions
diff --git a/src/common/tusb_common.h b/src/common/tusb_common.h
index 0d4082c03..d3e0cf888 100644
--- a/src/common/tusb_common.h
+++ b/src/common/tusb_common.h
@@ -79,7 +79,7 @@
//--------------------------------------------------------------------+
// Optional API implemented by application if needed
-// TODO move to a more ovious place/file
+// TODO move to a more obvious place/file
//--------------------------------------------------------------------+
// flush data cache
diff --git a/src/common/tusb_compiler.h b/src/common/tusb_compiler.h
index ce5566ffe..646c22b29 100644
--- a/src/common/tusb_compiler.h
+++ b/src/common/tusb_compiler.h
@@ -119,6 +119,14 @@
#define _TU_ARGS_APPLY_8(_X, _s, _a1, _a2, _a3, _a4, _a5, _a6, _a7, _a8) _X(_a1) _s _TU_ARGS_APPLY_7(_X, _s, _a2, _a3, _a4, _a5, _a6, _a7, _a8)
//--------------------------------------------------------------------+
+// Macro for function default arguments
+//--------------------------------------------------------------------+
+#define TU_GET_3RD_ARG(arg1, arg2, arg3, ...) arg3
+
+// function expand with number of arguments
+#define TU_FUNC_OPTIONAL_ARG(func, ...) TU_XSTRCAT(func##_arg, TU_ARGS_NUM(__VA_ARGS__))(__VA_ARGS__)
+
+//--------------------------------------------------------------------+
// Compiler porting with Attribute and Endian
//--------------------------------------------------------------------+
diff --git a/src/common/tusb_types.h b/src/common/tusb_types.h
index adf4b5720..5dfe3ff98 100644
--- a/src/common/tusb_types.h
+++ b/src/common/tusb_types.h
@@ -50,6 +50,7 @@ typedef enum {
TUSB_SPEED_FULL = 0,
TUSB_SPEED_LOW = 1,
TUSB_SPEED_HIGH = 2,
+ TUSB_SPEED_AUTO = 0xaa,
TUSB_SPEED_INVALID = 0xff,
} tusb_speed_t;
@@ -274,6 +275,15 @@ enum {
};
//--------------------------------------------------------------------+
+//
+//--------------------------------------------------------------------+
+typedef struct {
+ uint8_t rhport;
+ tusb_role_t role;
+ tusb_speed_t speed;
+} tusb_rhport_init_t;
+
+//--------------------------------------------------------------------+
// USB Descriptors
//--------------------------------------------------------------------+
diff --git a/src/common/tusb_verify.h b/src/common/tusb_verify.h
index 8ad218b03..3e0f1f106 100644
--- a/src/common/tusb_verify.h
+++ b/src/common/tusb_verify.h
@@ -93,9 +93,6 @@
#define TU_BREAKPOINT() do {} while (0)
#endif
-// Helper to implement optional parameter for TU_VERIFY Macro family
-#define TU_GET_3RD_ARG(arg1, arg2, arg3, ...) arg3
-
/*------------------------------------------------------------------*/
/* TU_VERIFY
* - TU_VERIFY_1ARGS : return false if failed