Skip to content

Commit

Permalink
blocks/sources/hackrf: add warning on using sample rate below 8 MHz
Browse files Browse the repository at this point in the history
  • Loading branch information
vsergeev committed Aug 31, 2016
1 parent 35ae6e1 commit d879b9d
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions radio/blocks/sources/hackrf.lua
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,12 @@ function HackRFSource:initialize_hackrf()
debug.printf("[HackRFSource] Board ID: %s\n", board_id)
end

-- Check sample rate
if self.rate < 8e6 then
io.stderr:write(string.format("[HackRFSource] Warning: low sample rate (%u Hz).\n", self.rate))
io.stderr:write("[HackRFSource] Using a sample rate under 8 MHz is not recommended!\n")
end

-- Set sample rate
ret = libhackrf.hackrf_set_sample_rate(self.dev[0], self.rate)
if ret ~= 0 then
Expand Down

0 comments on commit d879b9d

Please sign in to comment.