From a1622472c39da7b4303661480e38c0a84cfb2f22 Mon Sep 17 00:00:00 2001 From: Benjamin Walsh Date: Tue, 20 Dec 2016 15:50:42 -0500 Subject: [PATCH] drivers: hp206 driver does not need 2000 ticks/s frequency From code inspection, the driver always took timeouts in milliseconds. The only sub-ms wait uses k_busy_wait(), which has microseconds granularity, but its granularity does not depend on the system clock tick rate. Change-Id: If48363fd1fbeeb8e5ff0f0f2ca86e671d63bc571 Signed-off-by: Benjamin Walsh --- drivers/sensor/hp206c/hp206c.h | 4 ++-- tests/drivers/build_all/sensors_a_m.conf | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/sensor/hp206c/hp206c.h b/drivers/sensor/hp206c/hp206c.h index eb06566904a..9297c93d931 100644 --- a/drivers/sensor/hp206c/hp206c.h +++ b/drivers/sensor/hp206c/hp206c.h @@ -85,8 +85,8 @@ struct hp206c_device_data { struct device *i2c; #ifdef CONFIG_NANO_TIMERS -#if CONFIG_SYS_CLOCK_TICKS_PER_SEC < 2000 -#error "SYS_CLOCK_TICKS_PER_SEC >= 2000 needed for better timeouts granularity." +#if CONFIG_SYS_CLOCK_TICKS_PER_SEC != 1000 +#error "driver needs millisecond tick granularity" #endif struct k_timer tmr; #endif diff --git a/tests/drivers/build_all/sensors_a_m.conf b/tests/drivers/build_all/sensors_a_m.conf index f3a60141456..8aea245bb71 100644 --- a/tests/drivers/build_all/sensors_a_m.conf +++ b/tests/drivers/build_all/sensors_a_m.conf @@ -6,7 +6,7 @@ CONFIG_SPI=y CONFIG_SYS_LOG_SENSOR_LEVEL=4 # Some sensor drivers (notably HP206C) demand high tick rates: -CONFIG_SYS_CLOCK_TICKS_PER_SEC=2000 +CONFIG_SYS_CLOCK_TICKS_PER_SEC=1000 CONFIG_ADC=y CONFIG_AK8975=y