This commit is contained in:
zhugengyu
2022-09-21 08:57:41 +08:00
committed by sakumisu
parent 7837e34f75
commit e2a4fb11d8
16 changed files with 3114 additions and 0 deletions

View File

@@ -6,9 +6,25 @@
#ifndef USB_MEM_H
#define USB_MEM_H
#include "usb_config.h"
#ifdef CONFIG_USBHOST_XHCI
void *usb_hc_malloc(size_t size);
void usb_hc_free();
void *usb_hc_malloc_align(size_t align, size_t size);
#define usb_malloc(size) usb_hc_malloc(size)
#define usb_free(ptr) usb_hc_free(ptr)
#define usb_align(align, size) usb_hc_malloc_align(align, size)
#else
#define usb_malloc(size) malloc(size)
#define usb_free(ptr) free(ptr)
#endif
#ifndef CONFIG_USB_ALIGN_SIZE
#define CONFIG_USB_ALIGN_SIZE 4
#endif