signal_generator: also reject negative frequencies
This commit is contained in:
parent
f4fd752d54
commit
4f04bf17a8
|
@ -77,7 +77,7 @@ impl TryFrom<BasicConfig> for Config {
|
|||
|
||||
// Validate base frequency tuning word to be below Nyquist.
|
||||
const NYQUIST: f32 = (1u32 << 31) as _;
|
||||
if 2.0 * ftw > NYQUIST {
|
||||
if ftw < 0.0 || 2.0 * ftw > NYQUIST {
|
||||
return Err(Error::InvalidFrequency);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue