Merge git://github.com/r0ket/r0ket

This commit is contained in:
bernd 2011-08-05 00:58:13 +02:00
commit 7f373d8a88
10 changed files with 51 additions and 9 deletions

View File

@ -5,6 +5,7 @@
#include "lcd/lcd.h"
#include "lcd/fonts/smallfonts.h"
#include "lcd/print.h"
#include "lcd/image.h"
#include "filesystem/ff.h"
#include "usb/usbmsc.h"
#include "basic/random.h"
@ -15,7 +16,12 @@
void main_default(void) {
systickInit(SYSTICKSPEED);
switch(getInputRaw()){
//show bootscreen
lcdClear();
lcdLoadImage("r0ket.lcd");
lcdRefresh();
switch(getInputRaw()){
case BTN_ENTER:
ISPandReset();
break;

View File

@ -18,7 +18,8 @@ void init_nick();
void fancyNickname();
void main_final(void) {
if(GLOBAL(privacy)>2){ //firstboot
init_nick();
if(GLOBAL(privacy)>2){ //firstboot
if(execute_file("1boot.int",0,0)){
lcdPrintln("Badge SETUP");
lcdPrintln("error.");

View File

@ -54,7 +54,7 @@ uint8_t getInputWaitTimeout(int timeout) {
uint8_t key;
if(timeout==0)
return getInputWait();
int end=_timectr+timeout*(1000/SYSTICKSPEED);
int end=_timectr+timeout/SYSTICKSPEED;
while ((key=getInputRaw())==BTN_NONE){
if(_timectr>end)
break;

View File

@ -46,7 +46,7 @@ void handleMenu(const struct MENU *the_menu) {
}
lcdRefresh();
switch (getInputWaitTimeout((menuflags&MENU_TIMEOUT)?15:0)) {
switch (getInputWaitTimeout((menuflags&MENU_TIMEOUT)?15000:0)) {
case BTN_UP:
menuselection--;
if (menuselection < current_offset) {

View File

@ -2,3 +2,6 @@
*.bin
usetable.h
loadable.ld
*.nik
*.c0d
*.int

View File

@ -84,3 +84,5 @@ readFile
writeFile
input
saveConfig
lcdShowAnim
lcdLoadImage

View File

@ -5,6 +5,8 @@ SRCS = $(wildcard *.c)
OBJS = $(foreach mod,$(SRCS),$(subst .c,.o,$(mod)))
ELFS = $(foreach mod,$(SRCS),$(subst .c,.elf,$(mod)))
BINS = $(foreach mod,$(SRCS),$(subst .c,.bin,$(mod)))
CODS = $(foreach mod,$(SRCS),$(subst .c,.c0d,$(mod)))
NIKS = $(foreach mod,$(wildcard nick_*.c),$(subst .c,.nik,$(subst nick_,,$(mod))))
##########################################################################
# GNU GCC compiler flags
@ -22,7 +24,10 @@ LDSRCFILE=ram.ld
LDFILE=loadable.ld
CFLAGS+=-mlong-calls -fno-toplevel-reorder
all: $(OBJS) $(ELFS) $(BINS)
CRYPT=cp
CRYPTFLAGS=-p
all: $(OBJS) $(ELFS) $(BINS) $(CODS) $(NIKS) 1boot.int
$(LDFILE):
-@echo "MEMORY" > $(LDFILE)
@ -41,6 +46,15 @@ $(LDFILE):
%.bin: %.elf
$(OBJCOPY) $(OCFLAGS) -O binary $< $@
%.c0d: %.bin
$(CRYPT) $(CRYPTFLAGS) $< $@
%.nik: .PHONY
@a=$@;a=nick_$${a%.nik}.c0d;echo mv $$a $@;mv $$a $@
1boot.int: 1boot.c0d .PHONY
mv $< $@
clean:
rm -f *.o *.elf *.bin usetable.h

View File

@ -127,7 +127,7 @@ static bool screen_intro() {
DoString (0, 9, highnick);
lcdDisplay();
step = !step;
key=getInputWaitTimeout(1);
key=getInputWaitTimeout(1000);
}
return !(key==BTN_LEFT);
}
@ -142,7 +142,7 @@ static bool screen_gameover() {
if (highscore_set(game.score, GLOBAL(nickname)))
DoString (0,9,"HIGHSCORE!");
lcdDisplay();
key=getInputWaitTimeout(5);
key=getInputWaitTimeout(5000);
}
return !(key==BTN_LEFT);
}

View File

@ -0,0 +1,12 @@
#include <sysinit.h>
#include "basic/basic.h"
#include "lcd/lcd.h"
#include "filesystem/ff.h"
#include "usetable.h"
void ram(void) {
char fname[FILENAMELEN];
lcdShowAnim("nick.lcd",1000);
};

View File

@ -34,7 +34,11 @@ uint8_t lcdShowAnim(char *fname, uint32_t framems) {
continue;
};
lcdDisplay();
state=delayms_queue_plus(framems,0);
if(framems<100){
state=delayms_queue_plus(framems,0);
}else{
getInputWaitTimeout(framems);
};
}
if(state)