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/10/02 20:21:31 UTC

[mynewt-core] branch master updated: hw/battery: allow more then one battery

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


The following commit(s) were added to refs/heads/master by this push:
     new e3e73b9  hw/battery: allow more then one battery
e3e73b9 is described below

commit e3e73b94b040ad4619e2020ee84d9029dbbb4e3b
Author: Simon Frank <52...@users.noreply.github.com>
AuthorDate: Wed Sep 30 11:05:47 2020 +0200

    hw/battery: allow more then one battery
---
 hw/battery/src/battery.c | 2 +-
 hw/battery/syscfg.yml    | 5 +++++
 2 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/hw/battery/src/battery.c b/hw/battery/src/battery.c
index b622966..f900d14 100644
--- a/hw/battery/src/battery.c
+++ b/hw/battery/src/battery.c
@@ -25,7 +25,7 @@
 #include <battery/battery_prop.h>
 #include <battery/battery_drv.h>
 
-#define BATTERY_MAX_COUNT 1
+#define BATTERY_MAX_COUNT MYNEWT_VAL(BATTERY_MAX_COUNT)
 
 #define GET_BIT(arr, bit)   ((arr)[(bit) / 32] & (1 << ((bit) % 32)))
 
diff --git a/hw/battery/syscfg.yml b/hw/battery/syscfg.yml
index f65d0bf..ac42cdc 100644
--- a/hw/battery/syscfg.yml
+++ b/hw/battery/syscfg.yml
@@ -26,6 +26,11 @@ syscfg.defs:
             Specify the eventq to be used by the battery manager
         value:
 
+    BATTERY_MAX_COUNT:
+        description: >
+            Maximum number of batteries.
+        value: 1
+
     BATTERY_MAX_PROPERTY_COUNT:
         description: >
             Maximum number of supported battery properties. Number should