From fdfe4f4781c2a2c6cd479f8f078aa0c32873d08b Mon Sep 17 00:00:00 2001 From: "bernard.xiong@gmail.com" Date: Sun, 12 Dec 2010 23:37:14 +0000 Subject: [PATCH] add RT_USING_TC in SConscript. git-svn-id: https://rt-thread.googlecode.com/svn/trunk@1191 bbd45198-f89e-11dd-88c7-29a3b14d5316 --- examples/kernel/SConscript | 3 ++- examples/kernel/semaphore_buffer_worker.c | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/examples/kernel/SConscript b/examples/kernel/SConscript index be7eb48bed..1e7a057e4c 100644 --- a/examples/kernel/SConscript +++ b/examples/kernel/SConscript @@ -31,7 +31,8 @@ heap_malloc.c heap_realloc.c memp_simple.c """) +CPPDEFINES = ['RT_USING_TC'] -group = DefineGroup('examples', src, depend = ['']) +group = DefineGroup('examples', src, depend = [''], CPPDEFINES = CPPDEFINES) Return('group') diff --git a/examples/kernel/semaphore_buffer_worker.c b/examples/kernel/semaphore_buffer_worker.c index 96afb43dde..af5722547a 100644 --- a/examples/kernel/semaphore_buffer_worker.c +++ b/examples/kernel/semaphore_buffer_worker.c @@ -135,7 +135,7 @@ static rt_bool_t rb_get(struct rb* rb, rt_uint8_t *ptr, rt_uint16_t length) static void thread_entry(void* parameter) { rt_bool_t result; - rt_uint8_t data_buffer[BUFFER_ITEM]; + rt_uint8_t data_buffer[BUFFER_ITEM + 1]; while (1) { @@ -145,6 +145,7 @@ static void thread_entry(void* parameter) result = rb_get(&working_rb, &data_buffer[0], BUFFER_ITEM); /* 释放信号量 */ rt_sem_release(sem); + data_buffer[BUFFER_ITEM] = '\0'; if (result == RT_TRUE) {