Fix frequency related data types for >2Ghz

This commit is contained in:
Charles J. Cliffe
2015-01-04 17:11:20 -05:00
parent 44bee1f553
commit 9f945026b8
29 changed files with 393 additions and 144 deletions
+2 -2
View File
@@ -132,7 +132,7 @@ void SDRPostThread::threadMain() {
DemodulatorInstance *demod = *i;
if (demod->getParams().frequency != data_in->frequency
&& abs(data_in->frequency - demod->getParams().frequency) > (int) ((double) ((double) SRATE / 2.0))) {
&& abs(data_in->frequency - demod->getParams().frequency) > (SRATE / 2)) {
continue;
}
activeDemods++;
@@ -166,7 +166,7 @@ void SDRPostThread::threadMain() {
DemodulatorThreadInputQueue *demodQueue = demod->threadQueueDemod;
if (demod->getParams().frequency != data_in->frequency
&& abs(data_in->frequency - demod->getParams().frequency) > (int) ((double) ((double) SRATE / 2.0))) {
&& abs(data_in->frequency - demod->getParams().frequency) > (SRATE / 2)) {
if (demod->isActive()) {
demod->setActive(false);
DemodulatorThreadIQData *dummyDataOut = new DemodulatorThreadIQData;
+3 -3
View File
@@ -110,7 +110,7 @@ void SDRThread::threadMain() {
signed char buf[BUF_SIZE];
unsigned int frequency = DEFAULT_FREQ;
long long frequency = DEFAULT_FREQ;
unsigned int bandwidth = SRATE;
rtlsdr_open(&dev, firstDevAvailable);
@@ -137,7 +137,7 @@ void SDRThread::threadMain() {
if (!cmdQueue->empty()) {
bool freq_changed = false;
float new_freq;
long long new_freq;
while (!cmdQueue->empty()) {
SDRThreadCommand command;
@@ -146,7 +146,7 @@ void SDRThread::threadMain() {
switch (command.cmd) {
case SDRThreadCommand::SDR_THREAD_CMD_TUNE:
freq_changed = true;
new_freq = command.int_value;
new_freq = command.llong_value;
if (new_freq < SRATE / 2) {
new_freq = SRATE / 2;
}
+5 -5
View File
@@ -21,22 +21,22 @@ public:
};
SDRThreadCommand() :
cmd(SDR_THREAD_CMD_NULL), int_value(0) {
cmd(SDR_THREAD_CMD_NULL), llong_value(0) {
}
SDRThreadCommand(SDRThreadCommandEnum cmd) :
cmd(cmd), int_value(0) {
cmd(cmd), llong_value(0) {
}
SDRThreadCommandEnum cmd;
int int_value;
long long llong_value;
};
class SDRThreadIQData: public ReferenceCounter {
public:
unsigned int frequency;
long long frequency;
unsigned int bandwidth;
std::vector<signed char> data;
@@ -45,7 +45,7 @@ public:
}
SDRThreadIQData(unsigned int bandwidth, unsigned int frequency, std::vector<signed char> *data) :
SDRThreadIQData(unsigned int bandwidth, long long frequency, std::vector<signed char> *data) :
frequency(frequency), bandwidth(bandwidth) {
}