summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Marheine <pmarheine@chromium.org>2019-11-26 10:52:17 +1100
committerCommit Bot <commit-bot@chromium.org>2019-11-26 07:17:58 +0000
commitb06d417e821c8681261d6e5f1139e5d101d147fc (patch)
treeec802c532b53817b76088f4b4b183ee8e808b610
parentff9d3afc95c9b69b5ad91cf9ad17d4ac2812d1ca (diff)
downloadchrome-ec-b06d417e821c8681261d6e5f1139e5d101d147fc.tar.gz
puff: update PP3300_SNS divider
The schematic has changed to 9.31k / 47k resistors on this input. BUG=b:1829597655 TEST=still builds BRANCH=None Change-Id: I2856df05b2611edd30d497a35bb871b8f5b173e9 Signed-off-by: Peter Marheine <pmarheine@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1935467 Reviewed-by: Andrew McRae <amcrae@chromium.org> Commit-Queue: Nicolas Boichat <drinkcat@chromium.org>
-rw-r--r--board/puff/board.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/board/puff/board.c b/board/puff/board.c
index 77d632b9a3..7e27178469 100644
--- a/board/puff/board.c
+++ b/board/puff/board.c
@@ -98,11 +98,17 @@ const struct i2c_port_t i2c_ports[] = {
const unsigned int i2c_ports_used = ARRAY_SIZE(i2c_ports);
const struct adc_t adc_channels[] = {
- [ADC_SNS_PP3300] = { /* 9/11 voltage divider */
+ [ADC_SNS_PP3300] = {
+ /*
+ * 4700/5631 voltage divider: can take the value out of range
+ * for 32-bit signed integers, so truncate to 470/563 yielding
+ * <0.1% error and a maximum intermediate value of 1623457792,
+ * which comfortably fits in int32.
+ */
.name = "SNS_PP3300",
.input_ch = NPCX_ADC_CH2,
- .factor_mul = ADC_MAX_VOLT * 11,
- .factor_div = (ADC_READ_MAX + 1) * 9,
+ .factor_mul = ADC_MAX_VOLT * 563,
+ .factor_div = (ADC_READ_MAX + 1) * 470,
},
[ADC_SNS_PP1050] = {
.name = "SNS_PP1050",