Add a status LED on the RPi to the Null display driver.
This commit is contained in:
parent
adb8758ba2
commit
09e8563336
|
@ -0,0 +1,26 @@
|
|||
# This makefile is for use with the Raspberry Pi. The wiringpi library is needed.
|
||||
|
||||
CC = gcc
|
||||
CXX = g++
|
||||
CFLAGS = -g -O3 -Wall -std=c++0x -pthread -DRASPBERRY_PI -I/usr/local/include
|
||||
LIBS = -lwiringPi -lwiringPiDev -lpthread
|
||||
LDFLAGS = -g -L/usr/local/lib
|
||||
|
||||
OBJECTS = \
|
||||
AMBEFEC.o BCH.o BPTC19696.o Conf.o CRC.o Display.o DMRControl.o DMRCSBK.o DMRData.o DMRDataHeader.o DMREMB.o DMREmbeddedLC.o DMRFullLC.o DMRLookup.o DMRLC.o \
|
||||
DMRNetwork.o DMRShortLC.o DMRSlot.o DMRSlotType.o DMRAccessControl.o DMRTrellis.o DStarControl.o DStarHeader.o DStarNetwork.o DStarSlowData.o Golay2087.o \
|
||||
Golay24128.o Hamming.o Log.o MMDVMHost.o Modem.o ModemSerialPort.o Mutex.o Nextion.o NullDisplay.o P25Audio.o P25Control.o P25Data.o P25LowSpeedData.o \
|
||||
P25Network.o P25NID.o P25Utils.o QR1676.o RS129.o RS241213.o SerialController.o SerialPort.o SHA256.o StopWatch.o Sync.o TFTSerial.o Thread.o Timer.o UDPSocket.o \
|
||||
Utils.o YSFControl.o YSFConvolution.o YSFFICH.o YSFNetwork.o YSFPayload.o
|
||||
|
||||
all: MMDVMHost
|
||||
|
||||
MMDVMHost: $(OBJECTS)
|
||||
$(CXX) $(OBJECTS) $(CFLAGS) $(LIBS) -o MMDVMHost
|
||||
|
||||
%.o: %.cpp
|
||||
$(CXX) $(CFLAGS) -c -o $@ $<
|
||||
|
||||
clean:
|
||||
$(RM) MMDVMHost *.o *.d *.bak *~
|
||||
|
|
@ -18,6 +18,12 @@
|
|||
|
||||
#include "NullDisplay.h"
|
||||
|
||||
#if defined(RASPBERRY_PI)
|
||||
#include <wiringPi.h>
|
||||
#endif
|
||||
|
||||
#define LED_STATUS 28
|
||||
|
||||
CNullDisplay::CNullDisplay() :
|
||||
CDisplay()
|
||||
{
|
||||
|
@ -29,6 +35,12 @@ CNullDisplay::~CNullDisplay()
|
|||
|
||||
bool CNullDisplay::open()
|
||||
{
|
||||
#if defined(RASPBERRY_PI)
|
||||
::wiringPiSetup();
|
||||
|
||||
::pinMode(LED_STATUS, OUTPUT);
|
||||
::digitalWrite(LED_STATUS, 0);
|
||||
#endif
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -46,34 +58,58 @@ void CNullDisplay::setLockoutInt()
|
|||
|
||||
void CNullDisplay::writeDStarInt(const char* my1, const char* my2, const char* your, const char* type, const char* reflector)
|
||||
{
|
||||
#if defined(RASPBERRY_PI)
|
||||
::digitalWrite(LED_STATUS, 1);
|
||||
#endif
|
||||
}
|
||||
|
||||
void CNullDisplay::clearDStarInt()
|
||||
{
|
||||
#if defined(RASPBERRY_PI)
|
||||
::digitalWrite(LED_STATUS, 0);
|
||||
#endif
|
||||
}
|
||||
|
||||
void CNullDisplay::writeDMRInt(unsigned int slotNo, const std::string& src, bool group, const std::string& dst, const char* type)
|
||||
{
|
||||
#if defined(RASPBERRY_PI)
|
||||
::digitalWrite(LED_STATUS, 1);
|
||||
#endif
|
||||
}
|
||||
|
||||
void CNullDisplay::clearDMRInt(unsigned int slotNo)
|
||||
{
|
||||
#if defined(RASPBERRY_PI)
|
||||
::digitalWrite(LED_STATUS, 0);
|
||||
#endif
|
||||
}
|
||||
|
||||
void CNullDisplay::writeFusionInt(const char* source, const char* dest, const char* type, const char* origin)
|
||||
{
|
||||
#if defined(RASPBERRY_PI)
|
||||
::digitalWrite(LED_STATUS, 1);
|
||||
#endif
|
||||
}
|
||||
|
||||
void CNullDisplay::clearFusionInt()
|
||||
{
|
||||
#if defined(RASPBERRY_PI)
|
||||
::digitalWrite(LED_STATUS, 0);
|
||||
#endif
|
||||
}
|
||||
|
||||
void CNullDisplay::writeP25Int(const char* source, bool group, unsigned int dest, const char* type)
|
||||
{
|
||||
#if defined(RASPBERRY_PI)
|
||||
::digitalWrite(LED_STATUS, 1);
|
||||
#endif
|
||||
}
|
||||
|
||||
void CNullDisplay::clearP25Int()
|
||||
{
|
||||
#if defined(RASPBERRY_PI)
|
||||
::digitalWrite(LED_STATUS, 0);
|
||||
#endif
|
||||
}
|
||||
|
||||
void CNullDisplay::writeCWInt()
|
||||
|
|
Loading…
Reference in New Issue