1
0
mirror of git://projects.qi-hardware.com/antorcha.git synced 2024-11-01 05:15:20 +02:00

tools/: add cross-compilation for the Ben NanoNote

This uses the OpenWRT toolchain. It creates a static executable that will
also run on JLime. Graphical output is disabled so far.
This commit is contained in:
Werner Almesberger 2012-06-29 15:25:35 -03:00
parent 65fbf733c3
commit 28a3689672
2 changed files with 20 additions and 5 deletions

View File

@ -16,16 +16,22 @@ MAIN = antorcha
CFLAGS = -g -I../fw -I../../ben-wpan/tools/include \
-I../../ben-wpan/atusb/fw/include \
-Wall \
$(shell sdl-config --cflags)
LDLIBS = -L../../ben-wpan/tools/lib -latrf -lusb \
$(shell sdl-config --libs) -lSDL_gfx
$(if $(NOGFX),, -DGFX $(shell sdl-config --cflags)) \
$(if $(BEN), -static)
OBJS = antorcha.o hash.o plot.o
LDLIBS = -L../../ben-wpan/tools/lib -latrf \
$(if $(NOGFX),, $(shell sdl-config --libs) -lSDL_gfx) \
$(if $(BEN),, -usb)
.PHONY: all update ping off
OBJS = antorcha.o hash.o $(if $(NOGFX),, plot.o)
.PHONY: all ben update ping off
all: $(MAIN)
ben:
$(MAKE) NOGFX=y BEN=y CC=mipsel-openwrt-linux-gcc
$(MAIN): $(OBJS)
$(CC) $(CFLAGS) -o $@ $(OBJS) $(LDLIBS)

View File

@ -437,9 +437,12 @@ static void samples(struct atrf_dsc *dsc, int gui)
buf[0] = 1;
packet(dsc, SAMPLE, 0, 0, buf, PAYLOAD);
#ifdef GFX
if (gui)
plot_init();
else
#endif
signal(SIGINT, sigint);
while (run) {
got = rf_recv(dsc, buf, sizeof(buf));
@ -475,11 +478,15 @@ static void samples(struct atrf_dsc *dsc, int gui)
if (!gui)
printf("%11.6f\t%d\n", t, y);
#ifdef GFX
if (gui && !plot(x, y))
goto quit;
#endif
}
}
#ifdef GFX
quit:
#endif
buf[0] = 0;
packet(dsc, SAMPLE, 0, 0, buf, PAYLOAD);
}
@ -513,7 +520,9 @@ static void usage(const char *name)
" -P ping (version query)\n"
" -R reset\n"
" -S sample with output on stdout. Exit with ^C.\n"
#ifdef GFX
" -S -S sample with graphical output. Exit with Q.\n\n"
#endif
"Parameters:\n"
, name, "", name, "", name, "", name, "", name);
for (m = map; m->name; m++)