From 9a02bd8043c41f6ee57f136083ffc8bf8ec2bdc9 Mon Sep 17 00:00:00 2001 From: Matthijs Kooijman Date: Thu, 17 Sep 2020 19:29:31 +0200 Subject: Swap new and new.h header files 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. --- cores/arduino/new | 32 +++++++++++++++++++++++++++++--- cores/arduino/new.h | 34 +++------------------------------- 2 files changed, 32 insertions(+), 34 deletions(-) diff --git a/cores/arduino/new b/cores/arduino/new index aa8ecb5..763f5cc 100644 --- a/cores/arduino/new +++ b/cores/arduino/new @@ -1,5 +1,31 @@ /* -this header is for compatibility with standard c++ header names -so that #include works as expected + Copyright (c) 2014 Arduino. All right reserved. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + See the GNU Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ -#include "new.h" + +#ifndef NEW_H +#define NEW_H + +#include + +void * operator new(size_t size); +void * operator new[](size_t size); +void * operator new(size_t size, void * ptr) noexcept; +void operator delete(void * ptr); +void operator delete[](void * ptr); + +#endif + diff --git a/cores/arduino/new.h b/cores/arduino/new.h index 763f5cc..d529853 100644 --- a/cores/arduino/new.h +++ b/cores/arduino/new.h @@ -1,31 +1,3 @@ -/* - Copyright (c) 2014 Arduino. All right reserved. - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - See the GNU Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#ifndef NEW_H -#define NEW_H - -#include - -void * operator new(size_t size); -void * operator new[](size_t size); -void * operator new(size_t size, void * ptr) noexcept; -void operator delete(void * ptr); -void operator delete[](void * ptr); - -#endif - +// This file originally used a non-standard name for this Arduino core +// only, so still expose the old new.h name for compatibility. +#include "new" -- cgit v1.2.3-18-g5258 From 07b6bd188f2395551fbd5eee3c3ca7ca3769bbbc Mon Sep 17 00:00:00 2001 From: Matthijs Kooijman Date: Thu, 17 Sep 2020 17:15:42 +0200 Subject: Clean up and complete `` header This makes this header complete up to including C++14, except two exception classes that cannot be defined without ``. 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. --- cores/arduino/new | 35 ++++++++++++++++++++++++++++--- cores/arduino/new.cpp | 57 ++++++++++++++++++++++++++++++++++++++++++--------- 2 files changed, 79 insertions(+), 13 deletions(-) diff --git a/cores/arduino/new b/cores/arduino/new index 763f5cc..3599571 100644 --- a/cores/arduino/new +++ b/cores/arduino/new @@ -21,11 +21,40 @@ #include +namespace std { + struct nothrow_t {}; + extern const nothrow_t nothrow; + + // These are not actually implemented, to prevent overhead and + // complexity. They are still declared to allow implementing + // them in user code if needed. + typedef void (*new_handler)(); + new_handler set_new_handler(new_handler new_p) noexcept; + new_handler get_new_handler() noexcept; +} // namespace std + void * operator new(size_t size); void * operator new[](size_t size); -void * operator new(size_t size, void * ptr) noexcept; -void operator delete(void * ptr); -void operator delete[](void * ptr); + +void * operator new(size_t size, const std::nothrow_t tag) noexcept; +void * operator new[](size_t size, const std::nothrow_t& tag) noexcept; + +void * operator new(size_t size, void *place) noexcept; +void * operator new[](size_t size, void *place) noexcept; + +void operator delete(void * ptr) noexcept; +void operator delete[](void * ptr) noexcept; + +#if __cplusplus >= 201402L +void operator delete(void* ptr, size_t size) noexcept; +void operator delete[](void * ptr, size_t size) noexcept; +#endif // __cplusplus >= 201402L + +void operator delete(void* ptr, const std::nothrow_t& tag) noexcept; +void operator delete[](void* ptr, const std::nothrow_t& tag) noexcept; + +void operator delete(void* ptr, void* place) noexcept; +void operator delete[](void* ptr, void* place) noexcept; #endif diff --git a/cores/arduino/new.cpp b/cores/arduino/new.cpp index fc30cf8..a36fd21 100644 --- a/cores/arduino/new.cpp +++ b/cores/arduino/new.cpp @@ -16,26 +16,63 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ -#include +#include "new.h" -void *operator new(size_t size) { - return malloc(size); +namespace std { + const nothrow_t nothrow; } -void *operator new[](size_t size) { +void * operator new(size_t size) { return malloc(size); } +void * operator new[](size_t size) { + return operator new(size); +} -void * operator new(size_t size, void * ptr) noexcept { - (void)size; - return ptr; +void * operator new(size_t size, const std::nothrow_t tag) noexcept { + return operator new(size); +} +void * operator new[](size_t size, const std::nothrow_t& tag) noexcept { + return operator new[](size); } -void operator delete(void * ptr) { - free(ptr); +void * operator new(size_t size, void *place) noexcept { + // Nothing to do + (void)size; // unused + return place; +} +void * operator new[](size_t size, void *place) noexcept { + return operator new(size, place); } -void operator delete[](void * ptr) { +void operator delete(void * ptr) noexcept { free(ptr); } +void operator delete[](void * ptr) noexcept { + operator delete(ptr); +} + +#if __cplusplus >= 201402L +void operator delete(void* ptr, size_t size) noexcept { + operator delete(ptr); +} +void operator delete[](void * ptr, size_t size) noexcept { + operator delete[](ptr); +} +#endif // __cplusplus >= 201402L +void operator delete(void* ptr, const std::nothrow_t& tag) noexcept { + operator delete(ptr); +} +void operator delete[](void* ptr, const std::nothrow_t& tag) noexcept { + operator delete[](ptr); +} + +void operator delete(void* ptr, void* place) noexcept { + (void)ptr; (void)place; // unused + // Nothing to do +} +void operator delete[](void* ptr, void* place) noexcept { + (void)ptr; (void)place; // unused + // Nothing to do +} -- cgit v1.2.3-18-g5258 From 4e469e0c83799ad6d3698e7cfa51ef8a5f2a2c76 Mon Sep 17 00:00:00 2001 From: Matthijs Kooijman Date: Thu, 17 Sep 2020 17:22:41 +0200 Subject: Allow overriding selected operator new and delete functions 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. --- cores/arduino/new | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/cores/arduino/new b/cores/arduino/new index 3599571..fb60927 100644 --- a/cores/arduino/new +++ b/cores/arduino/new @@ -33,25 +33,25 @@ namespace std { new_handler get_new_handler() noexcept; } // namespace std -void * operator new(size_t size); -void * operator new[](size_t size); +[[gnu::weak]] void * operator new(size_t size); +[[gnu::weak]] void * operator new[](size_t size); -void * operator new(size_t size, const std::nothrow_t tag) noexcept; -void * operator new[](size_t size, const std::nothrow_t& tag) noexcept; +[[gnu::weak]] void * operator new(size_t size, const std::nothrow_t tag) noexcept; +[[gnu::weak]] void * operator new[](size_t size, const std::nothrow_t& tag) noexcept; void * operator new(size_t size, void *place) noexcept; void * operator new[](size_t size, void *place) noexcept; -void operator delete(void * ptr) noexcept; -void operator delete[](void * ptr) noexcept; +[[gnu::weak]] void operator delete(void * ptr) noexcept; +[[gnu::weak]] void operator delete[](void * ptr) noexcept; #if __cplusplus >= 201402L -void operator delete(void* ptr, size_t size) noexcept; -void operator delete[](void * ptr, size_t size) noexcept; +[[gnu::weak]] void operator delete(void* ptr, size_t size) noexcept; +[[gnu::weak]] void operator delete[](void * ptr, size_t size) noexcept; #endif // __cplusplus >= 201402L -void operator delete(void* ptr, const std::nothrow_t& tag) noexcept; -void operator delete[](void* ptr, const std::nothrow_t& tag) noexcept; +[[gnu::weak]] void operator delete(void* ptr, const std::nothrow_t& tag) noexcept; +[[gnu::weak]] void operator delete[](void* ptr, const std::nothrow_t& tag) noexcept; void operator delete(void* ptr, void* place) noexcept; void operator delete[](void* ptr, void* place) noexcept; -- cgit v1.2.3-18-g5258 From b8c6c850421d0d81bb5ea9c340c4fcd958937165 Mon Sep 17 00:00:00 2001 From: Matthijs Kooijman Date: Thu, 17 Sep 2020 17:37:53 +0200 Subject: Add weak `std::terminate()` implementation 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 ``, but we cannot meaningfully or completely implement that header, so better leave it to be overridden by e.g. libraries like uclibc++. --- cores/arduino/abi.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/cores/arduino/abi.cpp b/cores/arduino/abi.cpp index 8d719b8..b8f76cf 100644 --- a/cores/arduino/abi.cpp +++ b/cores/arduino/abi.cpp @@ -21,6 +21,12 @@ extern "C" void __cxa_pure_virtual(void) __attribute__ ((__noreturn__)); extern "C" void __cxa_deleted_virtual(void) __attribute__ ((__noreturn__)); +namespace std { + [[gnu::weak, noreturn]] void terminate() { + abort(); + } +} + void __cxa_pure_virtual(void) { // We might want to write some diagnostics to uart in this case //std::terminate(); -- cgit v1.2.3-18-g5258 From 66d06b033c3f6eafde901418be3c089ffcc6ebfc Mon Sep 17 00:00:00 2001 From: Matthijs Kooijman Date: Thu, 17 Sep 2020 17:40:02 +0200 Subject: Call std::terminate on pure or deleted virtual functions 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). --- cores/arduino/abi.cpp | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/cores/arduino/abi.cpp b/cores/arduino/abi.cpp index b8f76cf..6e1b0f8 100644 --- a/cores/arduino/abi.cpp +++ b/cores/arduino/abi.cpp @@ -28,14 +28,9 @@ namespace std { } void __cxa_pure_virtual(void) { - // We might want to write some diagnostics to uart in this case - //std::terminate(); - abort(); + std::terminate(); } void __cxa_deleted_virtual(void) { - // We might want to write some diagnostics to uart in this case - //std::terminate(); - abort(); + std::terminate(); } - -- cgit v1.2.3-18-g5258 From 6e0fb1ee25efa07be5aef320501f3908f44e5b79 Mon Sep 17 00:00:00 2001 From: Matthijs Kooijman Date: Thu, 17 Sep 2020 17:55:27 +0200 Subject: Make zero-sized new standards-compliant This fixes part of #287. --- cores/arduino/new.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/cores/arduino/new.cpp b/cores/arduino/new.cpp index a36fd21..1683594 100644 --- a/cores/arduino/new.cpp +++ b/cores/arduino/new.cpp @@ -23,6 +23,10 @@ namespace std { } void * operator new(size_t size) { + // Even zero-sized allocations should return a unique pointer, but + // malloc does not guarantee this + if (size == 0) + size = 1; return malloc(size); } void * operator new[](size_t size) { -- cgit v1.2.3-18-g5258 From 1a885ce890219213ac24c00d5aededa88c122fe1 Mon Sep 17 00:00:00 2001 From: Matthijs Kooijman Date: Thu, 17 Sep 2020 17:59:08 +0200 Subject: Optionally let new terminate on allocation failure 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. --- cores/arduino/new.cpp | 37 ++++++++++++++++++++++++++++++++++++- 1 file changed, 36 insertions(+), 1 deletion(-) diff --git a/cores/arduino/new.cpp b/cores/arduino/new.cpp index 1683594..19d80b6 100644 --- a/cores/arduino/new.cpp +++ b/cores/arduino/new.cpp @@ -18,26 +18,61 @@ #include "new.h" +// The C++ spec dicates that allocation failure should cause the +// (non-nothrow version of the) operator new to throw an exception. +// Since we expect to have exceptions disabled, it would be more +// appropriate (and probably standards-compliant) to terminate instead. +// Historically failure causes null to be returned, but this define +// allows switching to more robust terminating behaviour (that might +// become the default at some point in the future). Note that any code +// that wants null to be returned can (and should) use the nothrow +// versions of the new statement anyway and is unaffected by this. +// #define NEW_TERMINATES_ON_FAILURE + namespace std { + // Defined in abi.cpp + void terminate(); + const nothrow_t nothrow; } -void * operator new(size_t size) { +static void * new_helper(size_t size) { // Even zero-sized allocations should return a unique pointer, but // malloc does not guarantee this if (size == 0) size = 1; return malloc(size); } + +void * operator new(size_t size) { + void *res = new_helper(size); +#if defined(NEW_TERMINATES_ON_FAILURE) + if (!res) + std::terminate(); +#endif + return res; +} void * operator new[](size_t size) { return operator new(size); } void * operator new(size_t size, const std::nothrow_t tag) noexcept { +#if defined(NEW_TERMINATES_ON_FAILURE) + // Cannot call throwing operator new as standard suggests, so call + // new_helper directly then + return new_helper(size); +#else return operator new(size); +#endif } void * operator new[](size_t size, const std::nothrow_t& tag) noexcept { +#if defined(NEW_TERMINATES_ON_FAILURE) + // Cannot call throwing operator new[] as standard suggests, so call + // malloc directly then + return new_helper(size); +#else return operator new[](size); +#endif } void * operator new(size_t size, void *place) noexcept { -- cgit v1.2.3-18-g5258 From 6d292502e138b5c73705f0df8095ded3f1df956f Mon Sep 17 00:00:00 2001 From: Matthijs Kooijman Date: Thu, 17 Sep 2020 19:43:09 +0200 Subject: Use std::size_t in new/delete 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 ``. 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 `` header to work around that. --- cores/arduino/new | 22 ++++++++++++++-------- cores/arduino/new.cpp | 18 +++++++++--------- 2 files changed, 23 insertions(+), 17 deletions(-) diff --git a/cores/arduino/new b/cores/arduino/new index fb60927..8cf2103 100644 --- a/cores/arduino/new +++ b/cores/arduino/new @@ -31,23 +31,29 @@ namespace std { typedef void (*new_handler)(); new_handler set_new_handler(new_handler new_p) noexcept; new_handler get_new_handler() noexcept; + + // This is normally declared in various headers that we do not have + // available, so just define it here. We could also use ::size_t + // below, but then anyone including can no longer assume + // std::size_t is available. + using size_t = ::size_t; } // namespace std -[[gnu::weak]] void * operator new(size_t size); -[[gnu::weak]] void * operator new[](size_t size); +[[gnu::weak]] void * operator new(std::size_t size); +[[gnu::weak]] void * operator new[](std::size_t size); -[[gnu::weak]] void * operator new(size_t size, const std::nothrow_t tag) noexcept; -[[gnu::weak]] void * operator new[](size_t size, const std::nothrow_t& tag) noexcept; +[[gnu::weak]] void * operator new(std::size_t size, const std::nothrow_t tag) noexcept; +[[gnu::weak]] void * operator new[](std::size_t size, const std::nothrow_t& tag) noexcept; -void * operator new(size_t size, void *place) noexcept; -void * operator new[](size_t size, void *place) noexcept; +void * operator new(std::size_t size, void *place) noexcept; +void * operator new[](std::size_t size, void *place) noexcept; [[gnu::weak]] void operator delete(void * ptr) noexcept; [[gnu::weak]] void operator delete[](void * ptr) noexcept; #if __cplusplus >= 201402L -[[gnu::weak]] void operator delete(void* ptr, size_t size) noexcept; -[[gnu::weak]] void operator delete[](void * ptr, size_t size) noexcept; +[[gnu::weak]] void operator delete(void* ptr, std::size_t size) noexcept; +[[gnu::weak]] void operator delete[](void * ptr, std::size_t size) noexcept; #endif // __cplusplus >= 201402L [[gnu::weak]] void operator delete(void* ptr, const std::nothrow_t& tag) noexcept; diff --git a/cores/arduino/new.cpp b/cores/arduino/new.cpp index 19d80b6..9047b2d 100644 --- a/cores/arduino/new.cpp +++ b/cores/arduino/new.cpp @@ -36,7 +36,7 @@ namespace std { const nothrow_t nothrow; } -static void * new_helper(size_t size) { +static void * new_helper(std::size_t size) { // Even zero-sized allocations should return a unique pointer, but // malloc does not guarantee this if (size == 0) @@ -44,7 +44,7 @@ static void * new_helper(size_t size) { return malloc(size); } -void * operator new(size_t size) { +void * operator new(std::size_t size) { void *res = new_helper(size); #if defined(NEW_TERMINATES_ON_FAILURE) if (!res) @@ -52,11 +52,11 @@ void * operator new(size_t size) { #endif return res; } -void * operator new[](size_t size) { +void * operator new[](std::size_t size) { return operator new(size); } -void * operator new(size_t size, const std::nothrow_t tag) noexcept { +void * operator new(std::size_t size, const std::nothrow_t tag) noexcept { #if defined(NEW_TERMINATES_ON_FAILURE) // Cannot call throwing operator new as standard suggests, so call // new_helper directly then @@ -65,7 +65,7 @@ void * operator new(size_t size, const std::nothrow_t tag) noexcept { return operator new(size); #endif } -void * operator new[](size_t size, const std::nothrow_t& tag) noexcept { +void * operator new[](std::size_t size, const std::nothrow_t& tag) noexcept { #if defined(NEW_TERMINATES_ON_FAILURE) // Cannot call throwing operator new[] as standard suggests, so call // malloc directly then @@ -75,12 +75,12 @@ void * operator new[](size_t size, const std::nothrow_t& tag) noexcept { #endif } -void * operator new(size_t size, void *place) noexcept { +void * operator new(std::size_t size, void *place) noexcept { // Nothing to do (void)size; // unused return place; } -void * operator new[](size_t size, void *place) noexcept { +void * operator new[](std::size_t size, void *place) noexcept { return operator new(size, place); } @@ -92,10 +92,10 @@ void operator delete[](void * ptr) noexcept { } #if __cplusplus >= 201402L -void operator delete(void* ptr, size_t size) noexcept { +void operator delete(void* ptr, std::size_t size) noexcept { operator delete(ptr); } -void operator delete[](void * ptr, size_t size) noexcept { +void operator delete[](void * ptr, std::size_t size) noexcept { operator delete[](ptr); } #endif // __cplusplus >= 201402L -- cgit v1.2.3-18-g5258 From 4fd3801e32fee9e25f04ae68a4cbfc95533d56df Mon Sep 17 00:00:00 2001 From: Vitaly Shmagun <65466721+Vitve4@users.noreply.github.com> Date: Thu, 28 May 2020 20:31:49 +0300 Subject: Improve reading ADC result 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.. --- cores/arduino/wiring_analog.c | 18 +++++------------- 1 file changed, 5 insertions(+), 13 deletions(-) diff --git a/cores/arduino/wiring_analog.c b/cores/arduino/wiring_analog.c index e237d6d..0de64f7 100644 --- a/cores/arduino/wiring_analog.c +++ b/cores/arduino/wiring_analog.c @@ -37,7 +37,6 @@ void analogReference(uint8_t mode) int analogRead(uint8_t pin) { - uint8_t low, high; #if defined(analogPinToChannel) #if defined(__AVR_ATmega32U4__) @@ -74,27 +73,20 @@ int analogRead(uint8_t pin) // without a delay, we seem to read from the wrong channel //delay(1); -#if defined(ADCSRA) && defined(ADCL) +#if defined(ADCSRA) && defined(ADC) // start the conversion sbi(ADCSRA, ADSC); // ADSC is cleared when the conversion finishes while (bit_is_set(ADCSRA, ADSC)); - // we have to read ADCL first; doing so locks both ADCL - // and ADCH until ADCH is read. reading ADCL second would - // cause the results of each conversion to be discarded, - // as ADCL and ADCH would be locked when it completed. - low = ADCL; - high = ADCH; + // ADC macro takes care of reading ADC register. + // avr-gcc implements the proper reading order: ADCL is read first. + return ADC; #else // we dont have an ADC, return 0 - low = 0; - high = 0; + return 0; #endif - - // combine the two bytes - return (high << 8) | low; } // Right now, PWM output only works on the pins with -- cgit v1.2.3-18-g5258 From 18a9e3da59c71c298059f8fc3b7ebfa95ff492fc Mon Sep 17 00:00:00 2001 From: per1234 Date: Mon, 2 Nov 2020 07:04:19 -0800 Subject: Update platform specification URLs in configuration files The Google Code URL in boards.txt is very outdated. The URL in platform.txt is to a more recent home of the content, which has been replaced with a link to the new location, but while I'm updating boards.txt, I might as well point both URLs to the real page. --- boards.txt | 2 +- platform.txt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/boards.txt b/boards.txt index 1344fbb..2dca915 100644 --- a/boards.txt +++ b/boards.txt @@ -1,4 +1,4 @@ -# See: http://code.google.com/p/arduino/wiki/Platforms +# See: https://arduino.github.io/arduino-cli/latest/platform-specification/ menu.cpu=Processor diff --git a/platform.txt b/platform.txt index 8f46fbc..bb76b80 100644 --- a/platform.txt +++ b/platform.txt @@ -3,7 +3,7 @@ # ------------------------------ # # For more info: -# https://github.com/arduino/Arduino/wiki/Arduino-IDE-1.5-3rd-party-Hardware-specification +# https://arduino.github.io/arduino-cli/latest/platform-specification/ name=Arduino AVR Boards version=1.8.3 -- cgit v1.2.3-18-g5258 From 8e823d276f939d79b2d323fad675fb8442a718c2 Mon Sep 17 00:00:00 2001 From: Daniel Gibson Date: Tue, 5 Jan 2021 13:48:43 +0100 Subject: Allow disabling CDC with -DCDC_DISABLED Sometimes Arduino-based USB devices don't work because some hardware (like KVM switches) gets confused by the CDC sub-devices. This change makes it relatively easy to disable CDC at compiletime. Disabling it of course means that the serial console won't work anymore, so you need to use the reset button when flashing. CDC_DISABLED is also used in ArduinoCore-samd for the same purpose. based on https://github.com/gdsports/usb-metamorph/tree/master/USBSerPassThruLine See also https://github.com/NicoHood/HID/issues/225 and https://github.com/arduino/Arduino/issues/6387 and https://forum.arduino.cc/index.php?topic=545288.msg3717028#msg3717028 --- cores/arduino/CDC.cpp | 8 ++++++++ cores/arduino/USBCore.cpp | 18 +++++++++++++++++- cores/arduino/USBDesc.h | 17 +++++++++++++++++ 3 files changed, 42 insertions(+), 1 deletion(-) diff --git a/cores/arduino/CDC.cpp b/cores/arduino/CDC.cpp index 4ff6b9b..7d5afaa 100644 --- a/cores/arduino/CDC.cpp +++ b/cores/arduino/CDC.cpp @@ -22,6 +22,13 @@ #if defined(USBCON) +#ifndef CDC_ENABLED + +#warning "! Disabled serial console via USB (CDC)!" +#warning "! With this change you'll have to use the Arduino's reset button/pin to flash (upload)!" + +#else // CDC not disabled + typedef struct { u32 dwDTERate; @@ -299,4 +306,5 @@ int32_t Serial_::readBreak() { Serial_ Serial; +#endif /* if defined(CDC_ENABLED) */ #endif /* if defined(USBCON) */ diff --git a/cores/arduino/USBCore.cpp b/cores/arduino/USBCore.cpp index dc6bc38..9335238 100644 --- a/cores/arduino/USBCore.cpp +++ b/cores/arduino/USBCore.cpp @@ -69,8 +69,18 @@ const u8 STRING_MANUFACTURER[] PROGMEM = USB_MANUFACTURER; #define DEVICE_CLASS 0x02 // DEVICE DESCRIPTOR + +#ifdef CDC_ENABLED const DeviceDescriptor USB_DeviceDescriptorIAD = D_DEVICE(0xEF,0x02,0x01,64,USB_VID,USB_PID,0x100,IMANUFACTURER,IPRODUCT,ISERIAL,1); +#else // CDC_DISABLED +// The default descriptor uses USB class OxEF, subclass 0x02 with protocol 1 +// which means "Interface Association Descriptor" - that's needed for the CDC, +// but doesn't make much sense as a default for custom devices when CDC is disabled. +// (0x00 means "Use class information in the Interface Descriptors" which should be generally ok) +const DeviceDescriptor USB_DeviceDescriptorIAD = + D_DEVICE(0x00,0x00,0x00,64,USB_VID,USB_PID,0x100,IMANUFACTURER,IPRODUCT,ISERIAL,1); +#endif //================================================================== //================================================================== @@ -328,10 +338,12 @@ int USB_Send(u8 ep, const void* d, int len) u8 _initEndpoints[USB_ENDPOINTS] = { 0, // Control Endpoint - + +#ifdef CDC_ENABLED EP_TYPE_INTERRUPT_IN, // CDC_ENDPOINT_ACM EP_TYPE_BULK_OUT, // CDC_ENDPOINT_OUT EP_TYPE_BULK_IN, // CDC_ENDPOINT_IN +#endif // Following endpoints are automatically initialized to 0 }; @@ -373,10 +385,12 @@ void InitEndpoints() static bool ClassInterfaceRequest(USBSetup& setup) { +#ifdef CDC_ENABLED u8 i = setup.wIndex; if (CDC_ACM_INTERFACE == i) return CDC_Setup(setup); +#endif #ifdef PLUGGABLE_USB_ENABLED return PluggableUSB().setup(setup); @@ -466,7 +480,9 @@ static u8 SendInterfaces() { u8 interfaces = 0; +#ifdef CDC_ENABLED CDC_GetInterface(&interfaces); +#endif #ifdef PLUGGABLE_USB_ENABLED PluggableUSB().getInterface(&interfaces); diff --git a/cores/arduino/USBDesc.h b/cores/arduino/USBDesc.h index c0dce07..b55ac20 100644 --- a/cores/arduino/USBDesc.h +++ b/cores/arduino/USBDesc.h @@ -26,8 +26,25 @@ #define ISERIAL_MAX_LEN 20 +// Uncomment the following line or pass -DCDC_DISABLED to the compiler +// to disable CDC (serial console via USB). +// That's useful if you want to create an USB device (like an USB Boot Keyboard) +// that works even with problematic devices (like KVM switches). +// Keep in mind that with this change you'll have to use the Arduino's +// reset button to be able to flash it. +//#define CDC_DISABLED + +#ifndef CDC_DISABLED +#define CDC_ENABLED +#endif + +#ifdef CDC_ENABLED #define CDC_INTERFACE_COUNT 2 #define CDC_ENPOINT_COUNT 3 +#else // CDC_DISABLED +#define CDC_INTERFACE_COUNT 0 +#define CDC_ENPOINT_COUNT 0 +#endif #define CDC_ACM_INTERFACE 0 // CDC ACM #define CDC_DATA_INTERFACE 1 // CDC Data -- cgit v1.2.3-18-g5258 From bbc017f5ba3c0fc3373976d4ef7e28237899d733 Mon Sep 17 00:00:00 2001 From: Greyson Christoforo Date: Sat, 9 Jan 2021 11:31:39 +0000 Subject: fix twi_manageTimeoutFlag function description --- libraries/Wire/src/utility/twi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libraries/Wire/src/utility/twi.c b/libraries/Wire/src/utility/twi.c index e8a41a2..d223760 100644 --- a/libraries/Wire/src/utility/twi.c +++ b/libraries/Wire/src/utility/twi.c @@ -490,7 +490,7 @@ void twi_handleTimeout(bool reset){ * Desc returns true if twi has seen a timeout * optionally clears the timeout flag * Input clear_flag: true if we should reset the hardware - * Output none + * Output the value of twi_timed_out_flag when the function was called */ bool twi_manageTimeoutFlag(bool clear_flag){ bool flag = twi_timed_out_flag; -- cgit v1.2.3-18-g5258 From 4b35c44064ad638c63bae7aa337002fbcc665ffb Mon Sep 17 00:00:00 2001 From: ArkadyGamza Date: Thu, 25 Feb 2021 15:55:51 +0000 Subject: Declare TwoWire functions as virtual To make alternative implementations of the TwoWire class (e.g. SoftwareWire for software I2C) work properly being passed to libraries that expect TwoWire type. --- libraries/Wire/src/Wire.h | 38 +++++++++++++++++++------------------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/libraries/Wire/src/Wire.h b/libraries/Wire/src/Wire.h index e70d72e..30299ca 100644 --- a/libraries/Wire/src/Wire.h +++ b/libraries/Wire/src/Wire.h @@ -50,31 +50,31 @@ class TwoWire : public Stream static void onReceiveService(uint8_t*, int); public: TwoWire(); - void begin(); - void begin(uint8_t); - void begin(int); - void end(); - void setClock(uint32_t); - void setWireTimeout(uint32_t timeout = 25000, bool reset_with_timeout = false); - bool getWireTimeoutFlag(void); - void clearWireTimeoutFlag(void); - void beginTransmission(uint8_t); - void beginTransmission(int); - uint8_t endTransmission(void); - uint8_t endTransmission(uint8_t); - uint8_t requestFrom(uint8_t, uint8_t); - uint8_t requestFrom(uint8_t, uint8_t, uint8_t); - uint8_t requestFrom(uint8_t, uint8_t, uint32_t, uint8_t, uint8_t); - uint8_t requestFrom(int, int); - uint8_t requestFrom(int, int, int); + virtual void begin(); + virtual void begin(uint8_t); + virtual void begin(int); + virtual void end(); + virtual void setClock(uint32_t); + virtual void setWireTimeout(uint32_t timeout = 25000, bool reset_with_timeout = false); + virtual bool getWireTimeoutFlag(void); + virtual void clearWireTimeoutFlag(void); + virtual void beginTransmission(uint8_t); + virtual void beginTransmission(int); + virtual uint8_t endTransmission(void); + virtual uint8_t endTransmission(uint8_t); + virtual uint8_t requestFrom(uint8_t, uint8_t); + virtual uint8_t requestFrom(uint8_t, uint8_t, uint8_t); + virtual uint8_t requestFrom(uint8_t, uint8_t, uint32_t, uint8_t, uint8_t); + virtual uint8_t requestFrom(int, int); + virtual uint8_t requestFrom(int, int, int); virtual size_t write(uint8_t); virtual size_t write(const uint8_t *, size_t); virtual int available(void); virtual int read(void); virtual int peek(void); virtual void flush(void); - void onReceive( void (*)(int) ); - void onRequest( void (*)(void) ); + virtual void onReceive( void (*)(int) ); + virtual void onRequest( void (*)(void) ); inline size_t write(unsigned long n) { return write((uint8_t)n); } inline size_t write(long n) { return write((uint8_t)n); } -- cgit v1.2.3-18-g5258 From ec2b495c090e0bf0107f2fea2bb83ba591e9dd78 Mon Sep 17 00:00:00 2001 From: per1234 Date: Wed, 26 May 2021 03:31:21 -0700 Subject: Provide a brief description of the project --- README.md | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 README.md diff --git a/README.md b/README.md new file mode 100644 index 0000000..88d0b6f --- /dev/null +++ b/README.md @@ -0,0 +1,4 @@ +# Arduino AVR Boards + +This repository contains the source code and configuration files of the Arduino AVR Boards +[platform](https://arduino.github.io/arduino-cli/latest/platform-specification/). -- cgit v1.2.3-18-g5258 From de717ce81dc21009ae6ed4870908b4b5a5c616e2 Mon Sep 17 00:00:00 2001 From: per1234 Date: Wed, 26 May 2021 03:56:05 -0700 Subject: Configure Dependabot to check for outdated actions used in workflows Dependabot will periodically check the versions of all actions used in the repository's workflows. If any are found to be outdated, it will submit a pull request to update them. NOTE: Dependabot's PRs will sometimes try to pin to the patch version of the action (e.g., updating `uses: foo/bar@v1` to `uses: foo/bar@v2.3.4`). When the action author has provided a major version ref, use that instead (e.g., `uses: foo/bar@v2`). Dependabot will automatically close its PR once the workflow has been updated. More information: https://docs.github.com/en/github/administering-a-repository/keeping-your-actions-up-to-date-with-dependabot --- .github/dependabot.yml | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 .github/dependabot.yml diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000..03600dd --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,10 @@ +# See: https://docs.github.com/en/github/administering-a-repository/configuration-options-for-dependency-updates#about-the-dependabotyml-file +version: 2 + +updates: + # Configure check for outdated GitHub Actions actions in workflows. + # See: https://docs.github.com/en/github/administering-a-repository/keeping-your-actions-up-to-date-with-dependabot + - package-ecosystem: github-actions + directory: / # Check the repository's workflows under /.github/workflows/ + schedule: + interval: daily -- cgit v1.2.3-18-g5258 From 1ac42f7ac0c365cfa4d901889ff6d4c23d3b4796 Mon Sep 17 00:00:00 2001 From: Alexander Entinger Date: Wed, 26 May 2021 13:19:49 +0200 Subject: Revert "Declare TwoWire functions as virtual" (#412) --- libraries/Wire/src/Wire.h | 38 +++++++++++++++++++------------------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/libraries/Wire/src/Wire.h b/libraries/Wire/src/Wire.h index 30299ca..e70d72e 100644 --- a/libraries/Wire/src/Wire.h +++ b/libraries/Wire/src/Wire.h @@ -50,31 +50,31 @@ class TwoWire : public Stream static void onReceiveService(uint8_t*, int); public: TwoWire(); - virtual void begin(); - virtual void begin(uint8_t); - virtual void begin(int); - virtual void end(); - virtual void setClock(uint32_t); - virtual void setWireTimeout(uint32_t timeout = 25000, bool reset_with_timeout = false); - virtual bool getWireTimeoutFlag(void); - virtual void clearWireTimeoutFlag(void); - virtual void beginTransmission(uint8_t); - virtual void beginTransmission(int); - virtual uint8_t endTransmission(void); - virtual uint8_t endTransmission(uint8_t); - virtual uint8_t requestFrom(uint8_t, uint8_t); - virtual uint8_t requestFrom(uint8_t, uint8_t, uint8_t); - virtual uint8_t requestFrom(uint8_t, uint8_t, uint32_t, uint8_t, uint8_t); - virtual uint8_t requestFrom(int, int); - virtual uint8_t requestFrom(int, int, int); + void begin(); + void begin(uint8_t); + void begin(int); + void end(); + void setClock(uint32_t); + void setWireTimeout(uint32_t timeout = 25000, bool reset_with_timeout = false); + bool getWireTimeoutFlag(void); + void clearWireTimeoutFlag(void); + void beginTransmission(uint8_t); + void beginTransmission(int); + uint8_t endTransmission(void); + uint8_t endTransmission(uint8_t); + uint8_t requestFrom(uint8_t, uint8_t); + uint8_t requestFrom(uint8_t, uint8_t, uint8_t); + uint8_t requestFrom(uint8_t, uint8_t, uint32_t, uint8_t, uint8_t); + uint8_t requestFrom(int, int); + uint8_t requestFrom(int, int, int); virtual size_t write(uint8_t); virtual size_t write(const uint8_t *, size_t); virtual int available(void); virtual int read(void); virtual int peek(void); virtual void flush(void); - virtual void onReceive( void (*)(int) ); - virtual void onRequest( void (*)(void) ); + void onReceive( void (*)(int) ); + void onRequest( void (*)(void) ); inline size_t write(unsigned long n) { return write((uint8_t)n); } inline size_t write(long n) { return write((uint8_t)n); } -- cgit v1.2.3-18-g5258 From 5ec42f90eed49e886eb96ad156b4332ab3d21493 Mon Sep 17 00:00:00 2001 From: per1234 Date: Wed, 26 May 2021 03:56:23 -0700 Subject: Add CI workflow to check for commonly misspelled words On every push, pull request, and periodically, use the codespell-project/actions-codespell action to check for commonly misspelled words. In the event of a false positive, the problematic word should be added, in all lowercase, to the ignore-words-list field of ./.codespellrc. Regardless of the case of the word in the false positive, it must be in all lowercase in the ignore list. The ignore list is comma-separated with no spaces. --- .codespellrc | 7 +++++++ .github/workflows/spell-check.yml | 22 ++++++++++++++++++++++ README.md | 2 ++ 3 files changed, 31 insertions(+) create mode 100644 .codespellrc create mode 100644 .github/workflows/spell-check.yml diff --git a/.codespellrc b/.codespellrc new file mode 100644 index 0000000..6aace1d --- /dev/null +++ b/.codespellrc @@ -0,0 +1,7 @@ +# See: https://github.com/codespell-project/codespell#using-a-config-file +[codespell] +# In the event of a false positive, add the problematic word, in all lowercase, to a comma-separated list here: +ignore-words-list = hart,pullrequest +check-filenames = +check-hidden = +skip = ./.git,./firmwares/arduinoISP,./firmwares/wifishield,./bootloaders diff --git a/.github/workflows/spell-check.yml b/.github/workflows/spell-check.yml new file mode 100644 index 0000000..01bee87 --- /dev/null +++ b/.github/workflows/spell-check.yml @@ -0,0 +1,22 @@ +name: Spell Check + +# See: https://docs.github.com/en/free-pro-team@latest/actions/reference/events-that-trigger-workflows +on: + push: + pull_request: + schedule: + # Run every Tuesday at 8 AM UTC to catch new misspelling detections resulting from dictionary updates. + - cron: "0 8 * * TUE" + workflow_dispatch: + repository_dispatch: + +jobs: + spellcheck: + runs-on: ubuntu-latest + + steps: + - name: Checkout repository + uses: actions/checkout@v2 + + - name: Spell check + uses: codespell-project/actions-codespell@master diff --git a/README.md b/README.md index 88d0b6f..5f3471e 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,6 @@ # Arduino AVR Boards +[![Spell Check status](https://github.com/arduino/ArduinoCore-avr/actions/workflows/spell-check.yml/badge.svg)](https://github.com/arduino/ArduinoCore-avr/actions/workflows/spell-check.yml) + This repository contains the source code and configuration files of the Arduino AVR Boards [platform](https://arduino.github.io/arduino-cli/latest/platform-specification/). -- cgit v1.2.3-18-g5258 From 8b327d7bede1c1245db99daeba4e168c92c11194 Mon Sep 17 00:00:00 2001 From: per1234 Date: Wed, 26 May 2021 04:35:59 -0700 Subject: Correct typos in comments and documentation --- cores/arduino/HardwareSerial.cpp | 2 +- cores/arduino/HardwareSerial.h | 2 +- cores/arduino/HardwareSerial_private.h | 2 +- cores/arduino/Print.h | 2 +- cores/arduino/Stream.h | 2 +- cores/arduino/USBAPI.h | 2 +- cores/arduino/WString.h | 4 ++-- cores/arduino/new.cpp | 2 +- cores/arduino/wiring.c | 26 +++++++++++----------- cores/arduino/wiring_digital.c | 2 +- libraries/EEPROM/README.md | 6 ++--- .../EEPROM/examples/eeprom_clear/eeprom_clear.ino | 6 ++--- .../examples/eeprom_iteration/eeprom_iteration.ino | 2 +- .../EEPROM/examples/eeprom_read/eeprom_read.ino | 6 ++--- .../examples/eeprom_update/eeprom_update.ino | 8 +++---- .../EEPROM/examples/eeprom_write/eeprom_write.ino | 6 ++--- libraries/HID/src/HID.cpp | 2 +- .../BarometricPressureSensor.ino | 3 +-- .../DigitalPotControl/DigitalPotControl.ino | 6 ++--- libraries/SPI/src/SPI.h | 2 +- .../SoftwareSerialExample.ino | 3 +-- .../examples/TwoPortReceive/TwoPortReceive.ino | 10 ++------- .../examples/SFRRanger_reader/SFRRanger_reader.ino | 8 +++---- .../digital_potentiometer.ino | 3 +-- .../Wire/examples/i2c_scanner/i2c_scanner.ino | 6 ++--- .../Wire/examples/master_reader/master_reader.ino | 2 +- .../Wire/examples/master_writer/master_writer.ino | 2 +- .../examples/slave_receiver/slave_receiver.ino | 2 +- .../Wire/examples/slave_sender/slave_sender.ino | 2 +- libraries/Wire/src/Wire.cpp | 4 ++-- libraries/Wire/src/utility/twi.c | 10 ++++----- programmers.txt | 2 +- 32 files changed, 69 insertions(+), 78 deletions(-) diff --git a/cores/arduino/HardwareSerial.cpp b/cores/arduino/HardwareSerial.cpp index e99d503..561127f 100644 --- a/cores/arduino/HardwareSerial.cpp +++ b/cores/arduino/HardwareSerial.cpp @@ -219,7 +219,7 @@ void HardwareSerial::flush() _tx_udr_empty_irq(); } // If we get here, nothing is queued anymore (DRIE is disabled) and - // the hardware finished tranmission (TXC is set). + // the hardware finished transmission (TXC is set). } size_t HardwareSerial::write(uint8_t c) diff --git a/cores/arduino/HardwareSerial.h b/cores/arduino/HardwareSerial.h index 17000c2..6ff29d0 100644 --- a/cores/arduino/HardwareSerial.h +++ b/cores/arduino/HardwareSerial.h @@ -32,7 +32,7 @@ // using a ring buffer (I think), in which head is the index of the location // to which to write the next incoming character and tail is the index of the // location from which to read. -// NOTE: a "power of 2" buffer size is reccomended to dramatically +// NOTE: a "power of 2" buffer size is recommended to dramatically // optimize all the modulo operations for ring buffers. // WARNING: When buffer sizes are increased to > 256, the buffer index // variables are automatically increased in size, but the extra diff --git a/cores/arduino/HardwareSerial_private.h b/cores/arduino/HardwareSerial_private.h index 761a5e5..2e23cec 100644 --- a/cores/arduino/HardwareSerial_private.h +++ b/cores/arduino/HardwareSerial_private.h @@ -63,7 +63,7 @@ #endif #endif // !defined TXC0 -// Check at compiletime that it is really ok to use the bit positions of +// Check at compile time that it is really ok to use the bit positions of // UART0 for the other UARTs as well, in case these values ever get // changed for future hardware. #if defined(TXC1) && (TXC1 != TXC0 || RXEN1 != RXEN0 || RXCIE1 != RXCIE0 || \ diff --git a/cores/arduino/Print.h b/cores/arduino/Print.h index 058a2ab..0097cc1 100644 --- a/cores/arduino/Print.h +++ b/cores/arduino/Print.h @@ -59,7 +59,7 @@ class Print } // default to zero, meaning "a single write may block" - // should be overriden by subclasses with buffering + // should be overridden by subclasses with buffering virtual int availableForWrite() { return 0; } size_t print(const __FlashStringHelper *); diff --git a/cores/arduino/Stream.h b/cores/arduino/Stream.h index 8e950c7..21a247a 100644 --- a/cores/arduino/Stream.h +++ b/cores/arduino/Stream.h @@ -25,7 +25,7 @@ #include #include "Print.h" -// compatability macros for testing +// compatibility macros for testing /* #define getInt() parseInt() #define getInt(ignore) parseInt(ignore) diff --git a/cores/arduino/USBAPI.h b/cores/arduino/USBAPI.h index 701a14f..3ff1459 100644 --- a/cores/arduino/USBAPI.h +++ b/cores/arduino/USBAPI.h @@ -32,7 +32,7 @@ typedef unsigned long u32; #include "Arduino.h" -// This definitions is usefull if you want to reduce the EP_SIZE to 16 +// This definitions is useful if you want to reduce the EP_SIZE to 16 // at the moment only 64 and 16 as EP_SIZE for all EPs are supported except the control endpoint #ifndef USB_EP_SIZE #define USB_EP_SIZE 64 diff --git a/cores/arduino/WString.h b/cores/arduino/WString.h index 77709c3..2cf4cd7 100644 --- a/cores/arduino/WString.h +++ b/cores/arduino/WString.h @@ -95,7 +95,7 @@ public: // returns true on success, false on failure (in which case, the string // is left unchanged). if the argument is null or invalid, the - // concatenation is considered unsucessful. + // concatenation is considered unsuccessful. unsigned char concat(const String &str); unsigned char concat(const char *cstr); unsigned char concat(char c); @@ -152,7 +152,7 @@ public: unsigned char startsWith(const String &prefix, unsigned int offset) const; unsigned char endsWith(const String &suffix) const; - // character acccess + // character access char charAt(unsigned int index) const; void setCharAt(unsigned int index, char c); char operator [] (unsigned int index) const; diff --git a/cores/arduino/new.cpp b/cores/arduino/new.cpp index 9047b2d..7ca4931 100644 --- a/cores/arduino/new.cpp +++ b/cores/arduino/new.cpp @@ -18,7 +18,7 @@ #include "new.h" -// The C++ spec dicates that allocation failure should cause the +// The C++ spec dictates that allocation failure should cause the // (non-nothrow version of the) operator new to throw an exception. // Since we expect to have exceptions disabled, it would be more // appropriate (and probably standards-compliant) to terminate instead. diff --git a/cores/arduino/wiring.c b/cores/arduino/wiring.c index 9727135..8caf455 100644 --- a/cores/arduino/wiring.c +++ b/cores/arduino/wiring.c @@ -125,7 +125,7 @@ void delayMicroseconds(unsigned int us) // 2 microseconds) gives delays longer than desired. //delay_us(us); #if F_CPU >= 24000000L - // for the 24 MHz clock for the aventurous ones, trying to overclock + // for the 24 MHz clock for the adventurous ones trying to overclock // zero delay fix if (!us) return; // = 3 cycles, (4 when true) @@ -135,9 +135,9 @@ void delayMicroseconds(unsigned int us) // delay requested. us *= 6; // x6 us, = 7 cycles - // account for the time taken in the preceeding commands. + // account for the time taken in the preceding commands. // we just burned 22 (24) cycles above, remove 5, (5*4=20) - // us is at least 6 so we can substract 5 + // us is at least 6 so we can subtract 5 us -= 5; //=2 cycles #elif F_CPU >= 20000000L @@ -157,9 +157,9 @@ void delayMicroseconds(unsigned int us) // delay requested. us = (us << 2) + us; // x5 us, = 7 cycles - // account for the time taken in the preceeding commands. + // account for the time taken in the preceding commands. // we just burned 26 (28) cycles above, remove 7, (7*4=28) - // us is at least 10 so we can substract 7 + // us is at least 10 so we can subtract 7 us -= 7; // 2 cycles #elif F_CPU >= 16000000L @@ -174,9 +174,9 @@ void delayMicroseconds(unsigned int us) // delay requested. us <<= 2; // x4 us, = 4 cycles - // account for the time taken in the preceeding commands. + // account for the time taken in the preceding commands. // we just burned 19 (21) cycles above, remove 5, (5*4=20) - // us is at least 8 so we can substract 5 + // us is at least 8 so we can subtract 5 us -= 5; // = 2 cycles, #elif F_CPU >= 12000000L @@ -191,9 +191,9 @@ void delayMicroseconds(unsigned int us) // delay requested. us = (us << 1) + us; // x3 us, = 5 cycles - // account for the time taken in the preceeding commands. + // account for the time taken in the preceding commands. // we just burned 20 (22) cycles above, remove 5, (5*4=20) - // us is at least 6 so we can substract 5 + // us is at least 6 so we can subtract 5 us -= 5; //2 cycles #elif F_CPU >= 8000000L @@ -208,9 +208,9 @@ void delayMicroseconds(unsigned int us) // delay requested. us <<= 1; //x2 us, = 2 cycles - // account for the time taken in the preceeding commands. + // account for the time taken in the preceding commands. // we just burned 17 (19) cycles above, remove 4, (4*4=16) - // us is at least 6 so we can substract 4 + // us is at least 6 so we can subtract 4 us -= 4; // = 2 cycles #else @@ -218,9 +218,9 @@ void delayMicroseconds(unsigned int us) // the overhead of the function calls is 14 (16) cycles if (us <= 16) return; //= 3 cycles, (4 when true) - if (us <= 25) return; //= 3 cycles, (4 when true), (must be at least 25 if we want to substract 22) + if (us <= 25) return; //= 3 cycles, (4 when true), (must be at least 25 if we want to subtract 22) - // compensate for the time taken by the preceeding and next commands (about 22 cycles) + // compensate for the time taken by the preceding and next commands (about 22 cycles) us -= 22; // = 2 cycles // the following loop takes 4 microseconds (4 cycles) // per iteration, so execute it us/4 times diff --git a/cores/arduino/wiring_digital.c b/cores/arduino/wiring_digital.c index 27a62fc..432a150 100644 --- a/cores/arduino/wiring_digital.c +++ b/cores/arduino/wiring_digital.c @@ -67,7 +67,7 @@ void pinMode(uint8_t pin, uint8_t mode) // // Mark Sproul: // - Removed inline. Save 170 bytes on atmega1280 -// - changed to a switch statment; added 32 bytes but much easier to read and maintain. +// - changed to a switch statement; added 32 bytes but much easier to read and maintain. // - Added more #ifdefs, now compiles for atmega645 // //static inline void turnOffPWM(uint8_t timer) __attribute__ ((always_inline)); diff --git a/libraries/EEPROM/README.md b/libraries/EEPROM/README.md index a624136..9ca761d 100644 --- a/libraries/EEPROM/README.md +++ b/libraries/EEPROM/README.md @@ -53,7 +53,7 @@ This function does not return any value. This function will retrieve any object from the EEPROM. Two parameters are needed to call this function. The first is an `int` containing the address that is to be written, and the second is the object you would like to read. -This function returns a reference to the `object` passed in. It does not need to be used and is only returned for conveience. +This function returns a reference to the `object` passed in. It does not need to be used and is only returned for convenience. #### **`EEPROM.put( address, object )`** [[_example_]](examples/eeprom_put/eeprom_put.ino) @@ -62,7 +62,7 @@ Two parameters are needed to call this function. The first is an `int` containin This function uses the _update_ method to write its data, and therefore only rewrites changed cells. -This function returns a reference to the `object` passed in. It does not need to be used and is only returned for conveience. +This function returns a reference to the `object` passed in. It does not need to be used and is only returned for convenience. #### **Subscript operator: `EEPROM[address]`** [[_example_]](examples/eeprom_crc/eeprom_crc.ino) @@ -136,4 +136,4 @@ This is useful for STL objects, custom iteration and C++11 style ranged for loop This function returns an `EEPtr` pointing at the location after the last EEPROM cell. Used with `begin()` to provide custom iteration. -**Note:** The `EEPtr` returned is invalid as it is out of range. Infact the hardware causes wrapping of the address (overflow) and `EEPROM.end()` actually references the first EEPROM cell. +**Note:** The `EEPtr` returned is invalid as it is out of range. In fact the hardware causes wrapping of the address (overflow) and `EEPROM.end()` actually references the first EEPROM cell. diff --git a/libraries/EEPROM/examples/eeprom_clear/eeprom_clear.ino b/libraries/EEPROM/examples/eeprom_clear/eeprom_clear.ino index 8b5121c..3fed10f 100644 --- a/libraries/EEPROM/examples/eeprom_clear/eeprom_clear.ino +++ b/libraries/EEPROM/examples/eeprom_clear/eeprom_clear.ino @@ -18,9 +18,9 @@ void setup() { Iterate through each byte of the EEPROM storage. Larger AVR processors have larger EEPROM sizes, E.g: - - Arduno Duemilanove: 512b EEPROM storage. - - Arduino Uno: 1kb EEPROM storage. - - Arduino Mega: 4kb EEPROM storage. + - Arduino Duemilanove: 512 B EEPROM storage. + - Arduino Uno: 1 kB EEPROM storage. + - Arduino Mega: 4 kB EEPROM storage. Rather than hard-coding the length, you should use the pre-provided length function. This will make your code portable to all AVR processors. diff --git a/libraries/EEPROM/examples/eeprom_iteration/eeprom_iteration.ino b/libraries/EEPROM/examples/eeprom_iteration/eeprom_iteration.ino index 3673b47..b5d68be 100644 --- a/libraries/EEPROM/examples/eeprom_iteration/eeprom_iteration.ino +++ b/libraries/EEPROM/examples/eeprom_iteration/eeprom_iteration.ino @@ -54,4 +54,4 @@ void setup() { } //End of setup function. -void loop() {} \ No newline at end of file +void loop() {} diff --git a/libraries/EEPROM/examples/eeprom_read/eeprom_read.ino b/libraries/EEPROM/examples/eeprom_read/eeprom_read.ino index a8a3510..d465035 100644 --- a/libraries/EEPROM/examples/eeprom_read/eeprom_read.ino +++ b/libraries/EEPROM/examples/eeprom_read/eeprom_read.ino @@ -33,9 +33,9 @@ void loop() { Advance to the next address, when at the end restart at the beginning. Larger AVR processors have larger EEPROM sizes, E.g: - - Arduno Duemilanove: 512b EEPROM storage. - - Arduino Uno: 1kb EEPROM storage. - - Arduino Mega: 4kb EEPROM storage. + - Arduino Duemilanove: 512 B EEPROM storage. + - Arduino Uno: 1 kB EEPROM storage. + - Arduino Mega: 4 kB EEPROM storage. Rather than hard-coding the length, you should use the pre-provided length function. This will make your code portable to all AVR processors. diff --git a/libraries/EEPROM/examples/eeprom_update/eeprom_update.ino b/libraries/EEPROM/examples/eeprom_update/eeprom_update.ino index 5e3db5b..f5b0c0c 100644 --- a/libraries/EEPROM/examples/eeprom_update/eeprom_update.ino +++ b/libraries/EEPROM/examples/eeprom_update/eeprom_update.ino @@ -17,7 +17,7 @@ int address = 0; void setup() { - /** EMpty setup **/ + /** Empty setup **/ } void loop() { @@ -48,9 +48,9 @@ void loop() { Advance to the next address, when at the end restart at the beginning. Larger AVR processors have larger EEPROM sizes, E.g: - - Arduno Duemilanove: 512b EEPROM storage. - - Arduino Uno: 1kb EEPROM storage. - - Arduino Mega: 4kb EEPROM storage. + - Arduino Duemilanove: 512 B EEPROM storage. + - Arduino Uno: 1 kB EEPROM storage. + - Arduino Mega: 4 kB EEPROM storage. Rather than hard-coding the length, you should use the pre-provided length function. This will make your code portable to all AVR processors. diff --git a/libraries/EEPROM/examples/eeprom_write/eeprom_write.ino b/libraries/EEPROM/examples/eeprom_write/eeprom_write.ino index f9bea64..64e835c 100644 --- a/libraries/EEPROM/examples/eeprom_write/eeprom_write.ino +++ b/libraries/EEPROM/examples/eeprom_write/eeprom_write.ino @@ -36,9 +36,9 @@ void loop() { Advance to the next address, when at the end restart at the beginning. Larger AVR processors have larger EEPROM sizes, E.g: - - Arduno Duemilanove: 512b EEPROM storage. - - Arduino Uno: 1kb EEPROM storage. - - Arduino Mega: 4kb EEPROM storage. + - Arduino Duemilanove: 512 B EEPROM storage. + - Arduino Uno: 1 kB EEPROM storage. + - Arduino Mega: 4 kB EEPROM storage. Rather than hard-coding the length, you should use the pre-provided length function. This will make your code portable to all AVR processors. diff --git a/libraries/HID/src/HID.cpp b/libraries/HID/src/HID.cpp index 21ede26..3dd85fc 100644 --- a/libraries/HID/src/HID.cpp +++ b/libraries/HID/src/HID.cpp @@ -43,7 +43,7 @@ int HID_::getDescriptor(USBSetup& setup) if (setup.bmRequestType != REQUEST_DEVICETOHOST_STANDARD_INTERFACE) { return 0; } if (setup.wValueH != HID_REPORT_DESCRIPTOR_TYPE) { return 0; } - // In a HID Class Descriptor wIndex cointains the interface number + // In a HID Class Descriptor wIndex contains the interface number if (setup.wIndex != pluggedInterface) { return 0; } int total = 0; diff --git a/libraries/SPI/examples/BarometricPressureSensor/BarometricPressureSensor.ino b/libraries/SPI/examples/BarometricPressureSensor/BarometricPressureSensor.ino index df73ade..1b8ad70 100644 --- a/libraries/SPI/examples/BarometricPressureSensor/BarometricPressureSensor.ino +++ b/libraries/SPI/examples/BarometricPressureSensor/BarometricPressureSensor.ino @@ -43,7 +43,7 @@ void setup() { // start the SPI library: SPI.begin(); - // initalize the data ready and chip select pins: + // initialize the data ready and chip select pins: pinMode(dataReadyPin, INPUT); pinMode(chipSelectPin, OUTPUT); @@ -140,4 +140,3 @@ void writeRegister(byte thisRegister, byte thisValue) { // take the chip select high to de-select: digitalWrite(chipSelectPin, HIGH); } - diff --git a/libraries/SPI/examples/DigitalPotControl/DigitalPotControl.ino b/libraries/SPI/examples/DigitalPotControl/DigitalPotControl.ino index 8719058..39e5bf9 100644 --- a/libraries/SPI/examples/DigitalPotControl/DigitalPotControl.ino +++ b/libraries/SPI/examples/DigitalPotControl/DigitalPotControl.ino @@ -14,7 +14,7 @@ The circuit: * All A pins of AD5206 connected to +5V * All B pins of AD5206 connected to ground - * An LED and a 220-ohm resisor in series connected from each W pin to ground + * An LED and a 220-ohm resistor in series connected from each W pin to ground * CS - to digital pin 10 (SS pin) * SDI - to digital pin 11 (MOSI pin) * CLK - to digital pin 13 (SCK pin) @@ -27,7 +27,7 @@ */ -// inslude the SPI library: +// include the SPI library: #include @@ -64,7 +64,7 @@ void digitalPotWrite(int address, int value) { // take the SS pin low to select the chip: digitalWrite(slaveSelectPin, LOW); delay(100); - // send in the address and value via SPI: + // send in the address and value via SPI: SPI.transfer(address); SPI.transfer(value); delay(100); diff --git a/libraries/SPI/src/SPI.h b/libraries/SPI/src/SPI.h index 5206a09..1e37079 100644 --- a/libraries/SPI/src/SPI.h +++ b/libraries/SPI/src/SPI.h @@ -106,7 +106,7 @@ private: // slowest (128 == 2 ^^ 7, so clock_div = 6). uint8_t clockDiv; - // When the clock is known at compiletime, use this if-then-else + // When the clock is known at compile time, use this if-then-else // cascade, which the compiler knows how to completely optimize // away. When clock is not known, use a loop instead, which generates // shorter code. diff --git a/libraries/SoftwareSerial/examples/SoftwareSerialExample/SoftwareSerialExample.ino b/libraries/SoftwareSerial/examples/SoftwareSerialExample/SoftwareSerialExample.ino index 61ce88c..061bb70 100644 --- a/libraries/SoftwareSerial/examples/SoftwareSerialExample/SoftwareSerialExample.ino +++ b/libraries/SoftwareSerial/examples/SoftwareSerialExample/SoftwareSerialExample.ino @@ -1,5 +1,5 @@ /* - Software serial multple serial test + Software serial multiple serial test Receives from the hardware serial, sends to software serial. Receives from software serial, sends to hardware serial. @@ -52,4 +52,3 @@ void loop() { // run over and over mySerial.write(Serial.read()); } } - diff --git a/libraries/SoftwareSerial/examples/TwoPortReceive/TwoPortReceive.ino b/libraries/SoftwareSerial/examples/TwoPortReceive/TwoPortReceive.ino index 8d7f93e..d8c064b 100644 --- a/libraries/SoftwareSerial/examples/TwoPortReceive/TwoPortReceive.ino +++ b/libraries/SoftwareSerial/examples/TwoPortReceive/TwoPortReceive.ino @@ -1,5 +1,5 @@ /* - Software serial multple serial test + Software serial multiple serial test Receives from the two software serial ports, sends to the hardware serial port. @@ -56,7 +56,7 @@ void setup() { } void loop() { - // By default, the last intialized port is listening. + // By default, the last initialized port is listening. // when you want to listen on a port, explicitly select it: portOne.listen(); Serial.println("Data from port one:"); @@ -83,9 +83,3 @@ void loop() { // blank line to separate data from the two ports: Serial.println(); } - - - - - - diff --git a/libraries/Wire/examples/SFRRanger_reader/SFRRanger_reader.ino b/libraries/Wire/examples/SFRRanger_reader/SFRRanger_reader.ino index 4d0a68f..aeb1a9c 100644 --- a/libraries/Wire/examples/SFRRanger_reader/SFRRanger_reader.ino +++ b/libraries/Wire/examples/SFRRanger_reader/SFRRanger_reader.ino @@ -3,7 +3,7 @@ // and James Tichenor // Demonstrates use of the Wire library reading data from the -// Devantech Utrasonic Rangers SFR08 and SFR10 +// Devantech Ultrasonic Rangers SFR08 and SFR10 // Created 29 April 2006 @@ -13,8 +13,8 @@ #include void setup() { - Wire.begin(); // join i2c bus (address optional for master) - Serial.begin(9600); // start serial communication at 9600bps + Wire.begin(); // join I2C bus (address optional for master) + Serial.begin(9600); // start serial communication at 9600 bps } int reading = 0; @@ -23,7 +23,7 @@ void loop() { // step 1: instruct sensor to read echoes Wire.beginTransmission(112); // transmit to device #112 (0x70) // the address specified in the datasheet is 224 (0xE0) - // but i2c adressing uses the high 7 bits so it's 112 + // but I2C addressing uses the high 7 bits so it's 112 Wire.write(byte(0x00)); // sets register pointer to the command register (0x00) Wire.write(byte(0x50)); // command sensor to measure in "inches" (0x50) // use 0x51 for centimeters diff --git a/libraries/Wire/examples/digital_potentiometer/digital_potentiometer.ino b/libraries/Wire/examples/digital_potentiometer/digital_potentiometer.ino index dd40a25..b5da366 100644 --- a/libraries/Wire/examples/digital_potentiometer/digital_potentiometer.ino +++ b/libraries/Wire/examples/digital_potentiometer/digital_potentiometer.ino @@ -13,7 +13,7 @@ #include void setup() { - Wire.begin(); // join i2c bus (address optional for master) + Wire.begin(); // join I2C bus (address optional for master) } byte val = 0; @@ -31,4 +31,3 @@ void loop() { } delay(500); } - diff --git a/libraries/Wire/examples/i2c_scanner/i2c_scanner.ino b/libraries/Wire/examples/i2c_scanner/i2c_scanner.ino index 3febbf4..295edf7 100644 --- a/libraries/Wire/examples/i2c_scanner/i2c_scanner.ino +++ b/libraries/Wire/examples/i2c_scanner/i2c_scanner.ino @@ -5,7 +5,7 @@ // This program (or code that looks like it) // can be found in many places. // For example on the Arduino.cc forum. -// The original author is not know. +// The original author is not known. // Version 2, Juni 2012, Using Arduino 1.0.1 // Adapted to be as simple as possible by Arduino.cc user Krodal // Version 3, Feb 26 2013 @@ -33,7 +33,7 @@ void setup() { Wire.begin(); Serial.begin(9600); - while (!Serial); // Leonardo: wait for serial monitor + while (!Serial); // Leonardo: wait for Serial Monitor Serial.println("\nI2C Scanner"); } @@ -44,7 +44,7 @@ void loop() { for (byte address = 1; address < 127; ++address) { // The i2c_scanner uses the return value of - // the Write.endTransmisstion to see if + // the Wire.endTransmission to see if // a device did acknowledge to the address. Wire.beginTransmission(address); byte error = Wire.endTransmission(); diff --git a/libraries/Wire/examples/master_reader/master_reader.ino b/libraries/Wire/examples/master_reader/master_reader.ino index ecab72a..e27cac3 100644 --- a/libraries/Wire/examples/master_reader/master_reader.ino +++ b/libraries/Wire/examples/master_reader/master_reader.ino @@ -13,7 +13,7 @@ #include void setup() { - Wire.begin(); // join i2c bus (address optional for master) + Wire.begin(); // join I2C bus (address optional for master) Serial.begin(9600); // start serial for output } diff --git a/libraries/Wire/examples/master_writer/master_writer.ino b/libraries/Wire/examples/master_writer/master_writer.ino index 5cbea11..7a17668 100644 --- a/libraries/Wire/examples/master_writer/master_writer.ino +++ b/libraries/Wire/examples/master_writer/master_writer.ino @@ -13,7 +13,7 @@ #include void setup() { - Wire.begin(); // join i2c bus (address optional for master) + Wire.begin(); // join I2C bus (address optional for master) } byte x = 0; diff --git a/libraries/Wire/examples/slave_receiver/slave_receiver.ino b/libraries/Wire/examples/slave_receiver/slave_receiver.ino index 8051d53..9b3f814 100644 --- a/libraries/Wire/examples/slave_receiver/slave_receiver.ino +++ b/libraries/Wire/examples/slave_receiver/slave_receiver.ino @@ -13,7 +13,7 @@ #include void setup() { - Wire.begin(8); // join i2c bus with address #8 + Wire.begin(8); // join I2C bus with address #8 Wire.onReceive(receiveEvent); // register event Serial.begin(9600); // start serial for output } diff --git a/libraries/Wire/examples/slave_sender/slave_sender.ino b/libraries/Wire/examples/slave_sender/slave_sender.ino index d2e72bb..6e2ed49 100644 --- a/libraries/Wire/examples/slave_sender/slave_sender.ino +++ b/libraries/Wire/examples/slave_sender/slave_sender.ino @@ -13,7 +13,7 @@ #include void setup() { - Wire.begin(8); // join i2c bus with address #8 + Wire.begin(8); // join I2C bus with address #8 Wire.onRequest(requestEvent); // register event } diff --git a/libraries/Wire/src/Wire.cpp b/libraries/Wire/src/Wire.cpp index c407776..001d924 100644 --- a/libraries/Wire/src/Wire.cpp +++ b/libraries/Wire/src/Wire.cpp @@ -100,7 +100,7 @@ void TwoWire::setClock(uint32_t clock) * when `clearWireTimeoutFlag()` or `setWireTimeoutUs()` is called. * * Note that this timeout can also trigger while waiting for clock stretching or waiting for a second master - * to complete its transaction. So make sure to adapt the timeout to accomodate for those cases if needed. + * to complete its transaction. So make sure to adapt the timeout to accommodate for those cases if needed. * A typical timeout would be 25ms (which is the maximum clock stretching allowed by the SMBus protocol), * but (much) shorter values will usually also work. * @@ -120,7 +120,7 @@ void TwoWire::setWireTimeout(uint32_t timeout, bool reset_with_timeout){ /*** * Returns the TWI timeout flag. * - * @return true if timeout has occured since the flag was last cleared. + * @return true if timeout has occurred since the flag was last cleared. */ bool TwoWire::getWireTimeoutFlag(void){ return(twi_manageTimeoutFlag(false)); diff --git a/libraries/Wire/src/utility/twi.c b/libraries/Wire/src/utility/twi.c index d223760..e09a33c 100644 --- a/libraries/Wire/src/utility/twi.c +++ b/libraries/Wire/src/utility/twi.c @@ -175,7 +175,7 @@ uint8_t twi_readFrom(uint8_t address, uint8_t* data, uint8_t length, uint8_t sen } twi_state = TWI_MRX; twi_sendStop = sendStop; - // reset error state (0xFF.. no error occured) + // reset error state (0xFF.. no error occurred) twi_error = 0xFF; // initialize buffer iteration vars @@ -183,7 +183,7 @@ uint8_t twi_readFrom(uint8_t address, uint8_t* data, uint8_t length, uint8_t sen twi_masterBufferLength = length-1; // This is not intuitive, read on... // On receive, the previously configured ACK/NACK setting is transmitted in // response to the received byte before the interrupt is signalled. - // Therefor we must actually set NACK when the _next_ to last byte is + // Therefore we must actually set NACK when the _next_ to last byte is // received, causing that NACK to be sent in response to receiving the last // expected byte of data. @@ -269,7 +269,7 @@ uint8_t twi_writeTo(uint8_t address, uint8_t* data, uint8_t length, uint8_t wait } twi_state = TWI_MTX; twi_sendStop = sendStop; - // reset error state (0xFF.. no error occured) + // reset error state (0xFF.. no error occurred) twi_error = 0xFF; // initialize buffer iteration vars @@ -294,7 +294,7 @@ uint8_t twi_writeTo(uint8_t address, uint8_t* data, uint8_t length, uint8_t wait // We need to remove ourselves from the repeated start state before we enable interrupts, // since the ISR is ASYNC, and we could get confused if we hit the ISR before cleaning // up. Also, don't enable the START interrupt. There may be one pending from the - // repeated start that we sent outselves, and that would really confuse things. + // repeated start that we sent ourselves, and that would really confuse things. twi_inRepStart = false; // remember, we're dealing with an ASYNC ISR startMicros = micros(); do { @@ -411,7 +411,7 @@ void twi_stop(void) // send stop condition TWCR = _BV(TWEN) | _BV(TWIE) | _BV(TWEA) | _BV(TWINT) | _BV(TWSTO); - // wait for stop condition to be exectued on bus + // wait for stop condition to be executed on bus // TWINT is not set after a stop condition! // We cannot use micros() from an ISR, so approximate the timeout with cycle-counted delays const uint8_t us_per_loop = 8; diff --git a/programmers.txt b/programmers.txt index 69ddf69..33ace57 100644 --- a/programmers.txt +++ b/programmers.txt @@ -81,7 +81,7 @@ buspirate.program.extra_params=-P{serial.port} # STK500 firmware version v1 and v2 use different serial protocols. # Using the 'stk500' protocol tells avrdude to try and autodetect the # firmware version. If this leads to problems, we might need to add -# stk500v1 and stk500v2 entries to allow explicitely selecting the +# stk500v1 and stk500v2 entries to allow explicitly selecting the # firmware version. stk500.name=Atmel STK500 development board stk500.communication=serial -- cgit v1.2.3-18-g5258 From d990c93ef892f626d990d12215ea5294e942e6f6 Mon Sep 17 00:00:00 2001 From: per1234 Date: Wed, 26 May 2021 04:37:22 -0700 Subject: Add CI workflow to do Arduino project-specific linting On every push, pull request, and periodically, run Arduino Lint to check for common problems not related to the project code. --- .github/workflows/check-arduino.yml | 27 +++++++++++++++++++++++++++ README.md | 1 + 2 files changed, 28 insertions(+) create mode 100644 .github/workflows/check-arduino.yml diff --git a/.github/workflows/check-arduino.yml b/.github/workflows/check-arduino.yml new file mode 100644 index 0000000..cfffb75 --- /dev/null +++ b/.github/workflows/check-arduino.yml @@ -0,0 +1,27 @@ +name: Check Arduino + +# See: https://docs.github.com/en/free-pro-team@latest/actions/reference/events-that-trigger-workflows +on: + push: + pull_request: + schedule: + # Run every Tuesday at 8 AM UTC to catch breakage caused by new rules added to Arduino Lint. + - cron: "0 8 * * TUE" + workflow_dispatch: + repository_dispatch: + +jobs: + lint: + runs-on: ubuntu-latest + + steps: + - name: Checkout repository + uses: actions/checkout@v2 + + - name: Arduino Lint + uses: arduino/arduino-lint-action@v1 + with: + compliance: specification + # Always use this setting for official repositories. Remove for 3rd party projects. + official: true + project-type: platform diff --git a/README.md b/README.md index 5f3471e..f072176 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,6 @@ # Arduino AVR Boards +[![Check Arduino status](https://github.com/arduino/ArduinoCore-avr/actions/workflows/check-arduino.yml/badge.svg)](https://github.com/arduino/ArduinoCore-avr/actions/workflows/check-arduino.yml) [![Spell Check status](https://github.com/arduino/ArduinoCore-avr/actions/workflows/spell-check.yml/badge.svg)](https://github.com/arduino/ArduinoCore-avr/actions/workflows/spell-check.yml) This repository contains the source code and configuration files of the Arduino AVR Boards -- cgit v1.2.3-18-g5258 From 05b7d7a9e9e89599f9b4c4762d55a7f5f4161ed4 Mon Sep 17 00:00:00 2001 From: per1234 Date: Wed, 26 May 2021 04:38:16 -0700 Subject: Add "smoke test" examples compilation CI workflow On every push or pull request that affects platform source code or bundled libraries, compile example sketches of all bundled libraries for the platform's boards. --- .github/workflows/compile-platform-examples.yml | 195 ++++++++++++++++++++++++ README.md | 1 + 2 files changed, 196 insertions(+) create mode 100644 .github/workflows/compile-platform-examples.yml diff --git a/.github/workflows/compile-platform-examples.yml b/.github/workflows/compile-platform-examples.yml new file mode 100644 index 0000000..3701bd0 --- /dev/null +++ b/.github/workflows/compile-platform-examples.yml @@ -0,0 +1,195 @@ +name: Compile Examples + +# See: https://docs.github.com/en/actions/reference/events-that-trigger-workflows +on: + push: + paths: + - ".github/workflows/compile-platform-examples.ya?ml" + - "cores/**" + - "libraries/**" + - "variants/**" + - "boards.txt" + - "platform.txt" + pull_request: + paths: + - ".github/workflows/compile-platform-examples.ya?ml" + - "cores/**" + - "libraries/**" + - "variants/**" + - "boards.txt" + - "platform.txt" + workflow_dispatch: + repository_dispatch: + +jobs: + build: + name: ${{ matrix.board.fqbn }} + runs-on: ubuntu-latest + + strategy: + fail-fast: false + + matrix: + board: + - fqbn: arduino:avr:yun + serial: true + softwareserial: true + - fqbn: arduino:avr:uno + serial: true + softwareserial: true + - fqbn: arduino:avr:diecimila:cpu=atmega328 + serial: true + softwareserial: true + - fqbn: arduino:avr:diecimila:cpu=atmega168 + serial: true + softwareserial: true + - fqbn: arduino:avr:nano:cpu=atmega328 + serial: true + softwareserial: true + - fqbn: arduino:avr:nano:cpu=atmega328old + serial: true + softwareserial: true + - fqbn: arduino:avr:nano:cpu=atmega168 + serial: true + softwareserial: true + - fqbn: arduino:avr:mega:cpu=atmega2560 + serial: true + softwareserial: true + - fqbn: arduino:avr:mega:cpu=atmega1280 + serial: true + softwareserial: true + - fqbn: arduino:avr:megaADK + serial: true + softwareserial: true + - fqbn: arduino:avr:leonardo + serial: true + softwareserial: true + - fqbn: arduino:avr:leonardoeth + serial: true + softwareserial: true + - fqbn: arduino:avr:micro + serial: true + softwareserial: true + - fqbn: arduino:avr:esplora + serial: true + softwareserial: true + - fqbn: arduino:avr:mini:cpu=atmega328 + serial: true + softwareserial: true + - fqbn: arduino:avr:mini:cpu=atmega168 + serial: true + softwareserial: true + - fqbn: arduino:avr:ethernet + serial: true + softwareserial: true + - fqbn: arduino:avr:fio + serial: true + softwareserial: true + - fqbn: arduino:avr:bt:cpu=atmega328 + serial: true + softwareserial: true + - fqbn: arduino:avr:bt:cpu=atmega168 + serial: true + softwareserial: true + - fqbn: arduino:avr:LilyPadUSB + serial: true + softwareserial: true + - fqbn: arduino:avr:lilypad:cpu=atmega328 + serial: true + softwareserial: true + - fqbn: arduino:avr:lilypad:cpu=atmega168 + serial: true + softwareserial: true + - fqbn: arduino:avr:pro:cpu=16MHzatmega328 + serial: true + softwareserial: true + - fqbn: arduino:avr:pro:cpu=8MHzatmega328 + serial: true + softwareserial: true + - fqbn: arduino:avr:pro:cpu=16MHzatmega168 + serial: true + softwareserial: true + - fqbn: arduino:avr:pro:cpu=8MHzatmega168 + serial: true + softwareserial: true + - fqbn: arduino:avr:atmegang:cpu=atmega168 + serial: true + softwareserial: true + - fqbn: arduino:avr:atmegang:cpu=atmega8 + serial: true + softwareserial: false + - fqbn: arduino:avr:robotControl + serial: true + softwareserial: false + - fqbn: arduino:avr:robotMotor + serial: true + softwareserial: false + - fqbn: arduino:avr:gemma + serial: false + softwareserial: false + - fqbn: arduino:avr:circuitplay32u4cat + serial: true + softwareserial: true + - fqbn: arduino:avr:yunmini + serial: true + softwareserial: true + - fqbn: arduino:avr:chiwawa + serial: true + softwareserial: true + - fqbn: arduino:avr:one + serial: true + softwareserial: true + - fqbn: arduino:avr:unowifi + serial: true + softwareserial: true + + # Make board type-specific customizations to the matrix jobs + include: + - board: + # Boards with Serial interface + serial: true + # Compile these sketches in addition to the ones compiled for all boards + serial-sketch-paths: | + - libraries/EEPROM/examples/eeprom_crc + - libraries/EEPROM/examples/eeprom_get + - libraries/EEPROM/examples/eeprom_put + - libraries/EEPROM/examples/eeprom_read + - libraries/SPI + - libraries/Wire + - board: + serial: false + serial-sketch-paths: "" + - board: + # Boards compatible with the SoftwareSerial library + softwareserial: true + softwareserial-sketch-paths: | + - libraries/SoftwareSerial + - board: + softwareserial: false + softwareserial-sketch-paths: "" + + steps: + - name: Checkout repository + uses: actions/checkout@v2 + + - name: Compile examples + uses: arduino/compile-sketches@v1 + with: + github-token: ${{ secrets.GITHUB_TOKEN }} + fqbn: ${{ matrix.board.fqbn }} + platforms: | + # Use Boards Manager to install the latest release of the platform to get the toolchain. + - name: arduino:avr + # Overwrite the Boards Manager installation with the platform from the repository. + - source-path: ./ + name: arduino:avr + sketch-paths: | + - libraries + # Compile these sketches for all boards + - libraries/EEPROM/examples/eeprom_clear + - libraries/EEPROM/examples/eeprom_iteration + - libraries/EEPROM/examples/eeprom_update + - libraries/EEPROM/examples/eeprom_write + # Board-specific sketches + ${{ matrix.serial-sketch-paths }} + ${{ matrix.softwareserial-sketch-paths }} diff --git a/README.md b/README.md index f072176..42a1f04 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,7 @@ # Arduino AVR Boards [![Check Arduino status](https://github.com/arduino/ArduinoCore-avr/actions/workflows/check-arduino.yml/badge.svg)](https://github.com/arduino/ArduinoCore-avr/actions/workflows/check-arduino.yml) +[![Compile Examples status](https://github.com/arduino/ArduinoCore-avr/actions/workflows/compile-platform-examples.yml/badge.svg)](https://github.com/arduino/ArduinoCore-avr/actions/workflows/compile-platform-examples.yml) [![Spell Check status](https://github.com/arduino/ArduinoCore-avr/actions/workflows/spell-check.yml/badge.svg)](https://github.com/arduino/ArduinoCore-avr/actions/workflows/spell-check.yml) This repository contains the source code and configuration files of the Arduino AVR Boards -- cgit v1.2.3-18-g5258 From 20dc2e532e5cecd17a7f463cf86541d87e5090e8 Mon Sep 17 00:00:00 2001 From: per1234 Date: Wed, 26 May 2021 04:38:37 -0700 Subject: Report changes in memory usage that would result from merging a PR On creation or commit to a pull request, a report of the resulting change in memory usage of the examples will be commented to the PR thread. --- .github/workflows/compile-platform-examples.yml | 13 ++++++++++++- .github/workflows/report-size-deltas.yml | 24 ++++++++++++++++++++++++ 2 files changed, 36 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/report-size-deltas.yml diff --git a/.github/workflows/compile-platform-examples.yml b/.github/workflows/compile-platform-examples.yml index 3701bd0..8e8f5b5 100644 --- a/.github/workflows/compile-platform-examples.yml +++ b/.github/workflows/compile-platform-examples.yml @@ -26,6 +26,9 @@ jobs: name: ${{ matrix.board.fqbn }} runs-on: ubuntu-latest + env: + SKETCHES_REPORTS_PATH: sketches-reports + strategy: fail-fast: false @@ -184,7 +187,6 @@ jobs: - source-path: ./ name: arduino:avr sketch-paths: | - - libraries # Compile these sketches for all boards - libraries/EEPROM/examples/eeprom_clear - libraries/EEPROM/examples/eeprom_iteration @@ -193,3 +195,12 @@ jobs: # Board-specific sketches ${{ matrix.serial-sketch-paths }} ${{ matrix.softwareserial-sketch-paths }} + enable-deltas-report: true + sketches-report-path: ${{ env.SKETCHES_REPORTS_PATH }} + + - name: Save sketches report as workflow artifact + uses: actions/upload-artifact@v2 + with: + if-no-files-found: error + path: ${{ env.SKETCHES_REPORTS_PATH }} + name: ${{ env.SKETCHES_REPORTS_PATH }} diff --git a/.github/workflows/report-size-deltas.yml b/.github/workflows/report-size-deltas.yml new file mode 100644 index 0000000..652be5d --- /dev/null +++ b/.github/workflows/report-size-deltas.yml @@ -0,0 +1,24 @@ +name: Report Size Deltas + +# See: https://docs.github.com/en/free-pro-team@latest/actions/reference/events-that-trigger-workflows +on: + push: + paths: + - ".github/workflows/report-size-deltas.yml" + schedule: + # Run at the minimum interval allowed by GitHub Actions. + # Note: GitHub Actions periodically has outages which result in workflow failures. + # In this event, the workflows will start passing again once the service recovers. + - cron: "*/5 * * * *" + workflow_dispatch: + repository_dispatch: + +jobs: + report: + runs-on: ubuntu-latest + steps: + - name: Comment size deltas reports to PRs + uses: arduino/report-size-deltas@v1 + with: + # The name of the workflow artifact created by the sketch compilation workflow + sketches-reports-source: sketches-reports -- cgit v1.2.3-18-g5258 From 4899e506bbddf4561d51ea1c04a88335ad5f9907 Mon Sep 17 00:00:00 2001 From: per1234 Date: Wed, 30 Jun 2021 04:38:56 -0700 Subject: Don't use codespell's "rare" dictionary for CI spell check 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. --- .codespellrc | 1 + 1 file changed, 1 insertion(+) diff --git a/.codespellrc b/.codespellrc index 6aace1d..d5d337d 100644 --- a/.codespellrc +++ b/.codespellrc @@ -2,6 +2,7 @@ [codespell] # In the event of a false positive, add the problematic word, in all lowercase, to a comma-separated list here: ignore-words-list = hart,pullrequest +builtin = clear check-filenames = check-hidden = skip = ./.git,./firmwares/arduinoISP,./firmwares/wifishield,./bootloaders -- cgit v1.2.3-18-g5258 From c34151f2342476c25146bb51dab67fc390a4524e Mon Sep 17 00:00:00 2001 From: Cristian Maglie Date: Wed, 13 Oct 2021 16:21:37 +0200 Subject: Added pluggable discovery/monitor definitions --- boards.txt | 219 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ platform.txt | 15 +++- programmers.txt | 15 ++++ 3 files changed, 246 insertions(+), 3 deletions(-) diff --git a/boards.txt b/boards.txt index 2dca915..c364d0d 100644 --- a/boards.txt +++ b/boards.txt @@ -15,8 +15,19 @@ yun.vid.2=0x2A03 yun.pid.2=0x0041 yun.vid.3=0x2A03 yun.pid.3=0x8041 +yun.upload_port.0.vid=0x2341 +yun.upload_port.0.pid=0x0041 +yun.upload_port.1.vid=0x2341 +yun.upload_port.1.pid=0x8041 +yun.upload_port.2.vid=0x2A03 +yun.upload_port.2.pid=0x0041 +yun.upload_port.3.vid=0x2A03 +yun.upload_port.3.pid=0x8041 +yun.upload_port.4.board=yun yun.upload.tool=avrdude +yun.upload.tool.default=avrdude +yun.upload.tool.network=arduino_ota yun.upload.protocol=avr109 yun.upload.maximum_size=28672 yun.upload.maximum_data_size=2560 @@ -26,6 +37,7 @@ yun.upload.use_1200bps_touch=true yun.upload.wait_for_upload_port=true yun.bootloader.tool=avrdude +yun.bootloader.tool.default=avrdude yun.bootloader.low_fuses=0xff yun.bootloader.high_fuses=0xd8 yun.bootloader.extended_fuses=0xfb @@ -56,14 +68,26 @@ uno.vid.2=0x2A03 uno.pid.2=0x0043 uno.vid.3=0x2341 uno.pid.3=0x0243 +uno.upload_port.0.vid=0x2341 +uno.upload_port.0.pid=0x0043 +uno.upload_port.1.vid=0x2341 +uno.upload_port.1.pid=0x0001 +uno.upload_port.2.vid=0x2A03 +uno.upload_port.2.pid=0x0043 +uno.upload_port.3.vid=0x2341 +uno.upload_port.3.pid=0x0243 +uno.upload_port.4.board=uno uno.upload.tool=avrdude +uno.upload.tool.default=avrdude +uno.upload.tool.network=arduino_ota uno.upload.protocol=arduino uno.upload.maximum_size=32256 uno.upload.maximum_data_size=2048 uno.upload.speed=115200 uno.bootloader.tool=avrdude +uno.bootloader.tool.default=avrdude uno.bootloader.low_fuses=0xFF uno.bootloader.high_fuses=0xDE uno.bootloader.extended_fuses=0xFD @@ -81,10 +105,15 @@ uno.build.variant=standard diecimila.name=Arduino Duemilanove or Diecimila +diecimila.upload_port.0.board=diecimila + diecimila.upload.tool=avrdude +diecimila.upload.tool.default=avrdude +diecimila.upload.tool.network=arduino_ota diecimila.upload.protocol=arduino diecimila.bootloader.tool=avrdude +diecimila.bootloader.tool.default=avrdude diecimila.bootloader.low_fuses=0xFF diecimila.bootloader.unlock_bits=0x3F diecimila.bootloader.lock_bits=0x0F @@ -126,10 +155,15 @@ diecimila.menu.cpu.atmega168.build.mcu=atmega168 nano.name=Arduino Nano +nano.upload_port.0.board=nano + nano.upload.tool=avrdude +nano.upload.tool.default=avrdude +nano.upload.tool.network=arduino_ota nano.upload.protocol=arduino nano.bootloader.tool=avrdude +nano.bootloader.tool.default=avrdude nano.bootloader.unlock_bits=0x3F nano.bootloader.lock_bits=0x0F @@ -199,11 +233,27 @@ mega.vid.4=0x2341 mega.pid.4=0x0210 mega.vid.5=0x2341 mega.pid.5=0x0242 +mega.upload_port.0.vid=0x2341 +mega.upload_port.0.pid=0x0010 +mega.upload_port.1.vid=0x2341 +mega.upload_port.1.pid=0x0042 +mega.upload_port.2.vid=0x2A03 +mega.upload_port.2.pid=0x0010 +mega.upload_port.3.vid=0x2A03 +mega.upload_port.3.pid=0x0042 +mega.upload_port.4.vid=0x2341 +mega.upload_port.4.pid=0x0210 +mega.upload_port.5.vid=0x2341 +mega.upload_port.5.pid=0x0242 +mega.upload_port.6.board=mega mega.upload.tool=avrdude +mega.upload.tool.default=avrdude +mega.upload.tool.network=arduino_ota mega.upload.maximum_data_size=8192 mega.bootloader.tool=avrdude +mega.bootloader.tool.default=avrdude mega.bootloader.low_fuses=0xFF mega.bootloader.unlock_bits=0x3F mega.bootloader.lock_bits=0x0F @@ -256,14 +306,26 @@ megaADK.vid.2=0x2A03 megaADK.pid.2=0x003f megaADK.vid.3=0x2A03 megaADK.pid.3=0x0044 +megaADK.upload_port.0.vid=0x2341 +megaADK.upload_port.0.pid=0x003f +megaADK.upload_port.1.vid=0x2341 +megaADK.upload_port.1.pid=0x0044 +megaADK.upload_port.2.vid=0x2A03 +megaADK.upload_port.2.pid=0x003f +megaADK.upload_port.3.vid=0x2A03 +megaADK.upload_port.3.pid=0x0044 +megaADK.upload_port.4.board=megaADK megaADK.upload.tool=avrdude +megaADK.upload.tool.default=avrdude +megaADK.upload.tool.network=arduino_ota megaADK.upload.protocol=wiring megaADK.upload.maximum_size=253952 megaADK.upload.maximum_data_size=8192 megaADK.upload.speed=115200 megaADK.bootloader.tool=avrdude +megaADK.bootloader.tool.default=avrdude megaADK.bootloader.low_fuses=0xFF megaADK.bootloader.high_fuses=0xD8 megaADK.bootloader.extended_fuses=0xFD @@ -288,8 +350,19 @@ leonardo.vid.2=0x2A03 leonardo.pid.2=0x0036 leonardo.vid.3=0x2A03 leonardo.pid.3=0x8036 +leonardo.upload_port.0.vid=0x2341 +leonardo.upload_port.0.pid=0x0036 +leonardo.upload_port.1.vid=0x2341 +leonardo.upload_port.1.pid=0x8036 +leonardo.upload_port.2.vid=0x2A03 +leonardo.upload_port.2.pid=0x0036 +leonardo.upload_port.3.vid=0x2A03 +leonardo.upload_port.3.pid=0x8036 +leonardo.upload_port.4.board=leonardo leonardo.upload.tool=avrdude +leonardo.upload.tool.default=avrdude +leonardo.upload.tool.network=arduino_ota leonardo.upload.protocol=avr109 leonardo.upload.maximum_size=28672 leonardo.upload.maximum_data_size=2560 @@ -299,6 +372,7 @@ leonardo.upload.use_1200bps_touch=true leonardo.upload.wait_for_upload_port=true leonardo.bootloader.tool=avrdude +leonardo.bootloader.tool.default=avrdude leonardo.bootloader.low_fuses=0xff leonardo.bootloader.high_fuses=0xd8 leonardo.bootloader.extended_fuses=0xcb @@ -323,8 +397,15 @@ leonardoeth.vid.0=0x2a03 leonardoeth.pid.0=0x0040 leonardoeth.vid.1=0x2a03 leonardoeth.pid.1=0x8040 +leonardoeth.upload_port.0.vid=0x2a03 +leonardoeth.upload_port.0.pid=0x0040 +leonardoeth.upload_port.1.vid=0x2a03 +leonardoeth.upload_port.1.pid=0x8040 +leonardoeth.upload_port.2.board=leonardoeth leonardoeth.upload.tool=avrdude +leonardoeth.upload.tool.default=avrdude +leonardoeth.upload.tool.network=arduino_ota leonardoeth.upload.protocol=avr109 leonardoeth.upload.maximum_size=28672 leonardoeth.upload.maximum_data_size=2560 @@ -334,6 +415,7 @@ leonardoeth.upload.use_1200bps_touch=true leonardoeth.upload.wait_for_upload_port=true leonardoeth.bootloader.tool=avrdude +leonardoeth.bootloader.tool.default=avrdude leonardoeth.bootloader.low_fuses=0xff leonardoeth.bootloader.high_fuses=0xd8 leonardoeth.bootloader.extended_fuses=0xcb @@ -367,8 +449,23 @@ micro.vid.4=0x2341 micro.pid.4=0x0237 micro.vid.5=0x2341 micro.pid.5=0x8237 +micro.upload_port.0.vid=0x2341 +micro.upload_port.0.pid=0x0037 +micro.upload_port.1.vid=0x2341 +micro.upload_port.1.pid=0x8037 +micro.upload_port.2.vid=0x2A03 +micro.upload_port.2.pid=0x0037 +micro.upload_port.3.vid=0x2A03 +micro.upload_port.3.pid=0x8037 +micro.upload_port.4.vid=0x2341 +micro.upload_port.4.pid=0x0237 +micro.upload_port.5.vid=0x2341 +micro.upload_port.5.pid=0x8237 +micro.upload_port.6.board=micro micro.upload.tool=avrdude +micro.upload.tool.default=avrdude +micro.upload.tool.network=arduino_ota micro.upload.protocol=avr109 micro.upload.maximum_size=28672 micro.upload.maximum_data_size=2560 @@ -378,6 +475,7 @@ micro.upload.use_1200bps_touch=true micro.upload.wait_for_upload_port=true micro.bootloader.tool=avrdude +micro.bootloader.tool.default=avrdude micro.bootloader.low_fuses=0xff micro.bootloader.high_fuses=0xd8 micro.bootloader.extended_fuses=0xcb @@ -406,8 +504,19 @@ esplora.vid.2=0x2A03 esplora.pid.2=0x003C esplora.vid.3=0x2A03 esplora.pid.3=0x803C +esplora.upload_port.0.vid=0x2341 +esplora.upload_port.0.pid=0x003C +esplora.upload_port.1.vid=0x2341 +esplora.upload_port.1.pid=0x803C +esplora.upload_port.2.vid=0x2A03 +esplora.upload_port.2.pid=0x003C +esplora.upload_port.3.vid=0x2A03 +esplora.upload_port.3.pid=0x803C +esplora.upload_port.4.board=esplora esplora.upload.tool=avrdude +esplora.upload.tool.default=avrdude +esplora.upload.tool.network=arduino_ota esplora.upload.protocol=avr109 esplora.upload.maximum_size=28672 esplora.upload.maximum_data_size=2560 @@ -417,6 +526,7 @@ esplora.upload.use_1200bps_touch=true esplora.upload.wait_for_upload_port=true esplora.bootloader.tool=avrdude +esplora.bootloader.tool.default=avrdude esplora.bootloader.low_fuses=0xff esplora.bootloader.high_fuses=0xd8 esplora.bootloader.extended_fuses=0xcb @@ -438,10 +548,15 @@ esplora.build.extra_flags={build.usb_flags} mini.name=Arduino Mini +mini.upload_port.0.board=mini + mini.upload.tool=avrdude +mini.upload.tool.default=avrdude +mini.upload.tool.network=arduino_ota mini.upload.protocol=arduino mini.bootloader.tool=avrdude +mini.bootloader.tool.default=avrdude mini.bootloader.low_fuses=0xff mini.bootloader.unlock_bits=0x3F mini.bootloader.lock_bits=0x0F @@ -483,13 +598,18 @@ mini.menu.cpu.atmega168.build.mcu=atmega168 ethernet.name=Arduino Ethernet +ethernet.upload_port.0.board=ethernet + ethernet.upload.tool=avrdude +ethernet.upload.tool.default=avrdude +ethernet.upload.tool.network=arduino_ota ethernet.upload.protocol=arduino ethernet.upload.maximum_size=32256 ethernet.upload.maximum_data_size=2048 ethernet.upload.speed=115200 ethernet.bootloader.tool=avrdude +ethernet.bootloader.tool.default=avrdude ethernet.bootloader.low_fuses=0xff ethernet.bootloader.high_fuses=0xde ethernet.bootloader.extended_fuses=0xFD @@ -507,13 +627,18 @@ ethernet.build.core=arduino fio.name=Arduino Fio +fio.upload_port.0.board=fio + fio.upload.tool=avrdude +fio.upload.tool.default=avrdude +fio.upload.tool.network=arduino_ota fio.upload.protocol=arduino fio.upload.maximum_size=30720 fio.upload.maximum_data_size=2048 fio.upload.speed=57600 fio.bootloader.tool=avrdude +fio.bootloader.tool.default=avrdude fio.bootloader.low_fuses=0xFF fio.bootloader.high_fuses=0xDA fio.bootloader.extended_fuses=0xFD @@ -531,12 +656,17 @@ fio.build.variant=eightanaloginputs bt.name=Arduino BT +bt.upload_port.0.board=bt + bt.upload.tool=avrdude +bt.upload.tool.default=avrdude +bt.upload.tool.network=arduino_ota bt.upload.protocol=arduino bt.upload.speed=19200 bt.upload.disable_flushing=true bt.bootloader.tool=avrdude +bt.bootloader.tool.default=avrdude bt.bootloader.low_fuses=0xff bt.bootloader.unlock_bits=0x3F bt.bootloader.lock_bits=0x0F @@ -577,8 +707,15 @@ LilyPadUSB.vid.0=0x1B4F LilyPadUSB.pid.0=0x9207 LilyPadUSB.vid.1=0x1B4F LilyPadUSB.pid.1=0x9208 +LilyPadUSB.upload_port.0.vid=0x1B4F +LilyPadUSB.upload_port.0.pid=0x9207 +LilyPadUSB.upload_port.1.vid=0x1B4F +LilyPadUSB.upload_port.1.pid=0x9208 +LilyPadUSB.upload_port.2.board=LilyPadUSB LilyPadUSB.upload.tool=avrdude +LilyPadUSB.upload.tool.default=avrdude +LilyPadUSB.upload.tool.network=arduino_ota LilyPadUSB.upload.protocol=avr109 LilyPadUSB.upload.maximum_size=28672 LilyPadUSB.upload.maximum_data_size=2560 @@ -588,6 +725,7 @@ LilyPadUSB.upload.use_1200bps_touch=true LilyPadUSB.upload.wait_for_upload_port=true LilyPadUSB.bootloader.tool=avrdude +LilyPadUSB.bootloader.tool.default=avrdude LilyPadUSB.bootloader.low_fuses=0xff LilyPadUSB.bootloader.high_fuses=0xd8 LilyPadUSB.bootloader.extended_fuses=0xce @@ -609,10 +747,15 @@ LilyPadUSB.build.extra_flags={build.usb_flags} lilypad.name=LilyPad Arduino +lilypad.upload_port.0.board=lilypad + lilypad.upload.tool=avrdude +lilypad.upload.tool.default=avrdude +lilypad.upload.tool.network=arduino_ota lilypad.upload.protocol=arduino lilypad.bootloader.tool=avrdude +lilypad.bootloader.tool.default=avrdude lilypad.bootloader.unlock_bits=0x3F lilypad.bootloader.lock_bits=0x0F @@ -655,10 +798,15 @@ lilypad.menu.cpu.atmega168.build.mcu=atmega168 pro.name=Arduino Pro or Pro Mini +pro.upload_port.0.board=pro + pro.upload.tool=avrdude +pro.upload.tool.default=avrdude +pro.upload.tool.network=arduino_ota pro.upload.protocol=arduino pro.bootloader.tool=avrdude +pro.bootloader.tool.default=avrdude pro.bootloader.unlock_bits=0x3F pro.bootloader.lock_bits=0x0F @@ -734,11 +882,16 @@ pro.menu.cpu.8MHzatmega168.build.f_cpu=8000000L atmegang.name=Arduino NG or older +atmegang.upload_port.0.board=atmegang + atmegang.upload.tool=avrdude +atmegang.upload.tool.default=avrdude +atmegang.upload.tool.network=arduino_ota atmegang.upload.protocol=arduino atmegang.upload.speed=19200 atmegang.bootloader.tool=avrdude +atmegang.bootloader.tool.default=avrdude atmegang.bootloader.unlock_bits=0x3F atmegang.bootloader.lock_bits=0x0F @@ -787,8 +940,19 @@ robotControl.vid.2=0x2A03 robotControl.pid.2=0x0038 robotControl.vid.3=0x2A03 robotControl.pid.3=0x8038 +robotControl.upload_port.0.vid=0x2341 +robotControl.upload_port.0.pid=0x0038 +robotControl.upload_port.1.vid=0x2341 +robotControl.upload_port.1.pid=0x8038 +robotControl.upload_port.2.vid=0x2A03 +robotControl.upload_port.2.pid=0x0038 +robotControl.upload_port.3.vid=0x2A03 +robotControl.upload_port.3.pid=0x8038 +robotControl.upload_port.4.board=robotControl robotControl.upload.tool=avrdude +robotControl.upload.tool.default=avrdude +robotControl.upload.tool.network=arduino_ota robotControl.upload.protocol=avr109 robotControl.upload.maximum_size=28672 robotControl.upload.maximum_data_size=2560 @@ -798,6 +962,7 @@ robotControl.upload.use_1200bps_touch=true robotControl.upload.wait_for_upload_port=true robotControl.bootloader.tool=avrdude +robotControl.bootloader.tool.default=avrdude robotControl.bootloader.low_fuses=0xff robotControl.bootloader.high_fuses=0xd8 robotControl.bootloader.extended_fuses=0xcb @@ -826,8 +991,19 @@ robotMotor.vid.2=0x2A03 robotMotor.pid.2=0x0039 robotMotor.vid.3=0x2A03 robotMotor.pid.3=0x8039 +robotMotor.upload_port.0.vid=0x2341 +robotMotor.upload_port.0.pid=0x0039 +robotMotor.upload_port.1.vid=0x2341 +robotMotor.upload_port.1.pid=0x8039 +robotMotor.upload_port.2.vid=0x2A03 +robotMotor.upload_port.2.pid=0x0039 +robotMotor.upload_port.3.vid=0x2A03 +robotMotor.upload_port.3.pid=0x8039 +robotMotor.upload_port.4.board=robotMotor robotMotor.upload.tool=avrdude +robotMotor.upload.tool.default=avrdude +robotMotor.upload.tool.network=arduino_ota robotMotor.upload.protocol=avr109 robotMotor.upload.maximum_size=28672 robotMotor.upload.maximum_data_size=2560 @@ -837,6 +1013,7 @@ robotMotor.upload.use_1200bps_touch=true robotMotor.upload.wait_for_upload_port=true robotMotor.bootloader.tool=avrdude +robotMotor.bootloader.tool.default=avrdude robotMotor.bootloader.low_fuses=0xff robotMotor.bootloader.high_fuses=0xd8 robotMotor.bootloader.extended_fuses=0xcb @@ -858,6 +1035,9 @@ robotMotor.build.extra_flags={build.usb_flags} gemma.vid.0=0x2341 gemma.pid.0=0x0c9f +gemma.upload_port.0.vid=0x2341 +gemma.upload_port.0.pid=0x0c9f +gemma.upload_port.1.board=gemma gemma.name=Arduino Gemma @@ -865,6 +1045,7 @@ gemma.bootloader.low_fuses=0xF1 gemma.bootloader.high_fuses=0xD5 gemma.bootloader.extended_fuses=0xFE gemma.bootloader.tool=avrdude +gemma.bootloader.tool.default=avrdude gemma.bootloader.lock_bits= gemma.bootloader.unlock_bits= gemma.bootloader.file=gemma/gemma_v1.hex @@ -876,6 +1057,8 @@ gemma.build.variant=gemma gemma.build.board=AVR_GEMMA gemma.upload.tool=avrdude +gemma.upload.tool.default=avrdude +gemma.upload.tool.network=arduino_ota gemma.upload.maximum_size=5310 ############################################################## @@ -889,6 +1072,7 @@ circuitplay32u4cat.bootloader.file=caterina/Caterina-Circuitplay32u4.hex circuitplay32u4cat.bootloader.unlock_bits=0x3F circuitplay32u4cat.bootloader.lock_bits=0x2F circuitplay32u4cat.bootloader.tool=avrdude +circuitplay32u4cat.bootloader.tool.default=avrdude circuitplay32u4cat.build.mcu=atmega32u4 circuitplay32u4cat.build.f_cpu=8000000L circuitplay32u4cat.build.vid=0x239A @@ -906,8 +1090,13 @@ circuitplay32u4cat.upload.disable_flushing=true circuitplay32u4cat.upload.use_1200bps_touch=true circuitplay32u4cat.upload.wait_for_upload_port=true circuitplay32u4cat.upload.tool=avrdude +circuitplay32u4cat.upload.tool.default=avrdude +circuitplay32u4cat.upload.tool.network=arduino_ota circuitplay32u4cat.vid.0=0x239A circuitplay32u4cat.pid.0=0x8011 +circuitplay32u4cat.upload_port.0.vid=0x239A +circuitplay32u4cat.upload_port.0.pid=0x8011 +circuitplay32u4cat.upload_port.1.board=circuitplay32u4cat ############################################################## @@ -918,8 +1107,15 @@ yunmini.vid.0=0x2a03 yunmini.pid.0=0x0050 yunmini.vid.1=0x2a03 yunmini.pid.1=0x8050 +yunmini.upload_port.0.vid=0x2a03 +yunmini.upload_port.0.pid=0x0050 +yunmini.upload_port.1.vid=0x2a03 +yunmini.upload_port.1.pid=0x8050 +yunmini.upload_port.2.board=yunmini yunmini.upload.tool=avrdude +yunmini.upload.tool.default=avrdude +yunmini.upload.tool.network=arduino_ota yunmini.upload.protocol=avr109 yunmini.upload.maximum_size=28672 yunmini.upload.maximum_data_size=2560 @@ -929,6 +1125,7 @@ yunmini.upload.use_1200bps_touch=true yunmini.upload.wait_for_upload_port=true yunmini.bootloader.tool=avrdude +yunmini.bootloader.tool.default=avrdude yunmini.bootloader.low_fuses=0xff yunmini.bootloader.high_fuses=0xd8 yunmini.bootloader.extended_fuses=0xfb @@ -955,8 +1152,15 @@ chiwawa.vid.0=0x2a03 chiwawa.pid.0=0x0056 chiwawa.vid.1=0x2a03 chiwawa.pid.1=0x8056 +chiwawa.upload_port.0.vid=0x2a03 +chiwawa.upload_port.0.pid=0x0056 +chiwawa.upload_port.1.vid=0x2a03 +chiwawa.upload_port.1.pid=0x8056 +chiwawa.upload_port.2.board=chiwawa chiwawa.upload.tool=avrdude +chiwawa.upload.tool.default=avrdude +chiwawa.upload.tool.network=arduino_ota chiwawa.upload.protocol=avr109 chiwawa.upload.maximum_size=28672 chiwawa.upload.maximum_data_size=2560 @@ -966,6 +1170,7 @@ chiwawa.upload.use_1200bps_touch=true chiwawa.upload.wait_for_upload_port=true chiwawa.bootloader.tool=avrdude +chiwawa.bootloader.tool.default=avrdude chiwawa.bootloader.low_fuses=0xff chiwawa.bootloader.high_fuses=0xd8 chiwawa.bootloader.extended_fuses=0xfb @@ -992,8 +1197,15 @@ one.vid.0=0x2a03 one.pid.0=0x0001 one.vid.1=0x2a03 one.pid.1=0x8001 +one.upload_port.0.vid=0x2a03 +one.upload_port.0.pid=0x0001 +one.upload_port.1.vid=0x2a03 +one.upload_port.1.pid=0x8001 +one.upload_port.2.board=one one.upload.tool=avrdude +one.upload.tool.default=avrdude +one.upload.tool.network=arduino_ota one.upload.protocol=avr109 one.upload.maximum_size=28672 one.upload.maximum_data_size=2560 @@ -1003,6 +1215,7 @@ one.upload.use_1200bps_touch=true one.upload.wait_for_upload_port=true one.bootloader.tool=avrdude +one.bootloader.tool.default=avrdude one.bootloader.low_fuses=0xff one.bootloader.high_fuses=0xd8 one.bootloader.extended_fuses=0xfb @@ -1025,8 +1238,13 @@ one.build.extra_flags={build.usb_flags} unowifi.name=Arduino Uno WiFi unowifi.vid.0=0x2A03 unowifi.pid.0=0x0057 +unowifi.upload_port.0.vid=0x2A03 +unowifi.upload_port.0.pid=0x0057 +unowifi.upload_port.1.board=unowifi unowifi.upload.tool=avrdude +unowifi.upload.tool.default=avrdude +unowifi.upload.tool.network=arduino_ota unowifi.upload.protocol=arduino unowifi.upload.maximum_size=32256 unowifi.upload.maximum_data_size=2048 @@ -1038,6 +1256,7 @@ unowifi.upload.network.endpoint_reset=/log/reset unowifi.upload.network.port=80 unowifi.bootloader.tool=avrdude +unowifi.bootloader.tool.default=avrdude unowifi.bootloader.low_fuses=0xFF unowifi.bootloader.high_fuses=0xDE unowifi.bootloader.extended_fuses=0x05 diff --git a/platform.txt b/platform.txt index bb76b80..dac8a20 100644 --- a/platform.txt +++ b/platform.txt @@ -89,6 +89,12 @@ recipe.preproc.includes="{compiler.path}{compiler.cpp.cmd}" {compiler.cpp.flags} preproc.macros.flags=-w -x c++ -E -CC recipe.preproc.macros="{compiler.path}{compiler.cpp.cmd}" {compiler.cpp.flags} {preproc.macros.flags} -mmcu={build.mcu} -DF_CPU={build.f_cpu} -DARDUINO={runtime.ide.version} -DARDUINO_{build.board} -DARDUINO_ARCH_{build.arch} {compiler.cpp.extra_flags} {build.extra_flags} {includes} "{source_file}" -o "{preprocessed_file_path}" +# Required discoveries and monitors +# --------------------------------- +pluggable_discovery.required.0=builtin:serial-discovery +pluggable_discovery.required.1=builtin:mdns-discovery +pluggable_monitor.required.serial=builtin:serial-monitor + # AVR Uploader/Programmers tools # ------------------------------ @@ -96,8 +102,6 @@ tools.avrdude.path={runtime.tools.avrdude.path} tools.avrdude.cmd.path={path}/bin/avrdude tools.avrdude.config.path={path}/etc/avrdude.conf -tools.avrdude.network_cmd={runtime.tools.arduinoOTA.path}/bin/arduinoOTA - tools.avrdude.upload.params.verbose=-v tools.avrdude.upload.params.quiet=-q -q # tools.avrdude.upload.verify is needed for backwards compatibility with IDE 1.6.8 or older, IDE 1.6.9 or newer overrides this value @@ -122,7 +126,12 @@ tools.avrdude.bootloader.pattern="{cmd.path}" "-C{config.path}" {bootloader.verb tools.avrdude_remote.upload.pattern=/usr/bin/run-avrdude /tmp/sketch.hex {upload.verbose} -p{build.mcu} -tools.avrdude.upload.network_pattern="{network_cmd}" -address {serial.port} -port {upload.network.port} -sketch "{build.path}/{build.project_name}.hex" -upload {upload.network.endpoint_upload} -sync {upload.network.endpoint_sync} -reset {upload.network.endpoint_reset} -sync_exp {upload.network.sync_return} +# the following rule is deprecated by pluggable discovery +tools.avrdude.upload.network_pattern="{tools.arduino_ota.cmd}" -address {serial.port} -port {upload.network.port} -sketch "{build.path}/{build.project_name}.hex" -upload {upload.network.endpoint_upload} -sync {upload.network.endpoint_sync} -reset {upload.network.endpoint_reset} -sync_exp {upload.network.sync_return} + +# arduino ota +tools.arduino_ota.cmd={runtime.tools.arduinoOTA.path}/bin/arduinoOTA +tools.arduino_ota.upload.pattern="{cmd}" -address {upload.port.address} -port {upload.port.properties.port} -sketch "{build.path}/{build.project_name}.hex" -upload {upload.port.properties.endpoint_upload} -sync {upload.port.properties.endpoint_sync} -reset {upload.port.properties.endpoint_reset} -sync_exp {upload.port.properties.sync_return} # USB Default Flags # Default blank usb manufacturer will be filled in at compile time diff --git a/programmers.txt b/programmers.txt index 33ace57..40532f5 100644 --- a/programmers.txt +++ b/programmers.txt @@ -3,6 +3,7 @@ avrisp.communication=serial avrisp.protocol=stk500v1 avrisp.program.protocol=stk500v1 avrisp.program.tool=avrdude +avrisp.program.tool.default=avrdude avrisp.program.extra_params=-P{serial.port} avrispmkii.name=AVRISP mkII @@ -10,21 +11,25 @@ avrispmkii.communication=usb avrispmkii.protocol=stk500v2 avrispmkii.program.protocol=stk500v2 avrispmkii.program.tool=avrdude +avrispmkii.program.tool.default=avrdude avrispmkii.program.extra_params=-Pusb usbtinyisp.name=USBtinyISP usbtinyisp.protocol=usbtiny usbtinyisp.program.tool=avrdude +usbtinyisp.program.tool.default=avrdude usbtinyisp.program.extra_params= arduinoisp.name=ArduinoISP arduinoisp.protocol=arduinoisp arduinoisp.program.tool=avrdude +arduinoisp.program.tool.default=avrdude arduinoisp.program.extra_params= arduinoisporg.name=ArduinoISP.org arduinoisporg.protocol=arduinoisporg arduinoisporg.program.tool=avrdude +arduinoisporg.program.tool.default=avrdude arduinoisporg.program.extra_params= usbasp.name=USBasp @@ -32,6 +37,7 @@ usbasp.communication=usb usbasp.protocol=usbasp usbasp.program.protocol=usbasp usbasp.program.tool=avrdude +usbasp.program.tool.default=avrdude usbasp.program.extra_params=-Pusb parallel.name=Parallel Programmer @@ -39,6 +45,7 @@ parallel.protocol=dapa parallel.force=true # parallel.delay=200 parallel.program.tool=avrdude +parallel.program.tool.default=avrdude parallel.program.extra_params=-F arduinoasisp.name=Arduino as ISP @@ -48,6 +55,7 @@ arduinoasisp.speed=19200 arduinoasisp.program.protocol=stk500v1 arduinoasisp.program.speed=19200 arduinoasisp.program.tool=avrdude +arduinoasisp.program.tool.default=avrdude arduinoasisp.program.extra_params=-P{serial.port} -b{program.speed} arduinoasispatmega32u4.name=Arduino as ISP (ATmega32U4) @@ -57,11 +65,13 @@ arduinoasispatmega32u4.speed=19200 arduinoasispatmega32u4.program.protocol=arduino arduinoasispatmega32u4.program.speed=19200 arduinoasispatmega32u4.program.tool=avrdude +arduinoasispatmega32u4.program.tool.default=avrdude arduinoasispatmega32u4.program.extra_params=-P{serial.port} -b{program.speed} usbGemma.name=Arduino Gemma usbGemma.protocol=arduinogemma usbGemma.program.tool=avrdude +usbGemma.program.tool.default=avrdude usbGemma.program.extra_params= usbGemma.config.path={runtime.platform.path}/bootloaders/gemma/avrdude.conf @@ -76,6 +86,7 @@ buspirate.communication=serial buspirate.protocol=buspirate buspirate.program.protocol=buspirate buspirate.program.tool=avrdude +buspirate.program.tool.default=avrdude buspirate.program.extra_params=-P{serial.port} # STK500 firmware version v1 and v2 use different serial protocols. @@ -88,6 +99,7 @@ stk500.communication=serial stk500.protocol=stk500 stk500.program.protocol=stk500 stk500.program.tool=avrdude +stk500.program.tool.default=avrdude stk500.program.extra_params=-P{serial.port} jtag3isp.name=Atmel JTAGICE3 (ISP mode) @@ -95,6 +107,7 @@ jtag3isp.communication=usb jtag3isp.protocol=jtag3isp jtag3isp.program.protocol=jtag3isp jtag3isp.program.tool=avrdude +jtag3isp.program.tool.default=avrdude jtag3isp.program.extra_params= jtag3.name=Atmel JTAGICE3 (JTAG mode) @@ -102,6 +115,7 @@ jtag3.communication=usb jtag3.protocol=jtag3 jtag3.program.protocol=jtag3 jtag3.program.tool=avrdude +jtag3.program.tool.default=avrdude # Set a bitclock of 0.1us (the fastest supported value). This should # work regardless of the crystal used, since JTAG doesn't use the MCU # clock but dictates its own clock. @@ -112,4 +126,5 @@ atmel_ice.communication=usb atmel_ice.protocol=atmelice_isp atmel_ice.program.protocol=atmelice_isp atmel_ice.program.tool=avrdude +atmel_ice.program.tool.default=avrdude atmel_ice.program.extra_params=-Pusb -- cgit v1.2.3-18-g5258 From 65e63bf378488dabf79e377debd4b0fa05fb3316 Mon Sep 17 00:00:00 2001 From: Bernhard Nebel Date: Mon, 18 Oct 2021 16:07:40 +0200 Subject: Inserted cast to unsigned int in available method in order to avoid call to __divmodhi4 --- libraries/SoftwareSerial/src/SoftwareSerial.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libraries/SoftwareSerial/src/SoftwareSerial.cpp b/libraries/SoftwareSerial/src/SoftwareSerial.cpp index 3163d7a..5a387ab 100644 --- a/libraries/SoftwareSerial/src/SoftwareSerial.cpp +++ b/libraries/SoftwareSerial/src/SoftwareSerial.cpp @@ -409,7 +409,7 @@ int SoftwareSerial::available() if (!isListening()) return 0; - return (_receive_buffer_tail + _SS_MAX_RX_BUFF - _receive_buffer_head) % _SS_MAX_RX_BUFF; + return ((unsigned int)(_receive_buffer_tail + _SS_MAX_RX_BUFF - _receive_buffer_head)) % _SS_MAX_RX_BUFF; } size_t SoftwareSerial::write(uint8_t b) -- cgit v1.2.3-18-g5258 From 514d5042883f608a93d53a80b7fae639e9740930 Mon Sep 17 00:00:00 2001 From: Martino Facchin Date: Tue, 23 Nov 2021 11:55:15 +0100 Subject: Add Uno mini board --- boards.txt | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/boards.txt b/boards.txt index c364d0d..fbe3baf 100644 --- a/boards.txt +++ b/boards.txt @@ -1271,3 +1271,38 @@ unowifi.build.core=arduino unowifi.build.variant=standard unowifi.build.esp_ch_uart_br=19200 unowifi.build.extra_flags=-DESP_CH_UART -DESP_CH_UART_BR={build.esp_ch_uart_br} + +############################################################## + +unomini.name=Arduino Uno Mini + +unomini.vid.0=0x2341 +unomini.pid.0=0x0062 +unomini.upload_port.0.vid=0x2341 +unomini.upload_port.0.pid=0x0062 +unomini.upload_port.4.board=unomini + +unomini.upload.tool=avrdude +unomini.upload.tool.default=avrdude +unomini.upload.tool.network=arduino_ota +unomini.upload.protocol=arduino +unomini.upload.maximum_size=32256 +unomini.upload.maximum_data_size=2048 +unomini.upload.speed=115200 + +unomini.bootloader.tool=avrdude +unomini.bootloader.tool.default=avrdude +unomini.bootloader.low_fuses=0xFF +unomini.bootloader.high_fuses=0xDE +unomini.bootloader.extended_fuses=0xFD +unomini.bootloader.unlock_bits=0x3F +unomini.bootloader.lock_bits=0x0F +unomini.bootloader.file=optiboot/optiboot_atmega328.hex + +unomini.build.mcu=atmega328p +unomini.build.f_cpu=16000000L +unomini.build.board=AVR_UNO +unomini.build.core=arduino +unomini.build.variant=standard + +############################################################## -- cgit v1.2.3-18-g5258 From a1c76c0651192587f495d88b419553edd12a4881 Mon Sep 17 00:00:00 2001 From: Martino Facchin Date: Tue, 23 Nov 2021 11:55:29 +0100 Subject: Release 1.8.4 --- platform.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/platform.txt b/platform.txt index dac8a20..9fbc7bb 100644 --- a/platform.txt +++ b/platform.txt @@ -6,7 +6,7 @@ # https://arduino.github.io/arduino-cli/latest/platform-specification/ name=Arduino AVR Boards -version=1.8.3 +version=1.8.4 # AVR compile variables # --------------------- -- cgit v1.2.3-18-g5258 From 2973950c96b2448bad7e997e2612b81e0e6afcdd Mon Sep 17 00:00:00 2001 From: David Madison Date: Tue, 22 Feb 2022 02:17:28 -0500 Subject: Add XInput to Circuit Playground name Missed this one back in the day. Also added "32u4" to make a more obvious distinction in the IDE between the modern SAMD Circuit Playground board. --- boards.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/boards.txt b/boards.txt index 748a0ea..79fd6f6 100644 --- a/boards.txt +++ b/boards.txt @@ -409,7 +409,7 @@ robotMotor.build.extra_flags={build.usb_flags} ############################################################## # Adafruit Circuit Playground 32u4 w/Caterina Configuration w/ XInput -circuitplay32u4cat.name=Adafruit Circuit Playground +circuitplay32u4cat.name=Adafruit Circuit Playground 32u4 w/ XInput circuitplay32u4cat.bootloader.low_fuses=0xff circuitplay32u4cat.bootloader.high_fuses=0xd8 circuitplay32u4cat.bootloader.extended_fuses=0xcb -- cgit v1.2.3-18-g5258 From 1a8e35ac5f0af7805a2f2d02c17a3cdda908b530 Mon Sep 17 00:00:00 2001 From: David Madison Date: Tue, 22 Feb 2022 02:18:11 -0500 Subject: Remove Arduino CI actions Don't need these for the fork --- .github/dependabot.yml | 10 -- .github/workflows/check-arduino.yml | 27 ---- .github/workflows/compile-platform-examples.yml | 206 ------------------------ .github/workflows/report-size-deltas.yml | 24 --- .github/workflows/spell-check.yml | 22 --- 5 files changed, 289 deletions(-) delete mode 100644 .github/dependabot.yml delete mode 100644 .github/workflows/check-arduino.yml delete mode 100644 .github/workflows/compile-platform-examples.yml delete mode 100644 .github/workflows/report-size-deltas.yml delete mode 100644 .github/workflows/spell-check.yml diff --git a/.github/dependabot.yml b/.github/dependabot.yml deleted file mode 100644 index 03600dd..0000000 --- a/.github/dependabot.yml +++ /dev/null @@ -1,10 +0,0 @@ -# See: https://docs.github.com/en/github/administering-a-repository/configuration-options-for-dependency-updates#about-the-dependabotyml-file -version: 2 - -updates: - # Configure check for outdated GitHub Actions actions in workflows. - # See: https://docs.github.com/en/github/administering-a-repository/keeping-your-actions-up-to-date-with-dependabot - - package-ecosystem: github-actions - directory: / # Check the repository's workflows under /.github/workflows/ - schedule: - interval: daily diff --git a/.github/workflows/check-arduino.yml b/.github/workflows/check-arduino.yml deleted file mode 100644 index cfffb75..0000000 --- a/.github/workflows/check-arduino.yml +++ /dev/null @@ -1,27 +0,0 @@ -name: Check Arduino - -# See: https://docs.github.com/en/free-pro-team@latest/actions/reference/events-that-trigger-workflows -on: - push: - pull_request: - schedule: - # Run every Tuesday at 8 AM UTC to catch breakage caused by new rules added to Arduino Lint. - - cron: "0 8 * * TUE" - workflow_dispatch: - repository_dispatch: - -jobs: - lint: - runs-on: ubuntu-latest - - steps: - - name: Checkout repository - uses: actions/checkout@v2 - - - name: Arduino Lint - uses: arduino/arduino-lint-action@v1 - with: - compliance: specification - # Always use this setting for official repositories. Remove for 3rd party projects. - official: true - project-type: platform diff --git a/.github/workflows/compile-platform-examples.yml b/.github/workflows/compile-platform-examples.yml deleted file mode 100644 index 8e8f5b5..0000000 --- a/.github/workflows/compile-platform-examples.yml +++ /dev/null @@ -1,206 +0,0 @@ -name: Compile Examples - -# See: https://docs.github.com/en/actions/reference/events-that-trigger-workflows -on: - push: - paths: - - ".github/workflows/compile-platform-examples.ya?ml" - - "cores/**" - - "libraries/**" - - "variants/**" - - "boards.txt" - - "platform.txt" - pull_request: - paths: - - ".github/workflows/compile-platform-examples.ya?ml" - - "cores/**" - - "libraries/**" - - "variants/**" - - "boards.txt" - - "platform.txt" - workflow_dispatch: - repository_dispatch: - -jobs: - build: - name: ${{ matrix.board.fqbn }} - runs-on: ubuntu-latest - - env: - SKETCHES_REPORTS_PATH: sketches-reports - - strategy: - fail-fast: false - - matrix: - board: - - fqbn: arduino:avr:yun - serial: true - softwareserial: true - - fqbn: arduino:avr:uno - serial: true - softwareserial: true - - fqbn: arduino:avr:diecimila:cpu=atmega328 - serial: true - softwareserial: true - - fqbn: arduino:avr:diecimila:cpu=atmega168 - serial: true - softwareserial: true - - fqbn: arduino:avr:nano:cpu=atmega328 - serial: true - softwareserial: true - - fqbn: arduino:avr:nano:cpu=atmega328old - serial: true - softwareserial: true - - fqbn: arduino:avr:nano:cpu=atmega168 - serial: true - softwareserial: true - - fqbn: arduino:avr:mega:cpu=atmega2560 - serial: true - softwareserial: true - - fqbn: arduino:avr:mega:cpu=atmega1280 - serial: true - softwareserial: true - - fqbn: arduino:avr:megaADK - serial: true - softwareserial: true - - fqbn: arduino:avr:leonardo - serial: true - softwareserial: true - - fqbn: arduino:avr:leonardoeth - serial: true - softwareserial: true - - fqbn: arduino:avr:micro - serial: true - softwareserial: true - - fqbn: arduino:avr:esplora - serial: true - softwareserial: true - - fqbn: arduino:avr:mini:cpu=atmega328 - serial: true - softwareserial: true - - fqbn: arduino:avr:mini:cpu=atmega168 - serial: true - softwareserial: true - - fqbn: arduino:avr:ethernet - serial: true - softwareserial: true - - fqbn: arduino:avr:fio - serial: true - softwareserial: true - - fqbn: arduino:avr:bt:cpu=atmega328 - serial: true - softwareserial: true - - fqbn: arduino:avr:bt:cpu=atmega168 - serial: true - softwareserial: true - - fqbn: arduino:avr:LilyPadUSB - serial: true - softwareserial: true - - fqbn: arduino:avr:lilypad:cpu=atmega328 - serial: true - softwareserial: true - - fqbn: arduino:avr:lilypad:cpu=atmega168 - serial: true - softwareserial: true - - fqbn: arduino:avr:pro:cpu=16MHzatmega328 - serial: true - softwareserial: true - - fqbn: arduino:avr:pro:cpu=8MHzatmega328 - serial: true - softwareserial: true - - fqbn: arduino:avr:pro:cpu=16MHzatmega168 - serial: true - softwareserial: true - - fqbn: arduino:avr:pro:cpu=8MHzatmega168 - serial: true - softwareserial: true - - fqbn: arduino:avr:atmegang:cpu=atmega168 - serial: true - softwareserial: true - - fqbn: arduino:avr:atmegang:cpu=atmega8 - serial: true - softwareserial: false - - fqbn: arduino:avr:robotControl - serial: true - softwareserial: false - - fqbn: arduino:avr:robotMotor - serial: true - softwareserial: false - - fqbn: arduino:avr:gemma - serial: false - softwareserial: false - - fqbn: arduino:avr:circuitplay32u4cat - serial: true - softwareserial: true - - fqbn: arduino:avr:yunmini - serial: true - softwareserial: true - - fqbn: arduino:avr:chiwawa - serial: true - softwareserial: true - - fqbn: arduino:avr:one - serial: true - softwareserial: true - - fqbn: arduino:avr:unowifi - serial: true - softwareserial: true - - # Make board type-specific customizations to the matrix jobs - include: - - board: - # Boards with Serial interface - serial: true - # Compile these sketches in addition to the ones compiled for all boards - serial-sketch-paths: | - - libraries/EEPROM/examples/eeprom_crc - - libraries/EEPROM/examples/eeprom_get - - libraries/EEPROM/examples/eeprom_put - - libraries/EEPROM/examples/eeprom_read - - libraries/SPI - - libraries/Wire - - board: - serial: false - serial-sketch-paths: "" - - board: - # Boards compatible with the SoftwareSerial library - softwareserial: true - softwareserial-sketch-paths: | - - libraries/SoftwareSerial - - board: - softwareserial: false - softwareserial-sketch-paths: "" - - steps: - - name: Checkout repository - uses: actions/checkout@v2 - - - name: Compile examples - uses: arduino/compile-sketches@v1 - with: - github-token: ${{ secrets.GITHUB_TOKEN }} - fqbn: ${{ matrix.board.fqbn }} - platforms: | - # Use Boards Manager to install the latest release of the platform to get the toolchain. - - name: arduino:avr - # Overwrite the Boards Manager installation with the platform from the repository. - - source-path: ./ - name: arduino:avr - sketch-paths: | - # Compile these sketches for all boards - - libraries/EEPROM/examples/eeprom_clear - - libraries/EEPROM/examples/eeprom_iteration - - libraries/EEPROM/examples/eeprom_update - - libraries/EEPROM/examples/eeprom_write - # Board-specific sketches - ${{ matrix.serial-sketch-paths }} - ${{ matrix.softwareserial-sketch-paths }} - enable-deltas-report: true - sketches-report-path: ${{ env.SKETCHES_REPORTS_PATH }} - - - name: Save sketches report as workflow artifact - uses: actions/upload-artifact@v2 - with: - if-no-files-found: error - path: ${{ env.SKETCHES_REPORTS_PATH }} - name: ${{ env.SKETCHES_REPORTS_PATH }} diff --git a/.github/workflows/report-size-deltas.yml b/.github/workflows/report-size-deltas.yml deleted file mode 100644 index 652be5d..0000000 --- a/.github/workflows/report-size-deltas.yml +++ /dev/null @@ -1,24 +0,0 @@ -name: Report Size Deltas - -# See: https://docs.github.com/en/free-pro-team@latest/actions/reference/events-that-trigger-workflows -on: - push: - paths: - - ".github/workflows/report-size-deltas.yml" - schedule: - # Run at the minimum interval allowed by GitHub Actions. - # Note: GitHub Actions periodically has outages which result in workflow failures. - # In this event, the workflows will start passing again once the service recovers. - - cron: "*/5 * * * *" - workflow_dispatch: - repository_dispatch: - -jobs: - report: - runs-on: ubuntu-latest - steps: - - name: Comment size deltas reports to PRs - uses: arduino/report-size-deltas@v1 - with: - # The name of the workflow artifact created by the sketch compilation workflow - sketches-reports-source: sketches-reports diff --git a/.github/workflows/spell-check.yml b/.github/workflows/spell-check.yml deleted file mode 100644 index 01bee87..0000000 --- a/.github/workflows/spell-check.yml +++ /dev/null @@ -1,22 +0,0 @@ -name: Spell Check - -# See: https://docs.github.com/en/free-pro-team@latest/actions/reference/events-that-trigger-workflows -on: - push: - pull_request: - schedule: - # Run every Tuesday at 8 AM UTC to catch new misspelling detections resulting from dictionary updates. - - cron: "0 8 * * TUE" - workflow_dispatch: - repository_dispatch: - -jobs: - spellcheck: - runs-on: ubuntu-latest - - steps: - - name: Checkout repository - uses: actions/checkout@v2 - - - name: Spell check - uses: codespell-project/actions-codespell@master -- cgit v1.2.3-18-g5258 From fc9adfcf8e6839a3ef3d1242131dc41875fa2deb Mon Sep 17 00:00:00 2001 From: David Madison Date: Tue, 22 Feb 2022 02:27:08 -0500 Subject: Update Arduino CI version to 1.8.19 --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a5f6455..9707eca 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -3,7 +3,7 @@ name: build on: [push, pull_request, workflow_dispatch] env: - IDE_VERSION: 1.8.13 + IDE_VERSION: 1.8.19 IDE_LOCATION: /usr/local/share/arduino jobs: -- cgit v1.2.3-18-g5258 From 6f5881438af5b416fe83b0721a51215b9833498c Mon Sep 17 00:00:00 2001 From: David Madison Date: Tue, 22 Feb 2022 02:31:44 -0500 Subject: Add double reset note back into README After more testing, boards do more reliably update with the "double tap reset" than with a single press. [skip ci] --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 81d39d0..1be62e6 100644 --- a/README.md +++ b/README.md @@ -47,7 +47,7 @@ Lastly, you need to know where the 'reset' button is on your Arduino. If your bo To upload to the board: * Press the 'Upload' button in the IDE * Wait until the status bar says "Uploading..." -* Press the reset button +* Press the reset button twice, quickly If you timed it properly, the board should reset to the bootloader and the upload should begin. AVRDUDE will do its thing and you should see `avrdude done. Thank you.` near the bottom of the output window. -- cgit v1.2.3-18-g5258