Skip to content

Make g_APinDescription const #308

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
Oct 6, 2016

Conversation

eriknyquist
Copy link
Contributor

This has the effect of moving g_APinDescription out of .data (SRAM),
and into .rodata (flash).

Pros:
sketches now have an additional 1160 bytes of SRAM available

Cons:
state of pins is no longer tracked; e.g. when calling digitalWrite,
the full configuration is done each time. See changes in wiring_digital.c
and wiring_analog.c for details. There is inevitably a performance impact
for digitalRead/Write & analogRead/Write, though it is unlikely to be a
noticable one.

@calvinatintel @bigdinotech @SidLeung @russmcinnis @noelpaz please review.

Do not merge until it is explicitly requested

This has the effect of moving g_APinDescription out of .data (SRAM),
and into .rodata (flash).

Pros:
sketches now have an additional 1160 bytes of SRAM available

Cons:
state of pins is no longer tracked; e.g. when calling digitalWrite,
the full configuration is done each time. See changes in wiring_digital.c
and wiring_analog.c for details. There is inevitably a performance impact
for digitalRead/Write & analogRead/Write, though it is unlikely to be a
noticable one.
Copy link
Contributor

@bigdinotech bigdinotech left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1 I think the pro of having extra SRAM outweighs the con of not being able to track the muxmode since we usually do it only during the setup of that specific pin

@noelpaz
Copy link
Contributor

noelpaz commented Oct 6, 2016

Internal BAT Tests were ran using tT and 101 boards no issues. +1

@eriknyquist eriknyquist merged commit 1a5e3f7 into arduino:master Oct 6, 2016
@eriknyquist eriknyquist deleted the const_pindesc branch October 6, 2016 18:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants