Fix introduced CPU consumption bug.

This commit is contained in:
Nick Foster 2013-06-05 17:50:10 -04:00
parent 79aee53a52
commit a847f5f875
3 changed files with 14 additions and 14 deletions

View File

@ -184,7 +184,7 @@ int air_modes_preamble::general_work(int noutput_items,
if(!valid_preamble) continue; if(!valid_preamble) continue;
//be sure we've got enough room in the input buffer to copy out a whole packet //be sure we've got enough room in the input buffer to copy out a whole packet
if(ninputs-i < d_check_width) { if(ninputs-i < 240*d_samples_per_chip) {
consume_each(std::max(i-1,0)); consume_each(std::max(i-1,0));
if(0) std::cout << "Preamble consumed " << std::max(i-1,0) << ", returned 0 (no room)" << std::endl; if(0) std::cout << "Preamble consumed " << std::max(i-1,0) << ", returned 0 (no room)" << std::endl;
return 0; return 0;

View File

@ -60,8 +60,8 @@ void air_modes_slicer::set_rate(int channel_rate)
d_chip_rate = 2000000; //2Mchips per second d_chip_rate = 2000000; //2Mchips per second
d_samples_per_chip = 2;//FIXME this is constant now channel_rate / d_chip_rate; d_samples_per_chip = 2;//FIXME this is constant now channel_rate / d_chip_rate;
d_samples_per_symbol = d_samples_per_chip * 2; d_samples_per_symbol = d_samples_per_chip * 2;
d_check_width = 240 * d_samples_per_symbol; //how far you will have to look ahead d_check_width = 120 * d_samples_per_symbol; //how far you will have to look ahead
set_output_multiple(d_check_width); //how do you specify buffer size for sinks? set_output_multiple(d_check_width*2); //how do you specify buffer size for sinks?
} }
//this slicer is courtesy of Lincoln Labs. supposedly it is more resistant to mode A/C FRUIT. //this slicer is courtesy of Lincoln Labs. supposedly it is more resistant to mode A/C FRUIT.

View File

@ -80,18 +80,18 @@ class modes_radio (gr.top_block, pubsub):
self.rx_path = air_modes.rx_path(rate, options.threshold, self._queue, options.pmf) self.rx_path = air_modes.rx_path(rate, options.threshold, self._queue, options.pmf)
#now subscribe to set various options via pubsub #now subscribe to set various options via pubsub
self.subscribe("FREQ", self.set_freq) #self.subscribe("freq", self.set_freq)
self.subscribe("GAIN", self.set_gain) #self.subscribe("gain", self.set_gain)
self.subscribe("RATE", self.set_rate) #self.subscribe("rate", self.set_rate)
self.subscribe("RATE", self.rx_path.set_rate) #self.subscribe("rate", self.rx_path.set_rate)
self.subscribe("THRESHOLD", self.rx_path.set_threshold) #self.subscribe("threshold", self.rx_path.set_threshold)
self.subscribe("PMF", self.rx_path.set_pmf) #self.subscribe("pmf", self.rx_path.set_pmf)
self.publish("FREQ", self.get_freq) #self.publish("freq", self.get_freq)
self.publish("GAIN", self.get_gain) #self.publish("gain", self.get_gain)
self.publish("RATE", self.get_rate) #self.publish("rate", self.get_rate)
self.publish("THRESHOLD", self.rx_path.get_threshold) #self.publish("threshold", self.rx_path.get_threshold)
self.publish("PMF", self.rx_path.get_pmf) #self.publish("pmf", self.rx_path.get_pmf)
if use_resampler: if use_resampler:
self.lpfiltcoeffs = gr.firdes.low_pass(1, 5*3.2e6, 1.6e6, 300e3) self.lpfiltcoeffs = gr.firdes.low_pass(1, 5*3.2e6, 1.6e6, 300e3)