Skip to content

Commit

Permalink
Academy: build of ArduinoBLE driver
Browse files Browse the repository at this point in the history
  • Loading branch information
lyusupov committed Feb 29, 2024
1 parent bca0fce commit 1550c7d
Show file tree
Hide file tree
Showing 7 changed files with 378 additions and 5 deletions.
5 changes: 5 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ jobs:
env:
ARDUINO_IDE_VERSION: 1.8.13
ARDUINO_CLI_VERSION: 0.34.2
ARDUINO_BLE_VERSION: 1.3.6
ENERGIA_IDE_VERSION: 1.8.10E23
BOARD: ${{ matrix.board }}

Expand Down Expand Up @@ -321,6 +322,10 @@ jobs:
arduino --pref "boardsmanager.additional.urls=https://downloads.arduino.cc/packages/package_index.json" --save-prefs ;
arduino --install-boards arduino:renesas_uno:1.0.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" =~ "rp2040:rp2040:" ]]; then
Expand Down
4 changes: 3 additions & 1 deletion software/firmware/source/SoftRF/src/driver/Bluetooth.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ enum
#include "../platform/bluetooth/Bluefruit.h"
#elif defined(ARDUINO_ARCH_RP2040) && defined(ARDUINO_RASPBERRY_PI_PICO_W)
#include "../platform/bluetooth/BTstack.h"
#endif /* ESP32 or ARDUINO_ARCH_NRF52 or ARDUINO_ARCH_RP2040 */
#elif defined(ARDUINO_ARCH_RENESAS)
#include "../platform/bluetooth/ArduinoBLE.h"
#endif /* ESP32 or NRF52 or RP2040 or RENESAS */

#endif /* BLUETOOTHHELPER_H */
6 changes: 3 additions & 3 deletions software/firmware/source/SoftRF/src/driver/WiFi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -133,13 +133,13 @@ void WiFi_setup()
// ... Try to connect to WiFi station.
WiFi.begin(station_ssid.c_str(), station_psk.c_str());

// ... Pritn new SSID
// ... Print new SSID
Serial.print(F("new SSID: "));
Serial.println(WiFi.SSID());

Serial.println(F("Wait for WiFi connection."));

// ... Give Wi-Fi 10-20 seconds to connect to station.
// ... Give Wi-Fi 10-20 seconds to connect to an AP.
unsigned long startTime = millis();
while (WiFi.status() != WL_CONNECTED &&
millis() - startTime < WIFI_STA_TIMEOUT)
Expand Down Expand Up @@ -236,7 +236,7 @@ void WiFi_setup()

Serial.println(F("Wait for WiFi connection."));

// ... Give Wi-Fi 10-20 seconds to connect to station.
// ... Give Wi-Fi 10-20 seconds to connect to an AP.
unsigned long startTime = millis();
while (WiFi.status() != WL_CONNECTED &&
millis() - startTime < WIFI_STA_TIMEOUT)
Expand Down
7 changes: 6 additions & 1 deletion software/firmware/source/SoftRF/src/platform/RA4M1.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
#include "../driver/Baro.h"
#include "../driver/Sound.h"
#include "../driver/Battery.h"
#include "../driver/Bluetooth.h"
#include "../protocol/data/NMEA.h"
#include "../protocol/data/GDL90.h"
#include "../protocol/data/D1090.h"
Expand Down Expand Up @@ -874,7 +875,11 @@ const SoC_ops_t RA4M1_ops = {
RA4M1_SPI_begin,
RA4M1_swSer_begin,
RA4M1_swSer_enableRx,
NULL, /* RA4M1 has no built-in Bluetooth */
#if !defined(EXCLUDE_BLUETOOTH)
&RA4M1_Bluetooth_ops,
#else
NULL,
#endif /* EXCLUDE_BLUETOOTH */
&RA4M1_USBSerial_ops,
NULL,
RA4M1_Display_setup,
Expand Down
2 changes: 2 additions & 0 deletions software/firmware/source/SoftRF/src/platform/RA4M1.h
Original file line number Diff line number Diff line change
Expand Up @@ -130,13 +130,15 @@ struct rst_info {

#if defined(ARDUINO_UNOR4_MINIMA)
#define EXCLUDE_WIFI
#define EXCLUDE_BLUETOOTH
#elif defined(ARDUINO_UNOR4_WIFI)
#define USE_ARDUINO_WIFI
#define EXCLUDE_OTA
#define USE_WIFI_NINA false
#define USE_WIFI_CUSTOM true
#include <WiFiS3.h>
#define Serial_setDebugOutput(x) ({})
//#define EXCLUDE_BLUETOOTH
#endif

#define EXCLUDE_CC13XX
Expand Down
Loading

0 comments on commit 1550c7d

Please sign in to comment.