mirror of
https://github.com/eried/portapack-mayhem.git
synced 2025-08-07 14:12:31 -04:00
Remove unneeded AMFM support in those apps (#2597)
This commit is contained in:
parent
75c34747cb
commit
2c118ae584
3 changed files with 21 additions and 33 deletions
|
@ -1223,16 +1223,6 @@ size_t ReconView::change_mode(freqman_index_t new_mod) {
|
||||||
text_ctcss.set(" ");
|
text_ctcss.set(" ");
|
||||||
recording_sampling_rate = 48000;
|
recording_sampling_rate = 48000;
|
||||||
break;
|
break;
|
||||||
case AMFM_MODULATION:
|
|
||||||
freqman_set_bandwidth_option(new_mod, field_bw);
|
|
||||||
baseband::run_image(portapack::spi_flash::image_tag_am_audio);
|
|
||||||
receiver_model.set_modulation(ReceiverModel::Mode::AMAudioFMApt);
|
|
||||||
receiver_model.set_amfm_configuration(5); // Fix index 5 manually, not from freqman: set to RX AM (USB+FM) mode to demod audio tone, and get Wefax_APT signal.
|
|
||||||
field_bw.on_change = [this](size_t, OptionsField::value_t n) { (void)n; };
|
|
||||||
field_bw.set_by_value(0);
|
|
||||||
text_ctcss.set(" ");
|
|
||||||
recording_sampling_rate = 12000;
|
|
||||||
break;
|
|
||||||
case SPEC_MODULATION:
|
case SPEC_MODULATION:
|
||||||
freqman_set_bandwidth_option(new_mod, field_bw);
|
freqman_set_bandwidth_option(new_mod, field_bw);
|
||||||
baseband::run_image(portapack::spi_flash::image_tag_capture);
|
baseband::run_image(portapack::spi_flash::image_tag_capture);
|
||||||
|
@ -1263,9 +1253,17 @@ size_t ReconView::change_mode(freqman_index_t new_mod) {
|
||||||
|
|
||||||
field_mode.set_selected_index(new_mod);
|
field_mode.set_selected_index(new_mod);
|
||||||
field_mode.on_change = [this](size_t, OptionsField::value_t v) {
|
field_mode.on_change = [this](size_t, OptionsField::value_t v) {
|
||||||
if (v != -1) {
|
// initialize to a value under SPEC
|
||||||
change_mode(v);
|
static freqman_index_t last_mode = WFM_MODULATION;
|
||||||
|
if (v > SPEC_MODULATION) {
|
||||||
|
if (last_mode == SPEC_MODULATION)
|
||||||
|
v = AM_MODULATION;
|
||||||
|
else
|
||||||
|
v = SPEC_MODULATION;
|
||||||
|
field_mode.set_selected_index(v);
|
||||||
}
|
}
|
||||||
|
last_mode = v;
|
||||||
|
change_mode(v);
|
||||||
};
|
};
|
||||||
// for some motive, audio output gets stopped.
|
// for some motive, audio output gets stopped.
|
||||||
if (!recon && field_mode.selected_index_value() != SPEC_MODULATION)
|
if (!recon && field_mode.selected_index_value() != SPEC_MODULATION)
|
||||||
|
|
20
firmware/application/external/level/ui_level.cpp
vendored
20
firmware/application/external/level/ui_level.cpp
vendored
|
@ -130,9 +130,16 @@ LevelView::LevelView(NavigationView& nav)
|
||||||
|
|
||||||
freqman_set_modulation_option(field_mode);
|
freqman_set_modulation_option(field_mode);
|
||||||
field_mode.on_change = [this](size_t, OptionsField::value_t v) {
|
field_mode.on_change = [this](size_t, OptionsField::value_t v) {
|
||||||
if (v != -1) {
|
static freqman_index_t last_mode = WFM_MODULATION;
|
||||||
change_mode(v);
|
if (v > SPEC_MODULATION) {
|
||||||
|
if (last_mode == SPEC_MODULATION)
|
||||||
|
v = AM_MODULATION;
|
||||||
|
else
|
||||||
|
v = SPEC_MODULATION;
|
||||||
|
field_mode.set_selected_index(v);
|
||||||
}
|
}
|
||||||
|
last_mode = v;
|
||||||
|
change_mode(v);
|
||||||
};
|
};
|
||||||
field_mode.set_by_value(radio_mode); // Reflect the mode into the manual selector
|
field_mode.set_by_value(radio_mode); // Reflect the mode into the manual selector
|
||||||
field_bw.set_selected_index(radio_bw);
|
field_bw.set_selected_index(radio_bw);
|
||||||
|
@ -277,15 +284,6 @@ size_t LevelView::change_mode(freqman_index_t new_mod) {
|
||||||
field_bw.set_by_value(0);
|
field_bw.set_by_value(0);
|
||||||
field_bw.on_change = [this](size_t index, OptionsField::value_t n) { radio_bw = index ; receiver_model.set_wfm_configuration(n); };
|
field_bw.on_change = [this](size_t index, OptionsField::value_t n) { radio_bw = index ; receiver_model.set_wfm_configuration(n); };
|
||||||
break;
|
break;
|
||||||
case AMFM_MODULATION:
|
|
||||||
audio_sampling_rate = audio::Rate::Hz_12000;
|
|
||||||
freqman_set_bandwidth_option(new_mod, field_bw);
|
|
||||||
baseband::run_image(portapack::spi_flash::image_tag_am_audio);
|
|
||||||
receiver_model.set_modulation(ReceiverModel::Mode::AMAudioFMApt);
|
|
||||||
receiver_model.set_amfm_configuration(5); // Fix index 5 manually, not from freqman: set to RX AM (USB+FM) mode to demod audio tone, and get Wefax_APT signal.
|
|
||||||
field_bw.set_by_value(0);
|
|
||||||
field_bw.on_change = [this](size_t, OptionsField::value_t n) { (void)n; };
|
|
||||||
break;
|
|
||||||
case SPEC_MODULATION:
|
case SPEC_MODULATION:
|
||||||
audio_sampling_rate = audio::Rate::Hz_24000;
|
audio_sampling_rate = audio::Rate::Hz_24000;
|
||||||
freqman_set_bandwidth_option(new_mod, field_bw);
|
freqman_set_bandwidth_option(new_mod, field_bw);
|
||||||
|
|
|
@ -455,9 +455,9 @@ ScannerView::ScannerView(
|
||||||
// initialize to a value under SPEC
|
// initialize to a value under SPEC
|
||||||
static freqman_index_t last_mode = WFM_MODULATION;
|
static freqman_index_t last_mode = WFM_MODULATION;
|
||||||
// unsupported SPEC mode fix
|
// unsupported SPEC mode fix
|
||||||
if (v == SPEC_MODULATION) {
|
if (v >= SPEC_MODULATION) {
|
||||||
if (last_mode == WFM_MODULATION)
|
if (last_mode == WFM_MODULATION)
|
||||||
v = AMFM_MODULATION;
|
v = AM_MODULATION;
|
||||||
else
|
else
|
||||||
v = WFM_MODULATION;
|
v = WFM_MODULATION;
|
||||||
field_mode.set_selected_index(v);
|
field_mode.set_selected_index(v);
|
||||||
|
@ -727,14 +727,6 @@ void ScannerView::change_mode(freqman_index_t new_mod) {
|
||||||
field_bw.set_by_value(receiver_model.wfm_configuration());
|
field_bw.set_by_value(receiver_model.wfm_configuration());
|
||||||
field_bw.on_change = [this](size_t, OptionsField::value_t n) { receiver_model.set_wfm_configuration(n); };
|
field_bw.on_change = [this](size_t, OptionsField::value_t n) { receiver_model.set_wfm_configuration(n); };
|
||||||
break;
|
break;
|
||||||
case AMFM_MODULATION:
|
|
||||||
freqman_set_bandwidth_option(new_mod, field_bw);
|
|
||||||
baseband::run_image(portapack::spi_flash::image_tag_am_audio);
|
|
||||||
receiver_model.set_modulation(ReceiverModel::Mode::AMAudioFMApt);
|
|
||||||
receiver_model.set_amfm_configuration(5);
|
|
||||||
field_bw.set_by_value(0);
|
|
||||||
field_bw.on_change = [this](size_t, OptionsField::value_t n) { (void)n; };
|
|
||||||
break;
|
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue