mirror of
https://github.com/eried/portapack-mayhem.git
synced 2025-08-10 07:30:08 -04:00
Added wefax offset to audio app too. (#2572)
* added wefax offset to audio app too. * moved from head to cpp
This commit is contained in:
parent
ff2f27e297
commit
d73db884f0
3 changed files with 9 additions and 1 deletions
|
@ -265,6 +265,7 @@ void AnalogAudioView::set_spec_trigger(uint16_t trigger) {
|
||||||
}
|
}
|
||||||
|
|
||||||
AnalogAudioView::~AnalogAudioView() {
|
AnalogAudioView::~AnalogAudioView() {
|
||||||
|
receiver_model.set_hidden_offset(0);
|
||||||
audio::output::stop();
|
audio::output::stop();
|
||||||
receiver_model.disable();
|
receiver_model.disable();
|
||||||
baseband::shutdown();
|
baseband::shutdown();
|
||||||
|
@ -431,6 +432,8 @@ void AnalogAudioView::update_modulation(ReceiverModel::Mode modulation) {
|
||||||
receiver_model.set_sampling_rate(is_wideband_spectrum_mode ? spec_bw : 3072000);
|
receiver_model.set_sampling_rate(is_wideband_spectrum_mode ? spec_bw : 3072000);
|
||||||
receiver_model.set_baseband_bandwidth(is_wideband_spectrum_mode ? spec_bw / 2 : 1750000);
|
receiver_model.set_baseband_bandwidth(is_wideband_spectrum_mode ? spec_bw / 2 : 1750000);
|
||||||
|
|
||||||
|
receiver_model.set_hidden_offset(modulation == ReceiverModel::Mode::AMAudioFMApt ? -2200 : 0); // wefax needs to be shifted, see wefax rx app.
|
||||||
|
|
||||||
receiver_model.enable();
|
receiver_model.enable();
|
||||||
|
|
||||||
// TODO: This doesn't belong here! There's a better way.
|
// TODO: This doesn't belong here! There's a better way.
|
||||||
|
|
|
@ -282,6 +282,11 @@ void ReceiverModel::update_tuning_frequency() {
|
||||||
radio::set_tuning_frequency(target_frequency() + hidden_offset + tuning_offset());
|
radio::set_tuning_frequency(target_frequency() + hidden_offset + tuning_offset());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void ReceiverModel::set_hidden_offset(rf::Frequency offset) {
|
||||||
|
hidden_offset = offset;
|
||||||
|
update_tuning_frequency();
|
||||||
|
}
|
||||||
|
|
||||||
void ReceiverModel::update_baseband_bandwidth() {
|
void ReceiverModel::update_baseband_bandwidth() {
|
||||||
radio::set_baseband_filter_bandwidth_rx(baseband_bandwidth());
|
radio::set_baseband_filter_bandwidth_rx(baseband_bandwidth());
|
||||||
}
|
}
|
||||||
|
|
|
@ -110,7 +110,7 @@ class ReceiverModel {
|
||||||
uint8_t normalized_headphone_volume() const;
|
uint8_t normalized_headphone_volume() const;
|
||||||
void set_normalized_headphone_volume(uint8_t v);
|
void set_normalized_headphone_volume(uint8_t v);
|
||||||
|
|
||||||
void set_hidden_offset(rf::Frequency offset) { hidden_offset = offset; }
|
void set_hidden_offset(rf::Frequency offset);
|
||||||
|
|
||||||
void enable();
|
void enable();
|
||||||
void disable();
|
void disable();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue