Skip to content

Commit

Permalink
[CI] Fix for new LoraWAN examples (#1035)
Browse files Browse the repository at this point in the history
* Update CI for new LoRaWAN examples

* Use single line for flags

* Fixup flag strings

* Fixup array dump helper

* Added missing LoRaWAN defines

* Drop Teensy from CI (still broken)

* Define a board for CI runs
  • Loading branch information
jgromes authored Mar 26, 2024
1 parent 9c6eb20 commit 9e4783c
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 7 deletions.
7 changes: 6 additions & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -162,9 +162,14 @@ jobs:
# skip sketch
echo -e "\n\033[1;33mSkipped ${example##*/} (matched with ${{ steps.prep.outputs.skip-pattern }})\033[0m";
else
# apply special flags for LoRaWAN
if [[ ${example} =~ "LoRaWAN" ]]; then
flags="-DRADIOLIB_LORAWAN_DEV_ADDR=0 -DRADIOLIB_LORAWAN_NWKS_KEY=0 -DRADIOLIB_LORAWAN_SNWKSINT_KEY=0 -DRADIOLIB_LORAWAN_NWKSENC_KEY=0 -DRADIOLIB_LORAWAN_APPS_KEY=0 -DRADIOLIB_LORAWAN_APP_KEY=0 -DRADIOLIB_LORAWAN_NWK_KEY=0 -DRADIOLIB_LORAWAN_DEV_EUI=0 -DARDUINO_TTGO_LORA32_V1"
fi

# build sketch
echo -e "\n\033[1;33mBuilding ${example##*/} ... \033[0m";
arduino-cli compile --libraries /home/runner/work/RadioLib --fqbn ${{ matrix.id }}${{ steps.prep.outputs.options }} $example --warnings=${{ steps.prep.outputs.warnings }}
arduino-cli compile --libraries /home/runner/work/RadioLib --fqbn ${{ matrix.id }}${{ steps.prep.outputs.options }} --build-property compiler.cpp.extra_flags="$flags" $example --warnings=${{ steps.prep.outputs.warnings }}
if [ $? -ne 0 ]; then
echo -e "\033[1;31m${example##*/} build FAILED\033[0m\n";
exit 1;
Expand Down
6 changes: 4 additions & 2 deletions examples/LoRaWAN/LoRaWAN_ABP/configABP.h
Original file line number Diff line number Diff line change
Expand Up @@ -125,8 +125,10 @@ void debug(bool isFail, const __FlashStringHelper* message, int state, bool Free

// Helper function to display a byte array
void arrayDump(uint8_t *buffer, uint16_t len) {
for (uint16_t c; c < len; c++) {
Serial.printf("%02X", buffer[c]);
for(uint16_t c = 0; c < len; c++) {
char b = buffer[c];
if(b < 0x10) { Serial.print('0'); }
Serial.print(b, HEX);
}
Serial.println();
}
Expand Down
6 changes: 4 additions & 2 deletions examples/LoRaWAN/LoRaWAN_Reference/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -120,8 +120,10 @@ void debug(bool isFail, const __FlashStringHelper* message, int state, bool Free

// Helper function to display a byte array
void arrayDump(uint8_t *buffer, uint16_t len) {
for (uint16_t c; c < len; c++) {
Serial.printf("%02X", buffer[c]);
for(uint16_t c = 0; c < len; c++) {
char b = buffer[c];
if(b < 0x10) { Serial.print('0'); }
Serial.print(b, HEX);
}
Serial.println();
}
Expand Down
6 changes: 4 additions & 2 deletions examples/LoRaWAN/LoRaWAN_Starter/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -120,8 +120,10 @@ void debug(bool isFail, const __FlashStringHelper* message, int state, bool Free

// Helper function to display a byte array
void arrayDump(uint8_t *buffer, uint16_t len) {
for (uint16_t c; c < len; c++) {
Serial.printf("%02X", buffer[c]);
for(uint16_t c = 0; c < len; c++) {
char b = buffer[c];
if(b < 0x10) { Serial.print('0'); }
Serial.print(b, HEX);
}
Serial.println();
}
Expand Down

0 comments on commit 9e4783c

Please sign in to comment.