|
|
@@ -27,9 +27,12 @@ extern int st77xx_deinit(lcd_handle_t *h);
|
|
|
extern void st77xx_refresh(lcd_handle_t *hd, uint16_t x, uint16_t y, uint16_t w, uint16_t h, void *data, uint32_t len);
|
|
|
extern void st77xx_rotate(lcd_handle_t *h, int rotate);
|
|
|
extern void st77xx_draw_pixel(lcd_handle_t *hd, uint16_t x, uint16_t y, uint32_t color);
|
|
|
+extern void st77xx_fill(lcd_handle_t *h, uint32_t color);
|
|
|
+extern void st77xx_fill_rect(lcd_handle_t *hd, uint16_t x, uint16_t y, uint16_t w, uint16_t h, uint32_t color);
|
|
|
|
|
|
static inline int set_point(lcd_handle_t *h, int x, int y, uint32_t data)
|
|
|
{
|
|
|
+#if 0
|
|
|
int pos,bit;
|
|
|
|
|
|
if(h->rotate==180) {
|
|
|
@@ -45,6 +48,9 @@ static inline int set_point(lcd_handle_t *h, int x, int y, uint32_t data)
|
|
|
else {
|
|
|
h->buf[pos*h->width+x] &= ~BIT(bit); /* set 0 */
|
|
|
}
|
|
|
+#else
|
|
|
+ st77xx_draw_pixel(h,x,y,data);
|
|
|
+#endif
|
|
|
|
|
|
return 0;
|
|
|
}
|
|
|
@@ -116,8 +122,7 @@ void lcd_set_win(int x, int y, int w, int h)
|
|
|
void lcd_fill(uint32_t color)
|
|
|
{
|
|
|
lcd_handle_t *h=&lcdHandle;
|
|
|
-
|
|
|
- lcd_fill_rect(0, 0, h->width, h->height, color);
|
|
|
+ st77xx_fill(h, color);
|
|
|
}
|
|
|
|
|
|
|
|
|
@@ -212,14 +217,8 @@ void lcd_draw_rect(int x, int y, int w, int h, uint32_t color)
|
|
|
|
|
|
void lcd_fill_rect(int x, int y, int w, int h, uint32_t color)
|
|
|
{
|
|
|
- int i,j;
|
|
|
- lcd_handle_t *h2=&lcdHandle;
|
|
|
-
|
|
|
- for(i=x; i<x+w; i++) {
|
|
|
- for(j=y; j<y+h; j++) {
|
|
|
- set_point(h2, i, j, color);
|
|
|
- }
|
|
|
- }
|
|
|
+ lcd_handle_t *hd=&lcdHandle;
|
|
|
+ st77xx_fill_rect(hd, x, y, w, h, color);
|
|
|
}
|
|
|
|
|
|
|
|
|
@@ -279,13 +278,12 @@ int lcd_draw_char(lcd_handle_t *hd, int x, int y, int w, int h, uint8_t *c, int
|
|
|
}
|
|
|
#else
|
|
|
#if 0
|
|
|
- set_color(hd, bgcolor, fdata.width*h);
|
|
|
for(i=0; i<fdata.dlen; i++) {
|
|
|
tmp = fdata.data[i];
|
|
|
for(j=0; j<8; j++) {
|
|
|
if((x<x2 && x<hd->width) && (y<y2 && y<hd->height))
|
|
|
{
|
|
|
- int dx=x-x0,dy=y-y0;
|
|
|
+ int dx=x-x1,dy=y-y1;
|
|
|
|
|
|
if(tmp&0x01) {
|
|
|
hd->buf[dy*fdata.width+dx] = color;
|
|
|
@@ -300,7 +298,7 @@ int lcd_draw_char(lcd_handle_t *hd, int x, int y, int w, int h, uint8_t *c, int
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- st77xx_refresh(hd, x0, y0, fdata.width, h, hd->buf, fdata.width*h*2);
|
|
|
+ st77xx_refresh(hd, x1, y1, fdata.width, fdata.height, hd->buf, fdata.width*fdata.height*2);
|
|
|
#else
|
|
|
for(i=0; i<fdata.dlen; i++) {
|
|
|
tmp = fdata.data[i];
|
|
|
@@ -308,10 +306,10 @@ int lcd_draw_char(lcd_handle_t *hd, int x, int y, int w, int h, uint8_t *c, int
|
|
|
if((x<x2 && x<hd->width) && (y<y2 && y<hd->height))
|
|
|
{
|
|
|
if(tmp&0x01) {
|
|
|
- st77xx_draw_pixel(hd, x, y, color);
|
|
|
+ set_point(hd, x, y, color);
|
|
|
}
|
|
|
else {
|
|
|
- st77xx_draw_pixel(hd, x, y, bgcolor);
|
|
|
+ set_point(hd, x, y, bgcolor);
|
|
|
}
|
|
|
}
|
|
|
tmp >>= 1;
|