Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merging changes to separate the bluetooth module to separate board. #73

Merged
merged 22 commits into from
May 19, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
!**/.vscode/extensions.json

# Build configuration outputs
**/build/*
**/out
**/*.elf
**/*.hex
**/*.bin
Expand Down
123 changes: 86 additions & 37 deletions .vscode/c_cpp_properties.json
Original file line number Diff line number Diff line change
@@ -1,63 +1,112 @@
{
"version": 4,
"env": {
"librariesPath": "${env:USERPROFILE}/Documents/Arduino/libraries",
"arduinoDataPath": "${env:LOCALAPPDATA}/Arduino15/packages"
},
"configurations": [
{
"name": "ARM",
"name": "Bluetooth",
"intelliSenseMode": "gcc-x64",
"includePath": [
"${workspaceFolder}/sketches/Bluetooth/**",
"${arduinoDataPath}/adafruit/hardware/nrf52/0.21.0/cores/nRF5",
"${arduinoDataPath}/adafruit/hardware/nrf52/0.21.0/cores/nRF5/avr/**",
"${arduinoDataPath}/adafruit/hardware/nrf52/0.21.0/cores/nRF5/cmsis/**",
"${arduinoDataPath}/adafruit/hardware/nrf52/0.21.0/cores/nRF5/freertos/config/**",
"${arduinoDataPath}/adafruit/hardware/nrf52/0.21.0/cores/nRF5/freertos/portable/**",
"${arduinoDataPath}/adafruit/hardware/nrf52/0.21.0/cores/nRF5/freertos/source/include/**",
"${arduinoDataPath}/adafruit/hardware/nrf52/0.21.0/cores/nRF5/nordic",
"${arduinoDataPath}/adafruit/hardware/nrf52/0.21.0/cores/nRF5/nordic/nrfx",
"${arduinoDataPath}/adafruit/hardware/nrf52/0.21.0/cores/nRF5/nordic/nrfx/drivers/**",
"${arduinoDataPath}/adafruit/hardware/nrf52/0.21.0/cores/nRF5/nordic/nrfx/hal/**",
"${arduinoDataPath}/adafruit/hardware/nrf52/0.21.0/cores/nRF5/nordic/nrfx/helpers",
"${arduinoDataPath}/adafruit/hardware/nrf52/0.21.0/cores/nRF5/nordic/nrfx/mdk/**",
"${arduinoDataPath}/adafruit/hardware/nrf52/0.21.0/cores/nRF5/nordic/nrfx/soc",
"${arduinoDataPath}/adafruit/hardware/nrf52/0.21.0/cores/nRF5/nordic/softdevice/**",
"${arduinoDataPath}/adafruit/hardware/nrf52/0.21.0/cores/nRF5/TinyUSB",
"${arduinoDataPath}/adafruit/hardware/nrf52/0.21.0/cores/nRF5/TinyUSB/**",
"${arduinoDataPath}/adafruit/hardware/nrf52/0.21.0/libraries/**",
"${arduinoDataPath}/adafruit/hardware/nrf52/0.21.0/variants/**",
"${arduinoDataPath}/adafruit/tools/arm-none-eabi-gcc/9-2019q4/arm-none-eabi/include/**"
],
"forcedInclude": [
"${arduinoDataPath}/adafruit/hardware/nrf52/0.21.0/cores/nRF5/Arduino.h"
],
"compilerPath": "${arduinoDataPath}/adafruit/tools/arm-none-eabi-gcc/9-2019q4/bin/arm-none-eabi-g++.exe",
"compilerArgs": [],
"defines": [
"F_CPU=64000000",
"ARDUINO=10813",
"ARDUINO_NRF52832_FEATHER",
"ARDUINO_NRF52840_FEATHER",
"ARDUINO_ARCH_NRF52",
"ARDUINO_BSP_VERSION=\"0.20.5\"",
"NRF52832_XXAA",
"ARDUINO_BSP_VERSION=\"0.21.0\"",
"NRF52840_XXAA",
"NRF52",
"SOFTDEVICE_PRESENT",
"ARDUINO_NRF52_ADAFRUIT",
"NRF52_SERIES",
"LFS_NAME_MAX=64",
"__ENABLE_LOGGING__"
],
"cStandard": "c11",
"cppStandard": "c++11"
},
{
"name": "Mainboard",
"intelliSenseMode": "gcc-x64",
"includePath": [
"${workspaceFolder}/Nemesis-Mod/**",
"${workspaceFolder}/sketches/Bluetooth/**",
"${librariesPath}/Adafruit_FRAM_I2C",
"${librariesPath}/DualG2HighPowerMotorShield",
"${arduinoDataPath}/adafruit/hardware/nrf52/0.20.5/cores/nRF5",
"${arduinoDataPath}/adafruit/hardware/nrf52/0.20.5/cores/nRF5/avr/**",
"${arduinoDataPath}/adafruit/hardware/nrf52/0.20.5/cores/nRF5/cmsis/**",
"${arduinoDataPath}/adafruit/hardware/nrf52/0.20.5/cores/nRF5/freertos/config/**",
"${arduinoDataPath}/adafruit/hardware/nrf52/0.20.5/cores/nRF5/freertos/portable/**",
"${arduinoDataPath}/adafruit/hardware/nrf52/0.20.5/cores/nRF5/freertos/source/include/**",
"${arduinoDataPath}/adafruit/hardware/nrf52/0.20.5/cores/nRF5/nordic",
"${arduinoDataPath}/adafruit/hardware/nrf52/0.20.5/cores/nRF5/nordic/nrfx",
"${arduinoDataPath}/adafruit/hardware/nrf52/0.20.5/cores/nRF5/nordic/nrfx/drivers/**",
"${arduinoDataPath}/adafruit/hardware/nrf52/0.20.5/cores/nRF5/nordic/nrfx/hal/**",
"${arduinoDataPath}/adafruit/hardware/nrf52/0.20.5/cores/nRF5/nordic/nrfx/helpers",
"${arduinoDataPath}/adafruit/hardware/nrf52/0.20.5/cores/nRF5/nordic/nrfx/mdk/**",
"${arduinoDataPath}/adafruit/hardware/nrf52/0.20.5/cores/nRF5/nordic/nrfx/soc",
"${arduinoDataPath}/adafruit/hardware/nrf52/0.20.5/cores/nRF5/nordic/softdevice/**",
"${arduinoDataPath}/adafruit/hardware/nrf52/0.20.5/cores/nRF5/TinyUSB",
"${arduinoDataPath}/adafruit/hardware/nrf52/0.20.5/cores/nRF5/TinyUSB/**",
"${arduinoDataPath}/adafruit/hardware/nrf52/0.20.5/libraries/**",
"${arduinoDataPath}/adafruit/hardware/nrf52/0.20.5/variants/**",
"${arduinoDataPath}/adafruit/hardware/samd/1.6.5/cores/arduino/TinyUSB",
"${arduinoDataPath}/adafruit/hardware/samd/1.6.5/cores/arduino/TinyUSB/Adafruit_TinyUSB_ArduinoCore",
"${arduinoDataPath}/adafruit/hardware/samd/1.6.5/cores/arduino/TinyUSB/Adafruit_TinyUSB_ArduinoCore/tinyusb/src",
"${arduinoDataPath}/adafruit/hardware/samd/1.6.5/cores/arduino/TinyUSB",
"${arduinoDataPath}/adafruit/hardware/samd/1.6.5/cores/arduino/TinyUSB/Adafruit_TinyUSB_ArduinoCore",
"${arduinoDataPath}/adafruit/hardware/samd/1.6.5/cores/arduino/TinyUSB/Adafruit_TinyUSB_ArduinoCore/tinyusb/src",
"${arduinoDataPath}/adafruit/hardware/samd/1.6.5/cores/arduino",
"${arduinoDataPath}/adafruit/hardware/samd/1.6.5/variants/feather_m4",
"${arduinoDataPath}/adafruit/tools/CMSIS/5.4.0/CMSIS/Core/Include/",
"${arduinoDataPath}/adafruit/tools/CMSIS/5.4.0/CMSIS/DSP/Include/",
"${arduinoDataPath}/arduino/tools/CMSIS-Atmel/1.2.0/CMSIS/Device/ATMEL/",
"${arduinoDataPath}/adafruit/hardware/samd/1.6.5/libraries/Wire",
"${arduinoDataPath}/adafruit/tools/arm-none-eabi-gcc/9-2019q4/arm-none-eabi/include/**"
],
"browse": {
"limitSymbolsToIncludedHeaders": true,
"databaseFilename": "${workspaceFolder}/.vscode/temp/cache",
"path": [
"${workspaceFolder}/**",
"${librariesPath}/**",
"${arduinoDataPath}/**"
]
},
"compilerPath": "${arduinoDataPath}/adafruit/tools/arm-none-eabi-gcc/9-2019q4/bin/arm-none-eabi-g++.exe",
"forcedInclude": [
"${arduinoDataPath}/adafruit/hardware/samd/1.6.5/cores/arduino/Arduino.h"
],
"cStandard": "c11",
"cppStandard": "c++11"
}
],
"version": 4
"cppStandard": "c++11",
"compilerPath": "${arduinoDataPath}/adafruit/tools/arm-none-eabi-gcc/9-2019q4/bin/arm-none-eabi-g++.exe",
"compilerArgs": [
"-mcpu=cortex-m4",
"-mthumb",
"-std=gnu++11",
"-ffunction-sections",
"-fdata-sections",
"-fno-threadsafe-statics",
"-nostdlib",
"--param",
"-fno-rtti",
"-fno-exceptions"
],
"defines": [
"F_CPU=120000000L",
"ARDUINO=10813",
"ARDUINO_FEATHER_M4",
"ARDUINO_ARCH_SAMD",
"__SAMD51J19A__",
"ADAFRUIT_FEATHER_M4_EXPRESS",
"__SAMD51__",
"USB_CONFIG_POWER=100",
"__FPU_PRESENT",
"ARM_MATH_CM4",
"ENABLE_CACHE",
"USB_VID=0x239A",
"USB_PID=0x8022",
"USBCON"
]
}
]
}
30 changes: 22 additions & 8 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,11 @@ else
endif

# Arduino CLI Board type
BOARD_TYPE = adafruit:nrf52
FQBN = $(BOARD_TYPE):feather52832
MAIN_BOARD_TYPE = adafruit:samd
MAIN_FQBN = $(MAIN_BOARD_TYPE):adafruit_feather_m4

BT_BOARD_TYPE = adafruit:nrf52
BT_FQBN = $(BT_BOARD_TYPE):feather52840

# Default port to upload to
SERIAL_PORT ?=
Expand All @@ -20,10 +23,19 @@ SERIAL_PORT ?=
VERBOSE =

# Build path -- used to store built binary and object files
BUILD_FOLDER = $(WORKSPACE_FOLDER)/build
PROJECT_NAME = Nemesis-Mod
PROJECT_FOLDER = $(WORKSPACE_FOLDER)/$(PROJECT_NAME)
SKETCH_PATH = $(PROJECT_FOLDER)/Nemesis-Mod.ino
BUILD_FOLDER = $(WORKSPACE_FOLDER)/out
SKETCHES_FOLDER = $(WORKSPACE_FOLDER)/sketches

MAIN_PROJECT_NAME = Mainboard
MAIN_BUILD_FOLDER = $(BUILD_FOLDER)/$(MAIN_PROJECT_NAME)
MAIN_PROJECT_FOLDER = $(SKETCHES_FOLDER)/$(MAIN_PROJECT_NAME)
MAIN_SKETCH_PATH = $(MAIN_PROJECT_FOLDER)/$(MAIN_PROJECT_NAME).ino

BT_PROJECT_NAME = Bluetooth
BT_BUILD_FOLDER = $(BUILD_FOLDER)/$(BT_PROJECT_NAME)
BT_PROJECT_FOLDER = $(SKETCHES_FOLDER)/$(BT_PROJECT_NAME)
BT_SKETCH_PATH = $(BT_PROJECT_FOLDER)/$(BT_PROJECT_NAME).ino

CONFIG_FILE = $(WORKSPACE_FOLDER)/arduino-cli.yml

all: install_prerequisites rebuild
Expand All @@ -32,7 +44,8 @@ install_prerequisites: install_boards install_libraries

install_boards:
"$(ARDUINO_CLI)" core update-index
"$(ARDUINO_CLI)" core install $(BOARD_TYPE)
"$(ARDUINO_CLI)" core install $(MAIN_BOARD_TYPE)
"$(ARDUINO_CLI)" core install $(BT_BOARD_TYPE)

install_libraries:
"$(ARDUINO_CLI)" lib install "Adafruit FRAM I2C"
Expand All @@ -44,4 +57,5 @@ clean:
@rm -rf "$(BUILD_FOLDER)"

build:
"$(ARDUINO_CLI)" compile $(VERBOSE) --build-path="$(BUILD_FOLDER)" --build-cache-path="$(BUILD_FOLDER)" --fqbn $(FQBN) "$(PROJECT_FOLDER)"
"$(ARDUINO_CLI)" compile $(VERBOSE) --build-path="$(MAIN_BUILD_FOLDER)" --build-cache-path="$(MAIN_BUILD_FOLDER)" --fqbn $(MAIN_FQBN) "$(MAIN_PROJECT_FOLDER)"
"$(ARDUINO_CLI)" compile $(VERBOSE) --build-path="$(BT_BUILD_FOLDER)" --build-cache-path="$(BT_BUILD_FOLDER)" --fqbn $(BT_FQBN) "$(BT_PROJECT_FOLDER)"
5 changes: 3 additions & 2 deletions Nemesis-Mod.code-workspace
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,17 @@
"settings": {
"arduino.defaultBaudRate": 115200,
"arduino.logLevel": "info",
"arduino.disableIntelliSenseAutoGen": true,
"arduino.additionalUrls": [
"https://adafruit.github.io/arduino-board-index/package_adafruit_index.json"
],
"cortex-debug.armToolchainPath": "${env:LOCALAPPDATA}/Arduino15/packages/adafruit/tools/arm-none-eabi-gcc/9-2019q4/bin",
"cortex-debug.JLinkGDBServerPath": "${env:PROGRAMFILES(X86)}/SEGGER/JLink_v694a/JLinkGDBServerCL.exe",
"C_Cpp.intelliSenseEngine": "Default",
"editor.tabSize": 4,
"files.exclude": {
".vscode/ipch": true,
".vscode/temp": true,
"build": true,
"external": true,
"docs": true,
"**/*.exe": true,
"**/*.bin": true,
Expand Down
36 changes: 0 additions & 36 deletions Nemesis-Mod/src/Log.cpp

