Revert "Updated with some of the changes I made on travel. Will probably break everything..."
This reverts commit 86ae1ddb2f.
This commit is contained in:
+17
-17
@@ -214,12 +214,12 @@ void UBitxDSP::txUSBIn() {
|
||||
/**********************************************************************/
|
||||
// RX filter settings
|
||||
|
||||
const float minRxFilterLo = MIN_RX_FILTER_LO;
|
||||
const float maxRxFilterHi = MAX_RX_FILTER_HI;
|
||||
const float minRxFilterWidth = MIN_RX_FILTER_WIDTH;
|
||||
const float maxRxFilterWidth = MAX_RX_FILTER_WIDTH;
|
||||
const float minRxFilterCenter = MIN_RX_FILTER_CENTER;
|
||||
const float maxRxFilterCenter = MAX_RX_FILTER_CENTER;
|
||||
const int minRxFilterLo = MIN_RX_FILTER_LO;
|
||||
const int maxRxFilterHi = MAX_RX_FILTER_HI;
|
||||
const int minRxFilterWidth = MIN_RX_FILTER_WIDTH;
|
||||
const int maxRxFilterWidth = MAX_RX_FILTER_WIDTH;
|
||||
const int minRxFilterCenter = MIN_RX_FILTER_CENTER;
|
||||
const int maxRxFilterCenter = MAX_RX_FILTER_CENTER;
|
||||
|
||||
/*!
|
||||
* @brief Bypass the RX audio filter.
|
||||
@@ -238,7 +238,7 @@ void UBitxDSP::updateRxFilter() {
|
||||
rxFilter.begin(coefficients, NUM_COEFFICIENTS);
|
||||
}
|
||||
|
||||
void UBitxDSP::setRxFilter(float lo, float hi) {
|
||||
void UBitxDSP::setRxFilter(int lo, int hi) {
|
||||
if (hi < lo + minRxFilterWidth) {
|
||||
hi = lo + minRxFilterWidth;
|
||||
}
|
||||
@@ -256,7 +256,7 @@ void UBitxDSP::setRxFilter(float lo, float hi) {
|
||||
updateRxFilter();
|
||||
}
|
||||
|
||||
void UBitxDSP::setRxFilterLo(float lo) {
|
||||
void UBitxDSP::setRxFilterLo(int lo) {
|
||||
if (lo > state.rxFilterHi - minRxFilterWidth) {
|
||||
lo = state.rxFilterHi - minRxFilterWidth;
|
||||
}
|
||||
@@ -267,7 +267,7 @@ void UBitxDSP::setRxFilterLo(float lo) {
|
||||
updateRxFilter();
|
||||
}
|
||||
|
||||
void UBitxDSP::setRxFilterHi(float hi) {
|
||||
void UBitxDSP::setRxFilterHi(int hi) {
|
||||
if (hi < state.rxFilterLo + minRxFilterWidth) {
|
||||
hi = state.rxFilterLo + minRxFilterWidth;
|
||||
}
|
||||
@@ -278,27 +278,27 @@ void UBitxDSP::setRxFilterHi(float hi) {
|
||||
updateRxFilter();
|
||||
}
|
||||
|
||||
void UBitxDSP::setRxFilterWidth(float width) {
|
||||
void UBitxDSP::setRxFilterWidth(int width) {
|
||||
if (width < minRxFilterWidth) {
|
||||
width = minRxFilterWidth;
|
||||
} else if (width > maxRxFilterWidth) {
|
||||
width = maxRxFilterWidth;
|
||||
}
|
||||
float center = (state.rxFilterHi + state.rxFilterLo) / 2;
|
||||
float lo = center - (width / 2);
|
||||
float hi = center + (width / 2);
|
||||
int center = (state.rxFilterHi + state.rxFilterLo) / 2;
|
||||
int lo = center - (width / 2);
|
||||
int hi = center + (width / 2);
|
||||
setRxFilter(lo, hi);
|
||||
}
|
||||
|
||||
void UBitxDSP::setRxFilterCenter(float center) {
|
||||
void UBitxDSP::setRxFilterCenter(int center) {
|
||||
if (center < minRxFilterCenter) {
|
||||
center = minRxFilterCenter;
|
||||
} else if (center > maxRxFilterCenter) {
|
||||
center = maxRxFilterCenter;
|
||||
}
|
||||
float width = state.rxFilterHi - state.rxFilterLo;
|
||||
float lo = center - (width / 2);
|
||||
float hi = center + (width / 2);
|
||||
int width = state.rxFilterHi - state.rxFilterLo;
|
||||
int lo = center - (width / 2);
|
||||
int hi = center + (width / 2);
|
||||
setRxFilter(lo, hi);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user