Fix sensecap-watcher board bug (#322)

* fix: fixed the issue that the device enters re-network configuration mode by mistake when long pressing to start the device.

* fix: Do not shut down when connected to type-c.

* fix: fixed the issue that firmware verification failed during OTA for 32M flash.

* doc: update readme.

* fix: Solve the problem that the partition table configuration is not effective.
This commit is contained in:
virgil
2025-03-11 01:38:42 +08:00
committed by GitHub
parent 9bc8be2f25
commit 236e21ffc2
4 changed files with 26 additions and 3 deletions

View File

@ -60,6 +60,7 @@ Breadboard demonstration:
- <a href="https://github.com/Xinyuan-LilyGO/T-Circle-S3" target="_blank" title="LILYGO T-Circle-S3">LILYGO T-Circle-S3</a>
- <a href="https://oshwhub.com/tenclass01/xmini_c3" target="_blank" title="XiaGe Mini C3">XiaGe Mini C3</a>
- <a href="https://oshwhub.com/movecall/moji-xiaozhi-ai-derivative-editi" target="_blank" title="Movecall Moji ESP32S3">Moji XiaoZhi AI Derivative Version</a>
- <a href="https://www.seeedstudio.com/SenseCAP-Watcher-W1-A-p-5979.html" target="_blank" title="SenseCAP Watcher">SenseCAP Watcher</a>
<div style="display: flex; justify-content: space-between;">
<a href="docs/v1/lichuang-s3.jpg" target="_blank" title="LiChuang ESP32-S3 Development Board">
@ -92,6 +93,9 @@ Breadboard demonstration:
<a href="docs/v1/movecall-moji-esp32s3.jpg" target="_blank" title="Moji">
<img src="docs/v1/movecall-moji-esp32s3.jpg" width="240" />
</a>
<a href="docs/v1/sensecap_watcher.jpg" target="_blank" title="SenseCAP Watcher">
<img src="docs/v1/sensecap_watcher.jpg" width="240" />
</a>
</div>
## Firmware Section

View File

@ -60,6 +60,7 @@ Feishu ドキュメントチュートリアルをご覧ください:
- <a href="https://github.com/Xinyuan-LilyGO/T-Circle-S3" target="_blank" title="LILYGO T-Circle-S3">LILYGO T-Circle-S3</a>
- <a href="https://oshwhub.com/tenclass01/xmini_c3" target="_blank" title="XiaGe Mini C3">XiaGe Mini C3</a>
- <a href="https://oshwhub.com/movecall/moji-xiaozhi-ai-derivative-editi" target="_blank" title="Movecall Moji ESP32S3">Moji シャオジー AI 派生版</a>
- <a href="https://www.seeedstudio.com/SenseCAP-Watcher-W1-A-p-5979.html" target="_blank" title="SenseCAP Watcher">SenseCAP Watcher</a>
<div style="display: flex; justify-content: space-between;">
<a href="docs/v1/lichuang-s3.jpg" target="_blank" title="LiChuang ESP32-S3 開発ボード">
@ -89,6 +90,9 @@ Feishu ドキュメントチュートリアルをご覧ください:
<a href="docs/v1/movecall-moji-esp32s3.jpg" target="_blank" title="Moji">
<img src="docs/v1/movecall-moji-esp32s3.jpg" width="240" />
</a>
<a href="docs/v1/sensecap_watcher.jpg" target="_blank" title="SenseCAP Watcher">
<img src="docs/v1/sensecap_watcher.jpg" width="240" />
</a>
</div>
## ファームウェア部分

View File

@ -5,7 +5,10 @@
"name": "sensecap-watcher",
"sdkconfig_append": [
"CONFIG_ESPTOOLPY_FLASHSIZE_32MB=y",
"CONFIG_PARTITION_TABLE_CUSTOM_FILENAME='partitions_32M_sensecap.csv'"
"CONFIG_PARTITION_TABLE_CUSTOM_FILENAME=\"partitions_32M_sensecap.csv\"",
"CONFIG_BOOTLOADER_CACHE_32BIT_ADDR_QUAD_FLASH=y",
"CONFIG_ESPTOOLPY_FLASH_MODE_AUTO_DETECT=n",
"CONFIG_IDF_EXPERIMENTAL_FEATURES=y"
]
}
]

View File

@ -54,8 +54,13 @@ private:
});
power_save_timer_->OnShutdownRequest([this]() {
ESP_LOGI(TAG, "Shutting down");
IoExpanderSetLevel(BSP_PWR_LCD, 0);
IoExpanderSetLevel(BSP_PWR_SYSTEM, 0);
bool is_charging = (IoExpanderGetLevel(BSP_PWR_VBUS_IN_DET) == 0);
if (is_charging) {
ESP_LOGI(TAG, "charging");
GetBacklight()->SetBrightness(0);
} else {
IoExpanderSetLevel(BSP_PWR_SYSTEM, 0);
}
});
power_save_timer_->SetEnabled(true);
}
@ -123,6 +128,13 @@ private:
.priv = this,
},
};
//watcher 是通过长按滚轮进行开机的, 需要等待滚轮释放, 否则用户开机松手时可能会误触成单击
ESP_LOGI(TAG, "waiting for knob button release");
while(IoExpanderGetLevel(BSP_KNOB_BTN) == 0) {
vTaskDelay(50 / portTICK_PERIOD_MS);
}
btns = iot_button_create(&btn_config);
iot_button_register_cb(btns, BUTTON_SINGLE_CLICK, [](void* button_handle, void* usr_data) {
auto self = static_cast<SensecapWatcher*>(usr_data);