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
+41 -42
View File
@@ -28,10 +28,10 @@
#include "ui_widget.hpp"
#include "ui_navigation.hpp"
#include "ui_font_fixed_8x16.hpp"
#include "message.hpp"
#include "ui_receiver.hpp"
#include "transmitter_model.hpp"
#include "ctcss.hpp"
#include "tone_key.hpp"
#include "message.hpp"
namespace ui {
@@ -49,7 +49,7 @@ public:
// PTT: Enable through KeyEvent (only works with presses), disable by polling :(
bool on_key(const KeyEvent key) {
if ((key == KeyEvent::Left) && (!va_enabled)) {
if ((key == KeyEvent::Right) && (!va_enabled)) {
set_tx(true);
return true;
} else
@@ -59,16 +59,21 @@ public:
std::string title() const override { return "Microphone TX"; };
private:
static constexpr uint32_t sampling_rate = 1536000U;
static constexpr uint32_t lcd_frame_duration = (256 * 1000UL) / 60; // 1 frame @ 60fps in ms .8 fixed point
void update_vumeter();
void do_timing();
void set_tx(bool enable);
void on_tuning_frequency_changed(rf::Frequency f);
void on_ctcss_changed(uint32_t v);
void on_tx_progress(const uint32_t progress, const bool done);
void on_tx_progress(const bool done);
void configure_baseband();
bool transmitting { false };
bool va_enabled { };
bool rogerbeep_enabled { };
uint32_t tone_key_index { };
bool tone_key_enabled { };
uint32_t mic_gain_x10 { };
uint32_t audio_level { 0 };
uint32_t va_level { };
@@ -79,18 +84,17 @@ private:
Labels labels {
{ { 7 * 8, 1 * 8 }, "Mic. gain:", Color::light_grey() },
{ { 7 * 8, 4 * 8 }, "Voice activation:", Color::light_grey() },
{ { 8 * 8, 9 * 8 }, "Level: /255", Color::light_grey() },
{ { 8 * 8, 11 * 8 }, "Attack: ms", Color::light_grey() },
{ { 8 * 8, 13 * 8 }, "Decay: ms", Color::light_grey() },
{ { 7 * 8, 17 * 8 }, "Bandwidth: kHz", Color::light_grey() },
{ { 7 * 8, 19 * 8 }, "Frequency:", Color::light_grey() },
{ { 11 * 8, 21 * 8 }, "CTCSS:", Color::light_grey() }
{ { 7 * 8, 4 * 8 }, "Frequency:", Color::light_grey() },
{ { 7 * 8, 6 * 8 }, "Bandwidth: kHz", Color::light_grey() },
{ { 9 * 8, 13 * 8 }, "Level: /255", Color::light_grey() },
{ { 9 * 8, 15 * 8 }, "Attack: ms", Color::light_grey() },
{ { 9 * 8, 17 * 8 }, "Decay: ms", Color::light_grey() },
{ { 7 * 8, 21 * 8 }, "Tone key:", Color::light_grey() }
};
VuMeter vumeter {
{ 1 * 8, 2 * 8, 5 * 8, 26 * 8 },
16,
{ 1 * 8, 2 * 8, 5 * 8, 32 * 8 },
20,
false
};
@@ -105,67 +109,62 @@ private:
}
};
FrequencyField field_frequency {
{ 17 * 8, 4 * 8 },
};
NumberField field_bw {
{ 17 * 8, 6 * 8 },
3,
{ 0, 150 },
1,
' '
};
Checkbox check_va {
{ 8 * 8, 6 * 8 },
{ 7 * 8, 10 * 8 },
7,
"Enabled",
"Voice activation",
false
};
NumberField field_va_level {
{ 14 * 8, 9 * 8 },
{ 15 * 8, 13 * 8 },
3,
{ 0, 255 },
2,
' '
};
NumberField field_va_attack {
{ 15 * 8, 11 * 8 },
{ 16 * 8, 15 * 8 },
3,
{ 0, 999 },
20,
' '
};
NumberField field_va_decay {
{ 14 * 8, 13 * 8 },
{ 15 * 8, 17 * 8 },
4,
{ 0, 9999 },
100,
' '
};
NumberField field_bw {
{ 17 * 8, 17 * 8 },
3,
{ 0, 150 },
1,
' '
};
FrequencyField field_frequency {
{ 17 * 8, 19 * 8 },
};
OptionsField options_ctcss {
{ 17 * 8, 21 * 8 },
8,
OptionsField options_tone_key {
{ 7 * 8, 23 * 8 },
23,
{ }
};
Checkbox check_rogerbeep {
{ 8 * 8, 23 * 8 },
{ 7 * 8, 26 * 8 },
10,
"Roger beep",
false
};
Text text_ptt {
{ 7 * 8, 28 * 8, 16 * 8, 16 },
"PTT: LEFT BUTTON"
};
Button button_exit {
{ 18 * 8, 32 * 8, 10 * 8, 40 },
"Exit"
{ 7 * 8, 17 * 16, 16 * 8, 16 },
"PTT: RIGHT BUTTON"
};
MessageHandlerRegistration message_handler_lcd_sync {
@@ -188,7 +187,7 @@ private:
Message::ID::TXProgress,
[this](const Message* const p) {
const auto message = *reinterpret_cast<const TXProgressMessage*>(p);
this->on_tx_progress(message.progress, message.done);
this->on_tx_progress(message.done);
}
};
};