Skip to content

Commit 1e0cee1

Browse files
committed
Merge branch 'master' into tinyusb-refactor
2 parents 99f5348 + 79da608 commit 1e0cee1

File tree

9 files changed

+96
-27
lines changed

9 files changed

+96
-27
lines changed

.github/ISSUE_TEMPLATE/bug_report.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
name: Bug report
33
about: Create a report to help us improve
4-
title: "[Bug]"
4+
title: ''
55
labels: Bug
66
assignees: ''
77

.github/ISSUE_TEMPLATE/feature_request.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
name: Feature request
33
about: Suggest an idea for this project
4-
title: "[Feature]"
4+
title: ''
55
labels: Feature
66
assignees: ''
77

.github/ISSUE_TEMPLATE/questions-please-use-our-forum-support.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
name: Questions please use our forum support
33
about: Don't open issue, post your question at forums.adafruit.com
44
title: ''
5-
labels: ''
5+
labels: wontfix
66
assignees: ''
77

88
---

.travis.yml

Lines changed: 27 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
sudo: required
12
language: c
23
dist: xenial
34
git:
@@ -8,10 +9,28 @@ env:
89
global:
910
- BSP_PATH="$HOME/.arduino15/packages/adafruit/hardware/nrf52"
1011
jobs:
11-
# Split into one job per board (aka variant)
12-
- VARIANT="feather52840"
13-
- VARIANT="cplaynrf52840"
14-
- VARIANT="feather52832"
12+
# empty env required, else allow_failures will SILENTY IGNORE matching against env...
13+
-
14+
15+
jobs:
16+
fast_finish: true
17+
include:
18+
- name: "Feather 52840"
19+
env: VARIANT="feather52840"
20+
- name: "Feather 52840 (All warnings)"
21+
env: ALL_WARNINGS="true" VARIANT="feather52840"
22+
- name: "Circuit Playground 52840"
23+
env: VARIANT="cplaynrf52840"
24+
- name: "Circuit Playground 52840 (All warnings)"
25+
env: ALL_WARNINGS="true" VARIANT="cplaynrf52840"
26+
- name: "Feather 52832"
27+
env: VARIANT="feather52832"
28+
- name: "Feather 52832 (All warnings)"
29+
env: ALL_WARNINGS="true" VARIANT="feather52832"
30+
allow_failures:
31+
- env: ALL_WARNINGS="true" VARIANT="feather52840"
32+
- env: ALL_WARNINGS="true" VARIANT="cplaynrf52840"
33+
- env: ALL_WARNINGS="true" VARIANT="feather52832"
1534

1635
addons:
1736
apt:
@@ -24,6 +43,10 @@ addons:
2443
confinement: classic
2544

2645
install:
46+
# Filter only mDNS / Bonjour traffic
47+
- sudo iptables --insert INPUT --jump DROP --protocol udp --dport 5353 -m comment --comment "silently drop all 5353/udp input"
48+
- sudo iptables --insert INPUT --jump DROP --destination 224.0.0.251 -m comment --comment "silently drop all mDNS ipv4 broadcast"
49+
# Install the nRF52 support files for arduino
2750
- pip3 install --user adafruit-nrfutil
2851
- umake electronics arduino $HOME/arduino_ide
2952
- export PATH=$HOME/arduino_ide:$PATH

libraries/Bluefruit52Lib/examples/Central/central_throughput/central_throughput.ino

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,7 @@ void disconnect_callback(uint16_t conn_handle, uint8_t reason)
133133
void bleuart_rx_callback(BLEClientUart& uart_svc)
134134
{
135135
int count = uart_svc.available();
136+
(void)count;
136137
uart_svc.flush();
137138
}
138139

libraries/Bluefruit52Lib/examples/Central/central_ti_sensortag_optical/central_ti_sensortag_optical.ino

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -167,9 +167,6 @@ void connect_callback(uint16_t conn_handle)
167167
Serial.print("Connect Callback, conn_handle: ");
168168
Serial.println( conn_handle );
169169

