diff options
author | Andreas Eversberg <jolly@eversberg.eu> | 2021-09-18 11:43:01 +0200 |
---|---|---|
committer | Andreas Eversberg <jolly@eversberg.eu> | 2021-10-24 06:25:10 +0200 |
commit | 6fa74a12969f942b059693721aec2505772b2dcf (patch) | |
tree | df66a46dc0177d066fcf0202769dae14bf468e26 /src/jolly/main.c | |
parent | de685b3cb6f9397818c7f774eddbd802db5dde7a (diff) |
Refactor global variables for signal processing
These are:
device, sample rate, buffer, latency
Called now:
dsp_device, dsp_samplerate, dsp_buffer, dsp_latency
Call audio device:
call_device, call_samplerate, call_buffer
Diffstat (limited to 'src/jolly/main.c')
-rw-r--r-- | src/jolly/main.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/src/jolly/main.c b/src/jolly/main.c index b8ed825..c910069 100644 --- a/src/jolly/main.c +++ b/src/jolly/main.c @@ -154,14 +154,14 @@ int main(int argc, char *argv[]) mandatory = 1; } if (use_sdr) { - /* set audiodev */ + /* set device */ for (i = 0; i < num_kanal; i++) - audiodev[i] = "sdr"; - num_audiodev = num_kanal; + dsp_device[i] = "sdr"; + num_device = num_kanal; } - if (num_kanal == 1 && num_audiodev == 0) - num_audiodev = 1; /* use default */ - if (num_kanal != num_audiodev) { + if (num_kanal == 1 && num_device == 0) + num_device = 1; /* use default */ + if (num_kanal != num_device) { fprintf(stderr, "You need to specify as many sound devices as you have channels.\n"); exit(0); } @@ -185,12 +185,12 @@ int main(int argc, char *argv[]) /* inits */ fm_init(fast_math); - init_voice(samplerate); + init_voice(dsp_samplerate); dsp_init(); /* create transceiver instance */ for (i = 0; i < num_kanal; i++) { - rc = jolly_create(kanal[i], dl_freq, ul_freq, step, audiodev[i], use_sdr, samplerate, rx_gain, tx_gain, do_pre_emphasis, do_de_emphasis, write_rx_wave, write_tx_wave, read_rx_wave, read_tx_wave, loopback, squelch_db, nbfm, repeater); + rc = jolly_create(kanal[i], dl_freq, ul_freq, step, dsp_device[i], use_sdr, dsp_samplerate, rx_gain, tx_gain, do_pre_emphasis, do_de_emphasis, write_rx_wave, write_tx_wave, read_rx_wave, read_tx_wave, loopback, squelch_db, nbfm, repeater); if (rc < 0) { fprintf(stderr, "Failed to create transceiver instance. Quitting!\n"); goto fail; @@ -198,7 +198,7 @@ int main(int argc, char *argv[]) printf("base station on channel %s ready, please tune transmitter to %.4f MHz and receiver to %.4f MHz. (%.4f MHz offset)\n", kanal[i], dl_freq + step / 1e3 * (double)atoi(kanal[i]), ul_freq + step / 1e3 * (double)atoi(kanal[i]), ul_freq - dl_freq); } - main_mobile("jollycom", &quit, latency, interval, NULL, station_id, 4); + main_mobile("jollycom", &quit, NULL, station_id, 4); fail: /* destroy transceiver instance */ |