From 62e113f6e4579ed90f9f50a59b920277e8d015e4 Mon Sep 17 00:00:00 2001 From: ladyada Date: Thu, 24 Oct 2019 22:59:49 -0400 Subject: [PATCH 1/5] add power switch pin --- variants/circuitplayground_nrf52840/variant.cpp | 3 ++- variants/circuitplayground_nrf52840/variant.h | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/variants/circuitplayground_nrf52840/variant.cpp b/variants/circuitplayground_nrf52840/variant.cpp index fbb44b02..a29f722e 100644 --- a/variants/circuitplayground_nrf52840/variant.cpp +++ b/variants/circuitplayground_nrf52840/variant.cpp @@ -69,7 +69,8 @@ const uint32_t g_ADigitalPinMap[] = 32, // D33 is P1.00 (QSPI Data 2) 22, // D34 is P0.22 (QSPI Data 3) - + // D35 power switch + 6, // D36 is P0.06 (NeoPixel / Sensor switch) }; void initVariant() diff --git a/variants/circuitplayground_nrf52840/variant.h b/variants/circuitplayground_nrf52840/variant.h index c7fdd8cc..eaabe332 100644 --- a/variants/circuitplayground_nrf52840/variant.h +++ b/variants/circuitplayground_nrf52840/variant.h @@ -37,8 +37,8 @@ extern "C" #endif // __cplusplus // Number of pins defined in PinDescription array -#define PINS_COUNT (35) -#define NUM_DIGITAL_PINS (35) +#define PINS_COUNT (36) +#define NUM_DIGITAL_PINS (36) #define NUM_ANALOG_INPUTS (8) #define NUM_ANALOG_OUTPUTS (0) From 8ac887ed01509db4041730c72700660e54f1ce22 Mon Sep 17 00:00:00 2001 From: ladyada Date: Wed, 30 Oct 2019 02:43:03 -0400 Subject: [PATCH 2/5] make min/max templates @hathach --- cores/nRF5/Arduino.h | 29 +++++++++++++++++++++++++++-- 1 file changed, 27 insertions(+), 2 deletions(-) diff --git a/cores/nRF5/Arduino.h b/cores/nRF5/Arduino.h index 420c000f..5497dbbd 100644 --- a/cores/nRF5/Arduino.h +++ b/cores/nRF5/Arduino.h @@ -85,8 +85,33 @@ void suspendLoop(void); #undef abs #endif // abs -#define min(a,b) ((a)<(b)?(a):(b)) -#define max(a,b) ((a)>(b)?(a):(b)) +#ifdef __cplusplus + template + auto min(const T& a, const L& b) -> decltype((b < a) ? b : a) + { + return (b < a) ? b : a; + } + + template + auto max(const T& a, const L& b) -> decltype((b < a) ? b : a) + { + return (a < b) ? b : a; + } +#else +#ifndef min +#define min(a,b) \ + ({ __typeof__ (a) _a = (a); \ + __typeof__ (b) _b = (b); \ + _a < _b ? _a : _b; }) +#endif +#ifndef max +#define max(a,b) \ + ({ __typeof__ (a) _a = (a); \ + __typeof__ (b) _b = (b); \ + _a > _b ? _a : _b; }) +#endif +#endif + #define abs(x) ((x)>0?(x):-(x)) #define constrain(amt,low,high) ((amt)<(low)?(low):((amt)>(high)?(high):(amt))) #define round(x) ((x)>=0?(long)((x)+0.5):(long)((x)-0.5)) From dc8b43f2b7405ce1579cd06c298ddcf9cb47d9e8 Mon Sep 17 00:00:00 2001 From: hathach Date: Wed, 30 Oct 2019 16:02:26 +0700 Subject: [PATCH 3/5] increase version for release, update changelog --- changelog.md | 5 +++++ libraries/Bluefruit52Lib/library.properties | 2 +- platform.txt | 2 +- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/changelog.md b/changelog.md index f8abe4f9..52e2a7df 100644 --- a/changelog.md +++ b/changelog.md @@ -1,5 +1,10 @@ # Adafruit nRF52 Arduino Core Changelog +## 0.14.6 - 2019.10.30 + +- Added power switch pin for Circuit Playground Bluefruit +- Make min/max templates + ## 0.14.5 - 2019.10.21 - Added Itsy nRF52840 Express support diff --git a/libraries/Bluefruit52Lib/library.properties b/libraries/Bluefruit52Lib/library.properties index f0c63763..b25ecee1 100644 --- a/libraries/Bluefruit52Lib/library.properties +++ b/libraries/Bluefruit52Lib/library.properties @@ -1,5 +1,5 @@ name=Adafruit Bluefruit nRF52 Libraries -version=0.14.5 +version=0.14.6 author=Adafruit maintainer=Adafruit sentence=Arduino library for nRF52-based Adafruit Bluefruit LE modules diff --git a/platform.txt b/platform.txt index e9ff11d8..a34a5afd 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.14.5 +version=0.14.6 # Compile variables # ----------------- From bc042c0c3424f938c1747390e74b755a36edf12b Mon Sep 17 00:00:00 2001 From: Henry Gabryjelski Date: Mon, 4 Nov 2019 09:20:44 -0800 Subject: [PATCH 4/5] Record ISR entry/exit, when added via AttachInterrupt(). This only affects debug level 3 (Segger SysView) builds. --- cores/nRF5/WInterrupts.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/cores/nRF5/WInterrupts.c b/cores/nRF5/WInterrupts.c index 9f698852..dce18ca7 100644 --- a/cores/nRF5/WInterrupts.c +++ b/cores/nRF5/WInterrupts.c @@ -144,6 +144,10 @@ void detachInterrupt(uint32_t pin) void GPIOTE_IRQHandler() { +#if CFG_DEBUG >= 3 + SEGGER_SYSVIEW_RecordEnterISR(); +#endif + uint32_t event = offsetof(NRF_GPIOTE_Type, EVENTS_IN[0]); for (int ch = 0; ch < NUMBER_OF_GPIO_TE; ch++) { @@ -166,4 +170,8 @@ void GPIOTE_IRQHandler() event = (uint32_t)((uint32_t)event + 4); } + +#if CFG_DEBUG >= 3 + SEGGER_SYSVIEW_RecordExitISR(); +#endif } From 0417d8e3e1cbc7c0dc920e1101fa463d86d9ed60 Mon Sep 17 00:00:00 2001 From: Henry Gabryjelski Date: Mon, 4 Nov 2019 12:07:53 -0800 Subject: [PATCH 5/5] Split TravisCI build into one job per variant This change allows TravisCI integration for forks on free accounts. Those would otherwise fail, due to a hard-coded and non-configurable 50 minute job limt imposed by TravisCI. This will also help avoid the 120 minute job limit that applies to non-free accounts, which the current builds are quickly approaching.... --- .travis.yml | 10 ++++++++-- tools/build_all.py | 19 +++++++++++++++++-- 2 files changed, 25 insertions(+), 4 deletions(-) diff --git a/.travis.yml b/.travis.yml index a3fc8a0a..529a4e46 100644 --- a/.travis.yml +++ b/.travis.yml @@ -5,8 +5,14 @@ git: quiet: true env: - - BSP_PATH="$HOME/.arduino15/packages/adafruit/hardware/nrf52" - + global: + - BSP_PATH="$HOME/.arduino15/packages/adafruit/hardware/nrf52" + jobs: + # Split into one job per board (aka variant) + - VARIANT="feather52840" + - VARIANT="cplaynrf52840" + - VARIANT="feather52832" + addons: apt: packages: diff --git a/tools/build_all.py b/tools/build_all.py index 76689772..f0d01f57 100644 --- a/tools/build_all.py +++ b/tools/build_all.py @@ -65,8 +65,23 @@ def build_examples(variant): build_time = time.monotonic() -for var in variants_dict: - build_examples(var) +ENV_VARIABLE_NAME = 'VARIANT' + +# build only one variant if the environment variable is specified +if (ENV_VARIABLE_NAME in os.environ): + variant = os.environ.get(ENV_VARIABLE_NAME) + # only use the environment variable if the variant exists in the dictionary + if (variant in variants_dict): + build_examples(variant) + else: + print('\033[31failed\033[0m - invalid variant name "{}"'.format(variant)) + fail_count += 1 + exit_status = -1 + +else: # no environment variable specified, so build all variants + for var in variants_dict: + build_examples(var) + print(build_separator) build_time = time.monotonic() - build_time