Skip to content

Commit

Permalink
[nRF52] build MBED target with ArduinoBLE
Browse files Browse the repository at this point in the history
  • Loading branch information
lyusupov committed Aug 14, 2024
1 parent 116673d commit 2b390d8
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 2 deletions.
6 changes: 5 additions & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -357,8 +357,12 @@ jobs:
fi
if [[ "$BOARD" =~ "arduino:mbed_edge:" ]]; then
arduino --pref "boardsmanager.additional.urls=https://downloads.arduino.cc/packages/package_index.json" --save-prefs ;
arduino --install-boards arduino:mbed_edge:4.1.1 ;
arduino --install-boards arduino:mbed_edge:4.1.5 ;
arduino --board $BOARD --save-prefs ;
wget https://github.com/arduino-libraries/ArduinoBLE/archive/refs/tags/${ARDUINO_BLE_VERSION}.tar.gz ;
tar xzf ${ARDUINO_BLE_VERSION}.tar.gz ;
rm ${ARDUINO_BLE_VERSION}.tar.gz ;
mv ArduinoBLE-${ARDUINO_BLE_VERSION} $HOME/Arduino/libraries/ ;
cd $GITHUB_WORKSPACE ;
fi
if [[ "$BOARD" =~ "arduino:samd:" ]]; then
Expand Down
5 changes: 5 additions & 0 deletions software/firmware/source/SoftRF/src/driver/Bluetooth.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,11 @@ enum
#endif /* EXCLUDE_BLUETOOTH */
#elif defined(ARDUINO_ARCH_NRF52)
#include "../platform/bluetooth/Bluefruit.h"
#elif defined(ARDUINO_ARCH_NRF52840)
#include "../system/SoC.h"
#if defined(USE_ARDUINOBLE)
#include "../platform/bluetooth/ArduinoBLE.h"
#endif /* USE_ARDUINOBLE */
#elif defined(ARDUINO_ARCH_RP2040) && defined(ARDUINO_RASPBERRY_PI_PICO_W)
#include "../platform/bluetooth/BTstack.h"
#elif defined(ARDUINO_ARCH_RENESAS) || defined(ARDUINO_ARCH_SILABS)
Expand Down
4 changes: 4 additions & 0 deletions software/firmware/source/SoftRF/src/platform/nRF52.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3187,7 +3187,11 @@ const SoC_ops_t nRF52_ops = {
nRF52_swSer_begin,
nRF52_swSer_enableRx,
#if !defined(EXCLUDE_BLUETOOTH)
#if defined(USE_ARDUINOBLE)
&ArdBLE_Bluetooth_ops,
#else
&nRF52_Bluetooth_ops,
#endif /* USE_ARDUINOBLE */
#else
NULL,
#endif /* EXCLUDE_BLUETOOTH */
Expand Down
7 changes: 6 additions & 1 deletion software/firmware/source/SoftRF/src/platform/nRF52.h
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,10 @@ struct rst_info {

#if defined(ARDUINO_ARCH_MBED)
#define PCF8563_SLAVE_ADDRESS (0x51)

#define STR_HELPER(x) #x
#define STR(x) STR_HELPER(x)
#define ARDUINO_CORE_VERSION STR(CORE_MAJOR) "." STR(CORE_MINOR) "." STR(CORE_PATCH)
#endif /* ARDUINO_ARCH_MBED */

#define MIDI_CHANNEL_TRAFFIC 1
Expand Down Expand Up @@ -339,7 +343,8 @@ struct rst_info {
//#define USE_TFT
#else
#undef USE_EPAPER
#define EXCLUDE_BLUETOOTH
//#define EXCLUDE_BLUETOOTH
#define USE_ARDUINOBLE
#define EXCLUDE_IMU
#define EXCLUDE_BME280AUX
#endif /* ARDUINO_ARCH_MBED */
Expand Down

0 comments on commit 2b390d8

Please sign in to comment.