This file was deleted.

17 changes: 0 additions & 17 deletions Nemesis-Mod/src/Log.h

This file was deleted.

40 changes: 0 additions & 40 deletions Nemesis-Mod/src/bluetooth/NotificationService.cpp

This file was deleted.

21 changes: 0 additions & 21 deletions Nemesis-Mod/src/bluetooth/NotificationService.h

This file was deleted.

6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ It started off as me just wanting to play with an Arduino while repurposing some
## Hardware Requirements
These are the boards and hardware being used by the project.
- [Nerf Rival Nemesis MXVII-10K](https://shop.hasbro.com/en-us/product/nerf-rival-nemesis-mxvii-10-k-blue:04E71588-5056-9047-F5B8-940FC9A5A209)
- [Adafruit Feather nRF52 Bluefruit LE - nRF52832](https://www.adafruit.com/product/3406)
- [Adafruit Feather M4 Express (ATSAMD51)](https://www.adafruit.com/product/3857)
- [Adafruit Feather nRF52840 Express](https://www.adafruit.com/product/4062)
- [Adafruit FeatherWing Proto - Prototyping Add-on](https://www.adafruit.com/product/2884)
- [Adafruit I2C Non-Volatile FRAM Breakout](https://www.adafruit.com/product/1895)
- [Tactile Switch Button (12mm square, 6mm tall)](https://www.adafruit.com/product/1119)
Expand All @@ -31,7 +32,8 @@ Below are the software which must be installed to compile the source code.
The below are the optional tools that could be used as a replacement for the Makefile support.
- Arduino Extension for Visual Studio Code
- Arduino Board Manager Packages
- Adafruit nRF52 Boards (0.20.5)
- Adafruit SAMD Boards (1.6.5)
- Adafruit nRF52 Boards (0.21.0)

### Dependencies
Below are the dependencies that are being used by the project and must be installed using the Arduino IDE Library Manager.
Expand Down
6 changes: 2 additions & 4 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,7 @@ build_script:
- cmd: make.exe

artifacts:
- path: build/Nemesis-Mod.ino.zip
- path: build/Nemesis-Mod.ino.hex
- path: build/Nemesis-Mod.ino.elf
- path: build/Nemesis-Mod.ino.map
- path: out/Mainboard/Mainboard.ino.*
- path: out/Bluetooth/Bluetooth.ino.*

deploy: off
Loading