TUD_EPBUF_TYPE_DEF ncm_device

This commit is contained in:
hathach
2024-11-22 15:45:08 +07:00
parent 090964cd1b
commit 1533e693ee
5 changed files with 40 additions and 11 deletions

View File

@@ -373,8 +373,8 @@
#define CFG_TUH_MEM_DCACHE_ENABLE_DEFAULT 1
#endif
#define CFG_TUD_MEM_DCACHE_LINE_SIZE 64
#define CFG_TUH_MEM_DCACHE_LINE_SIZE 64
#define CFG_TUD_MEM_DCACHE_LINE_SIZE_DEFAULT 64
#define CFG_TUH_MEM_DCACHE_LINE_SIZE_DEFAULT 64
#define CFG_TUH_DWC2_DMA_ENABLE_DEFAULT 0 // TODO currently have issue with buffer DMA with espressif

View File

@@ -35,16 +35,17 @@
extern "C" {
#endif
// DCache padding for variable to occupy full cache line
#define TUD_EPBUF_DCACHE_SIZE(_size) \
(CFG_TUD_MEM_DCACHE_ENABLE ? (TU_DIV_CEIL(_size, CFG_TUD_MEM_DCACHE_LINE_SIZE) * CFG_TUD_MEM_DCACHE_LINE_SIZE) : (_size))
// Declare an endpoint buffer with uint8_t[size]
#define TUD_EPBUF_DEF(_name, _size) \
union { \
CFG_TUD_MEM_ALIGN uint8_t _name[_size]; \
uint8_t _name##_dcache_padding[TUD_EPBUF_DCACHE_SIZE(_size)]; \
};
// Declare an endpoint buffer with a type
#define TUD_EPBUF_TYPE_DEF(_name, _type) \
union { \
CFG_TUD_MEM_ALIGN _type _name; \