Skip to content

Conversation

user890104
Copy link
Contributor

What's new

In order to fit large protocol decoders/encoders, some of the others need to be disabled in order to meet the flash size limit. But some of the code relied on them always enabled.

This patch fixes it by including the relevant headers instead of assuming that all SubGHz protocols are enabled at all time.

Tested building with all protocols disabled, SubGHz Read and Read raw crash because of furi_check(). By enabling just raw and bin_raw, both options work again.

No functional change is expected by this commit.


For the reviewer

  • I've uploaded the firmware with this patch to a device and verified its functionality
  • I've confirmed the bug to be fixed / feature to be stable

In order to fit large protocol decoders/encoders, some of the others need to be
disabled in order to meet the flash size limit. But some of the code relied on
them always enabled.

This patch fixes it by including the relevant headers instead of assuming that
all SubGHz protocols are enabled at all time.

Tested building with all protocols disabled, SubGHz Read and Read raw crash
because of furi_check(). By enabling just raw and bin_raw, both options
work again.
@WillyJL
Copy link
Member

WillyJL commented Sep 14, 2025

by "SubGHz protocol items disabled" do you mean you were also commenting the #includes for them in protocol_items.h? because if so, thats not necessary, you can disable protocols by commenting them from protocol_items.c, specifically just removing them from the subghz_protocol_registry_items array: this will mean they are not part of the list of protocols used for the firmware, and thus they are not referenced elsewhere in the binary and so they are stripped when linking the firmware, meaning you can fit whatever you needed without deleting files or includes, just commenting them from the subghz_protocol_registry_items array, and making this PR redundant afaict

@user890104
Copy link
Contributor Author

That's right, I just went one step ahead and checked if there are any assumptions that specific protocol headers are always loaded, and found these occurrences. IMO it's cleaner to include only the bits you specifically need, so feel free to close it instead.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants