application.c 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. /*
  2. * File : app.c
  3. * This file is part of RT-Thread RTOS
  4. * COPYRIGHT (C) 2006, RT-Thread Development Team
  5. *
  6. * The license and distribution terms for this file may be
  7. * found in the file LICENSE in this distribution or at
  8. * http://openlab.rt-thread.com/license/LICENSE
  9. *
  10. * Change Logs:
  11. * Date Author Notes
  12. * 2010-08-28 Yi.Qiu the first version
  13. */
  14. /**
  15. * @addtogroup LM3S
  16. */
  17. /*@{*/
  18. #include <rtthread.h>
  19. #include <rtgui/rtgui.h>
  20. #include <rtgui/rtgui_server.h>
  21. #include <rtgui/rtgui_system.h>
  22. #include <rtgui/widgets/workbench.h>
  23. extern void tetris_ui_entry(void* parameter);
  24. int rt_application_init()
  25. {
  26. rt_thread_t tid;
  27. rtgui_rect_t rect;
  28. /* ×¢²áÃæ°å */
  29. rect.x1 = 0;
  30. rect.y1 = 0;
  31. rect.x2 = 128;
  32. rect.y2 = 96;
  33. rtgui_panel_register("main", &rect);
  34. rtgui_panel_set_default_focused("main");
  35. tid = rt_thread_create("wb", tetris_ui_entry, RT_NULL, 2048, 20, 5);
  36. if (tid != RT_NULL) rt_thread_startup(tid);
  37. return 0;
  38. }
  39. /*@}*/