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 1d75a3d300804bbcc958efa6d6b1a8083d33546b Author: Jerzy Kasenberg <[email protected]> AuthorDate: Sun Jun 1 12:37:07 2025 +0200 test/spiflash_stress_test: Register command statically Now flashstress shell command is register at link time to reduce memory footprint. No change in functionality. Signed-off-by: Jerzy Kasenberg <[email protected]> --- test/spiflash_stress_test/pkg.yml | 2 ++ test/spiflash_stress_test/src/spiflash_stress_test.c | 10 ++-------- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/test/spiflash_stress_test/pkg.yml b/test/spiflash_stress_test/pkg.yml index 201236c32..f5a1a3841 100644 --- a/test/spiflash_stress_test/pkg.yml +++ b/test/spiflash_stress_test/pkg.yml @@ -29,6 +29,8 @@ pkg.deps: pkg.req_apis: - console +pkg.whole_archive: true + pkg.init: spiflash_stress_test_init: 500 diff --git a/test/spiflash_stress_test/src/spiflash_stress_test.c b/test/spiflash_stress_test/src/spiflash_stress_test.c index 633313376..c435fd80b 100644 --- a/test/spiflash_stress_test/src/spiflash_stress_test.c +++ b/test/spiflash_stress_test/src/spiflash_stress_test.c @@ -142,12 +142,6 @@ void flash_test_task1(void *arg) } } -static int spiflash_stress_test_cli_cmd(int argc, char **argv); -static struct shell_cmd spiflash_stress_cmd_struct = { - .sc_cmd = "flashstress", - .sc_cmd_func = spiflash_stress_test_cli_cmd -}; - static int spiflash_stress_test_cli_cmd(int argc, char **argv) { @@ -164,6 +158,8 @@ spiflash_stress_test_cli_cmd(int argc, char **argv) return 0; } +MAKE_SHELL_CMD(flashstress, spiflash_stress_test_cli_cmd, NULL) + /* * Initialize the package. Only called from sysinit(). */ @@ -174,6 +170,4 @@ spiflash_stress_test_init(void) runtest_init_task(flash_test_task1, MYNEWT_VAL(OS_MAIN_TASK_PRIO) + 1); runtest_init_task(flash_test_task1, MYNEWT_VAL(OS_MAIN_TASK_PRIO) + 2); runtest_init_task(flash_test_task1, MYNEWT_VAL(OS_MAIN_TASK_PRIO) + 3); - - shell_cmd_register(&spiflash_stress_cmd_struct); }
