Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Println optimize #3211

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
facchinm merged 2 commits into arduino:master from Chris--A:println-optimize
May 28, 2015
Merged

Println optimize #3211

facchinm merged 2 commits into arduino:master from Chris--A:println-optimize
May 28, 2015

Conversation

Copy link
Contributor

@Chris--A Chris--A commented May 22, 2015

This PR resolves issue #884

The sketch below dropped 30 bytes. The increase to ram is only 2 bytes (AVR). The changes aren't as big on the SAM core, but still show a slight improvement in code size.

/***
 Standard:
 Sketch uses 5,634 bytes (18%) of program storage space. Maximum is 32,256 bytes.
 Global variables use 228 bytes (11%) of dynamic memory, leaving 1,820 bytes for local variables. Maximum is 2,048 bytes.
 Proposed:
 Sketch uses 5,604 bytes (17%) of program storage space. Maximum is 32,256 bytes.
 Global variables use 230 bytes (11%) of dynamic memory, leaving 1,818 bytes for local variables. Maximum is 2,048 bytes.
***/
void setup(){
 Serial.begin( 9600 );
 Serial.println( F("Printing a flash string!") );
 Serial.println( 12.34567f, 4 );
 Serial.println( "A plain string" );
 Serial.println( 'a' );
 Serial.println( String( "A String" ) );
 Serial.println( 123456, BIN );
 Serial.println( 123456, OCT );
 Serial.println( 123456, DEC );
 Serial.println( 123456, HEX );
}
void loop(){}

@ffissore ffissore added Architecture: AVR Applies only to the AVR microcontrollers (Uno, etc.) Architecture: SAM Applies only to the SAM microcontrollers (Due) Component: Core Related to the code for the standard Arduino API labels May 25, 2015
facchinm added a commit that referenced this pull request May 28, 2015
@facchinm facchinm merged commit 9d13023 into arduino:master May 28, 2015
Copy link
Member

Merged, thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Reviewers
No reviews
Labels
Architecture: AVR Applies only to the AVR microcontrollers (Uno, etc.) Architecture: SAM Applies only to the SAM microcontrollers (Due) Component: Core Related to the code for the standard Arduino API
Projects
None yet
Milestone
Release 1.6.5
Development

Successfully merging this pull request may close these issues.

AltStyle によって変換されたページ (->オリジナル) /