Skip to content

Commit d8c054c

Browse files
johnboilesSoucheSouche
authored andcommitted
fix(memory-utils): Use esp_ptr_in_tcm to check TCM range
1 parent b9f42e7 commit d8c054c

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

components/esp_hw_support/esp_memory_utils.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ bool esp_ptr_byte_accessible(const void *p)
5353
bool r;
5454
r = (ip >= SOC_BYTE_ACCESSIBLE_LOW && ip < SOC_BYTE_ACCESSIBLE_HIGH);
5555
#if SOC_MEM_TCM_SUPPORTED
56-
r |= (ip >= SOC_TCM_LOW && ip < SOC_TCM_HIGH);
56+
r |= esp_ptr_in_tcm(p);
5757
#endif
5858
#if CONFIG_ESP_SYSTEM_ALLOW_RTC_FAST_MEM_AS_HEAP
5959
/* For ESP32 case, RTC fast memory is accessible to PRO cpu only and hence

components/esp_hw_support/include/esp_memory_utils.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -279,7 +279,7 @@ inline static bool esp_ptr_internal(const void *p) {
279279
r = ((intptr_t)p >= SOC_MEM_INTERNAL_LOW && (intptr_t)p < SOC_MEM_INTERNAL_HIGH);
280280

281281
#if SOC_MEM_TCM_SUPPORTED
282-
r |= ((intptr_t)p >= SOC_TCM_LOW && (intptr_t)p < SOC_TCM_HIGH);
282+
r |= esp_ptr_in_tcm(p);
283283
#endif
284284

285285
#if SOC_RTC_SLOW_MEM_SUPPORTED

0 commit comments

Comments
 (0)