mirror of
https://github.com/eried/portapack-mayhem.git
synced 2025-08-06 05:34:50 -04:00
Allows apps using app settings to use global frequency (#1148)
* Allow apps to not use persisted freq. * use rx_freq for RX mode * remove direct call to persistant_memory in tx_model * app_setting defaults, and tx_view to use ctor value
This commit is contained in:
parent
ccd7bd6fc2
commit
3db2053c21
9 changed files with 81 additions and 32 deletions
|
@ -104,7 +104,6 @@ void TransmitterView::set_transmitting(const bool transmitting) {
|
|||
|
||||
void TransmitterView::on_show() {
|
||||
field_frequency.set_value(transmitter_model.target_frequency());
|
||||
field_frequency_step.set_by_value(receiver_model.frequency_step());
|
||||
|
||||
field_gain.set_value(transmitter_model.tx_gain());
|
||||
field_amp.set_value(transmitter_model.rf_amp() ? 14 : 0);
|
||||
|
@ -152,7 +151,6 @@ TransmitterView::TransmitterView(
|
|||
}
|
||||
}
|
||||
|
||||
field_frequency.set_step(frequency_step);
|
||||
field_frequency.on_change = [this](rf::Frequency f) {
|
||||
on_target_frequency_changed(f);
|
||||
};
|
||||
|
@ -162,8 +160,11 @@ TransmitterView::TransmitterView(
|
|||
};
|
||||
|
||||
field_frequency_step.on_change = [this](size_t, OptionsField::value_t v) {
|
||||
receiver_model.set_frequency_step(v);
|
||||
this->field_frequency.set_step(v);
|
||||
};
|
||||
// TODO: Shouldn't be a ctor parameter because it doesn't work with app settings.
|
||||
field_frequency_step.set_by_value(frequency_step);
|
||||
|
||||
field_gain.on_change = [this](uint32_t tx_gain) {
|
||||
on_tx_gain_changed(tx_gain);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue