static void InitializeGui (void) { Debug ("InitializeGui %d", theme.ok); // Prepare black box int i, il; int x = INIT_X; int y = INIT_Y; gui_Init(); gui.spotsIdx = 0; gui.spotsXpage = 16; gui.spotsXline = 4; grlib_IconSettingInit (&is); is.themed = theme.ok; is.border = 5.0; is.magX = 1.0; is.magY = 1.0; is.magXSel = 1.2; is.magYSel = 1.2; is.iconFake = vars.tex[TEX_NONE]; is.bkgTex = theme.frameBack; is.fgrSelTex = theme.frameSel; is.fgrTex = theme.frame; is.bkgColor = RGBA (0,0,0,255); is.borderSelColor = RGBA (255,255,255,255); // Border color is.borderColor = RGBA (128,128,128,255); // Border color is.fontReverse = 0; il = 0; for (i = 0; i < gui.spotsXpage; i++) { grlib_IconInit (&gui.spots[i].ico, NULL); gui.spots[i].ico.x = x; gui.spots[i].ico.y = y; gui.spots[i].ico.w = ICONW; gui.spots[i].ico.h = ICONH; il++; if (il == gui.spotsXline) { x = INIT_X; y += INC_Y; il = 0; } else { x+=INC_X; } } }
void sys_Init() { //创建系统守护定时(1S) #if OS_TYPE rt_timer_init(&timer_daemon, "daemon", sys_Daemon, NULL, 100 / OS_TICK_MS, RT_TIMER_FLAG_PERIODIC); rt_timer_start(&timer_daemon); #endif #if OS_TYPE buf_Init(); #endif #if OS_QUEUE_QTY os_que_Init(); #endif #if IRQ_ENABLE irq_Init(); #endif #if BATTERY_ENABLE bat_On(); #endif //------------------------------------------------------------------------- //GPIO Functions //------------------------------------------------------------------------- #if PULSE_COL_ENABLE pulse_Init(); #endif #if HT1621_ENABLE ht1621_Init(); #endif //------------------------------------------------------------------------- //External Parallel Interface Functions //------------------------------------------------------------------------- #if NANDFLASH_ENABLE nand_Init(); #endif //------------------------------------------------------------------------- //I2C Interface Functions //------------------------------------------------------------------------- #if PCA955X_ENABLE pca955x_Init(); #endif //------------------------------------------------------------------------- //SPI Interface Functions //------------------------------------------------------------------------- #if SC16IS7X_ENABLE sc16is7x_Init(); #endif #if ATT7022_ENABLE att7022_Init(); #endif #if NRSEC3000_ENABLE nrsec3000_Init(); #endif #if VOICE_ENABLE wtv_Init(); #endif #if MIFARE_ENABLE mf_InitGpio(); #endif //------------------------------------------------------------------------- //UART Interface Functions //------------------------------------------------------------------------- #if VK321X_ENABLE vk321x_Init(); #endif #if TDK6515_ENABLE tdk6515_Init(); #endif #if MODEM_ENABLE modem_Init(); #endif //------------------------------------------------------------------------- //Real Time Clock Functions //------------------------------------------------------------------------- #if RTC_ENABLE rtc_Init(); #endif //------------------------------------------------------------------------- //Backup Functions //------------------------------------------------------------------------- #if BKP_ENABLE bkp_Init(); #endif //------------------------------------------------------------------------- //Flash System Functions //------------------------------------------------------------------------- #if INTFLASH_ENABLE intf_Init(); #endif #if NORFLASH_ENABLE norf_Init(); #endif #if SPIFLASH_ENABLE spif_Init(); #endif #if FLASH_ENABLE flash_Init(); #endif //------------------------------------------------------------------------- //File System Functions //------------------------------------------------------------------------- #if FS_ENABLE fs_init(); #endif //------------------------------------------------------------------------- //USB Interface Functions //------------------------------------------------------------------------- #if USB_ENABLE usb_Init(); #endif //------------------------------------------------------------------------- //Register Subsystem Functions //------------------------------------------------------------------------- #if REGISTER_ENABLE reg_Init(); #endif //------------------------------------------------------------------------- //Network Subsystem Functions //------------------------------------------------------------------------- #if TCPPS_ENABLE net_Init(); #endif //------------------------------------------------------------------------- //In Application Programming Functions //------------------------------------------------------------------------- #if GDFTS_ENABLE gdfts_Init(); #endif #if GUI_ENABLE gui_Init(); #endif #if OS_TYPE //创建系统IO处理线程 #if SYS_TIMER_ENABLE rt_timer_init(&timer_IOHandle, "sysio", sys_IOHandle, NULL, 1, RT_TIMER_FLAG_PERIODIC); rt_timer_start(&timer_IOHandle); #else os_thd_Create(SysIo, 240); #endif //创建应用层线程 app_Entry(); //系统维护线程 sys_Maintain(); #endif }