Skip to content

Commit

Permalink
app sizes
Browse files Browse the repository at this point in the history
  • Loading branch information
root committed Jul 16, 2024
1 parent cb9a50c commit 8278573
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 8 deletions.
1 change: 1 addition & 0 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ jobs:
run: |
sudo add-apt-repository -y ppa:mongoose-os/mos
sudo apt -q install -y mos-latest
sudo mos update latest
- name: Build
run: make ${{ matrix.model }} RELEASE=1 RELEASE_SUFFIX=$(.github/version.py --suffix)
- name: Upload firmware artifacts
Expand Down
36 changes: 28 additions & 8 deletions mos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,23 @@ libs:
# - location: https://github.com/mongoose-os-libs/rpc-service-ota

conds:
- when: mos.platform == "esp32"
apply:
libs:
- location: https://github.com/mongoose-os-libs/adc
- location: https://github.com/mongoose-os-libs/pwm
cdefs:
HAVE_PWM: 1

- when: mos.platform == "esp8266"
apply:
libs:
- location: https://github.com/mongoose-os-libs/adc
- location: https://github.com/mongoose-os-libs/pwm
cdefs:
HAVE_PWM: 1


- when: mos.platform != "ubuntu"
apply:
sources:
Expand All @@ -189,8 +206,6 @@ conds:
# 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/adc
- location: https://github.com/mongoose-os-libs/pwm
- location: https://github.com/mongoose-os-libs/wifi
cdefs:
# Size fine-tuning, saves substantial amount of RAM vs defaults.
Expand Down Expand Up @@ -621,17 +636,22 @@ conds:
libs:
- location: https://github.com/mongoose-os-libs/mongoose
build_vars:
OTA_DATA_ADDR: 0x10000
OTA_DATA_SIZE: 0x4000
NVS_ADDR: 0x14000
NVS_SIZE: 0xC000
APP_OFFSET: 0x20000
APP_SLOT_SIZE: 0x280000
MGOS_ROOT_FS_TYPE: LFS
MGOS_ROOT_FS_SIZE: 458752
ESP_IDF_EXTRA_PARTITION: "scratch,data,0x80,0x3f0000,48K"
ESP_IDF_EXTRA_PARTITION_2: "shelly,data,0x88,0x3fc000,16K,encrypted"
#MGOS_ROOT_FS_SIZE: 10458752
#ESP_IDF_EXTRA_PARTITION: "scratch,data,0x80,0x720000,832K"
#ESP_IDF_EXTRA_PARTITION_2: "shelly,data,0x88,0x7F0000,64K,encrypted"
#MGOS_ROOT_FS_SIZE: 10485762
MGOS_ROOT_FS_SIZE: 1048576
ESP_IDF_EXTRA_PARTITION: "scratch,data,0x80,0x720000,0x80000,encrypted"
ESP_IDF_EXTRA_PARTITION_2: "shelly,data,0x88,0x7F0000,64K,encrypted"
ESP_IDF_SDKCONFIG_OPTS: >
${build_vars.ESP_IDF_SDKCONFIG_OPTS}
CONFIG_FREERTOS_UNICORE=y
CONFIG_ESPTOOLPY_FLASHMODE_DIO=y
CONFIG_ESPTOOLPY_FLASHSIZE_8MB=y
cdefs:
LED_GPIO: 0
LED_ON: 0
Expand Down
4 changes: 4 additions & 0 deletions src/ShellyMini1Gen3/shelly_init.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,11 @@ void CreatePeripherals(std::vector<std::unique_ptr<Input>> *inputs,
in->AddHandler(std::bind(&HandleInputResetSequence, in, LED_GPIO, _1, _2));
in->Init();
inputs->emplace_back(in);

// not yet compatible
#ifdef MGOS_HAVE_ADC
sys_temp->reset(new TempSensorSDNT1608X103F3950(3, 3.3f, 10000.0f));
#endif

InitSysLED(LED_GPIO, LED_ON);
InitSysBtn(BTN_GPIO, BTN_DOWN);
Expand Down
7 changes: 7 additions & 0 deletions src/shelly_output.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,10 @@

#include "mgos.hpp"
#include "mgos_gpio.h"

#ifdef HAVE_PWM
#include "mgos_pwm.h"
#endif

namespace shelly {

Expand Down Expand Up @@ -66,6 +69,7 @@ Status OutputPin::SetState(bool on, const char *source) {
}

Status OutputPin::SetStatePWM(float duty, const char *source) {
#ifdef HAVE_PWM
LOG(LL_INFO, ("Duty: %.3f", duty));
if (duty == 0) {
mgos_pwm_set(pin_, 0, 0);
Expand All @@ -78,6 +82,9 @@ Status OutputPin::SetStatePWM(float duty, const char *source) {
LOG(LL_INFO, ("Output %d: %f (%s)", id(), duty, source));
}
return Status::OK();
#else
return Status::UNIMPLEMENTED();
#endif
}

Status OutputPin::Pulse(bool on, int duration_ms, const char *source) {
Expand Down

0 comments on commit 8278573

Please sign in to comment.