lcdDrawLine() speed improvement
This commit is contained in:
parent
5f268adaaa
commit
fd65a3c5b5
1 changed files with 48 additions and 40 deletions
|
@ -267,6 +267,13 @@ void lcdVerticalScroll(uint16_t x0, uint16_t y0, uint16_t x1, uint16_t y1, uint1
|
||||||
}
|
}
|
||||||
|
|
||||||
void lcdDrawLine(uint16_t x0, uint16_t y0, uint16_t x1, uint16_t y1, uint16_t color) {
|
void lcdDrawLine(uint16_t x0, uint16_t y0, uint16_t x1, uint16_t y1, uint16_t color) {
|
||||||
|
// speed improvement if vertical or horizontal
|
||||||
|
if(x0 == x1) {
|
||||||
|
lcdFillArea(x0, y0, x0+1, y1, color);
|
||||||
|
} else if (y0 == y1) {
|
||||||
|
lcdFillArea(x0, y0, x1, y0+1, color);
|
||||||
|
|
||||||
|
} else {
|
||||||
int16_t dy, dx;
|
int16_t dy, dx;
|
||||||
int16_t addx = 1, addy = 1;
|
int16_t addx = 1, addy = 1;
|
||||||
int16_t P, diff;
|
int16_t P, diff;
|
||||||
|
@ -314,6 +321,7 @@ void lcdDrawLine(uint16_t x0, uint16_t y0, uint16_t x1, uint16_t y1, uint16_t co
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
uint16_t lcdDrawChar(uint16_t cx, uint16_t cy, char c, font_t font, uint16_t color, uint16_t bkcolor, bool_t tpText) {
|
uint16_t lcdDrawChar(uint16_t cx, uint16_t cy, char c, font_t font, uint16_t color, uint16_t bkcolor, bool_t tpText) {
|
||||||
/* Working pointer */
|
/* Working pointer */
|
||||||
|
|
Loading…
Add table
Reference in a new issue