Add a special Makefile for Raspberry Pi GPIO control.

pull/1/head
Jonathan Naylor 8 years ago
parent 99692723e9
commit 562f36f8de

@ -1,5 +1,5 @@
/*
* Copyright (C) 2012,2013,2015 by Jonathan Naylor, G4KLX
* Copyright (C) 2012,2013,2015,2018 by Jonathan Naylor, G4KLX
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -11,6 +11,8 @@
* GNU General Public License for more details.
*/
#if defined(GPIO)
#include "GPIOController.h"
CGPIOController::CGPIOController(unsigned int config) :
@ -168,3 +170,6 @@ void CGPIOController::setDigitalOutputs(bool outp1, bool outp2, bool outp3, bool
void CGPIOController::close()
{
}
#endif

@ -1,5 +1,5 @@
/*
* Copyright (C) 2012,2015 by Jonathan Naylor, G4KLX
* Copyright (C) 2012,2015,2018 by Jonathan Naylor, G4KLX
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -14,6 +14,8 @@
#ifndef GPIOController_H
#define GPIOController_H
#if defined(GPIO)
#include "HardwareController.h"
#include <wx/wx.h>
@ -44,3 +46,6 @@ private:
};
#endif
#endif

@ -2,10 +2,10 @@ OBJECTS = AMBEFEC.o AnnouncementUnit.o ArduinoController.o BeaconUnit.o Callsign
DStarGMSKDemodulator.o DStarGMSKModulator.o DStarRepeaterConfig.o DStarScrambler.o DummyController.o DVAPController.o \
DVMegaController.o DVRPTRV1Controller.o DVRPTRV2Controller.o DVRPTRV3Controller.o DVTOOLFileReader.o DVTOOLFileWriter.o \
ExternalController.o FIRFilter.o GatewayProtocolHandler.o GMSKController.o GMSKModem.o GMSKModemLibUsb.o Golay.o \
HardwareController.o HeaderData.o IcomController.o K8055Controller.o LogEvent.o Logger.o MMDVMController.o Modem.o OutputQueue.o \
RepeaterProtocolHandler.o SerialDataController.o SerialLineController.o SerialPortSelector.o SlowDataDecoder.o SlowDataEncoder.o \
SoundCardController.o SoundCardReaderWriter.o SplitController.o TCPReaderWriter.o Timer.o UDPReaderWriter.o \
URIUSBController.o Utils.o
GPIOController.o HardwareController.o HeaderData.o IcomController.o K8055Controller.o LogEvent.o Logger.o MMDVMController.o \
Modem.o OutputQueue.o RepeaterProtocolHandler.o SerialDataController.o SerialLineController.o SerialPortSelector.o \
SlowDataDecoder.o SlowDataEncoder.o SoundCardController.o SoundCardReaderWriter.o SplitController.o TCPReaderWriter.o \
Timer.o UDPReaderWriter.o UDRCController.o URIUSBController.o Utils.o
all: Common.a

@ -3,6 +3,8 @@
*
*/
#if defined(GPIO)
#include <wiringPi.h>
#include <errno.h>
#include <stdlib.h>
@ -119,6 +121,8 @@ void CUDRCController::switchMode(enum repeater_modes mode) {
::digitalWrite(EXT1_PIN, LOW);
::digitalWrite(EXT2_PIN, LOW);
break;
default:
break;
}
}
@ -132,12 +136,12 @@ bool CUDRCController::open()
if(m_mode != HOTSPOT) {
::pinMode(m_pttPin, OUTPUT);
for(int i = 0; i < ARRAY_SIZE(input_pins); ++i) {
for(unsigned int i = 0; i < ARRAY_SIZE(input_pins); ++i) {
::pinMode(input_pins[i], INPUT);
::pullUpDnControl(input_pins[i], PUD_UP);
}
for(int i = 0; i < ARRAY_SIZE(output_pins); ++i) {
for(unsigned int i = 0; i < ARRAY_SIZE(output_pins); ++i) {
::pinMode(output_pins[i], OUTPUT);
::digitalWrite(output_pins[i], HIGH);
}
@ -213,3 +217,5 @@ void CUDRCController::close()
}
}
#endif

@ -1,6 +1,8 @@
#ifndef UDRCController_H
#define UDRCController_H
#if defined(GPIO)
#include "ExternalController.h"
enum repeater_modes {
@ -30,4 +32,6 @@ private:
void switchMode(enum repeater_modes mode);
};
#endif
#endif // UDRCController_H

@ -0,0 +1,36 @@
export DATADIR := "/usr/share/dstarrepeater"
export LOGDIR := "/var/log"
export CONFDIR := "/etc"
export BINDIR := "/usr/bin"
export CXX := $(shell wx-config --cxx)
export CFLAGS := -O2 -Wall $(shell wx-config --cxxflags) -DLOG_DIR='$(LOGDIR)' -DCONF_DIR='$(CONFDIR)' -DDATA_DIR='$(DATADIR)' -DGPIO
export GUILIBS := $(shell wx-config --libs adv,core,base) -lasound
export LIBS := $(shell wx-config --libs base) -lasound -lusb-1.0 -lwiringPi
export LDFLAGS :=
all: DStarRepeater/dstarrepeaterd DStarRepeaterConfig/dstarrepeaterconfig
DStarRepeater/dstarrepeaterd: Common/Common.a
make -C DStarRepeater dstarrepeaterd
DStarRepeaterConfig/dstarrepeaterconfig: GUICommon/GUICommon.a Common/Common.a
make -C DStarRepeaterConfig
GUICommon/GUICommon.a:
make -C GUICommon
Common/Common.a:
make -C Common
install: all
make -C Data install
make -C DStarRepeater install
make -C DStarRepeaterConfig install
clean:
make -C Common clean
make -C GUICommon clean
make -C DStarRepeater clean
make -C DStarRepeaterConfig clean
Loading…
Cancel
Save

Powered by TurnKey Linux.