diff --git a/.github/workflows/githubci.yml b/.github/workflows/githubci.yml index 21e9999..3ddc9b5 100644 --- a/.github/workflows/githubci.yml +++ b/.github/workflows/githubci.yml @@ -3,15 +3,33 @@ name: Arduino Library CI on: [pull_request, push, repository_dispatch] jobs: - build: + pre-commit: runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Run pre-commit + uses: pre-commit/action@v3.0.1 + + - uses: actions/checkout@v4 + with: + repository: adafruit/ci-arduino + path: ci + + - name: pre-install + run: bash ci/actions_install.sh + + - name: doxygen + env: + GH_REPO_TOKEN: ${{ secrets.GH_REPO_TOKEN }} + PRETTYNAME : "Adafruit Arcada Library" + run: bash ci/doxy_gen_and_deploy.sh + build: + runs-on: ubuntu-latest + needs: pre-commit steps: - - uses: actions/setup-python@v4 - with: - python-version: '3.x' - - uses: actions/checkout@v3 - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 + - uses: actions/checkout@v4 with: repository: adafruit/ci-arduino path: ci @@ -24,21 +42,12 @@ jobs: - name: list run: | - ls - ls examples/*/build/ + ls + ls examples/*/build/ - name: Upload build artifacts uses: actions/upload-artifact@v4 with: name: example_uf2s path: | - examples/*/build/*/*.uf2 - - - name: clang - run: python3 ci/run-clang-format.py -e "ci/*" -e "bin/*" -r . - - - name: doxygen - env: - GH_REPO_TOKEN: ${{ secrets.GH_REPO_TOKEN }} - PRETTYNAME : "Adafruit PyCamera Library" - run: bash ci/doxy_gen_and_deploy.sh + examples/*/build/*/*.uf2 \ No newline at end of file diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 0000000..5ea4342 --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,11 @@ +# SPDX-FileCopyrightText: 2020 Diego Elio Pettenò +# +# SPDX-License-Identifier: Unlicense + +repos: +- repo: https://github.com/pre-commit/mirrors-clang-format + rev: v15.0.7 + hooks: + - id: clang-format + types_or: [c++, c, header] + exclude: \.ino$ diff --git a/Adafruit_PyCamera.cpp b/Adafruit_PyCamera.cpp index a674d0a..791d82b 100644 --- a/Adafruit_PyCamera.cpp +++ b/Adafruit_PyCamera.cpp @@ -169,7 +169,7 @@ bool Adafruit_PyCamera::initSD(void) { } Serial.println("Card successfully initialized"); - uint32_t size = sd.card()->cardSize(); + uint32_t size = sd.card()->sectorCount(); if (size == 0) { Serial.println("Can't determine the card size"); } else { @@ -494,7 +494,7 @@ bool Adafruit_PyCamera::takePhoto(const char *filename_base, return false; } - if (!sd.card() || (sd.card()->cardSize() == 0)) { + if (!sd.card() || (sd.card()->sectorCount() == 0)) { Serial.println("No SD card found"); // try to initialize? if (!initSD()) diff --git a/Adafruit_PyCamera.h b/Adafruit_PyCamera.h index 5d8c940..21b7cad 100644 --- a/Adafruit_PyCamera.h +++ b/Adafruit_PyCamera.h @@ -3,7 +3,7 @@ #include #include #include // Hardware-specific library for ST7789 -#include +#include #ifndef TAG #define TAG "PYCAM" diff --git a/library.properties b/library.properties index 899f443..37f99b4 100644 --- a/library.properties +++ b/library.properties @@ -1,5 +1,5 @@ name=Adafruit PyCamera Library -version=1.0.7 +version=1.0.8 author=Adafruit maintainer=Adafruit sentence=Arduino library for the MEMENTO ESP32-S3 camera