Added beep on radiosonde packet decoding, and volume widget to control its level.

This commit is contained in:
teixeluis
2021-06-08 23:07:37 +01:00
parent 182059b3c6
commit 9040e780bc
4 changed files with 171 additions and 6 deletions

View File

@@ -55,7 +55,15 @@ class SondeView : public View {
public:
static constexpr uint32_t sampling_rate = 2457600;
static constexpr uint32_t baseband_bandwidth = 1750000;
static constexpr int rssi_sample_range = 256;
static constexpr float rssi_voltage_min = 0.4;
static constexpr float rssi_voltage_max = 2.2;
static constexpr float adc_voltage_max = 3.3;
static constexpr int raw_min = rssi_sample_range * rssi_voltage_min / adc_voltage_max;
static constexpr int raw_max = rssi_sample_range * rssi_voltage_max / adc_voltage_max;
static constexpr int raw_delta = raw_max - raw_min;
SondeView(NavigationView& nav);
~SondeView();
@@ -68,10 +76,14 @@ private:
uint32_t target_frequency_ { 402700000 };
bool logging { false };
bool use_crc { false };
bool beep { false };
sonde::GPS_data gps_info { };
sonde::temp_humid temp_humid_info { };
std::string sonde_id { };
// AudioOutput audio_output { };
Labels labels {
{ { 4 * 8, 2 * 16 }, "Type:", Color::light_grey() },
{ { 6 * 8, 3 * 16 }, "ID:", Color::light_grey() },
@@ -103,14 +115,29 @@ private:
{ 21 * 8, 0, 6 * 8, 4 },
};
NumberField field_volume {
{ 28 * 8, 0 * 16 },
2,
{ 0, 99 },
1,
' ',
};
Checkbox check_beep {
{ 22 * 8, 6 * 16 },
3,
"Beep"
};
Checkbox check_log {
{ 23 * 8, 6 * 16 },
{ 22 * 8, 8 * 16 },
3,
"Log"
};
Checkbox check_crc {
{ 23 * 8, 8 * 16 },
{ 22 * 8, 10 * 16 },
3,
"CRC"
};
@@ -170,7 +197,10 @@ private:
};
void on_packet(const sonde::Packet& packet);
void on_headphone_volume_changed(int32_t v);
void set_target_frequency(const uint32_t new_value);
uint32_t tuning_frequency() const;
};