Skip to content
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

Only esp8266 requires special handling for _F() #2699

Merged
merged 1 commit into from
Jan 9, 2024

Conversation

mikee47
Copy link
Contributor

@mikee47 mikee47 commented Jan 9, 2024

The dangling pointer warnings for the _F() macro (discussed in #2659 and #2675) are affecting other builds. The purpose of the macro is to enforce word-aligned flash accesses on the esp8266: unaligned accesses result in a CPU exception. Other architectures do not have these alignment requirements.

The HostTests application has been built and run on all other SOCs currently supported: rp2040, esp32, esp32c3, esp32s2. I do not have any esp32s3 devices to test against but these use the same xtensa LX7 core as the esp32s2.

The net effect of this change is that the _F() macro is transparent, so Serial.print("test string"); and Serial.print(_F("test string");, for example, produce identical code for these SOCs. Continued use of the _F() macro is obviously necessary to ensure continued compatibility with esp8266.

Copy link

what-the-diff bot commented Jan 9, 2024

PR Summary

  • Addition of platform macro in FakePgmSpace.h file
    The ARCH_ESP8266 platform macro has been added to the FakePgmSpace.h file, enhancing our code's compatibility with the ESP8266 architecture. This should help ensure our software runs smoothly on more devices.

  • Modification of #ifdef ARCH_ESP8266 block
    The #ifdef ARCH_ESP8266 conditional compilation block was adjusted to include a new #define statement for _F(str). This change allows us to manage the memory allocation of constant strings more effectively, increasing the performance of our software during its execution.

@slaff slaff added this to the 5.2.0 milestone Jan 9, 2024
@slaff slaff merged commit d87ee6c into SmingHub:develop Jan 9, 2024
45 of 46 checks passed
@mikee47 mikee47 deleted the fix/fstr-macro branch January 9, 2024 16:03
@slaff slaff mentioned this pull request May 8, 2024
5 tasks
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