- #define LED0_PIN 39
 
- #define LED1_PIN 40
 
 
- static rt_thread_t led0_thread = RT_NULL;
 
- static rt_thread_t led1_thread = RT_NULL;
 
 
- /********************************************************************************************************
 
- * led_init(void)
 
- ********************************************************************************************************/
 
- void led_init(void)
 
- {
 
-         rt_pin_mode(LED1_PIN, PIN_MODE_OUTPUT);
 
-         rt_pin_mode(LED0_PIN, PIN_MODE_OUTPUT);
 
- }
 
- /********************************************************************************************************
 
- * led0_thread_entry(void)LED0任务初始化
 
- ********************************************************************************************************/
 
- static void led0_thread_entry(void* parameter)
 
- {        
 
-     while (1)
 
-     {
 
-         rt_pin_write(LED0_PIN, PIN_HIGH);
 
-         rt_thread_delay(500);   /* 延时500个tick */
 
-         rt_kprintf("led0_thread running,LED0_ON\r\n");
 
-         
 
-         rt_pin_write(LED0_PIN, PIN_LOW); 
 
-         rt_thread_delay(500);   /* 延时500个tick */                                 
 
-         rt_kprintf("led0_thread running,LED0_OFF\r\n");
 
-     }
 
- }
 
- /********************************************************************************************************
 
- * led1_thread_entry(void)LED1任务初始化
 
- ********************************************************************************************************/
 
- static void led1_thread_entry(void* parameter)
 
- {        
 
-     while (1)
 
-     {
 
-         rt_pin_write(LED1_PIN, PIN_HIGH);
 
-         rt_thread_delay(1000);   /* 延时1000个tick */
 
-         rt_kprintf("led1_thread running,LED1_ON\r\n");
 
-         
 
-         rt_pin_write(LED1_PIN, PIN_LOW);  
 
-         rt_thread_delay(1000);   /* 延时1000个tick */                                 
 
-         rt_kprintf("led1_thread running,LED1_OFF\r\n");
 
-     }
 
- }
 
- /********************************************************************************************************
 
- * led0_task(void)LED0任务
 
- ********************************************************************************************************/
 
- void led0_task(void)
 
- {
 
-     led0_thread =                          /* 线程控制块指针 */
 
-     rt_thread_create( "led0",              /* 线程名字 */
 
-                       led0_thread_entry,   /* 线程入口函数 */
 
-                       RT_NULL,             /* 线程入口函数参数 */
 
-                       512,                 /* 线程栈大小 */
 
-                       2,                   /* 线程的优先级 */
 
-                       20);                 /* 线程时间片 */
 
-                   
 
-     /* 启动线程,开启调度 */
 
-    if (led0_thread != RT_NULL)
 
-         rt_thread_startup(led0_thread);
 
- }
 
- /********************************************************************************************************
 
- * led1_task(void)LED1任务
 
- ********************************************************************************************************/
 
- void led1_task(void)
 
- {
 
-         led1_thread =                          /* 线程控制块指针 */
 
-     rt_thread_create( "led1",              /* 线程名字 */
 
-                       led1_thread_entry,   /* 线程入口函数 */
 
-                       RT_NULL,             /* 线程入口函数参数 */
 
-                       512,                 /* 线程栈大小 */
 
-                       3,                   /* 线程的优先级 */
 
-                       20);                 /* 线程时间片 */
 
-                   
 
-     /* 启动线程,开启调度 */
 
-    if (led1_thread != RT_NULL)
 
-         rt_thread_startup(led1_thread);
 
- }
 
 
- int main(void)
 
- {
 
-     led_init();
 
-                 led0_task();
 
-                 led1_task();
 
-     while (1)
 
-     {
 
 
-     }
 
- }
舒服了,之后的方案思路以及实现过程持续更新,敬请大家期待