Browse Source

update for rt-thread 5.0

guozhanxin 2 năm trước cách đây
mục cha
commit
ed51983485

+ 8 - 0
en/event_sample.c

@@ -31,7 +31,11 @@
 /* ECB (Event Control Block) */
 static struct rt_event event;
 
+#ifdef rt_align
+rt_align(RT_ALIGN_SIZE)
+#else
 ALIGN(RT_ALIGN_SIZE)
+#endif
 static char thread1_stack[1024]; /* thread stack 1024 Byte*/
 static struct rt_thread thread1; /* TCB (Thread Control Block) */
 
@@ -69,7 +73,11 @@ static void thread1_recv_event(void *param)
     rt_kprintf("thread1 leave.\n");
 }
 
+#ifdef rt_align
+rt_align(RT_ALIGN_SIZE)
+#else
 ALIGN(RT_ALIGN_SIZE)
+#endif
 static char thread2_stack[1024]; /* thread stack 1024 Byte*/
 static struct rt_thread thread2; /* TCB (Thread Control Block) */
 

+ 8 - 0
en/mailbox_sample.c

@@ -35,7 +35,11 @@ static char mb_str1[] = "I'm a mail!";
 static char mb_str2[] = "this is another mail!";
 static char mb_str3[] = "over";
 
+#ifdef rt_align
+rt_align(RT_ALIGN_SIZE)
+#else
 ALIGN(RT_ALIGN_SIZE)
+#endif
 static char thread1_stack[1024];
 static struct rt_thread thread1;
 
@@ -63,7 +67,11 @@ static void thread1_entry(void *parameter)
     rt_mb_detach(&mb);
 }
 
+#ifdef rt_align
+rt_align(RT_ALIGN_SIZE)
+#else
 ALIGN(RT_ALIGN_SIZE)
+#endif
 static char thread2_stack[1024];
 static struct rt_thread thread2;
 

+ 8 - 0
en/msgq_sample.c

@@ -30,7 +30,11 @@ static struct rt_messagequeue mq;
 /* the memory pool used to place messages in the message queue */
 static rt_uint8_t msg_pool[2048];
 
+#ifdef rt_align
+rt_align(RT_ALIGN_SIZE)
+#else
 ALIGN(RT_ALIGN_SIZE)
+#endif
 static char thread1_stack[1024];
 static struct rt_thread thread1;
 
@@ -60,7 +64,11 @@ static void thread1_entry(void *parameter)
     rt_mq_detach(&mq);
 }
 
+#ifdef rt_align
+rt_align(RT_ALIGN_SIZE)
+#else
 ALIGN(RT_ALIGN_SIZE)
+#endif
 static char thread2_stack[1024];
 static struct rt_thread thread2;
 

+ 8 - 0
en/mutex_sample.c

@@ -27,7 +27,11 @@
 static rt_mutex_t dynamic_mutex = RT_NULL;
 static rt_uint8_t number1, number2 = 0;
 
+#ifdef rt_align
+rt_align(RT_ALIGN_SIZE)
+#else
 ALIGN(RT_ALIGN_SIZE)
+#endif
 static char thread1_stack[1024];
 static struct rt_thread thread1;
 static void rt_thread_entry1(void *parameter)
@@ -47,7 +51,11 @@ static void rt_thread_entry1(void *parameter)
     }
 }
 
+#ifdef rt_align
+rt_align(RT_ALIGN_SIZE)
+#else
 ALIGN(RT_ALIGN_SIZE)
+#endif
 static char thread2_stack[1024];
 static struct rt_thread thread2;
 static void rt_thread_entry2(void *parameter)

+ 8 - 0
en/semaphore_sample.c

@@ -27,7 +27,11 @@
 /* semaphore handler */
 static rt_sem_t dynamic_sem = RT_NULL;
 
+#ifdef rt_align
+rt_align(RT_ALIGN_SIZE)
+#else
 ALIGN(RT_ALIGN_SIZE)
+#endif
 static char thread1_stack[1024];
 static struct rt_thread thread1;
 static void rt_thread1_entry(void *parameter)
@@ -52,7 +56,11 @@ static void rt_thread1_entry(void *parameter)
     }
 }
 
+#ifdef rt_align
+rt_align(RT_ALIGN_SIZE)
+#else
 ALIGN(RT_ALIGN_SIZE)
+#endif
 static char thread2_stack[1024];
 static struct rt_thread thread2;
 static void rt_thread2_entry(void *parameter)

+ 4 - 0
en/thread_sample.c

@@ -42,7 +42,11 @@ static void thread1_entry(void *parameter)
     }
 }
 
+#ifdef rt_align
+rt_align(RT_ALIGN_SIZE)
+#else
 ALIGN(RT_ALIGN_SIZE)
+#endif
 static char thread2_stack[1024];
 static struct rt_thread thread2;
 

+ 8 - 0
zh/event_sample.c

@@ -26,7 +26,11 @@
 /* 事件控制块 */
 static struct rt_event event;
 
+#ifdef rt_align
+rt_align(RT_ALIGN_SIZE)
+#else
 ALIGN(RT_ALIGN_SIZE)
