Skip to content

Commit 77a1e29

Browse files
committed
change: fix build clang test apps job error
1 parent b7e26d5 commit 77a1e29

File tree

6 files changed

+42
-26
lines changed

6 files changed

+42
-26
lines changed

components/esp_hw_support/esp_clk.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,12 @@
2626

2727
#define MHZ (1000000)
2828

29+
#if CONFIG_PM_SLP_IRAM_OPT
30+
# define ESP_CLK_FN_ATTR IRAM_ATTR
31+
#else
32+
# define ESP_CLK_FN_ATTR
33+
#endif
34+
2935
// g_ticks_us defined in ROMs for PRO and APP CPU
3036
extern uint32_t g_ticks_per_us_pro;
3137

@@ -48,7 +54,7 @@ _Static_assert(offsetof(retain_mem_t, checksum) == sizeof(retain_mem_t) - sizeof
4854
#if !NON_OS_BUILD
4955
static __attribute__((section(".rtc_timer_data_in_rtc_mem"))) retain_mem_t s_rtc_timer_retain_mem;
5056

51-
static uint32_t calc_checksum(void)
57+
static ESP_CLK_FN_ATTR uint32_t calc_checksum(void)
5258
{
5359
uint32_t checksum = 0;
5460
uint32_t *data = (uint32_t*) &s_rtc_timer_retain_mem;

components/esp_hw_support/sar_periph_ctrl_common.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,12 @@ static const char *TAG_TSENS = "temperature_sensor";
3333
#define TSENS_RCC_ATOMIC()
3434
#endif
3535

36+
#if CONFIG_PM_SLP_IRAM_OPT
37+
# define SAR_PERIPH_CTRL_COMMON_FN_ATTR IRAM_ATTR
38+
#else
39+
# define SAR_PERIPH_CTRL_COMMON_FN_ATTR
40+
#endif
41+
3642
static int s_record_min = INT_NOT_USED;
3743
static int s_record_max = INT_NOT_USED;
3844
static int s_temperature_sensor_power_cnt;
@@ -79,7 +85,7 @@ void temperature_sensor_power_release(void)
7985
portEXIT_CRITICAL(&rtc_spinlock);
8086
}
8187

82-
static int temperature_sensor_get_raw_value(void)
88+
static SAR_PERIPH_CTRL_COMMON_FN_ATTR int temperature_sensor_get_raw_value(void)
8389
{
8490
int raw_value = temperature_sensor_ll_get_raw_value();
8591
return (TEMPERATURE_SENSOR_LL_ADC_FACTOR * raw_value - TEMPERATURE_SENSOR_LL_DAC_FACTOR * temperature_sensor_attributes[s_tsens_idx].offset - TEMPERATURE_SENSOR_LL_OFFSET_FACTOR);

components/esp_pm/linker.lf

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -39,16 +39,13 @@ entries:
3939
esp_clk:esp_rtc_get_time_us (noflash)
4040
esp_clk:esp_clk_private_lock (noflash)
4141
esp_clk:esp_clk_private_unlock (noflash)
42-
if SOC_RTC_MEM_SUPPORTED = y:
43-
esp_clk:calc_checksum (noflash)
4442
if SOC_SYSTIMER_SUPPORTED = y:
4543
systimer (noflash)
4644
if IDF_TARGET_ESP32H21 != y && IDF_TARGET_ESP32H4 != y:
4745
sar_periph_ctrl:sar_periph_ctrl_power_disable (noflash)
4846
if SOC_TEMP_SENSOR_SUPPORTED = y:
4947
sar_periph_ctrl_common:temperature_sensor_power_acquire (noflash)
5048
sar_periph_ctrl_common:temperature_sensor_power_release (noflash)
51-
sar_periph_ctrl_common:temperature_sensor_get_raw_value (noflash)
5249
sar_periph_ctrl_common:temp_sensor_get_raw_value (noflash)
5350
regi2c_ctrl:regi2c_saradc_enable (noflash)
5451
regi2c_ctrl:regi2c_saradc_disable (noflash)
@@ -61,17 +58,6 @@ archive: libesp_system.a
6158
entries:
6259
if PM_RTOS_IDLE_OPT = y:
6360
freertos_hooks:esp_vApplicationIdleHook (noflash)
64-
if PM_SLP_IRAM_OPT = y:
65-
task_wdt:idle_hook_cb (noflash)
66-
task_wdt:task_wdt_timer_feed (noflash)
67-
task_wdt:find_entry_and_check_all_reset (noflash)
68-
task_wdt:find_entry_from_task_handle_and_check_all_reset (noflash)
69-
task_wdt:esp_task_wdt_reset (noflash)
70-
task_wdt:esp_task_wdt_reset_user (noflash)
71-
if ESP_TASK_WDT_USE_ESP_TIMER = y:
72-
task_wdt_impl_esp_timer:esp_task_wdt_impl_timer_feed (noflash)
73-
else:
74-
task_wdt_impl_timergroup:esp_task_wdt_impl_timer_feed (noflash)
7561

7662
[mapping:esp_timer_pm]
7763
archive: libesp_timer.a

components/esp_system/task_wdt/task_wdt.c

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,12 @@
3636
#define BACKTRACE_MSG "backtrace"
3737
#endif
3838

39+
#if CONFIG_PM_RTOS_IDLE_OPT
40+
# define TASK_WDT_FN_ATTR IRAM_ATTR
41+
#else
42+
# define TASK_WDT_FN_ATTR
43+
#endif
44+
3945
/* We will use this function in order to simulate an `abort()` occurring in
4046
* a different context than the one it's called from. */
4147
extern void xt_unhandled_exception(void *frame);
@@ -96,7 +102,7 @@ static char core_user_names[CONFIG_FREERTOS_NUMBER_OF_CORES][CORE_USER_NAME_LEN]
96102
* @brief Reset the timer and reset flags of each entry
97103
* When entering this function, the spinlock has already been taken, no need to take it back.
98104
*/
99-
static void task_wdt_timer_feed(void)
105+
static TASK_WDT_FN_ATTR void task_wdt_timer_feed(void)
100106
{
101107
esp_task_wdt_impl_timer_feed(p_twdt_obj->impl_ctx);
102108

@@ -114,7 +120,7 @@ static void task_wdt_timer_feed(void)
114120
* @param[out] all_reset Whether all entries have been reset
115121
* @return Whether the user entry exists
116122
*/
117-
static bool find_entry_and_check_all_reset(twdt_entry_t *user_entry, bool *all_reset)
123+
static TASK_WDT_FN_ATTR bool find_entry_and_check_all_reset(twdt_entry_t *user_entry, bool *all_reset)
118124
{
119125
bool found_user_entry = false;
120126
bool found_non_reset = false;
@@ -139,7 +145,7 @@ static bool find_entry_and_check_all_reset(twdt_entry_t *user_entry, bool *all_r
139145
* @param[out] all_reset Whether all entries have been reset
140146
* @return Task entry, or NULL if not found
141147
*/
142-
static twdt_entry_t *find_entry_from_task_handle_and_check_all_reset(TaskHandle_t handle, bool *all_reset)
148+
static TASK_WDT_FN_ATTR twdt_entry_t *find_entry_from_task_handle_and_check_all_reset(TaskHandle_t handle, bool *all_reset)
143149
{
144150
twdt_entry_t *target = NULL;
145151
bool found_non_reset = false;
@@ -448,7 +454,7 @@ static void task_wdt_timeout_handling(int cores_fail, bool panic)
448454
*
449455
* @return Whether the idle tasks should continue idling
450456
*/
451-
static bool idle_hook_cb(void)
457+
static TASK_WDT_FN_ATTR bool idle_hook_cb(void)
452458
{
453459
#if CONFIG_FREERTOS_SMP
454460
esp_task_wdt_reset_user(core_user_handles[xPortGetCoreID()]);
@@ -687,7 +693,7 @@ esp_err_t esp_task_wdt_add_user(const char *user_name, esp_task_wdt_user_handle_
687693
return ret;
688694
}
689695

690-
esp_err_t esp_task_wdt_reset(void)
696+
esp_err_t TASK_WDT_FN_ATTR esp_task_wdt_reset(void)
691697
{
692698
ESP_RETURN_ON_FALSE(p_twdt_obj != NULL, ESP_ERR_INVALID_STATE, TAG, "TWDT was never initialized");
693699
esp_err_t ret;
@@ -711,7 +717,7 @@ esp_err_t esp_task_wdt_reset(void)
711717
return ret;
712718
}
713719

714-
esp_err_t esp_task_wdt_reset_user(esp_task_wdt_user_handle_t user_handle)
720+
esp_err_t TASK_WDT_FN_ATTR esp_task_wdt_reset_user(esp_task_wdt_user_handle_t user_handle)
715721
{
716722
ESP_RETURN_ON_FALSE(user_handle != NULL, ESP_ERR_INVALID_ARG, TAG, "Invalid arguments");
717723
ESP_RETURN_ON_FALSE(p_twdt_obj != NULL, ESP_ERR_INVALID_STATE, TAG, "TWDT was never initialized");

components/esp_system/task_wdt/task_wdt_impl_esp_timer.c

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* SPDX-FileCopyrightText: 2015-2024 Espressif Systems (Shanghai) CO LTD
2+
* SPDX-FileCopyrightText: 2015-2025 Espressif Systems (Shanghai) CO LTD
33
*
44
* SPDX-License-Identifier: Apache-2.0
55
*/
@@ -17,6 +17,12 @@
1717
#include "esp_timer.h"
1818
#include "esp_private/esp_task_wdt_impl.h"
1919

20+
#if CONFIG_PM_SLP_IRAM_OPT
21+
# define TASK_WDT_FN_ATTR IRAM_ATTR
22+
#else
23+
# define TASK_WDT_FN_ATTR
24+
#endif
25+
2026
/**
2127
* Context for the software implementation of the Task WatchDog Timer.
2228
* This will be passed as a parameter to public functions below. */
@@ -50,7 +56,7 @@ esp_err_t esp_task_wdt_impl_timer_allocate(const esp_task_wdt_config_t *config,
5056
esp_err_t ret = esp_timer_create(&timer_args, &ctx->sw_timer);
5157
ESP_GOTO_ON_FALSE((ret == ESP_OK), ret, reterr, TAG, "could not start periodic timer");
5258

53-
/* Configure it as a periodic timer, so that we check the Tasks everytime it is triggered.
59+
/* Configure it as a periodic timer, so that we check the Tasks every time it is triggered.
5460
* No need to start the timer here, it will be started later with `esp_task_wdt_impl_timer_restart` */
5561
ctx->period_ms = config->timeout_ms;
5662

@@ -89,7 +95,7 @@ void esp_task_wdt_impl_timer_free(twdt_ctx_t obj)
8995
}
9096
}
9197

92-
esp_err_t esp_task_wdt_impl_timer_feed(twdt_ctx_t obj)
98+
esp_err_t TASK_WDT_FN_ATTR esp_task_wdt_impl_timer_feed(twdt_ctx_t obj)
9399
{
94100
esp_err_t ret = ESP_OK;
95101
const twdt_ctx_soft_t* ctx = (twdt_ctx_soft_t*) obj;

components/esp_system/task_wdt/task_wdt_impl_timergroup.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,12 @@
3232
#define TWDT_TIMER_GROUP 0
3333
#define TWDT_INTR_SOURCE SYS_TG0_WDT_INTR_SOURCE
3434

35+
#if CONFIG_PM_SLP_IRAM_OPT
36+
# define TASK_WDT_FN_ATTR IRAM_ATTR
37+
#else
38+
# define TASK_WDT_FN_ATTR
39+
#endif
40+
3541
/**
3642
* Context for the software implementation of the Task WatchDog Timer.
3743
* This will be passed as a parameter to public functions below. */
@@ -177,7 +183,7 @@ void esp_task_wdt_impl_timer_free(twdt_ctx_t obj)
177183
}
178184
}
179185

180-
esp_err_t esp_task_wdt_impl_timer_feed(twdt_ctx_t obj)
186+
esp_err_t TASK_WDT_FN_ATTR esp_task_wdt_impl_timer_feed(twdt_ctx_t obj)
181187
{
182188
esp_err_t ret = ESP_OK;
183189
twdt_ctx_hard_t* ctx = (twdt_ctx_hard_t*) obj;

0 commit comments

Comments
 (0)