mirror of
git://projects.qi-hardware.com/antorcha.git
synced 2024-11-22 20:18:27 +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:
parent
65fbf733c3
commit
28a3689672
@ -16,16 +16,22 @@ MAIN = antorcha
|
|||||||
CFLAGS = -g -I../fw -I../../ben-wpan/tools/include \
|
CFLAGS = -g -I../fw -I../../ben-wpan/tools/include \
|
||||||
-I../../ben-wpan/atusb/fw/include \
|
-I../../ben-wpan/atusb/fw/include \
|
||||||
-Wall \
|
-Wall \
|
||||||
$(shell sdl-config --cflags)
|
$(if $(NOGFX),, -DGFX $(shell sdl-config --cflags)) \
|
||||||
LDLIBS = -L../../ben-wpan/tools/lib -latrf -lusb \
|
$(if $(BEN), -static)
|
||||||
$(shell sdl-config --libs) -lSDL_gfx
|
|
||||||
|
|
||||||
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)
|
all: $(MAIN)
|
||||||
|
|
||||||
|
ben:
|
||||||
|
$(MAKE) NOGFX=y BEN=y CC=mipsel-openwrt-linux-gcc
|
||||||
|
|
||||||
$(MAIN): $(OBJS)
|
$(MAIN): $(OBJS)
|
||||||
$(CC) $(CFLAGS) -o $@ $(OBJS) $(LDLIBS)
|
$(CC) $(CFLAGS) -o $@ $(OBJS) $(LDLIBS)
|
||||||
|
|
||||||
|
@ -437,9 +437,12 @@ static void samples(struct atrf_dsc *dsc, int gui)
|
|||||||
|
|
||||||
buf[0] = 1;
|
buf[0] = 1;
|
||||||
packet(dsc, SAMPLE, 0, 0, buf, PAYLOAD);
|
packet(dsc, SAMPLE, 0, 0, buf, PAYLOAD);
|
||||||
|
|
||||||
|
#ifdef GFX
|
||||||
if (gui)
|
if (gui)
|
||||||
plot_init();
|
plot_init();
|
||||||
else
|
else
|
||||||
|
#endif
|
||||||
signal(SIGINT, sigint);
|
signal(SIGINT, sigint);
|
||||||
while (run) {
|
while (run) {
|
||||||
got = rf_recv(dsc, buf, sizeof(buf));
|
got = rf_recv(dsc, buf, sizeof(buf));
|
||||||
@ -475,11 +478,15 @@ static void samples(struct atrf_dsc *dsc, int gui)
|
|||||||
if (!gui)
|
if (!gui)
|
||||||
printf("%11.6f\t%d\n", t, y);
|
printf("%11.6f\t%d\n", t, y);
|
||||||
|
|
||||||
|
#ifdef GFX
|
||||||
if (gui && !plot(x, y))
|
if (gui && !plot(x, y))
|
||||||
goto quit;
|
goto quit;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#ifdef GFX
|
||||||
quit:
|
quit:
|
||||||
|
#endif
|
||||||
buf[0] = 0;
|
buf[0] = 0;
|
||||||
packet(dsc, SAMPLE, 0, 0, buf, PAYLOAD);
|
packet(dsc, SAMPLE, 0, 0, buf, PAYLOAD);
|
||||||
}
|
}
|
||||||
@ -513,7 +520,9 @@ static void usage(const char *name)
|
|||||||
" -P ping (version query)\n"
|
" -P ping (version query)\n"
|
||||||
" -R reset\n"
|
" -R reset\n"
|
||||||
" -S sample with output on stdout. Exit with ^C.\n"
|
" -S sample with output on stdout. Exit with ^C.\n"
|
||||||
|
#ifdef GFX
|
||||||
" -S -S sample with graphical output. Exit with Q.\n\n"
|
" -S -S sample with graphical output. Exit with Q.\n\n"
|
||||||
|
#endif
|
||||||
"Parameters:\n"
|
"Parameters:\n"
|
||||||
, name, "", name, "", name, "", name, "", name);
|
, name, "", name, "", name, "", name, "", name);
|
||||||
for (m = map; m->name; m++)
|
for (m = map; m->name; m++)
|
||||||
|
Loading…
Reference in New Issue
Block a user