mirror of
https://github.com/g4klx/MMDVMHost
synced 2025-12-22 08:05:49 +08:00
Clean up the D-Star Control class a little.
This commit is contained in:
16
SMeter.cpp
16
SMeter.cpp
@@ -19,21 +19,19 @@
|
||||
|
||||
#include "SMeter.h"
|
||||
|
||||
#define RSSI_S1 141U
|
||||
#define RSSI_S9 93U
|
||||
const unsigned int RSSI_S1 = 141U;
|
||||
const unsigned int RSSI_S9 = 93U;
|
||||
|
||||
void CSMeter::getSignal(unsigned int rssi, unsigned int & signal, unsigned int & plus)
|
||||
void CSMeter::getSignal(unsigned int rssi, unsigned int& signal, unsigned int& plus)
|
||||
{
|
||||
if (rssi > RSSI_S1) {
|
||||
signal = 0;
|
||||
signal = 0U;
|
||||
plus = rssi - RSSI_S1;
|
||||
}
|
||||
else if (rssi > RSSI_S9 && rssi <= RSSI_S1) {
|
||||
} else if (rssi > RSSI_S9 && rssi <= RSSI_S1) {
|
||||
signal = ((RSSI_S1 - rssi) / 6U) + 1U;
|
||||
plus = (RSSI_S1 - rssi) % 6U;
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
signal = 9U;
|
||||
plus = RSSI_S9 - rssi;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user