Ver código fonte

[Components][USB][DFS][usb minimize stack size dfs fix build error
without finsh]

uestczyh222 7 anos atrás
pai
commit
049ed5047f

+ 2 - 2
components/dfs/src/dfs.c

@@ -406,7 +406,7 @@ up_one:
     return fullpath;
 }
 RTM_EXPORT(dfs_normalize_path);
-
+#ifdef RT_USING_FINSH
 #include <finsh.h>
 int list_fd(void)
 {
@@ -438,6 +438,6 @@ int list_fd(void)
     return 0;
 }
 MSH_CMD_EXPORT(list_fd, list file descriptor);
-
+#endif
 /*@}*/
 

+ 1 - 1
components/drivers/include/drivers/usb_common.h

@@ -577,7 +577,7 @@ typedef struct ustorage_csw* ustorage_csw_t;
  */
 /* the stack size of USB thread */
 #ifndef RT_USBD_THREAD_STACK_SZ
-#define RT_USBD_THREAD_STACK_SZ 2048
+#define RT_USBD_THREAD_STACK_SZ 512
 #endif
 
 /* the priority of USB thread */

+ 3 - 3
components/drivers/usb/usbdevice/class/hid.c

@@ -571,7 +571,7 @@ RT_WEAK void HID_Report_Received(hid_report_t report)
     dump_report(report);
 }
 ALIGN(RT_ALIGN_SIZE)
-static rt_uint8_t hid_thread_stack[RT_USBD_THREAD_STACK_SZ];
+static rt_uint8_t hid_thread_stack[512];
 static struct rt_thread hid_thread;
 
 static void hid_thread_entry(void* parameter)
@@ -586,7 +586,7 @@ static void hid_thread_entry(void* parameter)
 		HID_Report_Received(&report);
 	}
 }
-static rt_uint8_t hid_mq_pool[(sizeof(struct hid_report)+sizeof(void*))*32];
+static rt_uint8_t hid_mq_pool[(sizeof(struct hid_report)+sizeof(void*))*8];
 static void rt_usb_hid_init(struct ufunction *func)
 {
     struct hid_s *hiddev;
@@ -599,7 +599,7 @@ static void rt_usb_hid_init(struct ufunction *func)
                             sizeof(hid_mq_pool), RT_IPC_FLAG_FIFO);
                             
     rt_thread_init(&hid_thread, "hidd", hid_thread_entry, hiddev,
-            hid_thread_stack, RT_USBD_THREAD_STACK_SZ, RT_USBD_THREAD_PRIO, 20);
+            hid_thread_stack, sizeof(hid_thread_stack), RT_USBD_THREAD_PRIO, 20);
     rt_thread_startup(&hid_thread);
 }