+#endif
 static char thread1_stack[1024];
 static struct rt_thread thread1;
 
@@ -56,7 +60,11 @@ static void thread1_recv_event(void *param)
     rt_kprintf("thread1 leave.\n");
 }
 
+#ifdef rt_align
+rt_align(RT_ALIGN_SIZE)
+#else
 ALIGN(RT_ALIGN_SIZE)
+#endif
 static char thread2_stack[1024];
 static struct rt_thread thread2;
 

+ 8 - 0
zh/mailbox_sample.c

@@ -28,7 +28,11 @@ static char mb_str1[] = "I'm a mail!";
 static char mb_str2[] = "this is another mail!";
 static char mb_str3[] = "over";
 
+#ifdef rt_align
+rt_align(RT_ALIGN_SIZE)
+#else
 ALIGN(RT_ALIGN_SIZE)
+#endif
 static char thread1_stack[1024];
 static struct rt_thread thread1;
 
@@ -56,7 +60,11 @@ static void thread1_entry(void *parameter)
     rt_mb_detach(&mb);
 }
 
+#ifdef rt_align
+rt_align(RT_ALIGN_SIZE)
+#else
 ALIGN(RT_ALIGN_SIZE)
+#endif
 static char thread2_stack[1024];
 static struct rt_thread thread2;
 

+ 8 - 0
zh/mailbox_urgent_sample.c

@@ -30,7 +30,11 @@ static char mb_urgent[] = "I'm a urgent mail!";
 static char mb_normal[] = "I'm a normal mail!";
 static char mb_str3[] = "over";
 
+#ifdef rt_align
+rt_align(RT_ALIGN_SIZE)
+#else
 ALIGN(RT_ALIGN_SIZE)
+#endif
 static char thread1_stack[1024];
 static struct rt_thread thread1;
 
@@ -58,7 +62,11 @@ static void thread1_entry(void *parameter)
     rt_mb_detach(&mb);
 }
 
+#ifdef rt_align
+rt_align(RT_ALIGN_SIZE)
+#else
 ALIGN(RT_ALIGN_SIZE)
+#endif
 static char thread2_stack[1024];
 static struct rt_thread thread2;
 

+ 8 - 0
zh/msgq_sample.c

@@ -24,7 +24,11 @@ static struct rt_messagequeue mq;
 /* 消息队列中用到的放置消息的内存池 */
 static rt_uint8_t msg_pool[2048];
 
+#ifdef rt_align
+rt_align(RT_ALIGN_SIZE)
+#else
 ALIGN(RT_ALIGN_SIZE)
+#endif
 static char thread1_stack[1024];
 static struct rt_thread thread1;
 
@@ -53,7 +57,11 @@ static void thread1_entry(void *parameter)
     rt_mq_detach(&mq);
 }
 
+#ifdef rt_align
+rt_align(RT_ALIGN_SIZE)
+#else
 ALIGN(RT_ALIGN_SIZE)
+#endif
 static char thread2_stack[1024];
 static struct rt_thread thread2;
 

+ 8 - 0
zh/mutex_sample.c

@@ -24,7 +24,11 @@
 static rt_mutex_t dynamic_mutex = RT_NULL;
 static rt_uint8_t number1, number2 = 0;
 
+#ifdef rt_align
+rt_align(RT_ALIGN_SIZE)
+#else
 ALIGN(RT_ALIGN_SIZE)
+#endif
 static char thread1_stack[1024];
 static struct rt_thread thread1;
 static void rt_thread_entry1(void *parameter)
@@ -40,7 +44,11 @@ static void rt_thread_entry1(void *parameter)
     }
 }
 
+#ifdef rt_align
+rt_align(RT_ALIGN_SIZE)
+#else
 ALIGN(RT_ALIGN_SIZE)
+#endif
 static char thread2_stack[1024];
 static struct rt_thread thread2;
 static void rt_thread_entry2(void *parameter)

+ 8 - 0
zh/semaphore_sample.c

@@ -22,7 +22,11 @@
 /* 指向信号量的指针 */
 static rt_sem_t dynamic_sem = RT_NULL;
 
+#ifdef rt_align
+rt_align(RT_ALIGN_SIZE)
+#else
 ALIGN(RT_ALIGN_SIZE)
+#endif
 static char thread1_stack[1024];
 static struct rt_thread thread1;
 static void rt_thread1_entry(void *parameter)
@@ -47,7 +51,11 @@ static void rt_thread1_entry(void *parameter)
     }
 }
 
+#ifdef rt_align
+rt_align(RT_ALIGN_SIZE)
+#else
 ALIGN(RT_ALIGN_SIZE)
+#endif
 static char thread2_stack[1024];
 static struct rt_thread thread2;
 static void rt_thread2_entry(void *parameter)

+ 4 - 0
zh/thread_sample.c

@@ -35,7 +35,11 @@ static void thread1_entry(void *parameter)
     }
 }
 
+#ifdef rt_align
+rt_align(RT_ALIGN_SIZE)
+#else
 ALIGN(RT_ALIGN_SIZE)
+#endif
 static char thread2_stack[1024];
 static struct rt_thread thread2;