From ce81b830a13a28f0e80e31721911a0ea63fc1edf Mon Sep 17 00:00:00 2001 From: hathach Date: Mon, 31 Aug 2020 16:49:09 +0700 Subject: [PATCH] ready for release 0.21.0 --- changelog.md | 23 ++++++- cores/nRF5/HardwarePWM.cpp | 60 ++++++++----------- cores/nRF5/Tone.cpp | 2 + cores/nRF5/wiring_analog.cpp | 59 ++++++++---------- .../tone_happy_birthday.ino | 2 +- libraries/Bluefruit52Lib/library.properties | 2 +- libraries/Servo/src/nrf52/Servo.cpp | 3 + platform.txt | 2 +- 8 files changed, 78 insertions(+), 75 deletions(-) diff --git a/changelog.md b/changelog.md index e4fcfef15..56d8a6c18 100644 --- a/changelog.md +++ b/changelog.md @@ -1,7 +1,28 @@ # Adafruit nRF52 Arduino Core Changelog +## 0.21.0 - 2020.08.31 + +Special thanks to @henrygab, @pyro9, @Nenik, @orrmany, @thaanstad, @kevinfrei for contributing and helping with this release. + +- Reworked HardwarePWM, analogWrite, Servo, Tone to address PWM hardware conflict with ownership. +- Reworked Tone to use no interrupt handler +- Added multiprotocol support such as ANT with additional ANT_LICENSE_KEY (require 3rd party library) +- Fixed pgm_read_ptr(addr) macro +- Updated & enhanced TinyUSB performance, usb event, task switching is much faster +- Fixed BLE Characteristic discovery when the central device returns more than 4 Characteristics in a discovery request +- Enhanced micro() to use DWT cyclecount if enabled for higher precision +- Fixed miscalculated tick when sleeping with delay() +- Fixed FPU-caused power consumption issue +- Added Wire.setPins() +- Added resumeLoop() +- Renamed I2C terminology +- Support precompiled library with compiler.libraries.ldflags e.g BSEC BME680 +- Added Hardware/tone_happy_birthday example sketch + ## 0.20.5 - 2020.07.05 +Special thanks to @henrygab, @pyro9, @geeksville for contributing and helping with this release. + - Updated toolchain from gcc 7-2017q4 to 9-2019q4 - Fixed GPIOTE channel conflict between libraries - Added type-safe for arrcount() macros @@ -9,8 +30,6 @@ - Update CMSIS from v4 to v5 to build with TensorFlow - Update TinyUSB core to commit 0749077 -Special thanks to @henrygab, @pyro9, @geeksville for contributing and helping with this release. - ## 0.20.1 - 2020.04.23 - Update TinyUSB to commit c59fa77 due to a bug in the stack diff --git a/cores/nRF5/HardwarePWM.cpp b/cores/nRF5/HardwarePWM.cpp index 17768ad09..441c3fcb7 100644 --- a/cores/nRF5/HardwarePWM.cpp +++ b/cores/nRF5/HardwarePWM.cpp @@ -1,38 +1,28 @@ -/**************************************************************************/ -/*! - @file HardwarePWM.cpp - @author hathach (tinyusb.org) - - @section LICENSE - - Software License Agreement (BSD License) - - Copyright (c) 2018, Adafruit Industries (adafruit.com) - All rights reserved. - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - 1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - 2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - 3. Neither the name of the copyright holders nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ''AS IS'' AND ANY - EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY - DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ -/**************************************************************************/ +/* + * The MIT License (MIT) + * + * Copyright (c) 2020 Ha Thach for Adafruit Industries + * Copyright (c) 2020 Henry Gabryjelski + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + #include "Arduino.h" #include "HardwarePWM.h" diff --git a/cores/nRF5/Tone.cpp b/cores/nRF5/Tone.cpp index 9a15fb0fb..4f52d31f6 100644 --- a/cores/nRF5/Tone.cpp +++ b/cores/nRF5/Tone.cpp @@ -32,6 +32,8 @@ Version Modified By Date Comments 0008 S Kanemoto 12/06/22 Fixed for Leonardo by @maris_HY 0009 Arduino.org 15/06/30 Add M0/M0 Pro support 0010 Arduino.org 16/07/27 Added Arduino Primo support +0011 Henry Gabryjelski 20/08/25 Rework/Rewrite the library to use no interrupt handler and + support HwPWM ownership *************************************************/ #include "Arduino.h" diff --git a/cores/nRF5/wiring_analog.cpp b/cores/nRF5/wiring_analog.cpp index 38fefdf15..79131a7e7 100644 --- a/cores/nRF5/wiring_analog.cpp +++ b/cores/nRF5/wiring_analog.cpp @@ -1,38 +1,27 @@ -/**************************************************************************/ -/*! - @file wiring_analog.cpp - @author hathach (tinyusb.org) - - @section LICENSE - - Software License Agreement (BSD License) - - Copyright (c) 2018, Adafruit Industries (adafruit.com) - All rights reserved. - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - 1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - 2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - 3. Neither the name of the copyright holders nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ''AS IS'' AND ANY - EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY - DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ -/**************************************************************************/ +/* + * The MIT License (MIT) + * + * Copyright (c) 2020 Ha Thach for Adafruit Industries + * Copyright (c) 2020 Henry Gabryjelski + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ #include "Arduino.h" diff --git a/libraries/Bluefruit52Lib/examples/Hardware/tone_happy_birthday/tone_happy_birthday.ino b/libraries/Bluefruit52Lib/examples/Hardware/tone_happy_birthday/tone_happy_birthday.ino index db4656e32..7500d1c7c 100644 --- a/libraries/Bluefruit52Lib/examples/Hardware/tone_happy_birthday/tone_happy_birthday.ino +++ b/libraries/Bluefruit52Lib/examples/Hardware/tone_happy_birthday/tone_happy_birthday.ino @@ -19,7 +19,7 @@ // PIN_BUZZER should be defined by the supported variant e.g CPlay Bluefruit or CLUE. // Otherwise please define the pin you would like to use for tone output #ifndef PIN_BUZZER -#define PIN_BUZZER 5 +#define PIN_BUZZER A0 #endif diff --git a/libraries/Bluefruit52Lib/library.properties b/libraries/Bluefruit52Lib/library.properties index bace46318..abdaacd4a 100644 --- a/libraries/Bluefruit52Lib/library.properties +++ b/libraries/Bluefruit52Lib/library.properties @@ -1,5 +1,5 @@ name=Adafruit Bluefruit nRF52 Libraries -version=0.20.5 +version=0.21.0 author=Adafruit maintainer=Adafruit sentence=Arduino library for nRF52-based Adafruit Bluefruit LE modules diff --git a/libraries/Servo/src/nrf52/Servo.cpp b/libraries/Servo/src/nrf52/Servo.cpp index e83b97cb2..4103c43f4 100644 --- a/libraries/Servo/src/nrf52/Servo.cpp +++ b/libraries/Servo/src/nrf52/Servo.cpp @@ -14,6 +14,9 @@ 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 + + Modified by Ha Thach for Adafruit Industries + Modified by Henry Gabryjelski to add ownershp support */ #if defined(ARDUINO_ARCH_NRF52) || defined(ARDUINO_NRF52_ADAFRUIT) diff --git a/platform.txt b/platform.txt index 1e6ea7c1f..a5a457e65 100644 --- a/platform.txt +++ b/platform.txt @@ -17,7 +17,7 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA name=Adafruit nRF52 Boards -version=0.20.5 +version=0.21.0 # Compile variables # -----------------