crashtest-r0ket/firmware/applications/scroll.c

62 lines
1.1 KiB
C
Raw Permalink Normal View History

2011-07-19 00:43:15 +00:00
#include <sysinit.h>
#include "basic/basic.h"
#include "lcd/render.h"
#include "lcd/display.h"
#include "lcd/allfonts.h"
2011-07-21 20:32:48 +00:00
#include "lcd/print.h"
2011-07-19 00:43:15 +00:00
void backlightInit(void);
/**************************************************************************/
void main_scroll(void) {
int dx=0;
char key;
backlightInit();
2011-07-21 20:32:48 +00:00
bool wrap=true;
int ctr=0;
2011-07-19 00:43:15 +00:00
font=&Font_7x8;
dx=DoString(0,0,"Hello World");
while (1) {
lcdDisplay();
//// delayms(10);
2011-07-21 18:02:44 +00:00
key= getInputRaw();
2011-07-19 00:43:15 +00:00
// Easy flashing
2011-07-21 20:32:48 +00:00
if((key&(BTN_ENTER|BTN_LEFT))==(BTN_ENTER|BTN_LEFT)){
2011-07-19 00:43:15 +00:00
DoString(0,8,"Enter ISP!");
lcdDisplay();
ISPandReset();
}
2011-07-21 20:32:48 +00:00
if(key&BTN_ENTER){
lcdPrintInt(ctr++);
lcdPrintln(".");
while(getInputRaw())delayms(10);
};
2011-07-21 18:02:44 +00:00
if(key&BTN_RIGHT){
2011-07-21 20:32:48 +00:00
lcdShift(1,0,wrap);
2011-07-19 00:43:15 +00:00
}
2011-07-21 18:02:44 +00:00
if(key&BTN_LEFT){
2011-07-21 20:32:48 +00:00
lcdShift(-1,0,wrap);
2011-07-19 00:43:15 +00:00
}
2011-07-21 18:02:44 +00:00
if(key&BTN_UP){
2011-07-21 20:32:48 +00:00
lcdShift(0,1,wrap);
2011-07-19 00:43:15 +00:00
}
2011-07-21 18:02:44 +00:00
if(key&BTN_DOWN){
2011-07-21 20:32:48 +00:00
lcdShift(0,-1,wrap);
2011-07-19 00:43:15 +00:00
}
//font = &Font_Ubuntu36pt;
}
return;
}
void tick_scroll(void){
return;
};