Add a lot of documentation, etc. for ColorChord Embedded.
This commit is contained in:
parent
96002c5583
commit
ec4f175c2b
8 changed files with 92 additions and 44 deletions
13
embeddedlinux/Makefile
Normal file
13
embeddedlinux/Makefile
Normal file
|
@ -0,0 +1,13 @@
|
|||
all : embeddedcc
|
||||
|
||||
CFLAGS:=-Ofast -DCCEMBEDDED -I.. -flto -m32 -DDFREQ=11025
|
||||
LDFLAGS:=-ffunction-sections -Wl,--gc-sections -fno-asynchronous-unwind-tables -Wl,--strip-all
|
||||
|
||||
embeddedcc : ../embeddednf.c ../DFT32.c embeddedcc.c ../embeddedout.c
|
||||
gcc -o $@ $^ $(CFLAGS) $(LDFLAGS)
|
||||
|
||||
runembedded : embeddedcc
|
||||
parec --format=u8 --rate=11025 --channels=1 --device=alsa_output.pci-0000_00_1b.0.analog-stereo.monitor --latency=128 | ./embeddedcc
|
||||
|
||||
clean :
|
||||
rm -rf embeddedcc *~
|
74
embeddedlinux/embeddedcc.c
Normal file
74
embeddedlinux/embeddedcc.c
Normal file
|
@ -0,0 +1,74 @@
|
|||
//
|
||||
// This is the teststrap for the Embedded ColorChord System.
|
||||
// It is intended as a minimal scaffolding for testing Embedded ColorChord.
|
||||
//
|
||||
|
||||
|
||||
#include "embeddednf.h"
|
||||
#include <sys/socket.h>
|
||||
#include <string.h>
|
||||
#include <netinet/in.h>
|
||||
#include <stdio.h>
|
||||
#include "embeddedout.h"
|
||||
|
||||
struct sockaddr_in servaddr;
|
||||
int sock;
|
||||
|
||||
#define expected_lights 296
|
||||
|
||||
void NewFrame()
|
||||
{
|
||||
int i;
|
||||
char buffer[3000];
|
||||
|
||||
HandleFrameInfo();
|
||||
UpdateLinearLEDs();
|
||||
|
||||
buffer[0] = 0;
|
||||
buffer[1] = 0;
|
||||
buffer[2] = 0;
|
||||
|
||||
for( i = 0; i < expected_lights * 3; i++ )
|
||||
{
|
||||
buffer[i+3] = ledOut[i];
|
||||
}
|
||||
|
||||
int r = send(sock,buffer,expected_lights*3+3,0);
|
||||
}
|
||||
|
||||
|
||||
int main()
|
||||
{
|
||||
int wf = 0;
|
||||
int ci;
|
||||
|
||||
sock = socket(AF_INET,SOCK_DGRAM,IPPROTO_UDP);
|
||||
printf( "%d\n", sock );
|
||||
|
||||
memset(&servaddr,0,sizeof(servaddr));
|
||||
servaddr.sin_family = AF_INET;
|
||||
servaddr.sin_addr.s_addr = inet_addr("192.168.0.245");
|
||||
servaddr.sin_port=htons(7777);
|
||||
|
||||
connect( sock, (struct sockaddr *)&servaddr, sizeof(servaddr) );
|
||||
|
||||
Init();
|
||||
|
||||
while( ( ci = getchar() ) != EOF )
|
||||
{
|
||||
int cs = ci - 0x80;
|
||||
#ifdef USE_32DFT
|
||||
PushSample32( ((int8_t)cs)*32 );
|
||||
#else
|
||||
Push8BitIntegerSkippy( (int8_t)cs );
|
||||
#endif
|
||||
wf++;
|
||||
if( wf == 64 )
|
||||
{
|
||||
NewFrame();
|
||||
wf = 0;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue