1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
void main(void) NORETURN_ATTR;
void main(void)
{
    int i,j = 0;

    power_init();
    system_init();
    kernel_init();
    enable_irq();

    adc_init();
    lcd_init();
    backlight_init();
    button_init_device();


    LCDC_CTRL = ALPHA(7) | LCDC_STOP | LCDC_MCU;
    HOR_BP = 1;
    VERT_BP = 1;
    VERT_PERIOD = 0x3bf;
    HOR_ACT = LCD_HEIGHT;
    VERT_ACT = LCD_WIDTH;

    LINE0_YADDR = 0;
    LINE1_YADDR = (1 * LCD_HEIGHT);
    LINE2_YADDR = (2 * LCD_HEIGHT);
    LINE3_YADDR = (3 * LCD_HEIGHT);

    LINE0_UVADDR = 1;
    LINE1_UVADDR = (1 * LCD_HEIGHT) + 1;
    LINE2_UVADDR = (2 * LCD_HEIGHT) + 1;
    LINE3_UVADDR = (3 * LCD_HEIGHT) + 1;

    memset((void *)&LCD_BUFF, 0x00, 2048*4);

    lcdctrl_bypass(0);

    for (i=0; i<2048; i++)
        *(&LCD_BUFF + i) = (0x1f<<16)|0x1f;
    MCU_CTRL=(1<<1)|(1<<2)|(1<<5);

    while(1);
}