Skip to content
Closed
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
4 changes: 2 additions & 2 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ paste the debug output here
```

</p>
</details>
</details>

**To Reproduce**
Minimal Arduino sketch to reproduce the behavior. Please use 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 @@ -34,7 +34,7 @@ paste the sketch here, even if it is an unmodified example code
```

</p>
</details>
</details>

**Expected behavior**
A clear and concise description of what you expected to happen.
Expand Down
4 changes: 2 additions & 2 deletions .github/ISSUE_TEMPLATE/module-not-working.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ paste the sketch here, even if it is an unmodified example code
```

</p>
</details>
</details>

**Hardware setup**
Wiring diagram, schematic, pictures etc.
Expand All @@ -38,7 +38,7 @@ paste the debug output here
```

</p>
</details>
</details>

**Additional info (please complete):**
- MCU: [e.g. Arduino Uno, ESP8266 etc.]
Expand Down
30 changes: 15 additions & 15 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ jobs:
run: |
echo "skip-pattern=(STM32WL|LoRaWAN|LR11x0_Firmware_Update)" >> $GITHUB_OUTPUT
- id: SiliconLabs:silabs:xg24explorerkit
run: |
run: |
echo "index-url=--additional-urls https://siliconlabs.github.io/arduino/package_arduinosilabs_index.json" >> $GITHUB_OUTPUT

runs-on: ubuntu-latest
Expand Down Expand Up @@ -184,19 +184,19 @@ jobs:
|
cd $PWD/extras/test/ci
./build_examples.sh ${{ matrix.id }} "${{ steps.prep.outputs.skip-pattern }}" ${{ steps.prep.outputs.options }}

- name: Extract short commit hash
id: short-hash
run: echo "::set-output name=short_sha::$(git rev-parse --short HEAD)"

- name: Parse sizes
if: ${{ env.run-build == 'true' }}
run:
|
cd $PWD/extras/test/ci
./parse_size.sh ${{ matrix.id }}
cat size_${{ steps.short-hash.outputs.short_sha }}_${{ steps.split.outputs._0 }}-${{ steps.split.outputs._1 }}-${{ steps.split.outputs._2 }}.csv

- name: Upload size report as artifact
uses: actions/upload-artifact@v4
with:
Expand All @@ -223,12 +223,12 @@ jobs:
cd artifacts
git config --global user.name "${{ github.actor }}"
git config --global user.email "${{ github.actor }}@users.noreply.github.com"

- name: Download size artifacts
uses: actions/download-artifact@v4
with:
path: aggregated-sizes

- name: Push size files
run:
|
Expand All @@ -246,7 +246,7 @@ jobs:
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Install dependencies
run: |
sudo apt-get update
Expand All @@ -257,12 +257,12 @@ jobs:
mkdir -p ~/esp
cd ~/esp
git clone --recursive https://github.com/espressif/esp-idf.git

- name: Install ESP-IDF
run: |
cd ~/esp/esp-idf
./install.sh esp32

- name: Build the example
run: |
cd $PWD/examples/NonArduino/ESP-IDF
Expand Down Expand Up @@ -298,7 +298,7 @@ jobs:
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Install dependencies
run: |
sudo apt-get update
Expand All @@ -310,15 +310,15 @@ jobs:
sudo make install
cd ..
sudo rm -rf lg

- name: Install the library
run: |
cd $PWD
mkdir build
cd build
cmake ..
sudo make install

- name: Build the example
run: |
cd $PWD/examples/NonArduino/Raspberry
Expand All @@ -341,19 +341,19 @@ jobs:
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Install dependencies
run: |
sudo apt update
sudo apt install git cmake gcc-arm-none-eabi libnewlib-arm-none-eabi libstdc++-arm-none-eabi-newlib

- name: Clone the SDK
run: |
mkdir -p ~/rpi-pico
cd ~/rpi-pico
git clone https://github.com/raspberrypi/pico-sdk.git
cd pico-sdk && git checkout 1.5.1

