Added c functions necessary for packing/coding and demonstration/simulation program wsprsim.

git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/branches/wsjtx@5606 ab8295b8-cf94-4d9e-aec4-7959e3be5d79
This commit is contained in:
Steven Franke 2015-06-14 15:05:07 +00:00
parent d64fb9826e
commit 3039c9d790
6 changed files with 25 additions and 19 deletions

View File

@ -853,6 +853,9 @@ target_link_libraries (jt9code wsjt_fort wsjt_cxx)
add_executable (wsprd lib/wsprd/wsprd.c lib/wsprd/wsprd_utils.c lib/wsprd/fano.c lib/wsprd/tab.c lib/wsprd/nhash.c)
target_link_libraries (wsprd ${FFTW3_LIBRARIES})
add_executable (wsprsim lib/wsprd/wsprsim.c lib/wsprd/wsprsim_utils.c lib/wsprd/wsprd_utils.c lib/wsprd/fano.c lib/wsprd/tab.c lib/wsprd/nhash.c)
target_link_libraries (wsprsim )
add_executable (jt4code lib/jt4code.f90 wsjtx.rc)
target_link_libraries (jt4code wsjt_fort wsjt_cxx)
@ -961,7 +964,7 @@ install (TARGETS wsjtx
BUNDLE DESTINATION . COMPONENT runtime
)
install (TARGETS jt9 jt65code jt9code jt4code jt4sim wsprd message_aggregator
install (TARGETS jt9 jt65code jt9code jt4code jt4sim wsprd wsprsim message_aggregator
RUNTIME DESTINATION ${WSJT_BIN_DESTINATION} COMPONENT runtime
BUNDLE DESTINATION ${WSJT_BIN_DESTINATION} COMPONENT runtime
)

View File

@ -1,9 +1,9 @@
#CC = gcc
CC = clang
CC = gcc
#CC = clang
FC = gfortran
FFLAGS = -O2 -Wall -Wno-conversion
CFLAGS= -I/usr/include -Wall -Wno-missing-braces -O2
CFLAGS= -g -I/usr/include -Wall -Wno-missing-braces -O2
LDFLAGS = -L/usr/lib
LIBS = -lfftw3 -lm
@ -19,21 +19,16 @@ LIBS = -lfftw3 -lm
%.o: %.F90
${FC} ${FFLAGS} -c $<
all: wsprd WSPRcode test_wspr
all: wsprd wsprsim
DEPS = fano.h
OBJS1 = wsprd.o wsprd_utils.o fano.o tab.o nhash.o
DEPS = wsprsim_utils.h wsprd_utils.h fano.h
OBJS1 = wsprd.o wsprd_utils.o tab.o fano.o nhash.o
wsprd: $(OBJS1)
$(CC) -o $@ $^ $(CFLAGS) $(LDFLAGS) $(LIBS)
OBJS2 = test_wspr.o unpk.o wsprd_utils.o nhash.o
test_wspr: $(OBJS2) libwspr.a
$(FC) -o test_wspr $(FFLAGS) $(OBJS2) libwspr.a
OBJS3 = WSPRcode.o
WSPRcode: $(OBJS3) libwspr.a
$(FC) -o WSPRcode $(FFLAGS) $(OBJS3) libwspr.a
OBJS4 = wsprsim.o wsprsim_utils.o wsprd_utils.o tab.o fano.o nhash.o
wsprsim: $(OBJS4)
$(CC) -o $@ $^ $(CFLAGS) $(LDFLAGS) $(LIBS)
clean:
rm *.o wsprd
rm *.o wsprd wsprsim

View File

@ -9,6 +9,9 @@
Minor modifications by Joe Taylor, K1JT
*/
#ifndef FANO_H
#define FANO_H
int fano(unsigned int *metric, unsigned int *cycles, unsigned int *maxnp,
unsigned char *data,unsigned char *symbols, unsigned int nbits,
int mettab[2][256],int delta,unsigned int maxcycles);
@ -17,5 +20,4 @@ int encode(unsigned char *symbols,unsigned char *data,unsigned int nbytes);
extern unsigned char Partab[];
#endif

View File

@ -37,6 +37,7 @@
#include <fftw3.h>
#include "fano.h"
#include "nhash.h"
#include "wsprd_utils.h"
#define max(x,y) ((x) > (y) ? (x) : (y))

View File

@ -27,7 +27,6 @@
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "wsprd_utils.h"
#include "nhash.h"
#ifndef int32_t
#define int32_t int

View File

@ -1,3 +1,6 @@
#ifndef WSPRD_UTILS_H
#define WSPRD_UTILS_H
#include <stdio.h>
#include <unistd.h>
#include <stdlib.h>
@ -5,6 +8,7 @@
#include <string.h>
#include <stdint.h>
#include <time.h>
#include "nhash.h"
void unpack50( signed char *dat, int32_t *n1, int32_t *n2 );
@ -20,3 +24,5 @@ void deinterleave(unsigned char *sym);
int floatcomp(const void* elem1, const void* elem2);
int unpk_( signed char *message, char hashtab[32768][13], char *call_loc_pow, char *callsign);
#endif