Skip to content

SPISettings no longer constexpr #2201

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
jgromes opened this issue Nov 23, 2023 · 0 comments · Fixed by #2204
Closed

SPISettings no longer constexpr #2201

jgromes opened this issue Nov 23, 2023 · 0 comments · Fixed by #2204
Labels
bug 🐛 Something isn't working enhancement New feature or request
Milestone

Comments

@jgromes
Copy link
Contributor

jgromes commented Nov 23, 2023

Describe the bug
As discussed in #2191, the current SPISettings handling is incorrect, it should be made constexpr where applicable.

To Reproduce
Attempt to run something using SubGhz.spi_settings during object initialization, e.g. some RadioLib STM32WL Example.

Additional context
The recent changes to SPI library in 392469a introduced couple of issues. One was addressed by #2191, however, there is also a continued issue with constexpr being removed from SPISettings. To fix:

  1. d61ad83 (merged in fix(SubGhz): SPISettings not properly defined #2193) should be reverted
  2. SPISettings constructors should be made constexpr again, which will require removing init_AlwaysInline + init_MightInline and doing initialization in a simple constructor.
@fpistm fpistm added the enhancement New feature or request label Nov 23, 2023
@fpistm fpistm added this to the 2.7.1 milestone Nov 23, 2023
fpistm added a commit to fpistm/Arduino_Core_STM32 that referenced this issue Nov 24, 2023
Keep constexpr constructor to ensures that constructing
an SPISettings object can be done at compiletime.

Fixes stm32duino#2201.

Signed-off-by: Frederic Pillon <[email protected]>
fpistm added a commit to fpistm/Arduino_Core_STM32 that referenced this issue Nov 24, 2023
Keep constexpr constructor to ensures that constructing
an SPISettings object can be done at compiletime.

Fixes stm32duino#2201.

Signed-off-by: Frederic Pillon <[email protected]>
@fpistm fpistm added the bug 🐛 Something isn't working label Nov 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🐛 Something isn't working enhancement New feature or request
Projects
Development

Successfully merging a pull request may close this issue.

2 participants