Add scrolling to lcdPrint() & co.

This commit is contained in:
Stefan `Sec` Zehl 2011-07-21 22:31:26 +02:00
parent c69431c085
commit bb3dc0044c
1 changed files with 12 additions and 0 deletions

View File

@ -6,7 +6,15 @@
int x=0; int x=0;
int y=0; int y=0;
void checkScroll(void){
if(y+font->u8Height>RESY){
lcdShift(0,y+font->u8Height-RESY,false);
y=RESY-font->u8Height;
};
};
void lcdPrint(const char *string){ void lcdPrint(const char *string){
checkScroll();
x=DoString(x,y,string); x=DoString(x,y,string);
}; };
@ -20,18 +28,22 @@ void lcdPrintln(const char *string){
}; };
void lcdPrintInt(const int num){ void lcdPrintInt(const int num){
checkScroll();
x=DoInt(x,y,num); x=DoInt(x,y,num);
}; };
void lcdPrintIntHex(const int num){ void lcdPrintIntHex(const int num){
checkScroll();
x=DoIntX(x,y,num); x=DoIntX(x,y,num);
}; };
void lcdPrintCharHex(const uint8_t num){ void lcdPrintCharHex(const uint8_t num){
checkScroll();
x=DoCharX(x,y,num); x=DoCharX(x,y,num);
}; };
void lcdPrintShortHex(const uint16_t num){ void lcdPrintShortHex(const uint16_t num){
checkScroll();
x=DoShortX(x,y,num); x=DoShortX(x,y,num);
}; };