Skip to content

Commit 530dcf8

Browse files
committed
change(dcd_dwc2): Small refactoring
1 parent 8710090 commit 530dcf8

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

src/portable/synopsys/dwc2/dcd_dwc2.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@ TU_ATTR_ALWAYS_INLINE static inline dwc2_regs_t* DWC2_REG(uint8_t rhport) {
7979
// MACRO TYPEDEF CONSTANT ENUM
8080
//--------------------------------------------------------------------+
8181
#if DWC2_ENABLE_MEM_CACHE
82+
8283
#ifndef DWC2_MEM_CACHE_LINE_SIZE
8384
#warning "Cache line size not specified, use default(64b) instead"
8485
# define DWC2_MEM_CACHE_LINE_SIZE 0x40
@@ -91,11 +92,11 @@ CFG_TUD_MEM_SECTION struct {
9192
};
9293
} _cache_aligned_setup_packet;
9394

94-
#define _setup_packet _cache_aligned_setup_packet.data
95-
#define _sizeof_setup_packet() DWC2_MEM_CACHE_LINE_SIZE
95+
#define _setup_packet _cache_aligned_setup_packet.data
96+
#define _sizeof_setup_packet() DWC2_MEM_CACHE_LINE_SIZE
9697
#else
9798
static CFG_TUD_MEM_SECTION TU_ATTR_ALIGNED(4) uint32_t _setup_packet[2];
98-
#define _sizeof_setup_packet() sizeof(_setup_packet)
99+
#define _sizeof_setup_packet() sizeof(_setup_packet)
99100
#endif // DWC2_ENABLE_MEM_CACHE
100101

101102
typedef struct {

src/portable/synopsys/dwc2/dwc2_esp32.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545
#include "hal/cache_hal.h"
4646
#include "esp_cache.h"
4747
#include "esp_log.h"
48-
#define DWC2_ENABLE_MEM_CACHE 1
48+
#define DWC2_ENABLE_MEM_CACHE 1
4949
#endif // SOC_CACHE_INTERNAL_MEM_VIA_L1CACHE
5050
#endif // OPT_MCU_ESP32P4
5151

0 commit comments

Comments
 (0)