Skip to content

Commit

Permalink
OrangeThunder_baseline
Browse files Browse the repository at this point in the history
  • Loading branch information
lu7did committed May 25, 2020
1 parent 61c6128 commit c553b6e
Show file tree
Hide file tree
Showing 27 changed files with 84 additions and 1,705 deletions.
Binary file modified bin/OT4D
Binary file not shown.
Binary file modified bin/decodeFT8
Binary file not shown.
Binary file modified bin/demo_genSSB
Binary file not shown.
Binary file modified bin/genSSB
Binary file not shown.
14 changes: 1 addition & 13 deletions src/Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
all: ../bin/rtl_fm ../bin/demo_rtlfm ../bin/genSSB ../bin/demo_genSSB ../bin/OT4D ../bin/demo_gpio ../bin/gpioWrapper ../bin/decodeFT8 ../bin/decimator ../bin/demo_decodeFT8 ../bin/demo_craddle ../bin/pift8 ../bin/sendRF ../bin/gpio
all: ../bin/rtl_fm ../bin/demo_rtlfm ../bin/genSSB ../bin/demo_genSSB ../bin/OT4D ../bin/decodeFT8 ../bin/decimator ../bin/demo_decodeFT8 ../bin/pift8 ../bin/sendRF

CCP = c++
CC = cc
Expand Down Expand Up @@ -46,12 +46,6 @@ LSDR = /usr/local/lib/librtlsdr.a
$(CCP) $(OSC_CFLAGS) $(CXYFLAGS) -o ../bin/genSSB lib/genSSB.cpp $(LDFLAGS)


../bin/demo_gpio : lib/demo_gpio.c
$(GCC) -o ../bin/demo_gpio ./lib/demo_gpio.c $(CFLAGS)

../bin/gpio : lib/gpio.cpp
$(CCP) $(OSC_CFLAGS) $(CXYFLAGS) -g -o ../bin/gpio ./lib/gpio.cpp $(LDFLAGS)

../bin/demo_genDDS : lib/demo_genDDS.cpp lib/genDDS.h
$(CCP) -o ../bin/demo_genDDS ./lib/demo_genDDS.cpp ./lib/genDDS.h $(LDFLAGS)

Expand All @@ -71,31 +65,25 @@ LSDR = /usr/local/lib/librtlsdr.a
$(CCP) $(OSC_CFLAGS) $(CXYFLAGS) -o ../bin/sendRF lib/sendRF.cpp $(LDFLAGS)



clean:
rm -r ../bin/OT4D
# rm -r ../bin/gpioWrapper
rm -r ../bin/rtl_fm
rm -r ../bin/genSSB
rm -r ../bin/demo_rtlfm
rm -r ../bin/decimator
rm -r ../bin/demo_rtlfm
# rm -r ../bin/demo_gpio
rm -r ../bin/demo_decodeFT8
rm -r ../bin/demo_genSSB
rm -r ../bin/decodeFT8
rm -r ../bin/gpio
rm -r ../bin/sendRF
rm -r ../bin/pift8

install: all
install -m 0755 ../bin/OT4D /usr/bin
# install -m 0755 ../bin/gpioWrapper /usr/bin
install -m 0755 ../bin/rtl_fm /usr/bin
install -m 0755 ../bin/genSSB /usr/bin
install -m 0755 ../bin/demo_rtlfm /usr/bin
install -m 0755 ../bin/demo_decodeFT8 /usr/bin
install -m 0755 ../bin/gpio /usr/bin
install -m 0755 ../bin/decimator /usr/bin
install -m 0755 ../bin/pift8 /usr/bin
install -m 0755 ../bin/decodeFT8 /usr/bin
Expand Down
31 changes: 0 additions & 31 deletions src/OT/OT.cpp

This file was deleted.

