Skip to content

Commit

Permalink
Updated Makefile.mac. Added code to display panadater using color gra…
Browse files Browse the repository at this point in the history
…dient.
  • Loading branch information
g0orx committed Nov 5, 2020
1 parent 32b5333 commit bfa924d
Show file tree
Hide file tree
Showing 9 changed files with 223 additions and 51 deletions.
14 changes: 10 additions & 4 deletions Makefile.mac
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ AUDIOLIBS=-lsoundio
# sudo apt-get install soapysdr-module-rtlsdr
# sudo apt-get install soapysdr-module-lms7
#
SOAPYSDR_INCLUDE=SOAPYSDR
#SOAPYSDR_INCLUDE=SOAPYSDR

ifeq ($(SOAPYSDR_INCLUDE),SOAPYSDR)
SOAPYSDR_OPTIONS=-D SOAPYSDR
Expand Down Expand Up @@ -106,7 +106,9 @@ frequency.c\
rigctl.c\
error_handler.c\
radio_info.c\
bpsk.c
bpsk.c \
css.c \
subrx.c

HEADERS=\
main.h\
Expand Down Expand Up @@ -156,7 +158,9 @@ frequency.h\
rigctl.h\
error_handler.h\
radio_info.h\
bpsk.h
bpsk.h \
css.h \
subrx.h

OBJS=\
main.o\
Expand Down Expand Up @@ -205,7 +209,9 @@ frequency.o\
rigctl.o\
error_handler.o\
radio_info.o\
bpsk.o
bpsk.o \
css.o \
subrx.o

all: prebuild $(PROGRAM) $(HEADERS) $(SOURCES) $(SOAPYSDR_SOURCES)

Expand Down
44 changes: 40 additions & 4 deletions protocol1.c
Original file line number Diff line number Diff line change
Expand Up @@ -307,7 +307,7 @@ static gpointer ozy_ep6_rx_thread(gpointer arg) {

}
// terminate
_exit(0);
//_exit(0);
}
#endif

