summaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorhathach <[email protected]>2019-03-21 05:13:20 -0700
committerGitHub <[email protected]>2019-03-21 05:13:20 -0700
commit7d6085f870c755a32a099b0af5ac960cd4c33343 (patch)
tree409d0b47887be7e879f215a59e592eeff9d03dd8 /examples
parent02a1ce4e7655ad023875e03d879ab85aea848be5 (diff)
parentf8faf05e9eaf2e3e4ca05006f382b422b9680f5c (diff)
Merge pull request #45 from hathach/develop
Board uart rename and better support mynewt
Diffstat (limited to 'examples')
-rw-r--r--examples/device/cdc_msc_hid/Makefile1
-rw-r--r--examples/device/cdc_msc_hid/src/main.c16
-rw-r--r--examples/device/cdc_msc_hid_mynewt/readme.md1
3 files changed, 12 insertions, 6 deletions
diff --git a/examples/device/cdc_msc_hid/Makefile b/examples/device/cdc_msc_hid/Makefile
index 86587dd47..fffabee9d 100644
--- a/examples/device/cdc_msc_hid/Makefile
+++ b/examples/device/cdc_msc_hid/Makefile
@@ -34,7 +34,6 @@ MKDIR = mkdir
SED = sed
CP = cp
RM = rm
-AS = $(CROSS_COMPILE)as
INC += -Isrc \
-I$(TOP)/hw \
diff --git a/examples/device/cdc_msc_hid/src/main.c b/examples/device/cdc_msc_hid/src/main.c
index 5959f2960..b2a902835 100644
--- a/examples/device/cdc_msc_hid/src/main.c
+++ b/examples/device/cdc_msc_hid/src/main.c
@@ -93,6 +93,7 @@ void virtual_com_task(void)
}
}
+// Invoked when cdc when line state changed e.g connected/disconnected
void tud_cdc_line_state_cb(uint8_t itf, bool dtr, bool rts)
{
(void) itf;
@@ -104,6 +105,13 @@ void tud_cdc_line_state_cb(uint8_t itf, bool dtr, bool rts)
tud_cdc_write_str("\r\nTinyUSB CDC MSC HID device example\r\n");
}
}
+
+// Invoked when CDC interface received data from host
+void tud_cdc_rx_cb(uint8_t itf)
+{
+ (void) itf;
+}
+
#endif
//--------------------------------------------------------------------+
@@ -168,20 +176,18 @@ void tud_hid_generic_set_report_cb(uint8_t report_id, hid_report_type_t report_t
//--------------------------------------------------------------------+
// tinyusb callbacks
//--------------------------------------------------------------------+
+
+// Invoked when device is mounted
void tud_mount_cb(void)
{
}
+// Invoked when device is unmounted
void tud_umount_cb(void)
{
}
-void tud_cdc_rx_cb(uint8_t itf)
-{
- (void) itf;
-}
-
//--------------------------------------------------------------------+
// BLINKING TASK
//--------------------------------------------------------------------+
diff --git a/examples/device/cdc_msc_hid_mynewt/readme.md b/examples/device/cdc_msc_hid_mynewt/readme.md
new file mode 100644
index 000000000..2d2f579fa
--- /dev/null
+++ b/examples/device/cdc_msc_hid_mynewt/readme.md
@@ -0,0 +1 @@
+Please check out this repo https://github.com/hathach/mynewt-tinyusb-exmaple For mynewt example \ No newline at end of file