mirror of
https://github.com/Telecominfraproject/OpenCellular.git
synced 2026-01-11 02:15:14 +00:00
zinger: fix double ADC interrupt bug
The ADC interrupt does not clear the NVIC pending register. This can cause the interrupt to fire more than once for a given interrupt. BUG=none BRANCH=samus TEST=Send hard reset from samus to zinger using "pd 1 hard" on PD MCU console. This causes zinger to cut its output voltage and go into voltage discharging mode. When voltage discharge is complete, we get an ADC interrupt and switch back to current monitoring. Before this CL, sometimes (1 out of 20) times the ADC interrupt will fire twice, causing an OCP to be detected. With this CL, we never see the double fire. Change-Id: I91397a04773d04e263bc80a698c8799342b80a2e Signed-off-by: Alec Berg <alecaberg@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/223381 Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
This commit is contained in:
committed by
chrome-internal-fetch
parent
4a9cabc3f9
commit
27d60bb83e
@@ -369,6 +369,9 @@ void pd_adc_interrupt(void)
|
||||
fault = FAULT_FAST_OCP;
|
||||
/* pd_board_checks() will record the timeout later */
|
||||
}
|
||||
|
||||
/* clear ADC irq so we don't get a second interrupt */
|
||||
task_clear_pending_irq(STM32_IRQ_ADC_COMP);
|
||||
}
|
||||
DECLARE_IRQ(STM32_IRQ_ADC_COMP, pd_adc_interrupt, 1);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user