From 89e430de97f0bd97b58b3db0392185474963cae4 Mon Sep 17 00:00:00 2001 From: Stefan `Sec` Zehl Date: Thu, 21 Jul 2011 22:32:48 +0200 Subject: [PATCH] Add more code to test scrolling --- firmware/applications/scroll.c | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/firmware/applications/scroll.c b/firmware/applications/scroll.c index 2499b25..4217a7c 100644 --- a/firmware/applications/scroll.c +++ b/firmware/applications/scroll.c @@ -5,6 +5,7 @@ #include "lcd/render.h" #include "lcd/display.h" #include "lcd/allfonts.h" +#include "lcd/print.h" void backlightInit(void); @@ -14,6 +15,8 @@ void main_scroll(void) { int dx=0; char key; backlightInit(); + bool wrap=true; + int ctr=0; font=&Font_7x8; dx=DoString(0,0,"Hello World"); @@ -25,22 +28,27 @@ void main_scroll(void) { key= getInputRaw(); // Easy flashing - if(key&BTN_ENTER){ + if((key&(BTN_ENTER|BTN_LEFT))==(BTN_ENTER|BTN_LEFT)){ DoString(0,8,"Enter ISP!"); lcdDisplay(); ISPandReset(); } + if(key&BTN_ENTER){ + lcdPrintInt(ctr++); + lcdPrintln("."); + while(getInputRaw())delayms(10); + }; if(key&BTN_RIGHT){ - lcdShift(1,0,true); + lcdShift(1,0,wrap); } if(key&BTN_LEFT){ - lcdShift(-1,0,true); + lcdShift(-1,0,wrap); } if(key&BTN_UP){ - lcdShift(0,1,true); + lcdShift(0,1,wrap); } if(key&BTN_DOWN){ - lcdShift(0,-1,true); + lcdShift(0,-1,wrap); } //font = &Font_Ubuntu36pt;