diff --git a/Bossa/Makefile b/Bossa/Makefile new file mode 100644 index 0000000..fd052da --- /dev/null +++ b/Bossa/Makefile @@ -0,0 +1,322 @@ +.DEFAULT_GOAL := all + +# +# Version +# +VERSION=1.6.1-arduino +WXVERSION=3.0 + +# +# Source files +# +COMMON_SRCS=Samba.cpp Flash.cpp NvmFlash.cpp EfcFlash.cpp EefcFlash.cpp FlashFactory.cpp Applet.cpp WordCopyApplet.cpp Flasher.cpp +APPLET_SRCS=WordCopyArm.asm +BOSSA_SRCS=BossaForm.cpp BossaWindow.cpp BossaAbout.cpp BossaApp.cpp BossaBitmaps.cpp BossaInfo.cpp BossaThread.cpp BossaProgress.cpp +BOSSA_BMPS=BossaLogo.bmp BossaIcon.bmp ShumaTechLogo.bmp +BOSSAC_SRCS=bossac.cpp CmdOpts.cpp +BOSSASH_SRCS=bossash.cpp Shell.cpp Command.cpp + +# +# Build directories +# +BINDIR=bin +OBJDIR=obj +SRCDIR=src +RESDIR=res +INSTALLDIR=install + +# +# Determine OS +# +OS:=$(shell uname -s | cut -c -7) + +# +# Windows rules +# +ifeq ($(OS),MINGW32) +EXE=.exe +COMMON_SRCS+=WinSerialPort.cpp WinPortFactory.cpp +COMMON_LDFLAGS=-Wl,--enable-auto-import -static -static-libstdc++ -static-libgcc +COMMON_LIBS=-Wl,--as-needed -lsetupapi +BOSSA_RC=BossaRes.rc +WIXDIR="C:\Program Files (x86)\Windows Installer XML v3.5\bin" + +$(OBJDIR)\\bossa-$(VERSION).wixobj: $(INSTALLDIR)\\bossa.wxs + $(WIXDIR)\\candle.exe -dVersion=$(VERSION) -arch x86 -out $@ -ext $(WIXDIR)\\WixUIExtension.dll -ext $(WIXDIR)\\WixDifxAppExtension.dll $< + +$(OBJDIR)\\bossa64-$(VERSION).wixobj: $(INSTALLDIR)\\bossa.wxs + $(WIXDIR)\\candle.exe -dVersion=$(VERSION) -arch x64 -out $@ -ext $(WIXDIR)\\WixUIExtension.dll -ext $(WIXDIR)\\WixDifxAppExtension.dll $< + +$(BINDIR)\\bossa-$(VERSION).msi: $(OBJDIR)\\bossa-$(VERSION).wixobj + $(WIXDIR)\\light.exe -cultures:null -out $@ -pdbout $(OBJDIR)\\bossa.wixpdb -sice:ICE57 -ext $(WIXDIR)\\WixUIExtension.dll -ext $(WIXDIR)\\WixDifxAppExtension.dll $(WIXDIR)\\difxapp_x86.wixlib $< + +$(BINDIR)\\bossa64-$(VERSION).msi: $(OBJDIR)\\bossa64-$(VERSION).wixobj + $(WIXDIR)\\light.exe -cultures:null -out $@ -pdbout $(OBJDIR)\\bossa64.wixpdb -sice:ICE57 -ext $(WIXDIR)\\WixUIExtension.dll -ext $(WIXDIR)\\WixDifxAppExtension.dll $(WIXDIR)\\difxapp_x64.wixlib $< + +install32: $(BINDIR)\\bossa-$(VERSION).msi +install64: $(BINDIR)\\bossa64-$(VERSION).msi +.PHONY: install +install: strip install32 install64 + +endif + +# +# Linux rules +# +ifeq ($(OS),Linux) +COMMON_SRCS+=PosixSerialPort.cpp LinuxPortFactory.cpp +COMMON_LIBS=-Wl,--as-needed +WX_LIBS+=-lX11 + +MACHINE:=$(shell uname -m) + +install: strip + tar cvzf $(BINDIR)/bossa-$(MACHINE)-$(VERSION).tgz -C $(BINDIR) bossa$(EXE) bossac$(EXE) bossash$(EXE) +endif + +# +# OS X rules +# +ifeq ($(OS),Darwin) +COMMON_SRCS+=PosixSerialPort.cpp OSXPortFactory.cpp +COMMON_CXXFLAGS=-arch i386 -arch x86_64 -mmacosx-version-min=10.5 +COMMON_LDFLAGS=-arch i386 -arch x86_64 -mmacosx-version-min=10.5 +APP=BOSSA.app +DMG=bossa-$(VERSION).dmg +VOLUME=BOSSA +BACKGROUND=$(INSTALLDIR)/background.png +.PHONY: install +app: + mkdir -p $(BINDIR)/$(APP)/Contents/MacOS + mkdir -p $(BINDIR)/$(APP)/Contents/Resources + cp -f $(INSTALLDIR)/Info.plist $(BINDIR)/$(APP)/Contents + echo -n "APPL????" > $(BINDIR)/$(APP)/Contents/PkgInfo + ln -f $(BINDIR)/bossa $(BINDIR)/$(APP)/Contents/MacOS/bossa + cp -f $(RESDIR)/BossaIcon.icns $(BINDIR)/$(APP)/Contents/Resources +install: strip app + hdiutil create -ov -megabytes 5 -fs HFS+ -volname $(VOLUME) $(BINDIR)/$(DMG) + hdiutil attach -noautoopen $(BINDIR)/$(DMG) + cp -R $(BINDIR)/$(APP) /Volumes/$(VOLUME)/ + cp $(BINDIR)/bossac$(EXE) /Volumes/$(VOLUME)/ + cp $(BINDIR)/bossash$(EXE) /Volumes/$(VOLUME)/ + ln -s /Applications /Volumes/$(VOLUME)/Applications + ln -s /usr/bin /Volumes/$(VOLUME)/bin + mkdir /Volumes/$(VOLUME)/.background + cp $(BACKGROUND) /Volumes/$(VOLUME)/.background + osascript < $(INSTALLDIR)/dmgwin.osa + hdiutil detach /Volumes/$(VOLUME)/ + hdiutil convert -format UDBZ -o $(BINDIR)/tmp$(DMG) $(BINDIR)/$(DMG) + mv -f $(BINDIR)/tmp$(DMG) $(BINDIR)/$(DMG) +endif + +# +# OpenBSD rules +# (This is likely to work without changes, but not tested, on other BSDs) +# +ifeq ($(OS),OpenBSD) + +COMMON_SRCS+=PosixSerialPort.cpp BSDPortFactory.cpp + +# This is only needed for bossash, but we can't add it to BOSSASH_LIBS here +# because that one is redefined later. +COMMON_LIBS+=-ltermcap + +# As of 5.7, OpenBSD packages WxWidgets 2.8 +# bossa builds, runs, and appears to play nicely with this version, +# but fails to do anything useful on systems that don't have hardware +# serial ports because of USB detection problems. +# (The SAM's USB programming port doesn't get recognized as a ucom +# device, and a USB serial adaptor attached to the UART gets detected +# by bossa as a USB interface and doesn't fall back to the serial +# programming protocol.) +WXVERSION=2.8 + +endif + +# +# Object files +# +COMMON_OBJS=$(foreach src,$(COMMON_SRCS),$(OBJDIR)/$(src:%.cpp=%.o)) +APPLET_OBJS=$(foreach src,$(APPLET_SRCS),$(OBJDIR)/$(src:%.asm=%.o)) +BOSSA_OBJS=$(APPLET_OBJS) $(COMMON_OBJS) $(foreach src,$(BOSSA_SRCS),$(OBJDIR)/$(src:%.cpp=%.o)) +ifdef BOSSA_RC +BOSSA_OBJS+=$(OBJDIR)/$(BOSSA_RC:%.rc=%.o) +endif +BOSSAC_OBJS=$(APPLET_OBJS) $(COMMON_OBJS) $(foreach src,$(BOSSAC_SRCS),$(OBJDIR)/$(src:%.cpp=%.o)) +BOSSASH_OBJS=$(APPLET_OBJS) $(COMMON_OBJS) $(foreach src,$(BOSSASH_SRCS),$(OBJDIR)/$(src:%.cpp=%.o)) + +# +# Dependencies +# +DEPENDS=$(COMMON_SRCS:%.cpp=$(OBJDIR)/%.d) +DEPENDS+=$(APPLET_SRCS:%.asm=$(OBJDIR)/%.d) +DEPENDS+=$(BOSSA_SRCS:%.cpp=$(OBJDIR)/%.d) +DEPENDS+=$(BOSSAC_SRCS:%.cpp=$(OBJDIR)/%.d) +DEPENDS+=$(BOSSASH_SRCS:%.cpp=$(OBJDIR)/%.d) + +# +# Tools +# +#Q=@ +CXX=g++ +ARM=arm-none-eabi- +ARMAS=$(ARM)as +ARMOBJCOPY=$(ARM)objcopy + +# +# CXX Flags +# +# COMMON_CXXFLAGS+=-Wall -Werror -MT $@ -MD -MP -MF $(@:%.o=%.d) -DVERSION=\"$(VERSION)\" -g -O2 +COMMON_CXXFLAGS+=-Wall -MT $@ -MD -MP -MF $(@:%.o=%.d) -DVERSION=\"$(VERSION)\" -g -O2 +WX_CXXFLAGS:=$(shell wx-config --cxxflags --version=$(WXVERSION)) -DWX_PRECOMP -Wno-ctor-dtor-privacy -O2 -fno-strict-aliasing +BOSSA_CXXFLAGS=$(COMMON_CXXFLAGS) $(WX_CXXFLAGS) +BOSSAC_CXXFLAGS=$(COMMON_CXXFLAGS) +BOSSASH_CXXFLAGS=$(COMMON_CXXFLAGS) + +# +# LD Flags +# +COMMON_LDFLAGS+=-g +BOSSA_LDFLAGS=$(COMMON_LDFLAGS) +BOSSAC_LDFLAGS=$(COMMON_LDFLAGS) +BOSSASH_LDFLAGS=$(COMMON_LDFLAGS) + +# +# Libs +# +COMMON_LIBS+= +WX_LIBS:=$(shell wx-config --libs --version=$(WXVERSION)) $(WX_LIBS) +BOSSA_LIBS=$(COMMON_LIBS) $(WX_LIBS) +BOSSAC_LIBS=$(COMMON_LIBS) +BOSSASH_LIBS=-lreadline $(COMMON_LIBS) + +# +# Main targets +# +all: $(BINDIR)/bossa$(EXE) $(BINDIR)/bossac$(EXE) $(BINDIR)/bossash$(EXE) + +bossac: $(BINDIR)/bossac$(EXE) + +# +# Common rules +# +define common_obj +$(OBJDIR)/$(1:%.cpp=%.o): $(SRCDIR)/$(1) + @echo CPP COMMON $$< + $$(Q)$$(CXX) $$(COMMON_CXXFLAGS) -c -o $$@ $$< +endef +$(foreach src,$(COMMON_SRCS),$(eval $(call common_obj,$(src)))) + +# +# Applet rules +# +define applet_obj +$(SRCDIR)/$(1:%.asm=%.cpp): $(SRCDIR)/$(1) + @echo APPLET $(1:%.asm=%) + $$(Q)$$(ARMAS) -o $$(@:%.o=%.obj) $$< + $$(Q)$$(ARMOBJCOPY) -O binary $$(@:%.o=%.obj) $$(@:%.o=%.bin) + $$(Q)appletgen $(1:%.asm=%) $(SRCDIR) $(OBJDIR) +$(OBJDIR)/$(1:%.asm=%.o): $(SRCDIR)/$(1:%.asm=%.cpp) + @echo CPP APPLET $$< + $$(Q)$$(CXX) $$(COMMON_CXXFLAGS) -c -o $$(@) $$(<:%.asm=%.cpp) +endef +$(foreach src,$(APPLET_SRCS),$(eval $(call applet_obj,$(src)))) + +# +# BOSSA rules +# +define bossa_obj +$(OBJDIR)/$(1:%.cpp=%.o): $(SRCDIR)/$(1) + @echo CPP BOSSA $$< + $$(Q)$$(CXX) $$(BOSSA_CXXFLAGS) -c -o $$@ $$< +endef +$(foreach src,$(BOSSA_SRCS),$(eval $(call bossa_obj,$(src)))) + +# +# Resource rules +# +ifeq ($(OS),MINGW32) +$(OBJDIR)/$(BOSSA_RC:%.rc=%.o): $(RESDIR)/$(BOSSA_RC) + @echo RC $< + $(Q)`wx-config --rescomp --version=$(WXVERSION)` -o $@ $< +endif + +# +# BOSSAC rules +# +define bossac_obj +$(OBJDIR)/$(1:%.cpp=%.o): $(SRCDIR)/$(1) + @echo CPP BOSSAC $$< + $$(Q)$$(CXX) $$(BOSSAC_CXXFLAGS) -c -o $$@ $$< +endef +$(foreach src,$(BOSSAC_SRCS),$(eval $(call bossac_obj,$(src)))) + +# +# BOSSASH rules +# +define bossash_obj +$(OBJDIR)/$(1:%.cpp=%.o): $(SRCDIR)/$(1) + @echo CPP BOSSASH $$< + $$(Q)$$(CXX) $$(BOSSASH_CXXFLAGS) -c -o $$@ $$< +endef +$(foreach src,$(BOSSASH_SRCS),$(eval $(call bossash_obj,$(src)))) + +# +# BMP rules +# +define bossa_bmp +$(SRCDIR)/$(1:%.bmp=%.cpp): $(RESDIR)/$(1) + @echo BIN2C $$< + $(Q)bin2c $$< $$@ +endef +$(foreach bmp,$(BOSSA_BMPS),$(eval $(call bossa_bmp,$(bmp)))) + +# +# Directory rules +# +$(OBJDIR): + @mkdir $@ + +$(BINDIR): + @mkdir $@ + +# +# Target rules +# +$(BOSSA_OBJS): | $(OBJDIR) +$(BINDIR)/bossa$(EXE): $(foreach bmp,$(BOSSA_BMPS),$(SRCDIR)/$(bmp:%.bmp=%.cpp)) $(BOSSA_OBJS) | $(BINDIR) + @echo LD $@ + $(Q)$(CXX) $(BOSSA_LDFLAGS) -o $@ $(BOSSA_OBJS) $(BOSSA_LIBS) + +$(BOSSAC_OBJS): | $(OBJDIR) +$(BINDIR)/bossac$(EXE): $(BOSSAC_OBJS) | $(BINDIR) + @echo LD $@ + $(Q)$(CXX) $(BOSSAC_LDFLAGS) -o $@ $(BOSSAC_OBJS) $(BOSSAC_LIBS) + +$(BOSSASH_OBJS): | $(OBJDIR) +$(BINDIR)/bossash$(EXE): $(BOSSASH_OBJS) | $(BINDIR) + @echo LD $@ + $(Q)$(CXX) $(BOSSASH_LDFLAGS) -o $@ $(BOSSASH_OBJS) $(BOSSASH_LIBS) + +strip-bossa: $(BINDIR)/bossa$(EXE) + @echo STRIP $^ + $(Q)strip $^ + +strip-bossac: $(BINDIR)/bossac$(EXE) + @echo STRIP $^ + $(Q)strip $^ + +strip-bossash: $(BINDIR)/bossash$(EXE) + @echo STRIP $^ + $(Q)strip $^ + +strip: strip-bossa strip-bossac strip-bossash + +clean: + @echo CLEAN + $(Q)rm -rf $(BINDIR) $(OBJDIR) + +# +# Include dependencies +# +-include $(DEPENDS) diff --git a/Bossa/README.md b/Bossa/README.md new file mode 100644 index 0000000..105f4c4 --- /dev/null +++ b/Bossa/README.md @@ -0,0 +1,5 @@ +The bossac command is used to upload the MMDVM firmware to the due. On a Debian Jessie x86 platform, you can apt-get install bossa-cli. +For other platforms, you will need to build boaasc from source. The reposiorry is at use the arduino branch. +git clone -b arduino https://github.com/shumatech/BOSSA. If you build the complete package you will need GUI support installed. If all you want is the command line utility, then replace the Makefile with the included one and run: +make bossac + diff --git a/armv7/bin/bossac b/Bossa/armv7/bin/bossac similarity index 100% rename from armv7/bin/bossac rename to Bossa/armv7/bin/bossac diff --git a/armv7/bin/bossash b/Bossa/armv7/bin/bossash similarity index 100% rename from armv7/bin/bossash rename to Bossa/armv7/bin/bossash diff --git a/upload_firmware.sh b/Bossa/upload_firmware.sh similarity index 100% rename from upload_firmware.sh rename to Bossa/upload_firmware.sh diff --git a/HD44780_Adafruit/HD44780.cpp b/HD44780_Adafruit/HD44780.cpp deleted file mode 100644 index 0604d2f..0000000 --- a/HD44780_Adafruit/HD44780.cpp +++ /dev/null @@ -1,285 +0,0 @@ -/* - * Copyright (C) 2016 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - */ - -#include "HD44780.h" -#include "Log.h" - -#include -#include - -#include -#include - -const char* LISTENING = "Listening "; - - -CHD44780::CHD44780(unsigned int rows, unsigned int cols, const char* callsign, unsigned int dmrid, const std::vector& pins) : -m_rows(rows), -m_cols(cols), -m_callsign(callsign), -m_dmrid(dmrid), -m_rb(pins.at(0U)), -m_strb(pins.at(1U)), -m_d0(pins.at(2U)), -m_d1(pins.at(3U)), -m_d2(pins.at(4U)), -m_d3(pins.at(5U)), -m_fd(-1), -m_dmr(false) -{ - assert(rows > 1U); - assert(cols > 15U); -} - -CHD44780::~CHD44780() -{ -} - -bool CHD44780::open() -{ - ::wiringPiSetup(); - -#ifdef ADAFRUIT_DISPLAY - adafruitLCDSetup(); -#endif - - m_fd = ::lcdInit(m_rows, m_cols, 4, m_rb, m_strb, m_d0, m_d1, m_d2, m_d3, 0, 0, 0, 0); - if (m_fd == -1) { - LogError("Unable to open the HD44780"); - return false; - } - - ::lcdDisplay(m_fd, 1); - ::lcdCursor(m_fd, 0); - ::lcdCursorBlink(m_fd, 0); - - return true; -} - -/////////////////////////////////////////////////////////////////////////////////////////////////// - -#ifdef ADAFRUIT_DISPLAY -void CHD44780::adafruitLCDSetup() -{ - // The other control pins are initialised with lcdInit () - ::mcp23017Setup (AF_BASE, MCP23017); - - // Backlight LEDs, Only one color (RED) - pinMode (AF_RED, OUTPUT); - digitalWrite (AF_RED, LOW); // The colour outputs are inverted. - - // Control signals - pinMode (AF_RW, OUTPUT); - digitalWrite (AF_RW, LOW); -} -#endif - -/////////////////////////////////////////////////////////////////////////////////////////////////// - -void CHD44780::setIdle() -{ - ::lcdClear(m_fd); - - ::lcdPosition(m_fd, 0, 0); - ::lcdPrintf(m_fd, "%-6s / %u", m_callsign, m_dmrid); - - ::lcdPosition(m_fd, 0, 1); - ::lcdPuts(m_fd, "MMDVM Idle"); - - m_dmr = false; -} - -void CHD44780::setError(const char* text) -{ - assert(text != NULL); - - ::lcdClear(m_fd); - - ::lcdPosition(m_fd, 0, 0); - ::lcdPuts(m_fd, "MMDVM"); - - ::lcdPosition(m_fd, 0, 1); - ::lcdPrintf(m_fd, "%s ERROR", text); - - m_dmr = false; -} - -void CHD44780::setLockout() -{ - ::lcdClear(m_fd); - - ::lcdPosition(m_fd, 0, 0); - ::lcdPuts(m_fd, "MMDVM"); - - ::lcdPosition(m_fd, 0, 1); - ::lcdPuts(m_fd, "Lockout"); - - m_dmr = false; -} - -void CHD44780::writeDStar(const char* my1, const char* my2, const char* your, const char* type) -{ - assert(my1 != NULL); - assert(my2 != NULL); - assert(your != NULL); - assert(type != NULL); - - ::lcdClear(m_fd); - - ::lcdPosition(m_fd, 0, 0); - ::lcdPuts(m_fd, "D-Star"); - - if (m_rows > 2U) { - char buffer[40U]; - - ::sprintf(buffer, "%s %.8s/%.4s >", type, my1, my2); - ::lcdPosition(m_fd, 0, 1); - ::lcdPrintf(m_fd, "%.*s", m_cols, buffer); - - ::sprintf(buffer, "%.8s", your); - ::lcdPosition(m_fd, 0, 2); - ::lcdPrintf(m_fd, "%.*s", m_cols, buffer); - } else { - char buffer[40U]; - ::sprintf(buffer, "%s %.8s/%.4s > %.8s", type, my1, my2, your); - - ::lcdPosition(m_fd, 0, 1); - ::lcdPrintf(m_fd, "%.*s", m_cols, buffer); - } - - m_dmr = false; -} - -void CHD44780::clearDStar() -{ - if (m_rows > 2U) { - ::lcdPosition(m_fd, 0, 1); - ::lcdPrintf(m_fd, "%.*s", m_cols, LISTENING); - - ::lcdPosition(m_fd, 0, 2); - ::lcdPrintf(m_fd, "%.*s", m_cols, " "); - } else { - ::lcdPosition(m_fd, 0, 1); - ::lcdPrintf(m_fd, "%.*s", m_cols, LISTENING); - } -} - -void CHD44780::writeDMR(unsigned int slotNo, const char* src, bool group, const char* dst, const char* type) -{ - assert(src != NULL); - assert(type != NULL); - - if (!m_dmr) { - ::lcdClear(m_fd); - - if (m_rows > 2U) { - ::lcdPosition(m_fd, 0, 0); - ::lcdPuts(m_fd, "DMR"); - } - - if (slotNo == 1U) { - ::lcdPosition(m_fd, 0, m_rows > 2U ? 2 : 1); - ::lcdPrintf(m_fd, "2 %.*s", m_cols - 2U, LISTENING); - } else { - ::lcdPosition(m_fd, 0, m_rows > 2U ? 1 : 0); - ::lcdPrintf(m_fd, "1 %.*s", m_cols - 2U, LISTENING); - } - } - - if (slotNo == 1U) { - char buffer[40U]; - if (m_cols > 16U) - ::sprintf(buffer, "%s %s > %s%s", type, src, group ? "TG" : "", dst); - else - ::sprintf(buffer, "%s > %s%s", src, group ? "TG" : "", dst); - - ::lcdPosition(m_fd, 0, m_rows > 2U ? 1 : 0); - ::lcdPrintf(m_fd, "1 %.*s", m_cols - 2U, buffer); - } else { - char buffer[40U]; - if (m_cols > 16U) - ::sprintf(buffer, "%s %s > %s%s", type, src, group ? "TG" : "", dst); - else - ::sprintf(buffer, "%s > %s%s", src, group ? "TG" : "", dst); - - ::lcdPosition(m_fd, 0, m_rows > 2U ? 2 : 1); - ::lcdPrintf(m_fd, "2 %.*s", m_cols - 2U, buffer); - } - - m_dmr = true; -} - -void CHD44780::clearDMR(unsigned int slotNo) -{ - if (slotNo == 1U) { - ::lcdPosition(m_fd, 0, m_rows > 2U ? 1 : 0); - ::lcdPrintf(m_fd, "1 %.*s", m_cols - 2U, LISTENING); - } else { - ::lcdPosition(m_fd, 0, m_rows > 2U ? 2 : 1); - ::lcdPrintf(m_fd, "2 %.*s", m_cols - 2U, LISTENING); - } -} - -void CHD44780::writeFusion(const char* source, const char* dest) -{ - assert(source != NULL); - assert(dest != NULL); - - ::lcdClear(m_fd); - - ::lcdPosition(m_fd, 0, 0); - ::lcdPuts(m_fd, "System Fusion"); - - if (m_rows > 2U) { - char buffer[40U]; - - ::sprintf(buffer, "%.10s >", source); - ::lcdPosition(m_fd, 0, 1); - ::lcdPrintf(m_fd, "%.*s", m_cols, buffer); - - ::sprintf(buffer, "%.10s", dest); - ::lcdPosition(m_fd, 0, 2); - ::lcdPrintf(m_fd, "%.*s", m_cols, buffer); - } else { - char buffer[40U]; - ::sprintf(buffer, "%.10s > %.10s", source, dest); - - ::lcdPosition(m_fd, 0, 1); - ::lcdPrintf(m_fd, "%.*s", m_cols, buffer); - } - - m_dmr = false; -} - -void CHD44780::clearFusion() -{ - if (m_rows > 2U) { - ::lcdPosition(m_fd, 0, 1); - ::lcdPrintf(m_fd, "%.*s", m_cols, LISTENING); - - ::lcdPosition(m_fd, 0, 2); - ::lcdPrintf(m_fd, "%.*s", m_cols, ""); - } else { - ::lcdPosition(m_fd, 0, 1); - ::lcdPrintf(m_fd, "%.*s", m_cols, LISTENING); - } -} - -void CHD44780::close() -{ -} diff --git a/HD44780_Adafruit/HD44780.h b/HD44780_Adafruit/HD44780.h deleted file mode 100644 index 6333b6c..0000000 --- a/HD44780_Adafruit/HD44780.h +++ /dev/null @@ -1,82 +0,0 @@ -/* - * Copyright (C) 2016 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - */ - -#if !defined(HD44780_H) -#define HD44780_H - -#include "Display.h" - -#include -#include - -#include - -// Defines for the Adafruit Pi LCD interface board -#ifdef ADAFRUIT_DISPLAY -#define AF_BASE 100 -#define AF_RED (AF_BASE + 6) -#define AF_RW (AF_BASE + 14) -#define MCP23017 0x20 -#endif - -class CHD44780 : public IDisplay -{ -public: - CHD44780(unsigned int rows, unsigned int cols, const char* callsign, unsigned int dmrid, const std::vector& pins); - virtual ~CHD44780(); - - virtual bool open(); - - virtual void setIdle(); - - virtual void setError(const char* text); - virtual void setLockout(); - - virtual void writeDStar(const char* my1, const char* my2, const char* your, const char* type); - virtual void clearDStar(); - - virtual void writeDMR(unsigned int slotNo, const char* src, bool group, const char* dst, const char* type); - virtual void clearDMR(unsigned int slotNo); - - virtual void writeFusion(const char* source, const char* dest); - virtual void clearFusion(); - - virtual void close(); - - -private: - unsigned int m_rows; - unsigned int m_cols; - const char* m_callsign; - unsigned int m_dmrid; - unsigned int m_rb; - unsigned int m_strb; - unsigned int m_d0; - unsigned int m_d1; - unsigned int m_d2; - unsigned int m_d3; - int m_fd; - bool m_dmr; - -#ifdef ADAFRUIT_DISPLAY - void adafruitLCDSetup(); -#endif - -}; - -#endif diff --git a/HD44780_Adafruit/MMDVM.ini.Adafruit b/HD44780_Adafruit/MMDVM.ini.Adafruit deleted file mode 100644 index 175b462..0000000 --- a/HD44780_Adafruit/MMDVM.ini.Adafruit +++ /dev/null @@ -1,6 +0,0 @@ -[HD44780] -Rows=2 -Columns=16 -# rs, strb, d0, d1, d2, d3 -Pins=115,113,112,111,110,109 - diff --git a/HD44780_Adafruit/Makefile.Pi.Adafruit b/HD44780_Adafruit/Makefile.Pi.Adafruit deleted file mode 100644 index 2183ab9..0000000 --- a/HD44780_Adafruit/Makefile.Pi.Adafruit +++ /dev/null @@ -1,25 +0,0 @@ -# This makefile is for use with the Raspberry Pi when using an HD44780 compatible display. The wiringpi library is needed. - -CC = gcc -CXX = g++ -CFLAGS = -g -O3 -Wall -std=c++0x -DHD44780 -DADAFRUIT_DISPLAY -I/usr/local/include -LIBS = -lwiringPi -lwiringPiDev -LDFLAGS = -g -L/usr/local/lib - -OBJECTS = \ - AMBEFEC.o BPTC19696.o Conf.o CRC.o Display.o DMRControl.o DMRCSBK.o DMRData.o DMRDataHeader.o DMREMB.o DMREmbeddedLC.o DMRFullLC.o DMRIPSC.o DMRLookup.o DMRLC.o \ - DMRShortLC.o DMRSlot.o DMRSlotType.o DStarControl.o DStarHeader.o DStarNetwork.o DStarSlowData.o Golay2087.o Golay24128.o Hamming.o HD44780.o Log.o MMDVMHost.o \ - Modem.o Nextion.o NullDisplay.o QR1676.o RS129.o SerialController.o SHA256.o StopWatch.o Sync.o TFTSerial.o Timer.o Trellis.o UDPSocket.o Utils.o YSFControl.o \ - YSFConvolution.o YSFFICH.o YSFParrot.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 *~ - diff --git a/README.md b/README.md index f0b02da..187ba90 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ Scripts and config files to run the MMDVM on Debian Jessie Start MMDVMHost at boot time (systemd) -Restart MMDVM on failure (systemd or watchdog) +Restart MMDVM on failure (systemd) Log to /var/log