00001 00059 #include <dma.h> 00060 #include <led.h> 00061 #include <board.h> 00062 #include <mainloop.h> 00063 00064 #include <clk/sys.h> 00065 00066 #include <gfx/gfx.h> 00067 #include <gfx/win.h> 00068 00069 #include <touch/touch.h> 00070 00071 #include "app_calibrate.h" 00072 #include "app_widget.h" 00073 00074 static struct workqueue_task launch_application; 00075 00076 static void setup_root_window(void) 00077 { 00078 // Set transparent background window 00079 struct win_window *win_root; 00080 struct win_attributes attr; 00081 00082 win_root = win_get_root(); 00083 attr = *win_get_attributes(win_root); 00084 attr.background = NULL; 00085 win_set_attributes(win_root, &attr, WIN_ATTR_BACKGROUND); 00086 win_show(win_root); 00087 } 00088 00089 int main(void) 00090 { 00091 cpu_irq_enable(); 00092 sysclk_init(); 00093 dbg_init(); 00094 board_init(); 00095 led_activate(BOARD_LED0_ID); 00096 workqueue_init(&main_workqueue); 00097 #ifdef CONFIG_TOUCH_RESISTIVE 00098 touch_init(); 00099 touch_enable(); 00100 #endif 00101 gfx_init(); 00102 membag_init(CPU_DMA_ALIGN); 00103 win_init(); 00104 00105 setup_root_window(); 00106 00107 // Setup task for starting the application 00108 workqueue_task_init(&launch_application, app_widget_launch); 00109 00110 // Start calibration with task for starting application afterwards 00111 app_touch_calibrate_setup(&launch_application); 00112 00113 // Start processing workqueue 00114 mainloop_run(&main_workqueue); 00115 }
1.6.3