Merge pull request #446 from Brumi-2021/“Indep_persistent_memory_14dBs_RF_tx-rx_amp”

Minor improvements to the previous PR #395 Add Gain_TX to Replay App
This commit is contained in:
Erwin Ried 2022-01-12 15:19:54 +01:00 committed by GitHub
commit e5015cc67b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 21 additions and 7 deletions

View File

@ -145,16 +145,23 @@ void ReplayAppView::start() {
field_rfgain.set_value(tx_gain);
receiver_model.set_tx_gain(tx_gain);
field_rfamp.on_change = [this](int32_t v) {
rf_amp = (bool)v;
};
field_rfamp.set_value(rf_amp ? 14 : 0);
radio::enable({
receiver_model.tuning_frequency(),
sample_rate * 8 ,
baseband_bandwidth,
rf::Direction::Transmit,
receiver_model.rf_amp(),
rf_amp, // previous code line : "receiver_model.rf_amp()," was passing the same rf_amp of all Receiver Apps
static_cast<int8_t>(receiver_model.lna()),
static_cast<int8_t>(receiver_model.vga())
});
}
});
}
void ReplayAppView::stop(const bool do_loop) {
if( is_active() )
@ -186,7 +193,9 @@ ReplayAppView::ReplayAppView(
) : nav_ (nav)
{
tx_gain = 35;field_rfgain.set_value(tx_gain);
tx_gain = 35;field_rfgain.set_value(tx_gain); // Initial default value (-12 dB's max ).
field_rfamp.set_value(rf_amp ? 14 : 0); // Initial default value True. (TX RF amp on , +14dB's)
baseband::run_image(portapack::spi_flash::image_tag_replay);
add_children({
@ -198,7 +207,7 @@ ReplayAppView::ReplayAppView(
&progressbar,
&field_frequency,
&field_rfgain,
&field_rf_amp,
&field_rfamp, // let's not use common rf_amp
&check_loop,
&button_play,
&waterfall,

View File

@ -52,6 +52,7 @@ private:
uint32_t sample_rate = 0;
int32_t tx_gain { 47 };
bool rf_amp { true }; // aux private var to store temporal, Replay App rf_amp user selection.
static constexpr uint32_t baseband_bandwidth = 2500000;
const size_t read_size { 16384 };
const size_t buffer_count { 3 };
@ -112,8 +113,12 @@ private:
1,
' '
};
RFAmpField field_rf_amp {
{ 19 * 8, 2 * 16 }
NumberField field_rfamp { // previously I was using "RFAmpField field_rf_amp" but that is general Receiver amp setting.
{ 19 * 8, 2 * 16 },
2,
{ 0, 14 }, // this time we will display GUI , 0 or 14 dBs same as Mic App
14,
' '
};
Checkbox check_loop {
{ 21 * 8, 2 * 16 },