summaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorhathach <[email protected]>2019-06-10 18:50:59 +0700
committerGitHub <[email protected]>2019-06-10 18:50:59 +0700
commit393492823ce037a2e46d367d61fad1235859af2e (patch)
tree7bc829e94b0a542e6990566e71ec293a600d3553 /examples
parent69e98215ea94bf5d6a8adc042732fe2a67df9764 (diff)
parent7156bfb54d5e9e13c8574b2384a47bd5554798a9 (diff)
Merge pull request #80 from hathach/develop
added usbd_edpt_xfer/usbd_edpt_busy to replace dcd_edpt_transfer/dcd_edpt_busy()
Diffstat (limited to 'examples')
-rw-r--r--examples/device/cdc_msc_hid/src/main.c2
-rw-r--r--examples/device/cdc_msc_hid/src/tusb_config.h5
-rw-r--r--examples/device/cdc_msc_hid_freertos/src/tusb_config.h2
-rw-r--r--examples/device/hid_generic_inout/src/main.c15
-rw-r--r--examples/device/hid_generic_inout/src/tusb_config.h2
-rw-r--r--examples/device/msc_dual_lun/src/tusb_config.h2
-rw-r--r--examples/host/cdc_msc_hid/src/tusb_config.h2
-rw-r--r--examples/make.mk7
-rw-r--r--examples/obsolete/host/src/tusb_config.h2
-rw-r--r--examples/rules.mk1
10 files changed, 30 insertions, 10 deletions
diff --git a/examples/device/cdc_msc_hid/src/main.c b/examples/device/cdc_msc_hid/src/main.c
index 7c0fd39d5..8ebdddd80 100644
--- a/examples/device/cdc_msc_hid/src/main.c
+++ b/examples/device/cdc_msc_hid/src/main.c
@@ -201,7 +201,7 @@ void hid_task(void)
tud_hid_mouse_report(REPORT_ID_MOUSE, 0x00, delta, delta, 0, 0);
// delay a bit before attempt to send keyboard report
- board_delay(2);
+ board_delay(10);
}
}
diff --git a/examples/device/cdc_msc_hid/src/tusb_config.h b/examples/device/cdc_msc_hid/src/tusb_config.h
index 8981077d3..2c89a63b7 100644
--- a/examples/device/cdc_msc_hid/src/tusb_config.h
+++ b/examples/device/cdc_msc_hid/src/tusb_config.h
@@ -62,7 +62,7 @@
#endif
#ifndef CFG_TUSB_MEM_ALIGN
-#define CFG_TUSB_MEM_ALIGN ATTR_ALIGNED(4)
+#define CFG_TUSB_MEM_ALIGN TU_ATTR_ALIGNED(4)
#endif
//--------------------------------------------------------------------
@@ -95,6 +95,9 @@
// Should be sufficient to hold ID (if any) + Data
#define CFG_TUD_HID_BUFSIZE 16
+#define CFG_TUD_MIDI_RX_BUFSIZE 512
+#define CFG_TUD_MIDI_TX_BUFSIZE 512
+
#ifdef __cplusplus
}
#endif
diff --git a/examples/device/cdc_msc_hid_freertos/src/tusb_config.h b/examples/device/cdc_msc_hid_freertos/src/tusb_config.h
index dfa8be629..b4e18de92 100644
--- a/examples/device/cdc_msc_hid_freertos/src/tusb_config.h
+++ b/examples/device/cdc_msc_hid_freertos/src/tusb_config.h
@@ -62,7 +62,7 @@
#endif
#ifndef CFG_TUSB_MEM_ALIGN
-#define CFG_TUSB_MEM_ALIGN ATTR_ALIGNED(4)
+#define CFG_TUSB_MEM_ALIGN TU_ATTR_ALIGNED(4)
#endif
//--------------------------------------------------------------------
diff --git a/examples/device/hid_generic_inout/src/main.c b/examples/device/hid_generic_inout/src/main.c
index b08ca5aee..bbc61a797 100644
--- a/examples/device/hid_generic_inout/src/main.c
+++ b/examples/device/hid_generic_inout/src/main.c
@@ -34,9 +34,18 @@
* It will receive data from Host (In endpoint) and echo back (Out endpoint).
* HID Report descriptor use vendor for usage page (using template TUD_HID_REPORT_DESC_GENERIC_INOUT)
*
- * Run 'python3 hid_test.py' on your PC to send and receive data to this device.
- * Python and `hid` package is required, for installation please follow
- * https://pypi.org/project/hid/
+ * There are 2 ways to test the sketch
+ * 1. Using nodejs
+ * - Install nodejs and nmp to your PC
+ * - Install execellent node-hid (https://github.com/node-hid/node-hid) by
+ * $ npm install node-hid
+ * - Run provided hid test script
+ * $ node hid_test.js
+ *
+ * 2. Using python hidRun
+ * - Python and `hid` package is required, for installation please follow https://pypi.org/project/hid/
+ * - Run provided hid test script to send and receive data to this device.
+ * $ python3 hid_test.py
*/
//--------------------------------------------------------------------+
diff --git a/examples/device/hid_generic_inout/src/tusb_config.h b/examples/device/hid_generic_inout/src/tusb_config.h
index acd23f954..dc7d98812 100644
--- a/examples/device/hid_generic_inout/src/tusb_config.h
+++ b/examples/device/hid_generic_inout/src/tusb_config.h
@@ -62,7 +62,7 @@
#endif
#ifndef CFG_TUSB_MEM_ALIGN
-#define CFG_TUSB_MEM_ALIGN ATTR_ALIGNED(4)
+#define CFG_TUSB_MEM_ALIGN TU_ATTR_ALIGNED(4)
#endif
//--------------------------------------------------------------------
diff --git a/examples/device/msc_dual_lun/src/tusb_config.h b/examples/device/msc_dual_lun/src/tusb_config.h
index fe30fbf20..ae57b4d60 100644
--- a/examples/device/msc_dual_lun/src/tusb_config.h
+++ b/examples/device/msc_dual_lun/src/tusb_config.h
@@ -62,7 +62,7 @@
#endif
#ifndef CFG_TUSB_MEM_ALIGN
-#define CFG_TUSB_MEM_ALIGN ATTR_ALIGNED(4)
+#define CFG_TUSB_MEM_ALIGN TU_ATTR_ALIGNED(4)
#endif
//--------------------------------------------------------------------
diff --git a/examples/host/cdc_msc_hid/src/tusb_config.h b/examples/host/cdc_msc_hid/src/tusb_config.h
index 144efa519..9662223b1 100644
--- a/examples/host/cdc_msc_hid/src/tusb_config.h
+++ b/examples/host/cdc_msc_hid/src/tusb_config.h
@@ -63,7 +63,7 @@
#endif
#ifndef CFG_TUSB_MEM_ALIGN
-#define CFG_TUSB_MEM_ALIGN ATTR_ALIGNED(4)
+#define CFG_TUSB_MEM_ALIGN TU_ATTR_ALIGNED(4)
#endif
//--------------------------------------------------------------------
diff --git a/examples/make.mk b/examples/make.mk
index 73e339d84..6706294ad 100644
--- a/examples/make.mk
+++ b/examples/make.mk
@@ -14,6 +14,13 @@ CP = cp
RM = rm
PYTHON ?= python
+check_defined = \
+ $(strip $(foreach 1,$1, \
+ $(call __check_defined,$1,$(strip $(value 2)))))
+__check_defined = \
+ $(if $(value $1),, \
+ $(error Undefined make flag: $1$(if $2, ($2))))
+
# Select the board to build for.
ifeq ($(BOARD),)
$(info You must provide a BOARD parameter with 'BOARD=')
diff --git a/examples/obsolete/host/src/tusb_config.h b/examples/obsolete/host/src/tusb_config.h
index d88da4bb4..a025e9091 100644
--- a/examples/obsolete/host/src/tusb_config.h
+++ b/examples/obsolete/host/src/tusb_config.h
@@ -67,7 +67,7 @@
#if CFG_TUSB_MCU == OPT_MCU_LPC175X_6X
#define CFG_TUSB_MEM_SECTION // LPC17xx USB DMA can access all address
#elif (CFG_TUSB_MCU == OPT_MCU_LPC43XX)
- #define CFG_TUSB_MEM_SECTION ATTR_SECTION(.data.$RAM3)
+ #define CFG_TUSB_MEM_SECTION TU_ATTR_SECTION(.data.$RAM3)
#endif
#elif defined __CC_ARM // Compiled with Keil armcc
diff --git a/examples/rules.mk b/examples/rules.mk
index 07840f6ff..bba0fdb53 100644
--- a/examples/rules.mk
+++ b/examples/rules.mk
@@ -13,6 +13,7 @@ SRC_C += \
src/class/msc/msc_device.c \
src/class/cdc/cdc_device.c \
src/class/hid/hid_device.c \
+ src/class/midi/midi_device.c \
src/tusb.c \
src/portable/$(VENDOR)/$(CHIP_FAMILY)/dcd_$(CHIP_FAMILY).c