Skip to content

Commit

Permalink
New version to support 2 receivers
Browse files Browse the repository at this point in the history
  • Loading branch information
g0orx committed Feb 13, 2017
1 parent 1986314 commit a035bb1
Show file tree
Hide file tree
Showing 107 changed files with 12,972 additions and 6,653 deletions.
138 changes: 78 additions & 60 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,31 +3,51 @@
GIT_DATE := $(firstword $(shell git --no-pager show --date=short --format="%ai" --name-only))
GIT_VERSION := $(shell git describe --abbrev=0 --tags)

# uncomment the line below to include GPIO
GPIO_INCLUDE=GPIO

# uncomment the line below to include USB Ozy support
USBOZY_INCLUDE=USBOZY

# uncomment the line below to include support for psk31
PSK_INCLUDE=PSK
#PSK_INCLUDE=PSK

# uncomment the line to below include support for FreeDV codec2
FREEDV_INCLUDE=FREEDV
#FREEDV_INCLUDE=FREEDV

# uncomment the line to below include support for sx1509 i2c expander
#SX1509_INCLUDE=sx1509

# uncomment the line to below include support local CW keyer
#LOCALCW_INCLUDE=LOCALCW

# uncomment the line below to include MCP23017 I2C
#I2C_INCLUDE=I2C

#uncomment the line below for the platform being compiled on
UNAME_N=raspberrypi
#UNAME_N=raspberrypi
#UNAME_N=odroid
#UNAME_N=up
#UNAME_N=pine64
#UNAME_N=x86
UNAME_N=x86

CC=gcc
LINK=gcc

# uncomment the line below for various debug facilities
#DEBUG_OPTION=-D DEBUG

ifeq ($(USBOZY_INCLUDE),USBOZY)
USBOZY_OPTIONS=-D USBOZY
USBOZY_LIBS=-lusb-1.0
USBOZY_SOURCES= \
ozyio.c
USBOZY_HEADERS= \
ozyio.h
USBOZY_OBJS= \
ozyio.o
endif

# uncomment the line below for LimeSDR (uncomment line below)
#LIMESDR_INCLUDE=LIMESDR

Expand Down Expand Up @@ -88,50 +108,39 @@ beep.o \
iambic.o
endif

#required for MRAA GPIO
#MRAA_INCLUDE=MRAA

ifeq ($(MRAA_INCLUDE),MRAA)
GPIO_OPTIONS=-D GPIO
GPIO_LIBS=-lmraa
GPIO_SOURCES= \
gpio_mraa.c
GPIO_HEADERS= \
gpio.h
GPIO_OBJS= \
gpio_mraa.o
else
ifeq ($(UNAME_N),raspberrypi)
ifeq ($(GPIO_INCLUDE),GPIO)
GPIO_OPTIONS=-D GPIO
GPIO_LIBS=-lwiringPi -lpigpio
endif
ifeq ($(UNAME_N),odroid)
GPIO_LIBS=-lwiringPi
endif
ifeq ($(SX1509_INCLUDE),sx1509)
GPIO_OPTIONS=-D GPIO
GPIO_OPTIONS+=-D sx1509
GPIO_LIBS+=-lsx1509
endif
GPIO_SOURCES= \
gpio.c
gpio.c \
encoder_menu.c
GPIO_HEADERS= \
gpio.h
gpio.h \
encoder_menu.h
GPIO_OBJS= \
gpio.o
gpio.o \
encoder_menu.o
endif

ifeq ($(I2C_INCLUDE),I2C)
I2C_OPTIONS=-D I2C
I2C_SOURCES=i2c.c
I2C_HEADERS=i2c.h
I2C_OBJS=i2c.o
endif

#uncomment if build for SHORT FRAMES (MIC and Audio)
SHORT_FRAMES="-D SHORT_FRAMES"
SHORT_FRAMES=-D SHORT_FRAMES

