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 2020/04/20 08:56:47 UTC

[mynewt-core] 01/02: hw/battery: Only build shell when enabled

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 7afa66b2513b2a86e965b2ad6ce3c4cabf53ed61
Author: Casper Meijn <ca...@meijn.net>
AuthorDate: Sun Apr 5 08:26:58 2020 +0200

    hw/battery: Only build shell when enabled
    
    If application doesn't use shell, then build will fail because of
    missing #include <shell/shell.h>
---
 hw/battery/src/battery_shell.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/hw/battery/src/battery_shell.c b/hw/battery/src/battery_shell.c
index 33243d6..8e4ee83 100644
--- a/hw/battery/src/battery_shell.c
+++ b/hw/battery/src/battery_shell.c
@@ -17,6 +17,9 @@
  * under the License.
  */
 
+#include "syscfg/syscfg.h"
+#if MYNEWT_VAL(BATTERY_SHELL)
+
 #include <stdio.h>
 #include <string.h>
 #include <limits.h>
@@ -539,3 +542,5 @@ battery_shell_register(void)
     rc = shell_cmd_register(&bat_cli_cmd);
     SYSINIT_PANIC_ASSERT_MSG(rc == 0, "Failed to register battery shell");
 }
+
+#endif