Commit d6f01a34 by jdonnal

changed nerdjack packet data type for 64 bit compilers and adjusted the Makefile…

changed nerdjack packet data type for 64 bit compilers and adjusted the Makefile for proper linking of the math library

git-svn-id: https://bucket.mit.edu/svn/nilm/acquisition/ethstream@10306 ddd99763-3ecb-0310-9145-efcb8ce7c51f
parent 76143e7e
Showing with 5 additions and 2 deletions
...@@ -14,7 +14,9 @@ ...@@ -14,7 +14,9 @@
# Build options # Build options
CFLAGS += -Wall -g #-pg CFLAGS += -Wall -g #-pg
LDFLAGS += -lm #-pg LDFLAGS += #-pg
LDLIBS += -lm #CHANGED location from LDFLAGS for proper linking using gcc
PREFIX = /usr/local PREFIX = /usr/local
MANPATH = ${PREFIX}/man/man1/ MANPATH = ${PREFIX}/man/man1/
BINPATH = ${PREFIX}/bin BINPATH = ${PREFIX}/bin
......
...@@ -27,7 +27,8 @@ ...@@ -27,7 +27,8 @@
/* Packet structure used in message to start sampling on NerdJack */ /* Packet structure used in message to start sampling on NerdJack */
typedef struct __attribute__ ((__packed__)) { typedef struct __attribute__ ((__packed__)) {
char word[4]; char word[4];
unsigned long period; unsigned int period; //CHANGED FROM TYPE LONG. With 64 bit compilers longs are 8 bytes and nerdjack expects a 4 byte value
//since the int type is 4 bytes this works but should be changed to use defined datatypes rather than rely on compiler data types
unsigned short channelbit; unsigned short channelbit;
unsigned char precision; unsigned char precision;
unsigned char prescaler; unsigned char prescaler;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment