summaryrefslogtreecommitdiff
path: root/board/host
diff options
context:
space:
mode:
authorRandall Spangler <rspangler@chromium.org>2013-10-04 12:38:18 -0700
committerchrome-internal-fetch <chrome-internal-fetch@google.com>2013-10-07 18:30:50 +0000
commit99157c265c8353e166059e17d250d9991d4e7ae0 (patch)
tree386a582966b8b34afa652602a21eec6e6feab931 /board/host
parent90a6676ad531fd8c53e6398050f8093a921245fc (diff)
downloadchrome-ec-99157c265c8353e166059e17d250d9991d4e7ae0.tar.gz
cleanup: Battery header files and filenames
battery.h is the high-level interface. battery_smart.h is the low-level interface. Most things don't need the low-level interface, but were including smart_battery.h solely to get at battery.h. Fixed this. Also merged battery_pack.h into battery.h, since it was odd to split that data across multiple header files. Tidied the function comments in battery.h as well. No functional changes, just renaming files and adding comments. BUG=chrome-os-partner:18343 BRANCH=none TEST=build all boards; pass unit tests Change-Id: I5ef372f0a5f8f5f36e09a3a1ce24008685c1fd0d Signed-off-by: Randall Spangler <rspangler@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/171967 Reviewed-by: Bill Richardson <wfrichar@chromium.org>
Diffstat (limited to 'board/host')
-rw-r--r--board/host/battery.c (renamed from board/host/smart_battery.c)5
-rw-r--r--board/host/build.mk2
-rw-r--r--board/host/charger.c7
3 files changed, 6 insertions, 8 deletions
diff --git a/board/host/smart_battery.c b/board/host/battery.c
index 3465f83431..02fc263fc1 100644
--- a/board/host/smart_battery.c
+++ b/board/host/battery.c
@@ -5,12 +5,11 @@
* Smart battery driver.
*/
-#include "battery_pack.h"
+#include "battery.h"
+#include "battery_smart.h"
#include "common.h"
#include "console.h"
-#include "smart_battery.h"
#include "test_util.h"
-#include "uart.h"
#include "util.h"
static uint16_t mock_smart_battery[SB_MANUFACTURER_DATA + 1];
diff --git a/board/host/build.mk b/board/host/build.mk
index 42cd2f61b9..21e5383d86 100644
--- a/board/host/build.mk
+++ b/board/host/build.mk
@@ -10,4 +10,4 @@ CHIP:=host
board-y=board.o
board-$(HAS_TASK_CHIPSET)+=chipset.o
-board-$(CONFIG_BATTERY_MOCK)+=smart_battery.o charger.o
+board-$(CONFIG_BATTERY_MOCK)+=battery.o charger.o
diff --git a/board/host/charger.c b/board/host/charger.c
index f63eebbea3..d5396c7418 100644
--- a/board/host/charger.c
+++ b/board/host/charger.c
@@ -5,11 +5,10 @@
* Mock battery charger driver.
*/
+#include "battery_smart.h"
#include "charger.h"
#include "console.h"
#include "common.h"
-#include "smart_battery.h"
-#include "uart.h"
#include "util.h"
static const struct charger_info mock_charger_info = {
@@ -74,7 +73,7 @@ int charger_set_current(int current)
current = info->current_max;
if (mock_current != current)
- uart_printf("Charger set current: %d\n", current);
+ ccprintf("Charger set current: %d\n", current);
mock_current = current;
return EC_SUCCESS;
}
@@ -89,7 +88,7 @@ int charger_get_voltage(int *voltage)
int charger_set_voltage(int voltage)
{
mock_voltage = voltage;
- uart_printf("Charger set voltage: %d\n", voltage);
+ ccprintf("Charger set voltage: %d\n", voltage);
return EC_SUCCESS;
}