summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--common/led_peppy.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/common/led_peppy.c b/common/led_peppy.c
index 50a851b8ee..88cdf7c237 100644
--- a/common/led_peppy.c
+++ b/common/led_peppy.c
@@ -138,7 +138,8 @@ static void peppy_led_set_battery(int ticks)
break;
case PWR_STATE_ERROR:
peppy_led_set_color_battery(
- (ticks & 0x2) ? LED_AMBER : LED_OFF);
+ (ticks % LED_TOTAL_TICKS < LED_ON_TICKS) ?
+ LED_AMBER : LED_OFF);
break;
case PWR_STATE_IDLE: /* External power connected in IDLE. */
if (chflags & CHARGE_FLAG_FORCE_IDLE)