diff --git a/client/Makefile b/client/Makefile index 24c0553..3168f4e 100644 --- a/client/Makefile +++ b/client/Makefile @@ -25,27 +25,31 @@ EXE_SUFFIX = DEMO_NAME = demo NAME = clcc -OBJECTS = opendevice.o $(NAME).o +OBJECTS = ledcube.o opendevice.o $(NAME).o +OBJECTS_DEMO = ledcube.o opendevice.o $(DEMO_NAME).o CC = gcc -CFLAGS = $(CPPFLAGS) $(USBFLAGS) -O -g -Wall +CFLAGS = $(CPPFLAGS) $(USBFLAGS) -O3 -Wall LIBS = $(USBLIBS) -lm -largtable2 PROGRAM = $(NAME)$(EXE_SUFFIX) +DEMO = $(DEMO_NAME)$(EXE_SUFFIX) all: $(PROGRAM) $(DEMO) .c.o: $(CC) $(CFLAGS) -c $< -$(DEMO): $(OBJECTS) - $(CC) -o $(DEMO) $(OBJECTS) $(LIBS) +$(DEMO): $(OBJECTS_DEMO) + $(CC) -o $(DEMO) $(OBJECTS_DEMO) $(LIBS) $(PROGRAM): $(OBJECTS) $(CC) -o $(PROGRAM) $(OBJECTS) $(LIBS) strip: $(PROGRAM) strip $(PROGRAM) + strip $(DEMO) clean: - rm -f *.o $(PROGRAM) + rm -f *.o $(PROGRAM) $(DEMO) + diff --git a/client/clcc.c b/client/clcc.c index 245fb29..0630d5b 100644 --- a/client/clcc.c +++ b/client/clcc.c @@ -18,14 +18,17 @@ #include "../firmware/globals.h" /* custom request numbers */ -#include "ledcube.c" +//#include "ledcube.h" int main(int argc, char **argv) { + lc_init(); - // TODO + // TODO parse commandline parameters lc_close(); + + return 0; } diff --git a/client/demo.c b/client/demo.c index 8433835..ce4762d 100644 --- a/client/demo.c +++ b/client/demo.c @@ -17,7 +17,13 @@ #include "../firmware/globals.h" /* custom request numbers */ -#include "ledcube.c" +//#include "ledcube.h" + +extern void lc_setFrame(unsigned long); +extern void lc_setMode(int); +extern void lc_saveFrame(unsigned long, int); +extern void lc_init(void); +extern void lc_close(void); /** * @@ -65,15 +71,25 @@ void sinus1(int max) { int i = 0; + int k = 0; + //for (i = 0; i < 360; i+=11) for (i = 0; i < 360; i++) { + // 2 = 27 + // 1 = 27 / 2 + // n = 27 * n / 2 double d = cos((double)((6.28*i)/360)) + 1; // 6.28 = PI * 2 unsigned long tmp = (1 << (int)((27 * d) / 2)); // show frame lc_setFrame(tmp); + // or save the frame to eeprom + //tmp = tmp + (k << 27); + //if (k < 32) + //lc_saveFrame(tmp, k); usleep(2500); + k++; } }