Skip to content

Commit

Permalink
try build with latest idf
Browse files Browse the repository at this point in the history
migrate libs to shelly-homekit-os new idf builds

new_idf for plus/gen3 devices

new_idf for plus/gen3 devices

core yml
  • Loading branch information
markirb committed Jan 11, 2025
1 parent 74effa4 commit d8ed1a1
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 33 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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) && \
Expand Down
44 changes: 18 additions & 26 deletions mos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -162,42 +162,50 @@ 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
- location: https://github.com/mongoose-os-libs/rpc-service-fs
- 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"
apply:
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"]
Expand All @@ -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
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -1040,8 +1042,7 @@ conds:
libs:
- location: https://github.com/mongoose-os-libs/onewire
- location: https://github.com/mongoose-os-libs/dht
- location: https://github.com/markirb/ade7953
- location: https://github.com/mongoose-os-libs/mongoose
- location: https://github.com/shelly-homekit-mos/ade7953
build_vars:
OTA_DATA_ADDR: 0x10000
OTA_DATA_SIZE: 0x4000
Expand Down Expand Up @@ -1121,8 +1122,6 @@ conds:
- when: build_vars.MODEL == "ShellyMini1PMGen3"
apply:
name: Mini1PMG3
libs:
- location: https://github.com/mongoose-os-libs/mongoose
sources:
- src/BL0942
build_vars:
Expand Down Expand Up @@ -1175,8 +1174,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
Expand Down Expand Up @@ -1219,8 +1216,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
Expand Down Expand Up @@ -1266,7 +1261,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"
Expand Down Expand Up @@ -1326,7 +1320,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"
Expand Down Expand Up @@ -1394,7 +1387,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"
Expand Down Expand Up @@ -1636,7 +1629,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"
Expand Down
6 changes: 3 additions & 3 deletions src/shelly_input_pin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

#include "mgos.hpp"

#if CS_PLATFORM != CS_P_ESP8266
#if CS_PLATFORM == CS_P_ESP32
#include "driver/gpio.h"
#endif

Expand All @@ -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();
Expand All @@ -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
}
Expand Down
6 changes: 3 additions & 3 deletions src/shelly_output.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -46,15 +46,15 @@ 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,
on_value, OnOff(GetState())));
}

OutputPin::~OutputPin() {
#if CS_PLATFORM != CS_P_ESP8266
#if CS_PLATFORM == CS_P_ESP32
gpio_hold_en((gpio_num_t) pin_);
#endif
}
Expand Down

0 comments on commit d8ed1a1

Please sign in to comment.