From de266e50b47d93822356b7c3bbb71c5b49b4f700 Mon Sep 17 00:00:00 2001 From: roy rocket Date: Thu, 11 Aug 2011 06:23:43 +0200 Subject: [PATCH 01/12] user added l0dable snake --- firmware/l0dable/snake.c | 194 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 194 insertions(+) create mode 100644 firmware/l0dable/snake.c diff --git a/firmware/l0dable/snake.c b/firmware/l0dable/snake.c new file mode 100644 index 0000000..9422712 --- /dev/null +++ b/firmware/l0dable/snake.c @@ -0,0 +1,194 @@ +#include +#include "basic/basic.h" +#include "basic/config.h" + +#include "lcd/lcd.h" +#include "lcd/print.h" +#include "usetable.h" + +struct elem +{ + int x,y; +}; + +void reset(struct elem snake[],size_t *snake_size,int *dirc, +int*speed, int*points,int*point_s); +void o_rectangle (int x0, int y0, int width, int height); +struct elem rnd(void); + +#define MAX_SNAKE_LEN (40) +#define SNAKE_DEM (3) +#define MIN_SPEED (25) +#define MAX_SPEED (3) +#define SIZE_X (RESX) +#define SIZE_Y (RESY) + +void ram(void) +{ + int inpt,dirc,c,grows = 0,dx,dy,points,point_s=1; + size_t n = 0, snake_size = 5, speed=MIN_SPEED; + struct elem snake[MAX_SNAKE_LEN], food; + char test[512]; /* scratch space */ + o_init (test, sizeof(test)); + + reset(snake,&snake_size,&dirc,&speed,&points,&point_s); + + food = rnd(); + + while (1) + { + head: + if(!(++c % speed)) + { + + +inpt = getInputRaw(); + +dx=DoString(0,0,IntToStrX(points,2)); + dx=(SIZE_X-dx)/2; + if(dx<0) + dx=0; + dy=(SIZE_Y-getFontHeight())/2; + + lcdFill(255); + o_rectangle(1,0,SIZE_X-2,SIZE_Y-2); + o_set_gray (0); + o_fill (); + + //o_identity (); /* reset tranforms */ + + o_set_gray (50); + + setExtFont("UBUNTU29"); + + lcdSetPixel(1,1,1); + DoString(dx,dy,IntToStrX(points,2)); + + o_set_gray (255); + + + for(n=0;n SIZE_Y/SNAKE_DEM-1 || +t.x > SIZE_X/SNAKE_DEM) + { + reset(snake,&snake_size,&dirc,&speed,&points,&point_s); + goto head; + } + + for(n=0;n MAX_SPEED) --speed; + food = rnd(); + } + } + + if(!grows) + { + for(n=0;n Date: Thu, 11 Aug 2011 09:15:29 +0200 Subject: [PATCH 02/12] Fix initialisation. Somehow l0dables sometimes don't init correctly --- firmware/l0dable/rockets.c | 1 + 1 file changed, 1 insertion(+) diff --git a/firmware/l0dable/rockets.c b/firmware/l0dable/rockets.c index 6eb9c0a..fe291b3 100644 --- a/firmware/l0dable/rockets.c +++ b/firmware/l0dable/rockets.c @@ -27,6 +27,7 @@ void ram (void) int angle; int scale; int velocity = 0; + frame_no=0; while ((inpt = getInputRaw()) != BTN_ENTER) { From 9c5aaf715fbe9d49ba3d4be59415d691f05bfc60 Mon Sep 17 00:00:00 2001 From: Stefan `Sec` Zehl Date: Thu, 11 Aug 2011 09:16:31 +0200 Subject: [PATCH 03/12] Disable some code to save space --- firmware/lcd/o.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/firmware/lcd/o.c b/firmware/lcd/o.c index ceef2f0..b02e526 100644 --- a/firmware/lcd/o.c +++ b/firmware/lcd/o.c @@ -35,7 +35,7 @@ */ #define O_ENABLE_FILL -#define O_ENABLE_STROKE +//#define O_ENABLE_STROKE #define O_ENABLE_USER_SHADER #define O_ENABLE_BW /* pick one ,. */ //#define O_ENABLE_GRAY From d098891476d3dcb3781292286577f1c02047c110 Mon Sep 17 00:00:00 2001 From: Stefan `Sec` Zehl Date: Thu, 11 Aug 2011 09:19:27 +0200 Subject: [PATCH 04/12] Add more fonts --- tools/font/binary/orbit32.f0n | Bin 0 -> 3722 bytes tools/font/binary/soviet26.f0n | Bin 0 -> 1597 bytes tools/font/binary/soviet38.f0n | Bin 0 -> 2641 bytes 3 files changed, 0 insertions(+), 0 deletions(-) create mode 100644 tools/font/binary/orbit32.f0n create mode 100644 tools/font/binary/soviet26.f0n create mode 100644 tools/font/binary/soviet38.f0n diff --git a/tools/font/binary/orbit32.f0n b/tools/font/binary/orbit32.f0n new file mode 100644 index 0000000000000000000000000000000000000000..2563e93aff4920dfdace4cc8d4fdf450e7a9c965 GIT binary patch literal 3722 zcmaJ^du&tJ8P9iPu7iug*N-I5(;>DKirg9DKzQ8lgxF3TawbD!9tAVgIJ6s0T8LrO zwxns3plTCU(k0zLqch6|T8X4t8>p(a8Whu2n^>JE;o8oNbPqZh(bBHl3f*_@kc4iU zj=p;y{?0ky_xoPQu))x@JSmhkniNf%NSaCdJn74%^Mx9^7AZI6In#4Ety-0-Vs#srlg;|f%#CJcn%lQ$Tm6d1Rxk=hu1=Sp zo0h3%x%FJ8CR3Nn6=*ZaE~-C}&gxecKDNfZ-cp#Iv^J0Jt~=GM^|s$gdEC6B-mL6M zzQXun*53(6TPJ+uU7~%5r1ca1WuhO3&MnY-7{2Z5Q@cuu+T~QKT|{j{+KKeB@lO?-=>bFbh|~+6 zf;fC4GI$~u?t+ZB~XRT)IONe}uYL>kn|nc@Che+{e#9!k9E&3s z_@ASN-;!To?=`FE1w82&PgRR0UR2AADthNt_M-Y;gknDxjv+u##0~1&ONBFt;chBi z^@~)7q^%aI&Ms1uO{7Iekvg;@twwr!URB5ro`ZGFD@+T@bcor74Xr9pgB4b>=fm0e z)_AWK*S%ld*b9DinTlbtVkokGAj)URId*!~z)^q9TN|l6Bq7-gMs%}^-Cp4o?Ndj` z5wL&CXGe(HZSonP%Wq!Yo>$^F%$Z=W2xc5G?14}%^dAEO-RT6hz6yb};J*O=i%|U` z*u!;2b^^NPOX+CP2S3>f(k=#;u zb~VX%xHHR0W;xNjh`xfPZFlST6CGU!wn3ty>lLTvnkV57*s9@XwPKcid)TU>MpWOe zr84mM!!ZF`J3(j#Apju{T(!fD4L&n6GA;U90pnyGvLmwl_C!daPdJ_-sg)${uiHu5 zsD!~FM3R5C1frYh=Vd>m!ePJY2v>{t;v(8>FMTC35=sL&2>V6*Z)vZsbchPHN1&(r z>B%cz-#NA?c9)BSrB4I(;17v+DQXbi{B-|$TR8Xvov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?dp4doI7(P$#UKyS$M$R)EhwF zV9yL&xjG}{HfkX~Ot_yDu4EtKwrwX|X$9fzE~Gt#bCf4QmJl!V5U#wMa4tLHDoT-d z5^nnr!c~@_v!_5VO#|(qkK-MPtd4QQds!1#u0^Txy*i~7g8T=H5*GgqC`%p$W!S5H zKRF!xAdFAKEVqgLP?ocedEQVkWhk6weqnfiY3;X%pxzj&iB4CN)Tv4*|A*=&Z-K?f z^$cD#MFoF&8V6K3IuM^otBbX3u{PlIc?#b}D~&YXN_eHEO%b}#YB>;+j(m0y%l J;IFU){{bUC1J(cl literal 0 HcmV?d00001 diff --git a/tools/font/binary/soviet26.f0n b/tools/font/binary/soviet26.f0n new file mode 100644 index 0000000000000000000000000000000000000000..f3e18c6516fb475ae68ace09c52b6caa7ae17075 GIT binary patch literal 1597 zcmZQnRH)-*IKps^;SR%nh9?Z)82&JjHM0w?T%c|IXz zc~&lFE+}A-U}WBAtNAGTa+|FHqY~4#yWel_?LScX{iafF|Jm7$jSNN?8LS0C$mk+W z){^<`%7=IQRIWHgG4E5k;_>j#+y&80%)vLln%;2soho|EF?RjjbK zw;f}rir#eg?GKJ^4rUQ#@l(0|=+do64r$E$bFbgrC!o!eHb!ea=$W)Fdu~353w2ShDSj6uzh4c%WnDbVo9G$aY>(qtz_{9){V@^r_Ym^0Tz)x zc?-yYr#t(R?>*fEQOw6}IUhD(gh+{dUML1iLOcf4Ei2r4!JKs?D_=^V?1|ebGGJ4- z)N(#_hw23j>~k|?5L(E*KRMUk?84@U35;4WS2{$oskvQwAd*}ViwG{}ZKme)#7r&v zlf!-U&3*G^Wpf##8B88B@4k8Y%8j$9oiA;fx#gm_uW}#ArTcVGJaP;3cz7vgE;}&L zp~3I*u(PwWAQ~*|>(YN`?yj524waZOeL9f8cjv=9*B+Vso|Cu(RJ+5Lv-x6w)1^L@ zRG`lwF4sL9r+W3#9oB{LkOal-@jDNDrV$)3ColF>aIa(8X5t?aBNJ32dJ#hR`g zK%C_u_^2TpY{~V#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9ov}&5+VIi}0 z>>LaMWs)QkfSZ(oAgL3&3tU@0iDqK15B9JYicolU&UWt2^j(wa++)%Z5Sa3FO>ce> zD2r%W0IW3*ok@v2Y*q{cX_ZH46o)beYY)$*J8!9}tBE{&)p(+A&iH=ap7Vv3q0S6ScIW=M4?YO5cE2#JrPeA*k7ef zJtWt@mwv;e%d$theU-Ft9l9WWou;n^>F>j|ppSnFE>*)!WqKc;SRR08RIR|lz_pBa zb`&{78W|cMgtBxmK8h-rO)?e(hgp^w0o6q$Y36+_8O8|GuYwX^!xXJ<{Q(R;VgU&QTUOQ!70jS7dMu3 zv0X)*q2`fU{(7BBGk#9fx@(d6%@y&ww8WQ0FREx88;>F6q+wx_eXoZ$ Date: Thu, 11 Aug 2011 09:20:22 +0200 Subject: [PATCH 05/12] ignore the cryptobinary --- tools/.gitignore | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tools/.gitignore b/tools/.gitignore index cc28b98..1b1c77e 100644 --- a/tools/.gitignore +++ b/tools/.gitignore @@ -2,3 +2,5 @@ lpcfix.exe lpcfix xxtea.exe xxtea +generate-keys.exe +generate-keys From 63d3a3687afea0e7dc057d2ef810d6f313405931 Mon Sep 17 00:00:00 2001 From: Stefan `Sec` Zehl Date: Thu, 11 Aug 2011 09:22:22 +0200 Subject: [PATCH 06/12] Remove broken chargeled feature --- firmware/applications/default.c | 2 ++ firmware/basic/config.c | 2 +- firmware/basic/config.h | 1 + 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/firmware/applications/default.c b/firmware/applications/default.c index 0c29759..ea52100 100644 --- a/firmware/applications/default.c +++ b/firmware/applications/default.c @@ -108,6 +108,7 @@ void tick_default(void) { EVERY(50,0){ + /* if(GLOBAL(chargeled)){ IOCON_PIO1_11 = 0x0; gpioSetDir(RB_LED3, gpioDirection_Output); @@ -116,6 +117,7 @@ void tick_default(void) { else gpioSetValue (RB_LED3, 0); }; + */ if(GetVoltage()<3600){ IOCON_PIO1_11 = 0x0; diff --git a/firmware/basic/config.c b/firmware/basic/config.c index e0eba99..6ae9cdc 100644 --- a/firmware/basic/config.c +++ b/firmware/basic/config.c @@ -28,7 +28,7 @@ struct CDESC the_config[]= { {"flamemaxw", 255, 1, 255, 1, CFG_TYPE_FLAME}, {"flameminw", 0x8f, 1, 255, 1, CFG_TYPE_FLAME}, {"l0nick", 0, 0, 1 , 0, 0}, - {"chargeled", 0, 0, 1 , 0, 0}, + {"chargeled", 0, 0, 1 , 0, CFG_TYPE_GONE}, {"positionleds", 0, 0, 1 , 0, 0}, { NULL, 0, 0, 0 , 0, 0}, }; diff --git a/firmware/basic/config.h b/firmware/basic/config.h index e3a678f..299abb7 100644 --- a/firmware/basic/config.h +++ b/firmware/basic/config.h @@ -18,6 +18,7 @@ struct CDESC { #define CFG_TYPE_BASIC 0 #define CFG_TYPE_DEVEL 1 #define CFG_TYPE_FLAME 2 +#define CFG_TYPE_GONE 3 #define MAXNICK 17 extern struct CDESC the_config[]; From 0acd7a78e24b95c5aca1da9fef7073d7d9f8ee44 Mon Sep 17 00:00:00 2001 From: Stefan `Sec` Zehl Date: Thu, 11 Aug 2011 09:22:58 +0200 Subject: [PATCH 07/12] Improve filter support in serial tester app --- firmware/applications/serial/serial.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/firmware/applications/serial/serial.c b/firmware/applications/serial/serial.c index 30ffae2..9e52869 100644 --- a/firmware/applications/serial/serial.c +++ b/firmware/applications/serial/serial.c @@ -415,9 +415,21 @@ static int process(char * input){ puts_plus(" "); puts_plus(IntToStrX( uint8ptouint32(buf+8),8 )); }else if(type=='b'){ - if(filter) + if(filter=='.' || filter=='u') if(uint8ptouint32(buf+8)!=uint8ptouint32(filterdata)) continue; + if(filter=='0' && buf[3] != 0x00) + continue; + if(filter=='5' && buf[3] != 0x55) + continue; + if(filter=='a' && buf[3] != 0xaa) + continue; + if(filter=='A' && buf[3] != 0xaa) + continue; + if(filter=='f' && buf[3] != 0xff) + continue; + if(filter=='F' && buf[3] != 0xff) + continue; puts_plus("R "); puts_plus(IntToStrX( buf[0],2 )); puts_plus(" "); From de02a6ccbc13fa24f063c1e0c86d3878647981dc Mon Sep 17 00:00:00 2001 From: Stefan `Sec` Zehl Date: Thu, 11 Aug 2011 09:25:19 +0200 Subject: [PATCH 08/12] 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(); +} + From 35f875eb6cd80f057c5dba0d811a8b957bb95e1d Mon Sep 17 00:00:00 2001 From: Stefan `Sec` Zehl Date: Thu, 11 Aug 2011 10:16:55 +0200 Subject: [PATCH 09/12] add support for crypting l0dables in Makefile --- firmware/l0dable/Makefile | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/firmware/l0dable/Makefile b/firmware/l0dable/Makefile index 121c4f5..dfffde4 100644 --- a/firmware/l0dable/Makefile +++ b/firmware/l0dable/Makefile @@ -24,9 +24,13 @@ LDSRCFILE=ram.ld LDFILE=loadable.ld CFLAGS+=-mlong-calls -fno-toplevel-reorder -CRYPT=cp +DOCRYPT=0 +CRYPT=../../tools/crypto/xxtea CRYPTFLAGS=-p +skey=`cd .. && ./getkey.pl l0dable_sign` +ekey=`cd .. && ./getkey.pl l0dable_crypt` + all: $(OBJS) $(ELFS) $(BINS) $(CODS) $(NIKS) 1boot.int debug.int $(LDFILE): @@ -47,7 +51,13 @@ $(LDFILE): $(OBJCOPY) $(OCFLAGS) -O binary $< $@ %.c0d: %.bin - $(CRYPT) $(CRYPTFLAGS) $< $@ +ifeq "$(DOCRYPT)" "1" + $(CRYPT) -e -k $(ekey) -o $<.tmp $< + $(CRYPT) -s -k $(skey) -o $@ $<.tmp + rm -f $<.tmp +else + cp $< $@ +endif %.nik: .PHONY @a=$@;a=nick_$${a%.nik}.c0d;echo mv $$a $@;mv $$a $@ From 3bf8d5f903201ba786a1ccb01693c1a9ed973e34 Mon Sep 17 00:00:00 2001 From: Stefan `Sec` Zehl Date: Thu, 11 Aug 2011 10:26:25 +0200 Subject: [PATCH 10/12] Sorry. Can't get it to fit for now, so disable graphics lib This does brak the rokets l0dable. Will try to fix this after the camp --- firmware/l0dable/EXPORTS | 22 +++++++++---------- .../l0dable/{rockets.c => rockets.c.disabled} | 0 2 files changed, 11 insertions(+), 11 deletions(-) rename firmware/l0dable/{rockets.c => rockets.c.disabled} (100%) diff --git a/firmware/l0dable/EXPORTS b/firmware/l0dable/EXPORTS index 42a8b76..d4936d2 100644 --- a/firmware/l0dable/EXPORTS +++ b/firmware/l0dable/EXPORTS @@ -104,14 +104,14 @@ systickGetTicks uint32touint8p uint8ptouint32 #Add stuff here -o_init -o_path_new -o_move_to -o_line_to -o_curve_to -o_close -o_set_gray -o_fill -o_set_shader -o_identity -o_transform +#o_init +#o_path_new +#o_move_to +#o_line_to +#o_curve_to +#o_close +#o_set_gray +#o_fill +#o_set_shader +#o_identity +#o_transform diff --git a/firmware/l0dable/rockets.c b/firmware/l0dable/rockets.c.disabled similarity index 100% rename from firmware/l0dable/rockets.c rename to firmware/l0dable/rockets.c.disabled From 83e3ad20b9a34f7a8e1d6b4c0cc326d53d8be62f Mon Sep 17 00:00:00 2001 From: Stefan `Sec` Zehl Date: Thu, 11 Aug 2011 12:35:09 +0200 Subject: [PATCH 11/12] Updates --- firmware/l0dable/leiwand.c | 69 +++++++++++++++++++++----------------- 1 file changed, 39 insertions(+), 30 deletions(-) diff --git a/firmware/l0dable/leiwand.c b/firmware/l0dable/leiwand.c index a88768d..ff0df5d 100644 --- a/firmware/l0dable/leiwand.c +++ b/firmware/l0dable/leiwand.c @@ -10,10 +10,10 @@ #include "usetable.h" -//void backlightInit(void); void incBacklight(void); void decBacklight(void); void paintLogo(bool); +void leiwandInit(void); void leiwandDisplay(void); /**************************************************************************/ @@ -22,6 +22,7 @@ void leiwandDisplay(void); void ram(void) { int key; + leiwandInit(); while (1) { leiwandDisplay(); // Exit on enter+left @@ -32,14 +33,6 @@ void ram(void) { return; } -void leiwandInit(void) { - paintLogo(false); - delayms(200); - DoString(0,0,"Boot..."); - lcdDisplay(); - delayms(1000); -} - void leiwandDisplay(void) { int dx=0; char key = 0; @@ -114,6 +107,8 @@ void leiwandDisplay(void) { round++; if(round > 200) { round = 0; + gpioSetValue (RB_LED0, CFG_LED_OFF); + gpioSetValue (RB_LED2, CFG_LED_OFF); if(demoround == 1) { paintLogo(true); } else { @@ -173,42 +168,56 @@ void leiwandDisplay(void) { } else { dx=DoString(0, 60, " phone booth "); if((round % 6) < 3) { + gpioSetValue (RB_LED0, CFG_LED_ON); + gpioSetValue (RB_LED2, CFG_LED_ON); for(i = 0; i < 96; i++) { for(j = 0; j < 8; j++) { lcdSetPixel(i, j+60, !lcdGetPixel(i, j+60)); } } + } else { + gpioSetValue (RB_LED0, CFG_LED_OFF); + gpioSetValue (RB_LED2, CFG_LED_OFF); } } - /* - if(key&BTN_ENTER){ - lcdPrintInt(ctr++); - lcdPrintln("."); - while(getInputRaw())delayms(10); - }; - if(key&BTN_RIGHT){ - lcdShift(1,0,wrap); - } - if(key&BTN_LEFT){ - lcdShift(-1,0,wrap); - } - if(key&BTN_UP){ - lcdShift(0,1,wrap); - } - if(key&BTN_DOWN){ - lcdShift(0,-1,wrap); - } - */ - - //font = &Font_Ubuntu36pt; } return; } +#define cfg_size (2 << 14) void tick_scroll(void){ return; }; +void leiwandInit(void) { + char *delimeter = (char *)0; + char readbuffer[15]; + char cfgfile[] = "leiwand.cfg"; + gpioSetValue (RB_LED0, CFG_LED_ON); + gpioSetValue (RB_LED2, CFG_LED_OFF); + gpioSetValue (RB_LED3, CFG_LED_OFF); + paintLogo(false); + delayms(200); + gpioSetValue (RB_LED0, CFG_LED_OFF); + gpioSetValue (RB_LED2, CFG_LED_ON); + DoString(0,0,"Loading"); + lcdDisplay(); + delayms(1000); + gpioSetValue (RB_LED2, CFG_LED_OFF); + gpioSetValue (RB_LED3, CFG_LED_ON); + paintLogo(false); + DoString(0,0,"Decrunching"); + lcdDisplay(); + // Init config file + if (readFile(cfgfile, readbuffer, 15) == -1) { + writeFile(cfgfile, delimeter, cfg_size); + } + delayms(1000); + gpioSetValue (RB_LED0, CFG_LED_OFF); + gpioSetValue (RB_LED2, CFG_LED_OFF); + gpioSetValue (RB_LED3, CFG_LED_OFF); +} + void incBacklight(void) { /* uint32_t brightness = backlightGetBrightness(); From a0ebf87a4c80aee945b7e701a382b42729271766 Mon Sep 17 00:00:00 2001 From: Stefan `Sec` Zehl Date: Thu, 11 Aug 2011 15:59:17 +0200 Subject: [PATCH 12/12] Revert "Updates" This reverts commit 83e3ad20b9a34f7a8e1d6b4c0cc326d53d8be62f. remove hacking --- firmware/l0dable/leiwand.c | 69 +++++++++++++++++--------------------- 1 file changed, 30 insertions(+), 39 deletions(-) diff --git a/firmware/l0dable/leiwand.c b/firmware/l0dable/leiwand.c index ff0df5d..a88768d 100644 --- a/firmware/l0dable/leiwand.c +++ b/firmware/l0dable/leiwand.c @@ -10,10 +10,10 @@ #include "usetable.h" +//void backlightInit(void); void incBacklight(void); void decBacklight(void); void paintLogo(bool); -void leiwandInit(void); void leiwandDisplay(void); /**************************************************************************/ @@ -22,7 +22,6 @@ void leiwandDisplay(void); void ram(void) { int key; - leiwandInit(); while (1) { leiwandDisplay(); // Exit on enter+left @@ -33,6 +32,14 @@ void ram(void) { return; } +void leiwandInit(void) { + paintLogo(false); + delayms(200); + DoString(0,0,"Boot..."); + lcdDisplay(); + delayms(1000); +} + void leiwandDisplay(void) { int dx=0; char key = 0; @@ -107,8 +114,6 @@ void leiwandDisplay(void) { round++; if(round > 200) { round = 0; - gpioSetValue (RB_LED0, CFG_LED_OFF); - gpioSetValue (RB_LED2, CFG_LED_OFF); if(demoround == 1) { paintLogo(true); } else { @@ -168,56 +173,42 @@ void leiwandDisplay(void) { } else { dx=DoString(0, 60, " phone booth "); if((round % 6) < 3) { - gpioSetValue (RB_LED0, CFG_LED_ON); - gpioSetValue (RB_LED2, CFG_LED_ON); for(i = 0; i < 96; i++) { for(j = 0; j < 8; j++) { lcdSetPixel(i, j+60, !lcdGetPixel(i, j+60)); } } - } else { - gpioSetValue (RB_LED0, CFG_LED_OFF); - gpioSetValue (RB_LED2, CFG_LED_OFF); } } + /* + if(key&BTN_ENTER){ + lcdPrintInt(ctr++); + lcdPrintln("."); + while(getInputRaw())delayms(10); + }; + if(key&BTN_RIGHT){ + lcdShift(1,0,wrap); + } + if(key&BTN_LEFT){ + lcdShift(-1,0,wrap); + } + if(key&BTN_UP){ + lcdShift(0,1,wrap); + } + if(key&BTN_DOWN){ + lcdShift(0,-1,wrap); + } + */ + + //font = &Font_Ubuntu36pt; } return; } -#define cfg_size (2 << 14) void tick_scroll(void){ return; }; -void leiwandInit(void) { - char *delimeter = (char *)0; - char readbuffer[15]; - char cfgfile[] = "leiwand.cfg"; - gpioSetValue (RB_LED0, CFG_LED_ON); - gpioSetValue (RB_LED2, CFG_LED_OFF); - gpioSetValue (RB_LED3, CFG_LED_OFF); - paintLogo(false); - delayms(200); - gpioSetValue (RB_LED0, CFG_LED_OFF); - gpioSetValue (RB_LED2, CFG_LED_ON); - DoString(0,0,"Loading"); - lcdDisplay(); - delayms(1000); - gpioSetValue (RB_LED2, CFG_LED_OFF); - gpioSetValue (RB_LED3, CFG_LED_ON); - paintLogo(false); - DoString(0,0,"Decrunching"); - lcdDisplay(); - // Init config file - if (readFile(cfgfile, readbuffer, 15) == -1) { - writeFile(cfgfile, delimeter, cfg_size); - } - delayms(1000); - gpioSetValue (RB_LED0, CFG_LED_OFF); - gpioSetValue (RB_LED2, CFG_LED_OFF); - gpioSetValue (RB_LED3, CFG_LED_OFF); -} - void incBacklight(void) { /* uint32_t brightness = backlightGetBrightness();