From 30d4f9df858eafdeb0a6d5fda356a8bae92fe233 Mon Sep 17 00:00:00 2001 From: Markus Kirberg Date: Sat, 11 Jan 2025 10:45:32 +0000 Subject: [PATCH] try build with latest idf migrate libs to shelly-homekit-os new idf builds new_idf for plus/gen3 devices new_idf for plus/gen3 devices core yml --- Makefile | 2 +- mos.yml | 41 +++++++++++++++++----------------------- src/shelly_input_pin.cpp | 6 +++--- src/shelly_output.cpp | 6 +++--- 4 files changed, 24 insertions(+), 31 deletions(-) diff --git a/Makefile b/Makefile index 6c14ac61..34879cb1 100644 --- a/Makefile +++ b/Makefile @@ -174,7 +174,7 @@ ifneq "$(ALLOW_DIRTY_FS)" "1" @[ -z "$(wildcard fs/conf*.json fs/kvs.json)" ] || { echo; echo "XXX No configs in fs allowed, or set ALLOW_DIRTY_FS=1"; echo; exit 1; } endif $(MOS) build --platform=$(PLATFORM) --build-var=MODEL=$* \ - --build-dir=$(BUILD_DIR) --binary-libs-dir=./binlibs $(MOS_BUILD_FLAGS_FINAL) --repo https://github.com/markirb/mongoose-os + --build-dir=$(BUILD_DIR) --binary-libs-dir=./binlibs $(MOS_BUILD_FLAGS_FINAL) --repo https://github.com/shelly-homekit-mos/mongoose-os ifeq "$(RELEASE)" "1" [ $(PLATFORM) = ubuntu ] || \ (dir=releases/`jq -r .build_version $(BUILD_DIR)/gen/build_info.json`$(RELEASE_SUFFIX) && \ diff --git a/mos.yml b/mos.yml index 5aea8084..8cfe3cdf 100644 --- a/mos.yml +++ b/mos.yml @@ -162,9 +162,18 @@ cdefs: libs: - location: ./libreset - - location: https://github.com/markirb/core + + #for remapping deps to correct ones + #esp8266 needs old mbedtls + - location: https://github.com/shelly-homekit-mos/core + - location: https://github.com/shelly-homekit-mos/rpc-common + - location: https://github.com/shelly-homekit-mos/ota-common + - location: https://github.com/shelly-homekit-mos/vfs-common + - location: https://github.com/shelly-homekit-mos/mongoose + + - location: https://github.com/shelly-homekit-mos/homekit-adk + - location: https://github.com/mongoose-os-libs/file-logger - - location: https://github.com/mongoose-os-libs/homekit-adk - location: https://github.com/mongoose-os-libs/http-server - location: https://github.com/mongoose-os-libs/ota-http-server - location: https://github.com/mongoose-os-libs/rpc-service-config @@ -172,25 +181,21 @@ libs: - location: https://github.com/mongoose-os-libs/rpc-uart - location: https://github.com/mongoose-os-libs/rpc-ws - location: https://github.com/mongoose-os-libs/sntp + # Not enough space on 2.5 # - location: https://github.com/mongoose-os-libs/rpc-mqtt # - location: https://github.com/mongoose-os-libs/rpc-service-ota conds: - - when: mos.platform == "esp32c3" - apply: - libs: - - location: https://github.com/markirb/adc + - when: mos.platform == "esp32" apply: libs: - - location: https://github.com/mongoose-os-libs/adc - location: https://github.com/mongoose-os-libs/pwm - when: mos.platform == "esp8266" apply: libs: - - location: https://github.com/mongoose-os-libs/adc - location: https://github.com/mongoose-os-libs/pwm - when: mos.platform != "ubuntu" @@ -198,6 +203,9 @@ conds: sources: - src/noisy_input_pin - src/wifi_config + libs: + - location: https://github.com/shelly-homekit-mos/adc + - location: https://github.com/shelly-homekit-mos/wifi config_schema: - ["wifi.ap.pass", ""] - ["wifi.ap.ip", "192.168.33.1"] @@ -212,8 +220,6 @@ conds: # This is believed to be fixed, default has been flipped back to 0 in 2.11.0. # Consider removing in later releases. - ["shelly.wifi_connect_reboot_timeout", "i", 0, {title: "If not connected for this long when supposed to be, reboot"}] - libs: - - location: https://github.com/mongoose-os-libs/wifi cdefs: # Size fine-tuning, saves substantial amount of RAM vs defaults. HAP_SESSION_SIZE: 392 @@ -650,8 +656,6 @@ conds: - when: build_vars.MODEL == "ShellyPlusRGBWPM" apply: name: PlusRGBWPM - libs: - - location: https://github.com/mongoose-os-libs/mongoose sources: - src/ShellyRGBW2 build_vars: @@ -715,8 +719,6 @@ conds: sources: - src/ShellyMini1PMGen3 - src/BL0942 - libs: - - location: https://github.com/mongoose-os-libs/mongoose build_vars: MGOS_ROOT_FS_SIZE: 0x60000 APP_SLOT_SIZE: 0x190000 @@ -1121,8 +1123,6 @@ conds: - when: build_vars.MODEL == "ShellyMini1PMGen3" apply: name: Mini1PMG3 - libs: - - location: https://github.com/mongoose-os-libs/mongoose sources: - src/BL0942 build_vars: @@ -1175,8 +1175,6 @@ conds: - when: build_vars.MODEL == "ShellyMini1Gen3" apply: name: Mini1G3 - libs: - - location: https://github.com/mongoose-os-libs/mongoose build_vars: OTA_DATA_ADDR: 0x10000 OTA_DATA_SIZE: 0x4000 @@ -1219,8 +1217,6 @@ conds: name: Plus1Mini sources: - src/ShellyMini1Gen3 - libs: - - location: https://github.com/mongoose-os-libs/mongoose build_vars: MGOS_ROOT_FS_TYPE: LFS MGOS_ROOT_FS_SIZE: 0x60000 @@ -1266,7 +1262,6 @@ conds: libs: - location: https://github.com/mongoose-os-libs/onewire - location: https://github.com/mongoose-os-libs/dht - - location: https://github.com/mongoose-os-libs/mongoose build_vars: ESP_IDF_EXTRA_PARTITION: "aux,0x55,0x00,0x3f0000,48K" ESP_IDF_EXTRA_PARTITION_2: "shelly,data,0x88,0x3fc000,16K,encrypted" @@ -1326,7 +1321,6 @@ conds: libs: - location: https://github.com/mongoose-os-libs/onewire - location: https://github.com/mongoose-os-libs/dht - - location: https://github.com/mongoose-os-libs/mongoose build_vars: ESP_IDF_EXTRA_PARTITION: "aux,0x55,0x00,0x3f0000,48K" ESP_IDF_EXTRA_PARTITION_2: "shelly,data,0x88,0x3fc000,16K,encrypted" @@ -1394,7 +1388,7 @@ conds: libs: - location: https://github.com/mongoose-os-libs/onewire - location: https://github.com/mongoose-os-libs/dht - - location: https://github.com/mongoose-os-libs/ade7953 + - location: https://github.com/shelly-homekit-mos/ade7953 build_vars: ESP_IDF_EXTRA_PARTITION: "aux,0x55,0x00,0x3f0000,48K" ESP_IDF_EXTRA_PARTITION_2: "shelly,data,0x88,0x3fc000,16K,encrypted" @@ -1636,7 +1630,6 @@ conds: libs: - location: https://github.com/mongoose-os-libs/onewire - location: https://github.com/mongoose-os-libs/dht - - location: https://github.com/mongoose-os-libs/mongoose build_vars: ESP_IDF_EXTRA_PARTITION: "aux,0x55,0x00,0x3f0000,48K" ESP_IDF_EXTRA_PARTITION_2: "shelly,data,0x88,0x3fc000,16K,encrypted" diff --git a/src/shelly_input_pin.cpp b/src/shelly_input_pin.cpp index 4faf0865..887cf02b 100644 --- a/src/shelly_input_pin.cpp +++ b/src/shelly_input_pin.cpp @@ -19,7 +19,7 @@ #include "mgos.hpp" -#if CS_PLATFORM != CS_P_ESP8266 +#if CS_PLATFORM == CS_P_ESP32 #include "driver/gpio.h" #endif @@ -43,7 +43,7 @@ void InputPin::Init() { mgos_gpio_setup_input(cfg_.pin, cfg_.pull); mgos_gpio_set_button_handler(cfg_.pin, cfg_.pull, MGOS_GPIO_INT_EDGE_ANY, 20, GPIOIntHandler, this); -#if CS_PLATFORM != CS_P_ESP8266 +#if CS_PLATFORM == CS_P_ESP32 gpio_hold_dis((gpio_num_t) cfg_.pin); #endif bool state = GetState(); @@ -58,7 +58,7 @@ void InputPin::SetInvert(bool invert) { InputPin::~InputPin() { mgos_gpio_remove_int_handler(cfg_.pin, nullptr, nullptr); -#if CS_PLATFORM != CS_P_ESP8266 +#if CS_PLATFORM == CS_P_ESP32 gpio_hold_en((gpio_num_t) cfg_.pin); #endif } diff --git a/src/shelly_output.cpp b/src/shelly_output.cpp index 57dc0bf3..c44de7b2 100644 --- a/src/shelly_output.cpp +++ b/src/shelly_output.cpp @@ -20,7 +20,7 @@ #include "mgos.hpp" #include "mgos_gpio.h" -#if CS_PLATFORM != CS_P_ESP8266 +#if CS_PLATFORM == CS_P_ESP32 #include "driver/gpio.h" #endif @@ -46,7 +46,7 @@ OutputPin::OutputPin(int id, int pin, int on_value) on_value_(on_value), pulse_timer_(std::bind(&OutputPin::PulseTimerCB, this)) { mgos_gpio_set_mode(pin_, MGOS_GPIO_MODE_OUTPUT); -#if CS_PLATFORM != CS_P_ESP8266 +#if CS_PLATFORM == CS_P_ESP32 gpio_hold_dis((gpio_num_t) pin); #endif LOG(LL_INFO, ("OutputPin %d: pin %d, on_value %d, state %s", id, pin, @@ -54,7 +54,7 @@ OutputPin::OutputPin(int id, int pin, int on_value) } OutputPin::~OutputPin() { -#if CS_PLATFORM != CS_P_ESP8266 +#if CS_PLATFORM == CS_P_ESP32 gpio_hold_en((gpio_num_t) pin_); #endif }