From 80a21100b367f5175fdf27c395051c53b23976e8 Mon Sep 17 00:00:00 2001 From: xieyangrun Date: Mon, 4 Sep 2017 10:12:10 +0800 Subject: [PATCH] remove uart rx code --- bsp/samd21/applications/application.c | 32 --------------------------- 1 file changed, 32 deletions(-) diff --git a/bsp/samd21/applications/application.c b/bsp/samd21/applications/application.c index d89bdd2a60..d311cb23fc 100644 --- a/bsp/samd21/applications/application.c +++ b/bsp/samd21/applications/application.c @@ -94,8 +94,6 @@ void rt_init_thread_entry(void* parameter) configure_extint_channel(); configure_extint_callbacks(); -#ifndef TEST_UART_RX - sleep_timer_init(); // sleep_timer_start(1500); @@ -104,36 +102,6 @@ void rt_init_thread_entry(void* parameter) rt_kprintf("init thread running tick:%u\n", rt_tick_get()); rt_thread_delay(2*RT_TICK_PER_SECOND); } - -#else - - dev = rt_device_find("uart3"); - if (dev != RT_NULL) - { - rt_sem_init(&_rx_sem, "rxsem", 0, RT_IPC_FLAG_FIFO); - rt_device_set_rx_indicate(dev, _rx_ind); - rt_device_open(dev, RT_DEVICE_OFLAG_RDWR | RT_DEVICE_FLAG_INT_RX); - } - - while (1) - { - rt_size_t r_size; - rt_uint8_t r_buf[1]; - - rt_sem_take(&_rx_sem, RT_WAITING_FOREVER); - while ((r_size = rt_device_read(dev, 0, r_buf, 1)) > 0) - { - rt_device_write(dev, 0, r_buf, r_size); - if (r_buf[0] == '\r') - { - r_buf[0] = '\n'; - rt_device_write(dev, 0, r_buf, r_size); - } - } - } - -#endif - } int rt_application_init(void)