GTKINCLUDES=`pkg-config --cflags gtk+-3.0`
GTKLIBS=`pkg-config --libs gtk+-3.0`

AUDIO_LIBS=-lasound
#AUDIO_LIBS=-lsoundio

OPTIONS=-g -D $(UNAME_N) $(GPIO_OPTIONS) $(LIMESDR_OPTIONS) $(FREEDV_OPTIONS) $(LOCALCW_OPTIONS) $(PSK_OPTIONS) $(SHORT_FRAMES) -D GIT_DATE='"$(GIT_DATE)"' -D GIT_VERSION='"$(GIT_VERSION)"' $(DEBUG_OPTION) -O3
OPTIONS=-g -Wno-deprecated-declarations -D $(UNAME_N) $(USBOZY_OPTIONS) $(I2C_OPTIONS) $(GPIO_OPTIONS) $(LIMESDR_OPTIONS) $(FREEDV_OPTIONS) $(LOCALCW_OPTIONS) $(PSK_OPTIONS) $(SHORT_FRAMES) -D GIT_DATE='"$(GIT_DATE)"' -D GIT_VERSION='"$(GIT_VERSION)"' $(DEBUG_OPTION) -O3

LIBS=-lrt -lm -lwdsp -lpthread $(AUDIO_LIBS) $(PSKLIBS) $(GTKLIBS) $(GPIO_LIBS) $(SOAPYSDRLIBS) $(FREEDVLIBS)
LIBS=-lrt -lm -lwdsp -lpthread $(AUDIO_LIBS) $(USBOZY_LIBS) $(PSKLIBS) $(GTKLIBS) $(GPIO_LIBS) $(SOAPYSDRLIBS) $(FREEDVLIBS)
INCLUDES=$(GTKINCLUDES)

COMPILE=$(CC) $(OPTIONS) $(INCLUDES)
Expand All @@ -144,12 +153,13 @@ band.c \
configure.c \
frequency.c \
discovered.c \
discovery.c \
filter.c \
main.c \
new_menu.c \
exit_menu.c \
general_menu.c \
audio_menu.c \
radio_menu.c \
rx_menu.c \
ant_menu.c \
display_menu.c \
dsp_menu.c \
Expand All @@ -166,34 +176,36 @@ mode_menu.c \
filter_menu.c \
noise_menu.c \
agc_menu.c \
fm_menu.c \
vox_menu.c \
diversity_menu.c \
freqent_menu.c \
tx_menu.c \
vfo_menu.c \
test_menu.c \
rit.c \
meter.c \
mode.c \
old_discovery.c \
new_discovery.c \
old_protocol.c \
new_protocol.c \
new_protocol_programmer.c \
panadapter.c \
rx_panadapter.c \
tx_panadapter.c \
property.c \
radio.c \
receiver.c \
rigctl.c \
signal.c \
splash.c \
toolbar.c \
transmitter.c \
sliders.c \
version.c \
vfo.c \
waterfall.c \
wdsp_init.c \
button_text.c \
vox.c \
update.c \
store.c \
store_menu.c \
memory.c


Expand All @@ -207,11 +219,12 @@ frequency.h \
bandstack.h \
channel.h \
discovered.h \
discovery.h \
filter.h \
new_menu.h \
rx_menu.h \
exit_menu.h \
general_menu.h \
audio_menu.h \
radio_menu.h \
ant_menu.h \
display_menu.h \
dsp_menu.h \
Expand All @@ -228,33 +241,35 @@ mode_menu.h \
filter_menu.h \
noise_menu.h \
agc_menu.h \
fm_menu.h \
vox_menu.h \
diversity_menu.h \
freqent_menu.h \
tx_menu.h \
vfo_menu.h \
test_menu.h \
rit.h \
meter.h \
mode.h \
old_discovery.h \
new_discovery.h \
old_protocol.h \
new_protocol.h \
panadapter.h \
rx_panadapter.h \
tx_panadapter.h \
property.h \
radio.h \
receiver.h \
rigctl.h \
signal.h \
splash.h \
toolbar.h \
transmitter.h \
sliders.h \
version.h \
vfo.h \
waterfall.h \
wdsp_init.h \
button_text.h \
vox.h \
update.h \
store.h \
store_menu.h \
memory.h


