Compiles without warning.

This commit is contained in:
Kai Lauterbach 2011-12-25 11:58:42 +01:00
parent 70e877008f
commit 0fcd2d2d20
3 changed files with 31 additions and 8 deletions

View file

@ -25,27 +25,31 @@ EXE_SUFFIX =
DEMO_NAME = demo DEMO_NAME = demo
NAME = clcc 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 CC = gcc
CFLAGS = $(CPPFLAGS) $(USBFLAGS) -O -g -Wall CFLAGS = $(CPPFLAGS) $(USBFLAGS) -O3 -Wall
LIBS = $(USBLIBS) -lm -largtable2 LIBS = $(USBLIBS) -lm -largtable2
PROGRAM = $(NAME)$(EXE_SUFFIX) PROGRAM = $(NAME)$(EXE_SUFFIX)
DEMO = $(DEMO_NAME)$(EXE_SUFFIX)
all: $(PROGRAM) $(DEMO) all: $(PROGRAM) $(DEMO)
.c.o: .c.o:
$(CC) $(CFLAGS) -c $< $(CC) $(CFLAGS) -c $<
$(DEMO): $(OBJECTS) $(DEMO): $(OBJECTS_DEMO)
$(CC) -o $(DEMO) $(OBJECTS) $(LIBS) $(CC) -o $(DEMO) $(OBJECTS_DEMO) $(LIBS)
$(PROGRAM): $(OBJECTS) $(PROGRAM): $(OBJECTS)
$(CC) -o $(PROGRAM) $(OBJECTS) $(LIBS) $(CC) -o $(PROGRAM) $(OBJECTS) $(LIBS)
strip: $(PROGRAM) strip: $(PROGRAM)
strip $(PROGRAM) strip $(PROGRAM)
strip $(DEMO)
clean: clean:
rm -f *.o $(PROGRAM) rm -f *.o $(PROGRAM) $(DEMO)

View file

@ -18,14 +18,17 @@
#include "../firmware/globals.h" /* custom request numbers */ #include "../firmware/globals.h" /* custom request numbers */
#include "ledcube.c" //#include "ledcube.h"
int main(int argc, char **argv) int main(int argc, char **argv)
{ {
lc_init(); lc_init();
// TODO // TODO parse commandline parameters
lc_close(); lc_close();
return 0;
} }

View file

@ -17,7 +17,13 @@
#include "../firmware/globals.h" /* custom request numbers */ #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 i = 0;
int k = 0;
//for (i = 0; i < 360; i+=11)
for (i = 0; i < 360; i++) 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 double d = cos((double)((6.28*i)/360)) + 1; // 6.28 = PI * 2
unsigned long tmp = (1 << (int)((27 * d) / 2)); unsigned long tmp = (1 << (int)((27 * d) / 2));
// show frame // show frame
lc_setFrame(tmp); lc_setFrame(tmp);
// or save the frame to eeprom
//tmp = tmp + (k << 27);
//if (k < 32)
//lc_saveFrame(tmp, k);
usleep(2500); usleep(2500);
k++;
} }
} }