Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: arduino/ArduinoCore-avr
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: master
Choose a base ref
...
head repository: arduino/ArduinoCore-avr
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: formatting
Choose a head ref
Checking mergeability… Don’t worry, you can still create the pull request.
  • 19 commits
  • 2 files changed
  • 2 contributors

Commits on May 29, 2018

  1. Inline println(...) functions

    Remove all definitions of println(...) from Print.cpp except println(void),
    and replace them with inline methods in Print.h.
    This simplifies the code in Print.cpp improving maintainability.
    cousteaulecommandant authored and matthijskooijman committed May 29, 2018
    Configuration menu
    Copy the full SHA
    5301d53 View commit details
    Browse the repository at this point in the history
  2. Inline some print() functions

    Remove print(char | char[] | Printable | unsigned char | int | unsigned int)
    from Print.cpp and replace them with inline versions in Print.h.
    cousteaulecommandant authored and matthijskooijman committed May 29, 2018
    Configuration menu
    Copy the full SHA
    d9a8682 View commit details
    Browse the repository at this point in the history
  3. Add print(signed char | short | float) explicitly

    Add explicit print() support for signed char, unsigned/signed short, and float.
    Also, add `signed` keyword explicitly to int and long (even if unnecessary).
    
    Notice that `char` and `signed char` are considered different types,
    even if their ranges are the same (ditto for `unsigned char` in SAM).
    Both AVR and SAM seem to define [u]int8_t explicitly as [un]signed char
    and not as char, so printing them will print them as numbers as expected.
    (This does not apply to `int` and `signed int`; those are the same type.)
    cousteaulecommandant authored and matthijskooijman committed May 29, 2018
    Configuration menu
    Copy the full SHA
    da0b943 View commit details
    Browse the repository at this point in the history
  4. Force inlining of inline print[ln] methods

    Add GCC __attribute__ ((__always_inline__)) to inlined methods in Print.h.
    This seems necessary since not doing so increases the executable size
    (probably because that would create several function definitions),
    even with LTO optimizations.
    This change combined with the inlining of print/printf methods seems to reduce
    the executable size for most applications by a fair amount.
    (Note that the `inline` keyword does not imply actual inlining.)
    cousteaulecommandant authored and matthijskooijman committed May 29, 2018
    Configuration menu
    Copy the full SHA
    a10af6b View commit details
    Browse the repository at this point in the history
  5. Add support for variadic Serial.print(...)

    Allows combining multiple arguments into a single call to Print::print[ln], like Serial.print("Answer=", 66, HEX).
    This feature requires C++11 or newer to work, but if it is not available the old calls can still be used (the change has been wrapped in `#if __cplusplus >= 201103L ... #endif`).
    This change is backwards compatible: print(42, 16) prints "2A" as always, not "4216" (the latter can still be achieved with print(42, "", 16) ).  This also works with multiple arguments: any numeric argument followed by an int will be treated as a (number, format) pair.
    The variadic function calls are inlined using an __attribute__ ((__always_inline__)), so they're equivalent to writing multiple sequential calls to print with one argument.
    cousteaulecommandant authored and matthijskooijman committed May 29, 2018
    Configuration menu
    Copy the full SHA
    a79b445 View commit details
    Browse the repository at this point in the history
  6. WIP: Custom formatters

    This allows passing formatters to print. E.g. instead of print(10, HEX),
    you can pass any object that has a suitable printTo(Print*, ValueT)
    method.
    
    This is a WIP on top of the variadic print PR and it makes some changes
    that should probably go into there.
    
    As an example of usage:
    
    	struct EvenOddFormatter {
    	  int printTo(Print *p, int x) {
    	    return p->print(x % 2 ? "odd" : "even");
    	  }
    	};
    
    	Serial.println(1, EvenOddFormatter());
    matthijskooijman committed May 29, 2018
    Configuration menu
    Copy the full SHA
    5084817 View commit details
    Browse the repository at this point in the history
  7. WIP

    matthijskooijman committed May 29, 2018
    Configuration menu
    Copy the full SHA
    c64a4e0 View commit details
    Browse the repository at this point in the history

Commits on Jun 1, 2018

  1. WIP

    matthijskooijman committed Jun 1, 2018
    Configuration menu
    Copy the full SHA
    fa23c18 View commit details
    Browse the repository at this point in the history
  2. WIP

    matthijskooijman committed Jun 1, 2018
    Configuration menu
    Copy the full SHA
    288d947 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    9e13289 View commit details
    Browse the repository at this point in the history

Commits on Jun 4, 2018

  1. WIP

    matthijskooijman committed Jun 4, 2018
    Configuration menu
    Copy the full SHA
    3913a2b View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    51bc094 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    5ec021a View commit details
    Browse the repository at this point in the history
  4. fix

    matthijskooijman committed Jun 4, 2018
    Configuration menu
    Copy the full SHA
    0a4b502 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    18b5997 View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    07267a1 View commit details
    Browse the repository at this point in the history

Commits on Jun 12, 2018

  1. WIP comments

    matthijskooijman committed Jun 12, 2018
    Configuration menu
    Copy the full SHA
    11a3dc9 View commit details
    Browse the repository at this point in the history

Commits on Sep 24, 2018

  1. WIP comments

    matthijskooijman committed Sep 24, 2018
    Configuration menu
    Copy the full SHA
    67ad205 View commit details
    Browse the repository at this point in the history

Commits on Oct 2, 2018

  1. WIP: Comment

    matthijskooijman committed Oct 2, 2018
    Configuration menu
    Copy the full SHA
    f770726 View commit details
    Browse the repository at this point in the history
Loading