diff options
| author | WBI\nxf44444 <[email protected]> | 2022-01-26 01:43:05 +0800 |
|---|---|---|
| committer | WBI\nxf44444 <[email protected]> | 2022-01-26 01:43:05 +0800 |
| commit | 8b0f50b7e211ee32ab08ba085ecd74588c3a3c63 (patch) | |
| tree | 75440be5ecd30cc1403a9387851c0530ed057981 /examples/kernel/tc_sample.c | |
| parent | 3be35fecae513b07c35bd6f3992bf7824434bdd6 (diff) | |
| parent | 32a5668593c578b85560338c29d76f3a252c8dbc (diff) | |
Update i2c driver, add read ACK and BUS status check
Diffstat (limited to 'examples/kernel/tc_sample.c')
| -rw-r--r-- | examples/kernel/tc_sample.c | 62 |
1 files changed, 0 insertions, 62 deletions
diff --git a/examples/kernel/tc_sample.c b/examples/kernel/tc_sample.c deleted file mode 100644 index 212875b716..0000000000 --- a/examples/kernel/tc_sample.c +++ /dev/null @@ -1,62 +0,0 @@ -#include <rtthread.h> -#include "tc_comm.h" - -static rt_thread_t tid = RT_NULL; -static void sample_thread(void* parameter) -{ - rt_kprintf("I'm sample!\n"); -} -static void sample_thread_cleanup(struct rt_thread *p) -{ - tid = RT_NULL; - tc_done(TC_STAT_PASSED); -} - -int sample_init() -{ - tid = rt_thread_create("t", - sample_thread, RT_NULL, - THREAD_STACK_SIZE, THREAD_PRIORITY, THREAD_TIMESLICE); - if (tid != RT_NULL) - { - rt_thread_startup(tid); - tid->cleanup = sample_thread_cleanup; - } - else - tc_stat(TC_STAT_END | TC_STAT_FAILED); - - return 0; -} - -#ifdef RT_USING_TC -static void _tc_cleanup() -{ - /* lock scheduler */ - rt_enter_critical(); - /* delete thread */ - if (tid != RT_NULL) - { - rt_kprintf("tid1 is bad\n"); - tc_stat(TC_STAT_FAILED); - } - /* unlock scheduler */ - rt_exit_critical(); -} - -int _tc_sample() -{ - /* set tc cleanup */ - tc_cleanup(_tc_cleanup); - sample_init(); - - return 25; -} -FINSH_FUNCTION_EXPORT(_tc_sample, a thread testcase example); -#else -int rt_application_init() -{ - sample_init(); - - return 0; -} -#endif |
