Merge branch 'master' of github.com:r0ket/r0ket

This commit is contained in:
Stefan `Sec` Zehl 2011-08-04 16:57:57 +02:00
commit 27793d76a5
43 changed files with 127 additions and 32 deletions

View File

@ -180,6 +180,7 @@ struct MENU {
}; };
#define MENU_TIMEOUT (1<<0) #define MENU_TIMEOUT (1<<0)
#define MENU_JUSTONCE (1<<1)
extern uint8_t menuflags; extern uint8_t menuflags;

View File

@ -68,6 +68,10 @@ void handleMenu(const struct MENU *the_menu) {
case BTN_RIGHT: case BTN_RIGHT:
if (the_menu->entries[menuselection].callback!=NULL) if (the_menu->entries[menuselection].callback!=NULL)
the_menu->entries[menuselection].callback(); the_menu->entries[menuselection].callback();
if (menuflags&MENU_JUSTONCE)
return;
break; break;
case BTN_ENTER: case BTN_ENTER:
lcdClear(); lcdClear();
@ -77,6 +81,10 @@ void handleMenu(const struct MENU *the_menu) {
if (the_menu->entries[menuselection].callback!=NULL) if (the_menu->entries[menuselection].callback!=NULL)
the_menu->entries[menuselection].callback(); the_menu->entries[menuselection].callback();
lcdRefresh(); lcdRefresh();
if (menuflags&MENU_JUSTONCE)
return;
getInputWait(); getInputWait();
break; break;

53
firmware/l0dable/1boot.c Normal file
View File

@ -0,0 +1,53 @@
#include <sysinit.h>
#include "basic/basic.h"
#include "basic/config.h"
#include "lcd/print.h"
#include "usetable.h"
static void set_privacy();
static void privacy0();
static void privacy1();
static void privacy2();
static const char levels[][12] = {"0-trackable","1-mesh only","2-RF OFF"};
static const struct MENU submenu_privacy={ "Privacy?", {
{ levels[0], &privacy0},
{ levels[1], &privacy1},
{ levels[2], &privacy2},
{NULL,NULL}
}};
void ram(void){
// check privacy
menuflags|=MENU_JUSTONCE;
if ((GLOBAL(privacy)!=3)) { //TODO Change!
handleMenu(&submenu_privacy);
}
menuflags&= (~MENU_JUSTONCE);
};
static void privacy0() {
set_privacy(0);
}
static void privacy1() {
set_privacy(1);
}
static void privacy2() {
set_privacy(2);
}
static void set_privacy(int level) {
lcdClear();
lcdPrintln("Privacy:");
lcdPrintln(levels[level]);
lcdRefresh();
getInput();
GLOBAL(privacy) = level;
}

View File

@ -3,6 +3,8 @@ all : tui gui
.PHONY : tui gui tui-core clean .PHONY : tui gui tui-core clean
tui-core : tui-core :
$(MAKE) -C ../firmware/l0dable usetable.h
cd ..; $(SHELL) simulat0r/bin/update-bridge-files.sh
$(MAKE) -C firmware $(MAKE) -C firmware
$(MAKE) -C simcore $(MAKE) -C simcore
$(MAKE) -C tui $(MAKE) -C tui

View File

@ -22,7 +22,7 @@ fi
done done
echo "Updating bridge files for C source" echo "Updating bridge files for C source"
for i in `find firmware/ \! -path firmware/lcd/allfonts.h -type f -iname \*.[ch]` for i in `find firmware/ \! -path firmware/lcd/allfonts.h \! -path firmware/l0dable/usetable.h -type f -iname \*.[ch]`
do do
if test -f simulat0r/$i; if test -f simulat0r/$i;
then then
@ -45,10 +45,13 @@ do
fi fi
done done
if cmp firmware/.gitignore simulat0r/firmware/.gitignore;
for i in `find firmware -type f -name .gitignore`; do
if cmp $i simulat0r/$i
then then
echo OK .gitignore is the same in firmware/ and simulat0r/firmware echo OK $i and simulat0r/$i are the same
else else
echo WARNING: .gitignore mismatch in firmware/ and simulat0r/firmware echo WARNING: $i mismatches simulat0r/$i
diff -y firmware/.gitignore simulat0r/firmware/.gitignore diff -y $i simulat0r/$i
fi fi
done

View File

@ -4,3 +4,5 @@ lpc1xxx/memory.ld
applications/wrapper.c applications/wrapper.c
lcd/allfonts.h lcd/allfonts.h
Makefile.dep Makefile.dep
table.c
table.h

View File

@ -0,0 +1 @@
*.gen

View File

@ -1,2 +0,0 @@
/* AUTOGENERATED SOURCE FILE */
#include "../../../firmware/applications/executor.c"

View File

@ -0,0 +1,2 @@
/* AUTOGENERATED SOURCE FILE */
#include "../../../firmware/applications/final.c"

View File

@ -0,0 +1,2 @@
/* AUTOGENERATED SOURCE FILE */
#include "../../../../firmware/applications/final/beacon.c"

View File

@ -0,0 +1,2 @@
/* AUTOGENERATED SOURCE FILE */
#include "../../../../firmware/applications/final/config.c"

View File

@ -0,0 +1,2 @@
/* AUTOGENERATED SOURCE FILE */
#include "../../../../firmware/applications/final/exe.c"

View File

@ -0,0 +1,2 @@
/* AUTOGENERATED SOURCE FILE */
#include "../../../../firmware/applications/final/flame.c"

View File

@ -0,0 +1,2 @@
/* AUTOGENERATED SOURCE FILE */
#include "../../../../firmware/applications/final/mesh.c"

View File

@ -0,0 +1,2 @@
/* AUTOGENERATED SOURCE FILE */
#include "../../../../firmware/applications/final/nickname.c"

View File

@ -0,0 +1,2 @@
/* AUTOGENERATED SOURCE FILE */
#include "../../../../firmware/applications/final/util.c"

View File

@ -1,2 +0,0 @@
/* AUTOGENERATED SOURCE FILE */
#include "../../../firmware/applications/funk.c"

View File

@ -0,0 +1,2 @@
/* AUTOGENERATED SOURCE FILE */
#include "../../../firmware/applications/l0dable.c"

View File

@ -1,2 +0,0 @@
/* AUTOGENERATED SOURCE FILE */
#include "../../../firmware/applications/mandelbrot.c"

View File

@ -1,2 +0,0 @@
/* AUTOGENERATED SOURCE FILE */
#include "../../../firmware/applications/mandelbrot2.c"

View File

@ -1 +0,0 @@
#include "../../../firmware/applications/rect.c"

View File

@ -1,2 +0,0 @@
/* AUTOGENERATED SOURCE FILE */
#include "../../../firmware/applications/remote.c"

View File

@ -1,2 +0,0 @@
/* AUTOGENERATED SOURCE FILE */
#include "../../../../firmware/applications/serial/config.c"

View File

@ -1,2 +0,0 @@
/* AUTOGENERATED SOURCE FILE */
#include "../../../../firmware/applications/serial/remote.c"

View File

@ -1,2 +0,0 @@
/* AUTOGENERATED SOURCE FILE */
#include "../../../../firmware/applications/serial/uuid.c"

View File

@ -1,2 +0,0 @@
/* AUTOGENERATED SOURCE FILE */
#include "../../../firmware/applications/spaceinvaders.c"

View File

@ -1,2 +0,0 @@
/* AUTOGENERATED SOURCE FILE */
#include "../../../../firmware/applications/tester/config.c"

View File

@ -1 +0,0 @@
#include "../../../firmware/applications/waldbrand.c"

4
simulat0r/firmware/l0dable/.gitignore vendored Normal file
View File

@ -0,0 +1,4 @@
*.elf
*.bin
usetable.h
loadable.ld

View File

@ -0,0 +1,2 @@
# GENERATED INCLUDE BRIDGE/
include ../../../firmware/l0dable/Makefile

View File

@ -0,0 +1,2 @@
/* AUTOGENERATED SOURCE FILE */
#include "../../../firmware/l0dable/blink.c"

View File

@ -0,0 +1,2 @@
/* AUTOGENERATED SOURCE FILE */
#include "../../../firmware/l0dable/debug.c"

View File

@ -0,0 +1,2 @@
/* AUTOGENERATED SOURCE FILE */
#include "../../../firmware/l0dable/invaders.c"

View File

@ -0,0 +1,2 @@
/* AUTOGENERATED SOURCE FILE */
#include "../../../firmware/l0dable/mandel.c"

View File

@ -0,0 +1,2 @@
/* AUTOGENERATED SOURCE FILE */
#include "../../../firmware/l0dable/recvcard.c"

View File

@ -0,0 +1,2 @@
/* AUTOGENERATED SOURCE FILE */
#include "../../../firmware/l0dable/sendcard.c"

View File

@ -0,0 +1,4 @@
*.elf
*.bin
*.h
loadable.ld

View File

@ -1,2 +0,0 @@
/* AUTOGENERATED SOURCE FILE */
#include "../../../firmware/loadable/blinktest2.c"

View File

@ -0,0 +1,2 @@
/* AUTOGENERATED SOURCE FILE */
#include "../../../firmware/loadable/mandelbrot.c"

View File

@ -0,0 +1,2 @@
/* AUTOGENERATED SOURCE FILE */
#include "../../../firmware/loadable/recvcard.c"

View File

@ -0,0 +1,2 @@
/* AUTOGENERATED SOURCE FILE */
#include "../../../firmware/loadable/sendcard.c"

View File

@ -37,6 +37,7 @@ set(FIRMWARE_OBJS
../simcore/simcore.o ../simcore/simcore.o
../simcore/misc.o ../simcore/misc.o
../simcore/timecounter.o ../simcore/timecounter.o
../firmware/table.o
) )

View File

@ -24,6 +24,8 @@ LIBS += ../firmware/basic/libbasic.a
OBJS+=../simcore/simcore.o ../simcore/misc.o ../simcore/timecounter.o OBJS+=../simcore/simcore.o ../simcore/misc.o ../simcore/timecounter.o
OBJS += ../firmware/table.o
OBJS += simulat0r.o OBJS += simulat0r.o
.PHONY : all .PHONY : all