Work on PI4

This commit is contained in:
F5OEO 2019-06-27 08:58:34 +01:00 committed by f5oeo
parent c9714b2a7d
commit 5b5a4ee083
4 changed files with 22 additions and 8 deletions

View file

@ -1,7 +1,7 @@
all: testrpitx all: testrpitx
CFLAGS = -Wall -g -O3 -Wno-unused-variable CFLAGS = -Wall -g -O3 -Wno-unused-variable -I /opt/vc/include
LDFLAGS = -lm -lrt -lpthread LDFLAGS = -lm -lrt -lpthread -L/opt/vc/lib -lbcm_host
CCP = g++ CCP = g++
CC = gcc CC = gcc

View file

@ -701,6 +701,13 @@ void SimpleTestAtv(uint64_t Freq)
} }
} }
void info(void)
{
clkgpio clk;
clk.print_clock_tree();
}
static void static void
terminate(int num) terminate(int num)
{ {
@ -723,7 +730,7 @@ int main(int argc, char *argv[])
sa.sa_handler = terminate; sa.sa_handler = terminate;
sigaction(i, &sa, NULL); sigaction(i, &sa, NULL);
} }
dbg_setlevel(0); dbg_setlevel(1);
//SimpleTest(Freq); //SimpleTest(Freq);
//SimpleTestbpsk(Freq); //SimpleTestbpsk(Freq);
//SimpleTestFileIQ(Freq); //SimpleTestFileIQ(Freq);
@ -733,6 +740,9 @@ int main(int argc, char *argv[])
//SimpleTestBurstFsk(Freq); //SimpleTestBurstFsk(Freq);
//SimpleTestOOKTiming(Freq); //SimpleTestOOKTiming(Freq);
//AlectoOOK(Freq); //AlectoOOK(Freq);
RfSwitchOOK(Freq); //RfSwitchOOK(Freq);
//SimpleTestbpsk(Freq);
//SimpleTestAtv(Freq); //SimpleTestAtv(Freq);
info();
} }

View file

@ -1,6 +1,6 @@
CFLAGS = -Wall -O3 -Wno-unused-variable CFLAGS = -Wall -O3 -Wno-unused-variable
CXXFLAGS = -std=c++11 -Wall -O3 -Wno-unused-variable CXXFLAGS = -std=c++11 -Wall -O3 -Wno-unused-variable -I /opt/vc/include
LDFLAGS = -lm -lrt -lpthread LDFLAGS = -lm -lrt -lpthread -L/opt/vc/lib -lbcm_host
CCP = c++ CCP = c++
CC = cc CC = cc

View file

@ -25,6 +25,8 @@ extern "C" {
#include <sys/timex.h> #include <sys/timex.h>
#include <math.h> #include <math.h>
#include "util.h" #include "util.h"
#include <bcm_host.h>
//#include "/opt/vc/include/bcm_host.h"
gpio::gpio(uint32_t base, uint32_t len) gpio::gpio(uint32_t base, uint32_t len)
{ {
@ -42,7 +44,9 @@ gpio::~gpio()
uint32_t gpio::GetPeripheralBase() uint32_t gpio::GetPeripheralBase()
{ {
RASPBERRY_PI_INFO_T info; RASPBERRY_PI_INFO_T info;
uint32_t BCM2708_PERI_BASE = 0; uint32_t BCM2708_PERI_BASE = bcm_host_get_peripheral_address();
dbg_printf(1,"Peri Base = %x\n",BCM2708_PERI_BASE);
/*
if (getRaspberryPiInformation(&info) > 0) if (getRaspberryPiInformation(&info) > 0)
{ {
if (info.peripheralBase == RPI_BROADCOM_2835_PERIPHERAL_BASE) if (info.peripheralBase == RPI_BROADCOM_2835_PERIPHERAL_BASE)
@ -54,7 +58,7 @@ uint32_t gpio::GetPeripheralBase()
{ {
BCM2708_PERI_BASE = info.peripheralBase; BCM2708_PERI_BASE = info.peripheralBase;
} }
} }*/
return BCM2708_PERI_BASE; return BCM2708_PERI_BASE;
} }