Apply suggestions from @henrygab

Check if memory allocation fails
Fix memory leak
Initialize struct in declaration
Add/Fix some notes
Remove unlikely() in favor of readability
Remove a hard-coded magic number
This commit is contained in:
wh201906 committed 2023-11-15 18:04:52 +08:00
1 parent 835b7a9150
commit 3ee13c9ba6
12 files changed
+113 -44

No files matched your search

+4
View File
@@ -23,6 +23,10 @@
#include "common.h"
#include "at91sam7s512.h"
#define AT91C_USB_EP_CONTROL_SIZE 8
#define AT91C_USB_EP_OUT_SIZE 64
#define AT91C_USB_EP_IN_SIZE 64
void usb_disable(void);
void usb_enable(void);
bool usb_check(void);