feat(soc): Add soc_caps macros for sleep support

- modify console example to use the new SOC_LIGHT_SLEEP_SUPPORTED
and SOC_DEEP_SLEEP_SUPPORTED macros when registering sleep commands

- remove exclusion of esp32p4 in basic and advanced example in
.build-test-rules.yml

- replace exclusion of esp32p4 for deep and light sleep tests with newly introduced macro

- remove the temporary disable check for esp32p4 and uses the
SOC_LIGHT_SLEEP_SUPPORTED maccro instead.
This commit is contained in:
Guillaume Souchere
2024-02-01 11:28:28 +01:00
parent 5f85aefe0d
commit 0b9f01ac20
26 changed files with 119 additions and 43 deletions
@@ -14,5 +14,12 @@
void register_system(void)
{
register_system_common();
register_system_sleep();
#if SOC_LIGHT_SLEEP_SUPPORTED
register_system_light_sleep();
#endif
#if SOC_DEEP_SLEEP_SUPPORTED
register_system_deep_sleep();
#endif
}
@@ -19,7 +19,8 @@ void register_system(void);
void register_system_common(void);
// Register deep and light sleep functions
void register_system_sleep(void);
void register_system_deep_sleep(void);
void register_system_light_sleep(void);
#ifdef __cplusplus
}
@@ -1,5 +1,5 @@
/*
* SPDX-FileCopyrightText: 2023 Espressif Systems (Shanghai) CO LTD
* SPDX-FileCopyrightText: 2023-2024 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Unlicense OR CC0-1.0
*/
@@ -29,16 +29,6 @@
static const char *TAG = "cmd_system_sleep";
static void register_deep_sleep(void);
static void register_light_sleep(void);
void register_system_sleep(void)
{
register_deep_sleep();
register_light_sleep();
}
/** 'deep_sleep' command puts the chip into deep sleep mode */
static struct {
@@ -95,7 +85,7 @@ static int deep_sleep(int argc, char **argv)
return 1;
}
static void register_deep_sleep(void)
void register_system_deep_sleep(void)
{
int num_args = 1;
deep_sleep_args.wakeup_time =
@@ -196,7 +186,7 @@ static int light_sleep(int argc, char **argv)
return 0;
}
static void register_light_sleep(void)
void register_system_light_sleep(void)
{
light_sleep_args.wakeup_time =
arg_int0("t", "time", "<t>", "Wake up time, ms");