Expand All @@ -264,13 +279,14 @@ band.o \
configure.o \
frequency.o \
discovered.o \
discovery.o \
filter.o \
version.o \
main.o \
new_menu.o \
rx_menu.o \
exit_menu.o \
general_menu.o \
audio_menu.o \
radio_menu.o \
ant_menu.o \
display_menu.o \
dsp_menu.o \
Expand All @@ -287,42 +303,44 @@ mode_menu.o \
filter_menu.o \
noise_menu.o \
agc_menu.o \
fm_menu.o \
vox_menu.o \
diversity_menu.o \
freqent_menu.o \
tx_menu.o \
vfo_menu.o \
test_menu.o \
rit.o \
meter.o \
mode.o \
old_discovery.o \
new_discovery.o \
old_protocol.o \
new_protocol.o \
new_protocol_programmer.o \
panadapter.o \
rx_panadapter.o \
tx_panadapter.o \
property.o \
radio.o \
receiver.o \
rigctl.o \
signal.o \
splash.o \
toolbar.o \
transmitter.o \
sliders.o \
vfo.o \
waterfall.o \
wdsp_init.o \
button_text.o \
vox.o \
update.o \
store.o \
store_menu.o \
memory.o

all: prebuild $(PROGRAM) $(HEADERS) $(LIMESDR_HEADERS) $(FREEDV_HEADERS) $(LOCALCW_HEADERS) $(GPIO_HEADERS) $(PSK_HEADERS) $(SOURCES) $(LIMESDR_SOURCES) $(FREEDV_SOURCES) $(GPIO_SOURCES) $(PSK_SOURCES)
all: prebuild $(PROGRAM) $(HEADERS) $(USBOZY_HEADERS) $(LIMESDR_HEADERS) $(FREEDV_HEADERS) $(LOCALCW_HEADERS) $(I2C_HEADERS) $(GPIO_HEADERS) $(PSK_HEADERS) $(SOURCES) $(USBOZY_SOURCES) $(LIMESDR_SOURCES) $(FREEDV_SOURCES) $(I2C_SOURCES) $(GPIO_SOURCES) $(PSK_SOURCES)

prebuild:
rm -f version.o

$(PROGRAM): $(OBJS) $(LIMESDR_OBJS) $(FREEDV_OBJS) $(LOCALCW_OBJS) $(GPIO_OBJS) $(PSK_OBJS)
$(LINK) -o $(PROGRAM) $(OBJS) $(GPIO_OBJS) $(LIMESDR_OBJS) $(FREEDV_OBJS) $(LOCALCW_OBJS) $(PSK_OBJS) $(LIBS)
$(PROGRAM): $(OBJS) $(USBOZY_OBJS) $(LIMESDR_OBJS) $(FREEDV_OBJS) $(LOCALCW_OBJS) $(I2C_OBJS) $(GPIO_OBJS) $(PSK_OBJS)
$(LINK) -o $(PROGRAM) $(OBJS) $(USBOZY_OBJS) $(I2C_OBJS) $(GPIO_OBJS) $(LIMESDR_OBJS) $(FREEDV_OBJS) $(LOCALCW_OBJS) $(PSK_OBJS) $(LIBS)

.c.o:
$(COMPILE) -c -o $@ $<
Expand Down
21 changes: 14 additions & 7 deletions agc_menu.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
#include "band.h"
#include "channel.h"
#include "radio.h"
#include "receiver.h"
#include "vfo.h"
#include "button_text.h"

Expand All @@ -44,8 +45,9 @@ static gboolean close_cb (GtkWidget *widget, GdkEventButton *event, gpointer dat
}

