This is an automated email from the ASF dual-hosted git repository.

jerzy pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/mynewt-core.git

commit 0d4bf64cf481dacb7c9f799cd22ba601fee110b2
Author: Jerzy Kasenberg <[email protected]>
AuthorDate: Sun Jun 1 14:43:27 2025 +0200

    stm32f1/mcu_cli: Register shell module statically
    
    Now mcu shell module is register at link time to
    reduce memory footprint.
    No change in functionality.
    
    Signed-off-by: Jerzy Kasenberg <[email protected]>
---
 hw/mcu/stm/stm32f1xx/mcu_cli/pkg.yml       | 3 +--
 hw/mcu/stm/stm32f1xx/mcu_cli/src/mcu_cli.c | 9 +--------
 hw/mcu/stm/stm32f1xx/mcu_cli/syscfg.yml    | 4 ----
 3 files changed, 2 insertions(+), 14 deletions(-)

diff --git a/hw/mcu/stm/stm32f1xx/mcu_cli/pkg.yml 
b/hw/mcu/stm/stm32f1xx/mcu_cli/pkg.yml
index 916c15b3d..6c4d3183c 100644
--- a/hw/mcu/stm/stm32f1xx/mcu_cli/pkg.yml
+++ b/hw/mcu/stm/stm32f1xx/mcu_cli/pkg.yml
@@ -28,5 +28,4 @@ pkg.deps:
 pkg.req_apis:
     - console
 
-pkg.init:
-    mcu_cli_init: 'MYNEWT_VAL(MCU_CLI_SYSINIT_STAGE)'
+pkg.whole_archive: true
diff --git a/hw/mcu/stm/stm32f1xx/mcu_cli/src/mcu_cli.c 
b/hw/mcu/stm/stm32f1xx/mcu_cli/src/mcu_cli.c
index c0bc3577d..3e836cc7d 100644
--- a/hw/mcu/stm/stm32f1xx/mcu_cli/src/mcu_cli.c
+++ b/hw/mcu/stm/stm32f1xx/mcu_cli/src/mcu_cli.c
@@ -277,13 +277,6 @@ static const struct shell_cmd_help mcu_cli_info_help = {
 
 static const struct shell_cmd mcu_cli_commands[] = {
     SHELL_CMD_EXT("info", mcu_cli_info_cmd, &mcu_cli_info_help),
-    { },
 };
 
-int
-mcu_cli_init(void)
-{
-    shell_register("mcu", mcu_cli_commands);
-
-    return 0;
-}
+SHELL_MODULE_WITH_TABLE(mcu, mcu_cli_commands)
diff --git a/hw/mcu/stm/stm32f1xx/mcu_cli/syscfg.yml 
b/hw/mcu/stm/stm32f1xx/mcu_cli/syscfg.yml
index 44c28e3ce..02e0ccc96 100644
--- a/hw/mcu/stm/stm32f1xx/mcu_cli/syscfg.yml
+++ b/hw/mcu/stm/stm32f1xx/mcu_cli/syscfg.yml
@@ -15,7 +15,3 @@
 #
 
 syscfg.defs:
-    MCU_CLI_SYSINIT_STAGE:
-        description: >
-            Sysinit stage for mcu cli.
-        value: 501

Reply via email to