mirror of
https://github.com/RT-Thread/rt-thread.git
synced 2026-11-09 20:45:41 +08:00
[Examples] Remove unnecessary files
This commit is contained in:
1 parent
e14d030de9
commit
8123ab4cd7
14 files changed
-1509
No files matched your search
@@ -1,52 +0,0 @@
|
||||
#include <rtthread.h>
|
||||
#include <rtdevice.h>
|
||||
#include <log_trace.h>
|
||||
|
||||
#define PIPE_SZ 2048
|
||||
#define PIPE_NAME "lgpipe"
|
||||
|
||||
static rt_uint8_t pipebuf[PIPE_SZ];
|
||||
static struct rt_pipe_device pipedev;
|
||||
|
||||
static rt_uint8_t outbuf[1024];
|
||||
void memlog_flush(void)
|
||||
{
|
||||
rt_size_t remainsz, readsz;
|
||||
rt_device_t console;
|
||||
|
||||
console = rt_console_get_device();
|
||||
|
||||
if (!console)
|
||||
return;
|
||||
|
||||
rt_device_control((rt_device_t)&pipedev, PIPE_CTRL_GET_SPACE, &remainsz);
|
||||
if (remainsz == 0)
|
||||
{
|
||||
rt_kprintf("logtrace pipe "PIPE_NAME" is full, some log may lost\n");
|
||||
}
|
||||
|
||||
readsz = rt_device_read((rt_device_t)&pipedev, 0, outbuf, sizeof(outbuf));
|
||||
if (readsz)
|
||||
rt_device_write(console, 0, outbuf, readsz);
|
||||
}
|
||||
|
||||
void memlog_init(void)
|
||||
{
|
||||
rt_err_t res;
|
||||
|
||||
/* make sure the RT_PIPE_FLAG_BLOCK_RD is not set. The Idle should not be
|
||||
* blocked. RT_PIPE_FLAG_FORCE_WR will let the pipe discard some old data
|
||||
* when pipe is full. */
|
||||
res = rt_pipe_init(&pipedev, PIPE_NAME, RT_PIPE_FLAG_FORCE_WR,
|
||||
pipebuf, sizeof(pipebuf));
|
||||
if (res != RT_EOK)
|
||||
{
|
||||
rt_kprintf("init pipe device failed: %d\n", res);
|
||||
return;
|
||||
}
|
||||
|
||||
log_trace_set_device(PIPE_NAME);
|
||||
|
||||
rt_thread_idle_sethook(memlog_flush);
|
||||
}
|
||||
|
||||
@@ -1,4 +0,0 @@
|
||||
example:
|
||||
1.edit rtconfig.py to config toolchain and bsp
|
||||
2.scons --app=basicapp
|
||||
3.copy basicapp/build/$bsp/basicapp.so to filesystem
|
||||
@@ -1,73 +0,0 @@
|
||||
import os
|
||||
import sys
|
||||
import SCons.cpp
|
||||
import rtconfig
|
||||
|
||||
if os.getenv('RTT_ROOT'):
|
||||
RTT_ROOT = os.getenv('RTT_ROOT')
|
||||
else:
|
||||
RTT_ROOT = os.path.normpath(os.getcwd() + '/../..')
|
||||
|
||||
sys.path = sys.path + [os.path.join(RTT_ROOT, 'tools')]
|
||||
from building import *
|
||||
|
||||
Export('RTT_ROOT')
|
||||
|
||||
# add target option
|
||||
AddOption('--app',
|
||||
dest='app',
|
||||
nargs=1, type='string',
|
||||
action='store',
|
||||
metavar='DIR',
|
||||
help='installation prefix')
|
||||
|
||||
# add target option
|
||||
AddOption('--type',
|
||||
dest='type',
|
||||
nargs=1, type='string',
|
||||
action='store',
|
||||
metavar='DIR',
|
||||
help='installation prefix')
|
||||
|
||||
app = GetOption('app')
|
||||
|
||||
if GetOption('type') == 'ext':
|
||||
linkflags = rtconfig.LFLAGS + ' -e 0'
|
||||
else:
|
||||
linkflags = rtconfig.LFLAGS + ' -e main'
|
||||
|
||||
env = Environment(tools = ['mingw'],
|
||||
AS = rtconfig.AS, ASFLAGS = rtconfig.AFLAGS,
|
||||
CC = rtconfig.CC, CCFLAGS = rtconfig.CFLAGS,
|
||||
CXX = rtconfig.CXX,
|
||||
AR = rtconfig.AR, ARFLAGS = '-rc',
|
||||
LINK = rtconfig.LINK, LINKFLAGS = linkflags,
|
||||
CPPPATH = [
|
||||
RTT_ROOT + '/include',
|
||||
RTT_ROOT + '/bsp/' + rtconfig.BSP,
|
||||
RTT_ROOT + '/components/finsh',
|
||||
RTT_ROOT + '/components/rtgui/include',
|
||||
RTT_ROOT + '/components/rgtui/common',
|
||||
RTT_ROOT + '/components/rtgui/server',
|
||||
RTT_ROOT + '/components/rtgui/widgets',
|
||||
RTT_ROOT + '/components/libdl',
|
||||
RTT_ROOT + '/components/external/ftk/ftk/src/os/rt-thread',
|
||||
RTT_ROOT + '/components/external/ftk/ftk/src/demos',
|
||||
RTT_ROOT + '/components/external/ftk/ftk/apps/common',
|
||||
RTT_ROOT + '/components/external/ftk/ftk/src',
|
||||
RTT_ROOT + '/components/dfs',
|
||||
RTT_ROOT + '/components/dfs/include',
|
||||
RTT_ROOT + '/components/libc/newlib',
|
||||
RTT_ROOT + '/components/external/cairo/cairo-1.10.2/src',
|
||||
RTT_ROOT + '/components/external/cairo/'
|
||||
])
|
||||
env.PrependENVPath('PATH', rtconfig.EXEC_PATH)
|
||||
|
||||
PrepareModuleBuilding(env, RTT_ROOT, RTT_ROOT + '/bsp/' + rtconfig.BSP)
|
||||
|
||||
dir = app + '/build/' + rtconfig.BSP
|
||||
objs = SConscript(app + '/Sconscript', variant_dir=dir, duplicate=0)
|
||||
TARGET = dir + '/' + app + '.' + rtconfig.TARGET_EXT
|
||||
|
||||
# build program
|
||||
env.Program(TARGET, objs)
|
||||
@@ -1,7 +0,0 @@
|
||||
import rtconfig
|
||||
Import('RTT_ROOT')
|
||||
from building import *
|
||||
|
||||
src = Glob('*.c')
|
||||
group = DefineGroup('', src, depend = [''])
|
||||
Return('group')
|
||||
@@ -1,30 +0,0 @@
|
||||
#include <rtthread.h>
|
||||
|
||||
static int a = 0;
|
||||
static int b = 1000000;
|
||||
int c = 100;
|
||||
|
||||
static void function(int count1, int count2, int count3)
|
||||
{
|
||||
rt_kprintf("Hello RT-Thread %d %d\n", count1, count2, count3);
|
||||
}
|
||||
|
||||
int main(void)
|
||||
{
|
||||
int i;
|
||||
|
||||
rt_kprintf("application entry\n");
|
||||
rt_kprintf("[addr]a-0x%x,b-0x%x,c-0x%x\n", &a, &b, &c);
|
||||
rt_kprintf("[value]a-%d,b-%d,c-%d\n", a, b, c);
|
||||
|
||||
for(i=0; i<100; i++)
|
||||
{
|
||||
a++;
|
||||
b--;
|
||||
c++;
|
||||
function(a, c, b );
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -1,7 +0,0 @@
|
||||
import rtconfig
|
||||
Import('RTT_ROOT')
|
||||
from building import *
|
||||
|
||||
src = Glob('*.c')
|
||||
group = DefineGroup('', src, depend = [''])
|
||||
Return('group')
|
||||
@@ -1,35 +0,0 @@
|
||||
#include <rtthread.h>
|
||||
#include <dlfcn.h>
|
||||
|
||||
typedef void (*func)(void);
|
||||
|
||||
int main(void)
|
||||
{
|
||||
func f1, f2, f3, f4, f5;
|
||||
|
||||
void* handle = dlopen("/mo/ext.so", RTLD_NOW);
|
||||
if(handle != RT_NULL)
|
||||
{
|
||||
f1= (func)dlsym(handle, "function1");
|
||||
f2= (func)dlsym(handle, "function2");
|
||||
f3= (func)dlsym(handle, "function3");
|
||||
f4= (func)dlsym(handle, "function4");
|
||||
f5= (func)dlsym(handle, "function5");
|
||||
|
||||
if(f1 != RT_NULL) f1();
|
||||
else rt_kprintf("dlsym function1 failed.\n");
|
||||
if(f2 != RT_NULL) f2();
|
||||
else rt_kprintf("dlsym function2 failed.\n");
|
||||
if(f3 != RT_NULL) f3();
|
||||
else rt_kprintf("dlsym function3 failed.\n");
|
||||
if(f4 != RT_NULL) f4();
|
||||
else rt_kprintf("dlsym function4 failed.\n");
|
||||
if(f5 != RT_NULL) f5();
|
||||
else rt_kprintf("dlsym function5 failed.\n");
|
||||
}
|
||||
|
||||
if(handle != RT_NULL) dlclose(handle);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -1,23 +0,0 @@
|
||||
# bsp name
|
||||
BSP = 'mini2440'
|
||||
|
||||
# toolchains
|
||||
EXEC_PATH = 'C:/Program Files/CodeSourcery/Sourcery G++ Lite/bin'
|
||||
PREFIX = 'arm-none-eabi-'
|
||||
CC = PREFIX + 'gcc'
|
||||
CXX = PREFIX + 'g++'
|
||||
AS = PREFIX + 'gcc'
|
||||
AR = PREFIX + 'ar'
|
||||
LINK = PREFIX + 'gcc'
|
||||
TARGET_EXT = 'so'
|
||||
SIZE = PREFIX + 'size'
|
||||
OBJDUMP = PREFIX + 'objdump'
|
||||
OBJCPY = PREFIX + 'objcopy'
|
||||
|
||||
DEVICE = ' -mcpu=arm920t'
|
||||
CFLAGS = DEVICE + ' -O0 -fPIC -DFTK_AS_PLUGIN -DRT_THREAD '
|
||||
AFLAGS = ' -c' + DEVICE + ' -x assembler-with-cpp'
|
||||
LFLAGS = DEVICE + ' -Wl,-z,max-page-size=0x4 -shared -fPIC -nostdlib -s'
|
||||
|
||||
CPATH = ''
|
||||
LPATH = ''
|
||||
@@ -1,23 +0,0 @@
|
||||
# bsp name
|
||||
BSP = 'lm3s8962'
|
||||
|
||||
# toolchains
|
||||
EXEC_PATH = 'C:/Program Files/CodeSourcery/Sourcery G++ Lite/bin'
|
||||
PREFIX = 'arm-none-eabi-'
|
||||
CC = PREFIX + 'gcc'
|
||||
CXX = PREFIX + 'g++'
|
||||
AS = PREFIX + 'gcc'
|
||||
AR = PREFIX + 'ar'
|
||||
LINK = PREFIX + 'gcc'
|
||||
TARGET_EXT = 'so'
|
||||
SIZE = PREFIX + 'size'
|
||||
OBJDUMP = PREFIX + 'objdump'
|
||||
OBJCPY = PREFIX + 'objcopy'
|
||||
|
||||
DEVICE = ' -mcpu=cortex-m3'
|
||||
CFLAGS = DEVICE + ' -mthumb -mlong-calls -Dsourcerygxx -O0 -fPIC'
|
||||
AFLAGS = ' -c' + DEVICE + ' -x assembler-with-cpp'
|
||||
LFLAGS = DEVICE + ' -mthumb -Wl,-z,max-page-size=0x4 -shared -fPIC -e main -nostdlib'
|
||||
|
||||
CPATH = ''
|
||||
LPATH = ''
|
||||
@@ -1,7 +0,0 @@
|
||||
import rtconfig
|
||||
Import('RTT_ROOT')
|
||||
from building import *
|
||||
|
||||
src = Glob('*.c')
|
||||
group = DefineGroup('', src, depend = [''])
|
||||
Return('group')
|
||||
@@ -1,61 +0,0 @@
|
||||
/*
|
||||
* File : tetris_modal.c
|
||||
* This file is part of RTGUI in RT-Thread RTOS
|
||||
* COPYRIGHT (C) 2010, RT-Thread Development Team
|
||||
*
|
||||
* The license and distribution terms for this file may be
|
||||
* found in the file LICENSE in this distribution or at
|
||||
* http://www.rt-thread.org/license/LICENSE
|
||||
*
|
||||
* Change Logs:
|
||||
* Date Author Notes
|
||||
* 2010-08-14 Yi.Qiu first version
|
||||
*/
|
||||
|
||||
#include <rtthread.h>
|
||||
|
||||
struct rt_tetris;
|
||||
typedef struct rt_tetris rt_tetris_t;
|
||||
|
||||
struct rt_tetris_view;
|
||||
typedef struct rt_tetris_view rt_tetris_view_t;
|
||||
|
||||
typedef rt_err_t (*on_update)(rt_tetris_view_t* thiz, rt_tetris_t* tetris);
|
||||
|
||||
struct rt_tetris_view
|
||||
{
|
||||
rt_uint32_t width;
|
||||
rt_uint32_t height;
|
||||
|
||||
on_update update;
|
||||
on_update update_next_brick;
|
||||
on_update update_level;
|
||||
on_update update_score_and_lines;
|
||||
void *private;
|
||||
};
|
||||
|
||||
rt_tetris_t* rt_tetris_create(rt_uint32_t width, rt_uint32_t height);
|
||||
rt_err_t rt_tetris_destory(rt_tetris_t* thiz);
|
||||
rt_err_t rt_tetris_start(rt_tetris_t* thiz);
|
||||
rt_err_t rt_tetris_pause(rt_tetris_t* thiz);
|
||||
rt_uint32_t rt_tetris_width(rt_tetris_t* thiz);
|
||||
rt_uint32_t* rt_tetris_next_brick(rt_tetris_t* thiz);
|
||||
rt_uint32_t rt_tetris_level(rt_tetris_t* thiz);
|
||||
rt_uint32_t rt_tetris_lines(rt_tetris_t* thiz);
|
||||
rt_uint32_t rt_tetris_score(rt_tetris_t* thiz);
|
||||
rt_uint32_t rt_tetris_height(rt_tetris_t* thiz);
|
||||
rt_bool_t rt_tetris_status(rt_tetris_t* thiz);
|
||||
rt_err_t rt_tetris_down(rt_tetris_t* thiz);
|
||||
rt_err_t rt_tetris_left(rt_tetris_t* thiz);
|
||||
rt_err_t rt_tetris_right(rt_tetris_t* thiz);
|
||||
rt_err_t rt_tetris_drop(rt_tetris_t* thiz);
|
||||
rt_err_t rt_tetris_rotate(rt_tetris_t* thiz, rt_bool_t direction);
|
||||
rt_err_t rt_tetris_add_view(rt_tetris_t* thiz, rt_tetris_view_t* view);
|
||||
rt_err_t rt_tetris_delete_view(rt_tetris_t* thiz, rt_tetris_view_t* view);
|
||||
rt_err_t rt_tetris_check_collision(rt_tetris_t* thiz, rt_uint32_t block);
|
||||
|
||||
rt_tetris_view_t* rt_tetris_view_create(void* private);
|
||||
rt_err_t rt_tetris_view_destroy(rt_tetris_view_t* thiz);
|
||||
|
||||
void tetris_ui_entry(void* parameter);
|
||||
|
||||
File diff suppressed because it is too large.
Load diff
File diff suppressed because it is too large.
Load diff
File diff suppressed because it is too large.
Load diff
Reference in new issue
Block a user