mirror of
https://github.com/eried/portapack-mayhem.git
synced 2025-05-09 10:15:18 -04:00
Added PWM RSSI output for NBFM and WFM
This commit is contained in:
parent
1beac3bdbd
commit
1d697d2201
22 changed files with 274 additions and 118 deletions
|
@ -21,6 +21,7 @@
|
|||
|
||||
#include "ui_rssi.hpp"
|
||||
|
||||
#include "baseband_api.hpp"
|
||||
#include "utility.hpp"
|
||||
|
||||
#include <algorithm>
|
||||
|
@ -88,6 +89,17 @@ void RSSI::paint(Painter& painter) {
|
|||
r4,
|
||||
Color::black()
|
||||
);
|
||||
|
||||
if (pwmrssi_enabled) {
|
||||
const range_t<int> pwmrssi_avg_range { 0, 96 };
|
||||
const auto pwmrssi_avg = pwmrssi_avg_range.clip((avg_ - raw_min) * 96 / raw_delta);
|
||||
baseband::set_pwmrssi(pwmrssi_avg, true);
|
||||
}
|
||||
}
|
||||
|
||||
void RSSI::set_pwmrssi(bool enabled) {
|
||||
pwmrssi_enabled = enabled;
|
||||
if (!enabled) baseband::set_pwmrssi(0, false);
|
||||
}
|
||||
|
||||
void RSSI::on_statistics_update(const RSSIStatistics& statistics) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue