Skip to content

Commit

Permalink
Fixed New Protocol CW. Updated header files so only included once.
Browse files Browse the repository at this point in the history
  • Loading branch information
g0orx committed Aug 25, 2016
1 parent 397f1ae commit ee7430a
Show file tree
Hide file tree
Showing 43 changed files with 366 additions and 95 deletions.
4 changes: 4 additions & 0 deletions agc.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,13 @@
*
*/

#ifndef _AGC_H
#define _AGC_H

#define AGC_OFF 0
#define AGC_LONG 1
#define AGC_SLOW 2
#define AGC_MEDIUM 3
#define AGC_FAST 4

#endif
5 changes: 5 additions & 0 deletions alex.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@
*
*/

#ifndef _ALEX_H
#define _ALEX_H

#define ALEX_RX_ANTENNA_NONE 0x00000000
#define ALEX_RX_ANTENNA_XVTR 0x00000900
#define ALEX_RX_ANTENNA_EXT1 0x00000A00
Expand Down Expand Up @@ -48,3 +51,5 @@
#define ALEX_BYPASS_HPF 0x00000800

#define ALEX_6M_PREAMP 0x00000008

#endif
5 changes: 5 additions & 0 deletions audio.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@
*
*/

#ifndef _AUDIO_H
#define _AUDIO_H

extern int audio;
extern int audio_buffer_size;

Expand All @@ -26,3 +29,5 @@ void audio_write(short left_sample,short right_sample);
/*
void audio_write(double *buffer,int samples);
*/

#endif
4 changes: 4 additions & 0 deletions band.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@
*
*/

#ifndef _BAND_H
#define _BAND_H

#include <gtk/gtk.h>
#include "bandstack.h"

Expand Down Expand Up @@ -99,3 +102,4 @@ BAND_LIMITS* getBandLimits(long long minDisplay,long long maxDisplay);
XVTR_ENTRY* getXvtrEntry(int i);
*/

#endif
5 changes: 3 additions & 2 deletions bandstack.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,9 @@
*
*/

#ifndef BANDSTACK_H
#define BANDSTACK_H
#ifndef _BANDSTACK_H
#define _BANDSTACK_H

/* --------------------------------------------------------------------------*/
/**
* @brief Bandstack definition
Expand Down
5 changes: 5 additions & 0 deletions channel.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@
*
*/

#ifndef _CHANNEL_H
#define _CHANNEL_H

#define CHANNEL_RX0 0
#define CHANNEL_RX1 1
#define CHANNEL_RX2 2
Expand All @@ -32,3 +35,5 @@
#define CHANNEL_PSK 11
#endif

#endif

5 changes: 5 additions & 0 deletions configure.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,11 @@
*/


#ifndef _CONFIGURE_H
#define _CONFIGURE_H

#ifdef INCLUDE_GPIO
void configure_gpio(GtkWidget *parent);
#endif

#endif
4 changes: 4 additions & 0 deletions discovered.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@
*
*/

#ifndef _DISCOVERED_H
#define _DISCOVERED_H

#include <netinet/in.h>
#ifdef LIMESDR
#include <SoapySDR/Device.h>
Expand Down Expand Up @@ -82,3 +85,4 @@ extern int selected_device;
extern int devices;
extern DISCOVERED discovered[MAX_DEVICES];

#endif
4 changes: 4 additions & 0 deletions filter.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@
*
*/

#ifndef _FILTER_H
#define _FILTER_H

#include "mode.h"

// disable Var1 and Var2 (change to 12 to enable)
Expand Down Expand Up @@ -61,3 +64,4 @@ int filterVar2High;

FILTER *filters[MODES];

#endif
23 changes: 23 additions & 0 deletions freedv.h
Original file line number Diff line number Diff line change
@@ -1,3 +1,25 @@
/* Copyright (C)
* 2016 - John Melton, G0ORX/N6LYT
*
* 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 _FREEDV_H
#define _FREEDV_H

extern int n_speech_samples;
extern int n_max_modem_samples;
extern short *demod_in;
Expand All @@ -16,3 +38,4 @@ int demod_sample_freedv(short sample);
int mod_sample_freedv(short sample);
void reset_freedv_tx_text_index();

#endif
7 changes: 4 additions & 3 deletions frequency.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,8 @@
*
*/

//
// frequency.h
//
#ifndef _FREQUENCY_H
#define _FREQUENCY_H

