aboutsummaryrefslogtreecommitdiffstats
path: root/glcd.c
diff options
context:
space:
mode:
authorTectu <joel@unormal.org>2012-05-31 12:12:11 +0200
committerTectu <joel@unormal.org>2012-05-31 12:12:11 +0200
commit976ab0ffd5b2344354e3432b1cdec5566ff332c0 (patch)
tree10e0f39a126c07e16e4d012d88524641644af4d7 /glcd.c
parent045cc3cac75c7dcd0be8343cdd53c10610271eb0 (diff)
downloaduGFX-976ab0ffd5b2344354e3432b1cdec5566ff332c0.tar.gz
uGFX-976ab0ffd5b2344354e3432b1cdec5566ff332c0.tar.bz2
uGFX-976ab0ffd5b2344354e3432b1cdec5566ff332c0.zip
clean up
Diffstat (limited to 'glcd.c')
-rwxr-xr-xglcd.c44
1 files changed, 20 insertions, 24 deletions
diff --git a/glcd.c b/glcd.c
index b7104ba8..d98364eb 100755
--- a/glcd.c
+++ b/glcd.c
@@ -253,44 +253,40 @@ void lcdDrawLine(uint16_t x1, uint16_t y1, uint16_t x2, uint16_t y2, uint16_t co
}
void lcdDrawChar(uint16_t x, uint16_t y, unsigned char c, uint16_t charcolor, uint16_t bkcolor) {
- uint16_t i = 0;
- uint16_t j = 0;
- unsigned char buffer[16];
- unsigned char tmp_char=0;
- GetASCIICode(buffer,c);
- for (i=0;i<16;i++)
- {
- tmp_char=buffer[i];
- for (j=0;j<8;j++)
- {
- if (((tmp_char >> (7-j)) & 0x01) == 0x01)
- {
- lcdDrawPixel(x+j,y+i,charcolor);
- }
- else
- {
- lcdDrawPixel(x+j,y+i,bkcolor);
- }
- }
- }
+ uint16_t i = 0;
+ uint16_t j = 0;
+ unsigned char buffer[16];
+ unsigned char tmp_char=0;
+
+ GetASCIICode(buffer,c);
+
+ for (i=0;i<16;i++) {
+ tmp_char=buffer[i];
+ for (j=0;j<8;j++) {
+ if (((tmp_char >> (7-j)) & 0x01) == 0x01)
+ lcdDrawPixel(x+j,y+i,charcolor);
+ else
+ lcdDrawPixel(x+j,y+i,bkcolor);
+ }
+ }
}
void lcdDrawString(uint16_t x, uint16_t y, uint8_t *str, uint16_t color, uint16_t bkcolor) {
uint8_t TempChar;
do {
- TempChar=*str++;
+ TempChar = *str++;
lcdDrawChar(x,y,TempChar,color,bkcolor);
- if (x<232) {
+ if(x<232) {
x+=8;
- } else if (y<304) {
+ } else if(y<304) {
x=0;
y+=16;
} else {
x=0;
y=0;
}
- } while (*str!=0);
+ } while(*str != 0);
}
uint16_t lcdBGR2RGB(uint16_t color) {