2729 Commits

Author SHA1 Message Date
Michael Ossmann
9329c5e44e Detect hardware platform at run-time.
Firmware now detects the hardware it is running on at startup and
refuses to run if it is compiled for the wrong platform. The board ID
returned by firmware to the host is now derived from run-time detection
rather than a compile-time value. A separate method to retrieve
compile-time supported platform is added.

On HackRF One, pin straps are checked to determine hardware revision.
This is informational to aid troubleshooting and does not affect any
function.
2022-09-14 07:08:47 -04:00
Michael Ossmann
fdfe310f9a Merge pull request #1139 from martinling/tx-flush
Support flushing the device TX buffer before ending transmission
2022-09-14 05:45:40 -04:00
Martin Ling
7650236839 Flush buffer when CW mode is used with -n. 2022-09-12 16:50:53 +01:00
Martin Ling
0142ae6da9 Don't await buffer flush if interrupted by Ctrl-C. 2022-09-12 16:32:11 +01:00
Michael Ossmann
2104291594 firmware: use consistent clock source
CLKOUT now switches to the active clock source whenever the internal
clocks change source. It previously did so only when (re)enabled.
2022-09-10 06:54:51 -04:00
Michael Ossmann
57d51fd042 Merge pull request #1153 from greatscottgadgets/measure-power
Measure digital signal power, not amplitude in hackrf_transfer
2022-09-09 20:11:08 -04:00
Michael Ossmann
8a9af7a1ad hackrf_transfer: report on only actual transfers
The statistics reported to the user now reflect only completed USB
transfers and do not include information about the empty buffers that
are preloaded with data at the start of a TX operation.
2022-09-09 16:32:07 -04:00
Michael Ossmann
70a04855ac libhackrf: add transfer buffer size access calls
Applications may need to learn the size of the USB transfer buffer
queue, for example to determine how many bytes will be preloaded with
calls to the TX callback.
2022-09-09 16:16:24 -04:00
Michael Ossmann
c1e65778bc Merge pull request #1149 from grvvy/operacake_time_mode_fix
operacake: disable the usage of time mode when a portapack is installed
2022-09-09 12:46:45 -04:00
Michael Ossmann
e7b19ef2c2 hackrf_transfer: accept CW amplitude up to 128 2022-09-09 05:17:28 -04:00
Michael Ossmann
755ca960e5 hackrf_transfer: report power, not amplitude
improve accuracy and reliability of digital signal power measurement
2022-09-09 05:15:15 -04:00
Michael Ossmann
5b4be3e078 Merge pull request #1138 from martinling/preload-tx-transfers
Preload TX transfers
2022-09-05 11:41:05 -04:00
Michael Ossmann
ad5398d92c Merge pull request #1132 from martinling/hackrf-transfer-short-files
Support repeating short files in `hackrf_transfer`
2022-09-05 10:37:29 -04:00
grvvy
5d7b203058 operacake: disable the usage of time mode when a portapack is installed 2022-09-01 14:03:18 -06:00
Straithe
e41b4c5116 change checkboxes to text area for OS technical support question (#1148) 2022-08-28 19:55:50 -04:00
Straithe
0a85acf27a Add quotes to yes and no (#1147) 2022-08-28 19:18:44 -04:00
Straithe
783899b06f address hash issues in technical support issue template (#1146) 2022-08-28 19:06:46 -04:00
Straithe
e0b6978634 fix technical support template (#1145) 2022-08-28 18:47:13 -04:00
Straithe
e5e1507b4f remove yaml errors (#1144) 2022-08-28 18:29:48 -04:00
Straithe
a2ff44f0fd converted issue templates to .yml instead of .md (#1143) 2022-08-28 18:07:52 -04:00
Straithe
6e38a68234 Add issue templates (#1122)
* Add issue templates

* Update templates based on feedback

* Update feature request issue template

* update templates based on suggestions
2022-08-28 17:45:09 -04:00
Martin Ling
8f60e6b66f Wait for TX buffer flush at end of hackrf_transfer. 2022-08-24 23:48:24 +01:00
Martin Ling
d556f0abab Add API to support flushing the device buffer when TX finishes. 2022-08-24 23:48:22 +01:00
Martin Ling
9d2e163a2d Call TX callback to fill transfers before initial submission. 2022-08-23 13:21:43 +01:00
Martin Ling
8bd8dedddc Use an early return to reduce indentation in prepare_transfers. 2022-08-23 13:03:53 +01:00
Martin Ling
5881b3b6a1 Add defines for TX and RX endpoint addresses. 2022-08-23 12:24:00 +01:00
Martin Ling
9b6a0259a7 Remove message when rewinding input file.
For small input files this may be printed a very large number of times.
2022-08-23 09:30:04 +01:00
Martin Ling
0c35cff05b In repeat mode, rewind file as many times as needed to fill buffer.
Fixes #720.
2022-08-23 09:30:04 +01:00
Martin Ling
06a0c2b189 One more early return to simplify TX callback. 2022-08-23 09:30:02 +01:00
Martin Ling
85a86b8baa Use more early returns to further simplify callbacks. 2022-08-23 09:29:13 +01:00
Martin Ling
bcaebc00c3 Use some early returns to reduce deeply indented callbacks. 2022-08-23 09:26:00 +01:00
Martin Ling
344af5094b Merge pull request #1131 from martinling/hackrf-transfer-validation
Additional argument validation for hackrf_transfer
2022-08-23 08:57:17 +01:00
Michael Ossmann
c703a72ac0 add parentheses to avoid compiler warning
avoids a warning from -Wparentheses
2022-08-23 08:44:29 +01:00
Michael Ossmann
04cb3a4084 Merge pull request #1133 from martinling/hackrf-transfer-timing
Overhaul timing in hackrf_transfer
2022-08-22 18:37:34 -04:00
Michael Ossmann
00f79572c1 Merge pull request #1135 from martinling/clkin-detect
Add a simpler way to check CLKIN status.
2022-08-22 15:17:13 -04:00
Martin Ling
a09e9a20ed Overhaul timing in hackrf_transfer.
Rather than using sleep() for 1s at a time, set up an interval timer
that will fire once per second, and wait in the main loop for either
this or some other event.

On POSIX, the timing is set up with setitimer(), which generates a
SIGALRM signal each time the timer fires. The main loop runs pause() to
wait for any signal.

On Windows, the timing is set up using CreateWaitableTimer, which
provides an event handle that is set each time the timer fires. The main
loop runs WaitForMultipleObjects() to wait on this and an interrupt
event.

The TX and RX callbacks can now stop the main loop immediately when they
stop streaming. This fixes #1019.
2022-08-17 13:05:03 +01:00
Martin Ling
eeaaaf3b9b Make use of Win32 functions conditional on _WIN32, not _MSC_VER.
Using _MSC_VER here means that the choice of signal() versus
SetConsoleCtrlHandler depends on the compiler being used, rather
than the OS being targeted. When built with MinGW rather than MSVC,
this happens to work because MinGW's signal emulation is used, but
that emulation is quite limited.

Instead, be consistent and use the Win32 API when building for that
platform, regardless of compiler.

Note that if building for Cygwin, _WIN32 is not defined and POSIX
APIs are used.
2022-08-17 12:54:22 +01:00
Martin Ling
e88a0387cb Extend force option to frequency ranges outside 1MHz-6GHz. 2022-08-15 21:47:49 +01:00
Martin Ling
2e1f55c2d5 Add hackrf_transfer -F option to force unsupported sample rates. 2022-08-15 21:47:49 +01:00
Martin Ling
8c12fa6007 Validate sample rates passed to hackrf_transfer. 2022-08-15 21:47:42 +01:00
Martin Ling
2fe3185f9d Use an array of buffers for u64->ASCII conversions. 2022-08-15 21:46:36 +01:00
Michael Ossmann
26077ac85e Merge pull request #1112 from martinling/code-style
Standardise and enforce code style
2022-08-15 16:17:04 -04:00
Martin Ling
ba148ee047 Add a simpler way to check CLKIN status. 2022-08-05 09:37:38 +01:00
Martin Ling
01e0702013 Print hackrf_sweep usage with a single fprintf call. 2022-08-03 23:46:46 +01:00
Martin Ling
e8e6784881 Add spacing lines between declarations in hackrf.h. 2022-08-03 23:46:46 +01:00
Martin Ling
c0d13de598 Add braces to all control statements without them. 2022-08-03 23:46:46 +01:00
Martin Ling
0de4c7ad23 Add helper script to add missing braces using clang-tidy. 2022-08-03 23:46:46 +01:00
Martin Ling
55bea828ea Add missing stdbool.h include to rom_iap.h.
Fixes a clang-tidy error.
2022-08-03 23:46:46 +01:00
Martin Ling
44ebd5a6ff Add clang-format check to Github actions. 2022-08-03 23:46:46 +01:00
Martin Ling
c3fdf402d7 Reformat all code to new clang-format standard. 2022-08-03 23:46:44 +01:00