/* --------------------------------------------------------------------------*/
/**
Expand All @@ -44,3 +43,5 @@ struct frequency_info {
char* getFrequencyInfo(long long frequency);
int getBand(long long frequency);
int canTransmit();

#endif
5 changes: 5 additions & 0 deletions gpio.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@
*
*/

#ifndef _GPIO_H
#define _GPIO_H

extern int ENABLE_VFO_ENCODER;
extern int ENABLE_VFO_PULLUP;
extern int VFO_ENCODER_A;
Expand Down Expand Up @@ -67,3 +70,5 @@ int mode_get_state();
int filter_get_state();
int noise_get_state();
int mox_get_state();

#endif
24 changes: 24 additions & 0 deletions lime_discovery.h
Original file line number Diff line number Diff line change
@@ -1 +1,25 @@
/* Copyright (C)
* 2015 - John Melton, G0ORX/N6LYT
*
* 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 _LIME_DISCOVERY_H
#define _LIME_DISCOVERY_H

void lime_discovery();

#endif
24 changes: 24 additions & 0 deletions lime_protocol.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,31 @@
/* Copyright (C)
* 2015 - John Melton, G0ORX/N6LYT
*
* 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 _LIME_PROTOCOL_H
#define _LIME_PROTOCOL_H

#define BUFFER_SIZE 1024

void lime_protocol_init(int rx,int pixels);
void lime_protocol_stop();
void lime_protocol_set_frequency(long long f);
void lime_protocol_set_antenna(int ant);
void lime_protocol_set_attenuation(int attenuation);

#endif
15 changes: 11 additions & 4 deletions main.c
Original file line number Diff line number Diff line change
Expand Up @@ -166,16 +166,21 @@ gint update(gpointer data) {
DISCOVERED *d=&discovered[selected_device];

double constant1=3.3;
double constant2=0.09;
double constant2=0.095;

if(d->protocol==ORIGINAL_PROTOCOL) {
switch(d->device) {
case DEVICE_METIS:
constant1=3.3;
constant2=0.09;
break;
case DEVICE_HERMES:
//constant2=0.095; HERMES 2
constant1=3.3;
constant2=0.095;
break;
case DEVICE_ANGELIA:
constant1=3.3;
constant2=0.095;
break;
case DEVICE_ORION:
constant1=5.0;
Expand Down Expand Up @@ -256,9 +261,11 @@ gint update(gpointer data) {
}
}

//fprintf(stderr,"drive=%d tune_drive=%d alex_forward_power=%d alex_reverse_power=%d exciter_power=%d fwd=%f rev=%f exciter=%f\n",
// drive, tune_drive, alex_forward_power, alex_reverse_power, exciter_power, fwd, rev, exciter);
/*
fprintf(stderr,"alex_forward_power=%d alex_reverse_power=%d exciter_power=%d fwd=%f rev=%f exciter=%f\n",
alex_forward_power, alex_reverse_power, exciter_power, fwd, rev, exciter);
meter_update(POWER,fwd,rev,exciter,alc);
*/
}

return TRUE;
Expand Down
4 changes: 4 additions & 0 deletions main.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@
*
*/

#ifndef _MAIN_H
#define _MAIN_H

#include <sys/utsname.h>
extern struct utsname unameData;
void reconfigure_display();
Expand All @@ -25,3 +28,4 @@ void show_psk();
void show_waterfall();
#endif

#endif
5 changes: 5 additions & 0 deletions menu.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,9 @@
*/


#ifndef _MENU_H
#define _MENU_H

GtkWidget* menu_init(int width,int height,GtkWidget *parent);

#endif
5 changes: 5 additions & 0 deletions meter.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@
*
*/

#ifndef _METER_H
#define _METER_H

#define SMETER 0
#define POWER 1
#ifdef PSK
Expand All @@ -26,3 +29,5 @@

GtkWidget* meter_init(int width,int height,GtkWidget *parent);
void meter_update(int meter_type,double value,double reverse,double exciter,double alc);

#endif
4 changes: 4 additions & 0 deletions mode.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@
*
*/

#ifndef _MODE_H
#define _MODE_H

#define modeLSB 0
#define modeUSB 1
#define modeDSB 2
Expand Down Expand Up @@ -51,3 +54,4 @@ int mode;

char *mode_string[MODES];

#endif
4 changes: 4 additions & 0 deletions new_discovery.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,9 @@
*
*/

#ifndef _NEW_DISCOVERY_H
#define _NEW_DISCOVERY_H

void new_discovery(void);

#endif
Loading

0 comments on commit ee7430a

Please sign in to comment.