tests: dma: update to unified kernel
Use k_sleep instead of nano timer.
Change-Id: Ic1cc68cefa23b2e291e3605f4795cbe21ad98fc0
Signed-off-by: Baohong Liu <baohong.liu@intel.com>
diff --git a/tests/drivers/dma/test_loop_transfer/src/dma.c b/tests/drivers/dma/test_loop_transfer/src/dma.c
index 3d59998..70d2aa0 100644
--- a/tests/drivers/dma/test_loop_transfer/src/dma.c
+++ b/tests/drivers/dma/test_loop_transfer/src/dma.c
@@ -23,8 +23,8 @@
#include <misc/printk.h>
#include <string.h>
-#define SLEEPTIME 1
-#define SLEEPTICKS (SLEEPTIME * sys_clock_ticks_per_sec)
+/* in millisecond */
+#define SLEEPTIME 1000
#define TRANSFER_LOOPS (5)
#define RX_BUFF_SIZE (50)
@@ -64,9 +64,7 @@
void main(void)
{
struct device *dma;
- struct nano_timer timer;
static uint32_t chan_id;
- uint32_t data[2] = {0, 0};
struct dma_channel_config dma_chan_cfg = {0};
struct dma_transfer_config dma_trans = {0};
@@ -110,9 +108,7 @@
return;
}
- nano_timer_init(&timer, data);
- nano_timer_start(&timer, SLEEPTICKS);
- nano_timer_test(&timer, TICKS_UNLIMITED);
+ k_sleep(SLEEPTIME);
if (transfer_count < TRANSFER_LOOPS) {
transfer_count = TRANSFER_LOOPS;