From 20a57ea77c270fd7b48b39cef1052b719e0e97ee Mon Sep 17 00:00:00 2001 From: "goprife@gmail.com" Date: Sun, 18 Nov 2012 08:35:23 +0000 Subject: [PATCH] change RTGUI path in SConstruct, update application.c to start RTGUI demo automatically, set idle's hook to reduce the cpu consumption. git-svn-id: https://rt-thread.googlecode.com/svn/trunk@2426 bbd45198-f89e-11dd-88c7-29a3b14d5316 --- bsp/simulator/applications/application.c | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/bsp/simulator/applications/application.c b/bsp/simulator/applications/application.c index ad4a38fec..cf84a1e11 100644 --- a/bsp/simulator/applications/application.c +++ b/bsp/simulator/applications/application.c @@ -64,6 +64,20 @@ void rt_init_thread_entry(void* parameter) #endif } #endif +#ifdef WIN32 + { + extern void low_cpu(void); + rt_thread_idle_sethook(low_cpu); + } +#endif + +#ifdef RT_USING_RTGUI + { + extern void application_init(void); + rt_thread_delay(RT_TICK_PER_SECOND); + application_init(); + } +#endif } void rt_test_thread_entry(void* parameter) @@ -95,6 +109,12 @@ int rt_application_init() return 0; } +#ifdef WIN32 +#include +void low_cpu(void) +{ + Sleep(1000); +} #ifndef _CRT_TERMINATE_DEFINED #define _CRT_TERMINATE_DEFINED @@ -109,6 +129,8 @@ void rt_hw_exit(void) } FINSH_FUNCTION_EXPORT_ALIAS(rt_hw_exit, exit, exit rt-thread); +#endif + #include void test_fs(void) {