summaryrefslogtreecommitdiff
path: root/chip/it83xx/clock.c
diff options
context:
space:
mode:
authorDino Li <Dino.Li@ite.com.tw>2017-01-10 13:38:16 +0800
committerchrome-bot <chrome-bot@chromium.org>2017-01-10 21:35:30 -0800
commitd96460541addf75bd4c3c3a8e7b5de47cf89f2d0 (patch)
treea784e7c34e37d2b6f854710abd45796e4bb7e379 /chip/it83xx/clock.c
parentd87ad06a6d44bd68e22417115d0a53f5f9d3fb20 (diff)
downloadchrome-ec-d96460541addf75bd4c3c3a8e7b5de47cf89f2d0.tar.gz
it83xx: adc: interrupt is used
We don't need to loop and waiting ADC's data valid flag after the change was made. Signed-off-by: Dino Li <dino.li@ite.com.tw> BRANCH=none BUG=none TEST=1. We build a EC binary for PD EVB (declared two ADC channels for VBUS measurement of PD task and priority is highest) 2. Use console command "adc" continually to read ADC channels and check if any error. Change-Id: I1379e0b4c9ef721c29cb053d7d85e1a8ece9471b Reviewed-on: https://chromium-review.googlesource.com/421307 Commit-Ready: Dino Li <Dino.Li@ite.com.tw> Tested-by: Dino Li <Dino.Li@ite.com.tw> Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
Diffstat (limited to 'chip/it83xx/clock.c')
-rw-r--r--chip/it83xx/clock.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/chip/it83xx/clock.c b/chip/it83xx/clock.c
index b5638f2bbc..2dc45dbf5c 100644
--- a/chip/it83xx/clock.c
+++ b/chip/it83xx/clock.c
@@ -5,6 +5,7 @@
/* Clocks and power management settings */
+#include "adc_chip.h"
#include "clock.h"
#include "common.h"
#include "console.h"
@@ -27,6 +28,10 @@
#define SLEEP_SET_HTIMER_DELAY_USEC 250
#define SLEEP_FTIMER_SKIP_USEC (HOOK_TICK_INTERVAL * 2)
+#ifdef CONFIG_ADC
+BUILD_ASSERT(ADC_TIMEOUT_US < SLEEP_SET_HTIMER_DELAY_USEC);
+#endif
+
static timestamp_t sleep_mode_t0;
static timestamp_t sleep_mode_t1;
static int idle_doze_cnt;