Skip to content

Commit 14394ed

Browse files
committed
Merge branch 'bugfix/esp_pm_and_sleep_build_errors' into 'master'
esp_system: Fix various PM and sleep build errors Closes IDFGH-8930 See merge request espressif/esp-idf!21606
2 parents d534d08 + 2f50469 commit 14394ed

File tree

3 files changed

+5
-4
lines changed

3 files changed

+5
-4
lines changed

components/esp_pm/pm_impl.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
#include <stdlib.h>
88
#include <stdbool.h>
99
#include <string.h>
10+
#include <stdint.h>
1011
#include <sys/param.h>
1112

1213
#include "esp_attr.h"
@@ -646,7 +647,7 @@ void IRAM_ATTR vApplicationSleep( TickType_t xExpectedIdleTime )
646647
int64_t sleep_time_us = MIN(wakeup_delay_us, time_until_next_alarm);
647648
if (sleep_time_us >= configEXPECTED_IDLE_TIME_BEFORE_SLEEP * portTICK_PERIOD_MS * 1000LL) {
648649
esp_sleep_enable_timer_wakeup(sleep_time_us - LIGHT_SLEEP_EARLY_WAKEUP_US);
649-
#ifdef CONFIG_PM_TRACE
650+
#if CONFIG_PM_TRACE && SOC_PM_SUPPORT_RTC_PERIPH_PD
650651
/* to force tracing GPIOs to keep state */
651652
esp_sleep_pd_config(ESP_PD_DOMAIN_RTC_PERIPH, ESP_PD_OPTION_ON);
652653
#endif
@@ -704,7 +705,7 @@ void esp_pm_impl_dump_stats(FILE* out)
704705
/* don't display light sleep mode if it's not enabled */
705706
continue;
706707
}
707-
fprintf(out, "%-8s %-3dM%-7s %-10lld %-2d%%\n",
708+
fprintf(out, "%-8s %-3"PRIu32"M%-7s %-10lld %-2d%%\n",
708709
s_mode_names[i],
709710
s_cpu_freq_by_mode[i].freq_mhz,
710711
"", //Empty space to align columns

components/esp_pm/test/CMakeLists.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,2 @@
11
idf_component_register(SRC_DIRS .
22
PRIV_REQUIRES unity esp_pm ulp driver esp_timer test_utils)
3-
target_compile_options(${COMPONENT_LIB} PRIVATE "-Wno-format")

components/esp_pm/test/test_pm.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
#include <stdio.h>
22
#include <stdlib.h>
3+
#include <stdint.h>
34
#include <time.h>
45
#include <sys/time.h>
56
#include <sys/param.h>
@@ -351,7 +352,7 @@ TEST_CASE("esp_timer produces correct delays with light sleep", "[pm]")
351352
test_args_t *p_args = (test_args_t *) arg;
352353
int64_t t_end = esp_clk_rtc_time();
353354
int32_t ms_diff = (t_end - p_args->t_start) / 1000;
354-
printf("timer #%d %dms\n", p_args->cur_interval, ms_diff);
355+
printf("timer #%d %"PRIi32"ms\n", p_args->cur_interval, ms_diff);
355356
p_args->intervals[p_args->cur_interval++] = ms_diff;
356357
// Deliberately make timer handler run longer.
357358
// We check that this doesn't affect the result.

0 commit comments

Comments
 (0)