From de02a6ccbc13fa24f063c1e0c86d3878647981dc Mon Sep 17 00:00:00 2001 From: Stefan `Sec` Zehl Date: Thu, 11 Aug 2011 09:25:19 +0200 Subject: [PATCH] Add showlcd l0dable given to me late at night --- firmware/l0dable/showlcd.c | 67 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 67 insertions(+) create mode 100644 firmware/l0dable/showlcd.c diff --git a/firmware/l0dable/showlcd.c b/firmware/l0dable/showlcd.c new file mode 100644 index 0000000..fc6b72a --- /dev/null +++ b/firmware/l0dable/showlcd.c @@ -0,0 +1,67 @@ +#include + +#include "basic/basic.h" +#include "lcd/lcd.h" +#include "lcd/print.h" +#include "filesystem/ff.h" + +#include "usetable.h" + +//shows *.lcd +void ram(void) +{ + char filename[13]; + char key; + int i=500; + + // Image or Animation? + lcdClear(); + lcdPrintln("Image | Anim?"); + lcdPrintln("Up=Image"); + lcdPrintln("Down=Anim"); + lcdRefresh(); + key = getInputWait(); + delayms(230); + + // Show file + if( key == BTN_DOWN ){ + // Choose animation speed + while ( key != BTN_ENTER ){ + lcdClear(); + lcdPrintln("Choose speed:"); + lcdPrintln(""); + lcdPrint(" "); + lcdPrint(IntToStr(i,5,0)); + lcdPrintln("ms"); + lcdRefresh(); + key = getInputWait(); + if ( key == BTN_UP ){ + if ( i < 60000 ) + i+=10; + } else if ( key == BTN_DOWN ){ + if ( i > 10 ) + i-=10; + } + delayms(100); + } + // Select file + lcdClear(); + delayms(230); + selectFile(filename,"LCD"); + // Load as animation + lcdShowAnim(filename, i); + } else if ( key == BTN_UP ){ + // Select file + lcdClear(); + delayms(230); + selectFile(filename,"LCD"); + // Load as image + lcdLoadImage(filename); + lcdRefresh(); + } else { + // Exit + return; + } + getInputWait(); +} +