From 5e2f899bada75aa8e6d28a049185eb8e8352d662 Mon Sep 17 00:00:00 2001 From: Baohong Liu Date: Thu, 10 Nov 2016 11:57:13 -0800 Subject: [PATCH] tests: adc: update to unified kernel Use k_sleep instead of nano timer. Change-Id: Iba88b93c71dedd60bdbb842fd8e44a55593f54bf Signed-off-by: Baohong Liu --- tests/drivers/adc/src/main.c | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/tests/drivers/adc/src/main.c b/tests/drivers/adc/src/main.c index 29d546c92ef..b0f83d5ff32 100644 --- a/tests/drivers/adc/src/main.c +++ b/tests/drivers/adc/src/main.c @@ -23,8 +23,8 @@ #include #include -#define SLEEPTIME 2 -#define SLEEPTICKS (SLEEPTIME * sys_clock_ticks_per_sec) +/* in millisecond */ +#define SLEEPTIME 2000 #define ADC_DEVICE_NAME "ADC_0" @@ -66,8 +66,6 @@ static void _print_sample_in_hex(uint8_t *buf, uint32_t length) void main(void) { struct device *adc; - struct nano_timer timer; - uint32_t data[2] = {0, 0}; printk("ADC sample started on %s\n", ADC_DEVICE_NAME); @@ -77,7 +75,6 @@ void main(void) return; } - nano_timer_init(&timer, data); adc_enable(adc); while (1) { if (adc_read(adc, &table) != 0) { @@ -86,8 +83,7 @@ void main(void) printk("Sampling is done\n"); _print_sample_in_hex(seq_buffer, BUFFER_SIZE); } - nano_timer_start(&timer, SLEEPTICKS); - nano_timer_test(&timer, TICKS_UNLIMITED); + k_sleep(SLEEPTIME); } adc_disable(adc); }