awtk/demos/demo_main.c

71 lines
1.5 KiB
C
Raw Normal View History

2018-02-21 19:36:38 +08:00
/**
2018-03-10 22:01:10 +08:00
* File: demo_main.c
2018-02-21 19:36:38 +08:00
* Author: Li XianJing <xianjimli@hotmail.com>
2018-03-10 22:01:10 +08:00
* Brief: demo main
2018-02-21 19:36:38 +08:00
*
* Copyright (c) 2018 - 2018 Li XianJing <xianjimli@hotmail.com>
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* License file for more details.
*
*/
/**
* History:
* ================================================================
* 2018-02-16 Li XianJing <xianjimli@hotmail.com> created
*
*/
2018-04-27 11:23:09 +08:00
#include "tk.h"
2018-04-26 16:09:53 +08:00
#include "resource.h"
#include "base/system_info.h"
2018-02-22 18:07:22 +08:00
ret_t application_init(void);
2018-02-21 19:36:38 +08:00
#ifdef WITH_STM32F103ZE_RAW
#include "button.h"
#include "delay.h"
#include "flash.h"
2018-02-21 19:36:38 +08:00
#include "gui.h"
#include "lcd_driver.h"
#include "led.h"
2018-02-21 19:36:38 +08:00
#include "rtc.h"
#include "stdlib.h"
#include "sys.h"
#include "tim.h"
2018-02-21 19:36:38 +08:00
#include "touch.h"
#include "usart.h"
2018-02-22 18:07:22 +08:00
#include "main_loop/main_loop_stm32_raw.h"
2018-02-21 19:36:38 +08:00
static __align(8) uint32_t s_heap_mem[2048];
2018-02-22 18:07:22 +08:00
#elif defined(WITH_RT_THREAD)
#include "main_loop/main_loop_rtthread.h"
static uint32_t s_heap_mem[2048];
2018-02-21 19:36:38 +08:00
#else
#include "main_loop/main_loop_sdl2.h"
static uint32_t s_heap_mem[2048];
#endif
2018-05-07 17:50:05 +08:00
#ifdef USE_GUI_MAIN
2018-02-24 20:40:44 +08:00
#include "base/mem.h"
int gui_app_start(void* params) {
#elif defined(WIN32)
2018-02-21 19:36:38 +08:00
#include <windows.h>
int WINAPI WinMain(HINSTANCE hinstance, HINSTANCE hprevinstance, LPSTR lpcmdline, int ncmdshow) {
#else
#include "base/mem.h"
int main(void) {
#endif
2018-04-27 11:23:09 +08:00
tk_init(320, 480, s_heap_mem, sizeof(s_heap_mem));
2018-02-21 19:36:38 +08:00
resource_init();
application_init();
2018-04-27 11:23:09 +08:00
tk_run();
2018-02-21 19:36:38 +08:00
return 0;
}