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>
This commit is contained in:
Baohong Liu 2016-11-10 16:16:14 -08:00 committed by Anas Nashif
commit ab96d3648a

View file

@ -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 @@ static void test_error(struct device *dev, void *data)
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 @@ void main(void)
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;