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/07/06 06:27:51 UTC
(mynewt-core) 04/04: sys/shell: Register prompt module 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 f0c90b9bb6365bcd0f715c2d90f9b7b6d9d5a253
Author: Jerzy Kasenberg <je...@codecoup.pl>
AuthorDate: Sat May 31 00:54:16 2025 +0200
sys/shell: Register prompt module statically
Module prompt is not linked statically.
No need for runtime registering.
Signed-off-by: Jerzy Kasenberg <je...@apache.org>
---
sys/shell/src/shell_priv.h | 2 --
sys/shell/src/shell_prompt.c | 14 +++++---------
2 files changed, 5 insertions(+), 11 deletions(-)
diff --git a/sys/shell/src/shell_priv.h b/sys/shell/src/shell_priv.h
index 6c85d1ac7..3603d2b01 100644
--- a/sys/shell/src/shell_priv.h
+++ b/sys/shell/src/shell_priv.h
@@ -49,8 +49,6 @@ void shell_nlip_init(void);
void shell_nlip_clear_pkt(void);
#endif
-void shell_prompt_register(void);
-
#if MYNEWT_VAL(SHELL_BRIDGE)
void shell_bridge_streamer_new(struct shell_bridge_streamer *sbs,
struct CborEncoder *str_encoder);
diff --git a/sys/shell/src/shell_prompt.c b/sys/shell/src/shell_prompt.c
index 00a1c1801..448d579bd 100644
--- a/sys/shell/src/shell_prompt.c
+++ b/sys/shell/src/shell_prompt.c
@@ -17,10 +17,10 @@
* under the License.
*/
-#include <stdio.h>
-#include <string.h>
-
#include "os/mynewt.h"
+
+#if MYNEWT_VAL(SHELL_PROMPT_MODULE)
+
#include "console/console.h"
#include "console/ticks.h"
@@ -73,12 +73,8 @@ static const struct shell_cmd prompt_commands[] = {
.help = &ticks_help,
#endif
},
- { 0 },
};
+SHELL_MODULE_WITH_TABLE(prompt, prompt_commands)
-void
-shell_prompt_register(void)
-{
- shell_register(SHELL_PROMPT, prompt_commands);
-}
+#endif