mirror of
https://github.com/portapack-mayhem/mayhem-firmware.git
synced 2026-08-19 06:03:59 +00:00
New approach to support RX-only mode more cleanly (#2908)
* Add enabled checks in ReceiverModel and TransmitterModel * Move TX limit logic to TransmitterModel from radio API * Add TX disable functionality and UI
This commit is contained in:
@@ -152,10 +152,10 @@ struct misc_config_t {
|
||||
bool config_sdcard_high_speed_io : 1;
|
||||
bool config_disable_config_mode : 1;
|
||||
bool beep_on_packets : 1;
|
||||
bool tx_disabled : 1;
|
||||
bool tx_amp_disabled : 1;
|
||||
bool UNUSED_7 : 1;
|
||||
|
||||
int8_t tx_gain_max_db;
|
||||
uint8_t tx_gain_max_db;
|
||||
uint8_t PLACEHOLDER_1;
|
||||
uint8_t PLACEHOLDER_2;
|
||||
};
|
||||
@@ -442,6 +442,7 @@ void defaults() {
|
||||
|
||||
set_config_sdcard_high_speed_io(false, true);
|
||||
|
||||
set_config_tx_disabled(false);
|
||||
set_config_tx_amp_disabled(false);
|
||||
set_config_tx_gain_max_db(47);
|
||||
}
|
||||
@@ -652,11 +653,15 @@ bool config_sdcard_high_speed_io() {
|
||||
return data->misc_config.config_sdcard_high_speed_io;
|
||||
}
|
||||
|
||||
bool config_tx_disabled() {
|
||||
return data->misc_config.tx_disabled;
|
||||
}
|
||||
|
||||
bool config_tx_amp_disabled() {
|
||||
return data->misc_config.tx_amp_disabled;
|
||||
}
|
||||
|
||||
int8_t config_tx_gain_max_db() {
|
||||
uint8_t config_tx_gain_max_db() {
|
||||
return data->misc_config.tx_gain_max_db;
|
||||
}
|
||||
|
||||
@@ -754,11 +759,15 @@ void set_config_sdcard_high_speed_io(bool v, bool save) {
|
||||
data->misc_config.config_sdcard_high_speed_io = v;
|
||||
}
|
||||
|
||||
void set_config_tx_disabled(bool v) {
|
||||
data->misc_config.tx_disabled = v;
|
||||
}
|
||||
|
||||
void set_config_tx_amp_disabled(bool v) {
|
||||
data->misc_config.tx_amp_disabled = v;
|
||||
}
|
||||
|
||||
void set_config_tx_gain_max_db(int8_t v) {
|
||||
void set_config_tx_gain_max_db(uint8_t v) {
|
||||
data->misc_config.tx_gain_max_db = v;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user