1. 14 Oct, 2021 1 commit
  2. 01 Oct, 2021 1 commit
  3. 08 Sep, 2021 1 commit
  4. 30 Jun, 2021 1 commit
    • per1234's avatar
      Don't use codespell's "rare" dictionary for CI spell check · 4899e506
      per1234 authored
      The word "statics" was recently added to codespell's "rare" commonly mispelled words directory. By default, this
      dictionary is used in addition to the more conservative "clear" dictionary, resulting in a spurious failure of the
      "Spell Check" CI workflow.
      
      Although this could be fixed by adding the word to the ignore list, it seems that an increasing number of common words
      being added to this dictionary, so I think it's best to just remove it altogether. The goal for the "Spell Check"
      workflow is to catch some typos without a significant number of false positives, even if that means some misspellings
      slip through. I think the "clear" dictionary is more in line with that goal.
      4899e506
  5. 26 May, 2021 9 commits
  6. 25 May, 2021 1 commit
  7. 25 Feb, 2021 1 commit
    • ArkadyGamza's avatar
      Declare TwoWire functions as virtual · 4b35c440
      ArkadyGamza authored
      To make alternative implementations of the TwoWire class (e.g. SoftwareWire for software I2C) work properly being passed to libraries that expect TwoWire type.
      4b35c440
  8. 12 Jan, 2021 1 commit
  9. 09 Jan, 2021 1 commit
  10. 06 Jan, 2021 1 commit
  11. 02 Nov, 2020 3 commits
  12. 01 Nov, 2020 1 commit
    • Vitaly Shmagun's avatar
      Improve reading ADC result · 4fd3801e
      Vitaly Shmagun authored
      7.3.0-atmel3.6.1-arduino7 gcc fails to optimize separate reading from ADCL and ADCH. It produces additionally three eor commands or in some cases two mov commands in the assembly code (see discussion #344). These commands swap register contents before store them to data area. So they are completely unnecessary. Reading ADC result with ADC macro fixes it and gcc generates the right code..
      4fd3801e
  13. 15 Oct, 2020 1 commit
  14. 17 Sep, 2020 8 commits
    • Matthijs Kooijman's avatar
      Use std::size_t in new/delete · 6d292502
      Matthijs Kooijman authored
      The standard dictates that `std::size_t` is used, rather than the plain
      `size_t` type.
      
      Even though these types are usually, if not always, exactly the same
      type, other code might assume that `std::size_t` is actually used and thus
      also available under that name after including `<new>`.
      
      This fixes that by using the right type. One challenge is that it is
      usually declared in headers that we do not have available, so this just
      defines the `std::size_t` type in the `<new>` header to work around
      that.
      6d292502
    • Matthijs Kooijman's avatar
      Optionally let new terminate on allocation failure · 1a885ce8
      Matthijs Kooijman authored
      This is currently disabled, keeping the old behavior of returning
      NULL on failure, but should probably be enabled in the future as code
      that does want to do a null check has had a chance to switch to the
      more portable nothrow versions.
      
      When enabled, allocation failure calls the weak `std::terminate()`,
      which calls `abort()` by default, but can be replaced by user code to do
      more specific handling.
      
      To enable this, a macro must be defined (in new.cpp or on the compiler
      commandline).
      
      This fixes part of #287.
      1a885ce8
    • Matthijs Kooijman's avatar
      Make zero-sized new standards-compliant · 6e0fb1ee
      Matthijs Kooijman authored
      This fixes part of #287.
      6e0fb1ee
    • Matthijs Kooijman's avatar
      Call std::terminate on pure or deleted virtual functions · 66d06b03
      Matthijs Kooijman authored
      These are special functions that are presumably put into vtables for
      deleted or pure virtual functions. Previously, this would call `abort()`
      directly, but calling `std::terminate()` achieves the same effect, but
      allows user code to change the behavior (e.g. to print to serial, blink
      leds or whatever makes sense).
      66d06b03
    • Matthijs Kooijman's avatar
      Add weak `std::terminate()` implementation · b8c6c850
      Matthijs Kooijman authored
      This allows calling it from other places later. The default
      implementation calls `abort()`, but making it weak allows user code to
      override this function (either directly, or by including a library like
      uclibc++ that implements `std::set_terminate()`).
      
      Note that this does not add a declaration for this function, since the
      standard dictates this to be in `<exception>`, but we cannot
      meaningfully or completely implement that header, so better leave it to
      be overridden by e.g. libraries like uclibc++.
      b8c6c850
    • Matthijs Kooijman's avatar
      Allow overriding selected operator new and delete functions · 4e469e0c
      Matthijs Kooijman authored
      This makes these functions weak, so that a sketch or library can replace
      them. This does not apply to all of these operators, only for the ones
      that the C++ standard specifies as replaceable.
      4e469e0c
    • Matthijs Kooijman's avatar
      Clean up and complete `<new>` header · 07b6bd18
      Matthijs Kooijman authored
      This makes this header complete up to including C++14, except two
      exception classes that cannot be defined without `<exception>`.
      
      The functions related to the "new_handler" are declared but not actually
      defined, to prevent overhead and complexity. They are still declared to
      allow implementing them in user code if needed.
      
      This makes the implementation of all operator new and delete functions
      comply with the C++11/C++14 specification in terms of which should be
      actually implemented and which should be delegate to other functions.
      
      There are still some areas where these implementations are not entirely
      standards-compliant, which will be fixed in subsequent commits.
      
      This fixes part of #287 and fixes #47.
      07b6bd18
    • Matthijs Kooijman's avatar
      Swap new and new.h header files · 9a02bd80
      Matthijs Kooijman authored
      Originally, the Arduino core used "new.h", rather than the standard
      "new", probably because the implementation was incomplete, and for the
      most commonly used new and delete operators, no include is needed at all
      (they are defined implicitly by the compiler). However, now Arduino
      does expose the "new" name, as an alias for the older "new.h". Given
      that the standard name is "new", it makes more sense to put the actual
      content in "new", and make "new.h" a compatibility header that includes
      "new" instead of the other way around.
      9a02bd80
  15. 11 Jun, 2020 7 commits
  16. 13 May, 2020 1 commit
  17. 04 May, 2020 1 commit