Compiles without warning.
This commit is contained in:
parent
70e877008f
commit
0fcd2d2d20
3 changed files with 31 additions and 8 deletions
|
@ -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)
|
||||
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
@ -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++;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue