diff --git a/bsp/nuclei/gd32vf103_rvstar/applications/main.c b/bsp/nuclei/gd32vf103_rvstar/applications/main.c index ef6ba62014..7da5f0da45 100644 --- a/bsp/nuclei/gd32vf103_rvstar/applications/main.c +++ b/bsp/nuclei/gd32vf103_rvstar/applications/main.c @@ -10,82 +10,10 @@ #include #include -#include -#define THREAD_PRIORITY 19 -#define THREAD_STACK_SIZE 396 -#define THREAD_TIMESLICE 5 -#define THREAD_NUM 2 -//#define APP_DEBUG_PRINT - -/* Align stack when using static thread */ -ALIGN(RT_ALIGN_SIZE) -static rt_uint8_t thread_stack[THREAD_NUM][THREAD_STACK_SIZE]; -static struct rt_thread tid[THREAD_NUM]; - -/* Thread entry function */ -static void thread_entry(void *parameter) +int main(int argc, char *argv[]) { - rt_uint32_t count = 0; - - while (1) - { -#ifdef APP_DEBUG_PRINT - rt_kprintf("thread %d count: %d\n", (rt_uint32_t)parameter, count++); -#endif - rt_thread_mdelay(500); - if ((rt_uint32_t)parameter < (LEDn - 1)) - { - gd_rvstar_led_toggle((rt_uint32_t)parameter); - } - } + return RT_EOK; } -/* Thread demo */ -int create_thread_demo(void) -{ - int i; - static char tname[9] = "thread"; - - for (i = 0; i < THREAD_NUM; i ++) - { - /* Create static threads */ - tname[6] = i / 10 + '0'; - tname[7] = i % 10 + '0'; - tname[8] = '\0'; - rt_thread_init(&tid[i], tname, thread_entry, (void *)i, thread_stack[i], - THREAD_STACK_SIZE, THREAD_PRIORITY, THREAD_TIMESLICE); - } - - /* Startup threads */ - for (i = 0; i < THREAD_NUM; i ++) - { - rt_thread_startup(&tid[i]); - } - - return 0; -} - -int main(void) -{ - rt_uint32_t count = 0; - - create_thread_demo(); - for (int i = 0; i < LEDn; i ++) - { - gd_rvstar_led_init(i); - } - - - while (1) - { -#ifdef APP_DEBUG_PRINT - rt_kprintf("Main thread count: %d\n", count++); -#endif - rt_thread_mdelay(1000); - gd_rvstar_led_toggle(LED3); - } -} - -/******************** end of file *******************/ - +/******************** end of file *******************/ \ No newline at end of file