From f3eec6492836885aba83cd8ada2a841e8ad77d3d Mon Sep 17 00:00:00 2001 From: Tomasz Duda Date: Tue, 23 Jul 2024 00:06:06 +0200 Subject: [PATCH] add clang-tidy for zephyr --- .github/workflows/ci.yml | 4 ++++ esphome/components/logger/logger_zephyr.cpp | 2 +- esphome/components/zephyr/core.cpp | 2 +- platformio.ini | 8 ++++++++ 4 files changed, 14 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a8e93248bb..38fbfe90ea 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -289,6 +289,10 @@ jobs: name: Run script/clang-tidy for ESP32 IDF options: --environment esp32-idf-tidy --grep USE_ESP_IDF pio_cache_key: tidyesp32-idf + - id: clang-tidy + name: Run script/clang-tidy for ZEPHYR + options: --environment nrf52 --grep USE_ZEPHYR + pio_cache_key: tidy-zephyr steps: - name: Check out code from GitHub diff --git a/esphome/components/logger/logger_zephyr.cpp b/esphome/components/logger/logger_zephyr.cpp index c0e9eb142d..b775e28ff3 100644 --- a/esphome/components/logger/logger_zephyr.cpp +++ b/esphome/components/logger/logger_zephyr.cpp @@ -26,7 +26,7 @@ void Logger::loop() { return; } - if (false == opened) { + if (!opened) { App.schedule_dump_config(); } opened = !opened; diff --git a/esphome/components/zephyr/core.cpp b/esphome/components/zephyr/core.cpp index c846680db2..cac9be45b5 100644 --- a/esphome/components/zephyr/core.cpp +++ b/esphome/components/zephyr/core.cpp @@ -47,7 +47,7 @@ void loop(); int main() { setup(); - while (1) { + while (true) { loop(); esphome::yield(); } diff --git a/platformio.ini b/platformio.ini index fc7f35b6c3..57669a6cfb 100644 --- a/platformio.ini +++ b/platformio.ini @@ -391,3 +391,11 @@ build_flags = ${common.build_flags} -DUSE_HOST -std=c++17 + +[env:nrf52] +extends = common +platform = platformio/nordicnrf52@10.3.0 +platform_packages = + platformio/framework-zephyr @ https://github.com/tomaszduda23/framework-sdk-nrf + platformio/toolchain-gccarmnoneeabi@https://github.com/tomaszduda23/toolchain-sdk-ng +board = adafruit_feather_nrf52840