diff --git a/.arduino-ci.yaml b/.arduino-ci.yaml new file mode 100644 index 0000000..87bc081 --- /dev/null +++ b/.arduino-ci.yaml @@ -0,0 +1,5 @@ +only_boards: + - esp8266:esp8266:generic + - arduino:renesas_uno:unor4wifi +library_archives: + - Nanopb=https://github.com/nanopb/nanopb/archive/refs/tags/0.4.7.tar.gz=17yaz3sn0fjhxbhjy27hc2960d4h4j4m5xvxqv3psbpi0r8w82hj \ No newline at end of file diff --git a/.github/workflows/build_arduino.yml b/.github/workflows/build_arduino.yml index d850388..73d74df 100644 --- a/.github/workflows/build_arduino.yml +++ b/.github/workflows/build_arduino.yml @@ -1,18 +1,19 @@ -name: Build Arduino - +name: "CI" on: + pull_request: push: - branches: [ master ] - workflow_dispatch: - jobs: - lint: - runs-on: ubuntu-latest + ci: + runs-on: ubuntu-20.04 steps: - - name: Check out repository - uses: actions/checkout@v2 - - name: Arduino CI - uses: Arduino-CI/action@v0.1.6 - env: - EXPECT_EXAMPLES: true - EXPECT_UNITTESTS: false \ No newline at end of file + - name: Checkout this repository + uses: actions/checkout@v2 + - name: Cache for arduino-ci + uses: actions/cache@v2 + with: + path: | + ~/.arduino15 + key: ${{ runner.os }}-arduino + - name: Install nix + uses: cachix/install-nix-action@v12 + - run: nix-shell -I nixpkgs=channel:nixpkgs-unstable -p arduino-ci --run "arduino-ci" \ No newline at end of file diff --git a/.github/workflows/update_protobufs.yml b/.github/workflows/update_protobufs.yml new file mode 100644 index 0000000..9d1a89c --- /dev/null +++ b/.github/workflows/update_protobufs.yml @@ -0,0 +1,33 @@ +name: "Update protobufs and regenerate classes" +on: workflow_dispatch + +jobs: + update-protobufs: + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v3 + with: + submodules: true + + - name: Update submodule + run: | + git submodule update --remote protobufs + + - name: Download nanopb + run: | + wget https://jpa.kapsi.fi/nanopb/download/nanopb-0.4.7-linux-x86.tar.gz + tar xvzf nanopb-0.4.7-linux-x86.tar.gz + mv nanopb-0.4.7-linux-x86 nanopb-0.4.7 + + - name: Re-generate protocol buffers + run: | + ./bin/regen-protos.sh + + - name: Create pull request + uses: peter-evans/create-pull-request@v3 + with: + add-paths: | + protobufs + src/ \ No newline at end of file diff --git a/examples/SendReceiveClient/SendReceiveClient.ino b/examples/SendReceiveClient/SendReceiveClient.ino index 983d2c8..f56ac70 100644 --- a/examples/SendReceiveClient/SendReceiveClient.ino +++ b/examples/SendReceiveClient/SendReceiveClient.ino @@ -25,8 +25,8 @@ // A different baud rate to communicate with the Meshtastic device can be specified here #define BAUD_RATE 9600 -// Send a text message every this many msec -#define SEND_PERIOD (300 * 1000) +// Send a text message every this many seconds +#define SEND_PERIOD 300 uint32_t next_send_time = 0; @@ -89,6 +89,6 @@ void loop() { mt_send_text("Hello, world!", dest, channel_index); - next_send_time = now + SEND_PERIOD; + next_send_time = now + SEND_PERIOD * 1000; } }