GIT_VERSION := $(shell git describe --abbrev=0 --tags)
# uncomment the line below to include GPIO
-GPIO_INCLUDE=GPIO
+#GPIO_INCLUDE=GPIO
# uncomment the line below to include MCP23017 I2C
#I2C_INCLUDE=I2C
# uncomment the line below for LimeSDR (uncomment line below)
#LIMESDR_INCLUDE=LIMESDR
-# uncomment the line below when Radioberry radio cape is plugged in
-#RADIOBERRY_INCLUDE=RADIOBERRY
-
+# 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)
RADIOBERRY_OPTIONS=-D RADIOBERRY
-RADIOBERRYLIBS=-lpigpio
-RADIOBERRY_SOURCES= \
-radioberry_discovery.c \
-radioberry.c
-RADIOBERRY_HEADERS= \
-radioberry_discovery.h \
-radioberry.h
-RADIOBERRY_OBJS= \
-radioberry_discovery.o \
-radioberry.o
endif
-
ifeq ($(LIMESDR_INCLUDE),LIMESDR)
LIMESDR_OPTIONS=-D LIMESDR
SOAPYSDRLIBS=-lSoapySDR
AUDIO_LIBS=-lasound
#AUDIO_LIBS=-lsoundio
-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) -D GIT_DATE='"$(GIT_DATE)"' -D GIT_VERSION='"$(GIT_VERSION)"' $(DEBUG_OPTION) -O3
+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) -D GIT_DATE='"$(GIT_DATE)"' -D GIT_VERSION='"$(GIT_VERSION)"' $(DEBUG_OPTION) -O3
-LIBS=-lrt -lm -lwdsp -lpthread $(AUDIO_LIBS) $(USBOZY_LIBS) $(PSKLIBS) $(GTKLIBS) $(GPIO_LIBS) $(RADIOBERRYLIBS) $(SOAPYSDRLIBS) $(FREEDVLIBS) $(STEMLAB_LIBS)
+LIBS=-lrt -lm -lwdsp -lpthread $(AUDIO_LIBS) $(USBOZY_LIBS) $(PSKLIBS) $(GTKLIBS) $(GPIO_LIBS) $(SOAPYSDRLIBS) $(FREEDVLIBS) $(STEMLAB_LIBS)
INCLUDES=$(GTKINCLUDES)
COMPILE=$(CC) $(OPTIONS) $(INCLUDES)
ext.o \
error_handler.o
-$(PROGRAM): $(OBJS) $(REMOTE_OBJS) $(USBOZY_OBJS) $(LIMESDR_OBJS) $(FREEDV_OBJS) $(LOCALCW_OBJS) $(I2C_OBJS) $(GPIO_OBJS) $(PSK_OBJS) $(RADIOBERRY_OBJS) $(PURESIGNAL_OBJS) $(STEMLAB_OBJS)
- $(LINK) -o $(PROGRAM) $(OBJS) $(REMOTE_OBJS) $(USBOZY_OBJS) $(I2C_OBJS) $(GPIO_OBJS) $(LIMESDR_OBJS) $(FREEDV_OBJS) $(LOCALCW_OBJS) $(PSK_OBJS) $(LIBS) $(RADIOBERRY_OBJS) $(PURESIGNAL_OBJS) $(STEMLAB_OBJS)
+$(PROGRAM): $(OBJS) $(REMOTE_OBJS) $(USBOZY_OBJS) $(LIMESDR_OBJS) $(FREEDV_OBJS) $(LOCALCW_OBJS) $(I2C_OBJS) $(GPIO_OBJS) $(PSK_OBJS) $(PURESIGNAL_OBJS) $(STEMLAB_OBJS)
+ $(LINK) -o $(PROGRAM) $(OBJS) $(REMOTE_OBJS) $(USBOZY_OBJS) $(I2C_OBJS) $(GPIO_OBJS) $(LIMESDR_OBJS) $(FREEDV_OBJS) $(LOCALCW_OBJS) $(PSK_OBJS) $(LIBS) $(PURESIGNAL_OBJS) $(STEMLAB_OBJS)
-all: prebuild $(PROGRAM) $(HEADERS) $(REMOTE_HEADERS) $(RADIOBERRY_HEADERS) $(USBOZY_HEADERS) $(LIMESDR_HEADERS) $(FREEDV_HEADERS) $(LOCALCW_HEADERS) $(I2C_HEADERS) $(GPIO_HEADERS) $(PSK_HEADERS) $(PURESIGNAL_HEADERS) $(STEMLAB_HEADERS) $(SOURCES) $(REMOTE_SOURCES) $(USBOZY_SOURCES) $(LIMESDR_SOURCES) $(FREEDV_SOURCES) $(I2C_SOURCES) $(GPIO_SOURCES) $(PSK_SOURCES) $(RADIOBERRY_SOURCES) $(PURESIGNAL_SOURCES) $(STEMLAB_SOURCES)
+all: prebuild $(PROGRAM) $(HEADERS) $(REMOTE_HEADERS) $(USBOZY_HEADERS) $(LIMESDR_HEADERS) $(FREEDV_HEADERS) $(LOCALCW_HEADERS) $(I2C_HEADERS) $(GPIO_HEADERS) $(PSK_HEADERS) $(PURESIGNAL_HEADERS) $(STEMLAB_HEADERS) $(SOURCES) $(REMOTE_SOURCES) $(USBOZY_SOURCES) $(LIMESDR_SOURCES) $(FREEDV_SOURCES) $(I2C_SOURCES) $(GPIO_SOURCES) $(PSK_SOURCES) $(PURESIGNAL_SOURCES) $(STEMLAB_SOURCES)
prebuild:
rm -f version.o
#include "new_protocol.h"
#include "old_protocol.h"
-#ifdef RADIOBERRY
-#include "radioberry.h"
-#endif
#include "radio.h"
#include "receiver.h"
#include "audio.h"
case NEW_PROTOCOL:
mic_buffer_size = 64;
break;
-#ifdef RADIOBERRY
- case RADIOBERRY_PROTOCOL:
- mic_buffer_size = 1024;
- break;
-#endif
default:
break;
}
case NEW_PROTOCOL:
new_protocol_process_local_mic(mic_buffer,1);
break;
-#ifdef RADIOBERRY
- case RADIOBERRY_PROTOCOL:
- radioberry_protocol_process_local_mic(mic_buffer,1);
- break;
-#endif
default:
break;
}
#ifdef USBOZY
#include "ozyio.h"
#endif
-#ifdef RADIOBERRY
-#include "radioberry_discovery.h"
-#endif
-#ifdef RADIOBERRY
-#include "radioberry.h"
-#endif
#ifdef REMOTE
#include "remote_radio.h"
#endif
lime_discovery();
#endif
-#ifdef RADIOBERRY
- status_text("Radioberry SDR ... Discovering Device");
- radioberry_discovery();
-#endif
status_text("Discovery");
-
-
+
if(devices==0) {
gdk_window_set_cursor(gtk_widget_get_window(top_window),gdk_cursor_new(GDK_ARROW));
discovery_dialog = gtk_dialog_new();
d->name);
break;
#endif
-#ifdef RADIOBERRY
- case RADIOBERRY_PROTOCOL:
- sprintf(text,"%s\n",d->name);
- break;
-#endif
#ifdef STEMLAB_DISCOVERY
case STEMLAB_PROTOCOL:
sprintf(text, "STEMlab (%02X:%02X:%02X:%02X:%02X:%02X) on %s",
case LIMESDR_PROTOCOL:
lime_protocol_stop();
break;
-#endif
-#ifdef RADIOBERRY
- case RADIOBERRY_PROTOCOL:
- radioberry_protocol_stop();
- break;
#endif
}
radioSaveState();
case LIMESDR_PROTOCOL:
lime_protocol_stop();
break;
-#endif
-#ifdef RADIOBERRY
- case RADIOBERRY_PROTOCOL:
- radioberry_protocol_stop();
- break;
#endif
}
radioSaveState();
case LIMESDR_PROTOCOL:
lime_protocol_stop();
break;
-#endif
-#ifdef RADIOBERRY
- case RADIOBERRY_PROTOCOL:
- radioberry_protocol_stop();
- break;
#endif
}
radioSaveState();
gtk_grid_attach(GTK_GRID(grid),vfo_divisor,4,2,1,1);
g_signal_connect(vfo_divisor,"value_changed",G_CALLBACK(vfo_divisor_value_changed_cb),NULL);
- if(protocol==ORIGINAL_PROTOCOL || protocol==NEW_PROTOCOL
-#ifdef RADIOBERRY
- || protocol==RADIOBERRY_PROTOCOL) {
-#else
- ){
-#endif
+ if(protocol==ORIGINAL_PROTOCOL || protocol==NEW_PROTOCOL){
if((protocol==NEW_PROTOCOL && device==NEW_DEVICE_ORION) ||
(protocol==NEW_PROTOCOL && device==NEW_DEVICE_ORION2) ||
gtk_grid_attach(GTK_GRID(grid),bias_b,3,4,1,1);
g_signal_connect(bias_b,"toggled",G_CALLBACK(bias_cb),NULL);
}
-
-#ifdef RADIOBERRY
- if (protocol==ORIGINAL_PROTOCOL || protocol==NEW_PROTOCOL) {
-#endif
+
GtkWidget *alex_b=gtk_check_button_new_with_label("ALEX");
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (alex_b), filter_board==ALEX);
gtk_grid_attach(GTK_GRID(grid),alex_b,1,1,1,1);
g_signal_connect(alex_b,"toggled",G_CALLBACK(alex_cb),apollo_b);
g_signal_connect(apollo_b,"toggled",G_CALLBACK(apollo_cb),alex_b);
-#ifdef RADIOBERRY
- }
-#endif
}
GtkWidget *sample_rate_label=gtk_label_new("Sample Rate:");
gtk_grid_attach(GTK_GRID(grid),sample_rate_label,0,1,1,1);
- if(protocol==ORIGINAL_PROTOCOL || protocol==NEW_PROTOCOL
- #ifdef RADIOBERRY
- || protocol==RADIOBERRY_PROTOCOL) {
-#else
- ){
-#endif
+ if(protocol==ORIGINAL_PROTOCOL || protocol==NEW_PROTOCOL){
GtkWidget *sample_rate_48=gtk_radio_button_new_with_label(NULL,"48000");
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (sample_rate_48), sample_rate==48000);
gtk_grid_attach(GTK_GRID(grid),sample_rate_48,0,2,1,1);
int settle_time=DEFAULT_SETTLE_TIME;
static gint release_timer=-1;
-#ifdef RADIOBERRY
-#include <pigpio.h>
-#endif
#ifdef CONTROLLER2
gpio_restore_state();
wiringPiSetup(); // use WiringPi pin numbers
-
-#ifdef RADIOBERRY
- if (gpioInitialise() < 0) {
- fprintf(stderr,"radioberry_protocol: gpio could not be initialized. \n");
- exit(-1);
- }
-#endif
if(ENABLE_VFO_ENCODER) {
#ifdef CONTROLLER2
#include "discovered.h"
#include "configure.h"
#include "gpio.h"
-#ifdef RADIOBERRY
-#include "radioberry.h"
-#endif
#include "wdsp.h"
#include "new_menu.h"
#include "radio.h"
case LIMESDR_PROTOCOL:
lime_protocol_stop();
break;
-#endif
-#ifdef RADIOBERRY
- case RADIOBERRY_PROTOCOL:
- radioberry_protocol_stop();
- break;
#endif
}
radioSaveState();
#include "new_menu.h"
#include "new_protocol.h"
#include "old_protocol.h"
-#ifdef RADIOBERRY
-#include "radioberry.h"
-#endif
#include "store.h"
#ifdef LIMESDR
#include "lime_protocol.h"
case LIMESDR_PROTOCOL:
sprintf(property_path,"limesdr.props");
break;
-#endif
-#ifdef RADIOBERRY
- case RADIOBERRY_PROTOCOL:
- sprintf(property_path,"radioberry.props");
- break;
#endif
}
case LIMESDR_PROTOCOL:
lime_protocol_init(0,display_width,receiver[0]->sample_rate);
break;
-#endif
-#ifdef RADIOBERRY
- case RADIOBERRY_PROTOCOL:
- radioberry_protocol_init(0,display_width);
- break;
#endif
}
switch(protocol) {
case NEW_PROTOCOL:
case ORIGINAL_PROTOCOL:
-#ifdef RADIOBERRY
- case RADIOBERRY_PROTOCOL:
-#endif
if(vfo[v].ctun) {
long long minf=vfo[v].frequency-(long long)(active_receiver->sample_rate/2);
long long maxf=vfo[v].frequency+(long long)(active_receiver->sample_rate/2);
schedule_high_priority();
break;
case ORIGINAL_PROTOCOL:
-#ifdef RADIOBERRY
- case RADIOBERRY_PROTOCOL:
-#endif
break;
#ifdef LIMESDR
case LIMESDR_PROTOCOL:
case LIMESDR_PROTOCOL:
lime_protocol_set_attenuation(value);
break;
-#endif
-#ifdef RADIOBERRY
- case RADIOBERRY_PROTOCOL:
- radioberry_set_attenuation(value);
- break;
#endif
}
}
if(value) adc_attenuation[0]=atoi(value);
value=getProperty("adc_1_attenuation");
if(value) adc_attenuation[1]=atoi(value);
-
+
+ value=getProperty("rx1_gain_slider");
+ if(value) rx_gain_slider[0]=atoi(value);
+ value=getProperty("rx2_gain_slider");
+ if(value) rx_gain_slider[1]=atoi(value);
+
sem_post(&property_sem);
}
setProperty("adc_0_attenuation",value);
sprintf(value,"%d",adc_attenuation[1]);
setProperty("adc_1_attenuation",value);
-
+
+ sprintf(value,"%d",rx_gain_slider[0]);
+ setProperty("rx1_gain_slider",value);
+ sprintf(value,"%d",rx_gain_slider[1]);
+ setProperty("rx2_gain_slider",value);
+
vfo_save_state();
sprintf(value,"%d",receivers);
setProperty("receivers",value);
+++ /dev/null
-/* Copyright (C)
-* 2017 - Johan Maas, PA3GSB
-*
-* 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-*
-*/
-
-#include <gtk/gtk.h>
-#include <stdlib.h>
-#include <stdio.h>
-#include <semaphore.h>
-#include <pthread.h>
-#include <sys/time.h>
-
-#include <string.h>
-#include <errno.h>
-#include <math.h>
-
-#include "audio.h"
-
-#include "band.h"
-#include "channel.h"
-#include "discovered.h"
-#include "mode.h"
-#include "filter.h"
-#include "old_protocol.h"
-#include "radio.h"
-#include "toolbar.h"
-#include "vox.h"
-#include <semaphore.h>
-#ifdef PSK
-#include "psk.h"
-#endif
-#include "receiver.h"
-#include "transmitter.h"
-#include "vfo.h"
-#include <pigpio.h>
-#include "ext.h"
-
-#define SPEED_48K 0x00
-#define SPEED_96K 0x01
-#define SPEED_192K 0x02
-#define SPEED_384K 0x03
-
-#define RECEIVED_SAMPLES 64
-
-static GThread *radioberry_thread_id;
-static gpointer radioberry_thread(gpointer arg);
-
-static int running;
-
-static void setSampleSpeed(int r);
-static int sampleSpeed[2];
-
-unsigned char tx_iqdata[6];
-struct timeval t20;
-struct timeval t21;
-
-void spiWriter();
-void rx1_spiReader(unsigned char iqdata[]);
-void rx2_spiReader(unsigned char iqdata[]);
-
-int radioberry_attenuation = 0;
-int prev_drive_level;
-static int txcount =0;
-
-GMutex mutex_rxtx;
-
-static int rx1_spi_handler;
-static int rx2_spi_handler;
-
-
-#define HANDLER_STEADY_TIME_US 5000
-void setup_handler(int pin, gpioAlertFunc_t pAlert) {
- gpioSetMode(pin, PI_INPUT);
- gpioSetPullUpDown(pin,PI_PUD_UP);
- // give time to settle to avoid false triggers
- usleep(10000);
- gpioSetAlertFunc(pin, pAlert);
- gpioGlitchFilter(pin, HANDLER_STEADY_TIME_US);
-}
-
-void cwPTT_Alert(int gpio, int level, uint32_t tick) {
- //fprintf(stderr,"radioberry ptt swith %d 0=ptt off and 1=ptt on\n", level);
- //fprintf(stderr,"%d - %d -%d - %d\n", running, cw_breakin, transmitter->mode, level);
- if (running && cw_breakin && (transmitter->mode==modeCWU || transmitter->mode==modeCWL)){
- g_idle_add(ext_mox_update,(gpointer)level);
- }
-}
-
-float timedifference_msec(struct timeval t0, struct timeval t1)
-{
- return (t1.tv_sec - t0.tv_sec) * 1000.0f + (t1.tv_usec - t0.tv_usec) / 1000.0f;
-}
-
-void radioberry_protocol_init(int rx,int pixels) {
- int i;
-
- fprintf(stderr,"\n");
- fprintf(stderr, "====================================================================\n");
- fprintf(stderr, "====================================================================\n");
- fprintf(stderr, " Radioberry V2.0 beta 2.\n");
- fprintf(stderr, "\n");
- fprintf(stderr, " PIHPSDR plugin version 19-5-2018 \n");
- fprintf(stderr, "\n");
- fprintf(stderr, "\n");
- fprintf(stderr, " Have fune Johan PA3GSB\n");
- fprintf(stderr, "\n");
- fprintf(stderr, "\n");
- fprintf(stderr, "====================================================================\n");
- fprintf(stderr, "====================================================================\n");
-
-#ifndef GPIO
- if (gpioInitialise() < 0) {
- fprintf(stderr,"radioberry_protocol: gpio could not be initialized. \n");
- exit(-1);
- }
-#endif
- gpioSetMode(13, PI_INPUT); //rx1_x-samples received.
- gpioSetMode(16, PI_INPUT); //rx2_x-samples received.
- gpioSetMode(20, PI_INPUT);
- gpioSetMode(21, PI_OUTPUT);
-
- setup_handler(17, cwPTT_Alert);
-
- rx1_spi_handler = spiOpen(0, 15625000, 49155); //channel 0
- if (rx1_spi_handler < 0) {
- fprintf(stderr,"radioberry_protocol: spi bus rx1 could not be initialized. \n");
- exit(-1);
- }
-
- rx2_spi_handler = spiOpen(1, 15625000, 49155); //channel 1
- if (rx2_spi_handler < 0) {
- fprintf(stderr,"radioberry_protocol: spi bus rx2 could not be initialized. \n");
- exit(-1);
- }
-
- running=1;
- radioberry_attenuation = adc_attenuation[active_receiver->adc];
- printf("init done \n");
-
- if(transmitter->local_microphone) {
- if(audio_open_input()!=0) {
- fprintf(stderr,"audio_open_input failed\n");
- transmitter->local_microphone=0;
- }
- }
-
- radioberry_thread_id = g_thread_new( "radioberry", radioberry_thread, NULL);
- if( ! radioberry_thread_id )
- {
- fprintf(stderr,"g_thread_new failed on radioberry_thread\n");
- exit( -1 );
- }
- fprintf(stderr, "radioberry_thread: id=%p\n",radioberry_thread_id);
-
-}
-
-void convertToDouble(unsigned char* value, double buffer[]) {
-
- int left_sample;
- int right_sample;
- double left_sample_double;
- double right_sample_double;
-
- left_sample = (int)((signed char) value[0]) << 16;
- left_sample |= (int)((((unsigned char)value[1]) << 8)&0xFF00);
- left_sample |= (int)((unsigned char)value[2]&0xFF);
- right_sample = (int)((signed char) value[3]) << 16;
- right_sample |= (int)((((unsigned char)value[4]) << 8)&0xFF00);
- right_sample |= (int)((unsigned char)value[5]&0xFF);
-
- left_sample_double=(double)left_sample/8388607.0; // 24 bit sample 2^23-1
- right_sample_double=(double)right_sample/8388607.0; // 24 bit sample 2^23-1
-
- buffer[0] = left_sample_double;
- buffer[1] = right_sample_double;
-}
-
-static gpointer radioberry_thread(gpointer arg) {
- fprintf(stderr, "radioberry_protocol: radioberry_thread\n");
-
- unsigned char iqdata[6];
- double _iqdata[2];
-
- while(running) {
-
- if (!isTransmitting())
- {
- g_mutex_lock(&mutex_rxtx);
-
- gpioWrite(21, 0);
-
- setSampleSpeed(0);
- setSampleSpeed(1);
-
- if (gpioRead(13) == 1) {
- int i=0;
- for (i=0; i< RECEIVED_SAMPLES; i++) {
- rx1_spiReader(iqdata);
- convertToDouble(iqdata, _iqdata);
- add_iq_samples(receiver[0], _iqdata[0], _iqdata[1]);
- }
- }
-
- if (receivers==2) {
- if (gpioRead(16) == 1) {
- int i=0;
- for (i=0; i< RECEIVED_SAMPLES; i++) {
- rx2_spiReader(iqdata);
- convertToDouble(iqdata, _iqdata);
- add_iq_samples(receiver[1], _iqdata[0], _iqdata[1]);
- }
- }
- }
-
- g_mutex_unlock(&mutex_rxtx);
- }
- }
-
- fprintf(stderr, "radioberry_protocol stop: radioberry_thread\n");
-}
-
-void radioberry_protocol_iq_samples(int isample,int qsample) {
-
- g_mutex_lock(&mutex_rxtx);
-
- int power=0;
- if(tune && !transmitter->tune_use_drive) {
- power=(int)((double)transmitter->drive_level/100.0*(double)transmitter->tune_percent);
- } else {
- power=transmitter->drive_level;
- }
-
- tx_iqdata[0] = 0;
- tx_iqdata[1] = power / 6.4; // convert drive level from 0-255 to 0-39 steps of 0.5dB to control AD9866)
- if (prev_drive_level != transmitter->drive_level) {
- printf("drive level %d - corrected drive level %d \n", transmitter->drive_level, tx_iqdata[1]);
- prev_drive_level = transmitter->drive_level;
- }
- tx_iqdata[2] = isample>>8;
- tx_iqdata[3] = isample;
- tx_iqdata[4] = qsample>>8;
- tx_iqdata[5] = qsample;
-
- spiWriter();
-
- g_mutex_unlock(&mutex_rxtx);
-}
-
-void *radioberry_protocol_process_local_mic(unsigned char *buffer,int le) {
- int b;
- short mic_sample;
- // always 48000 samples per second
-
- b=0;
- int i;
- for(i=0;i<1024;i++) {
- if(le) {
- mic_sample = (short)((buffer[b++]&0xFF) | (buffer[b++]<<8));
- } else {
- mic_sample = (short)((buffer[b++]<<8) | (buffer[b++]&0xFF));
- }
- add_mic_sample(transmitter,mic_sample);
- }
-}
-
-void setSampleSpeed(int r) {
-
- switch(receiver[r]->sample_rate) {
- case 48000:
- sampleSpeed[r]=SPEED_48K;
- break;
- case 96000:
- sampleSpeed[r]=SPEED_96K;
- break;
- case 192000:
- sampleSpeed[r]=SPEED_192K;
- break;
- case 384000:
- sampleSpeed[r]=SPEED_384K;
- break;
- }
-}
-
-void radioberry_set_attenuation(int attenuation) {
- radioberry_attenuation = attenuation;
-}
-
-void radioberry_protocol_stop() {
-
- running=FALSE;
-
- if (rx1_spi_handler !=0)
- spiClose(rx1_spi_handler);
- if (rx2_spi_handler !=0)
- spiClose(rx2_spi_handler);
-
- gpioTerminate();
-
-}
-
-void rx1_spiReader(unsigned char iqdata[]) {
-
- long long rxFrequency=vfo[0].frequency-vfo[0].lo;
- if(vfo[0].rit_enabled) {
- rxFrequency+=vfo[0].rit;
- }
- if (active_receiver->id==0) {
- if(vfo[0].mode==modeCWU) {
- rxFrequency-=(long long)cw_keyer_sidetone_frequency;
- } else if(vfo[0].mode==modeCWL) {
- rxFrequency+=(long long)cw_keyer_sidetone_frequency;
- }
- }
-
- iqdata[0] = (sampleSpeed[0] & 0x03);
- iqdata[1] = (((active_receiver->random << 6) & 0x40) | (~(radioberry_attenuation & 0x2F)));
- iqdata[2] = ((rxFrequency >> 24) & 0xFF);
- iqdata[3] = ((rxFrequency >> 16) & 0xFF);
- iqdata[4] = ((rxFrequency >> 8) & 0xFF);
- iqdata[5] = (rxFrequency & 0xFF);
-
- spiXfer(rx1_spi_handler, iqdata, iqdata, 6);
-}
-
-void rx2_spiReader(unsigned char iqdata[]) {
-
- long long rxFrequency=vfo[1].frequency-vfo[1].lo;
- if(vfo[1].rit_enabled) {
- rxFrequency+=vfo[1].rit;
- }
- if (active_receiver->id==1) {
- if(vfo[1].mode==modeCWU) {
- rxFrequency-=(long long)cw_keyer_sidetone_frequency;
- } else if(vfo[1].mode==modeCWL) {
- rxFrequency+=(long long)cw_keyer_sidetone_frequency;
- }
- }
-
- iqdata[0] = (sampleSpeed[1] & 0x03);
- iqdata[1] = 0x00; //not used by firmware; the active receiver settings are set via rx1
- iqdata[2] = ((rxFrequency >> 24) & 0xFF);
- iqdata[3] = ((rxFrequency >> 16) & 0xFF);
- iqdata[4] = ((rxFrequency >> 8) & 0xFF);
- iqdata[5] = (rxFrequency & 0xFF);
-
- spiXfer(rx2_spi_handler, iqdata, iqdata, 6);
-}
-
-void spiWriter() {
-
- gpioWrite(21, 1);
-
- while ( gpioRead(20) == 1) {};
-
- spiXfer(rx1_spi_handler, tx_iqdata, tx_iqdata, 6);
-
- long long txFrequency;
- if(split) {
- txFrequency=vfo[VFO_B].frequency-vfo[VFO_A].lo+vfo[VFO_B].offset;
- } else {
- txFrequency=vfo[VFO_A].frequency-vfo[VFO_B].lo+vfo[VFO_A].offset;
- }
- tx_iqdata[0] = cw_keyer_speed | (cw_keyer_mode<<6);
- tx_iqdata[1] = cw_keyer_weight | (cw_keyer_spacing<<7);
- tx_iqdata[2] = ((txFrequency >> 24) & 0xFF);
- tx_iqdata[3] = ((txFrequency >> 16) & 0xFF);
- tx_iqdata[4] = ((txFrequency >> 8) & 0xFF);
- tx_iqdata[5] = (txFrequency & 0xFF);
-
- spiXfer(rx2_spi_handler, tx_iqdata, tx_iqdata, 6);
-
- txcount ++;
- if (txcount == 48000) {
- txcount = 0;
- gettimeofday(&t21, 0);
- float elapsd = timedifference_msec(t20, t21);
- printf("Code tx mode spi executed in %f milliseconds.\n", elapsd);
- gettimeofday(&t20, 0);
- }
-}
-// end of source
+++ /dev/null
-/* Copyright (C)
-* 2017 - Johan Maas, PA3GSB
-*
-* 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-*
-*/
-
-#include <gtk/gtk.h>
-#include <stdlib.h>
-#include <stdio.h>
-#include <semaphore.h>
-#include <pthread.h>
-
-#include <string.h>
-#include <errno.h>
-#include <math.h>
-
-#include "audio.h"
-
-#include "band.h"
-#include "channel.h"
-#include "discovered.h"
-#include "mode.h"
-#include "filter.h"
-#include "old_protocol.h"
-#include "radio.h"
-#include "toolbar.h"
-#include "vox.h"
-#include <semaphore.h>
-#ifdef PSK
-#include "psk.h"
-#endif
-#include "receiver.h"
-#include "transmitter.h"
-#include "vfo.h"
-
-#include <pigpio.h>
-#include "ext.h"
-
-#define OUTPUT_BUFFER_SIZE 1024
-#define SPEED_48K 0x00
-#define SPEED_96K 0x01
-#define SPEED_192K 0x02
-#define SPEED_384K 0x03
-
-static int display_width;
-static int running;
-static int sampleSpeed =0;
-
-unsigned char iqdata[6];
-unsigned char tx_iqdata[6];
-
-static pthread_t radioberry_thread_id;
-static void start_radioberry_thread();
-static void *radioberry_thread(void* arg);
-
-static void setSampleSpeed();
-static void handleReceiveStream();
-
-struct timeval t0;
-struct timeval t1;
-struct timeval t10;
-struct timeval t11;
-struct timeval t20;
-struct timeval t21;
-float elapsed;
-
-#define RADIOSTATE_RX 0
-#define RADIOSTATE_TX 1
-static int radiostate = RADIOSTATE_RX;
-
-void spiWriter();
-void spiReader();
-
-
-int prev_drive_level;
-
-static int rxcount =0;
-static int txcount =0;
-
-sem_t mutex;
-
-#ifdef PSK
-static int psk_samples=0;
-static int psk_divisor=6;
-#endif
-
-static int h;
-
-
-#define HANDLER_STEADY_TIME_US 5000
-void setup_handler(int pin, gpioAlertFunc_t pAlert) {
- gpioSetMode(pin, PI_INPUT);
- gpioSetPullUpDown(pin,PI_PUD_UP);
- // give time to settle to avoid false triggers
- usleep(10000);
- gpioSetAlertFunc(pin, pAlert);
- gpioGlitchFilter(pin, HANDLER_STEADY_TIME_US);
-}
-
-void cwPTT_Alert(int gpio, int level, uint32_t tick) {
- //fprintf(stderr,"radioberry ptt swith %d 0=ptt off and 1=ptt on\n", level);
- //fprintf(stderr,"%d - %d -%d - %d\n", running, cw_breakin, transmitter->mode, level);
- if (running && cw_breakin && (transmitter->mode==modeCWU || transmitter->mode==modeCWL)){
- g_idle_add(ext_mox_update,(gpointer)level);
- }
-}
-
-float timedifference_msec(struct timeval t0, struct timeval t1)
-{
- return (t1.tv_sec - t0.tv_sec) * 1000.0f + (t1.tv_usec - t0.tv_usec) / 1000.0f;
-}
-
-void radioberry_protocol_init(int rx,int pixels) {
- int i;
-
- fprintf(stderr,"radioberry_protocol_init\n");
- sem_init(&mutex, 0, 1); //mutal exlusion
- display_width=pixels;
- fprintf(stderr,"radioberry_protocol: buffer size: =%d\n", buffer_size);
-
-/*
- if (gpioInitialise() < 0) {
- fprintf(stderr,"radioberry_protocol: gpio could not be initialized. \n");
- exit(-1);
- }
-<<<<<<< HEAD
-*/
-
- gpioSetMode(13, PI_INPUT); //rx1_FIFOEmpty
- gpioSetMode(16, PI_INPUT); //rx2_FIFOEmpty
-=======
-#endif
-
- gpioSetMode(13, PI_INPUT);
->>>>>>> upstream/master
- gpioSetMode(20, PI_INPUT);
- gpioSetMode(21, PI_OUTPUT);
-
- setup_handler(17, cwPTT_Alert);
-
-
- h = spiOpen(0, 15625000, 49155);
- if (h < 0) {
- fprintf(stderr,"radioberry_protocol: spi bus could not be initialized. \n");
- exit(-1);
- }
-
- printf("init done \n");
-
- setSampleSpeed();
-
- if(transmitter->local_microphone) {
- if(audio_open_input()!=0) {
- fprintf(stderr,"audio_open_input failed\n");
- transmitter->local_microphone=0;
- }
- }
-
- start_radioberry_thread();
-}
-
-static void start_radioberry_thread() {
- int rc;
- fprintf(stderr,"radioberry_protocol starting radioberry thread\n");
- rc=pthread_create(&radioberry_thread_id,NULL,radioberry_thread,NULL);
- if(rc != 0) {
- fprintf(stderr,"radioberry_protocol: pthread_create failed on radioberry_thread: rc=%d\n", rc);
- exit(-1);
- }
-}
-
-static void *radioberry_thread(void* arg) {
- fprintf(stderr, "radioberry_protocol: radioberry_thread\n");
-
- running=1;
-
- gettimeofday(&t20, 0);
- gettimeofday(&t0, 0);
-
- gpioSetMode(13, PI_INPUT);
- gpioSetMode(20, PI_INPUT);
- gpioSetMode(21, PI_OUTPUT);
-
- while(running) {
-
- sem_wait(&mutex);
-
- if (isTransmitting())
- radiostate = RADIOSTATE_TX;
- else
- radiostate = RADIOSTATE_RX;
-
- if(radiostate == RADIOSTATE_TX) {
- gpioWrite(21, 1);
- }
- else
- {
- gpioWrite(21, 0);
- spiReader();
- handleReceiveStream();
- sem_post(&mutex);
- }
- }
-}
-
-void radioberry_protocol_iq_samples(int isample,int qsample) {
-
- if(radiostate == RADIOSTATE_TX) {
-
- tx_iqdata[0] = 0;
- tx_iqdata[1] = transmitter->drive / 6.4; // convert drive level from 0-255 to 0-39 )
- if (prev_drive_level != transmitter->drive) {
- printf("drive level %d - corrected drive level %d \n", transmitter->drive_level, tx_iqdata[1]);
- prev_drive_level = transmitter->drive;
- }
- tx_iqdata[2] = isample>>8;
- tx_iqdata[3] = isample;
- tx_iqdata[4] = qsample>>8;
- tx_iqdata[5] = qsample;
-
- spiWriter();
-
- sem_post(&mutex);
- }
-
-}
-
-void *radioberry_protocol_process_local_mic(unsigned char *buffer,int le) {
- int b;
- short mic_sample;
- // always 48000 samples per second
-
- b=0;
- int i;
- for(i=0;i<1024;i++) {
- if(le) {
- mic_sample = (short)((buffer[b++]&0xFF) | (buffer[b++]<<8));
- } else {
- mic_sample = (short)((buffer[b++]<<8) | (buffer[b++]&0xFF));
- }
- if(active_receiver->freedv) {
- add_freedv_mic_sample(transmitter,mic_sample);
- } else {
- add_mic_sample(transmitter,mic_sample);
- }
- }
-}
-
-static void handleReceiveStream() {
- int left_sample;
- int right_sample;
- double left_sample_double;
- double right_sample_double;
- int r;
-
- left_sample = (int)((signed char) iqdata[0]) << 16;
- left_sample += (int)((unsigned char)iqdata[1]) << 8;
- left_sample += (int)((unsigned char)iqdata[2]);
- right_sample = (int)((signed char) iqdata[3]) << 16;
- right_sample += (int)((unsigned char)iqdata[4]) << 8;
- right_sample += (int)((unsigned char)iqdata[5]);
-
- left_sample_double=(double)left_sample/8388607.0; // 24 bit sample 2^23-1
- right_sample_double=(double)right_sample/8388607.0; // 24 bit sample 2^23-1
-
- for(r=0;r<RECEIVERS;r++) {
- add_iq_samples(receiver[r], left_sample_double,right_sample_double);
- }
-}
-
-void setSampleSpeed() {
- switch(active_receiver->sample_rate) {
- case 48000:
- sampleSpeed=SPEED_48K;
- break;
- case 96000:
- sampleSpeed=SPEED_96K;
- break;
- case 192000:
- sampleSpeed=SPEED_192K;
- break;
- case 384000:
- sampleSpeed=SPEED_384K;
- break;
- }
-}
-
-void radioberry_protocol_stop() {
-
- running=FALSE;
-
- if (h !=0)
- spiClose(h);
-
-#ifndef GPIO
- gpioTerminate();
-#endif
-
-}
-
-void spiReader() {
- // wait till rxFIFO buffer is filled with at least one element
- while ( gpioRead(13) == 1) {};
-
- setSampleSpeed();
-
- int v=receiver[0]->id;
- long long rxFrequency=vfo[v].frequency-vfo[v].lo;
- if(vfo[v].rit_enabled) {
- rxFrequency+=vfo[v].rit;
- }
- if(vfo[active_receiver->id].mode==modeCWU) {
- rxFrequency-=(long long)cw_keyer_sidetone_frequency;
- } else if(vfo[active_receiver->id].mode==modeCWL) {
- rxFrequency+=(long long)cw_keyer_sidetone_frequency;
- }
-
- iqdata[0] = (sampleSpeed & 0x03);
- iqdata[1] = (((active_receiver->random << 6) & 0x40) | ((active_receiver->dither <<5) & 0x20) | (attenuation & 0x1F));
- iqdata[2] = ((rxFrequency >> 24) & 0xFF);
- iqdata[3] = ((rxFrequency >> 16) & 0xFF);
- iqdata[4] = ((rxFrequency >> 8) & 0xFF);
- iqdata[5] = (rxFrequency & 0xFF);
-
- spiXfer(h, iqdata, iqdata, 6);
-
- //firmware: tdata(56'h00010203040506) -> 0-1-2-3-4-5-6 (element 0 contains 0; second element contains 1)
- rxcount ++;
- if (rxcount == 48000) {
- rxcount = 0;
- gettimeofday(&t1, 0);
- elapsed = timedifference_msec(t0, t1);
- printf("Code rx mode spi executed in %f milliseconds.\n", elapsed);
- gettimeofday(&t0, 0);
- }
-}
-
-void spiWriter() {
- while ( gpioRead(20) == 1) {};
-
-<<<<<<< HEAD
- spiXfer(rx1_spi_handler, tx_iqdata, tx_iqdata, 6);
-
- long long txFrequency;
- if(split) {
- txFrequency=vfo[VFO_B].frequency-vfo[VFO_A].lo+vfo[VFO_B].offset;
- } else {
- txFrequency=vfo[VFO_A].frequency-vfo[VFO_B].lo+vfo[VFO_A].offset;
- }
- tx_iqdata[0] = cw_keyer_speed | (cw_keyer_mode<<6);
- tx_iqdata[1] = cw_keyer_weight | (cw_keyer_spacing<<7);
- tx_iqdata[2] = ((txFrequency >> 24) & 0xFF);
- tx_iqdata[3] = ((txFrequency >> 16) & 0xFF);
- tx_iqdata[4] = ((txFrequency >> 8) & 0xFF);
- tx_iqdata[5] = (txFrequency & 0xFF);
-
- spiXfer(rx2_spi_handler, tx_iqdata, tx_iqdata, 6);
-=======
- spiXfer(h, tx_iqdata, tx_iqdata, 6);
->>>>>>> upstream/master
-
- txcount ++;
- if (txcount == 48000) {
- txcount = 0;
- gettimeofday(&t21, 0);
- float elapsd = timedifference_msec(t20, t21);
- printf("Code tx mode spi executed in %f milliseconds.\n", elapsd);
- gettimeofday(&t20, 0);
- }
-}
\ No newline at end of file
+++ /dev/null
-/* Copyright (C)
-* 2017 - Johan Maas, PA3GSB
-*
-* 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-*
-*/
-
-#define BUFFER_SIZE 1024
-void radioberry_protocol_stop();
-void radioberry_protocol_init(int rx,int pixels);
-void *radioberry_protocol_process_local_mic(unsigned char *buffer,int le);
-extern void radioberry_protocol_iq_samples(int isample,int qsample);
-void radioberry_set_attenuation(int attenuation);
+++ /dev/null
-/* Copyright (C)
-* 2017 - Johan Maas, PA3GSB
-*
-* 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-*
-*/
-
-#include <stdio.h>
-#include <string.h>
-#include "discovered.h"
-#include "radioberry_discovery.h"
-
-void radioberry_discovery() {
-
- //check availability of RADIOBERRY for instance by si570 i2c address;
- //for initial version when compiling with radioberry option; select it.
-
-
- // setting clock and loading rbf file..... done before starting
-
- discovered[devices].protocol=RADIOBERRY_PROTOCOL;
- discovered[devices].device=RADIOBERRY_SPI_DEVICE;
- strcpy(discovered[devices].name, "RadioBerry");
- discovered[devices].status=STATE_AVAILABLE;
- discovered[devices].software_version=100;
- devices++;
-}
+++ /dev/null
-/* Copyright (C)
-* 2017 - Johan Maas, PA3GSB
-*
-* 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-*
-*/
-#ifndef _RADIOBERRY_DISCOVERY_H
-#define _RADIOBERRY_DISCOVERY_H
-
-void radioberry_discovery();
-
-#endif
\ No newline at end of file
#include "freedv.h"
#endif
#include "audio_waterfall.h"
-#ifdef RADIOBERRY
-#include "radioberry.h"
-#endif
#include "ext.h"
#include "new_menu.h"
}
switch(protocol) {
case ORIGINAL_PROTOCOL:
-#ifdef RADIOBERRY
- case RADIOBERRY_PROTOCOL:
-#endif
switch(device) {
-#ifdef RADIOBERRY
- case RADIOBERRY_SPI_DEVICE:
-#endif
case DEVICE_METIS:
case DEVICE_HERMES:
case DEVICE_HERMES_LITE:
#ifdef LIMESDR
case LIMESDR_PROTOCOL:
break;
-#endif
-#ifdef RADIOBERRY
- case RADIOBERRY_PROTOCOL:
- //no audio stream to radioberry hardware, using local audio of rpi.
- break;
#endif
}
}
#ifdef LIMESDR
case LIMESDR_PROTOCOL:
break;
-#endif
-#ifdef RADIOBERRY
- case RADIOBERRY_PROTOCOL:
- //no audio stream to radioberry hardware, using local audio of rpi.
- break;
#endif
}
int x=0;
switch(protocol) {
-#ifdef RADIOBERRY
- case RADIOBERRY_PROTOCOL:
-#endif
case NEW_PROTOCOL:
{
GtkWidget *sample_rate_label=gtk_label_new("Sample Rate");
}
switch(protocol) {
-#ifdef RADIOBERRY
- case RADIOBERRY_PROTOCOL:
-#endif
case ORIGINAL_PROTOCOL:
case NEW_PROTOCOL:
{
void set_attenuation_value(double value) {
adc_attenuation[active_receiver->adc]=(int)value;
if(display_sliders) {
+#ifdef RADIOBERRY
+ gtk_range_set_value (GTK_RANGE(attenuation_scale),(double)rx_gain_slider[active_receiver->adc]);
+#else
gtk_range_set_value (GTK_RANGE(attenuation_scale),(double)adc_attenuation[active_receiver->adc]);
+#endif
} else {
if(scale_status!=ATTENUATION) {
if(scale_status!=NONE) {
#ifdef RADIOBERRY
attenuation_scale=gtk_scale_new_with_range(GTK_ORIENTATION_HORIZONTAL,0.0, 60.0, 1.0);
+ gtk_range_set_value (GTK_RANGE(attenuation_scale),rx_gain_slider[active_receiver->adc]);
#else
attenuation_scale=gtk_scale_new_with_range(GTK_ORIENTATION_HORIZONTAL,0.0, 31.0, 1.0);
+ gtk_range_set_value (GTK_RANGE(attenuation_scale),adc_attenuation[active_receiver->adc]);
#endif
- gtk_range_set_value (GTK_RANGE(attenuation_scale),adc_attenuation[active_receiver->adc]);
+
gtk_widget_show(attenuation_scale);
gtk_grid_attach(GTK_GRID(sliders),attenuation_scale,7,0,2,1);
g_signal_connect(G_OBJECT(attenuation_scale),"value_changed",G_CALLBACK(attenuation_value_changed_cb),NULL);
#include "property.h"
#include "new_menu.h"
#include "button_text.h"
-#ifdef RADIOBERRY
-#include "radioberry.h"
-#endif
#include "ext.h"
#define MAX_FUNCTION 3
}
static void stop() {
-#ifdef RADIOBERRY
- if(protocol==RADIOBERRY_PROTOCOL) {
- radioberry_protocol_stop();
- }
-#endif
if(protocol==ORIGINAL_PROTOCOL) {
old_protocol_stop();
} else {
double constant1=3.3;
double constant2=0.095;
-#ifdef RADIOBERRY
- if(protocol==ORIGINAL_PROTOCOL || protocol==RADIOBERRY_PROTOCOL) {
-#else
if(protocol==ORIGINAL_PROTOCOL) {
-#endif
switch(device) {
case DEVICE_METIS:
constant1=3.3;
break;
case DEVICE_HERMES_LITE:
break;
-#ifdef RADIOBERRY
- case RADIOBERRY_SPI_DEVICE:
- break;
-#endif
}
int power=alex_forward_power;
constant1=3.3;
constant2=0.09;
break;
-#ifdef RADIOBERRY
- case RADIOBERRY_SPI_DEVICE:
- constant1=3.3;
- constant2=0.09;
- break;
-#endif
}
int power=alex_forward_power;
tx->fft_size=fft_size;
tx->fps=fps;
-#ifdef RADIOBERRY
- if(protocol==ORIGINAL_PROTOCOL || protocol==RADIOBERRY_PROTOCOL) {
-#else
- if(protocol==ORIGINAL_PROTOCOL) {
-#endif
+ if(protocol==ORIGINAL_PROTOCOL) {
tx->mic_sample_rate=48000;
tx->mic_dsp_rate=48000;
tx->iq_output_rate=48000;
int mode;
switch(protocol) {
-#ifdef RADIOBERRY
- case RADIOBERRY_PROTOCOL:
-#endif
case ORIGINAL_PROTOCOL:
gain=32767.0; // 16 bit
break;
case NEW_PROTOCOL:
new_protocol_iq_samples(isample,qsample);
break;
-#ifdef RADIOBERRY
- case RADIOBERRY_PROTOCOL:
- radioberry_protocol_iq_samples(isample,qsample);
- break;
-#endif
}
}
}
row++;
col=0;
-#ifdef RADIOBERRY
- if(protocol==ORIGINAL_PROTOCOL || protocol==NEW_PROTOCOL || protocol==RADIOBERRY_PROTOCOL) {
-#else
if(protocol==ORIGINAL_PROTOCOL || protocol==NEW_PROTOCOL) {
-#endif
-
micin_b=gtk_radio_button_new_with_label_from_widget(NULL,"Mic In");
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (micin_b), mic_linein==0);
gtk_widget_show(micin_b);
gtk_widget_show_all(dialog);
-#ifdef RADIOBERRY
- if(transmitter->local_microphone && (protocol==ORIGINAL_PROTOCOL || protocol==NEW_PROTOCOL || protocol==RADIOBERRY_PROTOCOL)) {
-#else
- if(transmitter->local_microphone && (protocol==ORIGINAL_PROTOCOL || protocol==NEW_PROTOCOL)) {
-#endif
+
+ if(transmitter->local_microphone && (protocol==ORIGINAL_PROTOCOL || protocol==NEW_PROTOCOL)) {
gtk_widget_hide(linein_b);
gtk_widget_hide(micboost_b);
}
#include "wdsp.h"
#include "new_menu.h"
#include "rigctl.h"
-#ifdef RADIOBERRY
-#include "radioberry.h"
-#endif
#include "ext.h"
#ifdef FREEDV
#include "freedv.h"