diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 12c45391..31dcf040 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -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; diff --git a/examples/LoRaWAN/LoRaWAN_ABP/configABP.h b/examples/LoRaWAN/LoRaWAN_ABP/configABP.h index 33fd9fa0..5d8d29e1 100644 --- a/examples/LoRaWAN/LoRaWAN_ABP/configABP.h +++ b/examples/LoRaWAN/LoRaWAN_ABP/configABP.h @@ -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(); } diff --git a/examples/LoRaWAN/LoRaWAN_Reference/config.h b/examples/LoRaWAN/LoRaWAN_Reference/config.h index bba38e4f..b9c1bf71 100644 --- a/examples/LoRaWAN/LoRaWAN_Reference/config.h +++ b/examples/LoRaWAN/LoRaWAN_Reference/config.h @@ -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(); } diff --git a/examples/LoRaWAN/LoRaWAN_Starter/config.h b/examples/LoRaWAN/LoRaWAN_Starter/config.h index bba38e4f..b9c1bf71 100644 --- a/examples/LoRaWAN/LoRaWAN_Starter/config.h +++ b/examples/LoRaWAN/LoRaWAN_Starter/config.h @@ -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(); }