Subversion Repositories freemyipod

Rev

Rev 513 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 513 Rev 521
Line 91... Line 91...
91
}
91
}
92
 
92
 
93
void displaylcd_sync() ICODE_ATTR;
93
void displaylcd_sync() ICODE_ATTR;
94
void displaylcd_sync()
94
void displaylcd_sync()
95
{
95
{
96
    mutex_lock(&lcd_mutex, TIMEOUT_BLOCK);
-
 
97
    while (displaylcd_busy()) sleep(100);
96
    while (displaylcd_busy()) sleep(100);
98
    mutex_unlock(&lcd_mutex);
-
 
99
}
97
}
100
 
98
 
101
void displaylcd_setup(unsigned int startx, unsigned int endx,
99
void displaylcd_setup(unsigned int startx, unsigned int endx,
102
                      unsigned int starty, unsigned int endy) ICODE_ATTR;
100
                      unsigned int starty, unsigned int endy) ICODE_ATTR;
103
void displaylcd_setup(unsigned int startx, unsigned int endx,
101
void displaylcd_setup(unsigned int startx, unsigned int endx,
104
                      unsigned int starty, unsigned int endy)
102
                      unsigned int starty, unsigned int endy)
105
{
103
{
106
    mutex_lock(&lcd_mutex, TIMEOUT_BLOCK);
-
 
107
    displaylcd_sync();
104
    displaylcd_sync();
-
 
105
    mutex_lock(&lcd_mutex, TIMEOUT_BLOCK);
108
    if (lcd_detect() & 2)
106
    if (lcd_detect() & 2)
109
    {
107
    {
110
        lcd_send_cmd(0x210);
108
        lcd_send_cmd(0x210);
111
        lcd_send_data(startx);
109
        lcd_send_data(startx);
112
        lcd_send_cmd(0x211);
110
        lcd_send_cmd(0x211);
Line 148... Line 146...
148
        lli->srcaddr = data;
146
        lli->srcaddr = data;
149
        lli->dstaddr = (void*)((int)&LCDWDATA);
147
        lli->dstaddr = (void*)((int)&LCDWDATA);
150
        lli->nextlli = last ? NULL : &lcd_lli[i + 1];
148
        lli->nextlli = last ? NULL : &lcd_lli[i + 1];
151
        lli->control = 0x70240000 | (last ? pixels : 0xfff)
149
        lli->control = 0x70240000 | (last ? pixels : 0xfff)
152
                     | (last ? 0x80000000 : 0) | (solid ? 0 : 0x4000000);
150
                     | (last ? 0x80000000 : 0) | (solid ? 0 : 0x4000000);
153
        data = (void*)(((uint32_t)data) + 0x1ffe);
151
        if (!solid) data = (void*)(((uint32_t)data) + 0x1ffe);
154
    }
152
    }
155
    clean_dcache();
153
    clean_dcache();
156
    DMAC0C4CONFIG = 0x88c1;
154
    DMAC0C4CONFIG = 0x88c1;
157
}
155
}
158
 
156
 
Line 299... Line 297...
299
}
297
}
300
 
298
 
301
void filllcd(unsigned int x, unsigned int y, unsigned int width, unsigned int height, int color)
299
void filllcd(unsigned int x, unsigned int y, unsigned int width, unsigned int height, int color)
302
{
300
{
303
    if (width * height <= 0) return;
301
    if (width * height <= 0) return;
-
 
302
    displaylcd_sync();
304
    mutex_lock(&lcd_mutex, TIMEOUT_BLOCK);
303
    mutex_lock(&lcd_mutex, TIMEOUT_BLOCK);
305
    lcd_color = color;
304
    lcd_color = color;
306
    displaylcd_dither(x, y, width, height, &lcd_color, 0, 0, 0, true);
305
    displaylcd_dither(x, y, width, height, &lcd_color, 0, 0, 0, true);
307
    mutex_unlock(&lcd_mutex);
306
    mutex_unlock(&lcd_mutex);
308
}
307
}