Преглед на файлове

modify name and add void parameter of functions

yangjie преди 7 години
родител
ревизия
55f6441314
променени са 3 файла, в които са добавени 7 реда и са изтрити 7 реда
  1. 2 2
      msgq/msgq_sample.c
  2. 4 4
      thread/scheduler_hook.c
  3. 1 1
      thread/timeslice_sample.c

+ 2 - 2
msgq/msgq_sample.c

@@ -98,7 +98,7 @@ static void thread2_entry(void *parameter)
 }
 }
 
 
 /* 消息队列示例的初始化 */
 /* 消息队列示例的初始化 */
-int messagequeue_sample()
+int msgq_sample(void)
 {
 {
     rt_err_t result;
     rt_err_t result;
 
 
@@ -136,4 +136,4 @@ int messagequeue_sample()
 }
 }
 
 
 /* 导出到 msh 命令列表中 */
 /* 导出到 msh 命令列表中 */
-MSH_CMD_EXPORT(messagequeue_sample, messagequeue sample);
+MSH_CMD_EXPORT(msgq_sample, msgq sample);

+ 4 - 4
thread/scheduler_hook.c

@@ -38,15 +38,15 @@ static void thread_entry(void* parameter)
 static rt_thread_t tid1 = RT_NULL;
 static rt_thread_t tid1 = RT_NULL;
 static rt_thread_t tid2 = RT_NULL;
 static rt_thread_t tid2 = RT_NULL;
 
 
-static void scheduler_hook(struct rt_thread* from, struct rt_thread* to)
+static void hook_of_scheduler(struct rt_thread* from, struct rt_thread* to)
 {
 {
     rt_kprintf("from: %s -->  to: %s \n", from->name , to->name);
     rt_kprintf("from: %s -->  to: %s \n", from->name , to->name);
 }
 }
 
 
-int sch_hook_sample()
+int scheduler_hook(void)
 {   
 {   
     /* 设置调度器钩子 */
     /* 设置调度器钩子 */
-    rt_scheduler_sethook(scheduler_hook);
+    rt_scheduler_sethook(hook_of_scheduler);
     
     
     /* 创建线程1 */
     /* 创建线程1 */
     tid1 = rt_thread_create("thread1", 
     tid1 = rt_thread_create("thread1", 
@@ -67,4 +67,4 @@ int sch_hook_sample()
 }
 }
 
 
 /* 导出到 msh 命令列表中 */
 /* 导出到 msh 命令列表中 */
-MSH_CMD_EXPORT(sch_hook_sample, sch_hook sample);
+MSH_CMD_EXPORT(scheduler_hook, scheduler_hook sample);

+ 1 - 1
thread/timeslice_sample.c

@@ -41,7 +41,7 @@ static void thread_entry(void* parameter)
      }  
      }  
 }
 }
 
 
-int timeslice_sample()
+int timeslice_sample(void)
 {
 {
     rt_thread_t tid;
     rt_thread_t tid;
     /* 创建线程1 */
     /* 创建线程1 */