2581 Commits

Author SHA1 Message Date
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
Martin Ling
7d6a524795 Add clang-format configuration and reformat script. 2022-08-03 23:43:08 +01:00
Martin Ling
ebb9e43fde Move some trailing comments on long lines. 2022-08-03 23:42:55 +01:00
Martin Ling
b50aeb4082 fixup clang-format off 2022-08-03 23:34:28 +01:00
Martin Ling
8b157cfdbc Split up two groups of defines. 2022-08-03 23:28:23 +01:00
Martin Ling
dbcc46d221 Mark code sections to be left alone by clang-format. 2022-08-03 23:03:15 +01:00
Martin Ling
b4c828915a Use an empty block for empty while loops. 2022-08-03 23:03:15 +01:00
Martin Ling
414b4a98da hackrf_transfer: Split a long line in usage(). 2022-08-03 23:03:15 +01:00
Martin Ling
7f5ae870ec hackrf_transfer: Clean up WAV headers. 2022-08-03 23:03:15 +01:00
Martin Ling
6cd9ca9483 sgpio: Clean up comments. 2022-08-03 23:03:15 +01:00
Martin Ling
51b76d33a6 sgpio: Remove a redundant variable. 2022-08-03 23:03:15 +01:00
Martin Ling
efd5603c80 Reformat sct.h to avoid long lines. 2022-08-03 23:03:15 +01:00
Martin Ling
445253be1e usb_descriptor: Realign descriptor comments. 2022-08-03 23:03:15 +01:00
Martin Ling
a66492b8b7 rom_iap: Clean up comments and realign with spaces. 2022-08-03 23:03:15 +01:00
Martin Ling
1acc71bebf rf_path: Realign scu_pinmux calls. 2022-08-03 23:03:15 +01:00
Martin Ling
6b5193198b Realign GPIO assignments with spaces rather than tabs. 2022-08-03 23:03:15 +01:00
Michael Ossmann
e4af1a6808 Merge pull request #1116 from gitcolt/amplitude-report
Fix #902 - Report transmit amplitude
2022-08-02 20:22:47 -04:00
Michael Ossmann
81b0cd34e7 Merge pull request #1125 from martinling/simplify-rx-loop
Simplify RX and TX loops
2022-08-02 20:07:17 -04:00
colt
b5057b87e8 Report an amplitude of value -INFINITY as is instead of showing it as
-0.0 dBfs
2022-08-02 18:44:28 -05:00
Michael Ossmann
0c563c4f5c Merge pull request #1071 from martinling/concurrency-cleanup
Simplify logic for tracking finished transfers
2022-08-01 18:41:51 -04:00
Martin Ling
3418f6e249 Use a #define for USB transfer size. 2022-07-25 10:54:07 +01:00
Martin Ling
a943610cd4 Simpify TX loop in the same way as RX loop. 2022-07-25 10:44:15 +01:00
Martin Ling
0175c2e84e Simplify rx_mode loop and prevent it stalling.
On rad1o, the UI update could block this loop from running for long
enough that it could stall in a state where neither of the conditions
was met.

Fix this by removing the 'phase' variable, in favour of a counter
tracking the number of bytes that have been scheduled for USB transfer.
Whenever there are enough bytes to schedule the next transfer, do so.

