浏览代码

clean up text

hathach 7 年之前
父节点
当前提交
ee6ed084f4
共有 2 个文件被更改,包括 7 次插入5 次删除
  1. 3 1
      examples/device/cdc_msc_hid/src/main.c
  2. 4 4
      src/device/usbd.h

+ 3 - 1
examples/device/cdc_msc_hid/src/main.c

@@ -210,13 +210,15 @@ void tud_umount_cb(void)
   blink_interval_ms = 250;
   blink_interval_ms = 250;
 }
 }
 
 
-// Invoked when device is suspended
+// Invoked when usb bus is suspended
+// USB specs: device can only draw up to 2.5 mA from bus
 void tud_suspend_cb(bool remote_wakeup_en)
 void tud_suspend_cb(bool remote_wakeup_en)
 {
 {
   (void) remote_wakeup_en;
   (void) remote_wakeup_en;
   blink_interval_ms = 2500;
   blink_interval_ms = 2500;
 }
 }
 
 
+// Invoked when usb bus is resumed
 void tud_resume_cb(void)
 void tud_resume_cb(void)
 {
 {
   blink_interval_ms = 1000;
   blink_interval_ms = 1000;

+ 4 - 4
src/device/usbd.h

@@ -76,16 +76,16 @@ bool tud_remote_wakeup(void);
 // Application Callbacks (WEAK is optional)
 // Application Callbacks (WEAK is optional)
 //--------------------------------------------------------------------+
 //--------------------------------------------------------------------+
 
 
-// Callback invoked when device is mounted (configured)
+// Invoked when device is mounted (configured)
 ATTR_WEAK void tud_mount_cb(void);
 ATTR_WEAK void tud_mount_cb(void);
 
 
-// Callback invoked when device is unmounted
+// Invoked when device is unmounted
 ATTR_WEAK void tud_umount_cb(void);
 ATTR_WEAK void tud_umount_cb(void);
 
 
-// Callback invoked when device is suspended
+// Invoked when usb bus is suspended, max bus current draw is 2.5 mA
 ATTR_WEAK void tud_suspend_cb(bool remote_wakeup_en);
 ATTR_WEAK void tud_suspend_cb(bool remote_wakeup_en);
 
 
-// Callback invoked when device is resumed
+// Invoked when usb bus is resumed
 ATTR_WEAK void tud_resume_cb(void);
 ATTR_WEAK void tud_resume_cb(void);
 
 
 #ifdef __cplusplus
 #ifdef __cplusplus