if(protocol==ORIGINAL_PROTOCOL) {
old_protocol_new_sample_rate((int)data);
} else {
- sample_rate=(int)data;
+ new_protocol_new_sample_rate((int)data);
}
}
static int freedv_resample=6; // convert from 48000 to 8000
#endif
+static void new_protocol_high_priority(int run,int tx,int drive);
static void* new_protocol_thread(void* arg);
static void* new_protocol_timer_thread(void* arg);
static void full_rx_buffer();
}
+void new_protocol_new_sample_rate(int rate) {
+ new_protocol_high_priority(0,0,0);
+ sample_rate=rate;
+ old_protocol_calc_buffers();
+ wdsp_new_sample_rate(rate);
+ new_protocol_high_priority(1,0,drive);
+}
+
static void new_protocol_general() {
unsigned char buffer[60];
buffer[4]=run|(tx<<1);
- long rxFrequency=ddsFrequency+(long long)rit;
+ long rxFrequency=ddsFrequency;
if(mode==modeCWU) {
rxFrequency-=cw_keyer_sidetone_frequency;
} else if(mode==modeCWL) {
metis_start_stop(0);
sample_rate=rate;
old_protocol_calc_buffers();
+ wdsp_new_sample_rate(rate);
metis_restart();
}
SetTXAPostGenRun(tx, 0);
SetChannelState(tx,1,0);
- SetChannelState(tx,1,0);
}
void wdsp_init(int rx,int pixels,int protocol) {
}
fprintf(stderr,"OpenChannel %d buffer_size=%d fft_size=%d sample_rate=%d dspRate=%d outputRate=%d\n",
CHANNEL_TX,
- tx_buffer_size,
+ buffer_size,
fft_size,
sample_rate, //micSampleRate,
micDspRate,
}
+void wdsp_new_sample_rate(int rate) {
+ SetChannelState(CHANNEL_TX,0,0);
+ SetInputSamplerate(CHANNEL_TX,rate);
+ SetChannelState(CHANNEL_TX,1,0);
+
+ SetChannelState(receiver,0,0);
+ SetInputSamplerate(receiver,rate);
+ SetChannelState(receiver,1,0);
+}
+
static void initAnalyzer(int channel,int buffer_size) {
int flp[] = {0};
double KEEP_TIME = 0.1;
extern int getFilterLow();
extern int getFilterHigh();
extern void wdsp_init(int rx,int pixels,int protocol);
+extern void wdsp_new_sample_rate(int rate);