Meanwhile, the M0 count is prevented from wrapping around and clobbering
data not yet sent, because the M0 code monitors the m4_count variable
which is updated as each transfer completes.
2022-07-25 10:35:05 +01:00
james-pcdf
1ed2d3bb14 Gain controls: bulleted list (#1113) 2022-07-21 12:58:27 -04:00
Michael Ossmann
74c3600200 Merge pull request #1119 from grvvy/ci_device_port_change
ci: update target device's changed port number
2022-07-18 12:57:36 -04:00
grvvy
53e076e997 ci: update target device's changed port number 2022-07-13 14:42:21 -06:00
colt
b47a808eaa Do dB ratio check BEFORE it's used 2022-07-11 13:25:14 -05:00
colt
151b431c64 Fix #902 - Report transmit amplitude 2022-07-06 22:34:26 -05:00
Martin Ling
0724bd36eb Lock the whole code block that touches active transfer count.
I believe this was safe before, because this code is only called from
the transfer thread, and the condition being protected is just whether
the count is zero, not the actual value of the count.

However, this isn't performance critical and it's a lot easier to
reason about the code if we just hold the lock for this whole section.
2022-07-04 18:00:07 +01:00
Martin Ling
743b2c76e2 Replace per-transfer flags with a count of active transfers.
This simplifies the code required to wait for cancellations to complete.
The condition variable now reflects whether `active_transfers == 0`, and
the associated lock must be held to decrement that count to zero.
2022-06-15 00:48:47 +01:00
Michael Ossmann
34cbbe7330 Merge pull request #1070 from martinling/cleanup-stop
Remove unnecessary delays on stop, and duplicated stop commands on close.
2022-06-14 10:47:45 -04:00
Michael Ossmann
a41c8078a0 Merge pull request #1069 from martinling/error-handling
Overhaul handling of transfer errors and use of streaming flag.
2022-06-14 10:42:19 -04:00
Martin Ling
bc0fbc3184 Merge pull request #1072 from martinling/fix-stack-variables
Fix USB requests that were responding with data from the stack.
2022-06-13 23:03:20 +01:00
Michael Ossmann
61c7cdee80 Merge pull request #1106 from martinling/pll-startup
Implement NXP's recommended setup sequence for the PLL and M4 clock
2022-06-13 16:32:29 -04:00
Martin Ling
405515d5b4 Implement NXP's recommended setup sequence for the PLL and M4 clock.
This follows the sequence described in:

UM10503 Rev 2.4 (Aug 2018), section 13.2.1.1, page 167
2022-06-13 16:49:45 +01:00
Martin Ling
273e6a1217 Add an accurate delay loop.
The existing 'delay' function is not calibrated to any specific measure
of time. Add a new function using a loop with a known cycle count, to
produce delays of a given duration at a given CPU clock speed.
2022-06-13 16:32:55 +01:00
Jacob Graves
fa0662e54c Jenkins CI (#1102)
* jenkins: initial commit

* jenkins: add missing usb hub check script

* jenkins: squish docker apt package install commands into a single command

* jenkins: fix type in Dockerfile

* jenkins: override interactive installations in Dockerfile (build-essentials fails due to tzdata)

* jenkins: set executable flag on ci scripts

* jenkins: remove sudo prefix from install scripts

* jenkins: add python3 venv to Dockerfile and build scripts

* jenkins: add missing python venv command to host install script

* jenkins: remove python install and venv redundancies

* jenkins: remove make install step, run hackrf tools directly from their build directory

* jenkins: re-add python3 and pip installations to docker because usbhub depends on them

* jenkins: add missing git install to docker

* jenkins: add python-is-python3 to docker's installed dependencies

* jenkins: use path string to specify the correct device for dfu-util

* jenkins: specify usbhub id for dual hub setup

* jenkins: turn unused usb hub ports off for testing

* jenkins: remove custom job throttle property

* use --disable-i2c usbhub option, install usbhub from latest, replace --privileged with cgroups option, remove redundancies from Dockerfile

* update device usb path for dfu-util

* remove apt/lists/* and fix typos

* ci: remove redundant environment setup in Jenkins
2022-06-08 13:26:28 -04:00
Michael Ossmann
dfadf6a31c Merge pull request #1090 from veloman-yunkan/sweep_mode_bugfix
Bugfix in sweep mode when multiple blocks have to be read for each frequency
2022-05-30 12:15:54 -04:00
yhetti
8feda0946b Documentation: Add RF shield installation instructions to docs (#1074)
* Documentation: Add RF shield installation instructions page.

Add a page with written instructions for installing a RF shield on a HackRF One. Includes pictures of various steps in the process

* Documentation: Add rf_shield_installation.rst that was left out of previous commit.

* Documentation: Move tag in multiple_device_hardware_synch.rst to correct location.

* Documentation: Add edits suggested by straithe to rf_shield instructions
2022-04-29 15:06:35 -04:00
Straithe
db39147e04 fix RTD to compile (#1095) 2022-04-28 20:23:37 -04:00
Straithe
555b90e061 change to get RTD working (#1094) 2022-04-28 20:14:19 -04:00
Veloman Yunkan
3157111d08 Bugfix in retuning rate
In sweep mode, frequency switching (retuning) must occur only
AFTER the requested number of samples has been received.
2022-04-13 18:36:12 +04:00
Radoslav Gerganov
6738085f59 Add project mention for the Tesla charging port opener (#1082)
Static web page which uses WebUSB and HackRF to transimt a signal which
opens the Tesla charging port
2022-04-05 19:34:31 -04:00
Michael Ossmann
cc5d0a429e Merge pull request #1081 from martinling/clear-feature
Implement USB CLEAR_FEATURE request for ENDPOINT_HALT
2022-04-04 11:53:50 -04:00
Martin Ling
7d93f40f6f Merge pull request #1080 from metayan/fix-longprint
Avoid warnings by using PRIu64
2022-04-04 12:11:26 +01:00
Martin Ling
077095451a Schedule ACK after CLEAR_FEATURE / ENDPOINT_HALT request. 2022-03-30 00:34:32 +01:00
Martin Ling
2fba08cf42 Reset endpoint specified in request, not the one it arrived on. 2022-03-29 23:40:08 +01:00
Martin Ling
84898a0bcb Implement USB CLEAR_FEATURE request for ENDPOINT_HALT.
From USB 2.0, section 9.4.5:

"For endpoints using data toggle, regardless of whether an endpoint has
the Halt feature set, a ClearFeature(ENDPOINT_HALT) request always
results in the data toggle being reinitialized to DATA0."
2022-03-29 14:11:00 +01:00