Merge pull request #8 from mamborambo/fix-compilation

Fix compilation + misc changes
This commit is contained in:
F5OEO 2018-11-23 11:47:46 +01:00 committed by GitHub
commit 17748b0b0e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 12 additions and 15 deletions

View file

@ -1,21 +1,16 @@
all: librpitx
CFLAGS = -Wall -O3 -Wno-unused-variable
LDFLAGS = -lm -lrt -lpthread
CCP = g++
CC = gcc
CFLAGS = -Wall -O3 -Wno-unused-variable
CXXFLAGS = -std=c++11 -Wall -O3 -Wno-unused-variable
LDFLAGS = -lm -lrt -lpthread
CCP = c++
CC = cc
librpitx: librpitx.h gpio.h gpio.cpp dma.h dma.cpp mailbox.c raspberry_pi_revision.c fmdmasync.h fmdmasync.cpp ngfmdmasync.h ngfmdmasync.cpp dsp.h dsp.cpp iqdmasync.h iqdmasync.cpp serialdmasync.h serialdmasync.cpp phasedmasync.h phasedmasync.cpp fskburst.h fskburst.cpp
$(CC) $(CFLAGS) -c -o mailbox.o mailbox.c
$(CC) $(CFLAGS) -c -o raspberry_pi_revision.o raspberry_pi_revision.c
$(CCP) $(CFLAGS) -c dsp.cpp iqdmasync.cpp ngfmdmasync.cpp fmdmasync.cpp dma.cpp gpio.cpp serialdmasync.cpp phasedmasync.cpp amdmasync.h amdmasync.cpp fskburst.cpp
$(CCP) $(CXXFLAGS) -c dsp.cpp iqdmasync.cpp ngfmdmasync.cpp fmdmasync.cpp dma.cpp gpio.cpp serialdmasync.cpp phasedmasync.cpp amdmasync.h amdmasync.cpp fskburst.cpp
$(AR) rc librpitx.a dsp.o iqdmasync.o ngfmdmasync.o fmdmasync.o dma.o gpio.o mailbox.o raspberry_pi_revision.o serialdmasync.o phasedmasync.o amdmasync.o fskburst.o
install: librpitx
clean:
rm -f *.o *.a
#install: all
rm -f *.o *.a

View file

@ -22,6 +22,7 @@ This program is free software: you can redistribute it and/or modify
#include <math.h>
#include <time.h>
#include <sched.h>
#include <stdlib.h>
amdmasync::amdmasync(uint64_t TuneFrequency,uint32_t SR,int Channel,uint32_t FifoSize):bufferdma(Channel,FifoSize,3,2)

View file

@ -17,6 +17,7 @@ This program is free software: you can redistribute it and/or modify
#include "dsp.h"
#include <stdlib.h>
dsp::dsp()
{

View file

@ -116,7 +116,7 @@ uint64_t clkgpio::GetPllFrequency(int PllNo)
Freq = XOSC_FREQUENCY * ((uint64_t)gpioreg[PLLH_CTRL] & 0x3ff) + XOSC_FREQUENCY * (uint64_t)gpioreg[PLLH_FRAC] / (1 << 20);
break;
}
fprintf(stderr, "Freq = %lld\n", Freq);
fprintf(stderr, "Freq = %lu\n", Freq);
return Freq;
}

View file

@ -63,7 +63,7 @@ void *mapmem(unsigned base, unsigned size)
printf("base=0x%x, mem=%p\n", base, mem);
#endif
if (mem == MAP_FAILED) {
printf("mmap error %d\n", (int)mem);
printf("mmap error %p\n", mem);
exit (-1);
}
close(mem_fd);