Skip to content

Commit 0bcf55c

Browse files
committed
Merge branch 'master' into develop
2 parents bbdc756 + 229997e commit 0bcf55c

File tree

9 files changed

+71
-11
lines changed

9 files changed

+71
-11
lines changed

.travis.yml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,14 @@ git:
55
quiet: true
66

77
env:
8-
- BSP_PATH="$HOME/.arduino15/packages/adafruit/hardware/nrf52"
9-
8+
global:
9+
- BSP_PATH="$HOME/.arduino15/packages/adafruit/hardware/nrf52"
10+
jobs:
11+
# Split into one job per board (aka variant)
12+
- VARIANT="feather52840"
13+
- VARIANT="cplaynrf52840"
14+
- VARIANT="feather52832"
15+
1016
addons:
1117
apt:
1218
packages:

changelog.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
# Adafruit nRF52 Arduino Core Changelog
22

3+
## 0.14.6 - 2019.10.30
4+
5+
- Added power switch pin for Circuit Playground Bluefruit
6+
- Make min/max templates
7+
38
## 0.14.5 - 2019.10.21
49

510
- Added Itsy nRF52840 Express support

cores/nRF5/Arduino.h

Lines changed: 27 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,8 +85,33 @@ void suspendLoop(void);
8585
#undef abs
8686
#endif // abs
8787

88-
#define min(a,b) ((a)<(b)?(a):(b))
89-
#define max(a,b) ((a)>(b)?(a):(b))
88+
#ifdef __cplusplus
89+
template<class T, class L>
90+
auto min(const T& a, const L& b) -> decltype((b < a) ? b : a)
91+
{
92+
return (b < a) ? b : a;
93+
}
94+
95+
template<class T, class L>
96+
auto max(const T& a, const L& b) -> decltype((b < a) ? b : a)
97+
{
98+
return (a < b) ? b : a;
99+
}
100+
#else
101+
#ifndef min
102+
#define min(a,b) \
103+
({ __typeof__ (a) _a = (a); \
104+
__typeof__ (b) _b = (b); \
105+
_a < _b ? _a : _b; })
106+
#endif
107+
#ifndef max
108+
#define max(a,b) \
109+
({ __typeof__ (a) _a = (a); \
110+
__typeof__ (b) _b = (b); \
111+
_a > _b ? _a : _b; })
112+
#endif
113+
#endif
114+
90115
#define abs(x) ((x)>0?(x):-(x))
91116
#define constrain(amt,low,high) ((amt)<(low)?(low):((amt)>(high)?(high):(amt)))
92117
#define round(x) ((x)>=0?(long)((x)+0.5):(long)((x)-0.5))

cores/nRF5/WInterrupts.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,10 @@ void detachInterrupt(uint32_t pin)
144144

145145
void GPIOTE_IRQHandler()
146146
{
147+
#if CFG_DEBUG >= 3
148+
SEGGER_SYSVIEW_RecordEnterISR();
149+
#endif
150+
147151
uint32_t event = offsetof(NRF_GPIOTE_Type, EVENTS_IN[0]);
148152

149153
for (int ch = 0; ch < NUMBER_OF_GPIO_TE; ch++) {
@@ -166,4 +170,8 @@ void GPIOTE_IRQHandler()
166170

167171
event = (uint32_t)((uint32_t)event + 4);
168172
}
173+
174+
#if CFG_DEBUG >= 3
175+
SEGGER_SYSVIEW_RecordExitISR();
176+
#endif
169177
}

libraries/Bluefruit52Lib/library.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name=Adafruit Bluefruit nRF52 Libraries
2-
version=0.14.5
2+
version=0.14.6
33
author=Adafruit
44
maintainer=Adafruit <[email protected]>
55
sentence=Arduino library for nRF52-based Adafruit Bluefruit LE modules

platform.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
1818

1919
name=Adafruit nRF52 Boards
20-
version=0.14.5
20+
version=0.14.6
2121

2222
# Compile variables
2323
# -----------------

tools/build_all.py

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,23 @@ def build_examples(variant):
6565

6666
build_time = time.monotonic()
6767

68-
for var in variants_dict:
69-
build_examples(var)
68+
ENV_VARIABLE_NAME = 'VARIANT'
69+
70+
# build only one variant if the environment variable is specified
71+
if (ENV_VARIABLE_NAME in os.environ):
72+
variant = os.environ.get(ENV_VARIABLE_NAME)
73+
# only use the environment variable if the variant exists in the dictionary
74+
if (variant in variants_dict):
75+
build_examples(variant)
76+
else:
77+
print('\033[31failed\033[0m - invalid variant name "{}"'.format(variant))
78+
fail_count += 1
79+
exit_status = -1
80+
81+
else: # no environment variable specified, so build all variants
82+
for var in variants_dict:
83+
build_examples(var)
84+
7085

7186
print(build_separator)
7287
build_time = time.monotonic() - build_time

variants/circuitplayground_nrf52840/variant.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,8 @@ const uint32_t g_ADigitalPinMap[] =
6969
32, // D33 is P1.00 (QSPI Data 2)
7070
22, // D34 is P0.22 (QSPI Data 3)
7171

72-
72+
// D35 power switch
73+
6, // D36 is P0.06 (NeoPixel / Sensor switch)
7374
};
7475

7576
void initVariant()

variants/circuitplayground_nrf52840/variant.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,8 @@ extern "C"
3737
#endif // __cplusplus
3838

3939
// Number of pins defined in PinDescription array
40-
#define PINS_COUNT (35)
41-
#define NUM_DIGITAL_PINS (35)
40+
#define PINS_COUNT (36)
41+
#define NUM_DIGITAL_PINS (36)
4242
#define NUM_ANALOG_INPUTS (8)
4343
#define NUM_ANALOG_OUTPUTS (0)
4444

0 commit comments

Comments
 (0)