Skip to content

Commit acf6baf

Browse files
committed
feat: Compile for Adafruit nRF2840 Express
1 parent 4806b57 commit acf6baf

File tree

4 files changed

+34
-29
lines changed

4 files changed

+34
-29
lines changed

.github/actions/compile-examples/Dockerfile

Lines changed: 27 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -11,42 +11,41 @@
1111
# Define global arguments
1212
ARG ARDUINO_CLI_VERSION=0.22.0
1313
ARG DEBIAN_FRONTEND="noninteractive"
14-
# ARG UID=1000
15-
# ARG USER="blues"
14+
ARG UID=1000
15+
ARG USER="blues"
1616

1717
# POSIX compatible (Linux/Unix) base image
1818
FROM debian:stable-slim
1919

2020
# Import global arguments
2121
ARG ARDUINO_CLI_VERSION
2222
ARG DEBIAN_FRONTEND
23-
# ARG UID
24-
# ARG USER
23+
ARG UID
24+
ARG USER
2525

2626
# Define local arguments
27-
# ARG ARDUINO_CLI_CHECKSUM="068f0a69ffecd5688e0b4bc02609720af57ec1aa60e5ea6a2879af3ed1dc0d9b"
2827
ARG BINDIR=/usr/local/bin
2928
ARG ECHO_BC_FILE='$bcfile'
3029

3130
# Define environment variables
3231
ENV ARDUINO_UPDATER_ENABLE_NOTIFICATION=false
3332

3433
# Create Non-Root User
35-
# RUN ["dash", "-c", "\
36-
# addgroup \
37-
# --gid ${UID} \
38-
# \"${USER}\" \
39-
# && adduser \
40-
# --disabled-password \
41-
# --gecos \"\" \
42-
# --ingroup \"${USER}\" \
43-
# --uid ${UID} \
44-
# \"${USER}\" \
45-
# && usermod \
46-
# --append \
47-
# --groups \"dialout,plugdev\" \
48-
# \"${USER}\" \
49-
# "]
34+
RUN ["dash", "-c", "\
35+
addgroup \
36+
--gid ${UID} \
37+
\"${USER}\" \
38+
&& adduser \
39+
--disabled-password \
40+
--gecos \"\" \
41+
--ingroup \"${USER}\" \
42+
--uid ${UID} \
43+
\"${USER}\" \
44+
&& usermod \
45+
--append \
46+
--groups \"dialout,plugdev\" \
47+
\"${USER}\" \
48+
"]
5049

5150
# Establish development environment
5251
RUN ["dash", "-c", "\
@@ -61,6 +60,7 @@ RUN ["dash", "-c", "\
6160
ssh \
6261
tree \
6362
&& pip install \
63+
adafruit-nrfutil \
6464
pyserial \
6565
&& apt-get clean \
6666
&& apt-get purge \
@@ -81,7 +81,7 @@ RUN ["dash", "-c", "\
8181
"]
8282

8383
# Configure Arduino CLI
84-
# USER ${USER}
84+
USER ${USER}
8585
RUN ["dash", "-c", "\
8686
arduino-cli config init \
8787
&& arduino-cli config add board_manager.additional_urls \
@@ -91,20 +91,21 @@ RUN ["dash", "-c", "\
9191
https://raw.githubusercontent.com/adafruit/arduino-board-index/gh-pages/package_adafruit_index.json \
9292
https://github.com/earlephilhower/arduino-pico/releases/download/global/package_rp2040_index.json \
9393
&& arduino-cli core update-index \
94+
&& arduino-cli core install adafruit:nrf52 \
95+
&& arduino-cli core install adafruit:samd \
9496
&& arduino-cli core install arduino:avr \
9597
&& arduino-cli core install arduino:mbed_nano \
9698
&& arduino-cli core install arduino:samd \
97-
&& arduino-cli core install STMicroelectronics:stm32 \
9899
&& arduino-cli core install esp32:esp32 \
99-
&& arduino-cli core install SparkFun:apollo3 \
100-
&& arduino-cli core install adafruit:nrf52 \
101-
&& arduino-cli core install adafruit:samd \
102100
&& arduino-cli core install rp2040:rp2040 \
101+
&& arduino-cli core install SparkFun:apollo3 \
102+
&& arduino-cli core install STMicroelectronics:stm32 \
103103
&& arduino-cli lib install \"Adafruit BME680 Library\" \
104104
"]
105105

106106
# Set Execution Environment
107-
# WORKDIR /host-volume
107+
USER root
108+
WORKDIR /host-volume
108109

109110
ENTRYPOINT ["arduino-cli"]
110111

.github/actions/compile-examples/action.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ runs:
77
entrypoint: 'bash'
88
args:
99
- -c
10-
- "cp -r . /root/Arduino/libraries/Blues_Wireless_Notecard \
11-
&& HOME=/root arduino-cli compile \
10+
- "cp -r . /home/blues/Arduino/libraries/Blues_Wireless_Notecard \
11+
&& HOME=/home/blues arduino-cli compile \
1212
--build-property compiler.cpp.extra_flags='-Wno-unused-parameter -Werror' \
1313
--fqbn ${{ inputs.fully-qualified-board-name }} \
1414
--warnings all \

.github/workflows/note-arduino-ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ jobs:
4848
- arduino:mbed_nano:nano33ble
4949
- SparkFun:apollo3:sfe_artemis_thing_plus
5050
- STMicroelectronics:stm32:Nucleo_32:pnum=NUCLEO_L432KC
51-
# - adafruit:nrf52:feather52840:softdevice=s140v6
51+
- adafruit:nrf52:feather52840:softdevice=s140v6
5252
- rp2040:rp2040:rpipico
5353
- arduino:avr:uno
5454
steps:

examples/Example0_LibrarylessCommunication/Example0_LibrarylessCommunication.ino

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,10 @@
2424
#define serialNotecard Serial1
2525
#endif
2626

27+
#ifdef ARDUINO_NRF52840_FEATHER
28+
#include "Adafruit_TinyUSB.h"
29+
#endif
30+
2731
// This is the unique Product Identifier for your device. This Product ID tells the Notecard what
2832
// type of device has embedded the Notecard, and by extension which vendor or customer is in charge
2933
// of "managing" it. In order to set this value, you must first register with notehub.io and

0 commit comments

Comments
 (0)