Draft
Conversation
9b27e37 to
40b52af
Compare
8f63bbb to
af22ea6
Compare
This was referenced Feb 6, 2026
1a1911b to
13a82d5
Compare
2f96cc9 to
fd50120
Compare
We've been using `gpio_t` as both the name of a `struct`, and a `typedef` for a pointer to that `struct`. In C that's possible because `struct gpio_t` names a different type from `gpio_t` , but it's confusing, and causes problems when trying to include the types elsewhere.
…ed firmware on HackRF One
fd50120 to
8aba74e
Compare
This was referenced Apr 2, 2026
Closed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR introduces a new
BOARDtarget calledUNIVERSALthat can be used to compile a combined firmware that supports both HackRF One and HackRF Pro hardware.Conventions
It introduces a new pattern to the code base for working with board support.
Previously, we used a mix of patterns of the form
#ifdef HACKRF_ONEor#ifndef PRALINEin conjunction withplatform_detect.detected_platform()to manage board differences.This PR applies the following new patterns across the codebase:
if (detected_platform() == BOARD_ID_x)orswitch (detected_platform())#ifdef SOME_BOARDbecome#if defined(SOME_BOARD)or#ifndef SOME_BOARDbecomes#if !defined(SOME_BOARD). This keeps usage consistent with the next point.HACKRF_ONEandPRALINEalways include theUNIVERSALtarget to ensure the code will be present in the combined firmware binary. For example:#if defined(PRALINE) || defined(UNIVERSAL)#else, this caught me a few times:Compilation
Size impact
Single-board firmware are slightly bigger as a result:
The size increase is mostly due to:
platform_scu: 968 bytesplatform_gpio: 1044 bytes…with the remaining being due to runtime platform detection across the rest of the code-base.
The combined firmware comes to
258376bytes.Testing
This PR has been tested with both single-board and combined firmware using
hackrf.git/ci-scripts/hackrf-test.pyandpraline-factory-test.git/bin/hackrf_test.pyin the following configurations:EUT: Hackrf One r4,TESTER: HackRF One r10c Portapack H4M clone from SDRStoreEUT: Hackrf Pro, TESTER:HackRF One r4Future Work
Now that conditional compilation directives are no longer used to control code execution we have the opportunity to consider whether we should follow the example of
firmware/common/rad1o/and addfirmware/common/hackrf_one/andfirmware/common/praline/directories.rf_path.cmax2831support tomax283xplatform_gpio.cplatform_scu.cplatform_detect.c#ifdefsPRALINEbinary booting onHACKRF_ONE#includeshackrf_info