From 345bae9e203cdff2c976eeac53e376d3cec03efd Mon Sep 17 00:00:00 2001 From: schneider Date: Wed, 10 Aug 2011 13:43:02 +0200 Subject: [PATCH] added showcard source --- firmware/l0dable/showcard.c | 70 +++++++++++++++++++++++++++++++++++++ 1 file changed, 70 insertions(+) create mode 100644 firmware/l0dable/showcard.c diff --git a/firmware/l0dable/showcard.c b/firmware/l0dable/showcard.c new file mode 100644 index 0000000..a2d2a56 --- /dev/null +++ b/firmware/l0dable/showcard.c @@ -0,0 +1,70 @@ +#include "filesystem/ff.h" +#include +#include "usetable.h" + +#define MAXSIZE 1024 + +//shows vcards +void ram(void) +{ + char filename[13]; + uint8_t buf[MAXSIZE]; + FRESULT res; + UINT readbytes; + FIL file; + uint8_t key; + int i,j=0,lines=0; + char *beginline=buf; + char help; + + selectFile(filename,"CRD"); + lcdClear(); + res=f_open(&file, (const char*)filename, FA_OPEN_EXISTING|FA_READ); + res=f_read(&file, (char *)buf, MAXSIZE, &readbytes); + for(i=0;i13) + { + help=buf[i]; + j=0; + buf[i]=0; + lcdPrintln(beginline); + beginline=&buf[i]; + buf[i]=help; + lines++; + } + j++; + + } + lcdRefresh(); + while (1) + { + key = getInput(); + if( key == BTN_LEFT ){ + break; + } + } + +} +