170-
/* Complete Local Name */
171-
uint8_t buffer[BLE_GAP_ADV_SET_DATA_SIZE_MAX] = { 0 };
172-
173170
// If Service is not found, disconnect and return
174171
Serial.print("Discovering Optical Service ... ");
175172
if ( !sensorTagOpticalService.discover(conn_handle) )

libraries/Bluefruit52Lib/examples/Peripheral/blemidi/blemidi.ino

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ BLEMidi blemidi;
2828
MIDI_CREATE_BLE_INSTANCE(blemidi);
2929

3030
// Variable that holds the current position in the sequence.
31-
int position = 0;
31+
unsigned int position = 0;
3232

3333
// Store example melody as an array of note values
3434
byte note_sequence[] = {
@@ -137,14 +137,10 @@ void loop()
137137

138138
// Setup variables for the current and previous
139139
// positions in the note sequence.
140-
int current = position;
141-
int previous = position - 1;
142-
140+
unsigned int current = position;
143141
// If we currently are at position 0, set the
144142
// previous position to the last note in the sequence.
145-
if (previous < 0) {
146-
previous = sizeof(note_sequence) - 1;
147-
}
143+
unsigned int previous = (current == 0) ? (sizeof(note_sequence)-1) : current - 1;
148144

149145
// Send Note On for current position at full velocity (127) on channel 1.
150146
MIDI.sendNoteOn(note_sequence[current], 127, 1);

libraries/Bluefruit52Lib/examples/Projects/rssi_proximity/rssi_proximity_central/rssi_proximity_central.ino

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -128,10 +128,10 @@ BLEUuid uuid = BLEUuid(CUSTOM_UUID);
128128
/* This struct is used to track detected nodes */
129129
typedef struct node_record_s
130130
{
131-
uint8_t addr[6]; // Six byte device address
132-
int8_t rssi; // RSSI value
133-
int32_t timestamp; // Timestamp for invalidation purposes
134-
int8_t reserved; // Padding for word alignment
131+
uint8_t addr[6]; // Six byte device address
132+
int8_t rssi; // RSSI value
133+
uint32_t timestamp; // Timestamp for invalidation purposes
134+
int8_t reserved; // Padding for word alignment
135135
} node_record_t;
136136

137137
node_record_t records[ARRAY_SIZE];
@@ -530,7 +530,7 @@ int invalidateRecords(void)
530530
{
531531
if (records[i].timestamp) // Ignore zero"ed records
532532
{
533-
if (records[i].timestamp <= millis() - TIMEOUT_MS)
533+
if (millis() - records[i].timestamp >= TIMEOUT_MS)
534534
{
535535
/* Record has expired, zero it out */
536536
memset(&records[i], 0, sizeof(node_record_t));

tools/build_all.py

Lines changed: 57 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,13 @@
88
if "TRAVIS" in os.environ and os.environ["TRAVIS"] == "true":
99
travis = True
1010

11+
all_warnings = False
12+
if "ALL_WARNINGS" in os.environ and os.environ["ALL_WARNINGS"] == "true":
13+
all_warnings = True
14+
15+
ENV_VARIABLE_NAME = 'VARIANT'
16+
17+
1118
exit_status = 0
1219
success_count = 0
1320
fail_count = 0
@@ -21,6 +28,25 @@
2128
'feather52832': 'Feather nRF52832'
2229
}
2330

31+
# STDERR receives output that starts with the following text, none of which should be considered a warning or error...
32+
output_to_ignore = (
33+
'Picked up JAVA_TOOL_OPTIONS:',
34+
'Loading configuration...',
35+
'Initializing packages...',
36+
'Preparing boards...',
37+
'Verifying...',
38+
)
39+
40+
def errorOutputFilter(line):
41+
if len(line) == 0:
42+
return False
43+
if line.isspace(): # Note: empty string does not match here!
44+
return False
45+
if line.startswith(output_to_ignore): # alternatively, can trim() each line, but that would create lots of short-lived strings...
46+
return False
47+
# TODO: additional items to remove?
48+
return True
49+
2450

2551
def build_examples(variant):
2652
global exit_status, success_count, fail_count, build_format, build_separator
@@ -33,18 +59,39 @@ def build_examples(variant):
3359
print(build_separator)
3460
subprocess.run("arduino --board adafruit:nrf52:{}:softdevice={},debug=l0 --save-prefs".format(variant, 's140v6' if variant != 'feather52832' else 's132v6'), shell=True,
3561
stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
62+
63+
if all_warnings:
64+
subprocess.run("arduino --pref 'compiler.warning_level=all' --save-prefs", shell=True,
65+
stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
3666

3767
for sketch in glob.iglob('libraries/**/*.ino', recursive=True):
3868
start_time = time.monotonic()
3969

4070
if os.path.exists(os.path.dirname(sketch) + '/.skip') or os.path.exists(os.path.dirname(sketch) + '/.skip.' + variant):
4171
success = "skipped"
4272
else:
43-
build_result = subprocess.run("arduino --verify {}".format(sketch), shell=True, stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
73+
# TODO - preferably, would have STDERR show up in **both** STDOUT and STDERR.
74+
# preferably, would use Python logging handler to get both distinct outputs and one merged output
75+
# for now, split STDERR when building with all warnings enabled, so can detect warning/error output.
76+
if all_warnings:
77+
build_result = subprocess.run("arduino --verify {}".format(sketch), shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
78+
else:
79+
build_result = subprocess.run("arduino --verify {}".format(sketch), shell=True, stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
80+
81+
# get stderr into a form where len(warningLines) indicates a true warning was output to stderr
82+
warningLines = [];
83+
if all_warnings and build_result.stderr:
84+
tmpWarningLines = build_result.stderr.decode("utf-8").splitlines()
85+
warningLines = list(filter(errorOutputFilter, (tmpWarningLines)))
86+
4487
if build_result.returncode != 0:
4588
exit_status = build_result.returncode
4689
success = "\033[31mfailed\033[0m "
4790
fail_count += 1
91+
elif len(warningLines) != 0:
92+
exit_status = -1
93+
success = "\033[31mwarnings\033[0m "
94+
fail_count += 1
4895
else:
4996
success = "\033[32msucceeded\033[0m"
5097
success_count += 1
@@ -56,16 +103,21 @@ def build_examples(variant):
56103

57104
print((build_format + '| {:5.2f}s |').format(sketch.split(os.path.sep)[1], os.path.basename(sketch), success, build_duration))
58105

59-
if build_result.returncode != 0:
60-
print(build_result.stdout.decode("utf-8"))
106+
if success != "skipped":
107+
if build_result.returncode != 0:
108+
print(build_result.stdout.decode("utf-8"))
109+
if (build_result.stderr):
110+
print(build_result.stderr.decode("utf-8"))
111+
if len(warningLines) != 0:
112+
for line in warningLines:
113+
print(line)
61114

62115
if travis:
63116
print('travis_fold:end:build-{}\\r'.format(sketch))
64117

65118

66119
build_time = time.monotonic()
67120

68-
ENV_VARIABLE_NAME = 'VARIANT'
69121

70122
# build only one variant if the environment variable is specified
71123
if (ENV_VARIABLE_NAME in os.environ):
@@ -74,7 +126,7 @@ def build_examples(variant):
74126
if (variant in variants_dict):
75127
build_examples(variant)
76128
else:
77-
print('\033[31failed\033[0m - invalid variant name "{}"'.format(variant))
129+
print('\033[31INTERNAL ERR\033[0m - invalid variant name "{}"'.format(variant))
78130
fail_count += 1
79131
exit_status = -1
80132

0 commit comments

Comments
 (0)