static gboolean agc_select_cb (GtkWidget *widget, gpointer data) {
agc=(int)data;
wdsp_set_agc(CHANNEL_RX0, agc);
active_receiver->agc=(int)data;
//wdsp_set_agc(CHANNEL_RX0, agc);
set_agc(active_receiver, active_receiver->agc);
vfo_update(NULL);
}

Expand Down Expand Up @@ -80,37 +82,42 @@ void agc_menu(GtkWidget *parent) {
g_signal_connect (close_b, "pressed", G_CALLBACK(close_cb), NULL);
gtk_grid_attach(GTK_GRID(grid),close_b,0,0,1,1);

char label[32];
sprintf(label,"RX %d VFO %s",active_receiver->id,active_receiver->id==0?"A":"B");
GtkWidget *rx_label=gtk_label_new(label);
gtk_grid_attach(GTK_GRID(grid),rx_label,1,0,1,1);

GtkWidget *b_off=gtk_radio_button_new_with_label(NULL,"Off");
//gtk_widget_override_font(b_off, pango_font_description_from_string("Arial 16"));
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (b_off), agc==AGC_OFF);
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (b_off), active_receiver->agc==AGC_OFF);
gtk_widget_show(b_off);
gtk_grid_attach(GTK_GRID(grid),b_off,0,1,2,1);
g_signal_connect(b_off,"pressed",G_CALLBACK(agc_select_cb),(gpointer *)AGC_OFF);

GtkWidget *b_long=gtk_radio_button_new_with_label_from_widget(GTK_RADIO_BUTTON(b_off),"Long");
//gtk_widget_override_font(b_long, pango_font_description_from_string("Arial 16"));
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (b_long), agc==AGC_LONG);
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (b_long), active_receiver->agc==AGC_LONG);
gtk_widget_show(b_long);
gtk_grid_attach(GTK_GRID(grid),b_long,0,2,2,1);
g_signal_connect(b_long,"pressed",G_CALLBACK(agc_select_cb),(gpointer *)AGC_LONG);

GtkWidget *b_slow=gtk_radio_button_new_with_label_from_widget(GTK_RADIO_BUTTON(b_long),"Slow");
//gtk_widget_override_font(b_slow, pango_font_description_from_string("Arial 16"));
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (b_slow), agc==AGC_SLOW);
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (b_slow), active_receiver->agc==AGC_SLOW);
gtk_widget_show(b_slow);
gtk_grid_attach(GTK_GRID(grid),b_slow,0,3,2,1);
g_signal_connect(b_slow,"pressed",G_CALLBACK(agc_select_cb),(gpointer *)AGC_SLOW);

GtkWidget *b_medium=gtk_radio_button_new_with_label_from_widget(GTK_RADIO_BUTTON(b_slow),"Medium");
//gtk_widget_override_font(b_medium, pango_font_description_from_string("Arial 16"));
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (b_medium), agc==AGC_MEDIUM);
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (b_medium), active_receiver->agc==AGC_MEDIUM);
gtk_widget_show(b_medium);
gtk_grid_attach(GTK_GRID(grid),b_medium,0,4,2,1);
g_signal_connect(b_medium,"pressed",G_CALLBACK(agc_select_cb),(gpointer *)AGC_MEDIUM);

GtkWidget *b_fast=gtk_radio_button_new_with_label_from_widget(GTK_RADIO_BUTTON(b_medium),"Fast");
//gtk_widget_override_font(b_fast, pango_font_description_from_string("Arial 16"));
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (b_fast), agc==AGC_FAST);
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (b_fast), active_receiver->agc==AGC_FAST);
gtk_widget_show(b_fast);
gtk_grid_attach(GTK_GRID(grid),b_fast,0,5,2,1);
g_signal_connect(b_fast,"pressed",G_CALLBACK(agc_select_cb),(gpointer *)AGC_FAST);
Expand Down
Loading

0 comments on commit a035bb1

Please sign in to comment.