From dafc6676aea5e62d6dad25e3ef277515259f17ab Mon Sep 17 00:00:00 2001 From: Ivan Grokhotkov Date: Thu, 30 Apr 2020 16:52:39 +0200 Subject: [PATCH] examples/console: allow not registering sleep related commands --- .../console/components/cmd_system/cmd_system.c | 18 ++++++++++++++---- .../console/components/cmd_system/cmd_system.h | 8 +++++++- 2 files changed, 21 insertions(+), 5 deletions(-) diff --git a/examples/system/console/components/cmd_system/cmd_system.c b/examples/system/console/components/cmd_system/cmd_system.c index e78e41bc16..1acb295250 100644 --- a/examples/system/console/components/cmd_system/cmd_system.c +++ b/examples/system/console/components/cmd_system/cmd_system.c @@ -39,19 +39,29 @@ static void register_light_sleep(void); static void register_tasks(void); #endif -void register_system(void) +void register_system_common(void) { register_free(); register_heap(); register_version(); register_restart(); - register_deep_sleep(); - register_light_sleep(); #if WITH_TASKS_INFO register_tasks(); #endif } +void register_system_sleep(void) +{ + register_deep_sleep(); + register_light_sleep(); +} + +void register_system(void) +{ + register_system_common(); + register_system_sleep(); +} + /* 'version' command */ static int get_version(int argc, char **argv) { @@ -124,7 +134,7 @@ static void register_free(void) static int heap_size(int argc, char **argv) { uint32_t heap_size = heap_caps_get_minimum_free_size(MALLOC_CAP_DEFAULT); - ESP_LOGI(TAG, "min heap size: %u", heap_size); + printf("min heap size: %u\n", heap_size); return 0; } diff --git a/examples/system/console/components/cmd_system/cmd_system.h b/examples/system/console/components/cmd_system/cmd_system.h index 9af96a8ae5..52bcfb9c46 100644 --- a/examples/system/console/components/cmd_system/cmd_system.h +++ b/examples/system/console/components/cmd_system/cmd_system.h @@ -12,9 +12,15 @@ extern "C" { #endif -// Register system functions +// Register all system functions void register_system(void); +// Register common system functions: "version", "restart", "free", "heap", "tasks" +void register_system_common(void); + +// Register deep and light sleep functions +void register_system_sleep(void); + #ifdef __cplusplus } #endif