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 78ec964372b56f957b2f119daef9131b93c6785a
Author: Jerzy Kasenberg <[email protected]>
AuthorDate: Wed Jun 4 17:57:36 2025 +0200

    drivers/bq27z561: Register command statically
    
    Now BQ27Z561 shell command is registered at link time to
    reduce memory footprint.
    No change in functionality.
    
    Signed-off-by: Jerzy Kasenberg <[email protected]>
---
 hw/drivers/bq27z561/include/bq27z561/bq27z561.h |  9 ---------
 hw/drivers/bq27z561/pkg.yml                     |  4 ++--
 hw/drivers/bq27z561/src/bq27z561.c              |  9 ---------
 hw/drivers/bq27z561/src/bq27z561_shell.c        | 11 +----------
 hw/drivers/bq27z561/syscfg.yml                  |  4 ----
 5 files changed, 3 insertions(+), 34 deletions(-)

diff --git a/hw/drivers/bq27z561/include/bq27z561/bq27z561.h 
b/hw/drivers/bq27z561/include/bq27z561/bq27z561.h
index 07f5478b3..f56210fec 100644
--- a/hw/drivers/bq27z561/include/bq27z561/bq27z561.h
+++ b/hw/drivers/bq27z561/include/bq27z561/bq27z561.h
@@ -634,15 +634,6 @@ int bq27z561_config(struct bq27z561 * bq27z561, struct 
bq27z561_cfg * cfg);
  */
 int bq27z561_init(struct os_dev * dev, void * arg);
 
-#if MYNEWT_VAL(BQ27Z561_CLI)
-/**
- * Initialize the BQ27Z561 shell extensions.
- *
- * @return 0 on success, non-zero on failure.
- */
-int bq27z561_shell_init(void);
-#endif
-
 #if MYNEWT_VAL(BUS_DRIVER_PRESENT)
 /**
  * Create I2C bus node for BQ27Z561
diff --git a/hw/drivers/bq27z561/pkg.yml b/hw/drivers/bq27z561/pkg.yml
index 04b1dbfb4..06725762b 100644
--- a/hw/drivers/bq27z561/pkg.yml
+++ b/hw/drivers/bq27z561/pkg.yml
@@ -38,8 +38,8 @@ pkg.deps.BUS_DRIVER_PRESENT:
 pkg.req_apis:
     - stats
 
+pkg.whole_archive: true
+
 pkg.deps.BQ27Z561_CLI:
     - "@apache-mynewt-core/util/parse"
 
-pkg.init:
-    bq27z561_pkg_init: 'MYNEWT_VAL(BQ27Z561_SYSINIT_STAGE)'
diff --git a/hw/drivers/bq27z561/src/bq27z561.c 
b/hw/drivers/bq27z561/src/bq27z561.c
index 0b21f757d..52e4ebc32 100644
--- a/hw/drivers/bq27z561/src/bq27z561.c
+++ b/hw/drivers/bq27z561/src/bq27z561.c
@@ -1348,15 +1348,6 @@ bq27z561_init(struct os_dev *dev, void *arg)
     return 0;
 }
 
-int bq27z561_pkg_init(void)
-{
-#if MYNEWT_VAL(BQ27Z561_CLI)
-    return bq27z561_shell_init();
-#else
-    return 0;
-#endif
-}
-
 #if MYNEWT_VAL(BUS_DRIVER_PRESENT)
 static void
 init_node_cb(struct bus_node *bnode, void *arg)
diff --git a/hw/drivers/bq27z561/src/bq27z561_shell.c 
b/hw/drivers/bq27z561/src/bq27z561_shell.c
index 64ea59c80..2f3e94e53 100644
--- a/hw/drivers/bq27z561/src/bq27z561_shell.c
+++ b/hw/drivers/bq27z561/src/bq27z561_shell.c
@@ -113,15 +113,6 @@ bq27z561_shell_cmd(int argc, char * argv[])
     return 0;
 }
 
-static const struct shell_cmd bq27z561_shell_cmd_desc = {
-    .sc_cmd      = "bq27z561",
-    .sc_cmd_func = bq27z561_shell_cmd,
-};
-
-int
-bq27z561_shell_init(void)
-{
-    return shell_cmd_register(&bq27z561_shell_cmd_desc);
-}
+MAKE_SHELL_CMD(bq27z561, bq27z561_shell_cmd, NULL)
 
 #endif
diff --git a/hw/drivers/bq27z561/syscfg.yml b/hw/drivers/bq27z561/syscfg.yml
index 49f388bce..7098d3e9f 100644
--- a/hw/drivers/bq27z561/syscfg.yml
+++ b/hw/drivers/bq27z561/syscfg.yml
@@ -39,10 +39,6 @@ syscfg.defs:
         description: >
             Number of OS ticks to wait for each I2C transaction to complete.
         value: 6
-    BQ27Z561_SYSINIT_STAGE:
-        description: >
-            Sysinit stage for the BQ27Z561 driver.
-        value: 500
 
     ### Log settings.
 

Reply via email to