# uncomment the line to below include support local CW keyer
#LOCALCW_INCLUDE=LOCALCW
-# uncomment the line below to include support for STEMlab discovery
+# uncomment the line below to include support for STEMlab discovery (with avahi)
#STEMLAB_DISCOVERY=STEMLAB_DISCOVERY
+# uncomment the line below to include support for STEMlab discovery WITHOUT AVAHI
+#STEMLAB_DISCOVERY=STEMLAB_DISCOVERY_NOAVAHI
+
# uncommment this line for activate work-around some RedPitaty HPSDR bugs
#STEMLAB_FIX_OPTION=-DSTEMLAB_FIX
#UNAME_N=pine64
#UNAME_N=jetsen
+# Additional options that can be chosen at compile time:
+# -DDIGI_MODES wide filters and no noise reduction in DIGU/DIGL
+# -DSPLIT_RXTX if there is more than one receiver, TX panel only "hides" the first one
+# -DPROTOCOL_DEBUG logs (on stderr) all state changes sent to the SDR (only old protocol)
+# -DDEBUG activate debug output
+#
+# leave the list empty if no such option should be used
+
+ADDITIONAL_OPTIONS=
+
+
CC=gcc
LINK=gcc
-# uncomment the line below for various debug facilities
-#DEBUG_OPTION=-D DEBUG
-
ifeq ($(PURESIGNAL_INCLUDE),PURESIGNAL)
PURESIGNAL_OPTIONS=-D PURESIGNAL
PURESIGNAL_SOURCES= \
#LIMESDR_INCLUDE=LIMESDR
# uncomment the line below when Radioberry radio cape is plugged in (for now use emulator and old protocol)
-RADIOBERRY_INCLUDE=RADIOBERRY
+#RADIOBERRY_INCLUDE=RADIOBERRY
ifeq ($(RADIOBERRY_INCLUDE),RADIOBERRY)
RADIOBERRY_OPTIONS=-D RADIOBERRY
endif
I2C_OBJS=i2c.o
endif
+#
+# We have two versions here, the second one has to be used
+# if you do not have the avahi libraries
+#
ifeq ($(STEMLAB_DISCOVERY), STEMLAB_DISCOVERY)
STEMLAB_OPTIONS=-D STEMLAB_DISCOVERY \
`pkg-config --cflags avahi-gobject` \
STEMLAB_OBJS=stemlab_discovery.o
endif
+ifeq ($(STEMLAB_DISCOVERY), STEMLAB_DISCOVERY_NOAVAHI)
+STEMLAB_OPTIONS=-D STEMLAB_DISCOVERY -D NO_AVAHI `pkg-config --cflags libcurl`
+STEMLAB_LIBS=`pkg-config --libs libcurl`
+STEMLAB_SOURCES=stemlab_discovery.c
+STEMLAB_HEADERS=stemlab_discovery.h
+STEMLAB_OBJS=stemlab_discovery.o
+endif
+
GTKINCLUDES=`pkg-config --cflags gtk+-3.0`
GTKLIBS=`pkg-config --libs gtk+-3.0`
OPTIONS=-g -Wno-deprecated-declarations $(PURESIGNAL_OPTIONS) $(REMOTE_OPTIONS) $(USBOZY_OPTIONS) $(I2C_OPTIONS) $(GPIO_OPTIONS) $(LIMESDR_OPTIONS) \
$(FREEDV_OPTIONS) $(LOCALCW_OPTIONS) $(RADIOBERRY_OPTIONS) $(PSK_OPTIONS) $(STEMLAB_OPTIONS) $(STEMLAB_FIX_OPTION) \
- -D GIT_DATE='"$(GIT_DATE)"' -D GIT_VERSION='"$(GIT_VERSION)"' $(DEBUG_OPTION) -O3
+ -D GIT_DATE='"$(GIT_DATE)"' -D GIT_VERSION='"$(GIT_VERSION)"' $(ADDITIONAL_OPTIONS) -O3
LIBS=-lrt -lm -lwdsp -lpthread $(AUDIO_LIBS) $(USBOZY_LIBS) $(PSKLIBS) $(GTKLIBS) $(GPIO_LIBS) $(SOAPYSDRLIBS) $(FREEDVLIBS) $(STEMLAB_LIBS)
INCLUDES=$(GTKINCLUDES)
GIT_DATE := $(firstword $(shell git --no-pager show --date=short --format="%ai" --name-only))
GIT_VERSION := $(shell git describe --abbrev=0 --tags)
-# un-commment this line for activate work-around some RedPitaty HPSDR bugs
-STEMLAB_FIX_OPTION=-DSTEMLAB_FIX
-
# uncomment the line below to include GPIO
#GPIO_INCLUDE=GPIO
# uncomment the line to below include support local CW keyer
#LOCALCW_INCLUDE=LOCALCW
-# uncomment the line below to include support for STEMlab discovery
-STEMLAB_DISCOVERY=STEMLAB_DISCOVERY
+# uncomment the line below to include support for STEMlab discovery (with avahi)
+#STEMLAB_DISCOVERY=STEMLAB_DISCOVERY
+
+# uncomment the line below to include support for STEMlab discovery WITHOUT AVAHI
+STEMLAB_DISCOVERY=STEMLAB_DISCOVERY_NOAVAHI
+
+# un-commment this line for activate work-around some RedPitaty HPSDR bugs
+STEMLAB_FIX_OPTION=-DSTEMLAB_FIX
#uncomment the line below for the platform being compiled on
-UNAME_N=MacOS
-#UNAME_N=raspberrypi
+UNAME_N=raspberrypi
#UNAME_N=odroid
#UNAME_N=up
#UNAME_N=pine64
# -DDIGI_MODES wide filters and no noise reduction in DIGU/DIGL
# -DSPLIT_RXTX if there is more than one receiver, TX panel only "hides" the first one
# -DPROTOCOL_DEBUG logs (on stderr) all state changes sent to the SDR (only old protocol)
+# -DDEBUG activate debug output
#
# leave the list empty if no such option should be used
ADDITIONAL_OPTIONS= -DDIGI_MODES -DSPLIT_RXTX
CC=gcc
-
-ifeq ($(UNAME_N),MacOS)
-#
-# This is only necessary for "make app", since the "patched"
-# library names are longer
-#
-LINK=gcc -headerpad_max_install_names
-else
LINK=gcc
-endif
-
-# uncomment the line below for various debug facilities
-#DEBUG_OPTION=-D DEBUG
ifeq ($(PURESIGNAL_INCLUDE),PURESIGNAL)
PURESIGNAL_OPTIONS=-D PURESIGNAL
# uncomment the line below for LimeSDR (uncomment line below)
#LIMESDR_INCLUDE=LIMESDR
-# uncomment the line below when Radioberry radio cape is plugged in
+# uncomment the line below when Radioberry radio cape is plugged in (for now use emulator and old protocol)
#RADIOBERRY_INCLUDE=RADIOBERRY
ifeq ($(RADIOBERRY_INCLUDE),RADIOBERRY)
endif
#
-# Here in Makefile.mac, we use the version that does not need avahi
+# We have two versions here, the second one has to be used
+# if you do not have the avahi libraries
#
ifeq ($(STEMLAB_DISCOVERY), STEMLAB_DISCOVERY)
+STEMLAB_OPTIONS=-D STEMLAB_DISCOVERY \
+ `pkg-config --cflags avahi-gobject` \
+ `pkg-config --cflags libcurl`
+STEMLAB_LIBS=`pkg-config --libs avahi-gobject` `pkg-config --libs libcurl`
+STEMLAB_SOURCES=stemlab_discovery.c
+STEMLAB_HEADERS=stemlab_discovery.h
+STEMLAB_OBJS=stemlab_discovery.o
+endif
+
+ifeq ($(STEMLAB_DISCOVERY), STEMLAB_DISCOVERY_NOAVAHI)
STEMLAB_OPTIONS=-D STEMLAB_DISCOVERY -D NO_AVAHI `pkg-config --cflags libcurl`
STEMLAB_LIBS=`pkg-config --libs libcurl`
STEMLAB_SOURCES=stemlab_discovery.c
PORTAUDIO_OPTIONS=-DPORTAUDIO
AUDIO_LIBS=-lportaudio
-OPTIONS=-g -Wno-deprecated-declarations $(PURESIGNAL_OPTIONS) $(REMOTE_OPTIONS) $(RADIOBERRY_OPTIONS) \
- $(USBOZY_OPTIONS) $(I2C_OPTIONS) $(GPIO_OPTIONS) $(LIMESDR_OPTIONS) $(FREEDV_OPTIONS) \
- $(LOCALCW_OPTIONS) $(PSK_OPTIONS) $(STEMLAB_OPTIONS) $(STEMLAB_FIX_OPTION) \
- $(PORTAUDIO_OPTIONS) $(ADDITIONAL_OPTIONS) \
- -D GIT_DATE='"$(GIT_DATE)"' -D GIT_VERSION='"$(GIT_VERSION)"' $(DEBUG_OPTION) -O3
-
-LIBS= $(AUDIO_LIBS) $(USBOZY_LIBS) $(PSKLIBS) $(GTKLIBS) $(GPIO_LIBS) \
- $(SOAPYSDRLIBS) $(FREEDVLIBS) $(STEMLAB_LIBS) -lwdsp -lm -pthread
+OPTIONS=-g -Wno-deprecated-declarations $(PURESIGNAL_OPTIONS) $(REMOTE_OPTIONS) $(USBOZY_OPTIONS) $(I2C_OPTIONS) $(GPIO_OPTIONS) $(LIMESDR_OPTIONS) \
+ $(FREEDV_OPTIONS) $(LOCALCW_OPTIONS) $(RADIOBERRY_OPTIONS) $(PSK_OPTIONS) $(STEMLAB_OPTIONS) $(STEMLAB_FIX_OPTION) \
+ -D GIT_DATE='"$(GIT_DATE)"' -D GIT_VERSION='"$(GIT_VERSION)"' $(PORTAUDIO_OPTIONS) $(ADDITIONAL_OPTIONS) -O3
+LIBS=-lm -lwdsp -lpthread $(AUDIO_LIBS) $(USBOZY_LIBS) $(PSKLIBS) $(GTKLIBS) $(GPIO_LIBS) $(SOAPYSDRLIBS) $(FREEDVLIBS) $(STEMLAB_LIBS)
INCLUDES=$(GTKINCLUDES)
COMPILE=$(CC) $(OPTIONS) $(INCLUDES)
# this is then stored *within* the app bundle.
#
#############################################################################
-app: pihpsdr
+app: $(OBJS) $(REMOTE_OBJS) $(USBOZY_OBJS) $(LIMESDR_OBJS) $(FREEDV_OBJS) \
+ $(LOCALCW_OBJS) $(I2C_OBJS) $(GPIO_OBJS) $(PSK_OBJS) \
+ $(PURESIGNAL_OBJS) $(STEMLAB_OBJS)
+ $(LINK) -headerpad_max_install_names -o $(PROGRAM) $(OBJS) $(REMOTE_OBJS) \
+ $(USBOZY_OBJS) $(I2C_OBJS) $(GPIO_OBJS) $(LIMESDR_OBJS) \
+ $(FREEDV_OBJS) $(LOCALCW_OBJS) $(PSK_OBJS) $(PURESIGNAL_OBJS) \
+ $(STEMLAB_OBJS) $(LIBS)
@rm -rf pihpsdr.app
@mkdir -p pihpsdr.app/Contents/MacOS
@mkdir -p pihpsdr.app/Contents/Frameworks
#ifndef _CONFIGURE_H
#define _CONFIGURE_H
-#ifdef INCLUDE_GPIO
+#ifdef GPIO
void configure_gpio(GtkWidget *parent);
#endif
#include "stemlab_discovery.h"
#endif
#include "ext.h"
+#include "configure.h"
static GtkWidget *discovery_dialog;
static DISCOVERED *d;
#include "radio.h"
#include "new_protocol.h"
#include "old_protocol.h"
+#ifdef GPIO
+#include "gpio.h"
+#endif
static GtkWidget *parent_window=NULL;
#endif
#include "ext.h"
#include "sliders.h"
+#include "new_protocol.h"
+#ifdef LOCALCW
+#include "iambic.h"
+#endif
// debounce settle time in ms
#define DEFAULT_SETTLE_TIME 150
}
#ifdef LOCALCW
-#define BUTTON_STEADY_TIME_US 5000
-static void setup_button(int button, gpioAlertFunc_t pAlert) {
- gpioSetMode(button, PI_INPUT);
- gpioSetPullUpDown(button,PI_PUD_UP);
- // give time to settle to avoid false triggers
- usleep(10000);
- gpioSetAlertFunc(button, pAlert);
- gpioGlitchFilter(button, BUTTON_STEADY_TIME_US);
+
+static void setup_cw_pin(int pin, void(*pAlert)(void)) {
+fprintf(stderr,"setup_cw_pin: pin=%d \n",pin);
+ pinMode(pin,INPUT);
+ pullUpDnControl(pin,PUD_UP);
+ usleep(10000);
+ wiringPiISR(pin,INT_EDGE_BOTH,pAlert);
}
-static void cwAlert(int gpio, int level, uint32_t tick) {
- //fprintf(stderr,"cw key at pin %d \n", gpio);
- if (cw_keyer_internal == 0 ){
- //fprintf(stderr,"call keyer_event...\n");
- keyer_event(gpio, cw_active_level == 0 ? level : (level==0));
- }
+static void cwAlert_left() {
+ int level=digitalRead(CWL_BUTTON);
+ //fprintf(stderr,"cwl button : level=%d \n",level);
+ if (cw_keyer_internal == 0 ){
+ keyer_event(CWL_BUTTON, cw_active_level == 0 ? level : (level==0));
+ }
+}
+
+static void cwAlert_right() {
+ int level=digitalRead(CWR_BUTTON);
+ //fprintf(stderr,"cwr button : level=%d \n",level);
+ if (cw_keyer_internal == 0 ){
+ keyer_event(CWR_BUTTON, cw_active_level == 0 ? level : (level==0));
+ }
}
+
#endif
int gpio_init() {
#ifdef LOCALCW
fprintf(stderr,"GPIO: ENABLE_CW_BUTTONS=%d CWL_BUTTON=%d CWR_BUTTON=%d\n", ENABLE_CW_BUTTONS, CWL_BUTTON, CWR_BUTTON);
if(ENABLE_CW_BUTTONS) {
- setup_button(CWL_BUTTON, cwAlert);
- setup_button(CWR_BUTTON, cwAlert);
+ setup_cw_pin(CWL_BUTTON, cwAlert_left);
+ setup_cw_pin(CWR_BUTTON, cwAlert_right);
}
#endif
return 0;
}
-static encoder_changed(int action,int pos) {
+static void encoder_changed(int action,int pos) {
double value;
int mode;
int id;
void keyer_event(int gpio, int level);
void keyer_update();
void keyer_close();
+int keyer_init();
#endif
fprintf(stderr,"width=%d height=%d\n", display_width, display_height);
- // DL1YCF: use define'd constants here
if(display_width>MAX_DISPLAY_WIDTH || display_height>MAX_DISPLAY_HEIGHT) {
display_width=MAX_DISPLAY_WIDTH;
display_height=MAX_DISPLAY_HEIGHT;
#include "toolbar.h"
#include "rigctl.h"
#include "ext.h"
+#ifdef LOCALCW
+#include "iambic.h"
+#endif
#define min(x,y) (x<y?x:y)
#define max(x,y) (x<y?y:x)
#ifndef _SLIDERS_H
#define _SLIDERS_H
+// include these since we are using RECEIVER and TRANSMITTER
+#include "receiver.h"
+#include "transmitter.h"
+
extern void att_type_changed(void);
extern void update_att_preamp(void);
extern void sliders_update();
extern void set_squelch(RECEIVER* rx);
+extern void set_compression(TRANSMITTER *tx);
#endif