mirror of
https://github.com/eried/portapack-mayhem.git
synced 2024-12-23 14:29:23 -05:00
Added rssi get_delta, better rssi min graph view
This commit is contained in:
parent
a7acb37a56
commit
f42812c6b4
@ -36,10 +36,11 @@ namespace ui {
|
||||
const auto r = screen_rect();
|
||||
|
||||
constexpr int rssi_sample_range = 256;
|
||||
constexpr float rssi_voltage_min = 0.4;
|
||||
//constexpr float rssi_voltage_min = 0.4;
|
||||
constexpr float rssi_voltage_max = 2.2;
|
||||
constexpr float adc_voltage_max = 3.3;
|
||||
constexpr int raw_min = rssi_sample_range * rssi_voltage_min / adc_voltage_max;
|
||||
//constexpr int raw_min = rssi_sample_range * rssi_voltage_min / adc_voltage_max;
|
||||
constexpr int raw_min = 0 ;
|
||||
constexpr int raw_max = rssi_sample_range * rssi_voltage_max / adc_voltage_max;
|
||||
constexpr int raw_delta = raw_max - raw_min;
|
||||
|
||||
@ -178,6 +179,12 @@ namespace ui {
|
||||
return max_ ;
|
||||
}
|
||||
|
||||
int32_t RSSI::get_delta()
|
||||
{
|
||||
return max_ - min_ ;
|
||||
}
|
||||
|
||||
|
||||
void RSSI::set_pitch_rssi(bool enabled) {
|
||||
pitch_rssi_enabled = enabled;
|
||||
if (!enabled) baseband::set_pitch_rssi(0, false);
|
||||
@ -272,7 +279,7 @@ namespace ui {
|
||||
painter.draw_vline(
|
||||
p4,
|
||||
width_y,
|
||||
Color::green());
|
||||
Color::green() );
|
||||
}
|
||||
}
|
||||
|
||||
@ -281,10 +288,11 @@ namespace ui {
|
||||
const auto r = screen_rect();
|
||||
|
||||
constexpr int rssi_sample_range = 256;
|
||||
constexpr float rssi_voltage_min = 0.4;
|
||||
//constexpr float rssi_voltage_min = 0.4;
|
||||
constexpr float rssi_voltage_max = 2.2;
|
||||
constexpr float adc_voltage_max = 3.3;
|
||||
constexpr int raw_min = rssi_sample_range * rssi_voltage_min / adc_voltage_max;
|
||||
//constexpr int raw_min = rssi_sample_range * rssi_voltage_min / adc_voltage_max;
|
||||
constexpr int raw_min = 0 ;
|
||||
constexpr int raw_max = rssi_sample_range * rssi_voltage_max / adc_voltage_max;
|
||||
constexpr int raw_delta = raw_max - raw_min;
|
||||
|
||||
@ -308,4 +316,5 @@ namespace ui {
|
||||
}
|
||||
set_dirty();
|
||||
}
|
||||
|
||||
} /* namespace ui */
|
||||
|
@ -49,6 +49,7 @@ public:
|
||||
int32_t get_min();
|
||||
int32_t get_avg();
|
||||
int32_t get_max();
|
||||
int32_t get_delta();
|
||||
void set_vertical_rssi(bool enabled);
|
||||
void set_peak(bool enabled, size_t duration);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user