mirror of
https://github.com/eried/portapack-mayhem.git
synced 2024-10-01 01:26:06 -04:00
Improve radio state management re: antenna bias voltage.
Responsibility for radio state is still rather muddy...
This commit is contained in:
parent
10d4172d5c
commit
25fac90d4f
@ -120,6 +120,7 @@ uint32_t ReceiverModel::baseband_oversampling() const {
|
||||
}
|
||||
|
||||
void ReceiverModel::enable() {
|
||||
enabled_ = true;
|
||||
radio::set_direction(rf::Direction::Receive);
|
||||
update_tuning_frequency();
|
||||
update_antenna_bias();
|
||||
@ -141,7 +142,12 @@ void ReceiverModel::baseband_disable() {
|
||||
}
|
||||
|
||||
void ReceiverModel::disable() {
|
||||
enabled_ = false;
|
||||
update_antenna_bias();
|
||||
baseband_disable();
|
||||
|
||||
// TODO: Responsibility for enabling/disabling the radio is muddy.
|
||||
// Some happens in ReceiverModel, some inside radio namespace.
|
||||
radio::disable();
|
||||
}
|
||||
|
||||
@ -159,7 +165,7 @@ void ReceiverModel::update_tuning_frequency() {
|
||||
}
|
||||
|
||||
void ReceiverModel::update_antenna_bias() {
|
||||
radio::set_antenna_bias(antenna_bias_);
|
||||
radio::set_antenna_bias(antenna_bias_ && enabled_);
|
||||
}
|
||||
|
||||
void ReceiverModel::update_rf_amp() {
|
||||
|
@ -89,6 +89,7 @@ public:
|
||||
|
||||
private:
|
||||
rf::Frequency frequency_step_ { 25000 };
|
||||
bool enabled_ { false };
|
||||
bool rf_amp_ { false };
|
||||
bool antenna_bias_ { false };
|
||||
int32_t lna_gain_db_ { 32 };
|
||||
|
Loading…
Reference in New Issue
Block a user