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 aabe82f8f8b785cf0c0d8c0a7115066f5c8eac51
Author: Jerzy Kasenberg <[email protected]>
AuthorDate: Sat May 31 19:19:22 2025 +0200

    test/flash_test: Register commands statically
    
    Now flash_test commands are register at link time to
    reduce memory footprint.
    No change in functionality.
    
    Signed-off-by: Jerzy Kasenberg <[email protected]>
---
 test/flash_test/pkg.yml          |  3 +--
 test/flash_test/src/flash_test.c | 22 ++--------------------
 test/flash_test/syscfg.yml       |  4 ----
 3 files changed, 3 insertions(+), 26 deletions(-)

diff --git a/test/flash_test/pkg.yml b/test/flash_test/pkg.yml
index ca2045060..8dfa35026 100644
--- a/test/flash_test/pkg.yml
+++ b/test/flash_test/pkg.yml
@@ -30,5 +30,4 @@ pkg.deps:
 pkg.req_apis:
     - console
 
-pkg.init:
-    flash_test_init: 'MYNEWT_VAL(FLASH_TEST_SYSINIT_STAGE)'
+pkg.whole_archive: true
diff --git a/test/flash_test/src/flash_test.c b/test/flash_test/src/flash_test.c
index f9a89d48a..acfae8fbf 100644
--- a/test/flash_test/src/flash_test.c
+++ b/test/flash_test/src/flash_test.c
@@ -29,17 +29,6 @@
 #include <string.h>
 #include <ctype.h>
 
-static int flash_cli_cmd(const struct shell_cmd *cmd, int argc, char **argv,
-                         struct streamer *streamer);
-static int flash_speed_test_cli(const struct shell_cmd *cmd, int argc,
-                                char **argv, struct streamer *streamer);
-
-static struct shell_cmd flash_cmd_struct =
-    SHELL_CMD_EXT("flash", flash_cli_cmd, NULL);
-
-static struct shell_cmd flash_speed_cli_struct =
-    SHELL_CMD_EXT("flash_speed", flash_speed_test_cli, NULL);
-
 static void
 dump_sector_range_info(struct streamer *streamer, int start_sector, uint32_t 
start_address,
                        int sector_count, uint32_t sector_size)
@@ -370,12 +359,5 @@ flash_speed_test_cli(const struct shell_cmd *cmd, int 
argc, char **argv,
     return 0;
 }
 
-/*
- * Initialize the package. Only called from sysinit().
- */
-void
-flash_test_init(void)
-{
-    shell_cmd_register(&flash_cmd_struct);
-    shell_cmd_register(&flash_speed_cli_struct);
-}
+MAKE_SHELL_EXT_CMD(flash, flash_cli_cmd, NULL)
+MAKE_SHELL_EXT_CMD(flash_speed, flash_speed_test_cli, NULL);
diff --git a/test/flash_test/syscfg.yml b/test/flash_test/syscfg.yml
index c16dcc8bd..9d3c811a8 100644
--- a/test/flash_test/syscfg.yml
+++ b/test/flash_test/syscfg.yml
@@ -18,7 +18,3 @@
 #
 
 syscfg.defs:
-    FLASH_TEST_SYSINIT_STAGE:
-        description: >
-            Sysinit stage for flash test functionality.
-        value: 500

Reply via email to