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 2ef2227b84475e8526622a51535475f3a54f80d5 Author: Jerzy Kasenberg <[email protected]> AuthorDate: Sun Jun 1 12:17:09 2025 +0200 tinyusb: Register shell module statically Now usb shell module is register at link time to reduce memory footprint. No change in functionality. Signed-off-by: Jerzy Kasenberg <[email protected]> --- hw/usb/tinyusb/shell/pkg.yml | 3 +-- hw/usb/tinyusb/shell/src/tinyusb_cli.c | 9 +-------- 2 files changed, 2 insertions(+), 10 deletions(-) diff --git a/hw/usb/tinyusb/shell/pkg.yml b/hw/usb/tinyusb/shell/pkg.yml index db26eafbe..916b66b5c 100644 --- a/hw/usb/tinyusb/shell/pkg.yml +++ b/hw/usb/tinyusb/shell/pkg.yml @@ -29,5 +29,4 @@ pkg.deps: - "@apache-mynewt-core/kernel/os" - "@apache-mynewt-core/hw/usb/tinyusb" -pkg.init: - tinyusb_cli_init: 'MYNEWT_VAL(SHELL_SYSINIT_STAGE) + 1' +pkg.whole_archive: true diff --git a/hw/usb/tinyusb/shell/src/tinyusb_cli.c b/hw/usb/tinyusb/shell/src/tinyusb_cli.c index df49fd4ee..7c6bc3326 100644 --- a/hw/usb/tinyusb/shell/src/tinyusb_cli.c +++ b/hw/usb/tinyusb/shell/src/tinyusb_cli.c @@ -50,13 +50,6 @@ usb_cli_stop_cmd(const struct shell_cmd *cmd, int argc, char **argv, static const struct shell_cmd usb_cli_commands[] = { SHELL_CMD_EXT("start", usb_cli_start_cmd, NULL), SHELL_CMD_EXT("stop", usb_cli_stop_cmd, NULL), - { }, }; -int -tinyusb_cli_init(void) -{ - shell_register("usb", usb_cli_commands); - - return 0; -} +SHELL_MODULE_WITH_TABLE(usb, usb_cli_commands)
