Skip to content
This repository has been archived by the owner on Nov 24, 2022. It is now read-only.

Commit

Permalink
Merge pull request #2 from osmanovv/upstream-merge
Browse files Browse the repository at this point in the history
Upstream merge: synced with `jgromes/RadioLib`
  • Loading branch information
geeksville authored Sep 5, 2021
2 parents 80ed10d + 252fe74 commit d82e9e6
Show file tree
Hide file tree
Showing 173 changed files with 6,588 additions and 3,126 deletions.
3 changes: 2 additions & 1 deletion .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ assignees: ''
Before submitting new issue, please check the [Wiki](https://github.com/jgromes/RadioLib/wiki) and the [API documentation](https://jgromes.github.io/RadioLib/). You might find a solution to your issue there.

**Describe the bug**
A clear and concise description of what the bug is. When applicable, please include debug mode output: uncomment [debug macro definitions in BuildOpt.h](https://github.com/jgromes/RadioLib/blob/master/src/BuildOpt.h#L135) and post the output.
A clear and concise description of what the bug is. When applicable, please include [debug mode output](https://github.com/jgromes/RadioLib/wiki/Debug-mode).

**To Reproduce**
Minimal Arduino sketch to reproduce the behavior. Please user Markdown to style the code to make it readable (see [Markdown Cheatsheet](https://github.com/adam-p/markdown-here/wiki/Markdown-Cheatsheet#code)).
Expand All @@ -24,6 +24,7 @@ If applicable, add screenshots to help explain your problem.

**Additional info (please complete):**
- MCU: [e.g. Arduino Uno, ESP8266 etc.]
- Link to Arduino core: [e.g. https://github.com/stm32duino/Arduino_Core_STM32 when using official STM32 core. See readme for links to all supported cores]
- Wireless module type [e.g. CC1101, SX1268, etc.]
- Arduino IDE version [e.g. 1.8.5]
- Library version [e.g. 3.0.0]
34 changes: 34 additions & 0 deletions .github/ISSUE_TEMPLATE/module-not-working.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
---
name: Module not working
about: Template to use when your module isn't working
title: ''
labels: ''
assignees: ''

---

**IMPORTANT: Before submitting an issue, please check the following:**
1. **Read [CONTRIBUTING.md](https://github.com/jgromes/RadioLib/blob/master/CONTRIBUTING.md)!** Issues that do not follow this document will be closed/locked/deleted/ignored.
2. RadioLib has a [Wiki](https://github.com/jgromes/RadioLib/wiki) and an extensive [API documentation](https://jgromes.github.io/RadioLib/). You might find a solution to your issue there.
3. Make sure you're using the latest release of the library! Releases can be found [here](https://github.com/jgromes/RadioLib/releases).
4. Use [Arduino forums](https://forum.arduino.cc/) to ask generic questions about wireless modules, wiring, usage, etc. Only create issues for problems specific to RadioLib!
5. Error codes, their meaning and how to fix them can be found on [this page](https://jgromes.github.io/RadioLib/group__status__codes.html).

**Sketch that is causing the module fail**

```c++
paste the sketch here, even if it is an unmodified example code
```

**Hardware setup**
Wiring diagram, schematic, pictures etc.

**Debug mode output**
Enable all [debug levels](https://github.com/jgromes/RadioLib/wiki/Debug-mode) and paste the Serial monitor output here.

**Additional info (please complete):**
- MCU: [e.g. Arduino Uno, ESP8266 etc.]
- Link to Arduino core: [e.g. https://github.com/stm32duino/Arduino_Core_STM32 when using official STM32 core. See readme for links to all supported cores]
- Wireless module type [e.g. CC1101, SX1268, etc.]
- Arduino IDE version [e.g. 1.8.5]
- Library version [e.g. 3.0.0]
66 changes: 66 additions & 0 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
name: "CodeQL"

on:
push:
branches: [master]
pull_request:
branches: [master]

jobs:
analyze:
name: Analyze
runs-on: ubuntu-latest

strategy:
fail-fast: false
matrix:
language: ['cpp']

steps:
- name: Checkout repository
uses: actions/checkout@v2
with:
# We must fetch at least the immediate parents so that if this is
# a pull request then we can checkout the head.
fetch-depth: 2

# If this run was triggered by a pull request event, then checkout
# the head of the pull request instead of the merge commit.
- run: git checkout HEAD^2
if: ${{ github.event_name == 'pull_request' }}

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v1
with:
languages: ${{ matrix.language }}

- name: Install arduino-cli
run:
|
mkdir -p ~/.local/bin
echo "~/.local/bin" >> $GITHUB_PATH
curl -fsSL https://raw.githubusercontent.com/arduino/arduino-cli/master/install.sh | BINDIR=~/.local/bin sh

- name: Install platform
run:
|
arduino-cli core update-index
arduino-cli core install arduino:avr

- name: Static link
run:
|
# static link fix from https://github.com/github/securitylab/discussions/171
for i in ~/.arduino*/packages/arduino/tools/avr-gcc/*/bin/*; do
mv "$i" "$i.real";
printf '#!/bin/bash\nexec "'"$i"'.real" ${1+"$@"}\n' > "$i";
chmod +x "$i";
done

- name: Build example
run:
arduino-cli compile --libraries /home/runner/work/RadioLib --fqbn arduino:avr:uno $PWD/examples/SX126x/SX126x_Transmit/SX126x_Transmit.ino --warnings=all

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v1
26 changes: 26 additions & 0 deletions .github/workflows/doxygen.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Doxygen

on:
push:
branches: [ master ]
workflow_dispatch:

jobs:
doxygen:
runs-on: ubuntu-latest
steps:
- name: Install Doxygen
run: |
sudo apt-get update
sudo apt-get install -y doxygen
- uses: actions/checkout@v2

- name: Generate docs
run: doxygen Doxyfile

- name: Deploy to GitHub Pages
uses: JamesIves/github-pages-deploy-action@releases/v3
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
BRANCH: gh-pages
FOLDER: docs/html
162 changes: 162 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,162 @@
name: CI

on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
workflow_dispatch:

jobs:

build:
strategy:
matrix:
board:
- arduino:avr:uno
- arduino:avr:mega
- arduino:avr:leonardo
- arduino:mbed:nano33ble
- arduino:mbed:envie_m4
- arduino:megaavr:uno2018
- arduino:sam:arduino_due_x
- arduino:samd:arduino_zero_native
- adafruit:samd:adafruit_feather_m0
- adafruit:nrf52:feather52832
- esp32:esp32:esp32
- esp8266:esp8266:generic
- Intel:arc32:arduino_101
- SparkFun:apollo3:sfe_artemis
- STM32:stm32:GenF3
- stm32duino:STM32F1:mapleMini
- MegaCoreX:megaavr:4809

runs-on: ubuntu-latest
name: ${{ matrix.board }}
env:
run-build: ${{ (matrix.board == 'arduino:avr:uno') || contains(github.event.head_commit.message, 'CI_BUILD_ALL') || contains(github.event.head_commit.message, 'Bump version to') || contains(github.event.head_commit.message, format('{0}', matrix.board)) }}

steps:
- name: Install arduino-cli
if: ${{ env.run-build == 'true' }}
run:
|
mkdir -p ~/.local/bin
echo "~/.local/bin" >> $GITHUB_PATH
curl -fsSL https://raw.githubusercontent.com/arduino/arduino-cli/master/install.sh | BINDIR=~/.local/bin sh

- name: Get platform name
if: ${{ env.run-build == 'true' }}
uses: jungwinter/split@v1
id: split
with:
msg: ${{ matrix.board }}
seperator: ':'

- name: Prepare platform-specific settings
if: ${{ env.run-build == 'true' }}
id: prep
run:
|
# common settings - no extra options, skip nothing, all warnings
echo "::set-output name=options::"
echo "::set-output name=skip-pattern::''"
echo "::set-output name=warnings::'all'"

# platform-dependent settings - extra board options, board index URLs, skip patterns etc.
if [[ "${{ contains(matrix.board, 'arduino:avr:mega') }}" == "true" ]]; then
# Arduino Mega
echo "::set-output name=options:::cpu=atmega2560"

elif [[ "${{ contains(matrix.board, 'arduino:mbed') }}" == "true" ]]; then
# Arduino Nano 33 BLE
echo "::set-output name=skip-pattern::(HTTP|MQTT).*ino"

elif [[ "${{ contains(matrix.board, 'arduino-beta:mbed') }}" == "true" ]]; then
# Arduino Portenta H7
echo "::set-output name=skip-pattern::(HTTP|MQTT).*ino"

elif [[ "${{ contains(matrix.board, 'arduino:megaavr:uno2018') }}" == "true" ]]; then
# Arduino Uno WiFi
echo "::set-output name=options:::mode=on"

elif [[ "${{ contains(matrix.board, 'adafruit:samd') }}" == "true" ]]; then
# Adafruit SAMD
echo "::set-output name=options:::usbstack=arduino,debug=off"
echo "::set-output name=index-url::--additional-urls https://www.adafruit.com/package_adafruit_index.json"

elif [[ "${{ contains(matrix.board, 'adafruit:nrf52') }}" == "true" ]]; then
# Adafruit Feather nRF52
sudo apt-get update
sudo apt-get install -y python3 python3-pip python3-setuptools
pip3 install wheel
pip3 install --user adafruit-nrfutil
echo "/home/runner/.local/bin" >> $GITHUB_PATH
echo "::set-output name=options:::softdevice=s132v6,debug=l0"
echo "::set-output name=index-url::--additional-urls https://www.adafruit.com/package_adafruit_index.json"

elif [[ "${{ contains(matrix.board, 'esp32:esp32') }}" == "true" ]]; then
# ESP32
python -m pip install pyserial
echo "::set-output name=index-url::--additional-urls https://raw.githubusercontent.com/espressif/arduino-esp32/gh-pages/package_esp32_index.json"

elif [[ "${{ contains(matrix.board, 'esp8266:esp8266') }}" == "true" ]]; then
# ESP8266
echo "::set-output name=options:::xtal=80,ResetMethod=ck,CrystalFreq=26,FlashFreq=40,FlashMode=qio,eesz=512K"
echo "::set-output name=index-url::--additional-urls http://arduino.esp8266.com/stable/package_esp8266com_index.json"
echo "::set-output name=skip-pattern::(HTTP|MQTT).*ino"

elif [[ "${{ contains(matrix.board, 'SparkFun:apollo3') }}" == "true" ]]; then
# SparkFun Apollo
echo "::set-output name=index-url::--additional-urls https://raw.githubusercontent.com/sparkfun/Arduino_Apollo3/master/package_sparkfun_apollo3_index.json"
echo "::set-output name=warnings::'none'"
echo "::set-output name=skip-pattern::(HTTP|MQTT).*ino"

elif [[ "${{ contains(matrix.board, 'STM32:stm32') }}" == "true" ]]; then
# STM32 (official core)
echo "::set-output name=options:::pnum=BLACKPILL_F303CC"
echo "::set-output name=index-url::--additional-urls https://github.com/stm32duino/BoardManagerFiles/raw/master/STM32/package_stm_index.json"

elif [[ "${{ contains(matrix.board, 'stm32duino:STM32F1') }}" == "true" ]]; then
# STM32 (unofficial core)
echo "::set-output name=options:::bootloader_version=original,cpu_speed=speed_72mhz"
echo "::set-output name=index-url::--additional-urls http://dan.drown.org/stm32duino/package_STM32duino_index.json"

elif [[ "${{ contains(matrix.board, 'MegaCoreX:megaavr') }}" == "true" ]]; then
# MegaCoreX
echo "::set-output name=index-url::--additional-urls https://mcudude.github.io/MegaCoreX/package_MCUdude_MegaCoreX_index.json"

fi

- name: Install platform
if: ${{ env.run-build == 'true' }}
run:
|
arduino-cli core update-index ${{ format('{0}', steps.prep.outputs.index-url) }}
arduino-cli core install ${{ format('{0}:{1} {2}', steps.split.outputs._0, steps.split.outputs._1, steps.prep.outputs.index-url) }}

- name: Checkout repository
if: ${{ env.run-build == 'true' }}
uses: actions/checkout@v2

- name: Build examples
if: ${{ env.run-build == 'true' }}
run:
|
for example in $(find $PWD/examples -name '*.ino' | sort); do
# check whether to skip this sketch
if [ ! -z '${{ steps.prep.outputs.skip-pattern }}' ] && [[ ${example} =~ ${{ steps.prep.outputs.skip-pattern }} ]]; then
# skip sketch
echo -e "\n\033[1;33mSkipped ${example##*/} (matched with ${{ steps.prep.outputs.skip-pattern }})\033[0m";
else
# build sketch
echo -e "\n\033[1;33mBuilding ${example##*/} ... \033[0m";
arduino-cli compile --libraries /home/runner/work/RadioLib --fqbn ${{ matrix.board }}${{ steps.prep.outputs.options }} $example --warnings=${{ steps.prep.outputs.warnings }}
if [ $? -ne 0 ]; then
echo -e "\033[1;31m${example##*/} build FAILED\033[0m\n";
exit 1;
else
echo -e "\033[1;32m${example##*/} build PASSED\033[0m\n";
fi
fi
done
46 changes: 10 additions & 36 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,42 +1,16 @@
# Prerequisites
*.d

# Compiled Object files
*.slo
*.lo
*.o
*.obj

# Precompiled Headers
*.gch
*.pch

# Compiled Dynamic libraries
*.so
*.dylib
*.dll

# Fortran module files
*.mod
*.smod

# Compiled Static libraries
*.lai
*.la
*.a
*.lib

# Executables
*.exe
*.out
*.app

# Arduino Library Development file
.development

# Arduino testing sketches
examples/test/

# Atom
*.tags
*.tags1

# Jetbrain IDEs
.idea

# Debug decoder
extras/decoder/log.txt
extras/decoder/out.txt

# PlatformIO
.pio*
Loading

0 comments on commit d82e9e6

Please sign in to comment.