Update application.c
code style clean
@@ -83,21 +83,23 @@ void rt_init_thread_entry(void* parameter)
rt_device_t dev;
rt_kprintf("SYSTEM running at %uhz\n", SystemCoreClock);
-
- sleep_timer_init();
- // sleep_timer_start(1500);
-
LED_Init();
configure_extint_channel();
configure_extint_callbacks();
+#if defined(TEST_UART_RX)
+
+ sleep_timer_init();
+ // sleep_timer_start(1500);
+
while (1)
{
rt_kprintf("init thread running tick:%u\n", rt_tick_get());
rt_thread_delay(2*RT_TICK_PER_SECOND);
}
-#if 0
+#else
+
dev = rt_device_find("uart3");
if (dev != RT_NULL)
{
@@ -110,8 +112,7 @@ void rt_init_thread_entry(void* parameter)
{
rt_size_t r_size;
rt_uint8_t r_buf[1];
- // rt_kprintf("SAMD2xJ18A hello thread\n");
- // rt_thread_delay(RT_TICK_PER_SECOND);
+
rt_sem_take(&_rx_sem, RT_WAITING_FOREVER);
while ((r_size = rt_device_read(dev, 0, r_buf, 1)) > 0)
{
@@ -123,7 +124,9 @@ void rt_init_thread_entry(void* parameter)
}
}
}
+
#endif
+
}
int rt_application_init(void)