Expand Down Expand Up @@ -452,11 +452,15 @@ static void process_control_bytes() {

RECEIVER *tx_receiver=radio->transmitter->rx;
if(tx_receiver!=NULL) {
#ifdef USE_VFO_B_MODE_AND_FILTER
if(radio->transmitter->rx->split) {
tx_mode=tx_receiver->mode_b;
} else {
#endif
tx_mode=tx_receiver->mode_a;
#ifdef USE_VFO_B_MODE_AND_FILTER
}
#endif
}

previous_ptt=radio->local_ptt;
Expand Down Expand Up @@ -490,9 +494,11 @@ g_print("process_control_bytes: ppt=%d dot=%d dash=%d\n",radio->ptt,radio->dot,r
if ((radio->ptt) || keytx) {
int recov = (control_in[3]&0x40) == 0x40;
int msb = (control_in[3]&0x80) == 0x80;
/*
if (msb == 1) {
g_print("Buffer recovery %d %d\n", recov, msb);
}
*/
}
#endif
//}
Expand Down Expand Up @@ -694,11 +700,15 @@ static void process_ozy_input_buffer(char *buffer) {

RECEIVER *tx_receiver=radio->transmitter->rx;
if(tx_receiver!=NULL) {
#ifdef USE_VFO_B_MODE_AND_FILTER
if(radio->transmitter->rx->split) {
tx_mode=tx_receiver->mode_b;
} else {
#endif
tx_mode=tx_receiver->mode_a;
#ifdef USE_VFO_B_MODE_AND_FILTER
}
#endif
}

if(buffer[b++]==SYNC && buffer[b++]==SYNC && buffer[b++]==SYNC) {
Expand Down Expand Up @@ -921,11 +931,15 @@ void protocol1_iq_samples(int isample,int qsample) {
gint tx_mode=USB;
RECEIVER *tx_receiver=radio->transmitter->rx;
if(tx_receiver!=NULL) {
#ifdef USE_VFO_B_MODE_AND_FILTER
if(radio->transmitter->rx->split) {
tx_mode=tx_receiver->mode_b;
} else {
#endif
tx_mode=tx_receiver->mode_a;
#ifdef USE_VFO_B_MODE_AND_FILTER
}
#endif
}
// I[0] of IQ stream is CWX keydown
if ((radio->cwdaemon) && (tx_mode==CWL || tx_mode==CWU)) {
Expand All @@ -944,10 +958,10 @@ void protocol1_iq_samples(int isample,int qsample) {
output_buffer[tx_output_buffer_index++]=isample>>8;
output_buffer[tx_output_buffer_index++]=isample;
}
#else
#else
output_buffer[tx_output_buffer_index++]=isample>>8;
output_buffer[tx_output_buffer_index++]=isample;
#endif
#endif

output_buffer[tx_output_buffer_index++]=qsample>>8;
output_buffer[tx_output_buffer_index++]=qsample;
Expand Down Expand Up @@ -1055,9 +1069,11 @@ void ozy_send_buffer() {
if(radio->transmitter->rx!=NULL) {
band=band_get_band(radio->transmitter->rx->band_a);
if(isTransmitting(radio)) {
#ifdef USE_VFO_B_MODE_AND_FILTER
if(radio->transmitter->rx->split) {
band=band_get_band(radio->transmitter->rx->band_b);
}
#endif
output_buffer[C2]|=band->OCtx<<1;
if(radio->tune) {
if(radio->OCmemory_tune_time!=0) {
Expand Down Expand Up @@ -1270,11 +1286,15 @@ void ozy_send_buffer() {
gint tx_mode=USB;
tx_receiver=radio->transmitter->rx;
if(tx_receiver!=NULL) {
#ifdef USE_VFO_B_MODE_AND_FILTER
if(radio->transmitter->rx->split) {
tx_mode=tx_receiver->mode_b;
} else {
#endif
tx_mode=tx_receiver->mode_a;
#ifdef USE_VFO_B_MODE_AND_FILTER
}
#endif
}


Expand All @@ -1284,11 +1304,15 @@ void ozy_send_buffer() {
BAND *band;
if(radio->transmitter!=NULL) {
if(radio->transmitter->rx!=NULL) {
#ifdef USE_VFO_B_MODE_AND_FILTER
if(radio->transmitter->rx->split) {
band=band_get_band(radio->transmitter->rx->band_b);
} else {
#endif
band=band_get_band(radio->transmitter->rx->band_a);
#ifdef USE_VFO_B_MODE_AND_FILTER
}
#endif
}
}

Expand Down Expand Up @@ -1344,11 +1368,13 @@ void ozy_send_buffer() {
output_buffer[C3]=output_buffer[C3]|0x40; // Alex 6M low noise amplifier
}
band=band_get_band(radio->transmitter->rx->band_a);
#ifdef USE_VFO_B_MODE_AND_FILTER
if(isTransmitting(radio)) {
if(radio->transmitter->rx->split) {
band=band_get_band(radio->transmitter->rx->band_b);
}
}
#endif
if(band->disablePA) {
output_buffer[C3]=output_buffer[C3]|0x80; // disable PA
}
Expand Down Expand Up @@ -1513,11 +1539,15 @@ void ozy_send_buffer() {
gint tx_mode=USB;
tx_receiver=radio->transmitter->rx;
if(tx_receiver!=NULL) {
#ifdef USE_VFO_B_MODE_AND_FILTER
if(radio->transmitter->rx->split) {
tx_mode=tx_receiver->mode_b;
} else {
#endif
tx_mode=tx_receiver->mode_a;
#ifdef USE_VFO_B_MODE_AND_FILTER
}
#endif
}

output_buffer[C1]=0x00;
Expand Down Expand Up @@ -1595,11 +1625,15 @@ void ozy_send_buffer() {
gint tx_mode=USB;
tx_receiver=radio->transmitter->rx;
if(tx_receiver!=NULL) {
#ifdef USE_VFO_B_MODE_AND_FILTER
if(radio->transmitter->rx->split) {
tx_mode=tx_receiver->mode_b;
} else {
#endif
tx_mode=tx_receiver->mode_a;
#ifdef USE_VFO_B_MODE_AND_FILTER
}
#endif
}

if(tx_mode==CWU || tx_mode==CWL) {
Expand Down Expand Up @@ -1747,4 +1781,6 @@ static void metis_send_buffer(unsigned char* buffer,int length) {
}
}


gboolean protocol1_is_running() {
return running;
}
1 change: 1 addition & 0 deletions protocol1.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,5 @@ extern void protocol1_process_local_mic(RADIO *r);
extern void protocol1_audio_samples(RECEIVER *rx,short left_audio_sample,short right_audio_sample);
extern void protocol1_iq_samples(int isample,int qsample);
extern void protocol1_eer_iq_samples(int isample,int qsample,int lasample,int rasample);
extern gboolean protocol1_is_running();
#endif
31 changes: 27 additions & 4 deletions protocol2.c
Original file line number Diff line number Diff line change
Expand Up @@ -320,11 +320,15 @@ void protocol2_general() {
if(radio!=NULL) {
if(radio->transmitter!=NULL) {
if(radio->transmitter->rx!=NULL) {
#ifdef USE_VFO_B_MODE_AND_FILTER
if(radio->transmitter->rx->split) {
band=band_get_band(radio->transmitter->rx->band_a);
} else {
band=band_get_band(radio->transmitter->rx->band_b);
} else {
#endif
band=band_get_band(radio->transmitter->rx->band_a);
#ifdef USE_VFO_B_MODE_AND_FILTER
}
#endif
}
}
}
Expand Down Expand Up @@ -397,11 +401,15 @@ void protocol2_high_priority() {

mode=USB;
if(radio->transmitter->rx!=NULL) {
#ifdef USE_VFO_B_MODE_AND_FILTER
if(radio->transmitter->rx->split) {
#endif
mode=radio->transmitter->rx->mode_a;
#ifdef USE_VFO_B_MODE_AND_FILTER
} else {
mode=radio->transmitter->rx->mode_b;
}
#endif
}
high_priority_buffer_to_radio[4]=running;
if(mode==CWU || mode==CWL) {
Expand Down Expand Up @@ -512,12 +520,15 @@ void protocol2_high_priority() {
BAND *band;
if(radio->transmitter!=NULL) {
if(radio->transmitter->rx!=NULL) {
#ifdef USE_VFO_B_MODE_AND_FILTER
if(radio->transmitter->rx->split) {
band=band_get_band(radio->transmitter->rx->band_b);
} else {
#endif
band=band_get_band(radio->transmitter->rx->band_a);
g_print("protocol2_high_priority: band=%d %s\n",radio->transmitter->rx->band_a, band->title);
#ifdef USE_VFO_B_MODE_AND_FILTER
}
#endif
}
}

Expand Down Expand Up @@ -890,11 +901,15 @@ static void protocol2_transmit_specific() {
if(radio!=NULL) {
if(radio->transmitter!=NULL) {
if(radio->transmitter->rx!=NULL) {
#ifdef USE_VFO_B_MODE_AND_FILTER
if(radio->transmitter->rx->split) {
#endif
mode=radio->transmitter->rx->mode_a;
#ifdef USE_VFO_B_MODE_AND_FILTER
} else {
mode=radio->transmitter->rx->mode_b;
}
#endif
}
}
}
Expand Down Expand Up @@ -1039,7 +1054,7 @@ void protocol2_stop() {
running=0;
protocol2_high_priority();
usleep(100000); // 100 ms
_exit(0);
//_exit(0);
}

void protocol2_run() {
Expand Down Expand Up @@ -1404,11 +1419,15 @@ static void process_high_priority(unsigned char *buffer) {
gint tx_mode=USB;
RECEIVER *tx_receiver=radio->transmitter->rx;
if(tx_receiver!=NULL) {
#ifdef USE_VFO_B_MODE_AND_FILTER
if(radio->transmitter->rx->split) {
tx_mode=tx_receiver->mode_b;
} else {
#endif
tx_mode=tx_receiver->mode_a;
#ifdef USE_VFO_B_MODE_AND_FILTER
}
#endif
}

radio->local_ptt=radio->ptt;
Expand Down Expand Up @@ -1507,3 +1526,7 @@ fprintf(stderr,"protocol2_timer_thread\n");
}
return NULL;
}

gboolean protocol2_is_running() {
return running;
}
1 change: 1 addition & 0 deletions protocol2.h
Original file line number Diff line number Diff line change
Expand Up @@ -81,4 +81,5 @@ extern int getTune();
extern void protocol2_process_local_mic(RADIO *r);
extern void protocol2_audio_samples(RECEIVER *rx,short left_audio_sample,short right_audio_sample);
extern void protocol2_iq_samples(int isample,int qsample);
extern gboolean protocol2_is_running();
#endif
Loading

0 comments on commit bfa924d

Please sign in to comment.