You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mynewt.apache.org by je...@apache.org on 2025/11/07 16:53:12 UTC
(mynewt-core) 12/26: test/i2c_scan: Register command statically
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 d5faa2142c2a60e23e42c465579b0a5e44d53531
Author: Jerzy Kasenberg <je...@codecoup.pl>
AuthorDate: Sun Jun 1 12:52:39 2025 +0200
test/i2c_scan: Register command statically
Now i2c_scan shell command is register at link time to
reduce memory footprint.
No change in functionality.
Signed-off-by: Jerzy Kasenberg <je...@apache.org>
---
test/i2c_scan/pkg.yml | 3 +--
test/i2c_scan/src/i2c_scan.c | 13 +------------
test/i2c_scan/syscfg.yml | 4 ----
3 files changed, 2 insertions(+), 18 deletions(-)
diff --git a/test/i2c_scan/pkg.yml b/test/i2c_scan/pkg.yml
index c19ddb361..6854d51ae 100644
--- a/test/i2c_scan/pkg.yml
+++ b/test/i2c_scan/pkg.yml
@@ -31,5 +31,4 @@ pkg.deps:
pkg.req_apis:
- console
-pkg.init:
- i2c_scan_init: 'MYNEWT_VAL(I2C_SCAN_SYSINIT_STAGE)'
+pkg.whole_archive: true
diff --git a/test/i2c_scan/src/i2c_scan.c b/test/i2c_scan/src/i2c_scan.c
index 00cffdaf4..8986a67b2 100644
--- a/test/i2c_scan/src/i2c_scan.c
+++ b/test/i2c_scan/src/i2c_scan.c
@@ -27,13 +27,6 @@
#include <bus/drivers/i2c_common.h>
#endif
-static int i2c_scan_cli_cmd(int argc, char **argv);
-
-static struct shell_cmd i2c_scan_cmd_struct = {
- .sc_cmd = "i2c_scan",
- .sc_cmd_func = i2c_scan_cli_cmd
-};
-
#if MYNEWT_VAL(BUS_DRIVER_PRESENT)
static int
i2c_scan_probe(int i2c_num, uint16_t address, uint32_t timeout)
@@ -108,8 +101,4 @@ i2c_scan_cli_cmd(int argc, char **argv)
return 0;
}
-void
-i2c_scan_init(void)
-{
- shell_cmd_register(&i2c_scan_cmd_struct);
-}
+MAKE_SHELL_CMD(i2c_scan, i2c_scan_cli_cmd, NULL)
diff --git a/test/i2c_scan/syscfg.yml b/test/i2c_scan/syscfg.yml
index b23bac85e..9d3c811a8 100644
--- a/test/i2c_scan/syscfg.yml
+++ b/test/i2c_scan/syscfg.yml
@@ -18,7 +18,3 @@
#
syscfg.defs:
- I2C_SCAN_SYSINIT_STAGE:
- description: >
- Sysinit stage for I2C scan test functionality.
- value: 500