mirror of
https://github.com/portapack-mayhem/mayhem-firmware.git
synced 2026-09-01 12:29:04 +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:
@@ -146,6 +146,7 @@ class Message {
|
||||
SSTVRXPhaseSlant = 88,
|
||||
SSTVRXCalibration = 89,
|
||||
SubCarData = 90,
|
||||
TXDisabled = 91,
|
||||
MAX
|
||||
};
|
||||
|
||||
@@ -1699,4 +1700,11 @@ class SubCarDataMessage : public Message {
|
||||
uint64_t data2 = 0;
|
||||
};
|
||||
|
||||
class TXDisabledMessage : public Message {
|
||||
public:
|
||||
constexpr TXDisabledMessage()
|
||||
: Message{ID::TXDisabled} {
|
||||
}
|
||||
};
|
||||
|
||||
#endif /*__MESSAGE_H__*/
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
@@ -203,8 +203,9 @@ bool config_disable_external_tcxo();
|
||||
bool config_sdcard_high_speed_io();
|
||||
bool config_disable_config_mode();
|
||||
bool beep_on_packets();
|
||||
bool config_tx_disabled();
|
||||
bool config_tx_amp_disabled();
|
||||
int8_t config_tx_gain_max_db();
|
||||
uint8_t config_tx_gain_max_db();
|
||||
|
||||
bool config_splash();
|
||||
bool config_converter();
|
||||
@@ -228,8 +229,9 @@ void set_config_disable_external_tcxo(bool v);
|
||||
void set_config_sdcard_high_speed_io(bool v, bool save);
|
||||
void set_config_disable_config_mode(bool v);
|
||||
void set_beep_on_packets(bool v);
|
||||
void set_config_tx_disabled(bool v);
|
||||
void set_config_tx_amp_disabled(bool v);
|
||||
void set_config_tx_gain_max_db(int8_t v);
|
||||
void set_config_tx_gain_max_db(uint8_t v);
|
||||
|
||||
void set_config_splash(bool v);
|
||||
bool config_converter();
|
||||
|
||||
Reference in New Issue
Block a user