diff --git a/.github/workflows/clangcheck.yml b/.github/workflows/clangcheck.yml index c35b530..3090c85 100644 --- a/.github/workflows/clangcheck.yml +++ b/.github/workflows/clangcheck.yml @@ -13,8 +13,8 @@ jobs: steps: - uses: actions/checkout@v3 - name: Run clang-format style check - uses: jidicula/clang-format-action@v4.10.2 + uses: jidicula/clang-format-action@v4.15.0 with: - clang-format-version: '15' + clang-format-version: '18' check-path: 'main' exclude-regex: '(main/lv_conf.h|main/hardware/sensors/sps30/*)' \ No newline at end of file diff --git a/.gitignore b/.gitignore index 403c8c5..51c5321 100644 --- a/.gitignore +++ b/.gitignore @@ -7,6 +7,7 @@ managed_components/ .vscode/c_cpp_properties.json .vscode/launch.json .vscode/ipch +.cache/ node_modules sdcard/ main/generated/ diff --git a/.vscode/c_cpp_properties.json b/.vscode/c_cpp_properties.json index 30eed17..68459c3 100644 --- a/.vscode/c_cpp_properties.json +++ b/.vscode/c_cpp_properties.json @@ -1,29 +1,29 @@ { - "configurations": [ - { - "name": "ESP-IDF", - "compilerPath": "${config:idf.toolsPath}/tools/xtensa-esp32s3-elf/esp-12.2.0_20230208/xtensa-esp32s3-elf/bin/xtensa-esp32s3-elf-gcc", - "cStandard": "c11", - "cppStandard": "c++17", - "includePath": [ - "${config:idf.espIdfPath}/components/**", - "${config:idf.espIdfPathWin}/components/**", - "${config:idf.espAdfPath}/components/**", - "${config:idf.espAdfPathWin}/components/**", - "${workspaceFolder}/**" - ], - "browse": { - "path": [ - "${config:idf.espIdfPath}/components", - "${config:idf.espIdfPathWin}/components", - "${config:idf.espAdfPath}/components/**", - "${config:idf.espAdfPathWin}/components/**", - "${workspaceFolder}" - ], - "limitSymbolsToIncludedHeaders": false - }, - "compileCommands": "${workspaceFolder}/build/compile_commands.json" - } - ], - "version": 4 -} + "configurations": [ + { + "name": "ESP-IDF", + "compilerPath": "${config:idf.toolsPath}/tools/xtensa-esp-elf/esp-13.2.0_20240530/xtensa-esp-elf/bin/xtensa-esp32s3-elf-gcc", + "cStandard": "c11", + "cppStandard": "c++17", + "includePath": [ + "${config:idf.espIdfPath}/components/**", + "${config:idf.espIdfPathWin}/components/**", + "${config:idf.espAdfPath}/components/**", + "${config:idf.espAdfPathWin}/components/**", + "${workspaceFolder}/**" + ], + "browse": { + "path": [ + "${config:idf.espIdfPath}/components", + "${config:idf.espIdfPathWin}/components", + "${config:idf.espAdfPath}/components/**", + "${config:idf.espAdfPathWin}/components/**", + "${workspaceFolder}" + ], + "limitSymbolsToIncludedHeaders": false + }, + "compileCommands": "${workspaceFolder}/build/compile_commands.json" + } + ], + "version": 4 +} \ No newline at end of file diff --git a/.vscode/settings.json b/.vscode/settings.json index 10797a3..b59d085 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,105 +1,108 @@ { - "idf.adapterTargetName": "esp32s3", - "idf.openOcdConfigs": [ - "board/esp32s3-builtin.cfg" - ], - "idf.portWin": "COM4", - "idf.flashType": "UART", - "files.associations": { - "sdkconfig.h": "c", - "array": "cpp", - "deque": "cpp", - "list": "cpp", - "string": "cpp", - "unordered_map": "cpp", - "vector": "cpp", - "string_view": "cpp", - "initializer_list": "cpp", - "regex": "cpp", - "lvgl.h": "c", - "esp_attr.h": "c", - "stdint.h": "c", - "atomic": "cpp", - "bit": "cpp", - "*.tcc": "cpp", - "bitset": "cpp", - "cctype": "cpp", - "chrono": "cpp", - "clocale": "cpp", - "cmath": "cpp", - "compare": "cpp", - "concepts": "cpp", - "condition_variable": "cpp", - "cstdarg": "cpp", - "cstddef": "cpp", - "cstdint": "cpp", - "cstdio": "cpp", - "cstdlib": "cpp", - "cstring": "cpp", - "ctime": "cpp", - "cwchar": "cpp", - "cwctype": "cpp", - "map": "cpp", - "set": "cpp", - "exception": "cpp", - "algorithm": "cpp", - "functional": "cpp", - "iterator": "cpp", - "memory": "cpp", - "memory_resource": "cpp", - "numeric": "cpp", - "random": "cpp", - "ratio": "cpp", - "system_error": "cpp", - "tuple": "cpp", - "type_traits": "cpp", - "utility": "cpp", - "fstream": "cpp", - "future": "cpp", - "iomanip": "cpp", - "iosfwd": "cpp", - "iostream": "cpp", - "istream": "cpp", - "limits": "cpp", - "mutex": "cpp", - "new": "cpp", - "numbers": "cpp", - "ostream": "cpp", - "semaphore": "cpp", - "sstream": "cpp", - "stdexcept": "cpp", - "stop_token": "cpp", - "streambuf": "cpp", - "thread": "cpp", - "cinttypes": "cpp", - "typeinfo": "cpp", - "optional": "cpp", - "codecvt": "cpp", - "complex": "cpp", - "netfwd": "cpp", - "locale": "cpp", - "charconv": "cpp", - "string.h": "c", - "sps30.h": "c", - "hardware.h": "c", - "source_location": "cpp", - "span": "cpp", - "esp_heap_caps.h": "c", - "esp_httpd_priv.h": "c", - "esp_system.h": "c", - "hap.h": "c", - "ui.h": "c", - "sps30_sensor_device.h": "c", - "csetjmp": "cpp", - "unordered_set": "cpp", - "esp_http_server.h": "c", - "sht3x_sensor_device.h": "c", - "scd4x_sensor_device.h": "c" - }, - "C_Cpp.errorSquiggles": "disabled", - "editor.formatOnSave": true, - "idf.port": "/dev/ttyACM0", - "idf.customExtraVars": { - "IDF_TARGET": "esp32s3" - } -} \ No newline at end of file + "idf.adapterTargetName": "esp32s3", + "idf.openOcdConfigs": [ + "board/esp32s3-builtin.cfg" + ], + "idf.portWin": "COM4", + "idf.flashType": "UART", + "files.associations": { + "sdkconfig.h": "c", + "array": "cpp", + "deque": "cpp", + "list": "cpp", + "string": "cpp", + "unordered_map": "cpp", + "vector": "cpp", + "string_view": "cpp", + "initializer_list": "cpp", + "regex": "cpp", + "lvgl.h": "c", + "esp_attr.h": "c", + "stdint.h": "c", + "atomic": "cpp", + "bit": "cpp", + "*.tcc": "cpp", + "bitset": "cpp", + "cctype": "cpp", + "chrono": "cpp", + "clocale": "cpp", + "cmath": "cpp", + "compare": "cpp", + "concepts": "cpp", + "condition_variable": "cpp", + "cstdarg": "cpp", + "cstddef": "cpp", + "cstdint": "cpp", + "cstdio": "cpp", + "cstdlib": "cpp", + "cstring": "cpp", + "ctime": "cpp", + "cwchar": "cpp", + "cwctype": "cpp", + "map": "cpp", + "set": "cpp", + "exception": "cpp", + "algorithm": "cpp", + "functional": "cpp", + "iterator": "cpp", + "memory": "cpp", + "memory_resource": "cpp", + "numeric": "cpp", + "random": "cpp", + "ratio": "cpp", + "system_error": "cpp", + "tuple": "cpp", + "type_traits": "cpp", + "utility": "cpp", + "fstream": "cpp", + "future": "cpp", + "iomanip": "cpp", + "iosfwd": "cpp", + "iostream": "cpp", + "istream": "cpp", + "limits": "cpp", + "mutex": "cpp", + "new": "cpp", + "numbers": "cpp", + "ostream": "cpp", + "semaphore": "cpp", + "sstream": "cpp", + "stdexcept": "cpp", + "stop_token": "cpp", + "streambuf": "cpp", + "thread": "cpp", + "cinttypes": "cpp", + "typeinfo": "cpp", + "optional": "cpp", + "codecvt": "cpp", + "complex": "cpp", + "netfwd": "cpp", + "locale": "cpp", + "charconv": "cpp", + "string.h": "c", + "sps30.h": "c", + "hardware.h": "c", + "source_location": "cpp", + "span": "cpp", + "esp_heap_caps.h": "c", + "esp_httpd_priv.h": "c", + "esp_system.h": "c", + "hap.h": "c", + "ui.h": "c", + "sps30_sensor_device.h": "c", + "csetjmp": "cpp", + "unordered_set": "cpp", + "esp_http_server.h": "c", + "sht3x_sensor_device.h": "c", + "scd4x_sensor_device.h": "c" + }, + "C_Cpp.errorSquiggles": "disabled", + "editor.formatOnSave": true, + "idf.port": "/dev/ttyACM0", + "idf.espIdfPath": "/home/deepak/esp/v5.1.6/esp-idf", + "idf.toolsPath": "/home/deepak/.espressif", + "idf.pythonInstallPath": "/usr/bin/python3", + "idf.customExtraVars": { + "IDF_TARGET": "esp32s3" + } +} diff --git a/dependencies.lock b/dependencies.lock index 35ca606..2ac2464 100644 --- a/dependencies.lock +++ b/dependencies.lock @@ -1,11 +1,11 @@ dependencies: bblanchon/arduinojson: - component_hash: 463812931f99cb7a554d64311288f537b43daaca3eed2427557b907af393447c + component_hash: b1c2f0b0bc26969af19809cee80b220fb882481d59cc75f8e79ebceecdc69f06 dependencies: [] source: registry_url: https://components.espressif.com/ type: service - version: 6.21.5 + version: 7.4.2 espressif/libsodium: component_hash: 25b968723c584a2742ca36cebe5a7ef049c6767e059f7b1e1eec69946019025d dependencies: @@ -35,6 +35,6 @@ direct_dependencies: - espressif/libsodium - espressif/mdns - idf -manifest_hash: dfded1dd19fea724069aaac4a789898b4f422c5dcf359824b719ce17f97737e5 +manifest_hash: 18c4389e26bede534e89973aa65e1f4d95266bcc7cea5cd7d7cdb1a74c064fde target: esp32s3 version: 2.0.0 diff --git a/main/hardware/sensors/sensor.h b/main/hardware/sensors/sensor.h index 2dc8f64..0ad9c55 100644 --- a/main/hardware/sensors/sensor.h +++ b/main/hardware/sensors/sensor.h @@ -278,20 +278,19 @@ constexpr std::array co2_definition_display{ #endif -constexpr std::array sensor_definitions -{ +constexpr std::array sensor_definitions{ sensor_definition{"PM 2.5", "µg/m³", pm_2_5_definition_display.data(), pm_2_5_definition_display.size(), 0, 1000, 1}, - sensor_definition{"Temperature", "°F", no_level.data(), no_level.size(), -40, 140, 1}, - sensor_definition{"Temperature", "°C", no_level.data(), no_level.size(), -40, 70, 0.1}, - sensor_definition{"Humidity", "⁒", no_level.data(), no_level.size(), 0, 100, 1}, + sensor_definition{"Temperature", "°F", no_level.data(), no_level.size(), -40, 140, 1}, + sensor_definition{"Temperature", "°C", no_level.data(), no_level.size(), -40, 70, 0.1}, + sensor_definition{"Humidity", "⁒", no_level.data(), no_level.size(), 0, 100, 1}, #if defined CONFIG_SCD30_SENSOR_ENABLE || defined CONFIG_SCD4x_SENSOR_ENABLE - sensor_definition{"CO2", "ppm", co2_definition_display.data(), co2_definition_display.size(), 0, 2000, 1}, + sensor_definition{"CO2", "ppm", co2_definition_display.data(), co2_definition_display.size(), 0, 2000, 1}, #endif - sensor_definition{"PM 1", "µg/m³", no_level.data(), no_level.size(), 0, 1000, 1}, - sensor_definition{"PM 4", "µg/m³", no_level.data(), no_level.size(), 0, 1000, 1}, - sensor_definition{"PM 10", "µg/m³", pm_10_definition_display.data(), pm_10_definition_display.size(), 0, 1000, 1}, - sensor_definition{"Typical Particle Size", "µg", no_level.data(), no_level.size(), 0, 10, 0.1}, - sensor_definition{"Light Intensity", "lux", no_level.data(), no_level.size(), 0, 65535, 1}, + sensor_definition{"PM 1", "µg/m³", no_level.data(), no_level.size(), 0, 1000, 1}, + sensor_definition{"PM 4", "µg/m³", no_level.data(), no_level.size(), 0, 1000, 1}, + sensor_definition{"PM 10", "µg/m³", pm_10_definition_display.data(), pm_10_definition_display.size(), 0, 1000, 1}, + sensor_definition{"Typical Particle Size", "µg", no_level.data(), no_level.size(), 0, 10, 0.1}, + sensor_definition{"Light Intensity", "lux", no_level.data(), no_level.size(), 0, 65535, 1}, }; constexpr auto &&get_sensor_definition(sensor_id_index id) diff --git a/main/homekit/homekit_definitions.h b/main/homekit/homekit_definitions.h index 61452d1..8ebd444 100644 --- a/main/homekit/homekit_definitions.h +++ b/main/homekit/homekit_definitions.h @@ -43,14 +43,12 @@ struct homekit_definition constexpr auto homekit_definitions = std::to_array({ homekit_definition{sensor_id_index::pm_2_5, HAP_SERV_UUID_AIR_QUALITY_SENSOR, HAP_CHAR_UUID_PM_2_5_DENSITY, std::string_view()}, - homekit_definition{sensor_id_index::temperatureC, HAP_SERV_UUID_TEMPERATURE_SENSOR, HAP_CHAR_UUID_CURRENT_TEMPERATURE, HAP_CHAR_UNIT_CELSIUS}, - homekit_definition{sensor_id_index::humidity, HAP_SERV_UUID_HUMIDITY_SENSOR, HAP_CHAR_UUID_CURRENT_RELATIVE_HUMIDITY, - HAP_CHAR_UNIT_PERCENTAGE}, - homekit_definition{sensor_id_index::pm_10, HAP_SERV_UUID_AIR_QUALITY_SENSOR, HAP_CHAR_UUID_PM_10_DENSITY, std::string_view()}, - homekit_definition{sensor_id_index::light_intensity, HAP_SERV_UUID_LIGHT_SENSOR, HAP_CHAR_UUID_CURRENT_AMBIENT_LIGHT_LEVEL, - HAP_CHAR_UNIT_LUX}, + homekit_definition{sensor_id_index::temperatureC, HAP_SERV_UUID_TEMPERATURE_SENSOR, HAP_CHAR_UUID_CURRENT_TEMPERATURE, HAP_CHAR_UNIT_CELSIUS}, + homekit_definition{sensor_id_index::humidity, HAP_SERV_UUID_HUMIDITY_SENSOR, HAP_CHAR_UUID_CURRENT_RELATIVE_HUMIDITY, HAP_CHAR_UNIT_PERCENTAGE}, + homekit_definition{sensor_id_index::pm_10, HAP_SERV_UUID_AIR_QUALITY_SENSOR, HAP_CHAR_UUID_PM_10_DENSITY, std::string_view()}, + homekit_definition{sensor_id_index::light_intensity, HAP_SERV_UUID_LIGHT_SENSOR, HAP_CHAR_UUID_CURRENT_AMBIENT_LIGHT_LEVEL, HAP_CHAR_UNIT_LUX}, #if defined CONFIG_SCD30_SENSOR_ENABLE || defined CONFIG_SCD4x_SENSOR_ENABLE - homekit_definition{sensor_id_index::CO2, HAP_SERV_UUID_AIR_QUALITY_SENSOR, HAP_CHAR_UUID_CARBON_DIOXIDE_LEVEL, std::string_view()}, + homekit_definition{sensor_id_index::CO2, HAP_SERV_UUID_CARBON_DIOXIDE_SENSOR, HAP_CHAR_UUID_CARBON_DIOXIDE_LEVEL, std::string_view()}, #endif }); diff --git a/main/idf_component.yml b/main/idf_component.yml index 2165cb3..9f43773 100644 --- a/main/idf_component.yml +++ b/main/idf_component.yml @@ -1,9 +1,8 @@ ## IDF Component Manager Manifest File dependencies: - bblanchon/arduinojson: "^6.21.3" ## Required IDF version idf: - version: ">=4.1.0" + version: '>=4.1.0' # # Put list of dependencies here # # For components maintained by Espressif: # component: "~1.0.0" @@ -14,4 +13,6 @@ dependencies: # # For transient dependencies `public` flag can be set. # # `public` flag doesn't have an effect dependencies of the `main` component. # # All dependencies of `main` are public by default. - # public: true \ No newline at end of file + # public: true + espressif/libsodium: ^1.0.20~2 + bblanchon/arduinojson: ^7.4.2