Added tone keys for some wireless mic brands

Renamed CTCSS stuff to Tone key
Changed PTT key in mic TX (was left, now right) to allow easier exit
Mic samplerate bumped to 48kHz
Updated binary
This commit is contained in:
furrtek
2017-11-09 20:02:34 +00:00
parent bf3aa6e11a
commit 4465cfb905
12 changed files with 221 additions and 229 deletions
+13 -13
View File
@@ -27,7 +27,7 @@
#include "lfsr_random.hpp"
#include "string_format.hpp"
using namespace ctcss;
using namespace tonekey;
using namespace portapack;
namespace ui {
@@ -95,8 +95,8 @@ void SoundBoardView::on_tuning_frequency_changed(rf::Frequency f) {
}
void SoundBoardView::play_sound(uint16_t id) {
uint32_t ctcss_index;
bool ctcss_enabled;
uint32_t tone_key_index;
bool tone_key_enabled;
uint32_t divider;
if (sounds[id].size == 0) return;
@@ -119,13 +119,13 @@ void SoundBoardView::play_sound(uint16_t id) {
transmitter_model.set_baseband_bandwidth(1750000);
transmitter_model.enable();
ctcss_index = options_ctcss.selected_index();
tone_key_index = options_tone_key.selected_index();
if (ctcss_index) {
ctcss_enabled = true;
ctcss_index--;
if (tone_key_index) {
tone_key_enabled = true;
tone_key_index--;
} else
ctcss_enabled = false;
tone_key_enabled = false;
divider = (1536000 / sounds[id].sample_rate) - 1;
@@ -133,8 +133,8 @@ void SoundBoardView::play_sound(uint16_t id) {
divider,
number_bw.value() * 1000,
1,
ctcss_enabled,
(uint32_t)((ctcss_tones[ctcss_index].frequency / 1536000.0) * 0xFFFFFFFFULL)
tone_key_enabled,
(uint32_t)((tone_keys[tone_key_index].second / 1536000.0) * 0xFFFFFFFFULL)
);
}
@@ -230,7 +230,7 @@ SoundBoardView::SoundBoardView(
&field_frequency,
&number_bw,
&text_kHz,
&options_ctcss,
&options_tone_key,
&text_title,
&text_page,
&text_duration,
@@ -240,8 +240,8 @@ SoundBoardView::SoundBoardView(
&button_exit
});
ctcss_populate(options_ctcss);
options_ctcss.set_selected_index(0);
tone_keys_populate(options_tone_key);
options_tone_key.set_selected_index(0);
const auto button_fn = [this](Button& button) {
tx_mode = NORMAL;