summaryrefslogtreecommitdiff
path: root/common/led_onoff_states.c
diff options
context:
space:
mode:
Diffstat (limited to 'common/led_onoff_states.c')
-rw-r--r--common/led_onoff_states.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/common/led_onoff_states.c b/common/led_onoff_states.c
index 1731953d8c..eea527373d 100644
--- a/common/led_onoff_states.c
+++ b/common/led_onoff_states.c
@@ -29,11 +29,19 @@ __overridable void led_set_color_battery(enum ec_led_colors color)
{
}
+#ifndef CONFIG_CHARGER
+/* Include for the sake of compilation */
+int charge_get_percent(void);
+#endif
+
static enum led_states led_get_state(void)
{
int charge_lvl;
enum led_states new_state = LED_NUM_STATES;
+ if (!IS_ENABLED(CONFIG_CHARGER))
+ return new_state;
+
switch (charge_get_state()) {
case PWR_STATE_CHARGE:
/* Get percent charge */