mirror of
https://github.com/espressif/esp-idf.git
synced 2025-07-30 18:57:19 +02:00
Merge branch 'fix/twai_psram' into 'master'
test(twai): with malloc comes from PSRAM by default Closes IDF-13045 See merge request espressif/esp-idf!39246
This commit is contained in:
@ -579,8 +579,8 @@ esp_err_t twai_new_node_onchip(const twai_onchip_node_config_t *node_config, twa
|
|||||||
ESP_RETURN_ON_FALSE(node_config->tx_queue_depth > 0, ESP_ERR_INVALID_ARG, TAG, "tx_queue_depth at least 1");
|
ESP_RETURN_ON_FALSE(node_config->tx_queue_depth > 0, ESP_ERR_INVALID_ARG, TAG, "tx_queue_depth at least 1");
|
||||||
ESP_RETURN_ON_FALSE(!node_config->intr_priority || (BIT(node_config->intr_priority) & ESP_INTR_FLAG_LOWMED), ESP_ERR_INVALID_ARG, TAG, "Invalid intr_priority level");
|
ESP_RETURN_ON_FALSE(!node_config->intr_priority || (BIT(node_config->intr_priority) & ESP_INTR_FLAG_LOWMED), ESP_ERR_INVALID_ARG, TAG, "Invalid intr_priority level");
|
||||||
|
|
||||||
// Allocate TWAI node object memory
|
// Allocate TWAI node from internal memory because it contains atomic variable
|
||||||
twai_onchip_ctx_t *node = heap_caps_calloc(1, sizeof(twai_onchip_ctx_t) + twai_hal_get_mem_requirment(), TWAI_MALLOC_CAPS);
|
twai_onchip_ctx_t *node = heap_caps_calloc(1, sizeof(twai_onchip_ctx_t) + twai_hal_get_mem_requirment(), MALLOC_CAP_INTERNAL | MALLOC_CAP_8BIT);
|
||||||
ESP_RETURN_ON_FALSE(node, ESP_ERR_NO_MEM, TAG, "No mem");
|
ESP_RETURN_ON_FALSE(node, ESP_ERR_NO_MEM, TAG, "No mem");
|
||||||
node->ctrlr_id = -1;
|
node->ctrlr_id = -1;
|
||||||
// Acquire controller
|
// Acquire controller
|
||||||
|
@ -10,6 +10,6 @@ endif()
|
|||||||
|
|
||||||
idf_component_register(
|
idf_component_register(
|
||||||
SRCS ${srcs}
|
SRCS ${srcs}
|
||||||
PRIV_REQUIRES esp_driver_twai esp_timer esp_driver_uart
|
PRIV_REQUIRES esp_driver_twai esp_timer esp_driver_uart esp_psram
|
||||||
WHOLE_ARCHIVE
|
WHOLE_ARCHIVE
|
||||||
)
|
)
|
||||||
|
@ -0,0 +1,2 @@
|
|||||||
|
CONFIG_SPIRAM=y
|
||||||
|
CONFIG_SPIRAM_MALLOC_ALWAYSINTERNAL=0
|
Reference in New Issue
Block a user