void gui_pages_init() { widgets_init(); page_state_step = PAGE_INFO_STEPS; page_state = PAGE_IDLE; active_widget = WIDGET_OFF; }
int main(void) { /* generic hw init */ hw_init(); /* init uart */ uart_init(); #ifdef DEBUG_INIT printf("AlceOSD hw%dv%d fw%d.%d.%d\r\n", hw_rev >> 4, hw_rev & 0xf, VERSION_MAJOR, VERSION_MINOR, VERSION_DEV); if (RCONbits.WDTO) printf("watchdog reset\r\n"); if (RCONbits.EXTR) printf("external reset\r\n"); if (RCONbits.SWR) printf("software reset\r\n"); if (RCONbits.IOPUWR) printf("ill opcode / uninit W reset\r\n"); if (RCONbits.WDTO) printf("trap conflict reset\r\n"); #endif /* real time clock init */ clock_init(); /* adc init */ adc_init(); /* init video driver */ init_video(); /* try to load config from flash */ config_init(); /* init widget modules */ widgets_init(); /* setup tabs */ tabs_init(); /* welcome message */ console_printf("AlceOSD hw%dv%d fw%d.%d.%d\n", hw_rev >> 4, hw_rev & 0xf, VERSION_MAJOR, VERSION_MINOR, VERSION_DEV); /* init home tracking */ init_home(); /* init flight status tracking */ init_flight_stats(); /* init mavlink module */ mavlink_init(); /* init uavtalk module */ uavtalk_init(); /* link serial ports to processes */ uart_set_config_clients(1); /* enable all interrupts */ _IPL = 0; _IPL3 = 1; console_printf("Processes running...\n"); /* main loop */ process_run(); return 0; }
int main(void) { extern int __C30_UART; __C30_UART = 2; unsigned char i; unsigned char in_config = 0; char c; /* generic hw init */ hw_init(); /* real time clock init */ clock_init(); /* adc init */ adc_init(); /* init uart2 */ uart_init2(UART_PORT_TELEMETRY); /* init video driver */ init_video(); /* try to load config from flash */ load_config(); /* video driver config */ video_apply_config(&config.video); /* init widgets */ widgets_init(); /* enable all interrupts */ SRbits.IPL = 0; CORCONbits.IPL3 = 1; /* TODO: rework config entry */ /* check for config entry */ for (i = 0; i < 8; i++) { while (uart_getc2(&c) == 0) { widgets_process(); render_process(); ClrWdt(); } if (c != '!') break; } if (i == 8) { in_config = 1; while (in_config) { in_config = config_osd(); widgets_process(); render_process(); ClrWdt(); } } /* re-build tab list */ build_tab_list(); uart_set_baudrate2(config.baudrate); init_home_process(); init_flight_stats_process(); for (;;) { mavlink_process(); widgets_process(); render_process(); clock_process(); ClrWdt(); } return 0; }