summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--components/gui/example/SConscript2
-rw-r--r--components/gui/example/gui_demo.c21
-rw-r--r--components/gui/example/resources.c (renamed from components/gui/example/gui_demo.h)6
3 files changed, 2 insertions, 27 deletions
diff --git a/components/gui/example/SConscript b/components/gui/example/SConscript
index cdd2816fa1..2981093bfc 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 afe04a4dea..fc4a361bab 100644
--- a/components/gui/example/gui_demo.c
+++ b/components/gui/example/gui_demo.c
@@ -9,7 +9,7 @@
#include <rtgui/widgets/window.h>
#include <rtgui/dc.h>
-#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
index a9f53cff3f..06c0e0fcae 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