summaryrefslogtreecommitdiff
path: root/test/thermal.c
diff options
context:
space:
mode:
authorWonjoon Lee <woojoo.lee@samsung.com>2015-09-01 21:33:56 +0900
committerchrome-bot <chrome-bot@chromium.org>2015-09-11 00:45:37 -0700
commit502dc50f04c5df787e95982cef4971b20e501cba (patch)
treec5b9b550600e72f5d4bc0cd3a1000fa0d0093ee5 /test/thermal.c
parent3f2dc44158630f0ce93633c21df8daaddb2b7324 (diff)
downloadchrome-ec-502dc50f04c5df787e95982cef4971b20e501cba.tar.gz
temp_sensor: Separate ADC interface and thermistor maths
Separate the bd99992gw ADC interface from the NCP15WB thermistor adc-to-temp maths so that the thermistor can be used with various other interfaces. BUG=chrome-os-partner:44764 TEST=make buildall -j Manual on Glados. Boot to S0, run "temps". Verify that temperatures start around 28C and begin to increase after system is powered-on for a long duration. BRANCH=None Change-Id: I3e72e9f390feebaac2440dbe722485f8d1cf8c56 Signed-off-by: Wonjoon Lee <woojoo.lee@samsung.com> Reviewed-on: https://chromium-review.googlesource.com/296871 Reviewed-by: Shawn N <shawnn@chromium.org>
Diffstat (limited to 'test/thermal.c')
-rw-r--r--test/thermal.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/test/thermal.c b/test/thermal.c
index 761dc9358d..6e95d37f83 100644
--- a/test/thermal.c
+++ b/test/thermal.c
@@ -480,11 +480,11 @@ static int test_several_limits(void)
return EC_SUCCESS;
}
-/* Tests for bd99992gw temperature sensor ADC-to-temp calculation */
+/* Tests for ncp15wb thermistor ADC-to-temp calculation */
#define LOW_ADC_TEST_VALUE 887 /* 0 C */
#define HIGH_ADC_TEST_VALUE 100 /* > 100C */
-static int test_bd99992_adc_to_temp(void)
+static int test_ncp15wb_adc_to_temp(void)
{
int i;
uint8_t temp;
@@ -513,10 +513,10 @@ static int test_bd99992_adc_to_temp(void)
* decrease.
*/
i = LOW_ADC_TEST_VALUE;
- temp = bd99992gw_get_temp(i);
+ temp = ncp15wb_calculate_temp(i);
while (--i > HIGH_ADC_TEST_VALUE) {
- new_temp = bd99992gw_get_temp(i);
+ new_temp = ncp15wb_calculate_temp(i);
TEST_ASSERT(new_temp == temp ||
new_temp == temp + 1);
temp = new_temp;
@@ -524,7 +524,7 @@ static int test_bd99992_adc_to_temp(void)
/* Verify several datapoints are within 1C accuracy */
for (i = 0; i < ARRAY_SIZE(adc_temp_datapoints); ++i) {
- temp = bd99992gw_get_temp(adc_temp_datapoints[i].adc);
+ temp = ncp15wb_calculate_temp(adc_temp_datapoints[i].adc);
ASSERT(temp >= adc_temp_datapoints[i].temp - 1 &&
temp <= adc_temp_datapoints[i].temp + 1);
}
@@ -544,6 +544,6 @@ void run_test(void)
RUN_TEST(test_one_limit);
RUN_TEST(test_several_limits);
- RUN_TEST(test_bd99992_adc_to_temp);
+ RUN_TEST(test_ncp15wb_adc_to_temp);
test_print_result();
}