diff --git a/components/driver/gdma.c b/components/driver/gdma.c index 4532d5527f..1d0c49a0d5 100644 --- a/components/driver/gdma.c +++ b/components/driver/gdma.c @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: 2020-2021 Espressif Systems (Shanghai) CO LTD + * SPDX-FileCopyrightText: 2020-2022 Espressif Systems (Shanghai) CO LTD * * SPDX-License-Identifier: Apache-2.0 */ @@ -34,12 +34,6 @@ static const char *TAG = "gdma"; #define GDMA_MEM_ALLOC_CAPS MALLOC_CAP_DEFAULT #endif // CONFIG_GDMA_ISR_IRAM_SAFE -#if CONFIG_GDMA_CTRL_FUNC_IN_IRAM -#define GDMA_CTRL_FUNC_ATTR IRAM_ATTR -#else -#define GDMA_CTRL_FUNC_ATTR -#endif // CONFIG_GDMA_CTRL_FUNC_IN_IRAM - #define GDMA_INVALID_PERIPH_TRIG (0x3F) #define SEARCH_REQUEST_RX_CHANNEL (1 << 0) #define SEARCH_REQUEST_TX_CHANNEL (1 << 1) @@ -452,7 +446,7 @@ err: return ret; } -GDMA_CTRL_FUNC_ATTR esp_err_t gdma_start(gdma_channel_handle_t dma_chan, intptr_t desc_base_addr) +esp_err_t gdma_start(gdma_channel_handle_t dma_chan, intptr_t desc_base_addr) { esp_err_t ret = ESP_OK; gdma_pair_t *pair = NULL; @@ -473,7 +467,7 @@ err: return ret; } -GDMA_CTRL_FUNC_ATTR esp_err_t gdma_stop(gdma_channel_handle_t dma_chan) +esp_err_t gdma_stop(gdma_channel_handle_t dma_chan) { esp_err_t ret = ESP_OK; gdma_pair_t *pair = NULL; @@ -492,7 +486,7 @@ err: return ret; } -GDMA_CTRL_FUNC_ATTR esp_err_t gdma_append(gdma_channel_handle_t dma_chan) +esp_err_t gdma_append(gdma_channel_handle_t dma_chan) { esp_err_t ret = ESP_OK; gdma_pair_t *pair = NULL; @@ -511,7 +505,7 @@ err: return ret; } -GDMA_CTRL_FUNC_ATTR esp_err_t gdma_reset(gdma_channel_handle_t dma_chan) +esp_err_t gdma_reset(gdma_channel_handle_t dma_chan) { esp_err_t ret = ESP_OK; gdma_pair_t *pair = NULL; diff --git a/components/driver/gptimer.c b/components/driver/gptimer.c index 52535ec9a4..31679cc3b9 100644 --- a/components/driver/gptimer.c +++ b/components/driver/gptimer.c @@ -35,12 +35,6 @@ #define GPTIMER_MEM_ALLOC_CAPS MALLOC_CAP_DEFAULT #endif //CONFIG_GPTIMER_ISR_IRAM_SAFE -#if CONFIG_GPTIMER_CTRL_FUNC_IN_IRAM -#define GPTIMER_CTRL_FUNC_ATTR IRAM_ATTR -#else -#define GPTIMER_CTRL_FUNC_ATTR -#endif // CONFIG_GPTIMER_CTRL_FUNC_IN_IRAM - #define GPTIMER_PM_LOCK_NAME_LEN_MAX 16 static const char *TAG = "gptimer"; @@ -213,7 +207,6 @@ esp_err_t gptimer_del_timer(gptimer_handle_t timer) return ESP_OK; } -GPTIMER_CTRL_FUNC_ATTR esp_err_t gptimer_set_raw_count(gptimer_handle_t timer, unsigned long long value) { ESP_RETURN_ON_FALSE(timer, ESP_ERR_INVALID_ARG, TAG, "invalid argument"); @@ -224,7 +217,6 @@ esp_err_t gptimer_set_raw_count(gptimer_handle_t timer, unsigned long long value return ESP_OK; } -GPTIMER_CTRL_FUNC_ATTR esp_err_t gptimer_get_raw_count(gptimer_handle_t timer, unsigned long long *value) { ESP_RETURN_ON_FALSE(timer && value, ESP_ERR_INVALID_ARG, TAG, "invalid argument"); @@ -265,7 +257,6 @@ esp_err_t gptimer_register_event_callbacks(gptimer_handle_t timer, const gptimer return ESP_OK; } -GPTIMER_CTRL_FUNC_ATTR esp_err_t gptimer_set_alarm_action(gptimer_handle_t timer, const gptimer_alarm_config_t *config) { ESP_RETURN_ON_FALSE(timer, ESP_ERR_INVALID_ARG, TAG, "invalid argument"); @@ -295,7 +286,6 @@ esp_err_t gptimer_set_alarm_action(gptimer_handle_t timer, const gptimer_alarm_c return ESP_OK; } -GPTIMER_CTRL_FUNC_ATTR esp_err_t gptimer_start(gptimer_handle_t timer) { ESP_RETURN_ON_FALSE(timer, ESP_ERR_INVALID_ARG, TAG, "invalid argument"); @@ -318,7 +308,6 @@ esp_err_t gptimer_start(gptimer_handle_t timer) return ESP_OK; } -GPTIMER_CTRL_FUNC_ATTR esp_err_t gptimer_stop(gptimer_handle_t timer) { ESP_RETURN_ON_FALSE(timer, ESP_ERR_INVALID_ARG, TAG, "invalid argument"); diff --git a/components/driver/linker.lf b/components/driver/linker.lf index f260c79cf7..eb3eea8506 100644 --- a/components/driver/linker.lf +++ b/components/driver/linker.lf @@ -7,3 +7,14 @@ entries: # placed in flash. if TWAI_ISR_IN_IRAM = y && (TWAI_ERRATA_FIX_RX_FRAME_INVALID = y || TWAI_ERRATA_FIX_RX_FIFO_CORRUPT = y): periph_ctrl: periph_module_reset (noflash) + if GPTIMER_CTRL_FUNC_IN_IRAM = y: + gptimer: gptimer_set_raw_count (noflash) + gptimer: gptimer_get_raw_count (noflash) + gptimer: gptimer_set_alarm_action (noflash) + gptimer: gptimer_start (noflash) + gptimer: gptimer_stop (noflash) + if GDMA_CTRL_FUNC_IN_IRAM = y: + gdma: gdma_start (noflash) + gdma: gdma_stop (noflash) + gdma: gdma_append (noflash) + gdma: gdma_reset (noflash)