From 45a5745acb135290de3df67faec8a6b4bf7587fa Mon Sep 17 00:00:00 2001 From: tangyuxin <462747508@qq.com> Date: Wed, 6 Dec 2017 21:01:46 +0800 Subject: [PATCH] [gui]remove gui_demo.h --- components/gui/example/SConscript | 2 +- components/gui/example/gui_demo.c | 21 +------------------ .../gui/example/{gui_demo.h => resources.c} | 6 ------ 3 files changed, 2 insertions(+), 27 deletions(-) rename components/gui/example/{gui_demo.h => resources.c} (99%) diff --git a/components/gui/example/SConscript b/components/gui/example/SConscript index cdd2816fa..2981093bf 100644 --- a/components/gui/example/SConscript +++ b/components/gui/example/SConscript @@ -5,6 +5,6 @@ src = Glob('*.c') CPPPATH = [cwd] -group = DefineGroup('gui_demo', src, depend = ['RTGUI_USING_DEMO'], CPPPATH = CPPPATH) +group = DefineGroup('gui_demo', src, depend = ['RT_USING_GUIENGINE', 'RTGUI_USING_DEMO'], CPPPATH = CPPPATH) Return('group') diff --git a/components/gui/example/gui_demo.c b/components/gui/example/gui_demo.c index afe04a4de..fc4a361ba 100644 --- a/components/gui/example/gui_demo.c +++ b/components/gui/example/gui_demo.c @@ -9,7 +9,7 @@ #include #include -#include "gui_demo.h" +extern const static unsigned char _picture_png[]; static rt_bool_t show_demo(struct rtgui_win *win) { @@ -111,25 +111,6 @@ static void rt_gui_demo_entry(void *parameter) int rt_gui_demo_init(void) { rt_thread_t tid; - rt_device_t device; - rt_err_t err; - - device = rt_device_find("lcd"); - if (device == RT_NULL) - { - rt_kprintf("Not found LCD driver\n"); - return RT_ERROR; - } - - err = rt_device_open(device, RT_DEVICE_OFLAG_RDWR); - if (err != RT_EOK) - { - rt_kprintf("Open LCD driver fail\n"); - return RT_ERROR; - } - - /* set graphic device */ - rtgui_graphic_set_device(device); tid = rt_thread_create("mygui", rt_gui_demo_entry, RT_NULL, diff --git a/components/gui/example/gui_demo.h b/components/gui/example/resources.c similarity index 99% rename from components/gui/example/gui_demo.h rename to components/gui/example/resources.c index a9f53cff3..06c0e0fca 100644 --- a/components/gui/example/gui_demo.h +++ b/components/gui/example/resources.c @@ -1,6 +1,3 @@ -#ifndef __GUI_DEMO_H__ -#define __GUI_DEMO_H__ - const static unsigned char _picture_png[] = { 0x89,0x50,0x4e,0x47,0x0d,0x0a,0x1a,0x0a,0x00,0x00,0x00,0x0d,0x49,0x48,0x44,0x52, 0x00,0x00,0x00,0xbe,0x00,0x00,0x00,0x4a,0x08,0x06,0x00,0x00,0x00,0x05,0x77,0xee, @@ -1396,6 +1393,3 @@ const static unsigned char _picture_png[] = { 0x1f,0x00,0x4b,0xa8,0x7e,0x3f,0xd2,0x12,0x11,0x79,0x00,0x00,0x00,0x00,0x49,0x45, 0x4e,0x44,0xae,0x42,0x60,0x82, }; - - -#endif \ No newline at end of file -- GitLab