summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVincent Palatin <vpalatin@chromium.org>2013-11-10 10:57:00 -0800
committerchrome-internal-fetch <chrome-internal-fetch@google.com>2013-11-11 18:41:55 +0000
commit895802f189c49645acd91491790c822710e5eae2 (patch)
tree5c3483a555e5f383d0b0e5ddf740d267215b38f5
parent899f8967afd2f8af8fd1b20fc28ce876e2e8cc2d (diff)
downloadchrome-ec-895802f189c49645acd91491790c822710e5eae2.tar.gz
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 <vpalatin@chromium.org> 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 <victoryang@chromium.org> Commit-Queue: Vincent Palatin <vpalatin@chromium.org> Tested-by: Vincent Palatin <vpalatin@chromium.org>
-rw-r--r--board/spring/usb_charging.c2
1 files changed, 1 insertions, 1 deletions
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;