mirror of
https://github.com/hathach/tinyusb.git
synced 2026-02-04 19:15:42 +00:00
dwc2 stm32 check if dcache enabled before calling SCB DCache function
This commit is contained in:
@ -337,6 +337,9 @@ TU_ATTR_ALWAYS_INLINE static inline uint32_t round_up_to_cache_line_size(uint32_
|
||||
}
|
||||
|
||||
TU_ATTR_ALWAYS_INLINE static inline bool is_cache_mem(uintptr_t addr) {
|
||||
if (0 == (SCB->CCR & SCB_CCR_DC_Msk)) {
|
||||
return false; // D-Cache is disabled
|
||||
}
|
||||
for (unsigned int i = 0; i < TU_ARRAY_SIZE(uncached_regions); i++) {
|
||||
if (uncached_regions[i].start <= addr && addr <= uncached_regions[i].end) { return false; }
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user