Skip to content

Commit

Permalink
drivers: hp206 driver does not need 2000 ticks/s frequency
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
benwrs authored and Anas Nashif committed Dec 21, 2016
1 parent e863a77 commit a162247
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions drivers/sensor/hp206c/hp206c.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion tests/drivers/build_all/sensors_a_m.conf
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit a162247

Please sign in to comment.