- name: Build the example
run: |
export PICO_SDK_PATH=~/rpi-pico/pico-sdk
Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,25 +12,25 @@ jobs:
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Checkout latest tag
run: git checkout $(git describe --tags $(git rev-list --tags --max-count=1))

- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: '3.9'

- name: Install PlatformIO and ESP-IDF
run: |
run: |
pip install --upgrade platformio
pip install --upgrade idf-component-manager

- name: PlatformIO publish
env:
PLATFORMIO_AUTH_TOKEN: ${{ secrets.PLATFORMIO_AUTH_TOKEN }}
run: pio pkg publish --no-interactive

- name: ESP-IDF publish
env:
IDF_COMPONENT_API_TOKEN: ${{ secrets.IDF_COMPONENT_API_TOKEN }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/unit-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:
run: |
cd extras/test/unit
./coverage.sh

- name: Upload coverage report as artifact
uses: actions/upload-artifact@v4
with:
Expand Down
10 changes: 10 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v5.0.0
hooks:
- id: check-yaml
- id: check-illegal-windows-names
- id: end-of-file-fixer
- id: trailing-whitespace
- id: mixed-line-ending
args: ['-f=lf']
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ if(ESP_PLATFORM)

idf_component_register(
SRCS ${RADIOLIB_SOURCES}
INCLUDE_DIRS . src
INCLUDE_DIRS . src
)

return()
Expand Down
30 changes: 17 additions & 13 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,20 +7,20 @@ To keep this library organized, please follow these rules.

The following rules guide submission of new issues. These rules are in place mainly so that the issue author can get help as quickly as possible.

1. **Questions are welcome, spam is not.**
1. **Questions are welcome, spam is not.**
Any issues without description will be considered spam and as such will be **CLOSED** and **LOCKED** immediately!
2. **This repository has issue templates.**
2. **This repository has issue templates.**
To report bugs or suggest new features, use the provided issue templates. Use the default issue only if the templates do not fit your issue type.
3. **Be as clear as possible when creating issues.**
3. **Be as clear as possible when creating issues.**
Issues with generic titles (e.g. "not working", "lora", etc.) will be **CLOSED** until the title is fixed, since the title is supposed to categorize the issue. The same applies for issues with very little information and extensive grammatical or formatting errors that make it difficult to find out what is the actual issue.
4. **Issues deserve some attention too.**
4. **Issues deserve some attention too.**
Issues that are left for 2 weeks without response by the original author when asked for further information will be closed due to inactivity. This is to keep track of important issues, the author is encouraged to reopen the issue at a later date.

## Code style guidelines

I like pretty code! Or at least, I like *consistent* code style. When creating pull requests, please follow these style guidelines, they're in place to keep high code readability.

1. **Bracket style**
1. **Bracket style**
This library uses the following style of bracket indentation (1TBS, or "javascript" style):

```c++
Expand All @@ -31,10 +31,10 @@ if (foo) {
}
```

2. **Tabs**
2. **Tabs**
Use 2 space characters for tabs.

3. **Single-line comments**
3. **Single-line comments**
Comments can be very useful - and they can become the bane of readability. Every single-line comment should start at new line, have one space between comment delimiter `//` and the start of the comment itself. The comment should also start with a lower-case letter.

```c++
Expand All @@ -45,7 +45,7 @@ foo("bar");
foo(12345);
```

4. **Split code into blocks**
4. **Split code into blocks**
It is very easy to write code that machine can read. It is much harder to write one that humans can read. That's why it's a great idea to split code into blocks - even if the block is just a single line!

```c++
Expand All @@ -62,13 +62,13 @@ state = readData(data, len);
data[len] = 0;
```

5. **Doxygen**
5. **Doxygen**
If you're adding a new method, make sure to add appropriate Doxygen comments, so that the documentation is always complete.

6. **Keywords**
6. **Keywords**
This is an Arduino library, so it needs to comply with the Arduino library specification. To add a new keyword to the Arduino IDE syntax highlighting, add it to the keywords.txt file. **Use true tabs in keywords.txt! No spaces there!**

7. **Dynamic memory**
7. **Dynamic memory**
Sometimes, RadioLib might be used in critical applications where dynamic memory allocation using `new` or `malloc` might cause issues. For such cases, RadioLib provides the option to compile using only static arrays. This means that every dynamically allocated array must have a sufficiently large static counterpart. Naturally, all dynamically allocated memory must be properly de-allocated using `delete` or `free`.

```c++
Expand All @@ -91,7 +91,7 @@ readData(data, length);
#endif
```

8. **God Mode**
8. **God Mode**
During development, it can be useful to have access to the low level drivers, such as the SPI commands. These are incredibly powerful, since they will basically let user do anything he wants with the module, outside of the normal level of sanity checks. As such, they are normally protected using C++ access modifiers `private` or `protected`. God mode disables this protection, and so any newly implemented `class` must contain the appropriate macro check:

```c++
Expand All @@ -106,5 +106,9 @@ class Module {
};
```

9. **No Arduino Strings**
9. **No Arduino Strings**
Arduino `String` class should never be used internally in the library. The only allowed occurence of Arduino `String` is in public API methods, and only at the top-most layer.

## Pre-commit

It is recommend that you use [pre-commit](https://pre-commit.com/) to automatically check your code before committing. Pre-commit can be installed following [these instructions](https://pre-commit.com/#installation), after which simply run `pre-commit install` at the root of this project. This will install all of the hooks specified in this project's [config file](./.pre-commit-config.yaml).
20 changes: 10 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,30 +34,30 @@ RadioLib was originally created as a driver for [__RadioShield__](https://github
* __SX123x__ FSK/OOK radio modules (SX1231, SX1233)

### Supported protocols and digital modes:
* [__AX.25__](https://www.sigidwiki.com/wiki/PACKET) using 2-FSK or AFSK for modules:
* [__AX.25__](https://www.sigidwiki.com/wiki/PACKET) using 2-FSK or AFSK for modules:
SX127x, RFM9x, SX126x, RF69, SX1231, CC1101, RFM2x, Si443x, LR11x0 and SX128x
* [__RTTY__](https://www.sigidwiki.com/wiki/RTTY) using 2-FSK or AFSK for modules:
* [__RTTY__](https://www.sigidwiki.com/wiki/RTTY) using 2-FSK or AFSK for modules:
SX127x, RFM9x, SX126x, RF69, SX1231, CC1101, nRF24L01, RFM2x, Si443x, LR11x0 and SX128x
* [__Morse Code__](https://www.sigidwiki.com/wiki/Morse_Code_(CW)) using 2-FSK or AFSK for modules:
* [__Morse Code__](https://www.sigidwiki.com/wiki/Morse_Code_(CW)) using 2-FSK or AFSK for modules:
SX127x, RFM9x, SX126x, RF69, SX1231, CC1101, nRF24L01, RFM2x, Si443x, LR11x0 and SX128x
* [__SSTV__](https://www.sigidwiki.com/wiki/SSTV) using 2-FSK or AFSK for modules:
* [__SSTV__](https://www.sigidwiki.com/wiki/SSTV) using 2-FSK or AFSK for modules:
SX127x, RFM9x, SX126x, RF69, SX1231, CC1101, RFM2x and Si443x
* [__Hellschreiber__](https://www.sigidwiki.com/wiki/Hellschreiber) using 2-FSK or AFSK for modules:
* [__Hellschreiber__](https://www.sigidwiki.com/wiki/Hellschreiber) using 2-FSK or AFSK for modules:
SX127x, RFM9x, SX126x, RF69, SX1231, CC1101, nRF24L01, RFM2x, Si443x, LR11x0 and SX128x
* [__APRS__](https://www.sigidwiki.com/wiki/APRS) using AFSK for modules:
* [__APRS__](https://www.sigidwiki.com/wiki/APRS) using AFSK for modules:
SX127x, RFM9x, SX126x, RF69, SX1231, CC1101, nRF24L01, RFM2x, Si443x and SX128x
* [__POCSAG__](https://www.sigidwiki.com/wiki/POCSAG) using 2-FSK for modules:
* [__POCSAG__](https://www.sigidwiki.com/wiki/POCSAG) using 2-FSK for modules:
SX127x, RFM9x, RF69, SX1231, CC1101, nRF24L01, RFM2x and Si443x
* [__LoRaWAN__](https://lora-alliance.org/) using LoRa and FSK for modules:
* [__LoRaWAN__](https://lora-alliance.org/) using LoRa and FSK for modules:
SX127x, RFM9x, SX126x, LR11x0 and SX128x
* Supports Class A and C (and Multicast over C)
* Pre-certified for Class A on dynamic channelplans (EU868-style)
* See the [wiki](https://github.com/jgromes/RadioLib/wiki/LoRaWAN) and [notes](https://github.com/jgromes/RadioLib/blob/master/examples/LoRaWAN/LoRaWAN_Starter/notes.md) for more information.
Comment on lines -37 to 55
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Trailing whitespaces are necessary in Markdown to prevent formatting issues.


### Supported Arduino platforms:
* __Arduino__
* __Arduino__
* [__AVR__](https://github.com/arduino/ArduinoCore-avr) - Arduino Uno, Mega, Leonardo, Pro Mini, Nano etc.
* NOTE: Arduino boards based on ATmega328 (Uno, Pro Mini, Nano etc.) and smaller are NOT recommended. This is because the ATmega328 MCU is very constrained in terms of program and memory size, so the library will end up taking most of the space available.
* NOTE: Arduino boards based on ATmega328 (Uno, Pro Mini, Nano etc.) and smaller are NOT recommended. This is because the ATmega328 MCU is very constrained in terms of program and memory size, so the library will end up taking most of the space available.
* [__mbed__](https://github.com/arduino/ArduinoCore-mbed) - Arduino Nano 33 BLE and Arduino Portenta H7
* [__megaAVR__](https://github.com/arduino/ArduinoCore-megaavr) - Arduino Uno WiFi Rev.2 and Nano Every
* [__SAM__](https://github.com/arduino/ArduinoCore-sam) - Arduino Due
Expand Down
8 changes: 4 additions & 4 deletions examples/AFSK/AFSK_External_Radio/AFSK_External_Radio.ino
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

This example shows how to use your Arduino
as modulator for an external analogue FM radio.

The example sends APRS position reports with
audio modulated as AFSK at 1200 baud using
Bell 202 tones. However, any other AFSK
Expand Down Expand Up @@ -64,19 +64,19 @@ void setup() {

void loop() {
Serial.print(F("[APRS] Sending position ... "));

// send a location without message or timestamp
char destination[] = "N0CALL";
char latitude[] = "4911.67N";
char longitude[] = "01635.96E";
int state = aprs.sendPosition(destination, 0, latitude, longitude);
delay(500);

// send a location with message and without timestamp
char message[] = "I'm here!";
state |= aprs.sendPosition(destination, 0, latitude, longitude, message);
delay(500);

// send a location with message and timestamp
char timestamp[] = "093045z";
state |= aprs.sendPosition(destination, 0, latitude, longitude, message, timestamp);
Expand Down
2 changes: 1 addition & 1 deletion examples/AFSK/AFSK_Tone/AFSK_Tone.ino
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ void setup() {
void loop() {
// AFSKClient can be used to transmit tones,
// same as Arduino tone() function

// 400 Hz tone
Serial.print(F("[AFSK] 400 Hz tone ... "));
audio.tone(400);
Expand Down
Loading