Skip to content

Remove false implications about PROGMEM #929

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

Merged
merged 1 commit into from
Nov 20, 2023

Conversation

edgar-bonet
Copy link
Contributor

This pull request addresses issue #739: PROGMEM.adoc falsely implies that PROGMEM costs flash space, and that reading PROGMEM data incurs the cost of an extra flash-to-SRAM copy.

Note that pull request #787 partially addressed the issue, but only fixed the section about the F() macro.

Remove two false implications from PROGMEM.adoc:

1. That PROGMEM costs flash space (constants go to flash no matter what,
   PROGMEM only prevents them from being copied to ram at start up).

2. That reading PROGMEM data incurs the cost of an extra flash-to-SRAM
   copy (no extra copy: an SRAM-to-CPU copy is replaced by a
   flash-to-CPU copy).

Also, add an empty line after `#include <avr/pgmspace.h>` for better
formatting.

Fixes arduino#739.
@karlsoderby karlsoderby self-requested a review November 20, 2023 15:40
@karlsoderby karlsoderby merged commit 84772b9 into arduino:master Nov 20, 2023
@edgar-bonet edgar-bonet deleted the progmem branch November 20, 2023 16:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants