diff --git a/bsp/simulator/applications/application.c b/bsp/simulator/applications/application.c index ad4a38fec60ff9e2b3cc78b3ee4804218669d908..cf84a1e116a4fc00cb8d78617467e19ae8d2e47d 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) {