From 895802f189c49645acd91491790c822710e5eae2 Mon Sep 17 00:00:00 2001 From: Vincent Palatin Date: Sun, 10 Nov 2013 10:57:00 -0800 Subject: spring: honor the PWM limit after a sysjump We arrive from a RO->RW sysjump, clip the former PWM value with the new RW PWM limit. Signed-off-by: Vincent Palatin BRANCH=spring BUG=chrome-os-partner:23973 TEST=On Spring, trigger a software sync from 3824.115.0 to the new version with the Spring charger plugged, then check the current limit. Change-Id: I4519a11d18594a4d93e66d8d640fc918d719d956 Reviewed-on: https://chromium-review.googlesource.com/176314 Reviewed-by: Vic Yang Commit-Queue: Vincent Palatin Tested-by: Vincent Palatin --- board/spring/usb_charging.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/board/spring/usb_charging.c b/board/spring/usb_charging.c index e644715d83..74da3cdd1f 100644 --- a/board/spring/usb_charging.c +++ b/board/spring/usb_charging.c @@ -376,7 +376,7 @@ void board_pwm_duty_cycle(int percent) if (system_get_image_copy() == SYSTEM_IMAGE_RW) { if (get_time().val - jump_time.val < (20 * SECOND) && percent > jump_pwm_duty) - percent = jump_pwm_duty; + percent = MAX(jump_pwm_duty, I_LIMIT_MAX); } STM32_TIM_CCR1(3) = percent; -- cgit v1.2.1