discuss-gnuradio
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Discuss-gnuradio] gri_control_loop::set_frequency() Possible Error?


From: Frederick Lee
Subject: [Discuss-gnuradio] gri_control_loop::set_frequency() Possible Error?
Date: Thu, 16 Aug 2012 16:11:22 -0700

Hi,

I was looking at the gri_control_loop.cc file and notices the set_frequency() function seemed a little odd. Here's what it looked like.

void
gri_control_loop::set_frequency(float freq)
{
  if(freq > d_max_freq)
    d_freq = d_min_freq;
  else if(freq < d_min_freq)
    d_freq = d_max_freq;
  else
    d_freq = freq;
}

This doesn't seem logical to me. Shouldn't the it be "d_freq = d_max_freq" in the if statement and "d_freq = d_min_freq" in the else if statement?
The frequency_limit() function has it the way I stated

void
gri_control_loop::frequency_limit()
{
  if (d_freq > d_max_freq)
    d_freq = d_max_freq;
  else if (d_freq < d_min_freq)
    d_freq = d_min_freq;
}

Regards,

Frederick

reply via email to

[Prev in Thread] Current Thread [Next in Thread]