9 changes: 7 additions & 2 deletions src/OT4D/OT4D.h
Original file line number Diff line number Diff line change
Expand Up @@ -348,7 +348,6 @@ void CATchangeStatus() {
vfo->setVFO(getWord(cat->FT817,VFO));
(TRACE >=0x01 ? fprintf(stderr,"%s:CATchangeStatus() VFO changed to VFO(%d)\n",PROGRAMID,getWord(cat->FT817,VFO)) : _NOP);
}
//FT817=cat->FT817;
return;

}
Expand Down Expand Up @@ -383,7 +382,7 @@ void changeSNR() {

}
//--------------------------------------------------------------------------------------------------
// callback for vfo
// callback for vfo (change Frequency)
//--------------------------------------------------------------------------------------------------
void vfoChangeFreq(float f) {

Expand All @@ -396,6 +395,9 @@ char* b;
(TRACE>=0x02 ? fprintf(stderr,"%s:vfoChangeFreq() VFO(%s) f(%5.0f) fA(%5.0f) fB(%5.0f) PTT(%s)\n",PROGRAMID,b,vfo->get(),vfo->get(VFOA),vfo->get(VFOB),BOOL2CHAR(vfo->getPTT())) : _NOP);
return;
}
//--------------------------------------------------------------------------------------------------
// callback for vfo (change mode)
//--------------------------------------------------------------------------------------------------
void vfoChangeMode(byte m) {

char* b;
Expand All @@ -409,6 +411,9 @@ char* b;
(TRACE>=0x02 ? fprintf(stderr,"%s:vfoChangeMode() mode(%s)\n",PROGRAMID,b) : _NOP);

}
//--------------------------------------------------------------------------------------------------
// callback for vfo (change status)
//--------------------------------------------------------------------------------------------------
void vfoChangeStatus(byte S) {

if (getWord(S,SPLIT)==true) {
Expand Down
68 changes: 25 additions & 43 deletions src/crypt/OT.cpp
Original file line number Diff line number Diff line change
@@ -1,49 +1,31 @@
/*
* OT.cpp
* Raspberry Pi based USB experimental SSB Generator for digital modes (mainly WSPR and FT8)
* Experimental version largely modelled after rtl_fm and librpitx
* This program tries to mimic the behaviour of simple QRP SSB transceivers
* SSB generation by the librpitx library isn´t linear but not much different from
* highly compressed HF SSB voice signals, the TAPR amplifier isn´t much linear either.
* So the transceiver is specially suited to PSK and FSK modulated modes such as WSPR,FT8, SSTV, CW or PSK31.
*---------------------------------------------------------------------
* This program is a sister project from a Raspberry Pi used to control
* a Pixie transceiver hardware.
* Project at http://www.github.com/lu7did/PixiePi
*---------------------------------------------------------------------
*
/*
* OT
*-----------------------------------------------------------------------------
* simple USB transceiver for the OrangeThunder project
* Copyright (C) 2020 by Pedro Colla <lu7did@gmail.com>
* ----------------------------------------------------------------------------
* Copyright (C) 2012 by Steve Markgraf <steve@steve-m.de>
* Copyright (C) 2012 by Hoernchen <la@tfc-server.de>
* Copyright (C) 2012 by Kyle Keen <keenerd@gmail.com>
* Copyright (C) 2013 by Elias Oenal <EliasOenal@gmail.com>
*
* Created by Pedro E. Colla (lu7did@gmail.com)
* Code excerpts from several packages:
* rtl_fm.c from Steve Markgraf <steve@steve-m.de> and others
* Adafruit's python code for CharLCDPlate
* tune.cpp from rpitx package by Evariste Courjaud F5OEO
* sendiq.cpp from rpitx package (also) by Evariste Coujaud (F5EOE)
* wiringPi library (git clone git://git.drogon.net/wiringPi)
* iambic-keyer (https://github.com/n1gp/iambic-keyer)
* log.c logging facility by rxi https://github.com/rxi/log.c
* minIni configuration management package by Compuphase https://github.com/compuphase/minIni/tree/master/dev
* tinyalsa https://github.com/tinyalsa/tinyalsa
* PJ_RPI GPIO low level handler git clone git://github.com/Pieter-Jan/PJ_RPI.git
* Also libraries
* librpitx by Evariste Courjaud (F5EOE)
* libcsdr by Karol Simonyi (HA7ILM) https://github.com/compuphase/minIni/tree/master/dev
*
* ---------------------------------------------------------------------
* This program is free software; you can redistribute it and/or modify
* 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
* 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., 51 Franklin Street, Fifth Floor, Boston,
* MA 02110-1301, USA.
*/
*/

#define OT4D
#include "/home/pi/OrangeThunder/src/OT4D/OT4D.cpp"

// *************************************************************************************************
// * Personalization directive *
// *************************************************************************************************

#define OT4D


// *************************************************************************************************
// * Main code library *
// *************************************************************************************************

#include "/home/pi/OrangeThunder/src/OT4D/OT4D.cpp"
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
26 changes: 10 additions & 16 deletions src/crypt/gpioWrapper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,7 @@ void handleGPIOAlert(int g, int level, uint32_t tick)
long mtime, seconds, useconds;
int k=0;

(TRACE>=0x03 ? fprintf(stderr,"%s:handleGPIOAlert() ISR Handler pin number(%d) level(%d) tick(%ld)\n",PROGRAMID,g,level,(long int)tick) : _NOP);
(TRACE>=0x02 ? fprintf(stderr,"%s:handleGPIOAlert() ISR Handler pin number(%d) level(%d) tick(%ld)\n",PROGRAMID,g,level,(long int)tick) : _NOP);

if (g<=0 || g>=32) {
(TRACE>=0x02 ? fprintf(stderr,"%s:handleGPIOAlert() invalid pin number(%d), ignored!\n",PROGRAMID,g) : _NOP);
Expand All @@ -284,7 +284,7 @@ int k=0;
return;
}

if (level == 0) {
if (level == 1) { //React to high level

if (gpio[g].BMULTI==false) {
(TRACE>=0x02 ? fprintf(stderr,"%s:handleGPIOAlert() pin number(%d) timer not running, ignored!\n",PROGRAMID,g) : _NOP);
Expand Down Expand Up @@ -312,13 +312,14 @@ int k=0;
(TRACE >= 0x02 ? fprintf(stderr,"%s:handleGPIOAlert() Pin(%d) pushed short t(%ld) ms\n",PROGRAMID,g,mtime) : _NOP);
gpio[g].KDOWN=false;
}
if (gpio[g].KDOWN==true && gpio[g].longpush==true) {k=2;} else {k=1;}
if (gpio[g].KDOWN==true) {k=2;} else {k=1;}
fprintf(stderr,"GPIO%d=%1d\n", g, k);
gpio[g].BMULTI=false;
gpio[g].KDOWN=false;
return;
}
}

if (gpio[g].BMULTI==true) {
(TRACE >= 0x03 ? fprintf(stderr,"%s:handleGPIOAlert() Received request to start while processing previouspin(%d). Ignored!\n",PROGRAMID,g) : _NOP);
return;
Expand All @@ -328,7 +329,7 @@ int k=0;
gpio[g].BMULTI=true;
(TRACE >= 0x02 ? fprintf(stderr,"%s:handleGPIOAlert() >>> Button(%d) pressed. Start of timer!\n",PROGRAMID,g) : _NOP);
k=0;
fprintf(stderr,"GPIO%d=%1d\n", g, k);
//fprintf(stderr,"GPIO%d=%1d\n", g, k);

}
// *--------------------------[Rotary Encoder Interrupt Handler]--------------------------------------
Expand Down Expand Up @@ -409,24 +410,24 @@ int j=0;
case 'p': {
int p=parseport(optarg,&gpio[0]);
if (p==-1) {
(TRACE >= 0x01 ? fprintf(stderr,"%s port(?) invalid, ignored!\n",PROGRAMID) : _NOP);
(TRACE >= 0x02 ? fprintf(stderr,"%s port(?) invalid, ignored!\n",PROGRAMID) : _NOP);
} else {
gpio[p].active=true;
(TRACE >= 0x01 ? fprintf(stderr,"%s port=[%d,%s,%s] set\n",PROGRAMID,p,BOOL2CHAR(gpio[p].mode),BOOL2CHAR(gpio[p].pullup)) : _NOP);
(TRACE >= 0x02 ? fprintf(stderr,"%s port=[%d,%s,%s] set\n",PROGRAMID,p,BOOL2CHAR(gpio[p].mode),BOOL2CHAR(gpio[p].pullup)) : _NOP);
}
break; }
case 'q': {
q = true;
(TRACE >= 0x01 ? fprintf(stderr,"%s QUIT=%s\n",PROGRAMID,BOOL2CHAR(q)) : _NOP);
(TRACE >= 0x02 ? fprintf(stderr,"%s QUIT=%s\n",PROGRAMID,BOOL2CHAR(q)) : _NOP);
break; }
case 'e': {
encoder=true;
(TRACE >= 0x01 ? fprintf(stderr,"%s ENCODER=%s\n",PROGRAMID,BOOL2CHAR(encoder)) : _NOP);
(TRACE >= 0x02 ? fprintf(stderr,"%s ENCODER=%s\n",PROGRAMID,BOOL2CHAR(encoder)) : _NOP);
break;
}
case 'v': {
TRACE = (byte)(atoi(optarg));
(TRACE >= 0x01 ? fprintf(stderr,"%s TRACE=%d\n",PROGRAMID,TRACE) : _NOP);
(TRACE >= 0x02 ? fprintf(stderr,"%s TRACE=%d\n",PROGRAMID,TRACE) : _NOP);
break; }
case 'h':
default: {
Expand All @@ -449,13 +450,6 @@ int j=0;
}
}


for (int i=0;i<64;i++) {

gpioSetSignalFunc(i,sighandler);

}

sigaction(SIGINT, &sigact, NULL);
sigaction(SIGTERM, &sigact, NULL);
sigaction(SIGQUIT, &sigact, NULL);
Expand Down
Loading

0 comments on commit c553b6e

Please sign in to comment.