diff --git a/.github/ISSUE_TEMPLATE/Bug_report.md b/.github/ISSUE_TEMPLATE/Bug_report.md index 922026fb0..68ec6f45b 100644 --- a/.github/ISSUE_TEMPLATE/Bug_report.md +++ b/.github/ISSUE_TEMPLATE/Bug_report.md @@ -32,7 +32,7 @@ _Make sure your have performed every step and checked the applicable boxes befor - [ ] Searched the problem in [discussions](https://github.com/arendst/Tasmota/discussions) - [ ] Searched the problem in the [docs](https://tasmota.github.io/docs/FAQ) - [ ] Searched the problem in the [chat](https://discord.gg/Ks2Kzd4) -- [ ] Problem is not scripter related, in this case open a discussion and tag @gemu2015 +- [ ] Problem is not scripter related, in this case open a discussion and tag gemu2015 - [ ] Device used (e.g., Sonoff Basic): _____ - [ ] Tasmota binary firmware version number used: _____ - [ ] Pre-compiled diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index 4573fa759..8431a3b05 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -7,7 +7,7 @@ - [ ] Only relevant files were touched - [ ] Only one feature/fix was added per PR and the code change compiles without warnings - [ ] The code change is tested and works with Tasmota core ESP8266 V.2.7.8 - - [ ] The code change is tested and works with Tasmota core ESP32 V.3.1.1.250203 + - [ ] The code change is tested and works with Tasmota core ESP32 V.3.1.3.250411 - [ ] I accept the [CLA](https://github.com/arendst/Tasmota/blob/development/CONTRIBUTING.md#contributor-license-agreement-cla). _NOTE: The code change must pass CI tests. **Your PR cannot be merged unless tests pass**_ diff --git a/.gitignore b/.gitignore index 820b5a561..e6b5050b7 100644 --- a/.gitignore +++ b/.gitignore @@ -49,6 +49,9 @@ lib/libesp32/berry/berry *.bak *.code-workspace +## IntelliJ ###### +.idea + ## Python virtual environments for Platformio ## venv .venv diff --git a/BUILDS.md b/BUILDS.md index f73691be2..6eb2e134c 100644 --- a/BUILDS.md +++ b/BUILDS.md @@ -14,10 +14,13 @@ Note: the `minimal` variant is not listed as it shouldn't be used outside of the | USE_HOME_ASSISTANT | - | - / - | - | - | - | - | | USE_TASMOTA_DISCOVERY | x | x / x | x | x | x | x | | USE_MQTT_TLS\* | - | - / x | - | - | - | - | +| USE_MQTT_CLIENT_CERT | - | - / - | - | - | - | - | | USE_MQTT_AWS_IOT | - | - / - | - | - | - | - | | USE_4K_RSA | - | - / - | - | - | - | - | | USE_TELEGRAM | - | - / - | - | - | - | - | | USE_KNX | - | - / x | x | - | - | - | +| USE_TELNET | - | - / - | - | - | - | - | +| USE_XYZMODEM | - | - / - | - | - | - | - | | USE_WEBSERVER | x | x / x | x | x | x | x | | USE_WEBSEND_RESPONSE | - | - / - | - | - | - | - | | USE_EMULATION_HUE | x | x / x | - | x | - | - | @@ -228,7 +231,9 @@ Note: the `minimal` variant is not listed as it shouldn't be used outside of the | USE_MIEL_HVAC | - | - / - | - | - | - | - | | USE_PROJECTOR_CTRL | - | - / - | - | - | - | - | | USE_AS608 | - | - / - | - | - | - | - | +| USE_LD2402 | - | - / - | - | - | - | - | | USE_LD2410 | - | - / - | - | - | - | - | +| USE_LD2410S | - | - / - | - | - | - | - | | USE_GM861 | - | - / - | - | - | - | - | | USE_TCP_BRIDGE | - | - / - | - | - | - | - | zbbridge / zbbrdgpro | | USE_HC8 | - | - / - | - | - | - | - | diff --git a/CHANGELOG.md b/CHANGELOG.md index c4278319d..70f6ff1cf 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,77 @@ All notable changes to this project will be documented in this file. ## [Released] +## [14.6.0] 20250416 +- Release Ryan + +## [14.5.0.3] +### Added +- Extend command `GPIO` with different display options and allowing updating of module GPIO's in one go +- Berry `bytes.add()` now accepts 3-bytes values (#23200) +- Berry expose `esp_http_server` for websockets (#23206) +- AlpineJS 2.8.2 - optional for now (#23259) +- Support for XMODEM over serial and telnet if enabled with `#define USE_XYZMODEM` + +### Breaking Changed +- HASPmota added `y2_min` and `y2_max` to control the second series of `chart` (#23287) +- HASPmota default theme is now Tasmota-style (#23288) + +### Changed +- Output of commands `GPIO` and `GPIOs` swapped +- Smoothen light gamma curve when using `Fade` (#23230) +- ESP32 Platform from 2025.03.30 to 2025.04.30, Framework (Arduino Core) from v3.1.3.250302 to v3.1.3.250411 and IDF from v5.3.2.250228 to 5.3.2.250403 (#23280) +- HLK-LD2402 updates for firmware 3.3.5+ (#23281) + +### Fixed +- INA226 driver fixes (#23197) +- TLS increase timeout and fix crash (#23249) +- Berry `readline` when a line is exactly 98 characters (#23276) + +## [14.5.0.2] 20250325 +### Added +- Berry load `.tapp` files in `/.extensions/` then in `/` (#23113) +- Support Vango Technologies V924x ultralow power, single-phase, power measurement (#23127) +- Support for HLK-LD2402 24GHz smart wave motion sensor (#23133) +- Matter prepare for ICD cluster (#23158) +- Berry `re.dump()` (#23162) +- Support for Telnet server using command `Telnet <0|1|port>[,]` if enabled with `#define USE_TELNET` +- HASPmota autostart when `pages.jsonl` exists (#23181) + +### Breaking Changed +- Berry remove `Leds.create_matrix` from the standard library waiting for reimplementation (#23114) + +### Changed +- ESP32 Platform from 2025.02.30 to 2025.03.30, Framework (Arduino Core) from v3.1.1.250203 to v3.1.3.250302 and IDF from v5.3.2.250120 to 5.3.2.250228 (#23088) +- ESP32 enable webcam version 2 (#18732) +- ESP8266 enable FTP for >= 4MB variants (#23120) +- Berry update flasher for Sonoff ZBBridge Pro (#23136) +- Berry `re` now accepts `bytes()` as precompiled patterns, added `re.compilebytes()` (#23149) +- RCSwitch `RCSWITCH_SEPARATION_LIMIT` from 4100 to 3600 + +### Fixed +- Berry prevent `import` from hiding a solidified class (#23112) +- ESP32-C3 WiFi sleep (#23096) +- ESP32 intermittent exception on WiFi AP cannot be reached (#23115) +- ESP32 receive incomplete serial data over 128 bytes (#23156) + +## [14.5.0.1] 20250302 +### Added +- Berry experimental driver for AXP2101 for M5Core2v1.1 (#23039) +- LVGL experimental mirroring of display on Web UI (#23041) +- Allow acl in mqtt when client certificate is in use with `#define USE_MQTT_CLIENT_CERT` (#22998) +- Berry `tasmota.when_network_up()` and simplified Matter using it (#23057) +- Berry `introspect.solidified()` to know if a Berry object is solidified or in RAM (#23063) +- Berry `global.undef()` to undefine a global variable (#23073) + +### Changed +- LVGL, prepare for HASPmota theme, change: no-grow when clicked, DPI set to 160 (#23040) +- LVGL Mirroring add checkbox to enable/disable the feature (in the iterim for a better solution) (#23047) +- Leds Panel add checkbox to enable/disable the feature (in the iterim for a better solution) (#23048) +- GPIOViewer from v1.6.1 to v1.6.2 (No functional change) + +### Fixed +- Too many zeros in RCSwitch received data regression from v14.4.1.4 (#23050) + ## [14.5.0] 20250219 - Release Ruth diff --git a/CODE_OWNERS.md b/CODE_OWNERS.md index b2de285ee..0732e5f25 100644 --- a/CODE_OWNERS.md +++ b/CODE_OWNERS.md @@ -89,8 +89,9 @@ In addition to @arendst the following code is mainly owned by: | xdrv_75_dali | @eeak, @arendst | xdrv_76_serial_i2c | @s-hadinger | xdrv_77_wizmote | @arendst -| xdrv_78 | +| xdrv_78_telnet | @arendst | xdrv_79_esp32_ble | @staars, @btsimonh +| xdrv_80 | | xdrv_81_esp32_webcam | @gemu, @philrich | xdrv_82_esp32_ethernet | @arendst | xdrv_83_esp32_watch | @gemu @@ -105,6 +106,7 @@ In addition to @arendst the following code is mainly owned by: | xdrv_93_ | | xdrv_94_ | | | +| xdrv_120_xyzmodem | @arendst | xdrv_121_gpioviewer | @arendst | xdrv_122_file_settings_demo | @arendst | xdrv_122_file_json_settings_demo | @arendst diff --git a/RELEASENOTES.md b/RELEASENOTES.md index 462ce8357..02d3dcd83 100644 --- a/RELEASENOTES.md +++ b/RELEASENOTES.md @@ -36,9 +36,9 @@ While fallback or downgrading is common practice it was never supported due to S This release will be supported from ESP8266/Arduino library Core version **2.7.8** due to reported security and stability issues on previous Core version. This will also support gzipped binaries. -This release will be supported from ESP32/Arduino library Core version **v3.1.1.250203**. +This release will be supported from ESP32/Arduino library Core version **v3.1.3.250411**. -Support of ESP8266 Core versions before 2.7.8 and ESP32 Core versions before v3.1.1.250203 have been removed. +Support of ESP8266 Core versions before 2.7.8 and ESP32 Core versions before v3.1.3.250411 have been removed. ## Support of TLS @@ -75,12 +75,12 @@ Latest released binaries can be downloaded from - http://ota.tasmota.com/tasmota/release Historical binaries can be downloaded from -- http://ota.tasmota.com/tasmota/release-14.5.0 +- http://ota.tasmota.com/tasmota/release-14.6.0 The latter links can be used for OTA upgrades too like ``OtaUrl http://ota.tasmota.com/tasmota/release/tasmota.bin.gz`` ### ESP32, ESP32-C2, ESP32-C3, ESP32-C6, ESP32-S2 and ESP32-S3 based -The following binary downloads have been compiled with ESP32/Arduino library core version **v3.1.1.250203**. +The following binary downloads have been compiled with ESP32/Arduino library core version **v3.1.3.250411**. - **tasmota32.bin** = The Tasmota version with most drivers including additional sensors and KNX for 4M+ flash. **RECOMMENDED RELEASE BINARY** - **tasmota32solo1.bin** = The Tasmota version with most drivers including additional sensors and KNX for single core ESP32 and 4M+ flash. @@ -88,7 +88,7 @@ The following binary downloads have been compiled with ESP32/Arduino library cor - **tasmota32s2cdc.bin** = The Tasmota version with most drivers including additional sensors and KNX for ESP32-S2 with serial over embedded USB CDC only and 4M+ flash. - **tasmota32s3.bin** = The Tasmota version with most drivers including additional sensors and KNX for ESP32-S3 with USB HWCDC and fallback to serial and 4M+ flash. - **tasmota32c2.bin** = The Tasmota version with most drivers including additional sensors and KNX for ESP32-C2 with serial and 4M+ flash. -- **tasmota32c3.bin** = The Tasmota version with most drivers including additional sensors and KNX for ESP32-C2 with USB HWCDC and fallback to serial and 4M+ flash. +- **tasmota32c3.bin** = The Tasmota version with most drivers including additional sensors and KNX for ESP32-C3 with USB HWCDC and fallback to serial and 4M+ flash. - **tasmota32c6.bin** = The Tasmota version with most drivers including additional sensors and KNX for ESP32-C6 with USB HWCDC and fallback to serial and 4M+ flash. - **tasmota32-AD.bin** to **tasmota32-VN.bin** = The Tasmota version in different languages for 4M+ flash. - **tasmota32-bluetooth.bin** = The Bluetooth version adds BLE support for 4M+ flash. @@ -104,7 +104,7 @@ Latest released binaries can be downloaded from - https://ota.tasmota.com/tasmota32/release Historical binaries can be downloaded from -- https://ota.tasmota.com/tasmota32/release-14.5.0 +- https://ota.tasmota.com/tasmota32/release-14.6.0 The latter links can be used for OTA upgrades too like ``OtaUrl https://ota.tasmota.com/tasmota32/release/tasmota32.bin`` @@ -114,76 +114,55 @@ The latter links can be used for OTA upgrades too like ``OtaUrl https://ota.tasm [Complete list](BUILDS.md) of available feature and sensors. -## Changelog v14.5.0 Ruth +## Changelog v14.6.0 Ryan ### Added -- Command `SetOption163 1` to disable display of Device name in GUI header -- Command `FileLog 0..4` to enable logging to filesystem using up to 16 rotating log files of 100kB (`#define FILE_LOG_SIZE 100`) -- Command `FileLog 10..14` to enable logging to filesystem using up to 16 log files of 100kB (`#define FILE_LOG_SIZE 100`) -- Command I2sLoop [#22807](https://github.com/arendst/Tasmota/issues/22807) -- Support for Lithuanian language translations by zzdovydas [#22971](https://github.com/arendst/Tasmota/issues/22971) -- Support for PCF85063 RTC [#22727](https://github.com/arendst/Tasmota/issues/22727) -- Support for Senseair S88 CO2 sensor [#22733](https://github.com/arendst/Tasmota/issues/22733) -- Support for C8-CO2-5K CO2 sensor [#22905](https://github.com/arendst/Tasmota/issues/22905) -- Support for ESP32 Two-Wire Automotive Interface (TWAI) or Controller Area Network (CAN) busses -- `#define FIX_JSON_HEXADECIMAL` to change JSON hexadecimal value "FF5F78" into "0xFF5F78" [#22919](https://github.com/arendst/Tasmota/issues/22919) -- Support for RC-switch decoding of 64-bit received data -- Support for WiZ Smart Remote using `#define USE_WIZMOTE` and command `SetOption164 1` -- `MqttTLS` field in `Status 6` to indicate if the MQTT connection is encrypted [#22995](https://github.com/arendst/Tasmota/issues/22995) -- Formatter `%_U` for `ext_snprintf_P()` to print uint64_t variable as decimal equivalent to `%llu` -- GPS driver select baudrate using GPIO GPS_RX1 (9600bps), GPS_RX2 (19200bps) or GPS_RX3 (38400bps) [#22869](https://github.com/arendst/Tasmota/issues/22869) -- I2S AAC support for web radio [#22787](https://github.com/arendst/Tasmota/issues/22787) -- I2S Opus stream and file support for opus/aac [#22795](https://github.com/arendst/Tasmota/issues/22795) -- ESP32 command `PixelType` to change the WS2812 color order and channel number [#22876](https://github.com/arendst/Tasmota/issues/22876) -- ESP32 TasmotaLED change dynamically the number of pixels [#22754](https://github.com/arendst/Tasmota/issues/22754) -- ESP32 expand `Pixels` with reverse, height and alternate [#22755](https://github.com/arendst/Tasmota/issues/22755) -- Display template for Waveshare ESP32-C6 LCD 1.47 [#22863](https://github.com/arendst/Tasmota/issues/22863) -- Berry `animate.crenel` primitive [#22673](https://github.com/arendst/Tasmota/issues/22673) -- Berry `tasmota.int(v, min, max)` function [#22723](https://github.com/arendst/Tasmota/issues/22723) -- Berry `bytes().appendhex()` [#22767](https://github.com/arendst/Tasmota/issues/22767) -- Berry `serial.read()` read only `n` bytes [#22835](https://github.com/arendst/Tasmota/issues/22835) -- Berry `tasmota.global.tele_period` and `tasmota.settings.tele_period` [#22865](https://github.com/arendst/Tasmota/issues/22865) -- Berry `tasmota.settings` entries for PixelType [#22912](https://github.com/arendst/Tasmota/issues/22912) -- Berry `tasmota.add_rule_once` and auto-remove rules with same pattern and id [#22900](https://github.com/arendst/Tasmota/issues/22900) -- Berry driver for M5Stack 8encoder [#22724](https://github.com/arendst/Tasmota/issues/22724) -- Berry driver for AXP2102 and M5CoreS3 [#22878](https://github.com/arendst/Tasmota/issues/22878) -- Berry driver for PN532 NFC/Mifare reader [#22899](https://github.com/arendst/Tasmota/issues/22899) -- Berry example for HeatFan WiFi Controller -- Berry WS2812 real-time Leds panel as app [#22788](https://github.com/arendst/Tasmota/issues/22788) -- Berry scroll to Leds_matrix [#22693](https://github.com/arendst/Tasmota/issues/22693) -- Berry unicode encoding to string parsing [#22713](https://github.com/arendst/Tasmota/issues/22713) -- Berry light_pixels values to `tasmota.settings` [#22762](https://github.com/arendst/Tasmota/issues/22762) -- Berry `tasmota.defer()` [#22976](https://github.com/arendst/Tasmota/issues/22976) -- Berry `bytes().appendb64()` [#22767](https://github.com/arendst/Tasmota/issues/22767) -- LVLG/HASPmota add color names from OpenHASP [#22879](https://github.com/arendst/Tasmota/issues/22879) -- LVGL `lv.set_paint_cb()` to register a callback when screen is refreshed [#22909](https://github.com/arendst/Tasmota/issues/22909) -- HASPmota support for `buttonmatrix` events [#22898](https://github.com/arendst/Tasmota/issues/22898) +- Extend command `GPIO` with different display options and allowing updating of module GPIO's in one go +- Support Vango Technologies V924x ultralow power, single-phase, power measurement [#23127](https://github.com/arendst/Tasmota/issues/23127) +- Support for HLK-LD2402 24GHz smart wave motion sensor [#23133](https://github.com/arendst/Tasmota/issues/23133) +- Support for Telnet server using command `Telnet <0|1|port>[,]` if enabled with `#define USE_TELNET` +- Support for XMODEM over serial and telnet if enabled with `#define USE_XYZMODEM` +- Allow acl in mqtt when client certificate is in use with `#define USE_MQTT_CLIENT_CERT` [#22998](https://github.com/arendst/Tasmota/issues/22998) +- AlpineJS 2.8.2 - optional for now [#23259](https://github.com/arendst/Tasmota/issues/23259) +- Berry experimental driver for AXP2101 for M5Core2v1.1 [#23039](https://github.com/arendst/Tasmota/issues/23039) +- Berry `tasmota.when_network_up()` and simplified Matter using it [#23057](https://github.com/arendst/Tasmota/issues/23057) +- Berry `introspect.solidified()` to know if a Berry object is solidified or in RAM [#23063](https://github.com/arendst/Tasmota/issues/23063) +- Berry `global.undef()` to undefine a global variable [#23073](https://github.com/arendst/Tasmota/issues/23073) +- Berry load `.tapp` files in `/.extensions/` then in `/` [#23113](https://github.com/arendst/Tasmota/issues/23113) +- Berry `re.dump()` [#23162](https://github.com/arendst/Tasmota/issues/23162) +- Berry `bytes.add()` now accepts 3-bytes values [#23200](https://github.com/arendst/Tasmota/issues/23200) +- Berry expose `esp_http_server` for websockets [#23206](https://github.com/arendst/Tasmota/issues/23206) +- Matter prepare for ICD cluster [#23158](https://github.com/arendst/Tasmota/issues/23158) +- LVGL experimental mirroring of display on Web UI [#23041](https://github.com/arendst/Tasmota/issues/23041) +- HASPmota autostart when `pages.jsonl` exists [#23181](https://github.com/arendst/Tasmota/issues/23181) + +### Breaking Changed +- Berry remove `Leds.create_matrix` from the standard library waiting for reimplementation [#23114](https://github.com/arendst/Tasmota/issues/23114) +- HASPmota added `y2_min` and `y2_max` to control the second series of `chart` [#23287](https://github.com/arendst/Tasmota/issues/23287) +- HASPmota default theme is now Tasmota-style [#23288](https://github.com/arendst/Tasmota/issues/23288) ### Changed -- ESP32 Platform from 2024.12.30 to 2025.02.30, Framework (Arduino Core) from v3.1.0.241206 to v3.1.1.250203 and IDF to 5.3.2 [#22943](https://github.com/arendst/Tasmota/issues/22943) -- GPIOViewer from v1.5.6 to v1.6.1 (No functional change) -- Postpone save_data during light animation when fade is Off -- Allow negative values for AdcParam/AdcGpio INPUT, TEMP and RANGE parameters [#22809](https://github.com/arendst/Tasmota/issues/22809) -- Command `Pixels` has backwards compatible arguments fixing #22755 [#22791](https://github.com/arendst/Tasmota/issues/22791) -- ESP32 disable PSRAM check (and on restart some relay toggles) with `#define DISABLE_PSRAMCHECK true` [#21266](https://github.com/arendst/Tasmota/issues/21266) -- ESP32 Webcam resolution changes since v14.4.0 [#22901](https://github.com/arendst/Tasmota/issues/22901) -- Berry `gpio.pin_mode` frees PWM on pin -- Berry bit-shift operators to `int64` [#22709](https://github.com/arendst/Tasmota/issues/22709) -- Berry callback now passes 5 arguments instead of 4 (in line with documentation) [#22908](https://github.com/arendst/Tasmota/issues/22908) -- HASPmota use 'roboto.ttf' for automatic sizing of default font [#22697](https://github.com/arendst/Tasmota/issues/22697) -- HASPmota add 'tag' attribute for free-form JSON [#22698](https://github.com/arendst/Tasmota/issues/22698) -- HASPmota support for `tabview` [#22707](https://github.com/arendst/Tasmota/issues/22707) +- ESP32 Platform from 2025.02.30 to 2025.04.30, Framework (Arduino Core) from v3.1.1.250203 to v3.1.3.250411 and IDF from v5.3.2.250120 to 5.3.2.250403 [#23280](https://github.com/arendst/Tasmota/issues/23280) +- Output of commands `GPIO` and `GPIOs` swapped +- Smoothen light gamma curve when using `Fade` [#23230](https://github.com/arendst/Tasmota/issues/23230) +- RCSwitch `RCSWITCH_SEPARATION_LIMIT` from 4100 to 3600 +- GPIOViewer from v1.6.1 to v1.6.2 (No functional change) +- HLK-LD2402 updates for firmware 3.3.5+ [#23281](https://github.com/arendst/Tasmota/issues/23281) +- ESP8266 enable FTP for >= 4MB variants [#23120](https://github.com/arendst/Tasmota/issues/23120) +- ESP32 enable webcam version 2 [#18732](https://github.com/arendst/Tasmota/issues/18732) +- Berry update flasher for Sonoff ZBBridge Pro [#23136](https://github.com/arendst/Tasmota/issues/23136) +- Berry `re` now accepts `bytes()` as precompiled patterns, added `re.compilebytes()` [#23149](https://github.com/arendst/Tasmota/issues/23149) +- LVGL, prepare for HASPmota theme, change: no-grow when clicked, DPI set to 160 [#23040](https://github.com/arendst/Tasmota/issues/23040) +- LVGL Mirroring add checkbox to enable/disable the feature (in the iterim for a better solution) [#23047](https://github.com/arendst/Tasmota/issues/23047) +- Leds Panel add checkbox to enable/disable the feature (in the iterim for a better solution) [#23048](https://github.com/arendst/Tasmota/issues/23048) ### Fixed -- Shutter discovery message regression from v14.4.1 [#22730](https://github.com/arendst/Tasmota/issues/22730) -- LoraWan decoding of Dragino LDS02 and MerryIoT DW10 [#22880](https://github.com/arendst/Tasmota/issues/22880) -- ESP32 TasMesh broker MAC address all zeros [#23005](https://github.com/arendst/Tasmota/issues/23005) -- ESP32-Cx compilation fails on Windows [#22832](https://github.com/arendst/Tasmota/issues/22832) -- Wrong RMT channels for ESP32S3, now depends on `soc_caps.h` [#23021](https://github.com/arendst/Tasmota/issues/23021) -- Sonoff SPM `PowerOnState` overrules `SSPMPowerOnState` in mixed 4Relay setup with 4Relay version 1.0.0 -- Webcam compilation with `define USE_WEBCAM` but without `define ENABLE_RTSPSERVER` [#22686](https://github.com/arendst/Tasmota/issues/22686) -- Berry Zigbee fix wrong attributes [#22684](https://github.com/arendst/Tasmota/issues/22684) -- Berry walrus operator [#22685](https://github.com/arendst/Tasmota/issues/22685) -- Berry parser error in rare case [#22997](https://github.com/arendst/Tasmota/issues/22997) -- LVGL updated `Antiburn.tapp` [#22699](https://github.com/arendst/Tasmota/issues/22699) -- HASPmota exception when clicking on a checkbox [#23022](https://github.com/arendst/Tasmota/issues/23022) -- Matter Air Quality sensor [#22708](https://github.com/arendst/Tasmota/issues/22708) +- Too many zeros in RCSwitch received data regression from v14.4.1.4 [#23050](https://github.com/arendst/Tasmota/issues/23050) +- INA226 driver fixes [#23197](https://github.com/arendst/Tasmota/issues/23197) +- TLS increase timeout and fix crash [#23249](https://github.com/arendst/Tasmota/issues/23249) +- ESP32 receive incomplete serial data over 128 bytes [#23156](https://github.com/arendst/Tasmota/issues/23156) +- ESP32 intermittent exception on WiFi AP cannot be reached [#23115](https://github.com/arendst/Tasmota/issues/23115) +- ESP32-C3 WiFi sleep [#23096](https://github.com/arendst/Tasmota/issues/23096) +- Berry prevent `import` from hiding a solidified class [#23112](https://github.com/arendst/Tasmota/issues/23112) +- Berry `readline` when a line is exactly 98 characters [#23276](https://github.com/arendst/Tasmota/issues/23276) + +### Removed diff --git a/lib/default/TasmotaSerial-3.6.0/src/TasmotaSerial.cpp b/lib/default/TasmotaSerial-3.6.0/src/TasmotaSerial.cpp index 242aa5a99..0a25a1723 100644 --- a/lib/default/TasmotaSerial-3.6.0/src/TasmotaSerial.cpp +++ b/lib/default/TasmotaSerial-3.6.0/src/TasmotaSerial.cpp @@ -168,6 +168,12 @@ void TasmotaSerial::Esp32Begin(void) { if (m_speed <= 9600) { // At 9600, 10 chars are ~10ms uart_set_rx_full_threshold(m_uart, 10); + } else { + // At 19200, 120 chars are ~60ms + // At 76800, 120 chars are ~15ms + uart_set_rx_full_threshold(m_uart, 120); + } +/* } else if (m_speed < 115200) { // At 19200, 120 chars are ~60ms // At 76800, 120 chars are ~15ms @@ -180,6 +186,7 @@ void TasmotaSerial::Esp32Begin(void) { // At even higher speeds set 75% of the buffer uart_set_rx_full_threshold(m_uart, serial_buffer_size * 3 / 4); } +*/ // For bitrate below 115200, set the Rx time out to 6 chars instead of the default 10 if (m_speed < 115200) { // At 76800 the timeout is ~1ms diff --git a/lib/lib_basic/NeoPixelBus/library.json b/lib/lib_basic/NeoPixelBus/library.json index 306e6e094..3a5561970 100644 --- a/lib/lib_basic/NeoPixelBus/library.json +++ b/lib/lib_basic/NeoPixelBus/library.json @@ -9,11 +9,7 @@ }, "version": "2.6.7", "frameworks": "arduino", - "platforms": "*", - "dependencies": [ - { - "name": "SPI" - } - ] + "libCompatMode": "strict", + "platforms": ["espressif8266"] } diff --git a/lib/lib_basic/TasmotaLED/library.json b/lib/lib_basic/TasmotaLED/library.json index 8ee6079f5..610467c6c 100644 --- a/lib/lib_basic/TasmotaLED/library.json +++ b/lib/lib_basic/TasmotaLED/library.json @@ -11,6 +11,7 @@ "url": "https://github.com/arendst/Tasmota/lib/lib_basic/TasmotaLED" }, "frameworks": "arduino", + "libCompatMode": "strict", "platforms": [ "espressif32" ] diff --git a/lib/lib_display/UDisplay/uDisplay.h b/lib/lib_display/UDisplay/uDisplay.h index ca8de0c5f..64afbaebd 100755 --- a/lib/lib_display/UDisplay/uDisplay.h +++ b/lib/lib_display/UDisplay/uDisplay.h @@ -97,7 +97,7 @@ enum uColorType { uCOLOR_BW, uCOLOR_COLOR }; #define UDISP_WHITE 0xFFFF /* 255, 255, 255 */ #define UDISP_ORANGE 0xFD20 /* 255, 165, 0 */ #define UDISP_GREENYELLOW 0xAFE5 /* 173, 255, 47 */ -#define UDISP_PINK 0xF81F +#define UDISP_PINK 0xFc18 /* 255, 128, 192 */ #ifdef ESP8266 #define PIN_OUT_SET 0x60000304 diff --git a/lib/lib_div/FastCRC/LICENCE.md b/lib/lib_div/FastCRC/LICENCE.md new file mode 100644 index 000000000..fad4885cf --- /dev/null +++ b/lib/lib_div/FastCRC/LICENCE.md @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2016 Frank + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/lib/lib_div/FastCRC/README.md b/lib/lib_div/FastCRC/README.md new file mode 100644 index 000000000..124f8cdd0 --- /dev/null +++ b/lib/lib_div/FastCRC/README.md @@ -0,0 +1,56 @@ +FastCRC +======= + +Fast CRC Arduino library +Up to 30 times faster than crc16.h (_avr_libc) + + - uses the on-chip hardware for Teensy 3.0 / 3.1 / 3.2 / 3.5 / 3.6 + - uses fast table-algorithms for other chips + +List of supported CRC calculations: +- +7 BIT: + +CRC7 + (poly=0x09 init=0x00 refin=false refout=false xorout=0x00 check=0x75) + MultiMediaCard interface + + +8 BIT: + +SMBUS + (poly=0x07 init=0x00 refin=false refout=false xorout=0x00 check=0xf4) + +MAXIM + (poly=0x31 init=0x00 refin=true refout=true xorout=0x00 check=0xa1) + + +16 BIT: + +KERMIT (Alias CRC-16/CCITT, CRC-16/CCITT-TRUE, CRC-CCITT) + (poly=0x1021 init=0x0000 refin=true refout=true xorout=0x0000 check=0x2189 + Attention: sometimes you'll find byteswapped presentation of result in other implementations) + +CCITT-FALSE + (poly=0x1021 init=0xffff refin=false refout=false xorout=0x0000 check=0x29b1) + +MCRF4XX + (poly=0x1021 init=0xffff refin=true refout=true xorout=0x0000 check=0x6f91) + +MODBUS + (poly=0x8005 init=0xffff refin=true refout=true xorout=0x0000 check=0x4b37) + +XMODEM (Alias ZMODEM, CRC-16/ACORN) + (poly=0x1021 init=0x0000 refin=false refout=false xorout=0x0000 check=0x31c3) + +X25 (Alias CRC-16/IBM-SDLC, CRC-16/ISO-HDLC, CRC-B) + (poly=0x1021 init=0xffff refin=true refout=true xorout=0xffff check=0x906e) + + +32 BIT: + +CRC32, CRC-32/ADCCP, PKZIP, ETHERNET, 802.3 + (poly=0x04c11db7 init=0xffffffff refin=true refout=true xorout=0xffffffff check=0xcbf43926) + +CKSUM, CRC-32/POSIX + (poly=0x04c11db7 init=0x00000000 refin=false refout=false xorout=0xffffffff check=0x765e7680) diff --git a/lib/lib_div/FastCRC/keywords.txt b/lib/lib_div/FastCRC/keywords.txt new file mode 100644 index 000000000..8a547c2f9 --- /dev/null +++ b/lib/lib_div/FastCRC/keywords.txt @@ -0,0 +1,59 @@ +####################################### +# Syntax Coloring Map For FastCRC +####################################### + +####################################### +# Datatypes (KEYWORD1) +####################################### + +FastCRC7 KEYWORD1 +FastCRC8 KEYWORD1 +FastCRC14 KEYWORD1 +FastCRC16 KEYWORD1 +FastCRC32 KEYWORD1 +CRC7 KEYWORD1 +CRC8 KEYWORD1 +CRC14 KEYWORD1 +CRC16 KEYWORD1 +CRC32 KEYWORD1 + +####################################### +# Methods and Functions (KEYWORD2) +####################################### +crc7 KEYWORD2 +crc7_upd KEYWORD2 +ccitt KEYWORD2 +ccitt_upd KEYWORD2 +kermit KEYWORD2 +kermit_upd KEYWORD2 +mcrf4xx KEYWORD2 +mcrf4xx_upd KEYWORD2 +modbus KEYWORD2 +modbus_upd KEYWORD2 +xmodem KEYWORD2 +xmodem_upd KEYWORD2 +x25 KEYWORD2 +x25_upd KEYWORD2 +update KEYWORD2 +update_upd KEYWORD2 +generic KEYWORD2 +crc32 KEYWORD2 +crc32_upd KEYWORD2 +cksum KEYWORD2 +cksum_upd KEYWORD2 +darc KEYWORD2 +darc_upd KEYWORD2 +gsm KEYWORD2 +gsm_upd KEYWORD2 +eloran KEYWORD2 +eloran_upd KEYWORD2 + +####################################### +# Constants (LITERAL1) +####################################### + +CRC_FLAG_NOREFLECT LITERAL1 +CRC_FLAG_REFLECT LITERAL1 +CRC_FLAG_XOR LITERAL1 +CRC_FLAG_NOREFLECT_8 LITERAL1 +CRC_FLAG_REFLECT_SWAP LITERAL1 diff --git a/lib/lib_div/FastCRC/library.json b/lib/lib_div/FastCRC/library.json new file mode 100644 index 000000000..d0e94fc52 --- /dev/null +++ b/lib/lib_div/FastCRC/library.json @@ -0,0 +1,26 @@ +{ + "name": "FastCRC", + "keywords": "CRC7, CRC8, CRC16, CRC32", + "description": "Fast CRC routines for Arduino and PC (Teensy 3.x: CRC in hardware)", + "exclude": [ + "examples", + "examples_PC" + ], + "repository": + { + "type": "git", + "url": "https://github.com/FrankBoesing/FastCRC" + }, + "authors": + [ + { + "name": "Frank Bösing", + "email": "f.boesing@gmx.de", + "url": "https://github.com/FrankBoesing/FastCRC", + "maintainer": true + } + ], + "version": "1.44", + "frameworks": "arduino", + "platforms": "*" +} diff --git a/lib/lib_div/FastCRC/library.properties b/lib/lib_div/FastCRC/library.properties new file mode 100644 index 000000000..09c3693d3 --- /dev/null +++ b/lib/lib_div/FastCRC/library.properties @@ -0,0 +1,10 @@ +name=FastCRC +version=1.44 +author=Frank Bösing +maintainer=Frank Boesing +sentence=Fast CRC routines +paragraph= +category=Data Processing +url=https://github.com/FrankBoesing/FastCRC +architectures=* +#dot_a_linkage=true \ No newline at end of file diff --git a/lib/lib_div/FastCRC/src/FastCRC.h b/lib/lib_div/FastCRC/src/FastCRC.h new file mode 100644 index 000000000..0cb4bbc6a --- /dev/null +++ b/lib/lib_div/FastCRC/src/FastCRC.h @@ -0,0 +1,189 @@ +/* FastCRC library code is placed under the MIT license + * Copyright (c) 2014 - 2021 Frank Bösing + * + * Permission is hereby granted, free of charge, to any person obtaining + * a copy of this software and associated documentation files (the + * "Software"), to deal in the Software without restriction, including + * without limitation the rights to use, copy, modify, merge, publish, + * distribute, sublicense, and/or sell copies of the Software, and to + * permit persons to whom the Software is furnished to do so, subject to + * the following conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS + * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + + +// Teensy 3.0, Teensy 3.1: +// See K20P64M72SF1RM.pdf (Kinetis), Pages 638 - 641 for documentation of CRC Device +// See KINETIS_4N30D.pdf for Errata (Errata ID 2776) +// +// So, ALL HW-calculations are done as 32 bit. +// +// +// +// Thanks to: +// - Catalogue of parametrised CRC algorithms, CRC RevEng +// http://reveng.sourceforge.net/crc-catalogue/ +// +// - Danjel McGougan (CRC-Table-Generator) +// + + +// Set this to 0 for smaller 32BIT-CRC-Tables: +#if !defined(CRC_BIGTABLES) +#define CRC_BIGTABLES 1 +#endif + +#if !defined(FastCRC_h) +#define FastCRC_h + +#if defined(ARDUINO) +#include +#endif + +#include + + +// ================= DEFINES =================== +#if defined(KINETISK) +#define CRC_SW 0 +#define CRC_FLAG_NOREFLECT (((1<<31) | (1<<30)) | ((0<<29) | (0<<28))) //refin=false refout=false +#define CRC_FLAG_REFLECT (((1<<31) | (0<<30)) | ((1<<29) | (0<<28))) //Reflect in- and outgoing bytes (refin=true refout=true) +#define CRC_FLAG_XOR (1<<26) //Perform XOR on result +#define CRC_FLAG_NOREFLECT_8 (0) //For 8-Bit CRC +#define CRC_FLAG_REFLECT_SWAP (((1<<31) | (0<<30)) | ((0<<29) | (1<<28))) //For 16-Bit CRC (byteswap) +#else +#define CRC_SW 1 +#endif + +// ================= 7-BIT CRC =================== +class FastCRC7 +{ +public: + FastCRC7(); + uint8_t crc7(const uint8_t *data, const size_t datalen); // (MultiMediaCard interface) + uint8_t crc7_upd(const uint8_t *data, const size_t datalen); // Call for subsequent calculations with previous seed. +#if !CRC_SW + uint8_t generic(const uint8_t polyom, const uint8_t seed, const uint32_t flags, const uint8_t *data, const size_t datalen); //Not available in non-hw-variant (not T3.x) +#endif +private: +#if CRC_SW + uint8_t seed; +#else + uint8_t update(const uint8_t *data, const size_t datalen); +#endif +}; + +// ================= 8-BIT CRC =================== + +class FastCRC8 +{ +public: + FastCRC8(); + uint8_t smbus(const uint8_t *data, const size_t datalen); // Alias CRC-8 + uint8_t maxim(const uint8_t *data, const size_t datalen); // Equivalent to _crc_ibutton_update() in crc16.h from avr_libc + + uint8_t smbus_upd(const uint8_t *data, size_t datalen); // Call for subsequent calculations with previous seed. + uint8_t maxim_upd(const uint8_t *data, size_t datalen); // Call for subsequent calculations with previous seed. +#if !CRC_SW + uint8_t generic(const uint8_t polyom, const uint8_t seed, const uint32_t flags, const uint8_t *data, const size_t datalen); //Not available in non-hw-variant (not T3.x) +#endif +private: +#if CRC_SW + uint8_t seed; +#else + uint8_t update(const uint8_t *data, const size_t datalen); +#endif +}; + +// ================= 14-BIT CRC =================== + +class FastCRC14 +{ +public: +#if !CRC_SW //NO Software-implemenation so far + FastCRC14(); + uint16_t darc(const uint8_t *data, const size_t datalen); + uint16_t gsm(const uint8_t *data, const size_t datalen); + uint16_t eloran(const uint8_t *data, const size_t datalen); + uint16_t ft4(const uint8_t *data, const size_t datalen); + + uint16_t darc_upd(const uint8_t *data, size_t len); + uint16_t gsm_upd(const uint8_t *data, size_t len); + uint16_t eloran_upd(const uint8_t *data, size_t len); + uint16_t ft4_upd(const uint8_t *data, size_t len); +#endif +#if !CRC_SW + uint16_t generic(const uint16_t polyom, const uint16_t seed, const uint32_t flags, const uint8_t *data, const size_t datalen); //Not available in non-hw-variant (not T3.x) +#endif +private: +#if CRC_SW + uint16_t seed; +#else + uint16_t update(const uint8_t *data, const size_t datalen); +#endif +}; + +// ================= 16-BIT CRC =================== + +class FastCRC16 +{ +public: + FastCRC16(); + uint16_t ccitt(const uint8_t *data, const size_t datalen); // Alias "false CCITT" + uint16_t mcrf4xx(const uint8_t *data,const size_t datalen); // Equivalent to _crc_ccitt_update() in crc16.h from avr_libc + uint16_t kermit(const uint8_t *data, const size_t datalen); // Alias CRC-16/CCITT, CRC-16/CCITT-TRUE, CRC-CCITT + uint16_t modbus(const uint8_t *data, const size_t datalen); // Equivalent to _crc_16_update() in crc16.h from avr_libc + uint16_t xmodem(const uint8_t *data, const size_t datalen); // Alias ZMODEM, CRC-16/ACORN + uint16_t x25(const uint8_t *data, const size_t datalen); // Alias CRC-16/IBM-SDLC, CRC-16/ISO-HDLC, CRC-B + + uint16_t ccitt_upd(const uint8_t *data, size_t len); // Call for subsequent calculations with previous seed + uint16_t mcrf4xx_upd(const uint8_t *data, size_t len); // Call for subsequent calculations with previous seed + uint16_t kermit_upd(const uint8_t *data, size_t len); // Call for subsequent calculations with previous seed + uint16_t modbus_upd(const uint8_t *data, size_t len); // Call for subsequent calculations with previous seed + uint16_t xmodem_upd(const uint8_t *data, size_t len); // Call for subsequent calculations with previous seed + uint16_t x25_upd(const uint8_t *data, size_t len); // Call for subsequent calculations with previous seed +#if !CRC_SW + uint16_t generic(const uint16_t polyom, const uint16_t seed, const uint32_t flags, const uint8_t *data, const size_t datalen); //Not available in non-hw-variant (not T3.x) +#endif +private: +#if CRC_SW + uint16_t seed; +#else + uint16_t update(const uint8_t *data, const size_t datalen); +#endif +}; + +// ================= 32-BIT CRC =================== + +class FastCRC32 +{ +public: + FastCRC32(); + uint32_t crc32(const uint8_t *data, const size_t datalen); // Alias CRC-32/ADCCP, PKZIP, Ethernet, 802.3 + uint32_t cksum(const uint8_t *data, const size_t datalen); // Alias CRC-32/POSIX + + uint32_t crc32_upd(const uint8_t *data, size_t len); // Call for subsequent calculations with previous seed + uint32_t cksum_upd(const uint8_t *data, size_t len); // Call for subsequent calculations with previous seed +#if !CRC_SW + uint32_t generic(const uint32_t polyom, const uint32_t seed, const uint32_t flags, const uint8_t *data, const size_t datalen); //Not available in non-hw-variant (not T3.x) +#endif +private: +#if CRC_SW + uint32_t seed; +#else + uint32_t update(const uint8_t *data, const size_t datalen); +#endif +}; + +#endif diff --git a/lib/lib_div/FastCRC/src/FastCRC_tables.h b/lib/lib_div/FastCRC/src/FastCRC_tables.h new file mode 100644 index 000000000..127385c94 --- /dev/null +++ b/lib/lib_div/FastCRC/src/FastCRC_tables.h @@ -0,0 +1,1596 @@ +/* FastCRC library code is placed under the MIT license + * Copyright (c) 2014 - 2021 Frank Bösing + * + * Permission is hereby granted, free of charge, to any person obtaining + * a copy of this software and associated documentation files (the + * "Software"), to deal in the Software without restriction, including + * without limitation the rights to use, copy, modify, merge, publish, + * distribute, sublicense, and/or sell copies of the Software, and to + * permit persons to whom the Software is furnished to do so, subject to + * the following conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS + * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + + /* + Tables generated with universal_crc by Danjel McGougan + */ + + +#if !defined(FastCRC_tables) +#define FastCRC_tables +#include + +#if !defined(__SAM3X8E__) +#if defined(__AVR__ ) || defined(__IMXRT1062__) || defined(ARDUINO_ARCH_STM32F1) || defined(ARDUINO_ARCH_SAMD) || defined(ARDUINO_UNOR4_MINIMA) || defined(ARDUINO_UNOR4_WIFI) || defined(ARDUINO_NANO_RP2040_CONNECT) +#include +#else +#if defined(ARDUINO) || defined(ARDUINO_ARCH_ESP32) +#include +#endif +#endif +#endif +#ifndef PROGMEM +// usefull if you're trying to test the lib in a non arduino env (in cppyy on x64 for exemple) +#define PROGMEM +#define PROGMEM_MOCK_ACTIVE +#endif +const uint8_t crc_table_crc7[256] PROGMEM = { + 0x00, 0x12, 0x24, 0x36, 0x48, 0x5a, 0x6c, 0x7e, + 0x90, 0x82, 0xb4, 0xa6, 0xd8, 0xca, 0xfc, 0xee, + 0x32, 0x20, 0x16, 0x04, 0x7a, 0x68, 0x5e, 0x4c, + 0xa2, 0xb0, 0x86, 0x94, 0xea, 0xf8, 0xce, 0xdc, + 0x64, 0x76, 0x40, 0x52, 0x2c, 0x3e, 0x08, 0x1a, + 0xf4, 0xe6, 0xd0, 0xc2, 0xbc, 0xae, 0x98, 0x8a, + 0x56, 0x44, 0x72, 0x60, 0x1e, 0x0c, 0x3a, 0x28, + 0xc6, 0xd4, 0xe2, 0xf0, 0x8e, 0x9c, 0xaa, 0xb8, + 0xc8, 0xda, 0xec, 0xfe, 0x80, 0x92, 0xa4, 0xb6, + 0x58, 0x4a, 0x7c, 0x6e, 0x10, 0x02, 0x34, 0x26, + 0xfa, 0xe8, 0xde, 0xcc, 0xb2, 0xa0, 0x96, 0x84, + 0x6a, 0x78, 0x4e, 0x5c, 0x22, 0x30, 0x06, 0x14, + 0xac, 0xbe, 0x88, 0x9a, 0xe4, 0xf6, 0xc0, 0xd2, + 0x3c, 0x2e, 0x18, 0x0a, 0x74, 0x66, 0x50, 0x42, + 0x9e, 0x8c, 0xba, 0xa8, 0xd6, 0xc4, 0xf2, 0xe0, + 0x0e, 0x1c, 0x2a, 0x38, 0x46, 0x54, 0x62, 0x70, + 0x82, 0x90, 0xa6, 0xb4, 0xca, 0xd8, 0xee, 0xfc, + 0x12, 0x00, 0x36, 0x24, 0x5a, 0x48, 0x7e, 0x6c, + 0xb0, 0xa2, 0x94, 0x86, 0xf8, 0xea, 0xdc, 0xce, + 0x20, 0x32, 0x04, 0x16, 0x68, 0x7a, 0x4c, 0x5e, + 0xe6, 0xf4, 0xc2, 0xd0, 0xae, 0xbc, 0x8a, 0x98, + 0x76, 0x64, 0x52, 0x40, 0x3e, 0x2c, 0x1a, 0x08, + 0xd4, 0xc6, 0xf0, 0xe2, 0x9c, 0x8e, 0xb8, 0xaa, + 0x44, 0x56, 0x60, 0x72, 0x0c, 0x1e, 0x28, 0x3a, + 0x4a, 0x58, 0x6e, 0x7c, 0x02, 0x10, 0x26, 0x34, + 0xda, 0xc8, 0xfe, 0xec, 0x92, 0x80, 0xb6, 0xa4, + 0x78, 0x6a, 0x5c, 0x4e, 0x30, 0x22, 0x14, 0x06, + 0xe8, 0xfa, 0xcc, 0xde, 0xa0, 0xb2, 0x84, 0x96, + 0x2e, 0x3c, 0x0a, 0x18, 0x66, 0x74, 0x42, 0x50, + 0xbe, 0xac, 0x9a, 0x88, 0xf6, 0xe4, 0xd2, 0xc0, + 0x1c, 0x0e, 0x38, 0x2a, 0x54, 0x46, 0x70, 0x62, + 0x8c, 0x9e, 0xa8, 0xba, 0xc4, 0xd6, 0xe0, 0xf2 +}; + +const uint8_t crc_table_smbus[256] PROGMEM = { + 0x00, 0x07, 0x0e, 0x09, 0x1c, 0x1b, 0x12, 0x15, + 0x38, 0x3f, 0x36, 0x31, 0x24, 0x23, 0x2a, 0x2d, + 0x70, 0x77, 0x7e, 0x79, 0x6c, 0x6b, 0x62, 0x65, + 0x48, 0x4f, 0x46, 0x41, 0x54, 0x53, 0x5a, 0x5d, + 0xe0, 0xe7, 0xee, 0xe9, 0xfc, 0xfb, 0xf2, 0xf5, + 0xd8, 0xdf, 0xd6, 0xd1, 0xc4, 0xc3, 0xca, 0xcd, + 0x90, 0x97, 0x9e, 0x99, 0x8c, 0x8b, 0x82, 0x85, + 0xa8, 0xaf, 0xa6, 0xa1, 0xb4, 0xb3, 0xba, 0xbd, + 0xc7, 0xc0, 0xc9, 0xce, 0xdb, 0xdc, 0xd5, 0xd2, + 0xff, 0xf8, 0xf1, 0xf6, 0xe3, 0xe4, 0xed, 0xea, + 0xb7, 0xb0, 0xb9, 0xbe, 0xab, 0xac, 0xa5, 0xa2, + 0x8f, 0x88, 0x81, 0x86, 0x93, 0x94, 0x9d, 0x9a, + 0x27, 0x20, 0x29, 0x2e, 0x3b, 0x3c, 0x35, 0x32, + 0x1f, 0x18, 0x11, 0x16, 0x03, 0x04, 0x0d, 0x0a, + 0x57, 0x50, 0x59, 0x5e, 0x4b, 0x4c, 0x45, 0x42, + 0x6f, 0x68, 0x61, 0x66, 0x73, 0x74, 0x7d, 0x7a, + 0x89, 0x8e, 0x87, 0x80, 0x95, 0x92, 0x9b, 0x9c, + 0xb1, 0xb6, 0xbf, 0xb8, 0xad, 0xaa, 0xa3, 0xa4, + 0xf9, 0xfe, 0xf7, 0xf0, 0xe5, 0xe2, 0xeb, 0xec, + 0xc1, 0xc6, 0xcf, 0xc8, 0xdd, 0xda, 0xd3, 0xd4, + 0x69, 0x6e, 0x67, 0x60, 0x75, 0x72, 0x7b, 0x7c, + 0x51, 0x56, 0x5f, 0x58, 0x4d, 0x4a, 0x43, 0x44, + 0x19, 0x1e, 0x17, 0x10, 0x05, 0x02, 0x0b, 0x0c, + 0x21, 0x26, 0x2f, 0x28, 0x3d, 0x3a, 0x33, 0x34, + 0x4e, 0x49, 0x40, 0x47, 0x52, 0x55, 0x5c, 0x5b, + 0x76, 0x71, 0x78, 0x7f, 0x6a, 0x6d, 0x64, 0x63, + 0x3e, 0x39, 0x30, 0x37, 0x22, 0x25, 0x2c, 0x2b, + 0x06, 0x01, 0x08, 0x0f, 0x1a, 0x1d, 0x14, 0x13, + 0xae, 0xa9, 0xa0, 0xa7, 0xb2, 0xb5, 0xbc, 0xbb, + 0x96, 0x91, 0x98, 0x9f, 0x8a, 0x8d, 0x84, 0x83, + 0xde, 0xd9, 0xd0, 0xd7, 0xc2, 0xc5, 0xcc, 0xcb, + 0xe6, 0xe1, 0xe8, 0xef, 0xfa, 0xfd, 0xf4, 0xf3 +}; + +const uint8_t crc_table_maxim[256] PROGMEM = { + 0x00, 0x5e, 0xbc, 0xe2, 0x61, 0x3f, 0xdd, 0x83, + 0xc2, 0x9c, 0x7e, 0x20, 0xa3, 0xfd, 0x1f, 0x41, + 0x9d, 0xc3, 0x21, 0x7f, 0xfc, 0xa2, 0x40, 0x1e, + 0x5f, 0x01, 0xe3, 0xbd, 0x3e, 0x60, 0x82, 0xdc, + 0x23, 0x7d, 0x9f, 0xc1, 0x42, 0x1c, 0xfe, 0xa0, + 0xe1, 0xbf, 0x5d, 0x03, 0x80, 0xde, 0x3c, 0x62, + 0xbe, 0xe0, 0x02, 0x5c, 0xdf, 0x81, 0x63, 0x3d, + 0x7c, 0x22, 0xc0, 0x9e, 0x1d, 0x43, 0xa1, 0xff, + 0x46, 0x18, 0xfa, 0xa4, 0x27, 0x79, 0x9b, 0xc5, + 0x84, 0xda, 0x38, 0x66, 0xe5, 0xbb, 0x59, 0x07, + 0xdb, 0x85, 0x67, 0x39, 0xba, 0xe4, 0x06, 0x58, + 0x19, 0x47, 0xa5, 0xfb, 0x78, 0x26, 0xc4, 0x9a, + 0x65, 0x3b, 0xd9, 0x87, 0x04, 0x5a, 0xb8, 0xe6, + 0xa7, 0xf9, 0x1b, 0x45, 0xc6, 0x98, 0x7a, 0x24, + 0xf8, 0xa6, 0x44, 0x1a, 0x99, 0xc7, 0x25, 0x7b, + 0x3a, 0x64, 0x86, 0xd8, 0x5b, 0x05, 0xe7, 0xb9, + 0x8c, 0xd2, 0x30, 0x6e, 0xed, 0xb3, 0x51, 0x0f, + 0x4e, 0x10, 0xf2, 0xac, 0x2f, 0x71, 0x93, 0xcd, + 0x11, 0x4f, 0xad, 0xf3, 0x70, 0x2e, 0xcc, 0x92, + 0xd3, 0x8d, 0x6f, 0x31, 0xb2, 0xec, 0x0e, 0x50, + 0xaf, 0xf1, 0x13, 0x4d, 0xce, 0x90, 0x72, 0x2c, + 0x6d, 0x33, 0xd1, 0x8f, 0x0c, 0x52, 0xb0, 0xee, + 0x32, 0x6c, 0x8e, 0xd0, 0x53, 0x0d, 0xef, 0xb1, + 0xf0, 0xae, 0x4c, 0x12, 0x91, 0xcf, 0x2d, 0x73, + 0xca, 0x94, 0x76, 0x28, 0xab, 0xf5, 0x17, 0x49, + 0x08, 0x56, 0xb4, 0xea, 0x69, 0x37, 0xd5, 0x8b, + 0x57, 0x09, 0xeb, 0xb5, 0x36, 0x68, 0x8a, 0xd4, + 0x95, 0xcb, 0x29, 0x77, 0xf4, 0xaa, 0x48, 0x16, + 0xe9, 0xb7, 0x55, 0x0b, 0x88, 0xd6, 0x34, 0x6a, + 0x2b, 0x75, 0x97, 0xc9, 0x4a, 0x14, 0xf6, 0xa8, + 0x74, 0x2a, 0xc8, 0x96, 0x15, 0x4b, 0xa9, 0xf7, + 0xb6, 0xe8, 0x0a, 0x54, 0xd7, 0x89, 0x6b, 0x35 +}; + +const unsigned short crc_table_ccitt[1024] PROGMEM = { + 0x0000, 0x2110, 0x4220, 0x6330, 0x8440, 0xa550, 0xc660, 0xe770, + 0x0881, 0x2991, 0x4aa1, 0x6bb1, 0x8cc1, 0xadd1, 0xcee1, 0xeff1, + 0x3112, 0x1002, 0x7332, 0x5222, 0xb552, 0x9442, 0xf772, 0xd662, + 0x3993, 0x1883, 0x7bb3, 0x5aa3, 0xbdd3, 0x9cc3, 0xfff3, 0xdee3, + 0x6224, 0x4334, 0x2004, 0x0114, 0xe664, 0xc774, 0xa444, 0x8554, + 0x6aa5, 0x4bb5, 0x2885, 0x0995, 0xeee5, 0xcff5, 0xacc5, 0x8dd5, + 0x5336, 0x7226, 0x1116, 0x3006, 0xd776, 0xf666, 0x9556, 0xb446, + 0x5bb7, 0x7aa7, 0x1997, 0x3887, 0xdff7, 0xfee7, 0x9dd7, 0xbcc7, + 0xc448, 0xe558, 0x8668, 0xa778, 0x4008, 0x6118, 0x0228, 0x2338, + 0xccc9, 0xedd9, 0x8ee9, 0xaff9, 0x4889, 0x6999, 0x0aa9, 0x2bb9, + 0xf55a, 0xd44a, 0xb77a, 0x966a, 0x711a, 0x500a, 0x333a, 0x122a, + 0xfddb, 0xdccb, 0xbffb, 0x9eeb, 0x799b, 0x588b, 0x3bbb, 0x1aab, + 0xa66c, 0x877c, 0xe44c, 0xc55c, 0x222c, 0x033c, 0x600c, 0x411c, + 0xaeed, 0x8ffd, 0xeccd, 0xcddd, 0x2aad, 0x0bbd, 0x688d, 0x499d, + 0x977e, 0xb66e, 0xd55e, 0xf44e, 0x133e, 0x322e, 0x511e, 0x700e, + 0x9fff, 0xbeef, 0xdddf, 0xfccf, 0x1bbf, 0x3aaf, 0x599f, 0x788f, + 0x8891, 0xa981, 0xcab1, 0xeba1, 0x0cd1, 0x2dc1, 0x4ef1, 0x6fe1, + 0x8010, 0xa100, 0xc230, 0xe320, 0x0450, 0x2540, 0x4670, 0x6760, + 0xb983, 0x9893, 0xfba3, 0xdab3, 0x3dc3, 0x1cd3, 0x7fe3, 0x5ef3, + 0xb102, 0x9012, 0xf322, 0xd232, 0x3542, 0x1452, 0x7762, 0x5672, + 0xeab5, 0xcba5, 0xa895, 0x8985, 0x6ef5, 0x4fe5, 0x2cd5, 0x0dc5, + 0xe234, 0xc324, 0xa014, 0x8104, 0x6674, 0x4764, 0x2454, 0x0544, + 0xdba7, 0xfab7, 0x9987, 0xb897, 0x5fe7, 0x7ef7, 0x1dc7, 0x3cd7, + 0xd326, 0xf236, 0x9106, 0xb016, 0x5766, 0x7676, 0x1546, 0x3456, + 0x4cd9, 0x6dc9, 0x0ef9, 0x2fe9, 0xc899, 0xe989, 0x8ab9, 0xaba9, + 0x4458, 0x6548, 0x0678, 0x2768, 0xc018, 0xe108, 0x8238, 0xa328, + 0x7dcb, 0x5cdb, 0x3feb, 0x1efb, 0xf98b, 0xd89b, 0xbbab, 0x9abb, + 0x754a, 0x545a, 0x376a, 0x167a, 0xf10a, 0xd01a, 0xb32a, 0x923a, + 0x2efd, 0x0fed, 0x6cdd, 0x4dcd, 0xaabd, 0x8bad, 0xe89d, 0xc98d, + 0x267c, 0x076c, 0x645c, 0x454c, 0xa23c, 0x832c, 0xe01c, 0xc10c, + 0x1fef, 0x3eff, 0x5dcf, 0x7cdf, 0x9baf, 0xbabf, 0xd98f, 0xf89f, + 0x176e, 0x367e, 0x554e, 0x745e, 0x932e, 0xb23e, 0xd10e, 0xf01e, + 0x0000, 0x3133, 0x6266, 0x5355, 0xc4cc, 0xf5ff, 0xa6aa, 0x9799, + 0xa989, 0x98ba, 0xcbef, 0xfadc, 0x6d45, 0x5c76, 0x0f23, 0x3e10, + 0x7303, 0x4230, 0x1165, 0x2056, 0xb7cf, 0x86fc, 0xd5a9, 0xe49a, + 0xda8a, 0xebb9, 0xb8ec, 0x89df, 0x1e46, 0x2f75, 0x7c20, 0x4d13, + 0xe606, 0xd735, 0x8460, 0xb553, 0x22ca, 0x13f9, 0x40ac, 0x719f, + 0x4f8f, 0x7ebc, 0x2de9, 0x1cda, 0x8b43, 0xba70, 0xe925, 0xd816, + 0x9505, 0xa436, 0xf763, 0xc650, 0x51c9, 0x60fa, 0x33af, 0x029c, + 0x3c8c, 0x0dbf, 0x5eea, 0x6fd9, 0xf840, 0xc973, 0x9a26, 0xab15, + 0xcc0d, 0xfd3e, 0xae6b, 0x9f58, 0x08c1, 0x39f2, 0x6aa7, 0x5b94, + 0x6584, 0x54b7, 0x07e2, 0x36d1, 0xa148, 0x907b, 0xc32e, 0xf21d, + 0xbf0e, 0x8e3d, 0xdd68, 0xec5b, 0x7bc2, 0x4af1, 0x19a4, 0x2897, + 0x1687, 0x27b4, 0x74e1, 0x45d2, 0xd24b, 0xe378, 0xb02d, 0x811e, + 0x2a0b, 0x1b38, 0x486d, 0x795e, 0xeec7, 0xdff4, 0x8ca1, 0xbd92, + 0x8382, 0xb2b1, 0xe1e4, 0xd0d7, 0x474e, 0x767d, 0x2528, 0x141b, + 0x5908, 0x683b, 0x3b6e, 0x0a5d, 0x9dc4, 0xacf7, 0xffa2, 0xce91, + 0xf081, 0xc1b2, 0x92e7, 0xa3d4, 0x344d, 0x057e, 0x562b, 0x6718, + 0x981b, 0xa928, 0xfa7d, 0xcb4e, 0x5cd7, 0x6de4, 0x3eb1, 0x0f82, + 0x3192, 0x00a1, 0x53f4, 0x62c7, 0xf55e, 0xc46d, 0x9738, 0xa60b, + 0xeb18, 0xda2b, 0x897e, 0xb84d, 0x2fd4, 0x1ee7, 0x4db2, 0x7c81, + 0x4291, 0x73a2, 0x20f7, 0x11c4, 0x865d, 0xb76e, 0xe43b, 0xd508, + 0x7e1d, 0x4f2e, 0x1c7b, 0x2d48, 0xbad1, 0x8be2, 0xd8b7, 0xe984, + 0xd794, 0xe6a7, 0xb5f2, 0x84c1, 0x1358, 0x226b, 0x713e, 0x400d, + 0x0d1e, 0x3c2d, 0x6f78, 0x5e4b, 0xc9d2, 0xf8e1, 0xabb4, 0x9a87, + 0xa497, 0x95a4, 0xc6f1, 0xf7c2, 0x605b, 0x5168, 0x023d, 0x330e, + 0x5416, 0x6525, 0x3670, 0x0743, 0x90da, 0xa1e9, 0xf2bc, 0xc38f, + 0xfd9f, 0xccac, 0x9ff9, 0xaeca, 0x3953, 0x0860, 0x5b35, 0x6a06, + 0x2715, 0x1626, 0x4573, 0x7440, 0xe3d9, 0xd2ea, 0x81bf, 0xb08c, + 0x8e9c, 0xbfaf, 0xecfa, 0xddc9, 0x4a50, 0x7b63, 0x2836, 0x1905, + 0xb210, 0x8323, 0xd076, 0xe145, 0x76dc, 0x47ef, 0x14ba, 0x2589, + 0x1b99, 0x2aaa, 0x79ff, 0x48cc, 0xdf55, 0xee66, 0xbd33, 0x8c00, + 0xc113, 0xf020, 0xa375, 0x9246, 0x05df, 0x34ec, 0x67b9, 0x568a, + 0x689a, 0x59a9, 0x0afc, 0x3bcf, 0xac56, 0x9d65, 0xce30, 0xff03, + 0x0000, 0x3037, 0x606e, 0x5059, 0xc0dc, 0xf0eb, 0xa0b2, 0x9085, + 0xa1a9, 0x919e, 0xc1c7, 0xf1f0, 0x6175, 0x5142, 0x011b, 0x312c, + 0x6343, 0x5374, 0x032d, 0x331a, 0xa39f, 0x93a8, 0xc3f1, 0xf3c6, + 0xc2ea, 0xf2dd, 0xa284, 0x92b3, 0x0236, 0x3201, 0x6258, 0x526f, + 0xc686, 0xf6b1, 0xa6e8, 0x96df, 0x065a, 0x366d, 0x6634, 0x5603, + 0x672f, 0x5718, 0x0741, 0x3776, 0xa7f3, 0x97c4, 0xc79d, 0xf7aa, + 0xa5c5, 0x95f2, 0xc5ab, 0xf59c, 0x6519, 0x552e, 0x0577, 0x3540, + 0x046c, 0x345b, 0x6402, 0x5435, 0xc4b0, 0xf487, 0xa4de, 0x94e9, + 0xad1d, 0x9d2a, 0xcd73, 0xfd44, 0x6dc1, 0x5df6, 0x0daf, 0x3d98, + 0x0cb4, 0x3c83, 0x6cda, 0x5ced, 0xcc68, 0xfc5f, 0xac06, 0x9c31, + 0xce5e, 0xfe69, 0xae30, 0x9e07, 0x0e82, 0x3eb5, 0x6eec, 0x5edb, + 0x6ff7, 0x5fc0, 0x0f99, 0x3fae, 0xaf2b, 0x9f1c, 0xcf45, 0xff72, + 0x6b9b, 0x5bac, 0x0bf5, 0x3bc2, 0xab47, 0x9b70, 0xcb29, 0xfb1e, + 0xca32, 0xfa05, 0xaa5c, 0x9a6b, 0x0aee, 0x3ad9, 0x6a80, 0x5ab7, + 0x08d8, 0x38ef, 0x68b6, 0x5881, 0xc804, 0xf833, 0xa86a, 0x985d, + 0xa971, 0x9946, 0xc91f, 0xf928, 0x69ad, 0x599a, 0x09c3, 0x39f4, + 0x5a3b, 0x6a0c, 0x3a55, 0x0a62, 0x9ae7, 0xaad0, 0xfa89, 0xcabe, + 0xfb92, 0xcba5, 0x9bfc, 0xabcb, 0x3b4e, 0x0b79, 0x5b20, 0x6b17, + 0x3978, 0x094f, 0x5916, 0x6921, 0xf9a4, 0xc993, 0x99ca, 0xa9fd, + 0x98d1, 0xa8e6, 0xf8bf, 0xc888, 0x580d, 0x683a, 0x3863, 0x0854, + 0x9cbd, 0xac8a, 0xfcd3, 0xcce4, 0x5c61, 0x6c56, 0x3c0f, 0x0c38, + 0x3d14, 0x0d23, 0x5d7a, 0x6d4d, 0xfdc8, 0xcdff, 0x9da6, 0xad91, + 0xfffe, 0xcfc9, 0x9f90, 0xafa7, 0x3f22, 0x0f15, 0x5f4c, 0x6f7b, + 0x5e57, 0x6e60, 0x3e39, 0x0e0e, 0x9e8b, 0xaebc, 0xfee5, 0xced2, + 0xf726, 0xc711, 0x9748, 0xa77f, 0x37fa, 0x07cd, 0x5794, 0x67a3, + 0x568f, 0x66b8, 0x36e1, 0x06d6, 0x9653, 0xa664, 0xf63d, 0xc60a, + 0x9465, 0xa452, 0xf40b, 0xc43c, 0x54b9, 0x648e, 0x34d7, 0x04e0, + 0x35cc, 0x05fb, 0x55a2, 0x6595, 0xf510, 0xc527, 0x957e, 0xa549, + 0x31a0, 0x0197, 0x51ce, 0x61f9, 0xf17c, 0xc14b, 0x9112, 0xa125, + 0x9009, 0xa03e, 0xf067, 0xc050, 0x50d5, 0x60e2, 0x30bb, 0x008c, + 0x52e3, 0x62d4, 0x328d, 0x02ba, 0x923f, 0xa208, 0xf251, 0xc266, + 0xf34a, 0xc37d, 0x9324, 0xa313, 0x3396, 0x03a1, 0x53f8, 0x63cf, + 0x0000, 0xb476, 0x68ed, 0xdc9b, 0xf1ca, 0x45bc, 0x9927, 0x2d51, + 0xc385, 0x77f3, 0xab68, 0x1f1e, 0x324f, 0x8639, 0x5aa2, 0xeed4, + 0xa71b, 0x136d, 0xcff6, 0x7b80, 0x56d1, 0xe2a7, 0x3e3c, 0x8a4a, + 0x649e, 0xd0e8, 0x0c73, 0xb805, 0x9554, 0x2122, 0xfdb9, 0x49cf, + 0x4e37, 0xfa41, 0x26da, 0x92ac, 0xbffd, 0x0b8b, 0xd710, 0x6366, + 0x8db2, 0x39c4, 0xe55f, 0x5129, 0x7c78, 0xc80e, 0x1495, 0xa0e3, + 0xe92c, 0x5d5a, 0x81c1, 0x35b7, 0x18e6, 0xac90, 0x700b, 0xc47d, + 0x2aa9, 0x9edf, 0x4244, 0xf632, 0xdb63, 0x6f15, 0xb38e, 0x07f8, + 0x9c6e, 0x2818, 0xf483, 0x40f5, 0x6da4, 0xd9d2, 0x0549, 0xb13f, + 0x5feb, 0xeb9d, 0x3706, 0x8370, 0xae21, 0x1a57, 0xc6cc, 0x72ba, + 0x3b75, 0x8f03, 0x5398, 0xe7ee, 0xcabf, 0x7ec9, 0xa252, 0x1624, + 0xf8f0, 0x4c86, 0x901d, 0x246b, 0x093a, 0xbd4c, 0x61d7, 0xd5a1, + 0xd259, 0x662f, 0xbab4, 0x0ec2, 0x2393, 0x97e5, 0x4b7e, 0xff08, + 0x11dc, 0xa5aa, 0x7931, 0xcd47, 0xe016, 0x5460, 0x88fb, 0x3c8d, + 0x7542, 0xc134, 0x1daf, 0xa9d9, 0x8488, 0x30fe, 0xec65, 0x5813, + 0xb6c7, 0x02b1, 0xde2a, 0x6a5c, 0x470d, 0xf37b, 0x2fe0, 0x9b96, + 0x38dd, 0x8cab, 0x5030, 0xe446, 0xc917, 0x7d61, 0xa1fa, 0x158c, + 0xfb58, 0x4f2e, 0x93b5, 0x27c3, 0x0a92, 0xbee4, 0x627f, 0xd609, + 0x9fc6, 0x2bb0, 0xf72b, 0x435d, 0x6e0c, 0xda7a, 0x06e1, 0xb297, + 0x5c43, 0xe835, 0x34ae, 0x80d8, 0xad89, 0x19ff, 0xc564, 0x7112, + 0x76ea, 0xc29c, 0x1e07, 0xaa71, 0x8720, 0x3356, 0xefcd, 0x5bbb, + 0xb56f, 0x0119, 0xdd82, 0x69f4, 0x44a5, 0xf0d3, 0x2c48, 0x983e, + 0xd1f1, 0x6587, 0xb91c, 0x0d6a, 0x203b, 0x944d, 0x48d6, 0xfca0, + 0x1274, 0xa602, 0x7a99, 0xceef, 0xe3be, 0x57c8, 0x8b53, 0x3f25, + 0xa4b3, 0x10c5, 0xcc5e, 0x7828, 0x5579, 0xe10f, 0x3d94, 0x89e2, + 0x6736, 0xd340, 0x0fdb, 0xbbad, 0x96fc, 0x228a, 0xfe11, 0x4a67, + 0x03a8, 0xb7de, 0x6b45, 0xdf33, 0xf262, 0x4614, 0x9a8f, 0x2ef9, + 0xc02d, 0x745b, 0xa8c0, 0x1cb6, 0x31e7, 0x8591, 0x590a, 0xed7c, + 0xea84, 0x5ef2, 0x8269, 0x361f, 0x1b4e, 0xaf38, 0x73a3, 0xc7d5, + 0x2901, 0x9d77, 0x41ec, 0xf59a, 0xd8cb, 0x6cbd, 0xb026, 0x0450, + 0x4d9f, 0xf9e9, 0x2572, 0x9104, 0xbc55, 0x0823, 0xd4b8, 0x60ce, + 0x8e1a, 0x3a6c, 0xe6f7, 0x5281, 0x7fd0, 0xcba6, 0x173d, 0xa34b +}; + +const uint16_t crc_table_mcrf4xx[1024] PROGMEM = { + 0x0000, 0x1189, 0x2312, 0x329b, 0x4624, 0x57ad, 0x6536, 0x74bf, + 0x8c48, 0x9dc1, 0xaf5a, 0xbed3, 0xca6c, 0xdbe5, 0xe97e, 0xf8f7, + 0x1081, 0x0108, 0x3393, 0x221a, 0x56a5, 0x472c, 0x75b7, 0x643e, + 0x9cc9, 0x8d40, 0xbfdb, 0xae52, 0xdaed, 0xcb64, 0xf9ff, 0xe876, + 0x2102, 0x308b, 0x0210, 0x1399, 0x6726, 0x76af, 0x4434, 0x55bd, + 0xad4a, 0xbcc3, 0x8e58, 0x9fd1, 0xeb6e, 0xfae7, 0xc87c, 0xd9f5, + 0x3183, 0x200a, 0x1291, 0x0318, 0x77a7, 0x662e, 0x54b5, 0x453c, + 0xbdcb, 0xac42, 0x9ed9, 0x8f50, 0xfbef, 0xea66, 0xd8fd, 0xc974, + 0x4204, 0x538d, 0x6116, 0x709f, 0x0420, 0x15a9, 0x2732, 0x36bb, + 0xce4c, 0xdfc5, 0xed5e, 0xfcd7, 0x8868, 0x99e1, 0xab7a, 0xbaf3, + 0x5285, 0x430c, 0x7197, 0x601e, 0x14a1, 0x0528, 0x37b3, 0x263a, + 0xdecd, 0xcf44, 0xfddf, 0xec56, 0x98e9, 0x8960, 0xbbfb, 0xaa72, + 0x6306, 0x728f, 0x4014, 0x519d, 0x2522, 0x34ab, 0x0630, 0x17b9, + 0xef4e, 0xfec7, 0xcc5c, 0xddd5, 0xa96a, 0xb8e3, 0x8a78, 0x9bf1, + 0x7387, 0x620e, 0x5095, 0x411c, 0x35a3, 0x242a, 0x16b1, 0x0738, + 0xffcf, 0xee46, 0xdcdd, 0xcd54, 0xb9eb, 0xa862, 0x9af9, 0x8b70, + 0x8408, 0x9581, 0xa71a, 0xb693, 0xc22c, 0xd3a5, 0xe13e, 0xf0b7, + 0x0840, 0x19c9, 0x2b52, 0x3adb, 0x4e64, 0x5fed, 0x6d76, 0x7cff, + 0x9489, 0x8500, 0xb79b, 0xa612, 0xd2ad, 0xc324, 0xf1bf, 0xe036, + 0x18c1, 0x0948, 0x3bd3, 0x2a5a, 0x5ee5, 0x4f6c, 0x7df7, 0x6c7e, + 0xa50a, 0xb483, 0x8618, 0x9791, 0xe32e, 0xf2a7, 0xc03c, 0xd1b5, + 0x2942, 0x38cb, 0x0a50, 0x1bd9, 0x6f66, 0x7eef, 0x4c74, 0x5dfd, + 0xb58b, 0xa402, 0x9699, 0x8710, 0xf3af, 0xe226, 0xd0bd, 0xc134, + 0x39c3, 0x284a, 0x1ad1, 0x0b58, 0x7fe7, 0x6e6e, 0x5cf5, 0x4d7c, + 0xc60c, 0xd785, 0xe51e, 0xf497, 0x8028, 0x91a1, 0xa33a, 0xb2b3, + 0x4a44, 0x5bcd, 0x6956, 0x78df, 0x0c60, 0x1de9, 0x2f72, 0x3efb, + 0xd68d, 0xc704, 0xf59f, 0xe416, 0x90a9, 0x8120, 0xb3bb, 0xa232, + 0x5ac5, 0x4b4c, 0x79d7, 0x685e, 0x1ce1, 0x0d68, 0x3ff3, 0x2e7a, + 0xe70e, 0xf687, 0xc41c, 0xd595, 0xa12a, 0xb0a3, 0x8238, 0x93b1, + 0x6b46, 0x7acf, 0x4854, 0x59dd, 0x2d62, 0x3ceb, 0x0e70, 0x1ff9, + 0xf78f, 0xe606, 0xd49d, 0xc514, 0xb1ab, 0xa022, 0x92b9, 0x8330, + 0x7bc7, 0x6a4e, 0x58d5, 0x495c, 0x3de3, 0x2c6a, 0x1ef1, 0x0f78, + 0x0000, 0x19d8, 0x33b0, 0x2a68, 0x6760, 0x7eb8, 0x54d0, 0x4d08, + 0xcec0, 0xd718, 0xfd70, 0xe4a8, 0xa9a0, 0xb078, 0x9a10, 0x83c8, + 0x9591, 0x8c49, 0xa621, 0xbff9, 0xf2f1, 0xeb29, 0xc141, 0xd899, + 0x5b51, 0x4289, 0x68e1, 0x7139, 0x3c31, 0x25e9, 0x0f81, 0x1659, + 0x2333, 0x3aeb, 0x1083, 0x095b, 0x4453, 0x5d8b, 0x77e3, 0x6e3b, + 0xedf3, 0xf42b, 0xde43, 0xc79b, 0x8a93, 0x934b, 0xb923, 0xa0fb, + 0xb6a2, 0xaf7a, 0x8512, 0x9cca, 0xd1c2, 0xc81a, 0xe272, 0xfbaa, + 0x7862, 0x61ba, 0x4bd2, 0x520a, 0x1f02, 0x06da, 0x2cb2, 0x356a, + 0x4666, 0x5fbe, 0x75d6, 0x6c0e, 0x2106, 0x38de, 0x12b6, 0x0b6e, + 0x88a6, 0x917e, 0xbb16, 0xa2ce, 0xefc6, 0xf61e, 0xdc76, 0xc5ae, + 0xd3f7, 0xca2f, 0xe047, 0xf99f, 0xb497, 0xad4f, 0x8727, 0x9eff, + 0x1d37, 0x04ef, 0x2e87, 0x375f, 0x7a57, 0x638f, 0x49e7, 0x503f, + 0x6555, 0x7c8d, 0x56e5, 0x4f3d, 0x0235, 0x1bed, 0x3185, 0x285d, + 0xab95, 0xb24d, 0x9825, 0x81fd, 0xccf5, 0xd52d, 0xff45, 0xe69d, + 0xf0c4, 0xe91c, 0xc374, 0xdaac, 0x97a4, 0x8e7c, 0xa414, 0xbdcc, + 0x3e04, 0x27dc, 0x0db4, 0x146c, 0x5964, 0x40bc, 0x6ad4, 0x730c, + 0x8ccc, 0x9514, 0xbf7c, 0xa6a4, 0xebac, 0xf274, 0xd81c, 0xc1c4, + 0x420c, 0x5bd4, 0x71bc, 0x6864, 0x256c, 0x3cb4, 0x16dc, 0x0f04, + 0x195d, 0x0085, 0x2aed, 0x3335, 0x7e3d, 0x67e5, 0x4d8d, 0x5455, + 0xd79d, 0xce45, 0xe42d, 0xfdf5, 0xb0fd, 0xa925, 0x834d, 0x9a95, + 0xafff, 0xb627, 0x9c4f, 0x8597, 0xc89f, 0xd147, 0xfb2f, 0xe2f7, + 0x613f, 0x78e7, 0x528f, 0x4b57, 0x065f, 0x1f87, 0x35ef, 0x2c37, + 0x3a6e, 0x23b6, 0x09de, 0x1006, 0x5d0e, 0x44d6, 0x6ebe, 0x7766, + 0xf4ae, 0xed76, 0xc71e, 0xdec6, 0x93ce, 0x8a16, 0xa07e, 0xb9a6, + 0xcaaa, 0xd372, 0xf91a, 0xe0c2, 0xadca, 0xb412, 0x9e7a, 0x87a2, + 0x046a, 0x1db2, 0x37da, 0x2e02, 0x630a, 0x7ad2, 0x50ba, 0x4962, + 0x5f3b, 0x46e3, 0x6c8b, 0x7553, 0x385b, 0x2183, 0x0beb, 0x1233, + 0x91fb, 0x8823, 0xa24b, 0xbb93, 0xf69b, 0xef43, 0xc52b, 0xdcf3, + 0xe999, 0xf041, 0xda29, 0xc3f1, 0x8ef9, 0x9721, 0xbd49, 0xa491, + 0x2759, 0x3e81, 0x14e9, 0x0d31, 0x4039, 0x59e1, 0x7389, 0x6a51, + 0x7c08, 0x65d0, 0x4fb8, 0x5660, 0x1b68, 0x02b0, 0x28d8, 0x3100, + 0xb2c8, 0xab10, 0x8178, 0x98a0, 0xd5a8, 0xcc70, 0xe618, 0xffc0, + 0x0000, 0x5adc, 0xb5b8, 0xef64, 0x6361, 0x39bd, 0xd6d9, 0x8c05, + 0xc6c2, 0x9c1e, 0x737a, 0x29a6, 0xa5a3, 0xff7f, 0x101b, 0x4ac7, + 0x8595, 0xdf49, 0x302d, 0x6af1, 0xe6f4, 0xbc28, 0x534c, 0x0990, + 0x4357, 0x198b, 0xf6ef, 0xac33, 0x2036, 0x7aea, 0x958e, 0xcf52, + 0x033b, 0x59e7, 0xb683, 0xec5f, 0x605a, 0x3a86, 0xd5e2, 0x8f3e, + 0xc5f9, 0x9f25, 0x7041, 0x2a9d, 0xa698, 0xfc44, 0x1320, 0x49fc, + 0x86ae, 0xdc72, 0x3316, 0x69ca, 0xe5cf, 0xbf13, 0x5077, 0x0aab, + 0x406c, 0x1ab0, 0xf5d4, 0xaf08, 0x230d, 0x79d1, 0x96b5, 0xcc69, + 0x0676, 0x5caa, 0xb3ce, 0xe912, 0x6517, 0x3fcb, 0xd0af, 0x8a73, + 0xc0b4, 0x9a68, 0x750c, 0x2fd0, 0xa3d5, 0xf909, 0x166d, 0x4cb1, + 0x83e3, 0xd93f, 0x365b, 0x6c87, 0xe082, 0xba5e, 0x553a, 0x0fe6, + 0x4521, 0x1ffd, 0xf099, 0xaa45, 0x2640, 0x7c9c, 0x93f8, 0xc924, + 0x054d, 0x5f91, 0xb0f5, 0xea29, 0x662c, 0x3cf0, 0xd394, 0x8948, + 0xc38f, 0x9953, 0x7637, 0x2ceb, 0xa0ee, 0xfa32, 0x1556, 0x4f8a, + 0x80d8, 0xda04, 0x3560, 0x6fbc, 0xe3b9, 0xb965, 0x5601, 0x0cdd, + 0x461a, 0x1cc6, 0xf3a2, 0xa97e, 0x257b, 0x7fa7, 0x90c3, 0xca1f, + 0x0cec, 0x5630, 0xb954, 0xe388, 0x6f8d, 0x3551, 0xda35, 0x80e9, + 0xca2e, 0x90f2, 0x7f96, 0x254a, 0xa94f, 0xf393, 0x1cf7, 0x462b, + 0x8979, 0xd3a5, 0x3cc1, 0x661d, 0xea18, 0xb0c4, 0x5fa0, 0x057c, + 0x4fbb, 0x1567, 0xfa03, 0xa0df, 0x2cda, 0x7606, 0x9962, 0xc3be, + 0x0fd7, 0x550b, 0xba6f, 0xe0b3, 0x6cb6, 0x366a, 0xd90e, 0x83d2, + 0xc915, 0x93c9, 0x7cad, 0x2671, 0xaa74, 0xf0a8, 0x1fcc, 0x4510, + 0x8a42, 0xd09e, 0x3ffa, 0x6526, 0xe923, 0xb3ff, 0x5c9b, 0x0647, + 0x4c80, 0x165c, 0xf938, 0xa3e4, 0x2fe1, 0x753d, 0x9a59, 0xc085, + 0x0a9a, 0x5046, 0xbf22, 0xe5fe, 0x69fb, 0x3327, 0xdc43, 0x869f, + 0xcc58, 0x9684, 0x79e0, 0x233c, 0xaf39, 0xf5e5, 0x1a81, 0x405d, + 0x8f0f, 0xd5d3, 0x3ab7, 0x606b, 0xec6e, 0xb6b2, 0x59d6, 0x030a, + 0x49cd, 0x1311, 0xfc75, 0xa6a9, 0x2aac, 0x7070, 0x9f14, 0xc5c8, + 0x09a1, 0x537d, 0xbc19, 0xe6c5, 0x6ac0, 0x301c, 0xdf78, 0x85a4, + 0xcf63, 0x95bf, 0x7adb, 0x2007, 0xac02, 0xf6de, 0x19ba, 0x4366, + 0x8c34, 0xd6e8, 0x398c, 0x6350, 0xef55, 0xb589, 0x5aed, 0x0031, + 0x4af6, 0x102a, 0xff4e, 0xa592, 0x2997, 0x734b, 0x9c2f, 0xc6f3, + 0x0000, 0x1cbb, 0x3976, 0x25cd, 0x72ec, 0x6e57, 0x4b9a, 0x5721, + 0xe5d8, 0xf963, 0xdcae, 0xc015, 0x9734, 0x8b8f, 0xae42, 0xb2f9, + 0xc3a1, 0xdf1a, 0xfad7, 0xe66c, 0xb14d, 0xadf6, 0x883b, 0x9480, + 0x2679, 0x3ac2, 0x1f0f, 0x03b4, 0x5495, 0x482e, 0x6de3, 0x7158, + 0x8f53, 0x93e8, 0xb625, 0xaa9e, 0xfdbf, 0xe104, 0xc4c9, 0xd872, + 0x6a8b, 0x7630, 0x53fd, 0x4f46, 0x1867, 0x04dc, 0x2111, 0x3daa, + 0x4cf2, 0x5049, 0x7584, 0x693f, 0x3e1e, 0x22a5, 0x0768, 0x1bd3, + 0xa92a, 0xb591, 0x905c, 0x8ce7, 0xdbc6, 0xc77d, 0xe2b0, 0xfe0b, + 0x16b7, 0x0a0c, 0x2fc1, 0x337a, 0x645b, 0x78e0, 0x5d2d, 0x4196, + 0xf36f, 0xefd4, 0xca19, 0xd6a2, 0x8183, 0x9d38, 0xb8f5, 0xa44e, + 0xd516, 0xc9ad, 0xec60, 0xf0db, 0xa7fa, 0xbb41, 0x9e8c, 0x8237, + 0x30ce, 0x2c75, 0x09b8, 0x1503, 0x4222, 0x5e99, 0x7b54, 0x67ef, + 0x99e4, 0x855f, 0xa092, 0xbc29, 0xeb08, 0xf7b3, 0xd27e, 0xcec5, + 0x7c3c, 0x6087, 0x454a, 0x59f1, 0x0ed0, 0x126b, 0x37a6, 0x2b1d, + 0x5a45, 0x46fe, 0x6333, 0x7f88, 0x28a9, 0x3412, 0x11df, 0x0d64, + 0xbf9d, 0xa326, 0x86eb, 0x9a50, 0xcd71, 0xd1ca, 0xf407, 0xe8bc, + 0x2d6e, 0x31d5, 0x1418, 0x08a3, 0x5f82, 0x4339, 0x66f4, 0x7a4f, + 0xc8b6, 0xd40d, 0xf1c0, 0xed7b, 0xba5a, 0xa6e1, 0x832c, 0x9f97, + 0xeecf, 0xf274, 0xd7b9, 0xcb02, 0x9c23, 0x8098, 0xa555, 0xb9ee, + 0x0b17, 0x17ac, 0x3261, 0x2eda, 0x79fb, 0x6540, 0x408d, 0x5c36, + 0xa23d, 0xbe86, 0x9b4b, 0x87f0, 0xd0d1, 0xcc6a, 0xe9a7, 0xf51c, + 0x47e5, 0x5b5e, 0x7e93, 0x6228, 0x3509, 0x29b2, 0x0c7f, 0x10c4, + 0x619c, 0x7d27, 0x58ea, 0x4451, 0x1370, 0x0fcb, 0x2a06, 0x36bd, + 0x8444, 0x98ff, 0xbd32, 0xa189, 0xf6a8, 0xea13, 0xcfde, 0xd365, + 0x3bd9, 0x2762, 0x02af, 0x1e14, 0x4935, 0x558e, 0x7043, 0x6cf8, + 0xde01, 0xc2ba, 0xe777, 0xfbcc, 0xaced, 0xb056, 0x959b, 0x8920, + 0xf878, 0xe4c3, 0xc10e, 0xddb5, 0x8a94, 0x962f, 0xb3e2, 0xaf59, + 0x1da0, 0x011b, 0x24d6, 0x386d, 0x6f4c, 0x73f7, 0x563a, 0x4a81, + 0xb48a, 0xa831, 0x8dfc, 0x9147, 0xc666, 0xdadd, 0xff10, 0xe3ab, + 0x5152, 0x4de9, 0x6824, 0x749f, 0x23be, 0x3f05, 0x1ac8, 0x0673, + 0x772b, 0x6b90, 0x4e5d, 0x52e6, 0x05c7, 0x197c, 0x3cb1, 0x200a, + 0x92f3, 0x8e48, 0xab85, 0xb73e, 0xe01f, 0xfca4, 0xd969, 0xc5d2 +}; + +const uint16_t crc_table_modbus[1024] PROGMEM = { + 0x0000, 0xc0c1, 0xc181, 0x0140, 0xc301, 0x03c0, 0x0280, 0xc241, + 0xc601, 0x06c0, 0x0780, 0xc741, 0x0500, 0xc5c1, 0xc481, 0x0440, + 0xcc01, 0x0cc0, 0x0d80, 0xcd41, 0x0f00, 0xcfc1, 0xce81, 0x0e40, + 0x0a00, 0xcac1, 0xcb81, 0x0b40, 0xc901, 0x09c0, 0x0880, 0xc841, + 0xd801, 0x18c0, 0x1980, 0xd941, 0x1b00, 0xdbc1, 0xda81, 0x1a40, + 0x1e00, 0xdec1, 0xdf81, 0x1f40, 0xdd01, 0x1dc0, 0x1c80, 0xdc41, + 0x1400, 0xd4c1, 0xd581, 0x1540, 0xd701, 0x17c0, 0x1680, 0xd641, + 0xd201, 0x12c0, 0x1380, 0xd341, 0x1100, 0xd1c1, 0xd081, 0x1040, + 0xf001, 0x30c0, 0x3180, 0xf141, 0x3300, 0xf3c1, 0xf281, 0x3240, + 0x3600, 0xf6c1, 0xf781, 0x3740, 0xf501, 0x35c0, 0x3480, 0xf441, + 0x3c00, 0xfcc1, 0xfd81, 0x3d40, 0xff01, 0x3fc0, 0x3e80, 0xfe41, + 0xfa01, 0x3ac0, 0x3b80, 0xfb41, 0x3900, 0xf9c1, 0xf881, 0x3840, + 0x2800, 0xe8c1, 0xe981, 0x2940, 0xeb01, 0x2bc0, 0x2a80, 0xea41, + 0xee01, 0x2ec0, 0x2f80, 0xef41, 0x2d00, 0xedc1, 0xec81, 0x2c40, + 0xe401, 0x24c0, 0x2580, 0xe541, 0x2700, 0xe7c1, 0xe681, 0x2640, + 0x2200, 0xe2c1, 0xe381, 0x2340, 0xe101, 0x21c0, 0x2080, 0xe041, + 0xa001, 0x60c0, 0x6180, 0xa141, 0x6300, 0xa3c1, 0xa281, 0x6240, + 0x6600, 0xa6c1, 0xa781, 0x6740, 0xa501, 0x65c0, 0x6480, 0xa441, + 0x6c00, 0xacc1, 0xad81, 0x6d40, 0xaf01, 0x6fc0, 0x6e80, 0xae41, + 0xaa01, 0x6ac0, 0x6b80, 0xab41, 0x6900, 0xa9c1, 0xa881, 0x6840, + 0x7800, 0xb8c1, 0xb981, 0x7940, 0xbb01, 0x7bc0, 0x7a80, 0xba41, + 0xbe01, 0x7ec0, 0x7f80, 0xbf41, 0x7d00, 0xbdc1, 0xbc81, 0x7c40, + 0xb401, 0x74c0, 0x7580, 0xb541, 0x7700, 0xb7c1, 0xb681, 0x7640, + 0x7200, 0xb2c1, 0xb381, 0x7340, 0xb101, 0x71c0, 0x7080, 0xb041, + 0x5000, 0x90c1, 0x9181, 0x5140, 0x9301, 0x53c0, 0x5280, 0x9241, + 0x9601, 0x56c0, 0x5780, 0x9741, 0x5500, 0x95c1, 0x9481, 0x5440, + 0x9c01, 0x5cc0, 0x5d80, 0x9d41, 0x5f00, 0x9fc1, 0x9e81, 0x5e40, + 0x5a00, 0x9ac1, 0x9b81, 0x5b40, 0x9901, 0x59c0, 0x5880, 0x9841, + 0x8801, 0x48c0, 0x4980, 0x8941, 0x4b00, 0x8bc1, 0x8a81, 0x4a40, + 0x4e00, 0x8ec1, 0x8f81, 0x4f40, 0x8d01, 0x4dc0, 0x4c80, 0x8c41, + 0x4400, 0x84c1, 0x8581, 0x4540, 0x8701, 0x47c0, 0x4680, 0x8641, + 0x8201, 0x42c0, 0x4380, 0x8341, 0x4100, 0x81c1, 0x8081, 0x4040, + 0x0000, 0x9001, 0x6001, 0xf000, 0xc002, 0x5003, 0xa003, 0x3002, + 0xc007, 0x5006, 0xa006, 0x3007, 0x0005, 0x9004, 0x6004, 0xf005, + 0xc00d, 0x500c, 0xa00c, 0x300d, 0x000f, 0x900e, 0x600e, 0xf00f, + 0x000a, 0x900b, 0x600b, 0xf00a, 0xc008, 0x5009, 0xa009, 0x3008, + 0xc019, 0x5018, 0xa018, 0x3019, 0x001b, 0x901a, 0x601a, 0xf01b, + 0x001e, 0x901f, 0x601f, 0xf01e, 0xc01c, 0x501d, 0xa01d, 0x301c, + 0x0014, 0x9015, 0x6015, 0xf014, 0xc016, 0x5017, 0xa017, 0x3016, + 0xc013, 0x5012, 0xa012, 0x3013, 0x0011, 0x9010, 0x6010, 0xf011, + 0xc031, 0x5030, 0xa030, 0x3031, 0x0033, 0x9032, 0x6032, 0xf033, + 0x0036, 0x9037, 0x6037, 0xf036, 0xc034, 0x5035, 0xa035, 0x3034, + 0x003c, 0x903d, 0x603d, 0xf03c, 0xc03e, 0x503f, 0xa03f, 0x303e, + 0xc03b, 0x503a, 0xa03a, 0x303b, 0x0039, 0x9038, 0x6038, 0xf039, + 0x0028, 0x9029, 0x6029, 0xf028, 0xc02a, 0x502b, 0xa02b, 0x302a, + 0xc02f, 0x502e, 0xa02e, 0x302f, 0x002d, 0x902c, 0x602c, 0xf02d, + 0xc025, 0x5024, 0xa024, 0x3025, 0x0027, 0x9026, 0x6026, 0xf027, + 0x0022, 0x9023, 0x6023, 0xf022, 0xc020, 0x5021, 0xa021, 0x3020, + 0xc061, 0x5060, 0xa060, 0x3061, 0x0063, 0x9062, 0x6062, 0xf063, + 0x0066, 0x9067, 0x6067, 0xf066, 0xc064, 0x5065, 0xa065, 0x3064, + 0x006c, 0x906d, 0x606d, 0xf06c, 0xc06e, 0x506f, 0xa06f, 0x306e, + 0xc06b, 0x506a, 0xa06a, 0x306b, 0x0069, 0x9068, 0x6068, 0xf069, + 0x0078, 0x9079, 0x6079, 0xf078, 0xc07a, 0x507b, 0xa07b, 0x307a, + 0xc07f, 0x507e, 0xa07e, 0x307f, 0x007d, 0x907c, 0x607c, 0xf07d, + 0xc075, 0x5074, 0xa074, 0x3075, 0x0077, 0x9076, 0x6076, 0xf077, + 0x0072, 0x9073, 0x6073, 0xf072, 0xc070, 0x5071, 0xa071, 0x3070, + 0x0050, 0x9051, 0x6051, 0xf050, 0xc052, 0x5053, 0xa053, 0x3052, + 0xc057, 0x5056, 0xa056, 0x3057, 0x0055, 0x9054, 0x6054, 0xf055, + 0xc05d, 0x505c, 0xa05c, 0x305d, 0x005f, 0x905e, 0x605e, 0xf05f, + 0x005a, 0x905b, 0x605b, 0xf05a, 0xc058, 0x5059, 0xa059, 0x3058, + 0xc049, 0x5048, 0xa048, 0x3049, 0x004b, 0x904a, 0x604a, 0xf04b, + 0x004e, 0x904f, 0x604f, 0xf04e, 0xc04c, 0x504d, 0xa04d, 0x304c, + 0x0044, 0x9045, 0x6045, 0xf044, 0xc046, 0x5047, 0xa047, 0x3046, + 0xc043, 0x5042, 0xa042, 0x3043, 0x0041, 0x9040, 0x6040, 0xf041, + 0x0000, 0xc051, 0xc0a1, 0x00f0, 0xc141, 0x0110, 0x01e0, 0xc1b1, + 0xc281, 0x02d0, 0x0220, 0xc271, 0x03c0, 0xc391, 0xc361, 0x0330, + 0xc501, 0x0550, 0x05a0, 0xc5f1, 0x0440, 0xc411, 0xc4e1, 0x04b0, + 0x0780, 0xc7d1, 0xc721, 0x0770, 0xc6c1, 0x0690, 0x0660, 0xc631, + 0xca01, 0x0a50, 0x0aa0, 0xcaf1, 0x0b40, 0xcb11, 0xcbe1, 0x0bb0, + 0x0880, 0xc8d1, 0xc821, 0x0870, 0xc9c1, 0x0990, 0x0960, 0xc931, + 0x0f00, 0xcf51, 0xcfa1, 0x0ff0, 0xce41, 0x0e10, 0x0ee0, 0xceb1, + 0xcd81, 0x0dd0, 0x0d20, 0xcd71, 0x0cc0, 0xcc91, 0xcc61, 0x0c30, + 0xd401, 0x1450, 0x14a0, 0xd4f1, 0x1540, 0xd511, 0xd5e1, 0x15b0, + 0x1680, 0xd6d1, 0xd621, 0x1670, 0xd7c1, 0x1790, 0x1760, 0xd731, + 0x1100, 0xd151, 0xd1a1, 0x11f0, 0xd041, 0x1010, 0x10e0, 0xd0b1, + 0xd381, 0x13d0, 0x1320, 0xd371, 0x12c0, 0xd291, 0xd261, 0x1230, + 0x1e00, 0xde51, 0xdea1, 0x1ef0, 0xdf41, 0x1f10, 0x1fe0, 0xdfb1, + 0xdc81, 0x1cd0, 0x1c20, 0xdc71, 0x1dc0, 0xdd91, 0xdd61, 0x1d30, + 0xdb01, 0x1b50, 0x1ba0, 0xdbf1, 0x1a40, 0xda11, 0xdae1, 0x1ab0, + 0x1980, 0xd9d1, 0xd921, 0x1970, 0xd8c1, 0x1890, 0x1860, 0xd831, + 0xe801, 0x2850, 0x28a0, 0xe8f1, 0x2940, 0xe911, 0xe9e1, 0x29b0, + 0x2a80, 0xead1, 0xea21, 0x2a70, 0xebc1, 0x2b90, 0x2b60, 0xeb31, + 0x2d00, 0xed51, 0xeda1, 0x2df0, 0xec41, 0x2c10, 0x2ce0, 0xecb1, + 0xef81, 0x2fd0, 0x2f20, 0xef71, 0x2ec0, 0xee91, 0xee61, 0x2e30, + 0x2200, 0xe251, 0xe2a1, 0x22f0, 0xe341, 0x2310, 0x23e0, 0xe3b1, + 0xe081, 0x20d0, 0x2020, 0xe071, 0x21c0, 0xe191, 0xe161, 0x2130, + 0xe701, 0x2750, 0x27a0, 0xe7f1, 0x2640, 0xe611, 0xe6e1, 0x26b0, + 0x2580, 0xe5d1, 0xe521, 0x2570, 0xe4c1, 0x2490, 0x2460, 0xe431, + 0x3c00, 0xfc51, 0xfca1, 0x3cf0, 0xfd41, 0x3d10, 0x3de0, 0xfdb1, + 0xfe81, 0x3ed0, 0x3e20, 0xfe71, 0x3fc0, 0xff91, 0xff61, 0x3f30, + 0xf901, 0x3950, 0x39a0, 0xf9f1, 0x3840, 0xf811, 0xf8e1, 0x38b0, + 0x3b80, 0xfbd1, 0xfb21, 0x3b70, 0xfac1, 0x3a90, 0x3a60, 0xfa31, + 0xf601, 0x3650, 0x36a0, 0xf6f1, 0x3740, 0xf711, 0xf7e1, 0x37b0, + 0x3480, 0xf4d1, 0xf421, 0x3470, 0xf5c1, 0x3590, 0x3560, 0xf531, + 0x3300, 0xf351, 0xf3a1, 0x33f0, 0xf241, 0x3210, 0x32e0, 0xf2b1, + 0xf181, 0x31d0, 0x3120, 0xf171, 0x30c0, 0xf091, 0xf061, 0x3030, + 0x0000, 0xfc01, 0xb801, 0x4400, 0x3001, 0xcc00, 0x8800, 0x7401, + 0x6002, 0x9c03, 0xd803, 0x2402, 0x5003, 0xac02, 0xe802, 0x1403, + 0xc004, 0x3c05, 0x7805, 0x8404, 0xf005, 0x0c04, 0x4804, 0xb405, + 0xa006, 0x5c07, 0x1807, 0xe406, 0x9007, 0x6c06, 0x2806, 0xd407, + 0xc00b, 0x3c0a, 0x780a, 0x840b, 0xf00a, 0x0c0b, 0x480b, 0xb40a, + 0xa009, 0x5c08, 0x1808, 0xe409, 0x9008, 0x6c09, 0x2809, 0xd408, + 0x000f, 0xfc0e, 0xb80e, 0x440f, 0x300e, 0xcc0f, 0x880f, 0x740e, + 0x600d, 0x9c0c, 0xd80c, 0x240d, 0x500c, 0xac0d, 0xe80d, 0x140c, + 0xc015, 0x3c14, 0x7814, 0x8415, 0xf014, 0x0c15, 0x4815, 0xb414, + 0xa017, 0x5c16, 0x1816, 0xe417, 0x9016, 0x6c17, 0x2817, 0xd416, + 0x0011, 0xfc10, 0xb810, 0x4411, 0x3010, 0xcc11, 0x8811, 0x7410, + 0x6013, 0x9c12, 0xd812, 0x2413, 0x5012, 0xac13, 0xe813, 0x1412, + 0x001e, 0xfc1f, 0xb81f, 0x441e, 0x301f, 0xcc1e, 0x881e, 0x741f, + 0x601c, 0x9c1d, 0xd81d, 0x241c, 0x501d, 0xac1c, 0xe81c, 0x141d, + 0xc01a, 0x3c1b, 0x781b, 0x841a, 0xf01b, 0x0c1a, 0x481a, 0xb41b, + 0xa018, 0x5c19, 0x1819, 0xe418, 0x9019, 0x6c18, 0x2818, 0xd419, + 0xc029, 0x3c28, 0x7828, 0x8429, 0xf028, 0x0c29, 0x4829, 0xb428, + 0xa02b, 0x5c2a, 0x182a, 0xe42b, 0x902a, 0x6c2b, 0x282b, 0xd42a, + 0x002d, 0xfc2c, 0xb82c, 0x442d, 0x302c, 0xcc2d, 0x882d, 0x742c, + 0x602f, 0x9c2e, 0xd82e, 0x242f, 0x502e, 0xac2f, 0xe82f, 0x142e, + 0x0022, 0xfc23, 0xb823, 0x4422, 0x3023, 0xcc22, 0x8822, 0x7423, + 0x6020, 0x9c21, 0xd821, 0x2420, 0x5021, 0xac20, 0xe820, 0x1421, + 0xc026, 0x3c27, 0x7827, 0x8426, 0xf027, 0x0c26, 0x4826, 0xb427, + 0xa024, 0x5c25, 0x1825, 0xe424, 0x9025, 0x6c24, 0x2824, 0xd425, + 0x003c, 0xfc3d, 0xb83d, 0x443c, 0x303d, 0xcc3c, 0x883c, 0x743d, + 0x603e, 0x9c3f, 0xd83f, 0x243e, 0x503f, 0xac3e, 0xe83e, 0x143f, + 0xc038, 0x3c39, 0x7839, 0x8438, 0xf039, 0x0c38, 0x4838, 0xb439, + 0xa03a, 0x5c3b, 0x183b, 0xe43a, 0x903b, 0x6c3a, 0x283a, 0xd43b, + 0xc037, 0x3c36, 0x7836, 0x8437, 0xf036, 0x0c37, 0x4837, 0xb436, + 0xa035, 0x5c34, 0x1834, 0xe435, 0x9034, 0x6c35, 0x2835, 0xd434, + 0x0033, 0xfc32, 0xb832, 0x4433, 0x3032, 0xcc33, 0x8833, 0x7432, + 0x6031, 0x9c30, 0xd830, 0x2431, 0x5030, 0xac31, 0xe831, 0x1430 +}; + +const uint16_t crc_table_kermit[1024] PROGMEM = { + 0x0000, 0x1189, 0x2312, 0x329b, 0x4624, 0x57ad, 0x6536, 0x74bf, + 0x8c48, 0x9dc1, 0xaf5a, 0xbed3, 0xca6c, 0xdbe5, 0xe97e, 0xf8f7, + 0x1081, 0x0108, 0x3393, 0x221a, 0x56a5, 0x472c, 0x75b7, 0x643e, + 0x9cc9, 0x8d40, 0xbfdb, 0xae52, 0xdaed, 0xcb64, 0xf9ff, 0xe876, + 0x2102, 0x308b, 0x0210, 0x1399, 0x6726, 0x76af, 0x4434, 0x55bd, + 0xad4a, 0xbcc3, 0x8e58, 0x9fd1, 0xeb6e, 0xfae7, 0xc87c, 0xd9f5, + 0x3183, 0x200a, 0x1291, 0x0318, 0x77a7, 0x662e, 0x54b5, 0x453c, + 0xbdcb, 0xac42, 0x9ed9, 0x8f50, 0xfbef, 0xea66, 0xd8fd, 0xc974, + 0x4204, 0x538d, 0x6116, 0x709f, 0x0420, 0x15a9, 0x2732, 0x36bb, + 0xce4c, 0xdfc5, 0xed5e, 0xfcd7, 0x8868, 0x99e1, 0xab7a, 0xbaf3, + 0x5285, 0x430c, 0x7197, 0x601e, 0x14a1, 0x0528, 0x37b3, 0x263a, + 0xdecd, 0xcf44, 0xfddf, 0xec56, 0x98e9, 0x8960, 0xbbfb, 0xaa72, + 0x6306, 0x728f, 0x4014, 0x519d, 0x2522, 0x34ab, 0x0630, 0x17b9, + 0xef4e, 0xfec7, 0xcc5c, 0xddd5, 0xa96a, 0xb8e3, 0x8a78, 0x9bf1, + 0x7387, 0x620e, 0x5095, 0x411c, 0x35a3, 0x242a, 0x16b1, 0x0738, + 0xffcf, 0xee46, 0xdcdd, 0xcd54, 0xb9eb, 0xa862, 0x9af9, 0x8b70, + 0x8408, 0x9581, 0xa71a, 0xb693, 0xc22c, 0xd3a5, 0xe13e, 0xf0b7, + 0x0840, 0x19c9, 0x2b52, 0x3adb, 0x4e64, 0x5fed, 0x6d76, 0x7cff, + 0x9489, 0x8500, 0xb79b, 0xa612, 0xd2ad, 0xc324, 0xf1bf, 0xe036, + 0x18c1, 0x0948, 0x3bd3, 0x2a5a, 0x5ee5, 0x4f6c, 0x7df7, 0x6c7e, + 0xa50a, 0xb483, 0x8618, 0x9791, 0xe32e, 0xf2a7, 0xc03c, 0xd1b5, + 0x2942, 0x38cb, 0x0a50, 0x1bd9, 0x6f66, 0x7eef, 0x4c74, 0x5dfd, + 0xb58b, 0xa402, 0x9699, 0x8710, 0xf3af, 0xe226, 0xd0bd, 0xc134, + 0x39c3, 0x284a, 0x1ad1, 0x0b58, 0x7fe7, 0x6e6e, 0x5cf5, 0x4d7c, + 0xc60c, 0xd785, 0xe51e, 0xf497, 0x8028, 0x91a1, 0xa33a, 0xb2b3, + 0x4a44, 0x5bcd, 0x6956, 0x78df, 0x0c60, 0x1de9, 0x2f72, 0x3efb, + 0xd68d, 0xc704, 0xf59f, 0xe416, 0x90a9, 0x8120, 0xb3bb, 0xa232, + 0x5ac5, 0x4b4c, 0x79d7, 0x685e, 0x1ce1, 0x0d68, 0x3ff3, 0x2e7a, + 0xe70e, 0xf687, 0xc41c, 0xd595, 0xa12a, 0xb0a3, 0x8238, 0x93b1, + 0x6b46, 0x7acf, 0x4854, 0x59dd, 0x2d62, 0x3ceb, 0x0e70, 0x1ff9, + 0xf78f, 0xe606, 0xd49d, 0xc514, 0xb1ab, 0xa022, 0x92b9, 0x8330, + 0x7bc7, 0x6a4e, 0x58d5, 0x495c, 0x3de3, 0x2c6a, 0x1ef1, 0x0f78, + 0x0000, 0x19d8, 0x33b0, 0x2a68, 0x6760, 0x7eb8, 0x54d0, 0x4d08, + 0xcec0, 0xd718, 0xfd70, 0xe4a8, 0xa9a0, 0xb078, 0x9a10, 0x83c8, + 0x9591, 0x8c49, 0xa621, 0xbff9, 0xf2f1, 0xeb29, 0xc141, 0xd899, + 0x5b51, 0x4289, 0x68e1, 0x7139, 0x3c31, 0x25e9, 0x0f81, 0x1659, + 0x2333, 0x3aeb, 0x1083, 0x095b, 0x4453, 0x5d8b, 0x77e3, 0x6e3b, + 0xedf3, 0xf42b, 0xde43, 0xc79b, 0x8a93, 0x934b, 0xb923, 0xa0fb, + 0xb6a2, 0xaf7a, 0x8512, 0x9cca, 0xd1c2, 0xc81a, 0xe272, 0xfbaa, + 0x7862, 0x61ba, 0x4bd2, 0x520a, 0x1f02, 0x06da, 0x2cb2, 0x356a, + 0x4666, 0x5fbe, 0x75d6, 0x6c0e, 0x2106, 0x38de, 0x12b6, 0x0b6e, + 0x88a6, 0x917e, 0xbb16, 0xa2ce, 0xefc6, 0xf61e, 0xdc76, 0xc5ae, + 0xd3f7, 0xca2f, 0xe047, 0xf99f, 0xb497, 0xad4f, 0x8727, 0x9eff, + 0x1d37, 0x04ef, 0x2e87, 0x375f, 0x7a57, 0x638f, 0x49e7, 0x503f, + 0x6555, 0x7c8d, 0x56e5, 0x4f3d, 0x0235, 0x1bed, 0x3185, 0x285d, + 0xab95, 0xb24d, 0x9825, 0x81fd, 0xccf5, 0xd52d, 0xff45, 0xe69d, + 0xf0c4, 0xe91c, 0xc374, 0xdaac, 0x97a4, 0x8e7c, 0xa414, 0xbdcc, + 0x3e04, 0x27dc, 0x0db4, 0x146c, 0x5964, 0x40bc, 0x6ad4, 0x730c, + 0x8ccc, 0x9514, 0xbf7c, 0xa6a4, 0xebac, 0xf274, 0xd81c, 0xc1c4, + 0x420c, 0x5bd4, 0x71bc, 0x6864, 0x256c, 0x3cb4, 0x16dc, 0x0f04, + 0x195d, 0x0085, 0x2aed, 0x3335, 0x7e3d, 0x67e5, 0x4d8d, 0x5455, + 0xd79d, 0xce45, 0xe42d, 0xfdf5, 0xb0fd, 0xa925, 0x834d, 0x9a95, + 0xafff, 0xb627, 0x9c4f, 0x8597, 0xc89f, 0xd147, 0xfb2f, 0xe2f7, + 0x613f, 0x78e7, 0x528f, 0x4b57, 0x065f, 0x1f87, 0x35ef, 0x2c37, + 0x3a6e, 0x23b6, 0x09de, 0x1006, 0x5d0e, 0x44d6, 0x6ebe, 0x7766, + 0xf4ae, 0xed76, 0xc71e, 0xdec6, 0x93ce, 0x8a16, 0xa07e, 0xb9a6, + 0xcaaa, 0xd372, 0xf91a, 0xe0c2, 0xadca, 0xb412, 0x9e7a, 0x87a2, + 0x046a, 0x1db2, 0x37da, 0x2e02, 0x630a, 0x7ad2, 0x50ba, 0x4962, + 0x5f3b, 0x46e3, 0x6c8b, 0x7553, 0x385b, 0x2183, 0x0beb, 0x1233, + 0x91fb, 0x8823, 0xa24b, 0xbb93, 0xf69b, 0xef43, 0xc52b, 0xdcf3, + 0xe999, 0xf041, 0xda29, 0xc3f1, 0x8ef9, 0x9721, 0xbd49, 0xa491, + 0x2759, 0x3e81, 0x14e9, 0x0d31, 0x4039, 0x59e1, 0x7389, 0x6a51, + 0x7c08, 0x65d0, 0x4fb8, 0x5660, 0x1b68, 0x02b0, 0x28d8, 0x3100, + 0xb2c8, 0xab10, 0x8178, 0x98a0, 0xd5a8, 0xcc70, 0xe618, 0xffc0, + 0x0000, 0x5adc, 0xb5b8, 0xef64, 0x6361, 0x39bd, 0xd6d9, 0x8c05, + 0xc6c2, 0x9c1e, 0x737a, 0x29a6, 0xa5a3, 0xff7f, 0x101b, 0x4ac7, + 0x8595, 0xdf49, 0x302d, 0x6af1, 0xe6f4, 0xbc28, 0x534c, 0x0990, + 0x4357, 0x198b, 0xf6ef, 0xac33, 0x2036, 0x7aea, 0x958e, 0xcf52, + 0x033b, 0x59e7, 0xb683, 0xec5f, 0x605a, 0x3a86, 0xd5e2, 0x8f3e, + 0xc5f9, 0x9f25, 0x7041, 0x2a9d, 0xa698, 0xfc44, 0x1320, 0x49fc, + 0x86ae, 0xdc72, 0x3316, 0x69ca, 0xe5cf, 0xbf13, 0x5077, 0x0aab, + 0x406c, 0x1ab0, 0xf5d4, 0xaf08, 0x230d, 0x79d1, 0x96b5, 0xcc69, + 0x0676, 0x5caa, 0xb3ce, 0xe912, 0x6517, 0x3fcb, 0xd0af, 0x8a73, + 0xc0b4, 0x9a68, 0x750c, 0x2fd0, 0xa3d5, 0xf909, 0x166d, 0x4cb1, + 0x83e3, 0xd93f, 0x365b, 0x6c87, 0xe082, 0xba5e, 0x553a, 0x0fe6, + 0x4521, 0x1ffd, 0xf099, 0xaa45, 0x2640, 0x7c9c, 0x93f8, 0xc924, + 0x054d, 0x5f91, 0xb0f5, 0xea29, 0x662c, 0x3cf0, 0xd394, 0x8948, + 0xc38f, 0x9953, 0x7637, 0x2ceb, 0xa0ee, 0xfa32, 0x1556, 0x4f8a, + 0x80d8, 0xda04, 0x3560, 0x6fbc, 0xe3b9, 0xb965, 0x5601, 0x0cdd, + 0x461a, 0x1cc6, 0xf3a2, 0xa97e, 0x257b, 0x7fa7, 0x90c3, 0xca1f, + 0x0cec, 0x5630, 0xb954, 0xe388, 0x6f8d, 0x3551, 0xda35, 0x80e9, + 0xca2e, 0x90f2, 0x7f96, 0x254a, 0xa94f, 0xf393, 0x1cf7, 0x462b, + 0x8979, 0xd3a5, 0x3cc1, 0x661d, 0xea18, 0xb0c4, 0x5fa0, 0x057c, + 0x4fbb, 0x1567, 0xfa03, 0xa0df, 0x2cda, 0x7606, 0x9962, 0xc3be, + 0x0fd7, 0x550b, 0xba6f, 0xe0b3, 0x6cb6, 0x366a, 0xd90e, 0x83d2, + 0xc915, 0x93c9, 0x7cad, 0x2671, 0xaa74, 0xf0a8, 0x1fcc, 0x4510, + 0x8a42, 0xd09e, 0x3ffa, 0x6526, 0xe923, 0xb3ff, 0x5c9b, 0x0647, + 0x4c80, 0x165c, 0xf938, 0xa3e4, 0x2fe1, 0x753d, 0x9a59, 0xc085, + 0x0a9a, 0x5046, 0xbf22, 0xe5fe, 0x69fb, 0x3327, 0xdc43, 0x869f, + 0xcc58, 0x9684, 0x79e0, 0x233c, 0xaf39, 0xf5e5, 0x1a81, 0x405d, + 0x8f0f, 0xd5d3, 0x3ab7, 0x606b, 0xec6e, 0xb6b2, 0x59d6, 0x030a, + 0x49cd, 0x1311, 0xfc75, 0xa6a9, 0x2aac, 0x7070, 0x9f14, 0xc5c8, + 0x09a1, 0x537d, 0xbc19, 0xe6c5, 0x6ac0, 0x301c, 0xdf78, 0x85a4, + 0xcf63, 0x95bf, 0x7adb, 0x2007, 0xac02, 0xf6de, 0x19ba, 0x4366, + 0x8c34, 0xd6e8, 0x398c, 0x6350, 0xef55, 0xb589, 0x5aed, 0x0031, + 0x4af6, 0x102a, 0xff4e, 0xa592, 0x2997, 0x734b, 0x9c2f, 0xc6f3, + 0x0000, 0x1cbb, 0x3976, 0x25cd, 0x72ec, 0x6e57, 0x4b9a, 0x5721, + 0xe5d8, 0xf963, 0xdcae, 0xc015, 0x9734, 0x8b8f, 0xae42, 0xb2f9, + 0xc3a1, 0xdf1a, 0xfad7, 0xe66c, 0xb14d, 0xadf6, 0x883b, 0x9480, + 0x2679, 0x3ac2, 0x1f0f, 0x03b4, 0x5495, 0x482e, 0x6de3, 0x7158, + 0x8f53, 0x93e8, 0xb625, 0xaa9e, 0xfdbf, 0xe104, 0xc4c9, 0xd872, + 0x6a8b, 0x7630, 0x53fd, 0x4f46, 0x1867, 0x04dc, 0x2111, 0x3daa, + 0x4cf2, 0x5049, 0x7584, 0x693f, 0x3e1e, 0x22a5, 0x0768, 0x1bd3, + 0xa92a, 0xb591, 0x905c, 0x8ce7, 0xdbc6, 0xc77d, 0xe2b0, 0xfe0b, + 0x16b7, 0x0a0c, 0x2fc1, 0x337a, 0x645b, 0x78e0, 0x5d2d, 0x4196, + 0xf36f, 0xefd4, 0xca19, 0xd6a2, 0x8183, 0x9d38, 0xb8f5, 0xa44e, + 0xd516, 0xc9ad, 0xec60, 0xf0db, 0xa7fa, 0xbb41, 0x9e8c, 0x8237, + 0x30ce, 0x2c75, 0x09b8, 0x1503, 0x4222, 0x5e99, 0x7b54, 0x67ef, + 0x99e4, 0x855f, 0xa092, 0xbc29, 0xeb08, 0xf7b3, 0xd27e, 0xcec5, + 0x7c3c, 0x6087, 0x454a, 0x59f1, 0x0ed0, 0x126b, 0x37a6, 0x2b1d, + 0x5a45, 0x46fe, 0x6333, 0x7f88, 0x28a9, 0x3412, 0x11df, 0x0d64, + 0xbf9d, 0xa326, 0x86eb, 0x9a50, 0xcd71, 0xd1ca, 0xf407, 0xe8bc, + 0x2d6e, 0x31d5, 0x1418, 0x08a3, 0x5f82, 0x4339, 0x66f4, 0x7a4f, + 0xc8b6, 0xd40d, 0xf1c0, 0xed7b, 0xba5a, 0xa6e1, 0x832c, 0x9f97, + 0xeecf, 0xf274, 0xd7b9, 0xcb02, 0x9c23, 0x8098, 0xa555, 0xb9ee, + 0x0b17, 0x17ac, 0x3261, 0x2eda, 0x79fb, 0x6540, 0x408d, 0x5c36, + 0xa23d, 0xbe86, 0x9b4b, 0x87f0, 0xd0d1, 0xcc6a, 0xe9a7, 0xf51c, + 0x47e5, 0x5b5e, 0x7e93, 0x6228, 0x3509, 0x29b2, 0x0c7f, 0x10c4, + 0x619c, 0x7d27, 0x58ea, 0x4451, 0x1370, 0x0fcb, 0x2a06, 0x36bd, + 0x8444, 0x98ff, 0xbd32, 0xa189, 0xf6a8, 0xea13, 0xcfde, 0xd365, + 0x3bd9, 0x2762, 0x02af, 0x1e14, 0x4935, 0x558e, 0x7043, 0x6cf8, + 0xde01, 0xc2ba, 0xe777, 0xfbcc, 0xaced, 0xb056, 0x959b, 0x8920, + 0xf878, 0xe4c3, 0xc10e, 0xddb5, 0x8a94, 0x962f, 0xb3e2, 0xaf59, + 0x1da0, 0x011b, 0x24d6, 0x386d, 0x6f4c, 0x73f7, 0x563a, 0x4a81, + 0xb48a, 0xa831, 0x8dfc, 0x9147, 0xc666, 0xdadd, 0xff10, 0xe3ab, + 0x5152, 0x4de9, 0x6824, 0x749f, 0x23be, 0x3f05, 0x1ac8, 0x0673, + 0x772b, 0x6b90, 0x4e5d, 0x52e6, 0x05c7, 0x197c, 0x3cb1, 0x200a, + 0x92f3, 0x8e48, 0xab85, 0xb73e, 0xe01f, 0xfca4, 0xd969, 0xc5d2 +}; + +const uint16_t crc_table_xmodem[1024] PROGMEM = { + 0x0000, 0x2110, 0x4220, 0x6330, 0x8440, 0xa550, 0xc660, 0xe770, + 0x0881, 0x2991, 0x4aa1, 0x6bb1, 0x8cc1, 0xadd1, 0xcee1, 0xeff1, + 0x3112, 0x1002, 0x7332, 0x5222, 0xb552, 0x9442, 0xf772, 0xd662, + 0x3993, 0x1883, 0x7bb3, 0x5aa3, 0xbdd3, 0x9cc3, 0xfff3, 0xdee3, + 0x6224, 0x4334, 0x2004, 0x0114, 0xe664, 0xc774, 0xa444, 0x8554, + 0x6aa5, 0x4bb5, 0x2885, 0x0995, 0xeee5, 0xcff5, 0xacc5, 0x8dd5, + 0x5336, 0x7226, 0x1116, 0x3006, 0xd776, 0xf666, 0x9556, 0xb446, + 0x5bb7, 0x7aa7, 0x1997, 0x3887, 0xdff7, 0xfee7, 0x9dd7, 0xbcc7, + 0xc448, 0xe558, 0x8668, 0xa778, 0x4008, 0x6118, 0x0228, 0x2338, + 0xccc9, 0xedd9, 0x8ee9, 0xaff9, 0x4889, 0x6999, 0x0aa9, 0x2bb9, + 0xf55a, 0xd44a, 0xb77a, 0x966a, 0x711a, 0x500a, 0x333a, 0x122a, + 0xfddb, 0xdccb, 0xbffb, 0x9eeb, 0x799b, 0x588b, 0x3bbb, 0x1aab, + 0xa66c, 0x877c, 0xe44c, 0xc55c, 0x222c, 0x033c, 0x600c, 0x411c, + 0xaeed, 0x8ffd, 0xeccd, 0xcddd, 0x2aad, 0x0bbd, 0x688d, 0x499d, + 0x977e, 0xb66e, 0xd55e, 0xf44e, 0x133e, 0x322e, 0x511e, 0x700e, + 0x9fff, 0xbeef, 0xdddf, 0xfccf, 0x1bbf, 0x3aaf, 0x599f, 0x788f, + 0x8891, 0xa981, 0xcab1, 0xeba1, 0x0cd1, 0x2dc1, 0x4ef1, 0x6fe1, + 0x8010, 0xa100, 0xc230, 0xe320, 0x0450, 0x2540, 0x4670, 0x6760, + 0xb983, 0x9893, 0xfba3, 0xdab3, 0x3dc3, 0x1cd3, 0x7fe3, 0x5ef3, + 0xb102, 0x9012, 0xf322, 0xd232, 0x3542, 0x1452, 0x7762, 0x5672, + 0xeab5, 0xcba5, 0xa895, 0x8985, 0x6ef5, 0x4fe5, 0x2cd5, 0x0dc5, + 0xe234, 0xc324, 0xa014, 0x8104, 0x6674, 0x4764, 0x2454, 0x0544, + 0xdba7, 0xfab7, 0x9987, 0xb897, 0x5fe7, 0x7ef7, 0x1dc7, 0x3cd7, + 0xd326, 0xf236, 0x9106, 0xb016, 0x5766, 0x7676, 0x1546, 0x3456, + 0x4cd9, 0x6dc9, 0x0ef9, 0x2fe9, 0xc899, 0xe989, 0x8ab9, 0xaba9, + 0x4458, 0x6548, 0x0678, 0x2768, 0xc018, 0xe108, 0x8238, 0xa328, + 0x7dcb, 0x5cdb, 0x3feb, 0x1efb, 0xf98b, 0xd89b, 0xbbab, 0x9abb, + 0x754a, 0x545a, 0x376a, 0x167a, 0xf10a, 0xd01a, 0xb32a, 0x923a, + 0x2efd, 0x0fed, 0x6cdd, 0x4dcd, 0xaabd, 0x8bad, 0xe89d, 0xc98d, + 0x267c, 0x076c, 0x645c, 0x454c, 0xa23c, 0x832c, 0xe01c, 0xc10c, + 0x1fef, 0x3eff, 0x5dcf, 0x7cdf, 0x9baf, 0xbabf, 0xd98f, 0xf89f, + 0x176e, 0x367e, 0x554e, 0x745e, 0x932e, 0xb23e, 0xd10e, 0xf01e, + 0x0000, 0x3133, 0x6266, 0x5355, 0xc4cc, 0xf5ff, 0xa6aa, 0x9799, + 0xa989, 0x98ba, 0xcbef, 0xfadc, 0x6d45, 0x5c76, 0x0f23, 0x3e10, + 0x7303, 0x4230, 0x1165, 0x2056, 0xb7cf, 0x86fc, 0xd5a9, 0xe49a, + 0xda8a, 0xebb9, 0xb8ec, 0x89df, 0x1e46, 0x2f75, 0x7c20, 0x4d13, + 0xe606, 0xd735, 0x8460, 0xb553, 0x22ca, 0x13f9, 0x40ac, 0x719f, + 0x4f8f, 0x7ebc, 0x2de9, 0x1cda, 0x8b43, 0xba70, 0xe925, 0xd816, + 0x9505, 0xa436, 0xf763, 0xc650, 0x51c9, 0x60fa, 0x33af, 0x029c, + 0x3c8c, 0x0dbf, 0x5eea, 0x6fd9, 0xf840, 0xc973, 0x9a26, 0xab15, + 0xcc0d, 0xfd3e, 0xae6b, 0x9f58, 0x08c1, 0x39f2, 0x6aa7, 0x5b94, + 0x6584, 0x54b7, 0x07e2, 0x36d1, 0xa148, 0x907b, 0xc32e, 0xf21d, + 0xbf0e, 0x8e3d, 0xdd68, 0xec5b, 0x7bc2, 0x4af1, 0x19a4, 0x2897, + 0x1687, 0x27b4, 0x74e1, 0x45d2, 0xd24b, 0xe378, 0xb02d, 0x811e, + 0x2a0b, 0x1b38, 0x486d, 0x795e, 0xeec7, 0xdff4, 0x8ca1, 0xbd92, + 0x8382, 0xb2b1, 0xe1e4, 0xd0d7, 0x474e, 0x767d, 0x2528, 0x141b, + 0x5908, 0x683b, 0x3b6e, 0x0a5d, 0x9dc4, 0xacf7, 0xffa2, 0xce91, + 0xf081, 0xc1b2, 0x92e7, 0xa3d4, 0x344d, 0x057e, 0x562b, 0x6718, + 0x981b, 0xa928, 0xfa7d, 0xcb4e, 0x5cd7, 0x6de4, 0x3eb1, 0x0f82, + 0x3192, 0x00a1, 0x53f4, 0x62c7, 0xf55e, 0xc46d, 0x9738, 0xa60b, + 0xeb18, 0xda2b, 0x897e, 0xb84d, 0x2fd4, 0x1ee7, 0x4db2, 0x7c81, + 0x4291, 0x73a2, 0x20f7, 0x11c4, 0x865d, 0xb76e, 0xe43b, 0xd508, + 0x7e1d, 0x4f2e, 0x1c7b, 0x2d48, 0xbad1, 0x8be2, 0xd8b7, 0xe984, + 0xd794, 0xe6a7, 0xb5f2, 0x84c1, 0x1358, 0x226b, 0x713e, 0x400d, + 0x0d1e, 0x3c2d, 0x6f78, 0x5e4b, 0xc9d2, 0xf8e1, 0xabb4, 0x9a87, + 0xa497, 0x95a4, 0xc6f1, 0xf7c2, 0x605b, 0x5168, 0x023d, 0x330e, + 0x5416, 0x6525, 0x3670, 0x0743, 0x90da, 0xa1e9, 0xf2bc, 0xc38f, + 0xfd9f, 0xccac, 0x9ff9, 0xaeca, 0x3953, 0x0860, 0x5b35, 0x6a06, + 0x2715, 0x1626, 0x4573, 0x7440, 0xe3d9, 0xd2ea, 0x81bf, 0xb08c, + 0x8e9c, 0xbfaf, 0xecfa, 0xddc9, 0x4a50, 0x7b63, 0x2836, 0x1905, + 0xb210, 0x8323, 0xd076, 0xe145, 0x76dc, 0x47ef, 0x14ba, 0x2589, + 0x1b99, 0x2aaa, 0x79ff, 0x48cc, 0xdf55, 0xee66, 0xbd33, 0x8c00, + 0xc113, 0xf020, 0xa375, 0x9246, 0x05df, 0x34ec, 0x67b9, 0x568a, + 0x689a, 0x59a9, 0x0afc, 0x3bcf, 0xac56, 0x9d65, 0xce30, 0xff03, + 0x0000, 0x3037, 0x606e, 0x5059, 0xc0dc, 0xf0eb, 0xa0b2, 0x9085, + 0xa1a9, 0x919e, 0xc1c7, 0xf1f0, 0x6175, 0x5142, 0x011b, 0x312c, + 0x6343, 0x5374, 0x032d, 0x331a, 0xa39f, 0x93a8, 0xc3f1, 0xf3c6, + 0xc2ea, 0xf2dd, 0xa284, 0x92b3, 0x0236, 0x3201, 0x6258, 0x526f, + 0xc686, 0xf6b1, 0xa6e8, 0x96df, 0x065a, 0x366d, 0x6634, 0x5603, + 0x672f, 0x5718, 0x0741, 0x3776, 0xa7f3, 0x97c4, 0xc79d, 0xf7aa, + 0xa5c5, 0x95f2, 0xc5ab, 0xf59c, 0x6519, 0x552e, 0x0577, 0x3540, + 0x046c, 0x345b, 0x6402, 0x5435, 0xc4b0, 0xf487, 0xa4de, 0x94e9, + 0xad1d, 0x9d2a, 0xcd73, 0xfd44, 0x6dc1, 0x5df6, 0x0daf, 0x3d98, + 0x0cb4, 0x3c83, 0x6cda, 0x5ced, 0xcc68, 0xfc5f, 0xac06, 0x9c31, + 0xce5e, 0xfe69, 0xae30, 0x9e07, 0x0e82, 0x3eb5, 0x6eec, 0x5edb, + 0x6ff7, 0x5fc0, 0x0f99, 0x3fae, 0xaf2b, 0x9f1c, 0xcf45, 0xff72, + 0x6b9b, 0x5bac, 0x0bf5, 0x3bc2, 0xab47, 0x9b70, 0xcb29, 0xfb1e, + 0xca32, 0xfa05, 0xaa5c, 0x9a6b, 0x0aee, 0x3ad9, 0x6a80, 0x5ab7, + 0x08d8, 0x38ef, 0x68b6, 0x5881, 0xc804, 0xf833, 0xa86a, 0x985d, + 0xa971, 0x9946, 0xc91f, 0xf928, 0x69ad, 0x599a, 0x09c3, 0x39f4, + 0x5a3b, 0x6a0c, 0x3a55, 0x0a62, 0x9ae7, 0xaad0, 0xfa89, 0xcabe, + 0xfb92, 0xcba5, 0x9bfc, 0xabcb, 0x3b4e, 0x0b79, 0x5b20, 0x6b17, + 0x3978, 0x094f, 0x5916, 0x6921, 0xf9a4, 0xc993, 0x99ca, 0xa9fd, + 0x98d1, 0xa8e6, 0xf8bf, 0xc888, 0x580d, 0x683a, 0x3863, 0x0854, + 0x9cbd, 0xac8a, 0xfcd3, 0xcce4, 0x5c61, 0x6c56, 0x3c0f, 0x0c38, + 0x3d14, 0x0d23, 0x5d7a, 0x6d4d, 0xfdc8, 0xcdff, 0x9da6, 0xad91, + 0xfffe, 0xcfc9, 0x9f90, 0xafa7, 0x3f22, 0x0f15, 0x5f4c, 0x6f7b, + 0x5e57, 0x6e60, 0x3e39, 0x0e0e, 0x9e8b, 0xaebc, 0xfee5, 0xced2, + 0xf726, 0xc711, 0x9748, 0xa77f, 0x37fa, 0x07cd, 0x5794, 0x67a3, + 0x568f, 0x66b8, 0x36e1, 0x06d6, 0x9653, 0xa664, 0xf63d, 0xc60a, + 0x9465, 0xa452, 0xf40b, 0xc43c, 0x54b9, 0x648e, 0x34d7, 0x04e0, + 0x35cc, 0x05fb, 0x55a2, 0x6595, 0xf510, 0xc527, 0x957e, 0xa549, + 0x31a0, 0x0197, 0x51ce, 0x61f9, 0xf17c, 0xc14b, 0x9112, 0xa125, + 0x9009, 0xa03e, 0xf067, 0xc050, 0x50d5, 0x60e2, 0x30bb, 0x008c, + 0x52e3, 0x62d4, 0x328d, 0x02ba, 0x923f, 0xa208, 0xf251, 0xc266, + 0xf34a, 0xc37d, 0x9324, 0xa313, 0x3396, 0x03a1, 0x53f8, 0x63cf, + 0x0000, 0xb476, 0x68ed, 0xdc9b, 0xf1ca, 0x45bc, 0x9927, 0x2d51, + 0xc385, 0x77f3, 0xab68, 0x1f1e, 0x324f, 0x8639, 0x5aa2, 0xeed4, + 0xa71b, 0x136d, 0xcff6, 0x7b80, 0x56d1, 0xe2a7, 0x3e3c, 0x8a4a, + 0x649e, 0xd0e8, 0x0c73, 0xb805, 0x9554, 0x2122, 0xfdb9, 0x49cf, + 0x4e37, 0xfa41, 0x26da, 0x92ac, 0xbffd, 0x0b8b, 0xd710, 0x6366, + 0x8db2, 0x39c4, 0xe55f, 0x5129, 0x7c78, 0xc80e, 0x1495, 0xa0e3, + 0xe92c, 0x5d5a, 0x81c1, 0x35b7, 0x18e6, 0xac90, 0x700b, 0xc47d, + 0x2aa9, 0x9edf, 0x4244, 0xf632, 0xdb63, 0x6f15, 0xb38e, 0x07f8, + 0x9c6e, 0x2818, 0xf483, 0x40f5, 0x6da4, 0xd9d2, 0x0549, 0xb13f, + 0x5feb, 0xeb9d, 0x3706, 0x8370, 0xae21, 0x1a57, 0xc6cc, 0x72ba, + 0x3b75, 0x8f03, 0x5398, 0xe7ee, 0xcabf, 0x7ec9, 0xa252, 0x1624, + 0xf8f0, 0x4c86, 0x901d, 0x246b, 0x093a, 0xbd4c, 0x61d7, 0xd5a1, + 0xd259, 0x662f, 0xbab4, 0x0ec2, 0x2393, 0x97e5, 0x4b7e, 0xff08, + 0x11dc, 0xa5aa, 0x7931, 0xcd47, 0xe016, 0x5460, 0x88fb, 0x3c8d, + 0x7542, 0xc134, 0x1daf, 0xa9d9, 0x8488, 0x30fe, 0xec65, 0x5813, + 0xb6c7, 0x02b1, 0xde2a, 0x6a5c, 0x470d, 0xf37b, 0x2fe0, 0x9b96, + 0x38dd, 0x8cab, 0x5030, 0xe446, 0xc917, 0x7d61, 0xa1fa, 0x158c, + 0xfb58, 0x4f2e, 0x93b5, 0x27c3, 0x0a92, 0xbee4, 0x627f, 0xd609, + 0x9fc6, 0x2bb0, 0xf72b, 0x435d, 0x6e0c, 0xda7a, 0x06e1, 0xb297, + 0x5c43, 0xe835, 0x34ae, 0x80d8, 0xad89, 0x19ff, 0xc564, 0x7112, + 0x76ea, 0xc29c, 0x1e07, 0xaa71, 0x8720, 0x3356, 0xefcd, 0x5bbb, + 0xb56f, 0x0119, 0xdd82, 0x69f4, 0x44a5, 0xf0d3, 0x2c48, 0x983e, + 0xd1f1, 0x6587, 0xb91c, 0x0d6a, 0x203b, 0x944d, 0x48d6, 0xfca0, + 0x1274, 0xa602, 0x7a99, 0xceef, 0xe3be, 0x57c8, 0x8b53, 0x3f25, + 0xa4b3, 0x10c5, 0xcc5e, 0x7828, 0x5579, 0xe10f, 0x3d94, 0x89e2, + 0x6736, 0xd340, 0x0fdb, 0xbbad, 0x96fc, 0x228a, 0xfe11, 0x4a67, + 0x03a8, 0xb7de, 0x6b45, 0xdf33, 0xf262, 0x4614, 0x9a8f, 0x2ef9, + 0xc02d, 0x745b, 0xa8c0, 0x1cb6, 0x31e7, 0x8591, 0x590a, 0xed7c, + 0xea84, 0x5ef2, 0x8269, 0x361f, 0x1b4e, 0xaf38, 0x73a3, 0xc7d5, + 0x2901, 0x9d77, 0x41ec, 0xf59a, 0xd8cb, 0x6cbd, 0xb026, 0x0450, + 0x4d9f, 0xf9e9, 0x2572, 0x9104, 0xbc55, 0x0823, 0xd4b8, 0x60ce, + 0x8e1a, 0x3a6c, 0xe6f7, 0x5281, 0x7fd0, 0xcba6, 0x173d, 0xa34b +}; + +const uint16_t crc_table_x25[1024] PROGMEM = { + 0x0000, 0x1189, 0x2312, 0x329b, 0x4624, 0x57ad, 0x6536, 0x74bf, + 0x8c48, 0x9dc1, 0xaf5a, 0xbed3, 0xca6c, 0xdbe5, 0xe97e, 0xf8f7, + 0x1081, 0x0108, 0x3393, 0x221a, 0x56a5, 0x472c, 0x75b7, 0x643e, + 0x9cc9, 0x8d40, 0xbfdb, 0xae52, 0xdaed, 0xcb64, 0xf9ff, 0xe876, + 0x2102, 0x308b, 0x0210, 0x1399, 0x6726, 0x76af, 0x4434, 0x55bd, + 0xad4a, 0xbcc3, 0x8e58, 0x9fd1, 0xeb6e, 0xfae7, 0xc87c, 0xd9f5, + 0x3183, 0x200a, 0x1291, 0x0318, 0x77a7, 0x662e, 0x54b5, 0x453c, + 0xbdcb, 0xac42, 0x9ed9, 0x8f50, 0xfbef, 0xea66, 0xd8fd, 0xc974, + 0x4204, 0x538d, 0x6116, 0x709f, 0x0420, 0x15a9, 0x2732, 0x36bb, + 0xce4c, 0xdfc5, 0xed5e, 0xfcd7, 0x8868, 0x99e1, 0xab7a, 0xbaf3, + 0x5285, 0x430c, 0x7197, 0x601e, 0x14a1, 0x0528, 0x37b3, 0x263a, + 0xdecd, 0xcf44, 0xfddf, 0xec56, 0x98e9, 0x8960, 0xbbfb, 0xaa72, + 0x6306, 0x728f, 0x4014, 0x519d, 0x2522, 0x34ab, 0x0630, 0x17b9, + 0xef4e, 0xfec7, 0xcc5c, 0xddd5, 0xa96a, 0xb8e3, 0x8a78, 0x9bf1, + 0x7387, 0x620e, 0x5095, 0x411c, 0x35a3, 0x242a, 0x16b1, 0x0738, + 0xffcf, 0xee46, 0xdcdd, 0xcd54, 0xb9eb, 0xa862, 0x9af9, 0x8b70, + 0x8408, 0x9581, 0xa71a, 0xb693, 0xc22c, 0xd3a5, 0xe13e, 0xf0b7, + 0x0840, 0x19c9, 0x2b52, 0x3adb, 0x4e64, 0x5fed, 0x6d76, 0x7cff, + 0x9489, 0x8500, 0xb79b, 0xa612, 0xd2ad, 0xc324, 0xf1bf, 0xe036, + 0x18c1, 0x0948, 0x3bd3, 0x2a5a, 0x5ee5, 0x4f6c, 0x7df7, 0x6c7e, + 0xa50a, 0xb483, 0x8618, 0x9791, 0xe32e, 0xf2a7, 0xc03c, 0xd1b5, + 0x2942, 0x38cb, 0x0a50, 0x1bd9, 0x6f66, 0x7eef, 0x4c74, 0x5dfd, + 0xb58b, 0xa402, 0x9699, 0x8710, 0xf3af, 0xe226, 0xd0bd, 0xc134, + 0x39c3, 0x284a, 0x1ad1, 0x0b58, 0x7fe7, 0x6e6e, 0x5cf5, 0x4d7c, + 0xc60c, 0xd785, 0xe51e, 0xf497, 0x8028, 0x91a1, 0xa33a, 0xb2b3, + 0x4a44, 0x5bcd, 0x6956, 0x78df, 0x0c60, 0x1de9, 0x2f72, 0x3efb, + 0xd68d, 0xc704, 0xf59f, 0xe416, 0x90a9, 0x8120, 0xb3bb, 0xa232, + 0x5ac5, 0x4b4c, 0x79d7, 0x685e, 0x1ce1, 0x0d68, 0x3ff3, 0x2e7a, + 0xe70e, 0xf687, 0xc41c, 0xd595, 0xa12a, 0xb0a3, 0x8238, 0x93b1, + 0x6b46, 0x7acf, 0x4854, 0x59dd, 0x2d62, 0x3ceb, 0x0e70, 0x1ff9, + 0xf78f, 0xe606, 0xd49d, 0xc514, 0xb1ab, 0xa022, 0x92b9, 0x8330, + 0x7bc7, 0x6a4e, 0x58d5, 0x495c, 0x3de3, 0x2c6a, 0x1ef1, 0x0f78, + 0x0000, 0x19d8, 0x33b0, 0x2a68, 0x6760, 0x7eb8, 0x54d0, 0x4d08, + 0xcec0, 0xd718, 0xfd70, 0xe4a8, 0xa9a0, 0xb078, 0x9a10, 0x83c8, + 0x9591, 0x8c49, 0xa621, 0xbff9, 0xf2f1, 0xeb29, 0xc141, 0xd899, + 0x5b51, 0x4289, 0x68e1, 0x7139, 0x3c31, 0x25e9, 0x0f81, 0x1659, + 0x2333, 0x3aeb, 0x1083, 0x095b, 0x4453, 0x5d8b, 0x77e3, 0x6e3b, + 0xedf3, 0xf42b, 0xde43, 0xc79b, 0x8a93, 0x934b, 0xb923, 0xa0fb, + 0xb6a2, 0xaf7a, 0x8512, 0x9cca, 0xd1c2, 0xc81a, 0xe272, 0xfbaa, + 0x7862, 0x61ba, 0x4bd2, 0x520a, 0x1f02, 0x06da, 0x2cb2, 0x356a, + 0x4666, 0x5fbe, 0x75d6, 0x6c0e, 0x2106, 0x38de, 0x12b6, 0x0b6e, + 0x88a6, 0x917e, 0xbb16, 0xa2ce, 0xefc6, 0xf61e, 0xdc76, 0xc5ae, + 0xd3f7, 0xca2f, 0xe047, 0xf99f, 0xb497, 0xad4f, 0x8727, 0x9eff, + 0x1d37, 0x04ef, 0x2e87, 0x375f, 0x7a57, 0x638f, 0x49e7, 0x503f, + 0x6555, 0x7c8d, 0x56e5, 0x4f3d, 0x0235, 0x1bed, 0x3185, 0x285d, + 0xab95, 0xb24d, 0x9825, 0x81fd, 0xccf5, 0xd52d, 0xff45, 0xe69d, + 0xf0c4, 0xe91c, 0xc374, 0xdaac, 0x97a4, 0x8e7c, 0xa414, 0xbdcc, + 0x3e04, 0x27dc, 0x0db4, 0x146c, 0x5964, 0x40bc, 0x6ad4, 0x730c, + 0x8ccc, 0x9514, 0xbf7c, 0xa6a4, 0xebac, 0xf274, 0xd81c, 0xc1c4, + 0x420c, 0x5bd4, 0x71bc, 0x6864, 0x256c, 0x3cb4, 0x16dc, 0x0f04, + 0x195d, 0x0085, 0x2aed, 0x3335, 0x7e3d, 0x67e5, 0x4d8d, 0x5455, + 0xd79d, 0xce45, 0xe42d, 0xfdf5, 0xb0fd, 0xa925, 0x834d, 0x9a95, + 0xafff, 0xb627, 0x9c4f, 0x8597, 0xc89f, 0xd147, 0xfb2f, 0xe2f7, + 0x613f, 0x78e7, 0x528f, 0x4b57, 0x065f, 0x1f87, 0x35ef, 0x2c37, + 0x3a6e, 0x23b6, 0x09de, 0x1006, 0x5d0e, 0x44d6, 0x6ebe, 0x7766, + 0xf4ae, 0xed76, 0xc71e, 0xdec6, 0x93ce, 0x8a16, 0xa07e, 0xb9a6, + 0xcaaa, 0xd372, 0xf91a, 0xe0c2, 0xadca, 0xb412, 0x9e7a, 0x87a2, + 0x046a, 0x1db2, 0x37da, 0x2e02, 0x630a, 0x7ad2, 0x50ba, 0x4962, + 0x5f3b, 0x46e3, 0x6c8b, 0x7553, 0x385b, 0x2183, 0x0beb, 0x1233, + 0x91fb, 0x8823, 0xa24b, 0xbb93, 0xf69b, 0xef43, 0xc52b, 0xdcf3, + 0xe999, 0xf041, 0xda29, 0xc3f1, 0x8ef9, 0x9721, 0xbd49, 0xa491, + 0x2759, 0x3e81, 0x14e9, 0x0d31, 0x4039, 0x59e1, 0x7389, 0x6a51, + 0x7c08, 0x65d0, 0x4fb8, 0x5660, 0x1b68, 0x02b0, 0x28d8, 0x3100, + 0xb2c8, 0xab10, 0x8178, 0x98a0, 0xd5a8, 0xcc70, 0xe618, 0xffc0, + 0x0000, 0x5adc, 0xb5b8, 0xef64, 0x6361, 0x39bd, 0xd6d9, 0x8c05, + 0xc6c2, 0x9c1e, 0x737a, 0x29a6, 0xa5a3, 0xff7f, 0x101b, 0x4ac7, + 0x8595, 0xdf49, 0x302d, 0x6af1, 0xe6f4, 0xbc28, 0x534c, 0x0990, + 0x4357, 0x198b, 0xf6ef, 0xac33, 0x2036, 0x7aea, 0x958e, 0xcf52, + 0x033b, 0x59e7, 0xb683, 0xec5f, 0x605a, 0x3a86, 0xd5e2, 0x8f3e, + 0xc5f9, 0x9f25, 0x7041, 0x2a9d, 0xa698, 0xfc44, 0x1320, 0x49fc, + 0x86ae, 0xdc72, 0x3316, 0x69ca, 0xe5cf, 0xbf13, 0x5077, 0x0aab, + 0x406c, 0x1ab0, 0xf5d4, 0xaf08, 0x230d, 0x79d1, 0x96b5, 0xcc69, + 0x0676, 0x5caa, 0xb3ce, 0xe912, 0x6517, 0x3fcb, 0xd0af, 0x8a73, + 0xc0b4, 0x9a68, 0x750c, 0x2fd0, 0xa3d5, 0xf909, 0x166d, 0x4cb1, + 0x83e3, 0xd93f, 0x365b, 0x6c87, 0xe082, 0xba5e, 0x553a, 0x0fe6, + 0x4521, 0x1ffd, 0xf099, 0xaa45, 0x2640, 0x7c9c, 0x93f8, 0xc924, + 0x054d, 0x5f91, 0xb0f5, 0xea29, 0x662c, 0x3cf0, 0xd394, 0x8948, + 0xc38f, 0x9953, 0x7637, 0x2ceb, 0xa0ee, 0xfa32, 0x1556, 0x4f8a, + 0x80d8, 0xda04, 0x3560, 0x6fbc, 0xe3b9, 0xb965, 0x5601, 0x0cdd, + 0x461a, 0x1cc6, 0xf3a2, 0xa97e, 0x257b, 0x7fa7, 0x90c3, 0xca1f, + 0x0cec, 0x5630, 0xb954, 0xe388, 0x6f8d, 0x3551, 0xda35, 0x80e9, + 0xca2e, 0x90f2, 0x7f96, 0x254a, 0xa94f, 0xf393, 0x1cf7, 0x462b, + 0x8979, 0xd3a5, 0x3cc1, 0x661d, 0xea18, 0xb0c4, 0x5fa0, 0x057c, + 0x4fbb, 0x1567, 0xfa03, 0xa0df, 0x2cda, 0x7606, 0x9962, 0xc3be, + 0x0fd7, 0x550b, 0xba6f, 0xe0b3, 0x6cb6, 0x366a, 0xd90e, 0x83d2, + 0xc915, 0x93c9, 0x7cad, 0x2671, 0xaa74, 0xf0a8, 0x1fcc, 0x4510, + 0x8a42, 0xd09e, 0x3ffa, 0x6526, 0xe923, 0xb3ff, 0x5c9b, 0x0647, + 0x4c80, 0x165c, 0xf938, 0xa3e4, 0x2fe1, 0x753d, 0x9a59, 0xc085, + 0x0a9a, 0x5046, 0xbf22, 0xe5fe, 0x69fb, 0x3327, 0xdc43, 0x869f, + 0xcc58, 0x9684, 0x79e0, 0x233c, 0xaf39, 0xf5e5, 0x1a81, 0x405d, + 0x8f0f, 0xd5d3, 0x3ab7, 0x606b, 0xec6e, 0xb6b2, 0x59d6, 0x030a, + 0x49cd, 0x1311, 0xfc75, 0xa6a9, 0x2aac, 0x7070, 0x9f14, 0xc5c8, + 0x09a1, 0x537d, 0xbc19, 0xe6c5, 0x6ac0, 0x301c, 0xdf78, 0x85a4, + 0xcf63, 0x95bf, 0x7adb, 0x2007, 0xac02, 0xf6de, 0x19ba, 0x4366, + 0x8c34, 0xd6e8, 0x398c, 0x6350, 0xef55, 0xb589, 0x5aed, 0x0031, + 0x4af6, 0x102a, 0xff4e, 0xa592, 0x2997, 0x734b, 0x9c2f, 0xc6f3, + 0x0000, 0x1cbb, 0x3976, 0x25cd, 0x72ec, 0x6e57, 0x4b9a, 0x5721, + 0xe5d8, 0xf963, 0xdcae, 0xc015, 0x9734, 0x8b8f, 0xae42, 0xb2f9, + 0xc3a1, 0xdf1a, 0xfad7, 0xe66c, 0xb14d, 0xadf6, 0x883b, 0x9480, + 0x2679, 0x3ac2, 0x1f0f, 0x03b4, 0x5495, 0x482e, 0x6de3, 0x7158, + 0x8f53, 0x93e8, 0xb625, 0xaa9e, 0xfdbf, 0xe104, 0xc4c9, 0xd872, + 0x6a8b, 0x7630, 0x53fd, 0x4f46, 0x1867, 0x04dc, 0x2111, 0x3daa, + 0x4cf2, 0x5049, 0x7584, 0x693f, 0x3e1e, 0x22a5, 0x0768, 0x1bd3, + 0xa92a, 0xb591, 0x905c, 0x8ce7, 0xdbc6, 0xc77d, 0xe2b0, 0xfe0b, + 0x16b7, 0x0a0c, 0x2fc1, 0x337a, 0x645b, 0x78e0, 0x5d2d, 0x4196, + 0xf36f, 0xefd4, 0xca19, 0xd6a2, 0x8183, 0x9d38, 0xb8f5, 0xa44e, + 0xd516, 0xc9ad, 0xec60, 0xf0db, 0xa7fa, 0xbb41, 0x9e8c, 0x8237, + 0x30ce, 0x2c75, 0x09b8, 0x1503, 0x4222, 0x5e99, 0x7b54, 0x67ef, + 0x99e4, 0x855f, 0xa092, 0xbc29, 0xeb08, 0xf7b3, 0xd27e, 0xcec5, + 0x7c3c, 0x6087, 0x454a, 0x59f1, 0x0ed0, 0x126b, 0x37a6, 0x2b1d, + 0x5a45, 0x46fe, 0x6333, 0x7f88, 0x28a9, 0x3412, 0x11df, 0x0d64, + 0xbf9d, 0xa326, 0x86eb, 0x9a50, 0xcd71, 0xd1ca, 0xf407, 0xe8bc, + 0x2d6e, 0x31d5, 0x1418, 0x08a3, 0x5f82, 0x4339, 0x66f4, 0x7a4f, + 0xc8b6, 0xd40d, 0xf1c0, 0xed7b, 0xba5a, 0xa6e1, 0x832c, 0x9f97, + 0xeecf, 0xf274, 0xd7b9, 0xcb02, 0x9c23, 0x8098, 0xa555, 0xb9ee, + 0x0b17, 0x17ac, 0x3261, 0x2eda, 0x79fb, 0x6540, 0x408d, 0x5c36, + 0xa23d, 0xbe86, 0x9b4b, 0x87f0, 0xd0d1, 0xcc6a, 0xe9a7, 0xf51c, + 0x47e5, 0x5b5e, 0x7e93, 0x6228, 0x3509, 0x29b2, 0x0c7f, 0x10c4, + 0x619c, 0x7d27, 0x58ea, 0x4451, 0x1370, 0x0fcb, 0x2a06, 0x36bd, + 0x8444, 0x98ff, 0xbd32, 0xa189, 0xf6a8, 0xea13, 0xcfde, 0xd365, + 0x3bd9, 0x2762, 0x02af, 0x1e14, 0x4935, 0x558e, 0x7043, 0x6cf8, + 0xde01, 0xc2ba, 0xe777, 0xfbcc, 0xaced, 0xb056, 0x959b, 0x8920, + 0xf878, 0xe4c3, 0xc10e, 0xddb5, 0x8a94, 0x962f, 0xb3e2, 0xaf59, + 0x1da0, 0x011b, 0x24d6, 0x386d, 0x6f4c, 0x73f7, 0x563a, 0x4a81, + 0xb48a, 0xa831, 0x8dfc, 0x9147, 0xc666, 0xdadd, 0xff10, 0xe3ab, + 0x5152, 0x4de9, 0x6824, 0x749f, 0x23be, 0x3f05, 0x1ac8, 0x0673, + 0x772b, 0x6b90, 0x4e5d, 0x52e6, 0x05c7, 0x197c, 0x3cb1, 0x200a, + 0x92f3, 0x8e48, 0xab85, 0xb73e, 0xe01f, 0xfca4, 0xd969, 0xc5d2 +}; + +const uint32_t crc_table_crc32[256] PROGMEM = { + 0x00000000, 0x77073096, 0xee0e612c, 0x990951ba, + 0x076dc419, 0x706af48f, 0xe963a535, 0x9e6495a3, + 0x0edb8832, 0x79dcb8a4, 0xe0d5e91e, 0x97d2d988, + 0x09b64c2b, 0x7eb17cbd, 0xe7b82d07, 0x90bf1d91, + 0x1db71064, 0x6ab020f2, 0xf3b97148, 0x84be41de, + 0x1adad47d, 0x6ddde4eb, 0xf4d4b551, 0x83d385c7, + 0x136c9856, 0x646ba8c0, 0xfd62f97a, 0x8a65c9ec, + 0x14015c4f, 0x63066cd9, 0xfa0f3d63, 0x8d080df5, + 0x3b6e20c8, 0x4c69105e, 0xd56041e4, 0xa2677172, + 0x3c03e4d1, 0x4b04d447, 0xd20d85fd, 0xa50ab56b, + 0x35b5a8fa, 0x42b2986c, 0xdbbbc9d6, 0xacbcf940, + 0x32d86ce3, 0x45df5c75, 0xdcd60dcf, 0xabd13d59, + 0x26d930ac, 0x51de003a, 0xc8d75180, 0xbfd06116, + 0x21b4f4b5, 0x56b3c423, 0xcfba9599, 0xb8bda50f, + 0x2802b89e, 0x5f058808, 0xc60cd9b2, 0xb10be924, + 0x2f6f7c87, 0x58684c11, 0xc1611dab, 0xb6662d3d, + 0x76dc4190, 0x01db7106, 0x98d220bc, 0xefd5102a, + 0x71b18589, 0x06b6b51f, 0x9fbfe4a5, 0xe8b8d433, + 0x7807c9a2, 0x0f00f934, 0x9609a88e, 0xe10e9818, + 0x7f6a0dbb, 0x086d3d2d, 0x91646c97, 0xe6635c01, + 0x6b6b51f4, 0x1c6c6162, 0x856530d8, 0xf262004e, + 0x6c0695ed, 0x1b01a57b, 0x8208f4c1, 0xf50fc457, + 0x65b0d9c6, 0x12b7e950, 0x8bbeb8ea, 0xfcb9887c, + 0x62dd1ddf, 0x15da2d49, 0x8cd37cf3, 0xfbd44c65, + 0x4db26158, 0x3ab551ce, 0xa3bc0074, 0xd4bb30e2, + 0x4adfa541, 0x3dd895d7, 0xa4d1c46d, 0xd3d6f4fb, + 0x4369e96a, 0x346ed9fc, 0xad678846, 0xda60b8d0, + 0x44042d73, 0x33031de5, 0xaa0a4c5f, 0xdd0d7cc9, + 0x5005713c, 0x270241aa, 0xbe0b1010, 0xc90c2086, + 0x5768b525, 0x206f85b3, 0xb966d409, 0xce61e49f, + 0x5edef90e, 0x29d9c998, 0xb0d09822, 0xc7d7a8b4, + 0x59b33d17, 0x2eb40d81, 0xb7bd5c3b, 0xc0ba6cad, + 0xedb88320, 0x9abfb3b6, 0x03b6e20c, 0x74b1d29a, + 0xead54739, 0x9dd277af, 0x04db2615, 0x73dc1683, + 0xe3630b12, 0x94643b84, 0x0d6d6a3e, 0x7a6a5aa8, + 0xe40ecf0b, 0x9309ff9d, 0x0a00ae27, 0x7d079eb1, + 0xf00f9344, 0x8708a3d2, 0x1e01f268, 0x6906c2fe, + 0xf762575d, 0x806567cb, 0x196c3671, 0x6e6b06e7, + 0xfed41b76, 0x89d32be0, 0x10da7a5a, 0x67dd4acc, + 0xf9b9df6f, 0x8ebeeff9, 0x17b7be43, 0x60b08ed5, + 0xd6d6a3e8, 0xa1d1937e, 0x38d8c2c4, 0x4fdff252, + 0xd1bb67f1, 0xa6bc5767, 0x3fb506dd, 0x48b2364b, + 0xd80d2bda, 0xaf0a1b4c, 0x36034af6, 0x41047a60, + 0xdf60efc3, 0xa867df55, 0x316e8eef, 0x4669be79, + 0xcb61b38c, 0xbc66831a, 0x256fd2a0, 0x5268e236, + 0xcc0c7795, 0xbb0b4703, 0x220216b9, 0x5505262f, + 0xc5ba3bbe, 0xb2bd0b28, 0x2bb45a92, 0x5cb36a04, + 0xc2d7ffa7, 0xb5d0cf31, 0x2cd99e8b, 0x5bdeae1d, + 0x9b64c2b0, 0xec63f226, 0x756aa39c, 0x026d930a, + 0x9c0906a9, 0xeb0e363f, 0x72076785, 0x05005713, + 0x95bf4a82, 0xe2b87a14, 0x7bb12bae, 0x0cb61b38, + 0x92d28e9b, 0xe5d5be0d, 0x7cdcefb7, 0x0bdbdf21, + 0x86d3d2d4, 0xf1d4e242, 0x68ddb3f8, 0x1fda836e, + 0x81be16cd, 0xf6b9265b, 0x6fb077e1, 0x18b74777, + 0x88085ae6, 0xff0f6a70, 0x66063bca, 0x11010b5c, + 0x8f659eff, 0xf862ae69, 0x616bffd3, 0x166ccf45, + 0xa00ae278, 0xd70dd2ee, 0x4e048354, 0x3903b3c2, + 0xa7672661, 0xd06016f7, 0x4969474d, 0x3e6e77db, + 0xaed16a4a, 0xd9d65adc, 0x40df0b66, 0x37d83bf0, + 0xa9bcae53, 0xdebb9ec5, 0x47b2cf7f, 0x30b5ffe9, + 0xbdbdf21c, 0xcabac28a, 0x53b39330, 0x24b4a3a6, + 0xbad03605, 0xcdd70693, 0x54de5729, 0x23d967bf, + 0xb3667a2e, 0xc4614ab8, 0x5d681b02, 0x2a6f2b94, + 0xb40bbe37, 0xc30c8ea1, 0x5a05df1b, 0x2d02ef8d +}; + +const uint32_t crc_table_crc32_big[1024] PROGMEM = { + 0x00000000, 0x77073096, 0xee0e612c, 0x990951ba, + 0x076dc419, 0x706af48f, 0xe963a535, 0x9e6495a3, + 0x0edb8832, 0x79dcb8a4, 0xe0d5e91e, 0x97d2d988, + 0x09b64c2b, 0x7eb17cbd, 0xe7b82d07, 0x90bf1d91, + 0x1db71064, 0x6ab020f2, 0xf3b97148, 0x84be41de, + 0x1adad47d, 0x6ddde4eb, 0xf4d4b551, 0x83d385c7, + 0x136c9856, 0x646ba8c0, 0xfd62f97a, 0x8a65c9ec, + 0x14015c4f, 0x63066cd9, 0xfa0f3d63, 0x8d080df5, + 0x3b6e20c8, 0x4c69105e, 0xd56041e4, 0xa2677172, + 0x3c03e4d1, 0x4b04d447, 0xd20d85fd, 0xa50ab56b, + 0x35b5a8fa, 0x42b2986c, 0xdbbbc9d6, 0xacbcf940, + 0x32d86ce3, 0x45df5c75, 0xdcd60dcf, 0xabd13d59, + 0x26d930ac, 0x51de003a, 0xc8d75180, 0xbfd06116, + 0x21b4f4b5, 0x56b3c423, 0xcfba9599, 0xb8bda50f, + 0x2802b89e, 0x5f058808, 0xc60cd9b2, 0xb10be924, + 0x2f6f7c87, 0x58684c11, 0xc1611dab, 0xb6662d3d, + 0x76dc4190, 0x01db7106, 0x98d220bc, 0xefd5102a, + 0x71b18589, 0x06b6b51f, 0x9fbfe4a5, 0xe8b8d433, + 0x7807c9a2, 0x0f00f934, 0x9609a88e, 0xe10e9818, + 0x7f6a0dbb, 0x086d3d2d, 0x91646c97, 0xe6635c01, + 0x6b6b51f4, 0x1c6c6162, 0x856530d8, 0xf262004e, + 0x6c0695ed, 0x1b01a57b, 0x8208f4c1, 0xf50fc457, + 0x65b0d9c6, 0x12b7e950, 0x8bbeb8ea, 0xfcb9887c, + 0x62dd1ddf, 0x15da2d49, 0x8cd37cf3, 0xfbd44c65, + 0x4db26158, 0x3ab551ce, 0xa3bc0074, 0xd4bb30e2, + 0x4adfa541, 0x3dd895d7, 0xa4d1c46d, 0xd3d6f4fb, + 0x4369e96a, 0x346ed9fc, 0xad678846, 0xda60b8d0, + 0x44042d73, 0x33031de5, 0xaa0a4c5f, 0xdd0d7cc9, + 0x5005713c, 0x270241aa, 0xbe0b1010, 0xc90c2086, + 0x5768b525, 0x206f85b3, 0xb966d409, 0xce61e49f, + 0x5edef90e, 0x29d9c998, 0xb0d09822, 0xc7d7a8b4, + 0x59b33d17, 0x2eb40d81, 0xb7bd5c3b, 0xc0ba6cad, + 0xedb88320, 0x9abfb3b6, 0x03b6e20c, 0x74b1d29a, + 0xead54739, 0x9dd277af, 0x04db2615, 0x73dc1683, + 0xe3630b12, 0x94643b84, 0x0d6d6a3e, 0x7a6a5aa8, + 0xe40ecf0b, 0x9309ff9d, 0x0a00ae27, 0x7d079eb1, + 0xf00f9344, 0x8708a3d2, 0x1e01f268, 0x6906c2fe, + 0xf762575d, 0x806567cb, 0x196c3671, 0x6e6b06e7, + 0xfed41b76, 0x89d32be0, 0x10da7a5a, 0x67dd4acc, + 0xf9b9df6f, 0x8ebeeff9, 0x17b7be43, 0x60b08ed5, + 0xd6d6a3e8, 0xa1d1937e, 0x38d8c2c4, 0x4fdff252, + 0xd1bb67f1, 0xa6bc5767, 0x3fb506dd, 0x48b2364b, + 0xd80d2bda, 0xaf0a1b4c, 0x36034af6, 0x41047a60, + 0xdf60efc3, 0xa867df55, 0x316e8eef, 0x4669be79, + 0xcb61b38c, 0xbc66831a, 0x256fd2a0, 0x5268e236, + 0xcc0c7795, 0xbb0b4703, 0x220216b9, 0x5505262f, + 0xc5ba3bbe, 0xb2bd0b28, 0x2bb45a92, 0x5cb36a04, + 0xc2d7ffa7, 0xb5d0cf31, 0x2cd99e8b, 0x5bdeae1d, + 0x9b64c2b0, 0xec63f226, 0x756aa39c, 0x026d930a, + 0x9c0906a9, 0xeb0e363f, 0x72076785, 0x05005713, + 0x95bf4a82, 0xe2b87a14, 0x7bb12bae, 0x0cb61b38, + 0x92d28e9b, 0xe5d5be0d, 0x7cdcefb7, 0x0bdbdf21, + 0x86d3d2d4, 0xf1d4e242, 0x68ddb3f8, 0x1fda836e, + 0x81be16cd, 0xf6b9265b, 0x6fb077e1, 0x18b74777, + 0x88085ae6, 0xff0f6a70, 0x66063bca, 0x11010b5c, + 0x8f659eff, 0xf862ae69, 0x616bffd3, 0x166ccf45, + 0xa00ae278, 0xd70dd2ee, 0x4e048354, 0x3903b3c2, + 0xa7672661, 0xd06016f7, 0x4969474d, 0x3e6e77db, + 0xaed16a4a, 0xd9d65adc, 0x40df0b66, 0x37d83bf0, + 0xa9bcae53, 0xdebb9ec5, 0x47b2cf7f, 0x30b5ffe9, + 0xbdbdf21c, 0xcabac28a, 0x53b39330, 0x24b4a3a6, + 0xbad03605, 0xcdd70693, 0x54de5729, 0x23d967bf, + 0xb3667a2e, 0xc4614ab8, 0x5d681b02, 0x2a6f2b94, + 0xb40bbe37, 0xc30c8ea1, 0x5a05df1b, 0x2d02ef8d, + 0x00000000, 0x191b3141, 0x32366282, 0x2b2d53c3, + 0x646cc504, 0x7d77f445, 0x565aa786, 0x4f4196c7, + 0xc8d98a08, 0xd1c2bb49, 0xfaefe88a, 0xe3f4d9cb, + 0xacb54f0c, 0xb5ae7e4d, 0x9e832d8e, 0x87981ccf, + 0x4ac21251, 0x53d92310, 0x78f470d3, 0x61ef4192, + 0x2eaed755, 0x37b5e614, 0x1c98b5d7, 0x05838496, + 0x821b9859, 0x9b00a918, 0xb02dfadb, 0xa936cb9a, + 0xe6775d5d, 0xff6c6c1c, 0xd4413fdf, 0xcd5a0e9e, + 0x958424a2, 0x8c9f15e3, 0xa7b24620, 0xbea97761, + 0xf1e8e1a6, 0xe8f3d0e7, 0xc3de8324, 0xdac5b265, + 0x5d5daeaa, 0x44469feb, 0x6f6bcc28, 0x7670fd69, + 0x39316bae, 0x202a5aef, 0x0b07092c, 0x121c386d, + 0xdf4636f3, 0xc65d07b2, 0xed705471, 0xf46b6530, + 0xbb2af3f7, 0xa231c2b6, 0x891c9175, 0x9007a034, + 0x179fbcfb, 0x0e848dba, 0x25a9de79, 0x3cb2ef38, + 0x73f379ff, 0x6ae848be, 0x41c51b7d, 0x58de2a3c, + 0xf0794f05, 0xe9627e44, 0xc24f2d87, 0xdb541cc6, + 0x94158a01, 0x8d0ebb40, 0xa623e883, 0xbf38d9c2, + 0x38a0c50d, 0x21bbf44c, 0x0a96a78f, 0x138d96ce, + 0x5ccc0009, 0x45d73148, 0x6efa628b, 0x77e153ca, + 0xbabb5d54, 0xa3a06c15, 0x888d3fd6, 0x91960e97, + 0xded79850, 0xc7cca911, 0xece1fad2, 0xf5facb93, + 0x7262d75c, 0x6b79e61d, 0x4054b5de, 0x594f849f, + 0x160e1258, 0x0f152319, 0x243870da, 0x3d23419b, + 0x65fd6ba7, 0x7ce65ae6, 0x57cb0925, 0x4ed03864, + 0x0191aea3, 0x188a9fe2, 0x33a7cc21, 0x2abcfd60, + 0xad24e1af, 0xb43fd0ee, 0x9f12832d, 0x8609b26c, + 0xc94824ab, 0xd05315ea, 0xfb7e4629, 0xe2657768, + 0x2f3f79f6, 0x362448b7, 0x1d091b74, 0x04122a35, + 0x4b53bcf2, 0x52488db3, 0x7965de70, 0x607eef31, + 0xe7e6f3fe, 0xfefdc2bf, 0xd5d0917c, 0xcccba03d, + 0x838a36fa, 0x9a9107bb, 0xb1bc5478, 0xa8a76539, + 0x3b83984b, 0x2298a90a, 0x09b5fac9, 0x10aecb88, + 0x5fef5d4f, 0x46f46c0e, 0x6dd93fcd, 0x74c20e8c, + 0xf35a1243, 0xea412302, 0xc16c70c1, 0xd8774180, + 0x9736d747, 0x8e2de606, 0xa500b5c5, 0xbc1b8484, + 0x71418a1a, 0x685abb5b, 0x4377e898, 0x5a6cd9d9, + 0x152d4f1e, 0x0c367e5f, 0x271b2d9c, 0x3e001cdd, + 0xb9980012, 0xa0833153, 0x8bae6290, 0x92b553d1, + 0xddf4c516, 0xc4eff457, 0xefc2a794, 0xf6d996d5, + 0xae07bce9, 0xb71c8da8, 0x9c31de6b, 0x852aef2a, + 0xca6b79ed, 0xd37048ac, 0xf85d1b6f, 0xe1462a2e, + 0x66de36e1, 0x7fc507a0, 0x54e85463, 0x4df36522, + 0x02b2f3e5, 0x1ba9c2a4, 0x30849167, 0x299fa026, + 0xe4c5aeb8, 0xfdde9ff9, 0xd6f3cc3a, 0xcfe8fd7b, + 0x80a96bbc, 0x99b25afd, 0xb29f093e, 0xab84387f, + 0x2c1c24b0, 0x350715f1, 0x1e2a4632, 0x07317773, + 0x4870e1b4, 0x516bd0f5, 0x7a468336, 0x635db277, + 0xcbfad74e, 0xd2e1e60f, 0xf9ccb5cc, 0xe0d7848d, + 0xaf96124a, 0xb68d230b, 0x9da070c8, 0x84bb4189, + 0x03235d46, 0x1a386c07, 0x31153fc4, 0x280e0e85, + 0x674f9842, 0x7e54a903, 0x5579fac0, 0x4c62cb81, + 0x8138c51f, 0x9823f45e, 0xb30ea79d, 0xaa1596dc, + 0xe554001b, 0xfc4f315a, 0xd7626299, 0xce7953d8, + 0x49e14f17, 0x50fa7e56, 0x7bd72d95, 0x62cc1cd4, + 0x2d8d8a13, 0x3496bb52, 0x1fbbe891, 0x06a0d9d0, + 0x5e7ef3ec, 0x4765c2ad, 0x6c48916e, 0x7553a02f, + 0x3a1236e8, 0x230907a9, 0x0824546a, 0x113f652b, + 0x96a779e4, 0x8fbc48a5, 0xa4911b66, 0xbd8a2a27, + 0xf2cbbce0, 0xebd08da1, 0xc0fdde62, 0xd9e6ef23, + 0x14bce1bd, 0x0da7d0fc, 0x268a833f, 0x3f91b27e, + 0x70d024b9, 0x69cb15f8, 0x42e6463b, 0x5bfd777a, + 0xdc656bb5, 0xc57e5af4, 0xee530937, 0xf7483876, + 0xb809aeb1, 0xa1129ff0, 0x8a3fcc33, 0x9324fd72, + 0x00000000, 0x01c26a37, 0x0384d46e, 0x0246be59, + 0x0709a8dc, 0x06cbc2eb, 0x048d7cb2, 0x054f1685, + 0x0e1351b8, 0x0fd13b8f, 0x0d9785d6, 0x0c55efe1, + 0x091af964, 0x08d89353, 0x0a9e2d0a, 0x0b5c473d, + 0x1c26a370, 0x1de4c947, 0x1fa2771e, 0x1e601d29, + 0x1b2f0bac, 0x1aed619b, 0x18abdfc2, 0x1969b5f5, + 0x1235f2c8, 0x13f798ff, 0x11b126a6, 0x10734c91, + 0x153c5a14, 0x14fe3023, 0x16b88e7a, 0x177ae44d, + 0x384d46e0, 0x398f2cd7, 0x3bc9928e, 0x3a0bf8b9, + 0x3f44ee3c, 0x3e86840b, 0x3cc03a52, 0x3d025065, + 0x365e1758, 0x379c7d6f, 0x35dac336, 0x3418a901, + 0x3157bf84, 0x3095d5b3, 0x32d36bea, 0x331101dd, + 0x246be590, 0x25a98fa7, 0x27ef31fe, 0x262d5bc9, + 0x23624d4c, 0x22a0277b, 0x20e69922, 0x2124f315, + 0x2a78b428, 0x2bbade1f, 0x29fc6046, 0x283e0a71, + 0x2d711cf4, 0x2cb376c3, 0x2ef5c89a, 0x2f37a2ad, + 0x709a8dc0, 0x7158e7f7, 0x731e59ae, 0x72dc3399, + 0x7793251c, 0x76514f2b, 0x7417f172, 0x75d59b45, + 0x7e89dc78, 0x7f4bb64f, 0x7d0d0816, 0x7ccf6221, + 0x798074a4, 0x78421e93, 0x7a04a0ca, 0x7bc6cafd, + 0x6cbc2eb0, 0x6d7e4487, 0x6f38fade, 0x6efa90e9, + 0x6bb5866c, 0x6a77ec5b, 0x68315202, 0x69f33835, + 0x62af7f08, 0x636d153f, 0x612bab66, 0x60e9c151, + 0x65a6d7d4, 0x6464bde3, 0x662203ba, 0x67e0698d, + 0x48d7cb20, 0x4915a117, 0x4b531f4e, 0x4a917579, + 0x4fde63fc, 0x4e1c09cb, 0x4c5ab792, 0x4d98dda5, + 0x46c49a98, 0x4706f0af, 0x45404ef6, 0x448224c1, + 0x41cd3244, 0x400f5873, 0x4249e62a, 0x438b8c1d, + 0x54f16850, 0x55330267, 0x5775bc3e, 0x56b7d609, + 0x53f8c08c, 0x523aaabb, 0x507c14e2, 0x51be7ed5, + 0x5ae239e8, 0x5b2053df, 0x5966ed86, 0x58a487b1, + 0x5deb9134, 0x5c29fb03, 0x5e6f455a, 0x5fad2f6d, + 0xe1351b80, 0xe0f771b7, 0xe2b1cfee, 0xe373a5d9, + 0xe63cb35c, 0xe7fed96b, 0xe5b86732, 0xe47a0d05, + 0xef264a38, 0xeee4200f, 0xeca29e56, 0xed60f461, + 0xe82fe2e4, 0xe9ed88d3, 0xebab368a, 0xea695cbd, + 0xfd13b8f0, 0xfcd1d2c7, 0xfe976c9e, 0xff5506a9, + 0xfa1a102c, 0xfbd87a1b, 0xf99ec442, 0xf85cae75, + 0xf300e948, 0xf2c2837f, 0xf0843d26, 0xf1465711, + 0xf4094194, 0xf5cb2ba3, 0xf78d95fa, 0xf64fffcd, + 0xd9785d60, 0xd8ba3757, 0xdafc890e, 0xdb3ee339, + 0xde71f5bc, 0xdfb39f8b, 0xddf521d2, 0xdc374be5, + 0xd76b0cd8, 0xd6a966ef, 0xd4efd8b6, 0xd52db281, + 0xd062a404, 0xd1a0ce33, 0xd3e6706a, 0xd2241a5d, + 0xc55efe10, 0xc49c9427, 0xc6da2a7e, 0xc7184049, + 0xc25756cc, 0xc3953cfb, 0xc1d382a2, 0xc011e895, + 0xcb4dafa8, 0xca8fc59f, 0xc8c97bc6, 0xc90b11f1, + 0xcc440774, 0xcd866d43, 0xcfc0d31a, 0xce02b92d, + 0x91af9640, 0x906dfc77, 0x922b422e, 0x93e92819, + 0x96a63e9c, 0x976454ab, 0x9522eaf2, 0x94e080c5, + 0x9fbcc7f8, 0x9e7eadcf, 0x9c381396, 0x9dfa79a1, + 0x98b56f24, 0x99770513, 0x9b31bb4a, 0x9af3d17d, + 0x8d893530, 0x8c4b5f07, 0x8e0de15e, 0x8fcf8b69, + 0x8a809dec, 0x8b42f7db, 0x89044982, 0x88c623b5, + 0x839a6488, 0x82580ebf, 0x801eb0e6, 0x81dcdad1, + 0x8493cc54, 0x8551a663, 0x8717183a, 0x86d5720d, + 0xa9e2d0a0, 0xa820ba97, 0xaa6604ce, 0xaba46ef9, + 0xaeeb787c, 0xaf29124b, 0xad6fac12, 0xacadc625, + 0xa7f18118, 0xa633eb2f, 0xa4755576, 0xa5b73f41, + 0xa0f829c4, 0xa13a43f3, 0xa37cfdaa, 0xa2be979d, + 0xb5c473d0, 0xb40619e7, 0xb640a7be, 0xb782cd89, + 0xb2cddb0c, 0xb30fb13b, 0xb1490f62, 0xb08b6555, + 0xbbd72268, 0xba15485f, 0xb853f606, 0xb9919c31, + 0xbcde8ab4, 0xbd1ce083, 0xbf5a5eda, 0xbe9834ed, + 0x00000000, 0xb8bc6765, 0xaa09c88b, 0x12b5afee, + 0x8f629757, 0x37def032, 0x256b5fdc, 0x9dd738b9, + 0xc5b428ef, 0x7d084f8a, 0x6fbde064, 0xd7018701, + 0x4ad6bfb8, 0xf26ad8dd, 0xe0df7733, 0x58631056, + 0x5019579f, 0xe8a530fa, 0xfa109f14, 0x42acf871, + 0xdf7bc0c8, 0x67c7a7ad, 0x75720843, 0xcdce6f26, + 0x95ad7f70, 0x2d111815, 0x3fa4b7fb, 0x8718d09e, + 0x1acfe827, 0xa2738f42, 0xb0c620ac, 0x087a47c9, + 0xa032af3e, 0x188ec85b, 0x0a3b67b5, 0xb28700d0, + 0x2f503869, 0x97ec5f0c, 0x8559f0e2, 0x3de59787, + 0x658687d1, 0xdd3ae0b4, 0xcf8f4f5a, 0x7733283f, + 0xeae41086, 0x525877e3, 0x40edd80d, 0xf851bf68, + 0xf02bf8a1, 0x48979fc4, 0x5a22302a, 0xe29e574f, + 0x7f496ff6, 0xc7f50893, 0xd540a77d, 0x6dfcc018, + 0x359fd04e, 0x8d23b72b, 0x9f9618c5, 0x272a7fa0, + 0xbafd4719, 0x0241207c, 0x10f48f92, 0xa848e8f7, + 0x9b14583d, 0x23a83f58, 0x311d90b6, 0x89a1f7d3, + 0x1476cf6a, 0xaccaa80f, 0xbe7f07e1, 0x06c36084, + 0x5ea070d2, 0xe61c17b7, 0xf4a9b859, 0x4c15df3c, + 0xd1c2e785, 0x697e80e0, 0x7bcb2f0e, 0xc377486b, + 0xcb0d0fa2, 0x73b168c7, 0x6104c729, 0xd9b8a04c, + 0x446f98f5, 0xfcd3ff90, 0xee66507e, 0x56da371b, + 0x0eb9274d, 0xb6054028, 0xa4b0efc6, 0x1c0c88a3, + 0x81dbb01a, 0x3967d77f, 0x2bd27891, 0x936e1ff4, + 0x3b26f703, 0x839a9066, 0x912f3f88, 0x299358ed, + 0xb4446054, 0x0cf80731, 0x1e4da8df, 0xa6f1cfba, + 0xfe92dfec, 0x462eb889, 0x549b1767, 0xec277002, + 0x71f048bb, 0xc94c2fde, 0xdbf98030, 0x6345e755, + 0x6b3fa09c, 0xd383c7f9, 0xc1366817, 0x798a0f72, + 0xe45d37cb, 0x5ce150ae, 0x4e54ff40, 0xf6e89825, + 0xae8b8873, 0x1637ef16, 0x048240f8, 0xbc3e279d, + 0x21e91f24, 0x99557841, 0x8be0d7af, 0x335cb0ca, + 0xed59b63b, 0x55e5d15e, 0x47507eb0, 0xffec19d5, + 0x623b216c, 0xda874609, 0xc832e9e7, 0x708e8e82, + 0x28ed9ed4, 0x9051f9b1, 0x82e4565f, 0x3a58313a, + 0xa78f0983, 0x1f336ee6, 0x0d86c108, 0xb53aa66d, + 0xbd40e1a4, 0x05fc86c1, 0x1749292f, 0xaff54e4a, + 0x322276f3, 0x8a9e1196, 0x982bbe78, 0x2097d91d, + 0x78f4c94b, 0xc048ae2e, 0xd2fd01c0, 0x6a4166a5, + 0xf7965e1c, 0x4f2a3979, 0x5d9f9697, 0xe523f1f2, + 0x4d6b1905, 0xf5d77e60, 0xe762d18e, 0x5fdeb6eb, + 0xc2098e52, 0x7ab5e937, 0x680046d9, 0xd0bc21bc, + 0x88df31ea, 0x3063568f, 0x22d6f961, 0x9a6a9e04, + 0x07bda6bd, 0xbf01c1d8, 0xadb46e36, 0x15080953, + 0x1d724e9a, 0xa5ce29ff, 0xb77b8611, 0x0fc7e174, + 0x9210d9cd, 0x2aacbea8, 0x38191146, 0x80a57623, + 0xd8c66675, 0x607a0110, 0x72cfaefe, 0xca73c99b, + 0x57a4f122, 0xef189647, 0xfdad39a9, 0x45115ecc, + 0x764dee06, 0xcef18963, 0xdc44268d, 0x64f841e8, + 0xf92f7951, 0x41931e34, 0x5326b1da, 0xeb9ad6bf, + 0xb3f9c6e9, 0x0b45a18c, 0x19f00e62, 0xa14c6907, + 0x3c9b51be, 0x842736db, 0x96929935, 0x2e2efe50, + 0x2654b999, 0x9ee8defc, 0x8c5d7112, 0x34e11677, + 0xa9362ece, 0x118a49ab, 0x033fe645, 0xbb838120, + 0xe3e09176, 0x5b5cf613, 0x49e959fd, 0xf1553e98, + 0x6c820621, 0xd43e6144, 0xc68bceaa, 0x7e37a9cf, + 0xd67f4138, 0x6ec3265d, 0x7c7689b3, 0xc4caeed6, + 0x591dd66f, 0xe1a1b10a, 0xf3141ee4, 0x4ba87981, + 0x13cb69d7, 0xab770eb2, 0xb9c2a15c, 0x017ec639, + 0x9ca9fe80, 0x241599e5, 0x36a0360b, 0x8e1c516e, + 0x866616a7, 0x3eda71c2, 0x2c6fde2c, 0x94d3b949, + 0x090481f0, 0xb1b8e695, 0xa30d497b, 0x1bb12e1e, + 0x43d23e48, 0xfb6e592d, 0xe9dbf6c3, 0x516791a6, + 0xccb0a91f, 0x740cce7a, 0x66b96194, 0xde0506f1 +}; + +const uint32_t crc_table_cksum[256] PROGMEM = { + 0x00000000, 0xb71dc104, 0x6e3b8209, 0xd926430d, + 0xdc760413, 0x6b6bc517, 0xb24d861a, 0x0550471e, + 0xb8ed0826, 0x0ff0c922, 0xd6d68a2f, 0x61cb4b2b, + 0x649b0c35, 0xd386cd31, 0x0aa08e3c, 0xbdbd4f38, + 0x70db114c, 0xc7c6d048, 0x1ee09345, 0xa9fd5241, + 0xacad155f, 0x1bb0d45b, 0xc2969756, 0x758b5652, + 0xc836196a, 0x7f2bd86e, 0xa60d9b63, 0x11105a67, + 0x14401d79, 0xa35ddc7d, 0x7a7b9f70, 0xcd665e74, + 0xe0b62398, 0x57abe29c, 0x8e8da191, 0x39906095, + 0x3cc0278b, 0x8bdde68f, 0x52fba582, 0xe5e66486, + 0x585b2bbe, 0xef46eaba, 0x3660a9b7, 0x817d68b3, + 0x842d2fad, 0x3330eea9, 0xea16ada4, 0x5d0b6ca0, + 0x906d32d4, 0x2770f3d0, 0xfe56b0dd, 0x494b71d9, + 0x4c1b36c7, 0xfb06f7c3, 0x2220b4ce, 0x953d75ca, + 0x28803af2, 0x9f9dfbf6, 0x46bbb8fb, 0xf1a679ff, + 0xf4f63ee1, 0x43ebffe5, 0x9acdbce8, 0x2dd07dec, + 0x77708634, 0xc06d4730, 0x194b043d, 0xae56c539, + 0xab068227, 0x1c1b4323, 0xc53d002e, 0x7220c12a, + 0xcf9d8e12, 0x78804f16, 0xa1a60c1b, 0x16bbcd1f, + 0x13eb8a01, 0xa4f64b05, 0x7dd00808, 0xcacdc90c, + 0x07ab9778, 0xb0b6567c, 0x69901571, 0xde8dd475, + 0xdbdd936b, 0x6cc0526f, 0xb5e61162, 0x02fbd066, + 0xbf469f5e, 0x085b5e5a, 0xd17d1d57, 0x6660dc53, + 0x63309b4d, 0xd42d5a49, 0x0d0b1944, 0xba16d840, + 0x97c6a5ac, 0x20db64a8, 0xf9fd27a5, 0x4ee0e6a1, + 0x4bb0a1bf, 0xfcad60bb, 0x258b23b6, 0x9296e2b2, + 0x2f2bad8a, 0x98366c8e, 0x41102f83, 0xf60dee87, + 0xf35da999, 0x4440689d, 0x9d662b90, 0x2a7bea94, + 0xe71db4e0, 0x500075e4, 0x892636e9, 0x3e3bf7ed, + 0x3b6bb0f3, 0x8c7671f7, 0x555032fa, 0xe24df3fe, + 0x5ff0bcc6, 0xe8ed7dc2, 0x31cb3ecf, 0x86d6ffcb, + 0x8386b8d5, 0x349b79d1, 0xedbd3adc, 0x5aa0fbd8, + 0xeee00c69, 0x59fdcd6d, 0x80db8e60, 0x37c64f64, + 0x3296087a, 0x858bc97e, 0x5cad8a73, 0xebb04b77, + 0x560d044f, 0xe110c54b, 0x38368646, 0x8f2b4742, + 0x8a7b005c, 0x3d66c158, 0xe4408255, 0x535d4351, + 0x9e3b1d25, 0x2926dc21, 0xf0009f2c, 0x471d5e28, + 0x424d1936, 0xf550d832, 0x2c769b3f, 0x9b6b5a3b, + 0x26d61503, 0x91cbd407, 0x48ed970a, 0xfff0560e, + 0xfaa01110, 0x4dbdd014, 0x949b9319, 0x2386521d, + 0x0e562ff1, 0xb94beef5, 0x606dadf8, 0xd7706cfc, + 0xd2202be2, 0x653deae6, 0xbc1ba9eb, 0x0b0668ef, + 0xb6bb27d7, 0x01a6e6d3, 0xd880a5de, 0x6f9d64da, + 0x6acd23c4, 0xddd0e2c0, 0x04f6a1cd, 0xb3eb60c9, + 0x7e8d3ebd, 0xc990ffb9, 0x10b6bcb4, 0xa7ab7db0, + 0xa2fb3aae, 0x15e6fbaa, 0xccc0b8a7, 0x7bdd79a3, + 0xc660369b, 0x717df79f, 0xa85bb492, 0x1f467596, + 0x1a163288, 0xad0bf38c, 0x742db081, 0xc3307185, + 0x99908a5d, 0x2e8d4b59, 0xf7ab0854, 0x40b6c950, + 0x45e68e4e, 0xf2fb4f4a, 0x2bdd0c47, 0x9cc0cd43, + 0x217d827b, 0x9660437f, 0x4f460072, 0xf85bc176, + 0xfd0b8668, 0x4a16476c, 0x93300461, 0x242dc565, + 0xe94b9b11, 0x5e565a15, 0x87701918, 0x306dd81c, + 0x353d9f02, 0x82205e06, 0x5b061d0b, 0xec1bdc0f, + 0x51a69337, 0xe6bb5233, 0x3f9d113e, 0x8880d03a, + 0x8dd09724, 0x3acd5620, 0xe3eb152d, 0x54f6d429, + 0x7926a9c5, 0xce3b68c1, 0x171d2bcc, 0xa000eac8, + 0xa550add6, 0x124d6cd2, 0xcb6b2fdf, 0x7c76eedb, + 0xc1cba1e3, 0x76d660e7, 0xaff023ea, 0x18ede2ee, + 0x1dbda5f0, 0xaaa064f4, 0x738627f9, 0xc49be6fd, + 0x09fdb889, 0xbee0798d, 0x67c63a80, 0xd0dbfb84, + 0xd58bbc9a, 0x62967d9e, 0xbbb03e93, 0x0cadff97, + 0xb110b0af, 0x060d71ab, 0xdf2b32a6, 0x6836f3a2, + 0x6d66b4bc, 0xda7b75b8, 0x035d36b5, 0xb440f7b1 +}; + +const uint32_t crc_table_cksum_big[1024] PROGMEM = { + 0x00000000, 0xb71dc104, 0x6e3b8209, 0xd926430d, + 0xdc760413, 0x6b6bc517, 0xb24d861a, 0x0550471e, + 0xb8ed0826, 0x0ff0c922, 0xd6d68a2f, 0x61cb4b2b, + 0x649b0c35, 0xd386cd31, 0x0aa08e3c, 0xbdbd4f38, + 0x70db114c, 0xc7c6d048, 0x1ee09345, 0xa9fd5241, + 0xacad155f, 0x1bb0d45b, 0xc2969756, 0x758b5652, + 0xc836196a, 0x7f2bd86e, 0xa60d9b63, 0x11105a67, + 0x14401d79, 0xa35ddc7d, 0x7a7b9f70, 0xcd665e74, + 0xe0b62398, 0x57abe29c, 0x8e8da191, 0x39906095, + 0x3cc0278b, 0x8bdde68f, 0x52fba582, 0xe5e66486, + 0x585b2bbe, 0xef46eaba, 0x3660a9b7, 0x817d68b3, + 0x842d2fad, 0x3330eea9, 0xea16ada4, 0x5d0b6ca0, + 0x906d32d4, 0x2770f3d0, 0xfe56b0dd, 0x494b71d9, + 0x4c1b36c7, 0xfb06f7c3, 0x2220b4ce, 0x953d75ca, + 0x28803af2, 0x9f9dfbf6, 0x46bbb8fb, 0xf1a679ff, + 0xf4f63ee1, 0x43ebffe5, 0x9acdbce8, 0x2dd07dec, + 0x77708634, 0xc06d4730, 0x194b043d, 0xae56c539, + 0xab068227, 0x1c1b4323, 0xc53d002e, 0x7220c12a, + 0xcf9d8e12, 0x78804f16, 0xa1a60c1b, 0x16bbcd1f, + 0x13eb8a01, 0xa4f64b05, 0x7dd00808, 0xcacdc90c, + 0x07ab9778, 0xb0b6567c, 0x69901571, 0xde8dd475, + 0xdbdd936b, 0x6cc0526f, 0xb5e61162, 0x02fbd066, + 0xbf469f5e, 0x085b5e5a, 0xd17d1d57, 0x6660dc53, + 0x63309b4d, 0xd42d5a49, 0x0d0b1944, 0xba16d840, + 0x97c6a5ac, 0x20db64a8, 0xf9fd27a5, 0x4ee0e6a1, + 0x4bb0a1bf, 0xfcad60bb, 0x258b23b6, 0x9296e2b2, + 0x2f2bad8a, 0x98366c8e, 0x41102f83, 0xf60dee87, + 0xf35da999, 0x4440689d, 0x9d662b90, 0x2a7bea94, + 0xe71db4e0, 0x500075e4, 0x892636e9, 0x3e3bf7ed, + 0x3b6bb0f3, 0x8c7671f7, 0x555032fa, 0xe24df3fe, + 0x5ff0bcc6, 0xe8ed7dc2, 0x31cb3ecf, 0x86d6ffcb, + 0x8386b8d5, 0x349b79d1, 0xedbd3adc, 0x5aa0fbd8, + 0xeee00c69, 0x59fdcd6d, 0x80db8e60, 0x37c64f64, + 0x3296087a, 0x858bc97e, 0x5cad8a73, 0xebb04b77, + 0x560d044f, 0xe110c54b, 0x38368646, 0x8f2b4742, + 0x8a7b005c, 0x3d66c158, 0xe4408255, 0x535d4351, + 0x9e3b1d25, 0x2926dc21, 0xf0009f2c, 0x471d5e28, + 0x424d1936, 0xf550d832, 0x2c769b3f, 0x9b6b5a3b, + 0x26d61503, 0x91cbd407, 0x48ed970a, 0xfff0560e, + 0xfaa01110, 0x4dbdd014, 0x949b9319, 0x2386521d, + 0x0e562ff1, 0xb94beef5, 0x606dadf8, 0xd7706cfc, + 0xd2202be2, 0x653deae6, 0xbc1ba9eb, 0x0b0668ef, + 0xb6bb27d7, 0x01a6e6d3, 0xd880a5de, 0x6f9d64da, + 0x6acd23c4, 0xddd0e2c0, 0x04f6a1cd, 0xb3eb60c9, + 0x7e8d3ebd, 0xc990ffb9, 0x10b6bcb4, 0xa7ab7db0, + 0xa2fb3aae, 0x15e6fbaa, 0xccc0b8a7, 0x7bdd79a3, + 0xc660369b, 0x717df79f, 0xa85bb492, 0x1f467596, + 0x1a163288, 0xad0bf38c, 0x742db081, 0xc3307185, + 0x99908a5d, 0x2e8d4b59, 0xf7ab0854, 0x40b6c950, + 0x45e68e4e, 0xf2fb4f4a, 0x2bdd0c47, 0x9cc0cd43, + 0x217d827b, 0x9660437f, 0x4f460072, 0xf85bc176, + 0xfd0b8668, 0x4a16476c, 0x93300461, 0x242dc565, + 0xe94b9b11, 0x5e565a15, 0x87701918, 0x306dd81c, + 0x353d9f02, 0x82205e06, 0x5b061d0b, 0xec1bdc0f, + 0x51a69337, 0xe6bb5233, 0x3f9d113e, 0x8880d03a, + 0x8dd09724, 0x3acd5620, 0xe3eb152d, 0x54f6d429, + 0x7926a9c5, 0xce3b68c1, 0x171d2bcc, 0xa000eac8, + 0xa550add6, 0x124d6cd2, 0xcb6b2fdf, 0x7c76eedb, + 0xc1cba1e3, 0x76d660e7, 0xaff023ea, 0x18ede2ee, + 0x1dbda5f0, 0xaaa064f4, 0x738627f9, 0xc49be6fd, + 0x09fdb889, 0xbee0798d, 0x67c63a80, 0xd0dbfb84, + 0xd58bbc9a, 0x62967d9e, 0xbbb03e93, 0x0cadff97, + 0xb110b0af, 0x060d71ab, 0xdf2b32a6, 0x6836f3a2, + 0x6d66b4bc, 0xda7b75b8, 0x035d36b5, 0xb440f7b1, + 0x00000000, 0xdcc119d2, 0x0f9ef2a0, 0xd35feb72, + 0xa9212445, 0x75e03d97, 0xa6bfd6e5, 0x7a7ecf37, + 0x5243488a, 0x8e825158, 0x5dddba2a, 0x811ca3f8, + 0xfb626ccf, 0x27a3751d, 0xf4fc9e6f, 0x283d87bd, + 0x139b5110, 0xcf5a48c2, 0x1c05a3b0, 0xc0c4ba62, + 0xbaba7555, 0x667b6c87, 0xb52487f5, 0x69e59e27, + 0x41d8199a, 0x9d190048, 0x4e46eb3a, 0x9287f2e8, + 0xe8f93ddf, 0x3438240d, 0xe767cf7f, 0x3ba6d6ad, + 0x2636a320, 0xfaf7baf2, 0x29a85180, 0xf5694852, + 0x8f178765, 0x53d69eb7, 0x808975c5, 0x5c486c17, + 0x7475ebaa, 0xa8b4f278, 0x7beb190a, 0xa72a00d8, + 0xdd54cfef, 0x0195d63d, 0xd2ca3d4f, 0x0e0b249d, + 0x35adf230, 0xe96cebe2, 0x3a330090, 0xe6f21942, + 0x9c8cd675, 0x404dcfa7, 0x931224d5, 0x4fd33d07, + 0x67eebaba, 0xbb2fa368, 0x6870481a, 0xb4b151c8, + 0xcecf9eff, 0x120e872d, 0xc1516c5f, 0x1d90758d, + 0x4c6c4641, 0x90ad5f93, 0x43f2b4e1, 0x9f33ad33, + 0xe54d6204, 0x398c7bd6, 0xead390a4, 0x36128976, + 0x1e2f0ecb, 0xc2ee1719, 0x11b1fc6b, 0xcd70e5b9, + 0xb70e2a8e, 0x6bcf335c, 0xb890d82e, 0x6451c1fc, + 0x5ff71751, 0x83360e83, 0x5069e5f1, 0x8ca8fc23, + 0xf6d63314, 0x2a172ac6, 0xf948c1b4, 0x2589d866, + 0x0db45fdb, 0xd1754609, 0x022aad7b, 0xdeebb4a9, + 0xa4957b9e, 0x7854624c, 0xab0b893e, 0x77ca90ec, + 0x6a5ae561, 0xb69bfcb3, 0x65c417c1, 0xb9050e13, + 0xc37bc124, 0x1fbad8f6, 0xcce53384, 0x10242a56, + 0x3819adeb, 0xe4d8b439, 0x37875f4b, 0xeb464699, + 0x913889ae, 0x4df9907c, 0x9ea67b0e, 0x426762dc, + 0x79c1b471, 0xa500ada3, 0x765f46d1, 0xaa9e5f03, + 0xd0e09034, 0x0c2189e6, 0xdf7e6294, 0x03bf7b46, + 0x2b82fcfb, 0xf743e529, 0x241c0e5b, 0xf8dd1789, + 0x82a3d8be, 0x5e62c16c, 0x8d3d2a1e, 0x51fc33cc, + 0x98d88c82, 0x44199550, 0x97467e22, 0x4b8767f0, + 0x31f9a8c7, 0xed38b115, 0x3e675a67, 0xe2a643b5, + 0xca9bc408, 0x165addda, 0xc50536a8, 0x19c42f7a, + 0x63bae04d, 0xbf7bf99f, 0x6c2412ed, 0xb0e50b3f, + 0x8b43dd92, 0x5782c440, 0x84dd2f32, 0x581c36e0, + 0x2262f9d7, 0xfea3e005, 0x2dfc0b77, 0xf13d12a5, + 0xd9009518, 0x05c18cca, 0xd69e67b8, 0x0a5f7e6a, + 0x7021b15d, 0xace0a88f, 0x7fbf43fd, 0xa37e5a2f, + 0xbeee2fa2, 0x622f3670, 0xb170dd02, 0x6db1c4d0, + 0x17cf0be7, 0xcb0e1235, 0x1851f947, 0xc490e095, + 0xecad6728, 0x306c7efa, 0xe3339588, 0x3ff28c5a, + 0x458c436d, 0x994d5abf, 0x4a12b1cd, 0x96d3a81f, + 0xad757eb2, 0x71b46760, 0xa2eb8c12, 0x7e2a95c0, + 0x04545af7, 0xd8954325, 0x0bcaa857, 0xd70bb185, + 0xff363638, 0x23f72fea, 0xf0a8c498, 0x2c69dd4a, + 0x5617127d, 0x8ad60baf, 0x5989e0dd, 0x8548f90f, + 0xd4b4cac3, 0x0875d311, 0xdb2a3863, 0x07eb21b1, + 0x7d95ee86, 0xa154f754, 0x720b1c26, 0xaeca05f4, + 0x86f78249, 0x5a369b9b, 0x896970e9, 0x55a8693b, + 0x2fd6a60c, 0xf317bfde, 0x204854ac, 0xfc894d7e, + 0xc72f9bd3, 0x1bee8201, 0xc8b16973, 0x147070a1, + 0x6e0ebf96, 0xb2cfa644, 0x61904d36, 0xbd5154e4, + 0x956cd359, 0x49adca8b, 0x9af221f9, 0x4633382b, + 0x3c4df71c, 0xe08ceece, 0x33d305bc, 0xef121c6e, + 0xf28269e3, 0x2e437031, 0xfd1c9b43, 0x21dd8291, + 0x5ba34da6, 0x87625474, 0x543dbf06, 0x88fca6d4, + 0xa0c12169, 0x7c0038bb, 0xaf5fd3c9, 0x739eca1b, + 0x09e0052c, 0xd5211cfe, 0x067ef78c, 0xdabfee5e, + 0xe11938f3, 0x3dd82121, 0xee87ca53, 0x3246d381, + 0x48381cb6, 0x94f90564, 0x47a6ee16, 0x9b67f7c4, + 0xb35a7079, 0x6f9b69ab, 0xbcc482d9, 0x60059b0b, + 0x1a7b543c, 0xc6ba4dee, 0x15e5a69c, 0xc924bf4e, + 0x00000000, 0x87acd801, 0x0e59b103, 0x89f56902, + 0x1cb26207, 0x9b1eba06, 0x12ebd304, 0x95470b05, + 0x3864c50e, 0xbfc81d0f, 0x363d740d, 0xb191ac0c, + 0x24d6a709, 0xa37a7f08, 0x2a8f160a, 0xad23ce0b, + 0x70c88a1d, 0xf764521c, 0x7e913b1e, 0xf93de31f, + 0x6c7ae81a, 0xebd6301b, 0x62235919, 0xe58f8118, + 0x48ac4f13, 0xcf009712, 0x46f5fe10, 0xc1592611, + 0x541e2d14, 0xd3b2f515, 0x5a479c17, 0xddeb4416, + 0xe090153b, 0x673ccd3a, 0xeec9a438, 0x69657c39, + 0xfc22773c, 0x7b8eaf3d, 0xf27bc63f, 0x75d71e3e, + 0xd8f4d035, 0x5f580834, 0xd6ad6136, 0x5101b937, + 0xc446b232, 0x43ea6a33, 0xca1f0331, 0x4db3db30, + 0x90589f26, 0x17f44727, 0x9e012e25, 0x19adf624, + 0x8ceafd21, 0x0b462520, 0x82b34c22, 0x051f9423, + 0xa83c5a28, 0x2f908229, 0xa665eb2b, 0x21c9332a, + 0xb48e382f, 0x3322e02e, 0xbad7892c, 0x3d7b512d, + 0xc0212b76, 0x478df377, 0xce789a75, 0x49d44274, + 0xdc934971, 0x5b3f9170, 0xd2caf872, 0x55662073, + 0xf845ee78, 0x7fe93679, 0xf61c5f7b, 0x71b0877a, + 0xe4f78c7f, 0x635b547e, 0xeaae3d7c, 0x6d02e57d, + 0xb0e9a16b, 0x3745796a, 0xbeb01068, 0x391cc869, + 0xac5bc36c, 0x2bf71b6d, 0xa202726f, 0x25aeaa6e, + 0x888d6465, 0x0f21bc64, 0x86d4d566, 0x01780d67, + 0x943f0662, 0x1393de63, 0x9a66b761, 0x1dca6f60, + 0x20b13e4d, 0xa71de64c, 0x2ee88f4e, 0xa944574f, + 0x3c035c4a, 0xbbaf844b, 0x325aed49, 0xb5f63548, + 0x18d5fb43, 0x9f792342, 0x168c4a40, 0x91209241, + 0x04679944, 0x83cb4145, 0x0a3e2847, 0x8d92f046, + 0x5079b450, 0xd7d56c51, 0x5e200553, 0xd98cdd52, + 0x4ccbd657, 0xcb670e56, 0x42926754, 0xc53ebf55, + 0x681d715e, 0xefb1a95f, 0x6644c05d, 0xe1e8185c, + 0x74af1359, 0xf303cb58, 0x7af6a25a, 0xfd5a7a5b, + 0x804356ec, 0x07ef8eed, 0x8e1ae7ef, 0x09b63fee, + 0x9cf134eb, 0x1b5decea, 0x92a885e8, 0x15045de9, + 0xb82793e2, 0x3f8b4be3, 0xb67e22e1, 0x31d2fae0, + 0xa495f1e5, 0x233929e4, 0xaacc40e6, 0x2d6098e7, + 0xf08bdcf1, 0x772704f0, 0xfed26df2, 0x797eb5f3, + 0xec39bef6, 0x6b9566f7, 0xe2600ff5, 0x65ccd7f4, + 0xc8ef19ff, 0x4f43c1fe, 0xc6b6a8fc, 0x411a70fd, + 0xd45d7bf8, 0x53f1a3f9, 0xda04cafb, 0x5da812fa, + 0x60d343d7, 0xe77f9bd6, 0x6e8af2d4, 0xe9262ad5, + 0x7c6121d0, 0xfbcdf9d1, 0x723890d3, 0xf59448d2, + 0x58b786d9, 0xdf1b5ed8, 0x56ee37da, 0xd142efdb, + 0x4405e4de, 0xc3a93cdf, 0x4a5c55dd, 0xcdf08ddc, + 0x101bc9ca, 0x97b711cb, 0x1e4278c9, 0x99eea0c8, + 0x0ca9abcd, 0x8b0573cc, 0x02f01ace, 0x855cc2cf, + 0x287f0cc4, 0xafd3d4c5, 0x2626bdc7, 0xa18a65c6, + 0x34cd6ec3, 0xb361b6c2, 0x3a94dfc0, 0xbd3807c1, + 0x40627d9a, 0xc7cea59b, 0x4e3bcc99, 0xc9971498, + 0x5cd01f9d, 0xdb7cc79c, 0x5289ae9e, 0xd525769f, + 0x7806b894, 0xffaa6095, 0x765f0997, 0xf1f3d196, + 0x64b4da93, 0xe3180292, 0x6aed6b90, 0xed41b391, + 0x30aaf787, 0xb7062f86, 0x3ef34684, 0xb95f9e85, + 0x2c189580, 0xabb44d81, 0x22412483, 0xa5edfc82, + 0x08ce3289, 0x8f62ea88, 0x0697838a, 0x813b5b8b, + 0x147c508e, 0x93d0888f, 0x1a25e18d, 0x9d89398c, + 0xa0f268a1, 0x275eb0a0, 0xaeabd9a2, 0x290701a3, + 0xbc400aa6, 0x3becd2a7, 0xb219bba5, 0x35b563a4, + 0x9896adaf, 0x1f3a75ae, 0x96cf1cac, 0x1163c4ad, + 0x8424cfa8, 0x038817a9, 0x8a7d7eab, 0x0dd1a6aa, + 0xd03ae2bc, 0x57963abd, 0xde6353bf, 0x59cf8bbe, + 0xcc8880bb, 0x4b2458ba, 0xc2d131b8, 0x457de9b9, + 0xe85e27b2, 0x6ff2ffb3, 0xe60796b1, 0x61ab4eb0, + 0xf4ec45b5, 0x73409db4, 0xfab5f4b6, 0x7d192cb7, + 0x00000000, 0xb79a6ddc, 0xd9281abc, 0x6eb27760, + 0x054cf57c, 0xb2d698a0, 0xdc64efc0, 0x6bfe821c, + 0x0a98eaf9, 0xbd028725, 0xd3b0f045, 0x642a9d99, + 0x0fd41f85, 0xb84e7259, 0xd6fc0539, 0x616668e5, + 0xa32d14f7, 0x14b7792b, 0x7a050e4b, 0xcd9f6397, + 0xa661e18b, 0x11fb8c57, 0x7f49fb37, 0xc8d396eb, + 0xa9b5fe0e, 0x1e2f93d2, 0x709de4b2, 0xc707896e, + 0xacf90b72, 0x1b6366ae, 0x75d111ce, 0xc24b7c12, + 0xf146e9ea, 0x46dc8436, 0x286ef356, 0x9ff49e8a, + 0xf40a1c96, 0x4390714a, 0x2d22062a, 0x9ab86bf6, + 0xfbde0313, 0x4c446ecf, 0x22f619af, 0x956c7473, + 0xfe92f66f, 0x49089bb3, 0x27baecd3, 0x9020810f, + 0x526bfd1d, 0xe5f190c1, 0x8b43e7a1, 0x3cd98a7d, + 0x57270861, 0xe0bd65bd, 0x8e0f12dd, 0x39957f01, + 0x58f317e4, 0xef697a38, 0x81db0d58, 0x36416084, + 0x5dbfe298, 0xea258f44, 0x8497f824, 0x330d95f8, + 0x559013d1, 0xe20a7e0d, 0x8cb8096d, 0x3b2264b1, + 0x50dce6ad, 0xe7468b71, 0x89f4fc11, 0x3e6e91cd, + 0x5f08f928, 0xe89294f4, 0x8620e394, 0x31ba8e48, + 0x5a440c54, 0xedde6188, 0x836c16e8, 0x34f67b34, + 0xf6bd0726, 0x41276afa, 0x2f951d9a, 0x980f7046, + 0xf3f1f25a, 0x446b9f86, 0x2ad9e8e6, 0x9d43853a, + 0xfc25eddf, 0x4bbf8003, 0x250df763, 0x92979abf, + 0xf96918a3, 0x4ef3757f, 0x2041021f, 0x97db6fc3, + 0xa4d6fa3b, 0x134c97e7, 0x7dfee087, 0xca648d5b, + 0xa19a0f47, 0x1600629b, 0x78b215fb, 0xcf287827, + 0xae4e10c2, 0x19d47d1e, 0x77660a7e, 0xc0fc67a2, + 0xab02e5be, 0x1c988862, 0x722aff02, 0xc5b092de, + 0x07fbeecc, 0xb0618310, 0xded3f470, 0x694999ac, + 0x02b71bb0, 0xb52d766c, 0xdb9f010c, 0x6c056cd0, + 0x0d630435, 0xbaf969e9, 0xd44b1e89, 0x63d17355, + 0x082ff149, 0xbfb59c95, 0xd107ebf5, 0x669d8629, + 0x1d3de6a6, 0xaaa78b7a, 0xc415fc1a, 0x738f91c6, + 0x187113da, 0xafeb7e06, 0xc1590966, 0x76c364ba, + 0x17a50c5f, 0xa03f6183, 0xce8d16e3, 0x79177b3f, + 0x12e9f923, 0xa57394ff, 0xcbc1e39f, 0x7c5b8e43, + 0xbe10f251, 0x098a9f8d, 0x6738e8ed, 0xd0a28531, + 0xbb5c072d, 0x0cc66af1, 0x62741d91, 0xd5ee704d, + 0xb48818a8, 0x03127574, 0x6da00214, 0xda3a6fc8, + 0xb1c4edd4, 0x065e8008, 0x68ecf768, 0xdf769ab4, + 0xec7b0f4c, 0x5be16290, 0x355315f0, 0x82c9782c, + 0xe937fa30, 0x5ead97ec, 0x301fe08c, 0x87858d50, + 0xe6e3e5b5, 0x51798869, 0x3fcbff09, 0x885192d5, + 0xe3af10c9, 0x54357d15, 0x3a870a75, 0x8d1d67a9, + 0x4f561bbb, 0xf8cc7667, 0x967e0107, 0x21e46cdb, + 0x4a1aeec7, 0xfd80831b, 0x9332f47b, 0x24a899a7, + 0x45cef142, 0xf2549c9e, 0x9ce6ebfe, 0x2b7c8622, + 0x4082043e, 0xf71869e2, 0x99aa1e82, 0x2e30735e, + 0x48adf577, 0xff3798ab, 0x9185efcb, 0x261f8217, + 0x4de1000b, 0xfa7b6dd7, 0x94c91ab7, 0x2353776b, + 0x42351f8e, 0xf5af7252, 0x9b1d0532, 0x2c8768ee, + 0x4779eaf2, 0xf0e3872e, 0x9e51f04e, 0x29cb9d92, + 0xeb80e180, 0x5c1a8c5c, 0x32a8fb3c, 0x853296e0, + 0xeecc14fc, 0x59567920, 0x37e40e40, 0x807e639c, + 0xe1180b79, 0x568266a5, 0x383011c5, 0x8faa7c19, + 0xe454fe05, 0x53ce93d9, 0x3d7ce4b9, 0x8ae68965, + 0xb9eb1c9d, 0x0e717141, 0x60c30621, 0xd7596bfd, + 0xbca7e9e1, 0x0b3d843d, 0x658ff35d, 0xd2159e81, + 0xb373f664, 0x04e99bb8, 0x6a5becd8, 0xddc18104, + 0xb63f0318, 0x01a56ec4, 0x6f1719a4, 0xd88d7478, + 0x1ac6086a, 0xad5c65b6, 0xc3ee12d6, 0x74747f0a, + 0x1f8afd16, 0xa81090ca, 0xc6a2e7aa, 0x71388a76, + 0x105ee293, 0xa7c48f4f, 0xc976f82f, 0x7eec95f3, + 0x151217ef, 0xa2887a33, 0xcc3a0d53, 0x7ba0608f +}; + +#ifdef PROGMEM_MOCK_ACTIVE +// limit the effect of the progmem mock to this file +#undef PROGMEM +#undef PROGMEM_MOCK_ACTIVE +#endif +#endif diff --git a/lib/lib_div/FastCRC/src/FastCRChw.cpp b/lib/lib_div/FastCRC/src/FastCRChw.cpp new file mode 100644 index 000000000..ce61adda7 --- /dev/null +++ b/lib/lib_div/FastCRC/src/FastCRChw.cpp @@ -0,0 +1,567 @@ +/* FastCRC library code is placed under the MIT license + * Copyright (c) 2014 - 2021 Frank Bösing + * + * Permission is hereby granted, free of charge, to any person obtaining + * a copy of this software and associated documentation files (the + * "Software"), to deal in the Software without restriction, including + * without limitation the rights to use, copy, modify, merge, publish, + * distribute, sublicense, and/or sell copies of the Software, and to + * permit persons to whom the Software is furnished to do so, subject to + * the following conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS + * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +// +// HW-calculations are 32BIT +// +// Thanks to: +// - Catalogue of parametrised CRC algorithms, CRC RevEng +// http://reveng.sourceforge.net/crc-catalogue/ +// +// - Danjel McGougan (CRC-Table-Generator) +// + +#if defined(ARDUINO) +#include +#endif +#if defined(KINETISK) + +#include "mk20dx128.h" +#include "FastCRC.h" + +// =============================================== + +typedef struct { + union { + uint32_t CRC; //CRC Data register + struct { + uint16_t CRC16; + uint16_t CRC16_1; + }; + struct { + uint8_t CRC8; + uint8_t CRC8_1; + uint8_t CRC8_2; + uint8_t CRC8_3; + }; + }; + uint32_t GPOLY; //CRC Polynomial register + uint32_t CTRL; //CRC Control register +} CRC_T; + +static volatile CRC_T * const rCRC = (CRC_T *)0x40032000; + +#define CRC_CTRL_WAS 25 // Write CRC Data Register As Seed(1) / Data(0) +#define CRC_CTRL_TCRC 24 // Width of CRC protocol (0=16 BIT, 1=32 BIT) +#define CRC_CTRL_TOTR1 29 // TOTR[1] + +// ================= 7-BIT CRC =================== +/** Constructor + * Enables CRC-clock + */ +FastCRC7::FastCRC7(){ + SIM_SCGC6 |= SIM_SCGC6_CRC; +} + +/** CRC 7 + * MultiMediaCard interface + * @param data Pointer to Data + * @param datalen Length of Data + * @return CRC value + */ +uint8_t FastCRC7::crc7(const uint8_t *data, const size_t datalen) +{ + // poly=0x09 init=0x00 refin=false refout=false xorout=0x00 check=0x75 + return (generic(0x09, 0, CRC_FLAG_NOREFLECT, data, datalen)); +} + +/** Update + * Call for subsequent calculations with previous seed + * @param data Pointer to Data + * @param datalen Length of Data + * @return CRC value + */ +uint8_t FastCRC7::update(const uint8_t *data, const size_t datalen) +{ + + const uint8_t *src = data; + const uint8_t *target = src + datalen; + + while (((uintptr_t)src & 0x03) != 0 && (src < target)) { + rCRC->CRC8_3 = *src++; //Write 8 BIT + } + + while (src <= target-4) { + rCRC->CRC = *( uint32_t *)src; //Write 32 BIT + src += 4; + } + + while (src < target) { + rCRC->CRC8_3 = *src++; //Write 8 Bit + } + +//TODO: Check handling of CRC_CTRL_TOTR1 for other CRC7s +/* + if (rCRC->CTRL & (1<CRC8 >> 1; + else +*/ + return rCRC->CRC8_3 >> 1; +} + +/** generic function for all 7-Bit CRCs + * @param polynom Polynom + * @param seed Seed + * @param flags Flags + * @param data Pointer to Data + * @param datalen Length of Data + * @return CRC value + */ +uint8_t FastCRC7::generic(const uint8_t polynom, const uint8_t seed, const uint32_t flags, const uint8_t *data,const size_t datalen) +{ + + rCRC->CTRL = flags | (1<GPOLY = ((uint32_t)polynom)<<(24 + 1); // Set polynom + rCRC->CRC = ((uint32_t)seed<<(24 + 1)); // Write seed + rCRC->CTRL = flags | (1<CRC8_3 = *src++; //Write 8 BIT + } + + while (src <= target-4) { + rCRC->CRC = *( uint32_t *)src; //Write 32 BIT + src += 4; + } + + while (src < target) { + rCRC->CRC8_3 = *src++; //Write 8 Bit + } + + if (rCRC->CTRL & (1<CRC8; + else + return rCRC->CRC8_3; +} + +/** generic function for all 8-Bit CRCs + * @param polynom Polynom + * @param seed Seed + * @param flags Flags + * @param data Pointer to Data + * @param datalen Length of Data + * @return CRC value + */ +uint8_t FastCRC8::generic(const uint8_t polynom, const uint8_t seed, const uint32_t flags, const uint8_t *data,const size_t datalen) +{ + + rCRC->CTRL = flags | (1<GPOLY = ((uint32_t)polynom)<<24; // Set polynom + rCRC->CRC = ((uint32_t)seed<<24); // Write seed + rCRC->CTRL = flags | (1<CRC8_3 = *src++; //Write 8 BIT + } + + while (src <= target-4) { + rCRC->CRC = *( uint32_t *)src; //Write 32 BIT + src += 4; + } + + while (src < target) { + rCRC->CRC8_3 = *src++; //Write 8 Bit + } + + if (rCRC->CTRL & (1<CRC16; + else + return rCRC->CRC >> (32 - 14); +} + +/** generic function for all 14-Bit CRCs + * @param polynom Polynom + * @param seed Seed + * @param flags Flags + * @param data Pointer to Data + * @param datalen Length of Data + * @return CRC value + */ +uint16_t FastCRC14::generic(const uint16_t polynom, const uint16_t seed, const uint32_t flags, const uint8_t *data, const size_t datalen) +{ + + rCRC->CTRL = flags | (1<GPOLY = ((uint32_t)polynom) << (32 - 14); // set polynom + rCRC->CRC = ((uint32_t)seed << (32 - 14) ); // this is the seed + rCRC->CTRL = flags | (1<CRC8_3 = *src++; //Write 8 BIT + } + + while (src <= target-4) { + rCRC->CRC = *( uint32_t *)src; //Write 32 BIT + src += 4; + } + + while (src < target) { + rCRC->CRC8_3 = *src++; //Write 8 Bit + } + + if (rCRC->CTRL & (1<CRC16; + else + return rCRC->CRC16_1; +} + +/** generic function for all 16-Bit CRCs + * @param polynom Polynom + * @param seed Seed + * @param flags Flags + * @param data Pointer to Data + * @param datalen Length of Data + * @return CRC value + */ +uint16_t FastCRC16::generic(const uint16_t polynom, const uint16_t seed, const uint32_t flags, const uint8_t *data, const size_t datalen) +{ + + rCRC->CTRL = flags | (1<GPOLY = ((uint32_t)polynom)<<16; // set polynom + rCRC->CRC = ((uint32_t)seed<<16); // this is the seed + rCRC->CTRL = flags | (1<CRC8_3 = *src++; //Write 8 BIT + } + + while (src <= target-4) { + rCRC->CRC = *( uint32_t *)src; //Write 32 BIT + src += 4; + } + + while (src < target) { + rCRC->CRC8_3 = *src++; //Write 8 Bit + } + + return rCRC->CRC; +} + +/** generic function for all 32-Bit CRCs + * @param polynom Polynom + * @param seed Seed + * @param flags Flags + * @param data Pointer to Data + * @param datalen Length of Data + * @return CRC value + */ +uint32_t FastCRC32::generic(const uint32_t polynom, const uint32_t seed, const uint32_t flags, const uint8_t *data, const size_t datalen) +{ + + rCRC->CTRL = flags | (1<GPOLY = polynom; // Set polynom + rCRC->CRC = seed; // This is the seed + rCRC->CTRL = flags | (1< +#endif + +#if !defined(KINETISK) + +#if !defined(ARDUINO) +#define PROGMEM +#define pgm_read_byte(addr) (*(const unsigned char *)(addr)) +#define pgm_read_word(addr) ({ \ + typeof(addr) _addr = (addr); \ + *(const unsigned short *)(_addr); \ +}) +#define pgm_read_dword(addr) ({ \ + typeof(addr) _addr = (addr); \ + *(const unsigned long *)(_addr); \ +}) +#endif + + + +#include "FastCRC.h" +#include "FastCRC_tables.h" + + +static inline +uint32_t REV16( uint32_t value) +{ + return (value >> 8) | ((value & 0xff) << 8); +} + +static inline +uint32_t REV32( uint32_t value) +{ + value = (value >> 16) | ((value & 0xffff) << 16); + return ((value >> 8) & 0xff00ff) | ((value & 0xff00ff) << 8); +} + + + +// ================= 7-BIT CRC =================== + +/** Constructor + */ +FastCRC7::FastCRC7(){} + +/** SMBUS CRC + * aka CRC-8 + * @param data Pointer to Data + * @param datalen Length of Data + * @return CRC value + */ +uint8_t FastCRC7::crc7_upd(const uint8_t *data, size_t datalen) +{ + uint8_t crc = seed; + if (datalen) do { + crc = pgm_read_byte(&crc_table_crc7[crc ^ *data]); + data++; + } while (--datalen); + seed = crc; + return crc >> 1; +} + +uint8_t FastCRC7::crc7(const uint8_t *data, const size_t datalen) +{ + // poly=0x09 init=0x00 refin=false refout=false xorout=0x00 check=0x75 + seed = 0x00; + return crc7_upd(data, datalen); +} + +// ================= 8-BIT CRC =================== + +/** Constructor + */ +FastCRC8::FastCRC8(){} + +/** SMBUS CRC + * aka CRC-8 + * @param data Pointer to Data + * @param datalen Length of Data + * @return CRC value + */ +uint8_t FastCRC8::smbus_upd(const uint8_t *data, size_t datalen) +{ + uint8_t crc = seed; + if (datalen) do { + crc = pgm_read_byte(&crc_table_smbus[crc ^ *data]); + data++; + } while (--datalen); + seed = crc; + return crc; +} + +uint8_t FastCRC8::smbus(const uint8_t *data, const size_t datalen) +{ + // poly=0x07 init=0x00 refin=false refout=false xorout=0x00 check=0xf4 + seed = 0x00; + return smbus_upd(data, datalen); +} + +/** MAXIM 8-Bit CRC + * equivalent to _crc_ibutton_update() in crc16.h from avr_libc + * @param data Pointer to Data + * @param datalen Length of Data + * @return CRC value + */ +uint8_t FastCRC8::maxim_upd(const uint8_t *data, size_t datalen) +{ + uint8_t crc = seed; + if (datalen) do { + crc = pgm_read_byte(&crc_table_maxim[crc ^ *data]); + data++; + } while (--datalen); + seed = crc; + return crc; +} +uint8_t FastCRC8::maxim(const uint8_t *data, const size_t datalen) +{ + // poly=0x31 init=0x00 refin=true refout=true xorout=0x00 check=0xa1 + seed = 0x00; + return maxim_upd(data, datalen); +} + +// ================= 16-BIT CRC =================== +/** Constructor + */ +FastCRC16::FastCRC16(){} + +#define crc_n4(crc, data, table) crc ^= data; \ + crc = pgm_read_word(&table[(crc & 0xff) + 0x300]) ^ \ + pgm_read_word(&table[((crc >> 8) & 0xff) + 0x200]) ^ \ + pgm_read_word(&table[((data >> 16) & 0xff) + 0x100]) ^ \ + pgm_read_word(&table[data >> 24]); + +/** CCITT + * Alias "false CCITT" + * @param data Pointer to Data + * @param datalen Length of Data + * @return CRC value + */ +uint16_t FastCRC16::ccitt_upd(const uint8_t *data, size_t len) +{ + + uint16_t crc = seed; + while (((uintptr_t)data & 3) && len) { + crc = (crc >> 8) ^ pgm_read_word(&crc_table_ccitt[(crc & 0xff) ^ *data++]); + len--; + } + + while (len >= 16) { + len -= 16; + crc_n4(crc, ((uint32_t *)data)[0], crc_table_ccitt); + crc_n4(crc, ((uint32_t *)data)[1], crc_table_ccitt); + crc_n4(crc, ((uint32_t *)data)[2], crc_table_ccitt); + crc_n4(crc, ((uint32_t *)data)[3], crc_table_ccitt); + data += 16; + } + + while (len--) { + crc = (crc >> 8) ^ pgm_read_word(&crc_table_ccitt[(crc & 0xff) ^ *data++]); + } + + seed = crc; + crc = REV16(crc); + + return crc; +} +uint16_t FastCRC16::ccitt(const uint8_t *data,const size_t datalen) +{ + // poly=0x1021 init=0xffff refin=false refout=false xorout=0x0000 check=0x29b1 + seed = 0xffff; + return ccitt_upd(data, datalen); +} + +/** MCRF4XX + * equivalent to _crc_ccitt_update() in crc16.h from avr_libc + * @param data Pointer to Data + * @param datalen Length of Data + * @return CRC value + */ + +uint16_t FastCRC16::mcrf4xx_upd(const uint8_t *data, size_t len) +{ + + uint16_t crc = seed; + + while (((uintptr_t)data & 3) && len) { + crc = (crc >> 8) ^ pgm_read_word(&crc_table_mcrf4xx[(crc & 0xff) ^ *data++]); + len--; + } + + while (len >= 16) { + len -= 16; + crc_n4(crc, ((uint32_t *)data)[0], crc_table_mcrf4xx); + crc_n4(crc, ((uint32_t *)data)[1], crc_table_mcrf4xx); + crc_n4(crc, ((uint32_t *)data)[2], crc_table_mcrf4xx); + crc_n4(crc, ((uint32_t *)data)[3], crc_table_mcrf4xx); + data += 16; + } + + while (len--) { + crc = (crc >> 8) ^ pgm_read_word(&crc_table_mcrf4xx[(crc & 0xff) ^ *data++]); + } + + seed = crc; + return crc; +} + +uint16_t FastCRC16::mcrf4xx(const uint8_t *data,const size_t datalen) +{ + // poly=0x1021 init=0xffff refin=true refout=true xorout=0x0000 check=0x6f91 + seed = 0xffff; + return mcrf4xx_upd(data, datalen); +} + +/** MODBUS + * equivalent to _crc_16_update() in crc16.h from avr_libc + * @param data Pointer to Data + * @param datalen Length of Data + * @return CRC value + */ +uint16_t FastCRC16::modbus_upd(const uint8_t *data, size_t len) +{ + + uint16_t crc = seed; + + while (((uintptr_t)data & 3) && len) { + crc = (crc >> 8) ^ pgm_read_word(&crc_table_modbus[(crc & 0xff) ^ *data++]); + len--; + } + + while (len >= 16) { + len -= 16; + crc_n4(crc, ((uint32_t *)data)[0], crc_table_modbus); + crc_n4(crc, ((uint32_t *)data)[1], crc_table_modbus); + crc_n4(crc, ((uint32_t *)data)[2], crc_table_modbus); + crc_n4(crc, ((uint32_t *)data)[3], crc_table_modbus); + data += 16; + } + + while (len--) { + crc = (crc >> 8) ^ pgm_read_word(&crc_table_modbus[(crc & 0xff) ^ *data++]); + } + + seed = crc; + return crc; +} + +uint16_t FastCRC16::modbus(const uint8_t *data, const size_t datalen) +{ + // poly=0x8005 init=0xffff refin=true refout=true xorout=0x0000 check=0x4b37 + seed = 0xffff; + return modbus_upd(data, datalen); +} + +/** KERMIT + * Alias CRC-16/CCITT, CRC-16/CCITT-TRUE, CRC-CCITT + * @param data Pointer to Data + * @param datalen Length of Data + * @return CRC value + */ +uint16_t FastCRC16::kermit_upd(const uint8_t *data, size_t len) +{ + + uint16_t crc = seed; + + while (((uintptr_t)data & 3) && len) { + crc = (crc >> 8) ^ pgm_read_word(&crc_table_kermit[(crc & 0xff) ^ *data++]); + len--; + } + + while (len >= 16) { + len -= 16; + crc_n4(crc, ((uint32_t *)data)[0], crc_table_kermit); + crc_n4(crc, ((uint32_t *)data)[1], crc_table_kermit); + crc_n4(crc, ((uint32_t *)data)[2], crc_table_kermit); + crc_n4(crc, ((uint32_t *)data)[3], crc_table_kermit); + data += 16; + } + + while (len--) { + crc = (crc >> 8) ^ pgm_read_word(&crc_table_kermit[(crc & 0xff) ^ *data++]); + } + + seed = crc; + return crc; +} + +uint16_t FastCRC16::kermit(const uint8_t *data, const size_t datalen) +{ + // poly=0x1021 init=0x0000 refin=true refout=true xorout=0x0000 check=0x2189 + // sometimes byteswapped presentation of result + seed = 0x0000; + return kermit_upd(data, datalen); +} + +/** XMODEM + * Alias ZMODEM, CRC-16/ACORN + * @param data Pointer to Data + * @param datalen Length of Data + * @return CRC value + */ +uint16_t FastCRC16::xmodem_upd(const uint8_t *data, size_t len) +{ + + uint16_t crc = seed; + + while (((uintptr_t)data & 3) && len) { + crc = (crc >> 8) ^ pgm_read_word(&crc_table_xmodem[(crc & 0xff) ^ *data++]); + len--; + } + + while (len >= 16) { + len -= 16; + crc_n4(crc, ((uint32_t *)data)[0], crc_table_xmodem); + crc_n4(crc, ((uint32_t *)data)[1], crc_table_xmodem); + crc_n4(crc, ((uint32_t *)data)[2], crc_table_xmodem); + crc_n4(crc, ((uint32_t *)data)[3], crc_table_xmodem); + data += 16; + } + + while (len--) { + crc = (crc >> 8) ^ pgm_read_word(&crc_table_xmodem[(crc & 0xff) ^ *data++]); + } + + seed = crc; + crc = REV16(crc); + return crc; +} + +uint16_t FastCRC16::xmodem(const uint8_t *data, const size_t datalen) +{ + //width=16 poly=0x1021 init=0x0000 refin=false refout=false xorout=0x0000 check=0x31c3 + seed = 0x0000; + return xmodem_upd(data, datalen); +} + +/** X25 + * Alias CRC-16/IBM-SDLC, CRC-16/ISO-HDLC, CRC-B + * @param data Pointer to Data + * @param datalen Length of Data + * @return CRC value + */ +uint16_t FastCRC16::x25_upd(const uint8_t *data, size_t len) +{ + + uint16_t crc = seed; + + while (((uintptr_t)data & 3) && len) { + crc = (crc >> 8) ^ pgm_read_word(&crc_table_x25[(crc & 0xff) ^ *data++]); + len--; + } + + while (len >= 16) { + len -= 16; + crc_n4(crc, ((uint32_t *)data)[0], crc_table_x25); + crc_n4(crc, ((uint32_t *)data)[1], crc_table_x25); + crc_n4(crc, ((uint32_t *)data)[2], crc_table_x25); + crc_n4(crc, ((uint32_t *)data)[3], crc_table_x25); + data += 16; + } + + while (len--) { + crc = (crc >> 8) ^ pgm_read_word(&crc_table_x25[(crc & 0xff) ^ *data++]); + } + + seed = crc; + crc = ~crc; + + return crc; +} + +uint16_t FastCRC16::x25(const uint8_t *data, const size_t datalen) +{ + // poly=0x1021 init=0xffff refin=true refout=true xorout=0xffff check=0x906e + seed = 0xffff; + return x25_upd(data, datalen); +} + + + + + +// ================= 32-BIT CRC =================== +/** Constructor + */ +FastCRC32::FastCRC32(){} + +#define crc_n4d(crc, data, table) crc ^= data; \ + crc = pgm_read_dword(&table[(crc & 0xff) + 0x300]) ^ \ + pgm_read_dword(&table[((crc >> 8) & 0xff) + 0x200]) ^ \ + pgm_read_dword(&table[((crc >> 16) & 0xff) + 0x100]) ^ \ + pgm_read_dword(&table[(crc >> 24) & 0xff]); + +#define crcsm_n4d(crc, data, table) crc ^= data; \ + crc = (crc >> 8) ^ pgm_read_dword(&table[crc & 0xff]); \ + crc = (crc >> 8) ^ pgm_read_dword(&table[crc & 0xff]); \ + crc = (crc >> 8) ^ pgm_read_dword(&table[crc & 0xff]); \ + crc = (crc >> 8) ^ pgm_read_dword(&table[crc & 0xff]); + +/** CRC32 + * Alias CRC-32/ADCCP, PKZIP, Ethernet, 802.3 + * @param data Pointer to Data + * @param datalen Length of Data + * @return CRC value + */ +#if CRC_BIGTABLES +#define CRC_TABLE_CRC32 crc_table_crc32_big +#else +#define CRC_TABLE_CRC32 crc_table_crc32 +#endif + +uint32_t FastCRC32::crc32_upd(const uint8_t *data, size_t len) +{ + + uint32_t crc = seed; + + while (((uintptr_t)data & 3) && len) { + crc = (crc >> 8) ^ pgm_read_dword(&CRC_TABLE_CRC32[(crc & 0xff) ^ *data++]); + len--; + } + + while (len >= 16) { + len -= 16; + #if CRC_BIGTABLES + crc_n4d(crc, ((uint32_t *)data)[0], CRC_TABLE_CRC32); + crc_n4d(crc, ((uint32_t *)data)[1], CRC_TABLE_CRC32); + crc_n4d(crc, ((uint32_t *)data)[2], CRC_TABLE_CRC32); + crc_n4d(crc, ((uint32_t *)data)[3], CRC_TABLE_CRC32); + #else + crcsm_n4d(crc, ((uint32_t *)data)[0], CRC_TABLE_CRC32); + crcsm_n4d(crc, ((uint32_t *)data)[1], CRC_TABLE_CRC32); + crcsm_n4d(crc, ((uint32_t *)data)[2], CRC_TABLE_CRC32); + crcsm_n4d(crc, ((uint32_t *)data)[3], CRC_TABLE_CRC32); + #endif + data += 16; + } + + while (len--) { + crc = (crc >> 8) ^ pgm_read_dword(&CRC_TABLE_CRC32[(crc & 0xff) ^ *data++]); + } + + seed = crc; + crc = ~crc; + + return crc; +} + +uint32_t FastCRC32::crc32(const uint8_t *data, const size_t datalen) +{ + // poly=0x04c11db7 init=0xffffffff refin=true refout=true xorout=0xffffffff check=0xcbf43926 + seed = 0xffffffff; + return crc32_upd(data, datalen); +} + +/** CKSUM + * Alias CRC-32/POSIX + * @param data Pointer to Data + * @param datalen Length of Data + * @return CRC value + */ + #if CRC_BIGTABLES +#define CRC_TABLE_CKSUM crc_table_cksum_big +#else +#define CRC_TABLE_CKSUM crc_table_cksum +#endif +uint32_t FastCRC32::cksum_upd(const uint8_t *data, size_t len) +{ + + uint32_t crc = seed; + + while (((uintptr_t)data & 3) && len) { + crc = (crc >> 8) ^ pgm_read_dword(&CRC_TABLE_CKSUM[(crc & 0xff) ^ *data++]); + len--; + } + + while (len >= 16) { + len -= 16; + #if CRC_BIGTABLES + crc_n4d(crc, ((uint32_t *)data)[0], CRC_TABLE_CKSUM); + crc_n4d(crc, ((uint32_t *)data)[1], CRC_TABLE_CKSUM); + crc_n4d(crc, ((uint32_t *)data)[2], CRC_TABLE_CKSUM); + crc_n4d(crc, ((uint32_t *)data)[3], CRC_TABLE_CKSUM); + #else + crcsm_n4d(crc, ((uint32_t *)data)[0], CRC_TABLE_CKSUM); + crcsm_n4d(crc, ((uint32_t *)data)[1], CRC_TABLE_CKSUM); + crcsm_n4d(crc, ((uint32_t *)data)[2], CRC_TABLE_CKSUM); + crcsm_n4d(crc, ((uint32_t *)data)[3], CRC_TABLE_CKSUM); + #endif + data += 16; + } + + while (len--) { + crc = (crc >> 8) ^ pgm_read_dword(&CRC_TABLE_CKSUM[(crc & 0xff) ^ *data++]); + } + + seed = crc; + crc = ~REV32(crc); + return crc; +} + +uint32_t FastCRC32::cksum(const uint8_t *data, const size_t datalen) +{ + // width=32 poly=0x04c11db7 init=0x00000000 refin=false refout=false xorout=0xffffffff check=0x765e7680 + seed = 0x00; + return cksum_upd(data, datalen); +} + +#endif // #if !defined(KINETISK) diff --git a/lib/lib_div/ams/han_Parser.h b/lib/lib_div/ams/han_Parser.h index 2011de4cf..f90af40f2 100644 --- a/lib/lib_div/ams/han_Parser.h +++ b/lib/lib_div/ams/han_Parser.h @@ -6,7 +6,7 @@ #include "DataParsers.h" #include "DataParser.h" #include "Cosem.h" -#include "ntohll.h" +#include "ntohll_ams.h" #define BUF_SIZE_HAN (1280) diff --git a/lib/lib_div/ams/ntohll.cpp b/lib/lib_div/ams/ntohll_ams.cpp similarity index 54% rename from lib/lib_div/ams/ntohll.cpp rename to lib/lib_div/ams/ntohll_ams.cpp index 25732434d..207e3765c 100644 --- a/lib/lib_div/ams/ntohll.cpp +++ b/lib/lib_div/ams/ntohll_ams.cpp @@ -1,5 +1,5 @@ -#include "ntohll.h" +#include "ntohll_ams.h" -uint64_t ntohll(uint64_t x) { +uint64_t ntohll_ams(uint64_t x) { return (((uint64_t)ntohl((uint32_t)x)) << 32) + ntohl(x >> 32); } \ No newline at end of file diff --git a/lib/lib_div/ams/ntohll.h b/lib/lib_div/ams/ntohll_ams.h similarity index 67% rename from lib/lib_div/ams/ntohll.h rename to lib/lib_div/ams/ntohll_ams.h index 2bb1e5e09..03e30f77e 100644 --- a/lib/lib_div/ams/ntohll.h +++ b/lib/lib_div/ams/ntohll_ams.h @@ -3,6 +3,6 @@ #include "lwip/def.h" -uint64_t ntohll(uint64_t x); +uint64_t ntohll_ams(uint64_t x); #endif diff --git a/lib/lib_rf/rc-switch/src/RCSwitch.h b/lib/lib_rf/rc-switch/src/RCSwitch.h index 28d946d65..26bd4049e 100644 --- a/lib/lib_rf/rc-switch/src/RCSwitch.h +++ b/lib/lib_rf/rc-switch/src/RCSwitch.h @@ -59,13 +59,14 @@ // Number of maximum high/Low changes per packet. // We can handle up to 36 bit * 2 H/L changes per bit + 2 for sync // Для keeloq нужно увеличить RCSWITCH_MAX_CHANGES до 23+1+66*2+1=157 -#define RCSWITCH_MAX_CHANGES 75 // default 75 - longest protocol that requires this buffer size is 38/nexus +//#define RCSWITCH_MAX_CHANGES 75 // default 75 - longest protocol that requires this buffer size is 38/nexus +#define RCSWITCH_MAX_CHANGES 131 // default 75 - Supports 64 too // separationLimit: minimum microseconds between received codes, closer codes are ignored. // according to discussion on issue #14 it might be more suitable to set the separation // limit to the same time as the 'low' part of the sync signal for the current protocol. // should be set to the minimum value of pulselength * the sync signal -#define RCSWITCH_SEPARATION_LIMIT 4100 +#define RCSWITCH_SEPARATION_LIMIT 3600 class RCSwitch { diff --git a/lib/lib_ssl/tls_mini/src/StackThunk_light.cpp b/lib/lib_ssl/tls_mini/src/StackThunk_light.cpp index 098752c88..00799d66c 100644 --- a/lib/lib_ssl/tls_mini/src/StackThunk_light.cpp +++ b/lib/lib_ssl/tls_mini/src/StackThunk_light.cpp @@ -44,7 +44,7 @@ uint32_t *stack_thunk_light_save = NULL; /* Saved A1 while in BearSSL */ uint32_t stack_thunk_light_refcnt = 0; //#define _stackSize (5600/4) -#if defined(USE_MQTT_AWS_IOT) || defined(USE_MQTT_AWS_IOT_LIGHT) || defined(USE_MQTT_AZURE_IOT) +#if defined(USE_MQTT_CLIENT_CERT) || defined(USE_MQTT_AWS_IOT_LIGHT) || defined(USE_MQTT_AZURE_IOT) #define _stackSize (5300/4) // using a light version of bearssl we can save 300 bytes #else #define _stackSize (4800/4) // no private key, we can reduce a little, max observed 4300 diff --git a/lib/lib_ssl/tls_mini/src/WiFiClientSecureLightBearSSL.cpp b/lib/lib_ssl/tls_mini/src/WiFiClientSecureLightBearSSL.cpp index ce7a28270..c11acaec2 100755 --- a/lib/lib_ssl/tls_mini/src/WiFiClientSecureLightBearSSL.cpp +++ b/lib/lib_ssl/tls_mini/src/WiFiClientSecureLightBearSSL.cpp @@ -303,7 +303,9 @@ int WiFiClientSecure_light::connect(IPAddress ip, uint16_t port, int32_t timeout setLastError(ERR_TCP_CONNECT); return 0; } - return _connectSSL(_domain.isEmpty() ? nullptr : _domain.c_str()); + bool success = _connectSSL(_domain.isEmpty() ? nullptr : _domain.c_str()); + if (!success) { stop(); } + return success; } #else // ESP32 int WiFiClientSecure_light::connect(IPAddress ip, uint16_t port) { @@ -313,7 +315,9 @@ int WiFiClientSecure_light::connect(IPAddress ip, uint16_t port) { setLastError(ERR_TCP_CONNECT); return 0; } - return _connectSSL(_domain.isEmpty() ? nullptr : _domain.c_str()); + bool success = _connectSSL(_domain.isEmpty() ? nullptr : _domain.c_str()); + if (!success) { stop(); } + return success; } #endif @@ -570,6 +574,7 @@ int WiFiClientSecure_light::_run_until(unsigned target, bool blocking) { if (((int32_t)(millis() - (t + this->_loopTimeout)) >= 0)){ DEBUG_BSSL("_run_until: Timeout\n"); + setLastError(ERR_TLS_TIMEOUT); return -1; } @@ -994,16 +999,16 @@ bool WiFiClientSecure_light::_connectSSL(const char* hostName) { br_ssl_engine_set_buffers_bidi(_eng, _iobuf_in.get(), _iobuf_in_size, _iobuf_out.get(), _iobuf_out_size); // ============================================================ - // allocate Private key if needed, only if USE_MQTT_AWS_IOT + // allocate Private key if needed, only if USE_MQTT_CLIENT_CERT LOG_HEAP_SIZE("_connectSSL before PrivKey allocation"); - #ifdef USE_MQTT_AWS_IOT + #if defined(USE_MQTT_CLIENT_CERT) // ============================================================ - // Set the EC Private Key, only USE_MQTT_AWS_IOT + // Set the EC Private Key, only USE_MQTT_CLIENT_CERT // limited to P256 curve br_ssl_client_set_single_ec(_sc.get(), _chain_P, 1, _sk_ec_P, _allowed_usages, _cert_issuer_key_type, &br_ec_p256_m15, br_ecdsa_sign_asn1_get_default()); - #endif // USE_MQTT_AWS_IOT + #endif // USE_MQTT_CLIENT_CERT // ============================================================ // Start TLS connection, ALL diff --git a/lib/lib_ssl/tls_mini/src/WiFiClientSecureLightBearSSL.h b/lib/lib_ssl/tls_mini/src/WiFiClientSecureLightBearSSL.h index 8ba7a33ba..3cbbcc67e 100755 --- a/lib/lib_ssl/tls_mini/src/WiFiClientSecureLightBearSSL.h +++ b/lib/lib_ssl/tls_mini/src/WiFiClientSecureLightBearSSL.h @@ -137,7 +137,7 @@ class WiFiClientSecure_light : public WiFiClient { } private: - uint32_t _loopTimeout=5000; + uint32_t _loopTimeout=10000; void _clear(); bool _ctx_present; std::shared_ptr _sc; @@ -192,7 +192,8 @@ class WiFiClientSecure_light : public WiFiClient { #define ERR_CANT_RESOLVE_IP -1001 #define ERR_TCP_CONNECT -1002 // #define ERR_MISSING_EC_KEY -1003 // deprecated, AWS IoT is not called if the private key is not present -#define ERR_MISSING_CA -1004 +// #define ERR_MISSING_CA -1004 // deprecated +#define ERR_TLS_TIMEOUT -1005 // For reference, BearSSL error codes: // #define BR_ERR_OK 0 diff --git a/lib/libesp32/berry/default/be_modtab.c b/lib/libesp32/berry/default/be_modtab.c index 91fbd932e..fe7ef5980 100644 --- a/lib/libesp32/berry/default/be_modtab.c +++ b/lib/libesp32/berry/default/be_modtab.c @@ -40,6 +40,17 @@ be_extern_native_module(gpio); be_extern_native_module(display); be_extern_native_module(energy); be_extern_native_module(webserver); +#ifdef USE_BERRY_HTTPSERVER +be_extern_native_module(httpserver); + +#ifdef USE_BERRY_WSSERVER +be_extern_native_module(wsserver); +#endif // USE_BERRY_WSSERVER + +#ifdef USE_BERRY_WEBFILES +be_extern_native_module(webfiles); +#endif // USE_BERRY_WEBFILES +#endif // USE_BERRY_HTTPSERVER be_extern_native_module(flash); be_extern_native_module(path); be_extern_native_module(unishox); @@ -170,6 +181,15 @@ BERRY_LOCAL const bntvmodule_t* const be_module_table[] = { #ifdef USE_WEBSERVER &be_native_module(webserver), #endif // USE_WEBSERVER +#ifdef USE_BERRY_HTTPSERVER + &be_native_module(httpserver), +#ifdef USE_BERRY_WSSERVER + &be_native_module(wsserver), +#endif // USE_BERRY_WSSERVER +#ifdef USE_BERRY_WEBFILES + &be_native_module(webfiles), +#endif // USE_BERRY_WEBFILES +#endif // USE_BERRY_HTTPSERVER #ifdef USE_ZIGBEE &be_native_module(zigbee), &be_native_module(matter_zigbee), @@ -283,7 +303,6 @@ BERRY_LOCAL bclass_array be_class_table = { &be_native_class(AXP2102), #endif // USE_I2C &be_native_class(md5), -#ifdef USE_WEBCLIENT &be_native_class(udp), &be_native_class(webclient), &be_native_class(tcpclient), @@ -291,7 +310,6 @@ BERRY_LOCAL bclass_array be_class_table = { #ifdef USE_BERRY_DEBUG &be_native_class(webserver_async), // include only when USE_BERRY_DEBUG is enabled #endif // USE_BERRY_DEBUG -#endif // USE_WEBCLIENT #ifdef USE_BERRY_TCPSERVER &be_native_class(tcpserver), #endif // USE_BERRY_TCPSERVER diff --git a/lib/libesp32/berry/default/be_re_lib.c b/lib/libesp32/berry/default/be_re_lib.c index ab7f6644c..2b7961652 100644 --- a/lib/libesp32/berry/default/be_re_lib.c +++ b/lib/libesp32/berry/default/be_re_lib.c @@ -64,6 +64,25 @@ int be_re_compile(bvm *vm) { be_raise(vm, "type_error", NULL); } +// Native functions be_const_func() +// Berry: `re.compilebytes(pattern:string) -> instance(bytes)` +int be_re_compilebytes(bvm *vm) { + int32_t argc = be_top(vm); // Get the number of arguments + if (argc >= 1 && be_isstring(vm, 1)) { + const char * regex_str = be_tostring(vm, 1); + int sz = re1_5_sizecode(regex_str); + if (sz < 0) { + be_raise(vm, "internal_error", "error in regex"); + } + + be_pushbytes(vm, NULL, sizeof(ByteProg) + sz); + ByteProg *code = (ByteProg*) be_tobytes(vm, -1, NULL); + re1_5_compilecode(code, regex_str); + be_return(vm); + } + be_raise(vm, "type_error", NULL); +} + // pushes either a list if matched, else `nil` // return index of next offset, or -1 if not found const char *be_re_match_search_run(bvm *vm, ByteProg *code, const char *hay, bbool is_anchored, bbool size_only) { @@ -99,9 +118,10 @@ const char *be_re_match_search_run(bvm *vm, ByteProg *code, const char *hay, bbo int be_re_match_search(bvm *vm, bbool is_anchored, bbool size_only) { int32_t argc = be_top(vm); // Get the number of arguments - if (argc >= 2 && be_isstring(vm, 1) && be_isstring(vm, 2)) { - const char * regex_str = be_tostring(vm, 1); + if (argc >= 2 && (be_isstring(vm, 1) || be_isbytes(vm, 1)) && be_isstring(vm, 2)) { const char * hay = be_tostring(vm, 2); + ByteProg *code = NULL; + int32_t offset = 0; if (argc >= 3 && be_isint(vm, 3)) { offset = be_toint(vm, 3); @@ -111,22 +131,31 @@ int be_re_match_search(bvm *vm, bbool is_anchored, bbool size_only) { if (offset >= hay_len) { be_return_nil(vm); } // any match of empty string returns nil, this catches implicitly when hay_len == 0 hay += offset; // shift to offset - int sz = re1_5_sizecode(regex_str); - if (sz < 0) { - be_raise(vm, "internal_error", "error in regex"); - } + if (be_isstring(vm, 1)) { + const char * regex_str = be_tostring(vm, 1); + int sz = re1_5_sizecode(regex_str); + if (sz < 0) { + be_raise(vm, "internal_error", "error in regex"); + } - ByteProg *code = be_os_malloc(sizeof(ByteProg) + sz); - if (code == NULL) { - be_throw(vm, BE_MALLOC_FAIL); /* lack of heap space */ - } - int ret = re1_5_compilecode(code, regex_str); - if (ret != 0) { - be_os_free(code); - be_raise(vm, "internal_error", "error in regex"); + code = be_os_malloc(sizeof(ByteProg) + sz); + if (code == NULL) { + be_throw(vm, BE_MALLOC_FAIL); /* lack of heap space */ + } + int ret = re1_5_compilecode(code, regex_str); + if (ret != 0) { + be_os_free(code); + be_raise(vm, "internal_error", "error in regex"); + } + } else { + code = (ByteProg *) be_tobytes(vm, 1, NULL); } + // do the match be_re_match_search_run(vm, code, hay, is_anchored, size_only); - be_os_free(code); + // cleanup + if (be_isstring(vm, 1)) { + be_os_free(code); + } be_return(vm); } be_raise(vm, "type_error", NULL); @@ -134,26 +163,32 @@ int be_re_match_search(bvm *vm, bbool is_anchored, bbool size_only) { int be_re_match_search_all(bvm *vm, bbool is_anchored) { int32_t argc = be_top(vm); // Get the number of arguments - if (argc >= 2 && be_isstring(vm, 1) && be_isstring(vm, 2)) { - const char * regex_str = be_tostring(vm, 1); + if (argc >= 2 && (be_isstring(vm, 1) || be_isbytes(vm, 1)) && be_isstring(vm, 2)) { const char * hay = be_tostring(vm, 2); + ByteProg *code = NULL; int limit = -1; if (argc >= 3) { limit = be_toint(vm, 3); } - int sz = re1_5_sizecode(regex_str); - if (sz < 0) { - be_raise(vm, "internal_error", "error in regex"); - } - ByteProg *code = be_os_malloc(sizeof(ByteProg) + sz); - if (code == NULL) { - be_throw(vm, BE_MALLOC_FAIL); /* lack of heap space */ - } - int ret = re1_5_compilecode(code, regex_str); - if (ret != 0) { - be_os_free(code); - be_raise(vm, "internal_error", "error in regex"); + if (be_isstring(vm, 1)) { + const char * regex_str = be_tostring(vm, 1); + int sz = re1_5_sizecode(regex_str); + if (sz < 0) { + be_raise(vm, "internal_error", "error in regex"); + } + + code = be_os_malloc(sizeof(ByteProg) + sz); + if (code == NULL) { + be_throw(vm, BE_MALLOC_FAIL); /* lack of heap space */ + } + int ret = re1_5_compilecode(code, regex_str); + if (ret != 0) { + be_os_free(code); + be_raise(vm, "internal_error", "error in regex"); + } + } else { + code = (ByteProg *) be_tobytes(vm, 1, NULL); } be_newobject(vm, "list"); @@ -165,7 +200,10 @@ int be_re_match_search_all(bvm *vm, bbool is_anchored) { be_pop(vm, 1); } be_pop(vm, 1); - be_os_free(code); + // cleanup + if (be_isstring(vm, 1)) { + be_os_free(code); + } be_return(vm); } be_raise(vm, "type_error", NULL); @@ -193,6 +231,21 @@ int be_re_search_all(bvm *vm) { return be_re_match_search_all(vm, bfalse); } +// Berry: `re.dump(b:bytes) -> nil`` +int be_re_dump(bvm *vm) { +#ifdef USE_BERRY_DEBUG + int32_t argc = be_top(vm); // Get the number of arguments + if (argc >= 1 && be_isbytes(vm, 1)) { + ByteProg *code = (ByteProg*) be_tobytes(vm, 1, NULL); + re1_5_dumpcode(code); + be_return_nil(vm); + } + be_raise(vm, "type_error", NULL); +#else // USE_BERRY_DEBUG + be_return_nil(vm); +#endif +} + // Berry: `re_pattern.search(s:string [, offset:int]) -> list(string)` int re_pattern_search(bvm *vm) { int32_t argc = be_top(vm); // Get the number of arguments @@ -329,29 +382,36 @@ int re_pattern_split(bvm *vm) { // Berry: `re.split(pattern:string, s:string [, split_limit:int]) -> list(string)` int be_re_split(bvm *vm) { int32_t argc = be_top(vm); // Get the number of arguments - if (argc >= 2 && be_isstring(vm, 1) && be_isstring(vm, 2)) { - const char * regex_str = be_tostring(vm, 1); + if (argc >= 2 && (be_isstring(vm, 1) || be_isbytes(vm, 1)) && be_isstring(vm, 2)) { const char * hay = be_tostring(vm, 2); + ByteProg *code = NULL; int split_limit = -1; if (argc >= 3) { split_limit = be_toint(vm, 3); } - int sz = re1_5_sizecode(regex_str); - if (sz < 0) { - be_raise(vm, "internal_error", "error in regex"); - } + if (be_isstring(vm, 1)) { + const char * regex_str = be_tostring(vm, 1); + int sz = re1_5_sizecode(regex_str); + if (sz < 0) { + be_raise(vm, "internal_error", "error in regex"); + } - ByteProg *code = be_os_malloc(sizeof(ByteProg) + sz); - if (code == NULL) { - be_throw(vm, BE_MALLOC_FAIL); /* lack of heap space */ + code = be_os_malloc(sizeof(ByteProg) + sz); + if (code == NULL) { + be_throw(vm, BE_MALLOC_FAIL); /* lack of heap space */ + } + int ret = re1_5_compilecode(code, regex_str); + if (ret != 0) { + be_os_free(code); + be_raise(vm, "internal_error", "error in regex"); + } + } else { + code = (ByteProg *) be_tobytes(vm, 1, NULL); } - int ret = re1_5_compilecode(code, regex_str); - if (ret != 0) { + int ret = re_pattern_split_run(vm, code, hay, split_limit); + if (be_isstring(vm, 1)) { be_os_free(code); - be_raise(vm, "internal_error", "error in regex"); } - ret = re_pattern_split_run(vm, code, hay, split_limit); - be_os_free(code); return ret; } be_raise(vm, "type_error", NULL); @@ -363,12 +423,14 @@ int be_re_split(bvm *vm) { @const_object_info_begin module re (scope: global) { compile, func(be_re_compile) + compilebytes, func(be_re_compilebytes) search, func(be_re_search) searchall, func(be_re_search_all) match, func(be_re_match) match2, func(be_re_match2) matchall, func(be_re_match_all) split, func(be_re_split) + dump, func(be_re_dump) } @const_object_info_end diff --git a/lib/libesp32/berry/default/berry.c b/lib/libesp32/berry/default/berry.c index 76756bbc2..51c474bf4 100644 --- a/lib/libesp32/berry/default/berry.c +++ b/lib/libesp32/berry/default/berry.c @@ -405,7 +405,7 @@ int main(int argc, char *argv[]) { int res; bvm *vm = be_vm_new(); /* create a virtual machine instance */ - be_set_ctype_func_hanlder(vm, be_call_ctype_func); + be_set_ctype_func_handler(vm, be_call_ctype_func); res = analysis_args(vm, argc, argv); be_vm_delete(vm); /* free all objects and vm */ return res; diff --git a/lib/libesp32/berry/src/be_api.c b/lib/libesp32/berry/src/be_api.c index 6ccb65c5a..fab94ddcd 100644 --- a/lib/libesp32/berry/src/be_api.c +++ b/lib/libesp32/berry/src/be_api.c @@ -82,8 +82,8 @@ BERRY_API void be_regfunc(bvm *vm, const char *name, bntvfunc f) bstring *s = be_newstr(vm, name); #if !BE_USE_PRECOMPILED_OBJECT int idx = be_builtin_find(vm, s); - be_assert(idx == -1); - if (idx == -1) { /* new function */ + be_assert(idx < 0); + if (idx < 0) { /* new function */ idx = be_builtin_new(vm, s); #else int idx = be_global_find(vm, s); @@ -102,8 +102,8 @@ BERRY_API void be_regclass(bvm *vm, const char *name, const bnfuncinfo *lib) bstring *s = be_newstr(vm, name); #if !BE_USE_PRECOMPILED_OBJECT int idx = be_builtin_find(vm, s); - be_assert(idx == -1); - if (idx == -1) { /* new function */ + be_assert(idx < 0); + if (idx < 0) { /* new function */ idx = be_builtin_new(vm, s); #else int idx = be_global_find(vm, s); @@ -599,7 +599,7 @@ BERRY_API bbool be_getglobal(bvm *vm, const char *name) { int idx = be_global_find(vm, be_newstr(vm, name)); bvalue *top = be_incrtop(vm); - if (idx > -1) { + if (idx >= 0) { *top = *be_global_var(vm, idx); return btrue; } diff --git a/lib/libesp32/berry/src/be_byteslib.c b/lib/libesp32/berry/src/be_byteslib.c index 1ddd027d5..d692286d9 100644 --- a/lib/libesp32/berry/src/be_byteslib.c +++ b/lib/libesp32/berry/src/be_byteslib.c @@ -258,6 +258,26 @@ static size_t buf_add2_be(buf_impl* attr, const uint16_t data) // append 16 bits return attr->len; } +static size_t buf_add3_le(buf_impl* attr, const uint32_t data) // append 32 bits value +{ + if (attr->len < attr->size - 2) { // do we have room for 4 bytes + attr->bufptr[attr->len++] = data; + attr->bufptr[attr->len++] = data >> 8; + attr->bufptr[attr->len++] = data >> 16; + } + return attr->len; +} + +size_t buf_add3_be(buf_impl* attr, const uint32_t data) // append 32 bits value +{ + if (attr->len < attr->size - 2) { // do we have room for 4 bytes + attr->bufptr[attr->len++] = data >> 16; + attr->bufptr[attr->len++] = data >> 8; + attr->bufptr[attr->len++] = data; + } + return attr->len; +} + static size_t buf_add4_le(buf_impl* attr, const uint32_t data) // append 32 bits value { if (attr->len < attr->size - 3) { // do we have room for 4 bytes @@ -838,10 +858,12 @@ static int m_add(bvm *vm) case -1: /* fallback below */ case 1: buf_add1(&attr, v); break; case 2: buf_add2_le(&attr, v); break; + case 3: buf_add3_le(&attr, v); break; case 4: buf_add4_le(&attr, v); break; case -2: buf_add2_be(&attr, v); break; + case -3: buf_add3_be(&attr, v); break; case -4: buf_add4_be(&attr, v); break; - default: be_raise(vm, "type_error", "size must be -4, -2, -1, 0, 1, 2 or 4."); + default: be_raise(vm, "type_error", "size must be between -4 and 4."); } be_pop(vm, argc - 1); m_write_attributes(vm, 1, &attr); /* update attributes */ diff --git a/lib/libesp32/berry/src/be_constobj.h b/lib/libesp32/berry/src/be_constobj.h index 86a871563..7fccc8f4f 100644 --- a/lib/libesp32/berry/src/be_constobj.h +++ b/lib/libesp32/berry/src/be_constobj.h @@ -354,9 +354,6 @@ const bntvmodule_t be_native_module(_module) = { \ #else -// #define be_define_const_bytes(_name, ...) \ -// const uint8_t be_const_bin_##_name[] = { __VA_ARGS__ } - #define be_define_const_str_weak(_name, _s, _len) \ const bcstring be_const_str_##_name = { \ NULL, \ diff --git a/lib/libesp32/berry/src/be_filelib.c b/lib/libesp32/berry/src/be_filelib.c index dcf661fde..135de8ef7 100644 --- a/lib/libesp32/berry/src/be_filelib.c +++ b/lib/libesp32/berry/src/be_filelib.c @@ -234,7 +234,9 @@ int be_nfunc_open(bvm *vm) { "flush", i_flush }, { "close", i_close }, { "deinit", i_close }, +#if BE_USE_BYTECODE_SAVER { "savecode", i_savecode }, +#endif { NULL, NULL } }; fname = argc >= 1 && be_isstring(vm, 1) ? be_tostring(vm, 1) : NULL; diff --git a/lib/libesp32/berry/src/be_globallib.c b/lib/libesp32/berry/src/be_globallib.c index 6597fe78b..ef247a34d 100644 --- a/lib/libesp32/berry/src/be_globallib.c +++ b/lib/libesp32/berry/src/be_globallib.c @@ -27,10 +27,14 @@ static void dump_map_keys(bvm *vm, bmap *map) bmapiter iter = be_map_iter(); while ((node = be_map_next(map, &iter)) != NULL) { if (var_isstr(&node->key)) { - bstring *s = var_tostr(&node->key); - be_pushstring(vm, str(s)); - be_data_push(vm, -2); - be_pop(vm, 1); + /* check if the global was not undefined/removed */ + int idx = var_toidx(&node->value); + if (idx >= 0) { /* the key is present in global, and the index is valid */ + bstring *s = var_tostr(&node->key); + be_pushstring(vm, str(s)); + be_data_push(vm, -2); + be_pop(vm, 1); + } } } } @@ -49,7 +53,7 @@ static int m_contains(bvm *vm) if (top >= 1 && be_isstring(vm, 1)) { const char * name = be_tostring(vm, 1); int idx = be_global_find(vm, be_newstr(vm, name)); - be_pushbool(vm, idx > -1); + be_pushbool(vm, idx >= 0); be_return(vm); } be_return_nil(vm); @@ -76,12 +80,25 @@ static int m_setglobal(bvm *vm) be_return_nil(vm); } +/* Remove a global variable from global scope */ +/* Internally the global name cannot be removed but it's value is replaced with BE_NONE */ +/* and global function pretend that BE_NONE is equivalent to the name being absent */ +static int m_undef(bvm *vm) +{ + int top = be_top(vm); + if (top >= 1 && be_isstring(vm, 1)) { + be_global_undef(vm, be_newstr(vm, be_tostring(vm, 1))); + } + be_return_nil(vm); +} + #if !BE_USE_PRECOMPILED_OBJECT be_native_module_attr_table(global) { be_native_module_function("()", m_globals), be_native_module_function("contains", m_contains), be_native_module_function("member", m_findglobal), be_native_module_function("setmember", m_setglobal), + be_native_module_function("undef", m_undef), }; be_define_native_module(global, NULL); @@ -92,6 +109,7 @@ module global (scope: global, depend: BE_USE_GLOBAL_MODULE) { contains, func(m_contains) member, func(m_findglobal) setmember, func(m_setglobal) + undef, func(m_undef) } @const_object_info_end */ #include "../generate/be_fixed_global.h" diff --git a/lib/libesp32/berry/src/be_introspectlib.c b/lib/libesp32/berry/src/be_introspectlib.c index 78e7eb0e5..3d91e1ad9 100644 --- a/lib/libesp32/berry/src/be_introspectlib.c +++ b/lib/libesp32/berry/src/be_introspectlib.c @@ -137,6 +137,20 @@ static int m_toptr(bvm *vm) be_return_nil(vm); } +static int m_solidified(bvm *vm) +{ + int top = be_top(vm); + if (top >= 1) { + bvalue *v = be_indexof(vm, 1); + if (var_basetype(v) >= BE_FUNCTION || var_type(v) == BE_COMPTR) { + bbool isconst = gc_isconst((bgcobject*)var_toobj(v)); + be_pushbool(vm, isconst); + be_return(vm); + } + } + be_return_nil(vm); +} + static int m_fromptr(bvm *vm) { int top = be_top(vm); @@ -245,6 +259,7 @@ be_native_module_attr_table(introspect) { be_native_module_function("toptr", m_toptr), be_native_module_function("fromptr", m_fromptr), + be_native_module_function("solidified", m_solidified), be_native_module_function("name", m_name), @@ -266,6 +281,7 @@ module introspect (scope: global, depend: BE_USE_INTROSPECT_MODULE) { toptr, func(m_toptr) fromptr, func(m_fromptr) + solidified, func(m_solidified) name, func(m_name) diff --git a/lib/libesp32/berry/src/be_mem.c b/lib/libesp32/berry/src/be_mem.c index 9d20ca055..00a65272c 100644 --- a/lib/libesp32/berry/src/be_mem.c +++ b/lib/libesp32/berry/src/be_mem.c @@ -40,10 +40,15 @@ #elif defined(_MSC_VER) #define popcount(v) __popcnt(v) +// Find a free slot in the space bitmask +// Find the least significant 1-bit in x and return its 1-based index. static int ffs(unsigned x) { unsigned long i; - return _BitScanForward(&i, x) ? i : 0; + // NOTE: _BitScanForward is 0-based, see: + // https://learn.microsoft.com/en-us/cpp/intrinsics/bitscanforward-bitscanforward64?view=msvc-170 + // _BitScanForward(&index, 12) populates index with 2 + return _BitScanForward(&i, x) ? i + 1 : 0; } #else /* https://github.com/hcs0/Hackers-Delight/blob/master/pop.c.txt - count number of 1-bits */ diff --git a/lib/libesp32/berry/src/be_parser.c b/lib/libesp32/berry/src/be_parser.c index 9737cdf81..371c53792 100644 --- a/lib/libesp32/berry/src/be_parser.c +++ b/lib/libesp32/berry/src/be_parser.c @@ -324,8 +324,8 @@ static void end_func(bparser *parser) proto->codesize = finfo->pc; proto->ktab = be_vector_release(vm, &finfo->kvec); proto->nconst = be_vector_count(&finfo->kvec); - proto->nproto = be_vector_count(&finfo->pvec); proto->ptab = be_vector_release(vm, &finfo->pvec); + proto->nproto = be_vector_count(&finfo->pvec); #if BE_USE_MEM_ALIGNED proto->code = be_move_to_aligned(vm, proto->code, proto->codesize * sizeof(binstruction)); /* move `code` to 4-bytes aligned memory region */ proto->ktab = be_move_to_aligned(vm, proto->ktab, proto->nconst * sizeof(bvalue)); /* move `ktab` to 4-bytes aligned memory region */ @@ -488,7 +488,10 @@ static void new_var(bparser *parser, bstring *name, bexpdesc *var) var->v.idx = new_localvar(parser, name); /* if local, contains the index in current local var list */ } else { init_exp(var, ETGLOBAL, 0); - var->v.idx = be_global_new(parser->vm, name); + var->v.idx = be_global_find(parser->vm, name); + if (var->v.idx < 0) { + var->v.idx = be_global_new(parser->vm, name); + } if (var->v.idx > (int)IBx_MASK) { push_error(parser, "too many global variables (in '%s')", str(name)); diff --git a/lib/libesp32/berry/src/be_var.c b/lib/libesp32/berry/src/be_var.c index 1a8e5b18c..c243d6747 100644 --- a/lib/libesp32/berry/src/be_var.c +++ b/lib/libesp32/berry/src/be_var.c @@ -67,19 +67,39 @@ static int global_find(bvm *vm, bstring *name) { bvalue *res = be_map_findstr(vm, global(vm).vtab, name); if (res) { - return var_toidx(res) + be_builtin_count(vm); + int idx = var_toidx(res); + if (idx >= 0) { + return idx + be_builtin_count(vm); + } else { + return idx; /* the global does not exist (-1) or was underfined (< -1)*/ + } } return -1; /* not found */ } +bbool be_global_undef(bvm *vm, bstring *name) +{ + int idx = global_find(vm, name); + if (idx >= 0) { + bvalue *desc = be_map_findstr(vm, global(vm).vtab, name); + int index = var_toidx(desc); + var_setint(desc, -index - 2); /* negate the index to mark it as undefined */ + + bvalue* val = be_vector_at(&global(vm).vlist, index); + var_setnil(val); + return btrue; + } + return bfalse; +} + int be_global_find(bvm *vm, bstring *name) { - int res = global_find(vm, name); + int res = global_find(vm, name); /* returns negative if not found, -1 if does not exist, < -1 if existed but undefined */ if (res < 0) { - res = be_builtin_find(vm, name); + res = be_builtin_find(vm, name); /* returns -1 if not found */ } if (res < 0) { - res = global_native_class_find(vm, name); + res = global_native_class_find(vm, name); /* returns -1 if not found */ } return res; } @@ -97,11 +117,18 @@ static int global_new_anonymous(bvm *vm) int be_global_new(bvm *vm, bstring *name) { int idx = global_find(vm, name); - if (idx == -1) { + if (idx < 0) { bvalue *desc; - idx = global_new_anonymous(vm); - desc = be_map_insertstr(vm, global(vm).vtab, name, NULL); - var_setint(desc, idx); + if (idx == -1) { + idx = global_new_anonymous(vm); + desc = be_map_insertstr(vm, global(vm).vtab, name, NULL); + var_setint(desc, idx); + } else { + /* the global exists but was undefined */ + idx = -idx - 2; + desc = be_map_findstr(vm, global(vm).vtab, name); + var_setint(desc, idx); + } idx += be_builtin_count(vm); } return idx; diff --git a/lib/libesp32/berry/src/be_var.h b/lib/libesp32/berry/src/be_var.h index 6b9908a6b..d81623b07 100644 --- a/lib/libesp32/berry/src/be_var.h +++ b/lib/libesp32/berry/src/be_var.h @@ -20,6 +20,7 @@ void be_globalvar_init(bvm *vm); void be_globalvar_deinit(bvm *vm); int be_global_find(bvm *vm, bstring *name); int be_global_new(bvm *vm, bstring *name); +bbool be_global_undef(bvm *vm, bstring *name); bvalue* be_global_var(bvm *vm, int index); void be_global_release_space(bvm *vm); int be_builtin_find(bvm *vm, bstring *name); diff --git a/lib/libesp32/berry/src/be_vm.c b/lib/libesp32/berry/src/be_vm.c index 78fcc486b..1e441ffa7 100644 --- a/lib/libesp32/berry/src/be_vm.c +++ b/lib/libesp32/berry/src/be_vm.c @@ -591,7 +591,7 @@ newframe: /* a new call frame */ if (var_isstr(b)) { bstring *name = var_tostr(b); int idx = be_global_find(vm, name); - if (idx > -1) { + if (idx >= 0) { *v = *be_global_var(vm, idx); } else { vm_error(vm, "attribute_error", "'%s' undeclared", str(name)); @@ -1408,7 +1408,7 @@ BERRY_API void be_set_obs_micros(bvm *vm, bmicrosfnct micros) vm->microsfnct = micros; } -BERRY_API void be_set_ctype_func_hanlder(bvm *vm, bctypefunc handler) +BERRY_API void be_set_ctype_func_handler(bvm *vm, bctypefunc handler) { vm->ctypefunc = handler; } diff --git a/lib/libesp32/berry/src/berry.h b/lib/libesp32/berry/src/berry.h index e8ee792de..930c0e711 100644 --- a/lib/libesp32/berry/src/berry.h +++ b/lib/libesp32/berry/src/berry.h @@ -2168,14 +2168,14 @@ BERRY_API void be_set_obs_micros(bvm *vm, bmicrosfnct micros); /** - * @fn void be_set_ctype_func_hanlder(bvm*, bctypefunc) + * @fn void be_set_ctype_func_handler(bvm*, bctypefunc) * @note Observability hook * @brief (???) * * @param vm virtual machine instance * @param handler */ -BERRY_API void be_set_ctype_func_hanlder(bvm *vm, bctypefunc handler); +BERRY_API void be_set_ctype_func_handler(bvm *vm, bctypefunc handler); /** * @fn bctypefunc be_get_ctype_func_hanlder(bvm*) diff --git a/lib/libesp32/berry/tests/bytes.be b/lib/libesp32/berry/tests/bytes.be index 0cdc8334b..3533acc2a 100644 --- a/lib/libesp32/berry/tests/bytes.be +++ b/lib/libesp32/berry/tests/bytes.be @@ -53,6 +53,11 @@ b.add(0x12345678, -2) assert(str(b) == "bytes('2278785678563412785678')") b.add(0x12345678, -4) assert(str(b) == "bytes('227878567856341278567812345678')") +b.add(0xAABBCC, 3) +assert(str(b) == "bytes('227878567856341278567812345678CCBBAA')") +b.add(0x998877, -3) +assert(str(b) == "bytes('227878567856341278567812345678CCBBAA998877')") + #- get -# b=bytes("000102030405") diff --git a/lib/libesp32/berry/tests/re.be b/lib/libesp32/berry/tests/re.be new file mode 100644 index 000000000..38ebfb267 --- /dev/null +++ b/lib/libesp32/berry/tests/re.be @@ -0,0 +1,52 @@ +# test regex from re1.5 +import re + +# standard use of lib +assert(re.search("a.*?b(z+)", "zaaaabbbccbbzzzee") == ['aaaabbbccbbzzz', 'zzz']) +assert(re.searchall('<([a-zA-Z]+)>', ' yeah ') == [['', 'abc'], ['', 'xyz']]) + +assert(re.match("a.*?b(z+)", "aaaabbbccbbzzzee") == ['aaaabbbccbbzzz', 'zzz']) +assert(re.match2("a.*?b(z+)", "aaaabbbccbbzzzee") == [14, 'zzz']) +assert(re.matchall('<([a-zA-Z]+)>', ' yeah ') == [['', 'abc']]) +assert(re.matchall('<([a-zA-Z]+)>', '') == [['', 'abc'], ['', 'xyz']]) +assert(re.split('/', "foo/bar//baz") == ['foo', 'bar', '', 'baz']) + +# pre-compile +var rr +rr = re.compile("a.*?b(z+)") +assert(rr.search("zaaaabbbccbbzzzee") == ['aaaabbbccbbzzz', 'zzz']) +rr = re.compile('<([a-zA-Z]+)>') +assert(rr.searchall(' yeah ') == [['', 'abc'], ['', 'xyz']]) + +rr = re.compile("a.*?b(z+)") +assert(rr.match("aaaabbbccbbzzzee") == ['aaaabbbccbbzzz', 'zzz']) +assert(rr.match2("aaaabbbccbbzzzee") == [14, 'zzz']) +rr = re.compile('<([a-zA-Z]+)>') +assert(rr.matchall(' yeah ') == [['', 'abc']]) +assert(rr.matchall('') == [['', 'abc'], ['', 'xyz']]) +rr = re.compile('/') +assert(rr.split("foo/bar//baz") == ['foo', 'bar', '', 'baz']) + +# compile to bytes +var rb +rb = re.compilebytes("a.*?b(z+)") +assert(re.search(rb, "zaaaabbbccbbzzzee") == ['aaaabbbccbbzzz', 'zzz']) +assert(rb == bytes('1B0000000F0000000100000062030260FB7E00016162030260FB01627E02017A62FC7E037E017F')) + +rb = re.compilebytes('<([a-zA-Z]+)>') +assert(re.searchall(rb, ' yeah ') == [['', 'abc'], ['', 'xyz']]) +assert(rb == bytes('1A0000000C0000000100000062030260FB7E00013C7E020302617A415A62F87E03013E7E017F')) + +rb = re.compilebytes("a.*?b(z+)") +assert(re.match(rb, "aaaabbbccbbzzzee") == ['aaaabbbccbbzzz', 'zzz']) +assert(re.match2(rb, "aaaabbbccbbzzzee") == [14, 'zzz']) +assert(rb == bytes('1B0000000F0000000100000062030260FB7E00016162030260FB01627E02017A62FC7E037E017F')) + +rb = re.compilebytes('<([a-zA-Z]+)>') +assert(re.matchall(rb, ' yeah ') == [['', 'abc']]) +assert(re.matchall(rb, '') == [['', 'abc'], ['', 'xyz']]) +assert(rb == bytes('1A0000000C0000000100000062030260FB7E00013C7E020302617A415A62F87E03013E7E017F')) + +rb = re.compilebytes('/') +assert(re.split(rb, "foo/bar//baz") == ['foo', 'bar', '', 'baz']) +assert(rb == bytes('0C000000070000000000000062030260FB7E00012F7E017F')) diff --git a/lib/libesp32/berry_int64/src/be_int64_class.c b/lib/libesp32/berry_int64/src/be_int64_class.c index 356c096df..922821a9e 100644 --- a/lib/libesp32/berry_int64/src/be_int64_class.c +++ b/lib/libesp32/berry_int64/src/be_int64_class.c @@ -11,25 +11,25 @@ #include "be_mem.h" static void int64_toa(int64_t num, uint8_t* str) { - uint64_t sum = num; + uint64_t sum = num; if (num < 0) { sum = -num; str[0] = '-'; str++; } - int len = 0; - do { + int len = 0; + do { str[len++] = '0' + sum % 10LL; - sum /= 10LL; - } while (sum); - str[len] = '\0'; + sum /= 10LL; + } while (sum); + str[len] = '\0'; /* strrev */ int i, j; - for (i = 0, j = len - 1; i < j; i++, j--){ - uint8_t a = str[i]; - str[i] = str[j]; - str[j] = a; - } + for (i = 0, j = len - 1; i < j; i++, j--){ + uint8_t a = str[i]; + str[i] = str[j]; + str[j] = a; + } } /* constructor*/ @@ -320,15 +320,15 @@ be_local_closure(toint64, /* name */ &be_const_str_toint64, &be_const_str_solidified, ( &(const binstruction[ 9]) { /* code */ - 0x4C040000, // 0000 LDNIL R1 - 0x1C040001, // 0001 EQ R1 R0 R1 - 0x78060001, // 0002 JMPF R1 #0005 - 0x4C040000, // 0003 LDNIL R1 - 0x80040200, // 0004 RET 1 R1 - 0xB8060000, // 0005 GETNGBL R1 K0 - 0x5C080000, // 0006 MOVE R2 R0 - 0x7C040200, // 0007 CALL R1 1 - 0x80040200, // 0008 RET 1 R1 + 0x4C040000, // 0000 LDNIL R1 + 0x1C040001, // 0001 EQ R1 R0 R1 + 0x78060001, // 0002 JMPF R1 #0005 + 0x4C040000, // 0003 LDNIL R1 + 0x80040200, // 0004 RET 1 R1 + 0xB8060000, // 0005 GETNGBL R1 K0 + 0x5C080000, // 0006 MOVE R2 R0 + 0x7C040200, // 0007 CALL R1 1 + 0x80040200, // 0008 RET 1 R1 }) ) ); diff --git a/lib/libesp32/berry_mapping/README.md b/lib/libesp32/berry_mapping/README.md index d83b8b4e1..b1ba10e41 100644 --- a/lib/libesp32/berry_mapping/README.md +++ b/lib/libesp32/berry_mapping/README.md @@ -171,7 +171,7 @@ You need to register the ctype function handler at the launch of the Berry VM: void berry_launch(boid) { bvm *vm = be_vm_new(); /* Construct a VM */ - be_set_ctype_func_hanlder(berry.vm, be_call_ctype_func); /* register the ctype function handler */ + be_set_ctype_func_handler(berry.vm, be_call_ctype_func); /* register the ctype function handler */ } ``` diff --git a/lib/libesp32/berry_mapping/src/be_cb_module.c b/lib/libesp32/berry_mapping/src/be_cb_module.c index 343ac3d34..5c12e3342 100644 --- a/lib/libesp32/berry_mapping/src/be_cb_module.c +++ b/lib/libesp32/berry_mapping/src/be_cb_module.c @@ -27,26 +27,26 @@ static int call_berry_cb(int num, int v0, int v1, int v2, int v3, int v4); #define BERRY_CB(n) int berry_cb_##n(int v0, int v1, int v2, int v3, int v4) { return call_berry_cb(n, v0, v1, v2, v3, v4); } // list the callbacks -BERRY_CB(0); -BERRY_CB(1); -BERRY_CB(2); -BERRY_CB(3); -BERRY_CB(4); -BERRY_CB(5); -BERRY_CB(6); -BERRY_CB(7); -BERRY_CB(8); -BERRY_CB(9); -BERRY_CB(10); -BERRY_CB(11); -BERRY_CB(12); -BERRY_CB(13); -BERRY_CB(14); -BERRY_CB(15); -BERRY_CB(16); -BERRY_CB(17); -BERRY_CB(18); -BERRY_CB(19); +BERRY_CB(0) +BERRY_CB(1) +BERRY_CB(2) +BERRY_CB(3) +BERRY_CB(4) +BERRY_CB(5) +BERRY_CB(6) +BERRY_CB(7) +BERRY_CB(8) +BERRY_CB(9) +BERRY_CB(10) +BERRY_CB(11) +BERRY_CB(12) +BERRY_CB(13) +BERRY_CB(14) +BERRY_CB(15) +BERRY_CB(16) +BERRY_CB(17) +BERRY_CB(18) +BERRY_CB(19) // array of callbacks static const berry_callback_t berry_callback_array[BE_MAX_CB] = { diff --git a/lib/libesp32/berry_mapping/src/be_mapping_utils.c b/lib/libesp32/berry_mapping/src/be_mapping_utils.c index 18fad80af..3062c6747 100644 --- a/lib/libesp32/berry_mapping/src/be_mapping_utils.c +++ b/lib/libesp32/berry_mapping/src/be_mapping_utils.c @@ -145,4 +145,4 @@ int be_map_bin_search(const char * needle, const void * table, size_t elt_size, } else { return -1; } -} \ No newline at end of file +} diff --git a/lib/libesp32/berry_matter/src/embedded/Matter_0_Inspect.be b/lib/libesp32/berry_matter/src/embedded/Matter_0_Inspect.be index 0846415e7..c991b597e 100644 --- a/lib/libesp32/berry_matter/src/embedded/Matter_0_Inspect.be +++ b/lib/libesp32/berry_matter/src/embedded/Matter_0_Inspect.be @@ -87,9 +87,18 @@ matter.inspect = inspect # # Build a consolidated map of all the `CLUSTERS` static vars # from the inheritance hierarchy +# +# `cl` can be a the class to get the superclass, or a `map` #@ solidify:matter.consolidate_clusters,weak def consolidate_clusters(cl, m) - var cl_parent = (super(cl) != nil) ? super(cl).CLUSTERS : {} + var cl_parent + if cl == nil + cl_parent = {} + elif type(cl) == 'class' + cl_parent = (super(cl) != nil) ? super(cl).CLUSTERS : {} + elif type(cl) == 'instance' + cl_parent = cl + end var ret = {} # clone cl_parent for k: cl_parent.keys() diff --git a/lib/libesp32/berry_matter/src/embedded/Matter_Plugin_0.be b/lib/libesp32/berry_matter/src/embedded/Matter_Plugin_0.be index 2183fc09f..eaf1c6774 100644 --- a/lib/libesp32/berry_matter/src/embedded/Matter_Plugin_0.be +++ b/lib/libesp32/berry_matter/src/embedded/Matter_Plugin_0.be @@ -48,6 +48,7 @@ class Matter_Plugin # `FEATURE_MAPS` contains any non-zero value per cluster, if not present default to `0` static var FEATURE_MAPS = { # feature map per cluster 0x0031: 0x04, # Put Eth for now which should work for any on-network + # 0x0046: 0x04, # LITS: LongIdleTimeSupport 0x0102: 1 + 4, # Lift + PA_LF 0x0202: 2, # Fan: Auto } @@ -77,6 +78,7 @@ class Matter_Plugin # 0x0040: 1, # Initial Release # 0x0041: 1, # Initial Release # 0x0042: 1, # Initial Release + # 0x0046: 3, # ICD v3 # 0x005B: 1, # Initial Release # 0x005C: 1, # Initial Release 0x0101: 7, # Added support for European door locks (unbolt feature) @@ -283,20 +285,20 @@ matter_device.events.dump() return self.endpoint end def get_cluster_list_sorted() - return self.device.k2l(self.CLUSTERS) + return self.device.k2l(self.get_clusters()) end def contains_cluster(cluster) - return self.CLUSTERS.contains(cluster) + return self.get_clusters().contains(cluster) end # def get_attribute_list(cluster) # return self.clusters.find(cluster, []) # end # returns as a constant bytes of 16-bit ints, big endian def get_attribute_list_bytes(cluster) - return self.CLUSTERS.find(cluster, nil) + return self.get_clusters().find(cluster, nil) end def contains_attribute(cluster, attribute) - var attr_list = self.CLUSTERS.find(cluster) + var attr_list = self.get_clusters().find(cluster) # log(f"MTR: contains_attribute {cluster=} {attribute=} {attr_list=}") if attr_list != nil var idx = 0 diff --git a/lib/libesp32/berry_matter/src/embedded/Matter_Plugin_1_Root.be b/lib/libesp32/berry_matter/src/embedded/Matter_Plugin_1_Root.be index 21dd0851b..9e59d9e01 100644 --- a/lib/libesp32/berry_matter/src/embedded/Matter_Plugin_1_Root.be +++ b/lib/libesp32/berry_matter/src/embedded/Matter_Plugin_1_Root.be @@ -43,16 +43,42 @@ class Matter_Plugin_Root : Matter_Plugin 0x003E: [0,1,2,3,4,5], # Node Operational Credentials Cluster 11.17 p.704 0x003F: [] # Group Key Management Cluster 11.2 p.572 }) + # static var CLUSTERS_ICD = matter.consolidate_clusters(_class.CLUSTERS, { + # 0x0046: [0,1,2] # ICD Management Cluster + # }) static var TYPES = { 0x0016: 1 } # Root node + # # ICD options + # var icd_idle, icd_active, icd_threshold + ############################################################# # Constructor def init(device, endpoint, config) super(self).init(device, endpoint, config) + # # check if we have ICD parameters + # self.icd_idle = config.find("icd_idle", nil) + # if (self.icd_idle != nil) + # self.icd_active = config.find("icd_active", 5000) # default 5s + # self.icd_threshold = config.find("icd_threshold", 300) # default 300ms + # end + # publish mandatory events self.publish_event(0x0028, 0x00, matter.EVENT_CRITICAL, matter.TLV.Matter_TLV_item().set(matter.TLV.U4, tasmota.version())) # Event StartUp - Software Version self.publish_event(0x0033, 0x03, matter.EVENT_CRITICAL, matter.TLV.Matter_TLV_item().set(matter.TLV.U1, 1)) # Event BootReason - PowerOnReboot - TODO if we need to refine end + ############################################################# + # consolidate_clusters + # + # Build a consolidated map of all the `CLUSTERS` static vars + # from the inheritance hierarchy + # def get_clusters() + # if (self.icd_idle == nil) + # return self.CLUSTERS + # else + # return self.CLUSTERS_ICD + # end + # end + ############################################################# # read an attribute # @@ -323,6 +349,17 @@ class Matter_Plugin_Root : Matter_Plugin return pl end + # ==================================================================================================== + # elif cluster == 0x0046 # ========== ICD Management Cluster ========== + + # if attribute == 0x0000 # ---------- IdleModeDuration / uint32 (seconds) ---------- + # return tlv_solo.set_or_nil(TLV.U4, self.icd_idle) + # elif attribute == 0x0001 # ---------- ActiveModeDuration / uint32 (milliseconds) ---------- + # return tlv_solo.set_or_nil(TLV.U4, self.icd_active) + # elif attribute == 0x0002 # ---------- ActiveModeThreshold / uint16 (milliseconds) ---------- + # return tlv_solo.set_or_nil(TLV.U2, self.icd_threshold) + # end + end return super(self).read_attribute(session, ctx, tlv_solo) end diff --git a/lib/libesp32/berry_matter/src/embedded/Matter_z_Autoconf.be b/lib/libesp32/berry_matter/src/embedded/Matter_z_Autoconf.be index 0592669d2..42342633d 100644 --- a/lib/libesp32/berry_matter/src/embedded/Matter_z_Autoconf.be +++ b/lib/libesp32/berry_matter/src/embedded/Matter_z_Autoconf.be @@ -40,7 +40,7 @@ class Matter_Autoconf var plugins = self.device.plugins # start with mandatory endpoint 0 for root node - plugins.push(matter.Plugin_Root(self.device, 0, {})) + plugins.push(matter.Plugin_Root(self.device, 0, config.find("0", {}))) log("MTR: Configuring endpoints", 2) log(format("MTR: endpoint = %5i type:%s%s", 0, 'root', ''), 2) diff --git a/lib/libesp32/berry_matter/src/embedded/Matter_z_Commissioning.be b/lib/libesp32/berry_matter/src/embedded/Matter_z_Commissioning.be index 8225ff643..25df5e198 100644 --- a/lib/libesp32/berry_matter/src/embedded/Matter_z_Commissioning.be +++ b/lib/libesp32/berry_matter/src/embedded/Matter_z_Commissioning.be @@ -110,18 +110,7 @@ class Matter_Commissioning self.commissioning_L = L self.commissioning_admin_fabric = admin_fabric - if tasmota.wifi()['up'] || tasmota.eth()['up'] - self.mdns_announce_PASE() - else - tasmota.add_rule("Wifi#Connected", def () - self.mdns_announce_PASE() - tasmota.remove_rule("Wifi#Connected", "mdns_announce_PASE") - end, "mdns_announce_PASE") - tasmota.add_rule("Eth#Connected", def () - self.mdns_announce_PASE() - tasmota.remove_rule("Eth#Connected", "mdns_announce_PASE") - end, "mdns_announce_PASE") - end + tasmota.when_network_up(def () self.mdns_announce_PASE() end) end ############################################################# @@ -236,23 +225,16 @@ class Matter_Commissioning # When the announce is active, `hostname_wifi` and `hostname_eth` # are defined def start_mdns_announce_hostnames() - if tasmota.wifi()['up'] - self._mdns_announce_hostname(false) - else - tasmota.add_rule("Wifi#Connected", def () - self._mdns_announce_hostname(false) - tasmota.remove_rule("Wifi#Connected", "matter_mdns_host") - end, "matter_mdns_host") - end + tasmota.when_network_up(def () - if tasmota.eth()['up'] - self._mdns_announce_hostname(true) - else - tasmota.add_rule("Eth#Connected", def () - self._mdns_announce_hostname(true) - tasmota.remove_rule("Eth#Connected", "matter_mdns_host") - end, "matter_mdns_host") - end + if tasmota.wifi('up') + self._mdns_announce_hostname(false) + end + if tasmota.eth('up') + self._mdns_announce_hostname(true) + end + + end) end ############################################################# diff --git a/lib/libesp32/berry_matter/src/embedded/Matter_zz_Device.be b/lib/libesp32/berry_matter/src/embedded/Matter_zz_Device.be index da8e75270..1ff9f37d8 100644 --- a/lib/libesp32/berry_matter/src/embedded/Matter_zz_Device.be +++ b/lib/libesp32/berry_matter/src/embedded/Matter_zz_Device.be @@ -27,7 +27,7 @@ class Matter_Device static var PRODUCT_ID = 0x8000 static var FILENAME = "_matter_device.json" static var EP = 2 # first available endpoint number for devices - var started # is the Matter Device started (configured, mDNS and UDPServer started) + var started # is the Matter Device started (configured, mDNS and UDPServer started) - 'nil' means that we wait for Wifi to connect, 'false' means that the start is scheduled but not yet triggered var plugins # list of plugins instances var plugins_persist # true if plugins configuration needs to be saved static var plugins_classes = matter.plugins_classes # map of registered classes by type name @@ -68,7 +68,6 @@ class Matter_Device end # abort if SetOption 151 is not set matter.profiler = matter.Profiler() - self.started = false self.tick = 0 self.plugins = [] self.plugins_persist = false # plugins need to saved only when the first fabric is associated @@ -86,35 +85,22 @@ class Matter_Device self.zigbee = self.init_zigbee() self.ui = matter.UI(self, true) + tasmota.when_network_up(def () self.start() end) # start when network is connected self.commissioning.init_basic_commissioning() tasmota.add_driver(self) self.register_commands() end - ############################################################# - # Check if the network just started - def check_network() - if self.started return end # abort if already started - if tasmota.wifi()['up'] || tasmota.eth()['up'] - self.start() - end - end - - ############################################################# # Start Matter device server when the first network is coming up def start() - if self.started return end # abort if already started - # autoconfigure other plugins if needed self.autoconf_device() self._start_udp(self.UDP_PORT) self.commissioning.start_mdns_announce_hostnames() - - self.started = true end ##################################################################### @@ -251,7 +237,6 @@ class Matter_Device # dispatch every 50ms # ticks def every_50ms() - self.check_network() self.tick += 1 self.message_handler.every_50ms() end @@ -747,11 +732,7 @@ class Matter_Device var keys = [] for k: self.plugins_config.keys() keys.push(int(k)) end for ep: keys - if ep == 0 - log("MTR: invalid entry with ep '0'", 2) - self.plugins_config.remove(str(ep)) - dirty = true - elif ep == matter.AGGREGATOR_ENDPOINT + if ep == matter.AGGREGATOR_ENDPOINT dirty = true log(f"MTR: endpoint {ep} collides wit aggregator, relocating to {self.next_ep}", 2) self.plugins_config[str(self.next_ep)] = self.plugins_config[str(ep)] diff --git a/lib/libesp32/berry_matter/src/solidify/solidified_Matter_0_Inspect.h b/lib/libesp32/berry_matter/src/solidify/solidified_Matter_0_Inspect.h index e39e54d86..a3616701d 100644 --- a/lib/libesp32/berry_matter/src/solidify/solidified_Matter_0_Inspect.h +++ b/lib/libesp32/berry_matter/src/solidify/solidified_Matter_0_Inspect.h @@ -257,204 +257,227 @@ be_local_closure(module_matter_consolidate_clusters, /* name */ 0, /* has sup protos */ NULL, /* no sub protos */ 1, /* has constants */ - ( &(const bvalue[13]) { /* constants */ - /* K0 */ be_nested_str_weak(CLUSTERS), - /* K1 */ be_nested_str_weak(keys), - /* K2 */ be_const_int(2), - /* K3 */ be_const_int(0), - /* K4 */ be_nested_str_weak(push), - /* K5 */ be_nested_str_weak(get), - /* K6 */ be_const_int(1), - /* K7 */ be_nested_str_weak(stop_iteration), - /* K8 */ be_nested_str_weak(contains), - /* K9 */ be_nested_str_weak(find), - /* K10 */ be_nested_str_weak(matter), - /* K11 */ be_nested_str_weak(sort), - /* K12 */ be_nested_str_weak(add), + ( &(const bvalue[15]) { /* constants */ + /* K0 */ be_nested_str_weak(class), + /* K1 */ be_nested_str_weak(CLUSTERS), + /* K2 */ be_nested_str_weak(instance), + /* K3 */ be_nested_str_weak(keys), + /* K4 */ be_const_int(2), + /* K5 */ be_const_int(0), + /* K6 */ be_nested_str_weak(push), + /* K7 */ be_nested_str_weak(get), + /* K8 */ be_const_int(1), + /* K9 */ be_nested_str_weak(stop_iteration), + /* K10 */ be_nested_str_weak(contains), + /* K11 */ be_nested_str_weak(find), + /* K12 */ be_nested_str_weak(matter), + /* K13 */ be_nested_str_weak(sort), + /* K14 */ be_nested_str_weak(add), }), be_str_weak(consolidate_clusters), &be_const_str_solidified, - ( &(const binstruction[180]) { /* code */ - 0x60080003, // 0000 GETGBL R2 G3 - 0x5C0C0000, // 0001 MOVE R3 R0 - 0x7C080200, // 0002 CALL R2 1 - 0x4C0C0000, // 0003 LDNIL R3 - 0x20080403, // 0004 NE R2 R2 R3 - 0x780A0004, // 0005 JMPF R2 #000B - 0x60080003, // 0006 GETGBL R2 G3 - 0x5C0C0000, // 0007 MOVE R3 R0 - 0x7C080200, // 0008 CALL R2 1 - 0x88080500, // 0009 GETMBR R2 R2 K0 - 0x70020001, // 000A JMP #000D - 0x60080013, // 000B GETGBL R2 G19 - 0x7C080000, // 000C CALL R2 0 - 0x600C0013, // 000D GETGBL R3 G19 - 0x7C0C0000, // 000E CALL R3 0 - 0x60100010, // 000F GETGBL R4 G16 - 0x8C140501, // 0010 GETMET R5 R2 K1 - 0x7C140200, // 0011 CALL R5 1 - 0x7C100200, // 0012 CALL R4 1 - 0xA802001A, // 0013 EXBLK 0 #002F - 0x5C140800, // 0014 MOVE R5 R4 - 0x7C140000, // 0015 CALL R5 0 - 0x60180012, // 0016 GETGBL R6 G18 - 0x7C180000, // 0017 CALL R6 0 - 0x941C0405, // 0018 GETIDX R7 R2 R5 - 0x4C200000, // 0019 LDNIL R8 - 0x20200E08, // 001A NE R8 R7 R8 - 0x78220004, // 001B JMPF R8 #0021 - 0x6020000C, // 001C GETGBL R8 G12 - 0x5C240E00, // 001D MOVE R9 R7 - 0x7C200200, // 001E CALL R8 1 - 0x0C201102, // 001F DIV R8 R8 K2 - 0x70020000, // 0020 JMP #0022 - 0x58200003, // 0021 LDCONST R8 K3 - 0x58240003, // 0022 LDCONST R9 K3 - 0x14281208, // 0023 LT R10 R9 R8 - 0x782A0007, // 0024 JMPF R10 #002D - 0x8C280D04, // 0025 GETMET R10 R6 K4 - 0x8C300F05, // 0026 GETMET R12 R7 K5 - 0x08381302, // 0027 MUL R14 R9 K2 - 0x543DFFFD, // 0028 LDINT R15 -2 - 0x7C300600, // 0029 CALL R12 3 - 0x7C280400, // 002A CALL R10 2 - 0x00241306, // 002B ADD R9 R9 K6 - 0x7001FFF5, // 002C JMP #0023 - 0x980C0A06, // 002D SETIDX R3 R5 R6 - 0x7001FFE4, // 002E JMP #0014 - 0x58100007, // 002F LDCONST R4 K7 - 0xAC100200, // 0030 CATCH R4 1 0 - 0xB0080000, // 0031 RAISE 2 R0 R0 - 0x60100010, // 0032 GETGBL R4 G16 - 0x8C140301, // 0033 GETMET R5 R1 K1 - 0x7C140200, // 0034 CALL R5 1 - 0x7C100200, // 0035 CALL R4 1 - 0xA802001E, // 0036 EXBLK 0 #0056 - 0x5C140800, // 0037 MOVE R5 R4 - 0x7C140000, // 0038 CALL R5 0 - 0x8C180708, // 0039 GETMET R6 R3 K8 - 0x5C200A00, // 003A MOVE R8 R5 - 0x7C180400, // 003B CALL R6 2 - 0x741A0002, // 003C JMPT R6 #0040 - 0x60180012, // 003D GETGBL R6 G18 - 0x7C180000, // 003E CALL R6 0 - 0x980C0A06, // 003F SETIDX R3 R5 R6 - 0x60180010, // 0040 GETGBL R6 G16 - 0x941C0205, // 0041 GETIDX R7 R1 R5 - 0x7C180200, // 0042 CALL R6 1 - 0xA802000D, // 0043 EXBLK 0 #0052 - 0x5C1C0C00, // 0044 MOVE R7 R6 - 0x7C1C0000, // 0045 CALL R7 0 - 0x94200605, // 0046 GETIDX R8 R3 R5 - 0x8C201109, // 0047 GETMET R8 R8 K9 - 0x5C280E00, // 0048 MOVE R10 R7 - 0x7C200400, // 0049 CALL R8 2 - 0x4C240000, // 004A LDNIL R9 - 0x1C201009, // 004B EQ R8 R8 R9 - 0x78220003, // 004C JMPF R8 #0051 - 0x94200605, // 004D GETIDX R8 R3 R5 - 0x8C201104, // 004E GETMET R8 R8 K4 - 0x5C280E00, // 004F MOVE R10 R7 - 0x7C200400, // 0050 CALL R8 2 - 0x7001FFF1, // 0051 JMP #0044 - 0x58180007, // 0052 LDCONST R6 K7 - 0xAC180200, // 0053 CATCH R6 1 0 - 0xB0080000, // 0054 RAISE 2 R0 R0 - 0x7001FFE0, // 0055 JMP #0037 - 0x58100007, // 0056 LDCONST R4 K7 - 0xAC100200, // 0057 CATCH R4 1 0 - 0xB0080000, // 0058 RAISE 2 R0 R0 - 0x60100012, // 0059 GETGBL R4 G18 - 0x7C100000, // 005A CALL R4 0 - 0x5416FFF7, // 005B LDINT R5 65528 - 0x40140805, // 005C CONNECT R5 R4 R5 - 0x5416FFF8, // 005D LDINT R5 65529 - 0x40140805, // 005E CONNECT R5 R4 R5 - 0x5416FFF9, // 005F LDINT R5 65530 - 0x40140805, // 0060 CONNECT R5 R4 R5 - 0x5416FFFA, // 0061 LDINT R5 65531 - 0x40140805, // 0062 CONNECT R5 R4 R5 - 0x5416FFFB, // 0063 LDINT R5 65532 - 0x40140805, // 0064 CONNECT R5 R4 R5 - 0x5416FFFC, // 0065 LDINT R5 65533 - 0x40140805, // 0066 CONNECT R5 R4 R5 - 0x60140010, // 0067 GETGBL R5 G16 - 0x8C180301, // 0068 GETMET R6 R1 K1 - 0x7C180200, // 0069 CALL R6 1 - 0x7C140200, // 006A CALL R5 1 - 0xA8020017, // 006B EXBLK 0 #0084 - 0x5C180A00, // 006C MOVE R6 R5 - 0x7C180000, // 006D CALL R6 0 - 0x601C0010, // 006E GETGBL R7 G16 - 0x5C200800, // 006F MOVE R8 R4 - 0x7C1C0200, // 0070 CALL R7 1 - 0xA802000D, // 0071 EXBLK 0 #0080 - 0x5C200E00, // 0072 MOVE R8 R7 - 0x7C200000, // 0073 CALL R8 0 - 0x94240606, // 0074 GETIDX R9 R3 R6 - 0x8C241309, // 0075 GETMET R9 R9 K9 - 0x5C2C1000, // 0076 MOVE R11 R8 - 0x7C240400, // 0077 CALL R9 2 - 0x4C280000, // 0078 LDNIL R10 - 0x1C24120A, // 0079 EQ R9 R9 R10 - 0x78260003, // 007A JMPF R9 #007F - 0x94240606, // 007B GETIDX R9 R3 R6 - 0x8C241304, // 007C GETMET R9 R9 K4 - 0x5C2C1000, // 007D MOVE R11 R8 - 0x7C240400, // 007E CALL R9 2 - 0x7001FFF1, // 007F JMP #0072 - 0x581C0007, // 0080 LDCONST R7 K7 - 0xAC1C0200, // 0081 CATCH R7 1 0 - 0xB0080000, // 0082 RAISE 2 R0 R0 - 0x7001FFE7, // 0083 JMP #006C - 0x58140007, // 0084 LDCONST R5 K7 - 0xAC140200, // 0085 CATCH R5 1 0 - 0xB0080000, // 0086 RAISE 2 R0 R0 - 0x60140010, // 0087 GETGBL R5 G16 - 0x8C180701, // 0088 GETMET R6 R3 K1 - 0x7C180200, // 0089 CALL R6 1 - 0x7C140200, // 008A CALL R5 1 - 0xA8020008, // 008B EXBLK 0 #0095 - 0x5C180A00, // 008C MOVE R6 R5 - 0x7C180000, // 008D CALL R6 0 - 0x941C0606, // 008E GETIDX R7 R3 R6 - 0xB8221400, // 008F GETNGBL R8 K10 - 0x8C20110B, // 0090 GETMET R8 R8 K11 - 0x5C280E00, // 0091 MOVE R10 R7 - 0x7C200400, // 0092 CALL R8 2 - 0x980C0C08, // 0093 SETIDX R3 R6 R8 - 0x7001FFF6, // 0094 JMP #008C - 0x58140007, // 0095 LDCONST R5 K7 - 0xAC140200, // 0096 CATCH R5 1 0 + ( &(const binstruction[201]) { /* code */ + 0x4C080000, // 0000 LDNIL R2 + 0x4C0C0000, // 0001 LDNIL R3 + 0x1C0C0003, // 0002 EQ R3 R0 R3 + 0x780E0003, // 0003 JMPF R3 #0008 + 0x600C0013, // 0004 GETGBL R3 G19 + 0x7C0C0000, // 0005 CALL R3 0 + 0x5C080600, // 0006 MOVE R2 R3 + 0x70020019, // 0007 JMP #0022 + 0x600C0004, // 0008 GETGBL R3 G4 + 0x5C100000, // 0009 MOVE R4 R0 + 0x7C0C0200, // 000A CALL R3 1 + 0x1C0C0700, // 000B EQ R3 R3 K0 + 0x780E000E, // 000C JMPF R3 #001C + 0x600C0003, // 000D GETGBL R3 G3 + 0x5C100000, // 000E MOVE R4 R0 + 0x7C0C0200, // 000F CALL R3 1 + 0x4C100000, // 0010 LDNIL R4 + 0x200C0604, // 0011 NE R3 R3 R4 + 0x780E0004, // 0012 JMPF R3 #0018 + 0x600C0003, // 0013 GETGBL R3 G3 + 0x5C100000, // 0014 MOVE R4 R0 + 0x7C0C0200, // 0015 CALL R3 1 + 0x880C0701, // 0016 GETMBR R3 R3 K1 + 0x70020001, // 0017 JMP #001A + 0x600C0013, // 0018 GETGBL R3 G19 + 0x7C0C0000, // 0019 CALL R3 0 + 0x5C080600, // 001A MOVE R2 R3 + 0x70020005, // 001B JMP #0022 + 0x600C0004, // 001C GETGBL R3 G4 + 0x5C100000, // 001D MOVE R4 R0 + 0x7C0C0200, // 001E CALL R3 1 + 0x1C0C0702, // 001F EQ R3 R3 K2 + 0x780E0000, // 0020 JMPF R3 #0022 + 0x5C080000, // 0021 MOVE R2 R0 + 0x600C0013, // 0022 GETGBL R3 G19 + 0x7C0C0000, // 0023 CALL R3 0 + 0x60100010, // 0024 GETGBL R4 G16 + 0x8C140503, // 0025 GETMET R5 R2 K3 + 0x7C140200, // 0026 CALL R5 1 + 0x7C100200, // 0027 CALL R4 1 + 0xA802001A, // 0028 EXBLK 0 #0044 + 0x5C140800, // 0029 MOVE R5 R4 + 0x7C140000, // 002A CALL R5 0 + 0x60180012, // 002B GETGBL R6 G18 + 0x7C180000, // 002C CALL R6 0 + 0x941C0405, // 002D GETIDX R7 R2 R5 + 0x4C200000, // 002E LDNIL R8 + 0x20200E08, // 002F NE R8 R7 R8 + 0x78220004, // 0030 JMPF R8 #0036 + 0x6020000C, // 0031 GETGBL R8 G12 + 0x5C240E00, // 0032 MOVE R9 R7 + 0x7C200200, // 0033 CALL R8 1 + 0x0C201104, // 0034 DIV R8 R8 K4 + 0x70020000, // 0035 JMP #0037 + 0x58200005, // 0036 LDCONST R8 K5 + 0x58240005, // 0037 LDCONST R9 K5 + 0x14281208, // 0038 LT R10 R9 R8 + 0x782A0007, // 0039 JMPF R10 #0042 + 0x8C280D06, // 003A GETMET R10 R6 K6 + 0x8C300F07, // 003B GETMET R12 R7 K7 + 0x08381304, // 003C MUL R14 R9 K4 + 0x543DFFFD, // 003D LDINT R15 -2 + 0x7C300600, // 003E CALL R12 3 + 0x7C280400, // 003F CALL R10 2 + 0x00241308, // 0040 ADD R9 R9 K8 + 0x7001FFF5, // 0041 JMP #0038 + 0x980C0A06, // 0042 SETIDX R3 R5 R6 + 0x7001FFE4, // 0043 JMP #0029 + 0x58100009, // 0044 LDCONST R4 K9 + 0xAC100200, // 0045 CATCH R4 1 0 + 0xB0080000, // 0046 RAISE 2 R0 R0 + 0x60100010, // 0047 GETGBL R4 G16 + 0x8C140303, // 0048 GETMET R5 R1 K3 + 0x7C140200, // 0049 CALL R5 1 + 0x7C100200, // 004A CALL R4 1 + 0xA802001E, // 004B EXBLK 0 #006B + 0x5C140800, // 004C MOVE R5 R4 + 0x7C140000, // 004D CALL R5 0 + 0x8C18070A, // 004E GETMET R6 R3 K10 + 0x5C200A00, // 004F MOVE R8 R5 + 0x7C180400, // 0050 CALL R6 2 + 0x741A0002, // 0051 JMPT R6 #0055 + 0x60180012, // 0052 GETGBL R6 G18 + 0x7C180000, // 0053 CALL R6 0 + 0x980C0A06, // 0054 SETIDX R3 R5 R6 + 0x60180010, // 0055 GETGBL R6 G16 + 0x941C0205, // 0056 GETIDX R7 R1 R5 + 0x7C180200, // 0057 CALL R6 1 + 0xA802000D, // 0058 EXBLK 0 #0067 + 0x5C1C0C00, // 0059 MOVE R7 R6 + 0x7C1C0000, // 005A CALL R7 0 + 0x94200605, // 005B GETIDX R8 R3 R5 + 0x8C20110B, // 005C GETMET R8 R8 K11 + 0x5C280E00, // 005D MOVE R10 R7 + 0x7C200400, // 005E CALL R8 2 + 0x4C240000, // 005F LDNIL R9 + 0x1C201009, // 0060 EQ R8 R8 R9 + 0x78220003, // 0061 JMPF R8 #0066 + 0x94200605, // 0062 GETIDX R8 R3 R5 + 0x8C201106, // 0063 GETMET R8 R8 K6 + 0x5C280E00, // 0064 MOVE R10 R7 + 0x7C200400, // 0065 CALL R8 2 + 0x7001FFF1, // 0066 JMP #0059 + 0x58180009, // 0067 LDCONST R6 K9 + 0xAC180200, // 0068 CATCH R6 1 0 + 0xB0080000, // 0069 RAISE 2 R0 R0 + 0x7001FFE0, // 006A JMP #004C + 0x58100009, // 006B LDCONST R4 K9 + 0xAC100200, // 006C CATCH R4 1 0 + 0xB0080000, // 006D RAISE 2 R0 R0 + 0x60100012, // 006E GETGBL R4 G18 + 0x7C100000, // 006F CALL R4 0 + 0x5416FFF7, // 0070 LDINT R5 65528 + 0x40140805, // 0071 CONNECT R5 R4 R5 + 0x5416FFF8, // 0072 LDINT R5 65529 + 0x40140805, // 0073 CONNECT R5 R4 R5 + 0x5416FFF9, // 0074 LDINT R5 65530 + 0x40140805, // 0075 CONNECT R5 R4 R5 + 0x5416FFFA, // 0076 LDINT R5 65531 + 0x40140805, // 0077 CONNECT R5 R4 R5 + 0x5416FFFB, // 0078 LDINT R5 65532 + 0x40140805, // 0079 CONNECT R5 R4 R5 + 0x5416FFFC, // 007A LDINT R5 65533 + 0x40140805, // 007B CONNECT R5 R4 R5 + 0x60140010, // 007C GETGBL R5 G16 + 0x8C180303, // 007D GETMET R6 R1 K3 + 0x7C180200, // 007E CALL R6 1 + 0x7C140200, // 007F CALL R5 1 + 0xA8020017, // 0080 EXBLK 0 #0099 + 0x5C180A00, // 0081 MOVE R6 R5 + 0x7C180000, // 0082 CALL R6 0 + 0x601C0010, // 0083 GETGBL R7 G16 + 0x5C200800, // 0084 MOVE R8 R4 + 0x7C1C0200, // 0085 CALL R7 1 + 0xA802000D, // 0086 EXBLK 0 #0095 + 0x5C200E00, // 0087 MOVE R8 R7 + 0x7C200000, // 0088 CALL R8 0 + 0x94240606, // 0089 GETIDX R9 R3 R6 + 0x8C24130B, // 008A GETMET R9 R9 K11 + 0x5C2C1000, // 008B MOVE R11 R8 + 0x7C240400, // 008C CALL R9 2 + 0x4C280000, // 008D LDNIL R10 + 0x1C24120A, // 008E EQ R9 R9 R10 + 0x78260003, // 008F JMPF R9 #0094 + 0x94240606, // 0090 GETIDX R9 R3 R6 + 0x8C241306, // 0091 GETMET R9 R9 K6 + 0x5C2C1000, // 0092 MOVE R11 R8 + 0x7C240400, // 0093 CALL R9 2 + 0x7001FFF1, // 0094 JMP #0087 + 0x581C0009, // 0095 LDCONST R7 K9 + 0xAC1C0200, // 0096 CATCH R7 1 0 0xB0080000, // 0097 RAISE 2 R0 R0 - 0x60140010, // 0098 GETGBL R5 G16 - 0x8C180701, // 0099 GETMET R6 R3 K1 - 0x7C180200, // 009A CALL R6 1 - 0x7C140200, // 009B CALL R5 1 - 0xA8020012, // 009C EXBLK 0 #00B0 - 0x5C180A00, // 009D MOVE R6 R5 - 0x7C180000, // 009E CALL R6 0 - 0x941C0606, // 009F GETIDX R7 R3 R6 - 0x60200015, // 00A0 GETGBL R8 G21 - 0x7C200000, // 00A1 CALL R8 0 - 0x58240003, // 00A2 LDCONST R9 K3 - 0x6028000C, // 00A3 GETGBL R10 G12 - 0x5C2C0E00, // 00A4 MOVE R11 R7 - 0x7C280200, // 00A5 CALL R10 1 - 0x1428120A, // 00A6 LT R10 R9 R10 - 0x782A0005, // 00A7 JMPF R10 #00AE - 0x8C28110C, // 00A8 GETMET R10 R8 K12 - 0x94300E09, // 00A9 GETIDX R12 R7 R9 - 0x5435FFFD, // 00AA LDINT R13 -2 - 0x7C280600, // 00AB CALL R10 3 - 0x00241306, // 00AC ADD R9 R9 K6 - 0x7001FFF4, // 00AD JMP #00A3 - 0x980C0C08, // 00AE SETIDX R3 R6 R8 - 0x7001FFEC, // 00AF JMP #009D - 0x58140007, // 00B0 LDCONST R5 K7 - 0xAC140200, // 00B1 CATCH R5 1 0 - 0xB0080000, // 00B2 RAISE 2 R0 R0 - 0x80040600, // 00B3 RET 1 R3 + 0x7001FFE7, // 0098 JMP #0081 + 0x58140009, // 0099 LDCONST R5 K9 + 0xAC140200, // 009A CATCH R5 1 0 + 0xB0080000, // 009B RAISE 2 R0 R0 + 0x60140010, // 009C GETGBL R5 G16 + 0x8C180703, // 009D GETMET R6 R3 K3 + 0x7C180200, // 009E CALL R6 1 + 0x7C140200, // 009F CALL R5 1 + 0xA8020008, // 00A0 EXBLK 0 #00AA + 0x5C180A00, // 00A1 MOVE R6 R5 + 0x7C180000, // 00A2 CALL R6 0 + 0x941C0606, // 00A3 GETIDX R7 R3 R6 + 0xB8221800, // 00A4 GETNGBL R8 K12 + 0x8C20110D, // 00A5 GETMET R8 R8 K13 + 0x5C280E00, // 00A6 MOVE R10 R7 + 0x7C200400, // 00A7 CALL R8 2 + 0x980C0C08, // 00A8 SETIDX R3 R6 R8 + 0x7001FFF6, // 00A9 JMP #00A1 + 0x58140009, // 00AA LDCONST R5 K9 + 0xAC140200, // 00AB CATCH R5 1 0 + 0xB0080000, // 00AC RAISE 2 R0 R0 + 0x60140010, // 00AD GETGBL R5 G16 + 0x8C180703, // 00AE GETMET R6 R3 K3 + 0x7C180200, // 00AF CALL R6 1 + 0x7C140200, // 00B0 CALL R5 1 + 0xA8020012, // 00B1 EXBLK 0 #00C5 + 0x5C180A00, // 00B2 MOVE R6 R5 + 0x7C180000, // 00B3 CALL R6 0 + 0x941C0606, // 00B4 GETIDX R7 R3 R6 + 0x60200015, // 00B5 GETGBL R8 G21 + 0x7C200000, // 00B6 CALL R8 0 + 0x58240005, // 00B7 LDCONST R9 K5 + 0x6028000C, // 00B8 GETGBL R10 G12 + 0x5C2C0E00, // 00B9 MOVE R11 R7 + 0x7C280200, // 00BA CALL R10 1 + 0x1428120A, // 00BB LT R10 R9 R10 + 0x782A0005, // 00BC JMPF R10 #00C3 + 0x8C28110E, // 00BD GETMET R10 R8 K14 + 0x94300E09, // 00BE GETIDX R12 R7 R9 + 0x5435FFFD, // 00BF LDINT R13 -2 + 0x7C280600, // 00C0 CALL R10 3 + 0x00241308, // 00C1 ADD R9 R9 K8 + 0x7001FFF4, // 00C2 JMP #00B8 + 0x980C0C08, // 00C3 SETIDX R3 R6 R8 + 0x7001FFEC, // 00C4 JMP #00B2 + 0x58140009, // 00C5 LDCONST R5 K9 + 0xAC140200, // 00C6 CATCH R5 1 0 + 0xB0080000, // 00C7 RAISE 2 R0 R0 + 0x80040600, // 00C8 RET 1 R3 }) ) ); diff --git a/lib/libesp32/berry_matter/src/solidify/solidified_Matter_Plugin_0.h b/lib/libesp32/berry_matter/src/solidify/solidified_Matter_Plugin_0.h index 013f4df7c..d10fc3da8 100644 --- a/lib/libesp32/berry_matter/src/solidify/solidified_Matter_Plugin_0.h +++ b/lib/libesp32/berry_matter/src/solidify/solidified_Matter_Plugin_0.h @@ -4,8 +4,8 @@ \********************************************************************/ #include "be_constobj.h" extern const bclass be_class_Matter_Plugin; -// compact class 'Matter_Plugin' ktab size: 65, total: 108 (saved 344 bytes) -static const bvalue be_ktab_class_Matter_Plugin[65] = { +// compact class 'Matter_Plugin' ktab size: 66, total: 108 (saved 336 bytes) +static const bvalue be_ktab_class_Matter_Plugin[66] = { /* K0 */ be_nested_str_weak(json), /* K1 */ be_nested_str_weak(node_label), /* K2 */ be_nested_str_weak(_X2C_X22Name_X22_X3A_X25s), @@ -21,7 +21,7 @@ static const bvalue be_ktab_class_Matter_Plugin[65] = { /* K12 */ be_nested_str_weak(message_handler), /* K13 */ be_nested_str_weak(im), /* K14 */ be_nested_str_weak(send_ack_now), - /* K15 */ be_nested_str_weak(CLUSTERS), + /* K15 */ be_nested_str_weak(get_clusters), /* K16 */ be_nested_str_weak(find), /* K17 */ be_nested_str_weak(attribute_updated), /* K18 */ be_nested_str_weak(update_next), @@ -53,24 +53,25 @@ static const bvalue be_ktab_class_Matter_Plugin[65] = { /* K44 */ be_nested_str_weak(_X25s_X2C_X25s_X3A_X25s), /* K45 */ be_nested_str_weak(publish_command), /* K46 */ be_nested_str_weak(MtrReceived), - /* K47 */ be_nested_str_weak(contains), - /* K48 */ be_nested_str_weak(TLV), - /* K49 */ be_nested_str_weak(cluster), - /* K50 */ be_nested_str_weak(attribute), - /* K51 */ be_nested_str_weak(Matter_TLV_array), - /* K52 */ be_nested_str_weak(TYPES), - /* K53 */ be_nested_str_weak(keys), - /* K54 */ be_nested_str_weak(add_struct), - /* K55 */ be_nested_str_weak(add_TLV), - /* K56 */ be_nested_str_weak(U2), - /* K57 */ be_nested_str_weak(stop_iteration), - /* K58 */ be_nested_str_weak(get_cluster_list_sorted), - /* K59 */ be_nested_str_weak(U4), - /* K60 */ be_const_int(3), - /* K61 */ be_nested_str_weak(set), - /* K62 */ be_nested_str_weak(get_attribute_list_bytes), - /* K63 */ be_nested_str_weak(FEATURE_MAPS), - /* K64 */ be_nested_str_weak(CLUSTER_REVISIONS), + /* K47 */ be_nested_str_weak(CLUSTERS), + /* K48 */ be_nested_str_weak(contains), + /* K49 */ be_nested_str_weak(TLV), + /* K50 */ be_nested_str_weak(cluster), + /* K51 */ be_nested_str_weak(attribute), + /* K52 */ be_nested_str_weak(Matter_TLV_array), + /* K53 */ be_nested_str_weak(TYPES), + /* K54 */ be_nested_str_weak(keys), + /* K55 */ be_nested_str_weak(add_struct), + /* K56 */ be_nested_str_weak(add_TLV), + /* K57 */ be_nested_str_weak(U2), + /* K58 */ be_nested_str_weak(stop_iteration), + /* K59 */ be_nested_str_weak(get_cluster_list_sorted), + /* K60 */ be_nested_str_weak(U4), + /* K61 */ be_const_int(3), + /* K62 */ be_nested_str_weak(set), + /* K63 */ be_nested_str_weak(get_attribute_list_bytes), + /* K64 */ be_nested_str_weak(FEATURE_MAPS), + /* K65 */ be_nested_str_weak(CLUSTER_REVISIONS), }; @@ -210,13 +211,14 @@ be_local_closure(class_Matter_Plugin_get_attribute_list_bytes, /* name */ &be_ktab_class_Matter_Plugin, /* shared constants */ be_str_weak(get_attribute_list_bytes), &be_const_str_solidified, - ( &(const binstruction[ 6]) { /* code */ - 0x8808010F, // 0000 GETMBR R2 R0 K15 - 0x8C080510, // 0001 GETMET R2 R2 K16 - 0x5C100200, // 0002 MOVE R4 R1 - 0x4C140000, // 0003 LDNIL R5 - 0x7C080600, // 0004 CALL R2 3 - 0x80040400, // 0005 RET 1 R2 + ( &(const binstruction[ 7]) { /* code */ + 0x8C08010F, // 0000 GETMET R2 R0 K15 + 0x7C080200, // 0001 CALL R2 1 + 0x8C080510, // 0002 GETMET R2 R2 K16 + 0x5C100200, // 0003 MOVE R4 R1 + 0x4C140000, // 0004 LDNIL R5 + 0x7C080600, // 0005 CALL R2 3 + 0x80040400, // 0006 RET 1 R2 }) ) ); @@ -612,7 +614,7 @@ be_local_closure(class_Matter_Plugin_consolidate_update_commands, /* name */ ********************************************************************/ be_local_closure(class_Matter_Plugin_get_cluster_list_sorted, /* name */ be_nested_proto( - 4, /* nstack */ + 5, /* nstack */ 1, /* argc */ 10, /* varg */ 0, /* has upvals */ @@ -623,12 +625,13 @@ be_local_closure(class_Matter_Plugin_get_cluster_list_sorted, /* name */ &be_ktab_class_Matter_Plugin, /* shared constants */ be_str_weak(get_cluster_list_sorted), &be_const_str_solidified, - ( &(const binstruction[ 5]) { /* code */ + ( &(const binstruction[ 6]) { /* code */ 0x88040109, // 0000 GETMBR R1 R0 K9 0x8C040320, // 0001 GETMET R1 R1 K32 - 0x880C010F, // 0002 GETMBR R3 R0 K15 - 0x7C040400, // 0003 CALL R1 2 - 0x80040200, // 0004 RET 1 R1 + 0x8C0C010F, // 0002 GETMET R3 R0 K15 + 0x7C0C0200, // 0003 CALL R3 1 + 0x7C040400, // 0004 CALL R1 2 + 0x80040200, // 0005 RET 1 R1 }) ) ); @@ -820,33 +823,34 @@ be_local_closure(class_Matter_Plugin_contains_attribute, /* name */ &be_ktab_class_Matter_Plugin, /* shared constants */ be_str_weak(contains_attribute), &be_const_str_solidified, - ( &(const binstruction[26]) { /* code */ - 0x880C010F, // 0000 GETMBR R3 R0 K15 - 0x8C0C0710, // 0001 GETMET R3 R3 K16 - 0x5C140200, // 0002 MOVE R5 R1 - 0x7C0C0400, // 0003 CALL R3 2 - 0x4C100000, // 0004 LDNIL R4 - 0x20100604, // 0005 NE R4 R3 R4 - 0x78120010, // 0006 JMPF R4 #0018 - 0x58100023, // 0007 LDCONST R4 K35 - 0x6014000C, // 0008 GETGBL R5 G12 - 0x5C180600, // 0009 MOVE R6 R3 - 0x7C140200, // 000A CALL R5 1 - 0x0C140B24, // 000B DIV R5 R5 K36 - 0x14180805, // 000C LT R6 R4 R5 - 0x781A0009, // 000D JMPF R6 #0018 - 0x8C180725, // 000E GETMET R6 R3 K37 - 0x08200924, // 000F MUL R8 R4 K36 - 0x5425FFFD, // 0010 LDINT R9 -2 - 0x7C180600, // 0011 CALL R6 3 - 0x1C180C02, // 0012 EQ R6 R6 R2 - 0x781A0001, // 0013 JMPF R6 #0016 - 0x50180200, // 0014 LDBOOL R6 1 0 - 0x80040C00, // 0015 RET 1 R6 - 0x00100926, // 0016 ADD R4 R4 K38 - 0x7001FFF3, // 0017 JMP #000C - 0x50100000, // 0018 LDBOOL R4 0 0 - 0x80040800, // 0019 RET 1 R4 + ( &(const binstruction[27]) { /* code */ + 0x8C0C010F, // 0000 GETMET R3 R0 K15 + 0x7C0C0200, // 0001 CALL R3 1 + 0x8C0C0710, // 0002 GETMET R3 R3 K16 + 0x5C140200, // 0003 MOVE R5 R1 + 0x7C0C0400, // 0004 CALL R3 2 + 0x4C100000, // 0005 LDNIL R4 + 0x20100604, // 0006 NE R4 R3 R4 + 0x78120010, // 0007 JMPF R4 #0019 + 0x58100023, // 0008 LDCONST R4 K35 + 0x6014000C, // 0009 GETGBL R5 G12 + 0x5C180600, // 000A MOVE R6 R3 + 0x7C140200, // 000B CALL R5 1 + 0x0C140B24, // 000C DIV R5 R5 K36 + 0x14180805, // 000D LT R6 R4 R5 + 0x781A0009, // 000E JMPF R6 #0019 + 0x8C180725, // 000F GETMET R6 R3 K37 + 0x08200924, // 0010 MUL R8 R4 K36 + 0x5425FFFD, // 0011 LDINT R9 -2 + 0x7C180600, // 0012 CALL R6 3 + 0x1C180C02, // 0013 EQ R6 R6 R2 + 0x781A0001, // 0014 JMPF R6 #0017 + 0x50180200, // 0015 LDBOOL R6 1 0 + 0x80040C00, // 0016 RET 1 R6 + 0x00100926, // 0017 ADD R4 R4 K38 + 0x7001FFF3, // 0018 JMP #000D + 0x50100000, // 0019 LDBOOL R4 0 0 + 0x80040800, // 001A RET 1 R4 }) ) ); @@ -1086,7 +1090,7 @@ be_local_closure(class_Matter_Plugin_get_clusters, /* name */ be_str_weak(get_clusters), &be_const_str_solidified, ( &(const binstruction[ 2]) { /* code */ - 0x8804010F, // 0000 GETMBR R1 R0 K15 + 0x8804012F, // 0000 GETMBR R1 R0 K47 0x80040200, // 0001 RET 1 R1 }) ) @@ -1110,12 +1114,13 @@ be_local_closure(class_Matter_Plugin_contains_cluster, /* name */ &be_ktab_class_Matter_Plugin, /* shared constants */ be_str_weak(contains_cluster), &be_const_str_solidified, - ( &(const binstruction[ 5]) { /* code */ - 0x8808010F, // 0000 GETMBR R2 R0 K15 - 0x8C08052F, // 0001 GETMET R2 R2 K47 - 0x5C100200, // 0002 MOVE R4 R1 - 0x7C080400, // 0003 CALL R2 2 - 0x80040400, // 0004 RET 1 R2 + ( &(const binstruction[ 6]) { /* code */ + 0x8C08010F, // 0000 GETMET R2 R0 K15 + 0x7C080200, // 0001 CALL R2 1 + 0x8C080530, // 0002 GETMET R2 R2 K48 + 0x5C100200, // 0003 MOVE R4 R1 + 0x7C080400, // 0004 CALL R2 2 + 0x80040400, // 0005 RET 1 R2 }) ) ); @@ -1140,81 +1145,81 @@ be_local_closure(class_Matter_Plugin_read_attribute, /* name */ &be_const_str_solidified, ( &(const binstruction[169]) { /* code */ 0xB8122600, // 0000 GETNGBL R4 K19 - 0x88100930, // 0001 GETMBR R4 R4 K48 - 0x88140531, // 0002 GETMBR R5 R2 K49 - 0x88180532, // 0003 GETMBR R6 R2 K50 + 0x88100931, // 0001 GETMBR R4 R4 K49 + 0x88140532, // 0002 GETMBR R5 R2 K50 + 0x88180533, // 0003 GETMBR R6 R2 K51 0x541E001C, // 0004 LDINT R7 29 0x1C1C0A07, // 0005 EQ R7 R5 R7 0x781E0050, // 0006 JMPF R7 #0058 0x1C1C0D23, // 0007 EQ R7 R6 K35 0x781E001B, // 0008 JMPF R7 #0025 - 0x8C1C0933, // 0009 GETMET R7 R4 K51 + 0x8C1C0934, // 0009 GETMET R7 R4 K52 0x7C1C0200, // 000A CALL R7 1 - 0x88200134, // 000B GETMBR R8 R0 K52 + 0x88200135, // 000B GETMBR R8 R0 K53 0x60240010, // 000C GETGBL R9 G16 - 0x8C281135, // 000D GETMET R10 R8 K53 + 0x8C281136, // 000D GETMET R10 R8 K54 0x7C280200, // 000E CALL R10 1 0x7C240200, // 000F CALL R9 1 0xA802000E, // 0010 EXBLK 0 #0020 0x5C281200, // 0011 MOVE R10 R9 0x7C280000, // 0012 CALL R10 0 - 0x8C2C0F36, // 0013 GETMET R11 R7 K54 + 0x8C2C0F37, // 0013 GETMET R11 R7 K55 0x7C2C0200, // 0014 CALL R11 1 - 0x8C301737, // 0015 GETMET R12 R11 K55 + 0x8C301738, // 0015 GETMET R12 R11 K56 0x58380023, // 0016 LDCONST R14 K35 - 0x883C0938, // 0017 GETMBR R15 R4 K56 + 0x883C0939, // 0017 GETMBR R15 R4 K57 0x5C401400, // 0018 MOVE R16 R10 0x7C300800, // 0019 CALL R12 4 - 0x8C301737, // 001A GETMET R12 R11 K55 + 0x8C301738, // 001A GETMET R12 R11 K56 0x58380026, // 001B LDCONST R14 K38 - 0x883C0938, // 001C GETMBR R15 R4 K56 + 0x883C0939, // 001C GETMBR R15 R4 K57 0x9440100A, // 001D GETIDX R16 R8 R10 0x7C300800, // 001E CALL R12 4 0x7001FFF0, // 001F JMP #0011 - 0x58240039, // 0020 LDCONST R9 K57 + 0x5824003A, // 0020 LDCONST R9 K58 0xAC240200, // 0021 CATCH R9 1 0 0xB0080000, // 0022 RAISE 2 R0 R0 0x80040E00, // 0023 RET 1 R7 0x70020032, // 0024 JMP #0058 0x1C1C0D26, // 0025 EQ R7 R6 K38 0x781E0013, // 0026 JMPF R7 #003B - 0x8C1C0933, // 0027 GETMET R7 R4 K51 + 0x8C1C0934, // 0027 GETMET R7 R4 K52 0x7C1C0200, // 0028 CALL R7 1 0x60200010, // 0029 GETGBL R8 G16 - 0x8C24013A, // 002A GETMET R9 R0 K58 + 0x8C24013B, // 002A GETMET R9 R0 K59 0x7C240200, // 002B CALL R9 1 0x7C200200, // 002C CALL R8 1 0xA8020007, // 002D EXBLK 0 #0036 0x5C241000, // 002E MOVE R9 R8 0x7C240000, // 002F CALL R9 0 - 0x8C280F37, // 0030 GETMET R10 R7 K55 + 0x8C280F38, // 0030 GETMET R10 R7 K56 0x4C300000, // 0031 LDNIL R12 - 0x8834093B, // 0032 GETMBR R13 R4 K59 + 0x8834093C, // 0032 GETMBR R13 R4 K60 0x5C381200, // 0033 MOVE R14 R9 0x7C280800, // 0034 CALL R10 4 0x7001FFF7, // 0035 JMP #002E - 0x58200039, // 0036 LDCONST R8 K57 + 0x5820003A, // 0036 LDCONST R8 K58 0xAC200200, // 0037 CATCH R8 1 0 0xB0080000, // 0038 RAISE 2 R0 R0 0x80040E00, // 0039 RET 1 R7 0x7002001C, // 003A JMP #0058 0x1C1C0D24, // 003B EQ R7 R6 K36 0x781E0003, // 003C JMPF R7 #0041 - 0x8C1C0933, // 003D GETMET R7 R4 K51 + 0x8C1C0934, // 003D GETMET R7 R4 K52 0x7C1C0200, // 003E CALL R7 1 0x80040E00, // 003F RET 1 R7 0x70020016, // 0040 JMP #0058 - 0x1C1C0D3C, // 0041 EQ R7 R6 K60 + 0x1C1C0D3D, // 0041 EQ R7 R6 K61 0x781E0003, // 0042 JMPF R7 #0047 - 0x8C1C0933, // 0043 GETMET R7 R4 K51 + 0x8C1C0934, // 0043 GETMET R7 R4 K52 0x7C1C0200, // 0044 CALL R7 1 0x80040E00, // 0045 RET 1 R7 0x70020010, // 0046 JMP #0058 0x541EFFFB, // 0047 LDINT R7 65532 0x1C1C0C07, // 0048 EQ R7 R6 R7 0x781E0005, // 0049 JMPF R7 #0050 - 0x8C1C073D, // 004A GETMET R7 R3 K61 - 0x8824093B, // 004B GETMBR R9 R4 K59 + 0x8C1C073E, // 004A GETMET R7 R3 K62 + 0x8824093C, // 004B GETMBR R9 R4 K60 0x58280023, // 004C LDCONST R10 K35 0x7C1C0600, // 004D CALL R7 3 0x80040E00, // 004E RET 1 R7 @@ -1222,24 +1227,24 @@ be_local_closure(class_Matter_Plugin_read_attribute, /* name */ 0x541EFFFC, // 0050 LDINT R7 65533 0x1C1C0C07, // 0051 EQ R7 R6 R7 0x781E0004, // 0052 JMPF R7 #0058 - 0x8C1C073D, // 0053 GETMET R7 R3 K61 - 0x8824093B, // 0054 GETMBR R9 R4 K59 + 0x8C1C073E, // 0053 GETMET R7 R3 K62 + 0x8824093C, // 0054 GETMBR R9 R4 K60 0x58280026, // 0055 LDCONST R10 K38 0x7C1C0600, // 0056 CALL R7 3 0x80040E00, // 0057 RET 1 R7 0x541EFFF7, // 0058 LDINT R7 65528 0x1C1C0C07, // 0059 EQ R7 R6 R7 0x781E0003, // 005A JMPF R7 #005F - 0x8C1C0933, // 005B GETMET R7 R4 K51 + 0x8C1C0934, // 005B GETMET R7 R4 K52 0x7C1C0200, // 005C CALL R7 1 0x80040E00, // 005D RET 1 R7 0x70020047, // 005E JMP #00A7 0x541EFFFA, // 005F LDINT R7 65531 0x1C1C0C07, // 0060 EQ R7 R6 R7 0x781E001B, // 0061 JMPF R7 #007E - 0x8C1C0933, // 0062 GETMET R7 R4 K51 + 0x8C1C0934, // 0062 GETMET R7 R4 K52 0x7C1C0200, // 0063 CALL R7 1 - 0x8C20013E, // 0064 GETMET R8 R0 K62 + 0x8C20013F, // 0064 GETMET R8 R0 K63 0x5C280A00, // 0065 MOVE R10 R5 0x7C200400, // 0066 CALL R8 2 0x4C240000, // 0067 LDNIL R9 @@ -1253,9 +1258,9 @@ be_local_closure(class_Matter_Plugin_read_attribute, /* name */ 0x58280023, // 006F LDCONST R10 K35 0x142C1409, // 0070 LT R11 R10 R9 0x782E0009, // 0071 JMPF R11 #007C - 0x8C2C0F37, // 0072 GETMET R11 R7 K55 + 0x8C2C0F38, // 0072 GETMET R11 R7 K56 0x4C340000, // 0073 LDNIL R13 - 0x88380938, // 0074 GETMBR R14 R4 K56 + 0x88380939, // 0074 GETMBR R14 R4 K57 0x8C3C1125, // 0075 GETMET R15 R8 K37 0x08441524, // 0076 MUL R17 R10 K36 0x5449FFFD, // 0077 LDINT R18 -2 @@ -1268,27 +1273,27 @@ be_local_closure(class_Matter_Plugin_read_attribute, /* name */ 0x541EFFF9, // 007E LDINT R7 65530 0x1C1C0C07, // 007F EQ R7 R6 R7 0x781E0003, // 0080 JMPF R7 #0085 - 0x8C1C0933, // 0081 GETMET R7 R4 K51 + 0x8C1C0934, // 0081 GETMET R7 R4 K52 0x7C1C0200, // 0082 CALL R7 1 0x80040E00, // 0083 RET 1 R7 0x70020021, // 0084 JMP #00A7 0x541EFFF8, // 0085 LDINT R7 65529 0x1C1C0C07, // 0086 EQ R7 R6 R7 0x781E0003, // 0087 JMPF R7 #008C - 0x8C1C0933, // 0088 GETMET R7 R4 K51 + 0x8C1C0934, // 0088 GETMET R7 R4 K52 0x7C1C0200, // 0089 CALL R7 1 0x80040E00, // 008A RET 1 R7 0x7002001A, // 008B JMP #00A7 0x541EFFFB, // 008C LDINT R7 65532 0x1C1C0C07, // 008D EQ R7 R6 R7 0x781E000A, // 008E JMPF R7 #009A - 0x881C013F, // 008F GETMBR R7 R0 K63 + 0x881C0140, // 008F GETMBR R7 R0 K64 0x8C1C0F10, // 0090 GETMET R7 R7 K16 0x5C240A00, // 0091 MOVE R9 R5 0x58280023, // 0092 LDCONST R10 K35 0x7C1C0600, // 0093 CALL R7 3 - 0x8C20073D, // 0094 GETMET R8 R3 K61 - 0x8828093B, // 0095 GETMBR R10 R4 K59 + 0x8C20073E, // 0094 GETMET R8 R3 K62 + 0x8828093C, // 0095 GETMBR R10 R4 K60 0x5C2C0E00, // 0096 MOVE R11 R7 0x7C200600, // 0097 CALL R8 3 0x80041000, // 0098 RET 1 R8 @@ -1296,13 +1301,13 @@ be_local_closure(class_Matter_Plugin_read_attribute, /* name */ 0x541EFFFC, // 009A LDINT R7 65533 0x1C1C0C07, // 009B EQ R7 R6 R7 0x781E0009, // 009C JMPF R7 #00A7 - 0x881C0140, // 009D GETMBR R7 R0 K64 + 0x881C0141, // 009D GETMBR R7 R0 K65 0x8C1C0F10, // 009E GETMET R7 R7 K16 0x5C240A00, // 009F MOVE R9 R5 0x58280026, // 00A0 LDCONST R10 K38 0x7C1C0600, // 00A1 CALL R7 3 - 0x8C20073D, // 00A2 GETMET R8 R3 K61 - 0x8828093B, // 00A3 GETMBR R10 R4 K59 + 0x8C20073E, // 00A2 GETMET R8 R3 K62 + 0x8828093C, // 00A3 GETMBR R10 R4 K60 0x5C2C0E00, // 00A4 MOVE R11 R7 0x7C200600, // 00A5 CALL R8 3 0x80041000, // 00A6 RET 1 R8 diff --git a/lib/libesp32/berry_matter/src/solidify/solidified_Matter_z_Autoconf.h b/lib/libesp32/berry_matter/src/solidify/solidified_Matter_z_Autoconf.h index 74081e32f..6096e3550 100644 --- a/lib/libesp32/berry_matter/src/solidify/solidified_Matter_z_Autoconf.h +++ b/lib/libesp32/berry_matter/src/solidify/solidified_Matter_z_Autoconf.h @@ -3,8 +3,8 @@ * Generated code, don't edit * \********************************************************************/ #include "be_constobj.h" -// compact class 'Matter_Autoconf' ktab size: 73, total: 90 (saved 136 bytes) -static const bvalue be_ktab_class_Matter_Autoconf[73] = { +// compact class 'Matter_Autoconf' ktab size: 74, total: 91 (saved 136 bytes) +static const bvalue be_ktab_class_Matter_Autoconf[74] = { /* K0 */ be_nested_str_weak(device), /* K1 */ be_nested_str_weak(k2l_num), /* K2 */ be_nested_str_weak(plugins), @@ -12,72 +12,73 @@ static const bvalue be_ktab_class_Matter_Autoconf[73] = { /* K4 */ be_nested_str_weak(matter), /* K5 */ be_nested_str_weak(Plugin_Root), /* K6 */ be_const_int(0), - /* K7 */ be_nested_str_weak(log), - /* K8 */ be_nested_str_weak(MTR_X3A_X20Configuring_X20endpoints), - /* K9 */ be_const_int(2), - /* K10 */ be_nested_str_weak(MTR_X3A_X20_X20_X20endpoint_X20_X3D_X20_X255i_X20type_X3A_X25s_X25s), - /* K11 */ be_nested_str_weak(root), - /* K12 */ be_nested_str_weak(), - /* K13 */ be_nested_str_weak(Plugin_Aggregator), - /* K14 */ be_nested_str_weak(AGGREGATOR_ENDPOINT), - /* K15 */ be_nested_str_weak(aggregator), - /* K16 */ be_nested_str_weak(find), - /* K17 */ be_nested_str_weak(type), - /* K18 */ be_nested_str_weak(MTR_X3A_X20no_X20class_X20name_X2C_X20skipping), - /* K19 */ be_const_int(3), - /* K20 */ be_nested_str_weak(MTR_X3A_X20only_X20one_X20root_X20node_X20allowed), - /* K21 */ be_nested_str_weak(plugins_classes), - /* K22 */ be_nested_str_weak(MTR_X3A_X20unknown_X20class_X20name_X20_X27), - /* K23 */ be_nested_str_weak(_X27_X20skipping), - /* K24 */ be_nested_str_weak(conf_to_log), - /* K25 */ be_nested_str_weak(MTR_X3A_X20Exception), - /* K26 */ be_nested_str_weak(_X7C), - /* K27 */ be_nested_str_weak(stop_iteration), - /* K28 */ be_nested_str_weak(tasmota), - /* K29 */ be_nested_str_weak(publish_result), - /* K30 */ be_nested_str_weak(_X7B_X22Matter_X22_X3A_X7B_X22Initialized_X22_X3A1_X7D_X7D), - /* K31 */ be_nested_str_weak(Matter), - /* K32 */ be_nested_str_weak(json), - /* K33 */ be_nested_str_weak(START_ENDPOINT), - /* K34 */ be_nested_str_weak(light), - /* K35 */ be_nested_str_weak(get), - /* K36 */ be_nested_str_weak(channels), - /* K37 */ be_const_int(1), - /* K38 */ be_nested_str_weak(light1), - /* K39 */ be_nested_str_weak(light2), - /* K40 */ be_nested_str_weak(light3), - /* K41 */ be_nested_str_weak(cmd), - /* K42 */ be_nested_str_weak(Status_X2013), - /* K43 */ be_nested_str_weak(MTR_X3A_X20Status_X2013_X20_X3D_X20), - /* K44 */ be_nested_str_weak(contains), - /* K45 */ be_nested_str_weak(StatusSHT), - /* K46 */ be_nested_str_weak(SHT), - /* K47 */ be_nested_str_weak(MTR_X3A_X20_X27_X25s_X27_X20_X3D_X20_X25s), - /* K48 */ be_nested_str_weak(Relay1), - /* K49 */ be_nested_str_weak(Relay2), - /* K50 */ be_nested_str_weak(MTR_X3A_X20relay1_X3D_X25s_X20relay2_X3D_X25s), - /* K51 */ be_nested_str_weak(TiltConfig), - /* K52 */ be_nested_str_weak(shutter_X2Btilt), - /* K53 */ be_nested_str_weak(shutter), - /* K54 */ be_nested_str_weak(get_power), - /* K55 */ be_nested_str_weak(relay), - /* K56 */ be_nested_str_weak(load), - /* K57 */ be_nested_str_weak(read_sensors), - /* K58 */ be_nested_str_weak(autoconf_sensors_list), - /* K59 */ be_nested_str_weak(k2l), - /* K60 */ be_nested_str_weak(Temperature), - /* K61 */ be_nested_str_weak(_X23Temperature), - /* K62 */ be_nested_str_weak(temperature), - /* K63 */ be_nested_str_weak(filter), - /* K64 */ be_nested_str_weak(Pressure), - /* K65 */ be_nested_str_weak(_X23Pressure), - /* K66 */ be_nested_str_weak(pressure), - /* K67 */ be_nested_str_weak(Illuminance), - /* K68 */ be_nested_str_weak(_X23Illuminance), - /* K69 */ be_nested_str_weak(illuminance), - /* K70 */ be_nested_str_weak(Humidity), - /* K71 */ be_nested_str_weak(_X23Humidity), - /* K72 */ be_nested_str_weak(humidity), + /* K7 */ be_nested_str_weak(find), + /* K8 */ be_nested_str_weak(0), + /* K9 */ be_nested_str_weak(log), + /* K10 */ be_nested_str_weak(MTR_X3A_X20Configuring_X20endpoints), + /* K11 */ be_const_int(2), + /* K12 */ be_nested_str_weak(MTR_X3A_X20_X20_X20endpoint_X20_X3D_X20_X255i_X20type_X3A_X25s_X25s), + /* K13 */ be_nested_str_weak(root), + /* K14 */ be_nested_str_weak(), + /* K15 */ be_nested_str_weak(Plugin_Aggregator), + /* K16 */ be_nested_str_weak(AGGREGATOR_ENDPOINT), + /* K17 */ be_nested_str_weak(aggregator), + /* K18 */ be_nested_str_weak(type), + /* K19 */ be_nested_str_weak(MTR_X3A_X20no_X20class_X20name_X2C_X20skipping), + /* K20 */ be_const_int(3), + /* K21 */ be_nested_str_weak(MTR_X3A_X20only_X20one_X20root_X20node_X20allowed), + /* K22 */ be_nested_str_weak(plugins_classes), + /* K23 */ be_nested_str_weak(MTR_X3A_X20unknown_X20class_X20name_X20_X27), + /* K24 */ be_nested_str_weak(_X27_X20skipping), + /* K25 */ be_nested_str_weak(conf_to_log), + /* K26 */ be_nested_str_weak(MTR_X3A_X20Exception), + /* K27 */ be_nested_str_weak(_X7C), + /* K28 */ be_nested_str_weak(stop_iteration), + /* K29 */ be_nested_str_weak(tasmota), + /* K30 */ be_nested_str_weak(publish_result), + /* K31 */ be_nested_str_weak(_X7B_X22Matter_X22_X3A_X7B_X22Initialized_X22_X3A1_X7D_X7D), + /* K32 */ be_nested_str_weak(Matter), + /* K33 */ be_nested_str_weak(json), + /* K34 */ be_nested_str_weak(START_ENDPOINT), + /* K35 */ be_nested_str_weak(light), + /* K36 */ be_nested_str_weak(get), + /* K37 */ be_nested_str_weak(channels), + /* K38 */ be_const_int(1), + /* K39 */ be_nested_str_weak(light1), + /* K40 */ be_nested_str_weak(light2), + /* K41 */ be_nested_str_weak(light3), + /* K42 */ be_nested_str_weak(cmd), + /* K43 */ be_nested_str_weak(Status_X2013), + /* K44 */ be_nested_str_weak(MTR_X3A_X20Status_X2013_X20_X3D_X20), + /* K45 */ be_nested_str_weak(contains), + /* K46 */ be_nested_str_weak(StatusSHT), + /* K47 */ be_nested_str_weak(SHT), + /* K48 */ be_nested_str_weak(MTR_X3A_X20_X27_X25s_X27_X20_X3D_X20_X25s), + /* K49 */ be_nested_str_weak(Relay1), + /* K50 */ be_nested_str_weak(Relay2), + /* K51 */ be_nested_str_weak(MTR_X3A_X20relay1_X3D_X25s_X20relay2_X3D_X25s), + /* K52 */ be_nested_str_weak(TiltConfig), + /* K53 */ be_nested_str_weak(shutter_X2Btilt), + /* K54 */ be_nested_str_weak(shutter), + /* K55 */ be_nested_str_weak(get_power), + /* K56 */ be_nested_str_weak(relay), + /* K57 */ be_nested_str_weak(load), + /* K58 */ be_nested_str_weak(read_sensors), + /* K59 */ be_nested_str_weak(autoconf_sensors_list), + /* K60 */ be_nested_str_weak(k2l), + /* K61 */ be_nested_str_weak(Temperature), + /* K62 */ be_nested_str_weak(_X23Temperature), + /* K63 */ be_nested_str_weak(temperature), + /* K64 */ be_nested_str_weak(filter), + /* K65 */ be_nested_str_weak(Pressure), + /* K66 */ be_nested_str_weak(_X23Pressure), + /* K67 */ be_nested_str_weak(pressure), + /* K68 */ be_nested_str_weak(Illuminance), + /* K69 */ be_nested_str_weak(_X23Illuminance), + /* K70 */ be_nested_str_weak(illuminance), + /* K71 */ be_nested_str_weak(Humidity), + /* K72 */ be_nested_str_weak(_X23Humidity), + /* K73 */ be_nested_str_weak(humidity), }; @@ -99,7 +100,7 @@ be_local_closure(class_Matter_Autoconf_instantiate_plugins_from_config, /* nam &be_ktab_class_Matter_Autoconf, /* shared constants */ be_str_weak(instantiate_plugins_from_config), &be_const_str_solidified, - ( &(const binstruction[148]) { /* code */ + ( &(const binstruction[151]) { /* code */ 0x88080100, // 0000 GETMBR R2 R0 K0 0x8C080501, // 0001 GETMET R2 R2 K1 0x5C100200, // 0002 MOVE R4 R1 @@ -111,143 +112,146 @@ be_local_closure(class_Matter_Autoconf_instantiate_plugins_from_config, /* nam 0x8C180D05, // 0008 GETMET R6 R6 K5 0x88200100, // 0009 GETMBR R8 R0 K0 0x58240006, // 000A LDCONST R9 K6 - 0x60280013, // 000B GETGBL R10 G19 - 0x7C280000, // 000C CALL R10 0 - 0x7C180800, // 000D CALL R6 4 - 0x7C100400, // 000E CALL R4 2 - 0xB8120E00, // 000F GETNGBL R4 K7 - 0x58140008, // 0010 LDCONST R5 K8 - 0x58180009, // 0011 LDCONST R6 K9 - 0x7C100400, // 0012 CALL R4 2 - 0xB8120E00, // 0013 GETNGBL R4 K7 - 0x60140018, // 0014 GETGBL R5 G24 - 0x5818000A, // 0015 LDCONST R6 K10 - 0x581C0006, // 0016 LDCONST R7 K6 - 0x5820000B, // 0017 LDCONST R8 K11 - 0x5824000C, // 0018 LDCONST R9 K12 - 0x7C140800, // 0019 CALL R5 4 - 0x58180009, // 001A LDCONST R6 K9 - 0x7C100400, // 001B CALL R4 2 - 0x8C100703, // 001C GETMET R4 R3 K3 - 0xB81A0800, // 001D GETNGBL R6 K4 - 0x8C180D0D, // 001E GETMET R6 R6 K13 - 0x88200100, // 001F GETMBR R8 R0 K0 - 0xB8260800, // 0020 GETNGBL R9 K4 - 0x8824130E, // 0021 GETMBR R9 R9 K14 - 0x60280013, // 0022 GETGBL R10 G19 - 0x7C280000, // 0023 CALL R10 0 - 0x7C180800, // 0024 CALL R6 4 - 0x7C100400, // 0025 CALL R4 2 - 0xB8120E00, // 0026 GETNGBL R4 K7 - 0x60140018, // 0027 GETGBL R5 G24 - 0x5818000A, // 0028 LDCONST R6 K10 - 0xB81E0800, // 0029 GETNGBL R7 K4 - 0x881C0F0E, // 002A GETMBR R7 R7 K14 - 0x5820000F, // 002B LDCONST R8 K15 - 0x5824000C, // 002C LDCONST R9 K12 - 0x7C140800, // 002D CALL R5 4 - 0x58180009, // 002E LDCONST R6 K9 - 0x7C100400, // 002F CALL R4 2 - 0x60100010, // 0030 GETGBL R4 G16 - 0x5C140400, // 0031 MOVE R5 R2 - 0x7C100200, // 0032 CALL R4 1 - 0xA8020056, // 0033 EXBLK 0 #008B - 0x5C140800, // 0034 MOVE R5 R4 - 0x7C140000, // 0035 CALL R5 0 - 0x1C180B06, // 0036 EQ R6 R5 K6 - 0x781A0000, // 0037 JMPF R6 #0039 - 0x7001FFFA, // 0038 JMP #0034 - 0xA802003F, // 0039 EXBLK 0 #007A - 0x60180008, // 003A GETGBL R6 G8 - 0x5C1C0A00, // 003B MOVE R7 R5 - 0x7C180200, // 003C CALL R6 1 - 0x94180206, // 003D GETIDX R6 R1 R6 - 0x8C1C0D10, // 003E GETMET R7 R6 K16 - 0x58240011, // 003F LDCONST R9 K17 - 0x7C1C0400, // 0040 CALL R7 2 - 0x4C200000, // 0041 LDNIL R8 - 0x1C200E08, // 0042 EQ R8 R7 R8 - 0x78220005, // 0043 JMPF R8 #004A - 0xB8220E00, // 0044 GETNGBL R8 K7 - 0x58240012, // 0045 LDCONST R9 K18 - 0x58280013, // 0046 LDCONST R10 K19 - 0x7C200400, // 0047 CALL R8 2 - 0xA8040001, // 0048 EXBLK 1 1 - 0x7001FFE9, // 0049 JMP #0034 - 0x1C200F0B, // 004A EQ R8 R7 K11 - 0x78220005, // 004B JMPF R8 #0052 - 0xB8220E00, // 004C GETNGBL R8 K7 - 0x58240014, // 004D LDCONST R9 K20 - 0x58280013, // 004E LDCONST R10 K19 - 0x7C200400, // 004F CALL R8 2 - 0xA8040001, // 0050 EXBLK 1 1 - 0x7001FFE1, // 0051 JMP #0034 - 0x88200100, // 0052 GETMBR R8 R0 K0 - 0x88201115, // 0053 GETMBR R8 R8 K21 - 0x8C201110, // 0054 GETMET R8 R8 K16 - 0x5C280E00, // 0055 MOVE R10 R7 - 0x7C200400, // 0056 CALL R8 2 - 0x4C240000, // 0057 LDNIL R9 - 0x1C241009, // 0058 EQ R9 R8 R9 - 0x78260009, // 0059 JMPF R9 #0064 - 0xB8260E00, // 005A GETNGBL R9 K7 - 0x60280008, // 005B GETGBL R10 G8 - 0x5C2C0E00, // 005C MOVE R11 R7 - 0x7C280200, // 005D CALL R10 1 - 0x002A2C0A, // 005E ADD R10 K22 R10 - 0x00281517, // 005F ADD R10 R10 K23 - 0x582C0009, // 0060 LDCONST R11 K9 - 0x7C240400, // 0061 CALL R9 2 - 0xA8040001, // 0062 EXBLK 1 1 - 0x7001FFCF, // 0063 JMP #0034 - 0x5C241000, // 0064 MOVE R9 R8 - 0x88280100, // 0065 GETMBR R10 R0 K0 - 0x5C2C0A00, // 0066 MOVE R11 R5 - 0x5C300C00, // 0067 MOVE R12 R6 - 0x7C240600, // 0068 CALL R9 3 - 0x8C280703, // 0069 GETMET R10 R3 K3 - 0x5C301200, // 006A MOVE R12 R9 - 0x7C280400, // 006B CALL R10 2 - 0xB82A0E00, // 006C GETNGBL R10 K7 - 0x602C0018, // 006D GETGBL R11 G24 - 0x5830000A, // 006E LDCONST R12 K10 - 0x5C340A00, // 006F MOVE R13 R5 - 0x5C380E00, // 0070 MOVE R14 R7 - 0x883C0100, // 0071 GETMBR R15 R0 K0 - 0x8C3C1F18, // 0072 GETMET R15 R15 K24 - 0x5C440C00, // 0073 MOVE R17 R6 - 0x7C3C0400, // 0074 CALL R15 2 - 0x7C2C0800, // 0075 CALL R11 4 - 0x58300009, // 0076 LDCONST R12 K9 - 0x7C280400, // 0077 CALL R10 2 - 0xA8040001, // 0078 EXBLK 1 1 - 0x7002000F, // 0079 JMP #008A - 0xAC180002, // 007A CATCH R6 0 2 - 0x7002000C, // 007B JMP #0089 - 0xB8220E00, // 007C GETNGBL R8 K7 - 0x60240008, // 007D GETGBL R9 G8 - 0x5C280C00, // 007E MOVE R10 R6 - 0x7C240200, // 007F CALL R9 1 - 0x00263209, // 0080 ADD R9 K25 R9 - 0x0024131A, // 0081 ADD R9 R9 K26 - 0x60280008, // 0082 GETGBL R10 G8 - 0x5C2C0E00, // 0083 MOVE R11 R7 - 0x7C280200, // 0084 CALL R10 1 - 0x0024120A, // 0085 ADD R9 R9 R10 - 0x58280009, // 0086 LDCONST R10 K9 - 0x7C200400, // 0087 CALL R8 2 - 0x70020000, // 0088 JMP #008A - 0xB0080000, // 0089 RAISE 2 R0 R0 - 0x7001FFA8, // 008A JMP #0034 - 0x5810001B, // 008B LDCONST R4 K27 - 0xAC100200, // 008C CATCH R4 1 0 - 0xB0080000, // 008D RAISE 2 R0 R0 - 0xB8123800, // 008E GETNGBL R4 K28 - 0x8C10091D, // 008F GETMET R4 R4 K29 - 0x5818001E, // 0090 LDCONST R6 K30 - 0x581C001F, // 0091 LDCONST R7 K31 - 0x7C100600, // 0092 CALL R4 3 - 0x80000000, // 0093 RET 0 + 0x8C280307, // 000B GETMET R10 R1 K7 + 0x58300008, // 000C LDCONST R12 K8 + 0x60340013, // 000D GETGBL R13 G19 + 0x7C340000, // 000E CALL R13 0 + 0x7C280600, // 000F CALL R10 3 + 0x7C180800, // 0010 CALL R6 4 + 0x7C100400, // 0011 CALL R4 2 + 0xB8121200, // 0012 GETNGBL R4 K9 + 0x5814000A, // 0013 LDCONST R5 K10 + 0x5818000B, // 0014 LDCONST R6 K11 + 0x7C100400, // 0015 CALL R4 2 + 0xB8121200, // 0016 GETNGBL R4 K9 + 0x60140018, // 0017 GETGBL R5 G24 + 0x5818000C, // 0018 LDCONST R6 K12 + 0x581C0006, // 0019 LDCONST R7 K6 + 0x5820000D, // 001A LDCONST R8 K13 + 0x5824000E, // 001B LDCONST R9 K14 + 0x7C140800, // 001C CALL R5 4 + 0x5818000B, // 001D LDCONST R6 K11 + 0x7C100400, // 001E CALL R4 2 + 0x8C100703, // 001F GETMET R4 R3 K3 + 0xB81A0800, // 0020 GETNGBL R6 K4 + 0x8C180D0F, // 0021 GETMET R6 R6 K15 + 0x88200100, // 0022 GETMBR R8 R0 K0 + 0xB8260800, // 0023 GETNGBL R9 K4 + 0x88241310, // 0024 GETMBR R9 R9 K16 + 0x60280013, // 0025 GETGBL R10 G19 + 0x7C280000, // 0026 CALL R10 0 + 0x7C180800, // 0027 CALL R6 4 + 0x7C100400, // 0028 CALL R4 2 + 0xB8121200, // 0029 GETNGBL R4 K9 + 0x60140018, // 002A GETGBL R5 G24 + 0x5818000C, // 002B LDCONST R6 K12 + 0xB81E0800, // 002C GETNGBL R7 K4 + 0x881C0F10, // 002D GETMBR R7 R7 K16 + 0x58200011, // 002E LDCONST R8 K17 + 0x5824000E, // 002F LDCONST R9 K14 + 0x7C140800, // 0030 CALL R5 4 + 0x5818000B, // 0031 LDCONST R6 K11 + 0x7C100400, // 0032 CALL R4 2 + 0x60100010, // 0033 GETGBL R4 G16 + 0x5C140400, // 0034 MOVE R5 R2 + 0x7C100200, // 0035 CALL R4 1 + 0xA8020056, // 0036 EXBLK 0 #008E + 0x5C140800, // 0037 MOVE R5 R4 + 0x7C140000, // 0038 CALL R5 0 + 0x1C180B06, // 0039 EQ R6 R5 K6 + 0x781A0000, // 003A JMPF R6 #003C + 0x7001FFFA, // 003B JMP #0037 + 0xA802003F, // 003C EXBLK 0 #007D + 0x60180008, // 003D GETGBL R6 G8 + 0x5C1C0A00, // 003E MOVE R7 R5 + 0x7C180200, // 003F CALL R6 1 + 0x94180206, // 0040 GETIDX R6 R1 R6 + 0x8C1C0D07, // 0041 GETMET R7 R6 K7 + 0x58240012, // 0042 LDCONST R9 K18 + 0x7C1C0400, // 0043 CALL R7 2 + 0x4C200000, // 0044 LDNIL R8 + 0x1C200E08, // 0045 EQ R8 R7 R8 + 0x78220005, // 0046 JMPF R8 #004D + 0xB8221200, // 0047 GETNGBL R8 K9 + 0x58240013, // 0048 LDCONST R9 K19 + 0x58280014, // 0049 LDCONST R10 K20 + 0x7C200400, // 004A CALL R8 2 + 0xA8040001, // 004B EXBLK 1 1 + 0x7001FFE9, // 004C JMP #0037 + 0x1C200F0D, // 004D EQ R8 R7 K13 + 0x78220005, // 004E JMPF R8 #0055 + 0xB8221200, // 004F GETNGBL R8 K9 + 0x58240015, // 0050 LDCONST R9 K21 + 0x58280014, // 0051 LDCONST R10 K20 + 0x7C200400, // 0052 CALL R8 2 + 0xA8040001, // 0053 EXBLK 1 1 + 0x7001FFE1, // 0054 JMP #0037 + 0x88200100, // 0055 GETMBR R8 R0 K0 + 0x88201116, // 0056 GETMBR R8 R8 K22 + 0x8C201107, // 0057 GETMET R8 R8 K7 + 0x5C280E00, // 0058 MOVE R10 R7 + 0x7C200400, // 0059 CALL R8 2 + 0x4C240000, // 005A LDNIL R9 + 0x1C241009, // 005B EQ R9 R8 R9 + 0x78260009, // 005C JMPF R9 #0067 + 0xB8261200, // 005D GETNGBL R9 K9 + 0x60280008, // 005E GETGBL R10 G8 + 0x5C2C0E00, // 005F MOVE R11 R7 + 0x7C280200, // 0060 CALL R10 1 + 0x002A2E0A, // 0061 ADD R10 K23 R10 + 0x00281518, // 0062 ADD R10 R10 K24 + 0x582C000B, // 0063 LDCONST R11 K11 + 0x7C240400, // 0064 CALL R9 2 + 0xA8040001, // 0065 EXBLK 1 1 + 0x7001FFCF, // 0066 JMP #0037 + 0x5C241000, // 0067 MOVE R9 R8 + 0x88280100, // 0068 GETMBR R10 R0 K0 + 0x5C2C0A00, // 0069 MOVE R11 R5 + 0x5C300C00, // 006A MOVE R12 R6 + 0x7C240600, // 006B CALL R9 3 + 0x8C280703, // 006C GETMET R10 R3 K3 + 0x5C301200, // 006D MOVE R12 R9 + 0x7C280400, // 006E CALL R10 2 + 0xB82A1200, // 006F GETNGBL R10 K9 + 0x602C0018, // 0070 GETGBL R11 G24 + 0x5830000C, // 0071 LDCONST R12 K12 + 0x5C340A00, // 0072 MOVE R13 R5 + 0x5C380E00, // 0073 MOVE R14 R7 + 0x883C0100, // 0074 GETMBR R15 R0 K0 + 0x8C3C1F19, // 0075 GETMET R15 R15 K25 + 0x5C440C00, // 0076 MOVE R17 R6 + 0x7C3C0400, // 0077 CALL R15 2 + 0x7C2C0800, // 0078 CALL R11 4 + 0x5830000B, // 0079 LDCONST R12 K11 + 0x7C280400, // 007A CALL R10 2 + 0xA8040001, // 007B EXBLK 1 1 + 0x7002000F, // 007C JMP #008D + 0xAC180002, // 007D CATCH R6 0 2 + 0x7002000C, // 007E JMP #008C + 0xB8221200, // 007F GETNGBL R8 K9 + 0x60240008, // 0080 GETGBL R9 G8 + 0x5C280C00, // 0081 MOVE R10 R6 + 0x7C240200, // 0082 CALL R9 1 + 0x00263409, // 0083 ADD R9 K26 R9 + 0x0024131B, // 0084 ADD R9 R9 K27 + 0x60280008, // 0085 GETGBL R10 G8 + 0x5C2C0E00, // 0086 MOVE R11 R7 + 0x7C280200, // 0087 CALL R10 1 + 0x0024120A, // 0088 ADD R9 R9 R10 + 0x5828000B, // 0089 LDCONST R10 K11 + 0x7C200400, // 008A CALL R8 2 + 0x70020000, // 008B JMP #008D + 0xB0080000, // 008C RAISE 2 R0 R0 + 0x7001FFA8, // 008D JMP #0037 + 0x5810001C, // 008E LDCONST R4 K28 + 0xAC100200, // 008F CATCH R4 1 0 + 0xB0080000, // 0090 RAISE 2 R0 R0 + 0xB8123A00, // 0091 GETNGBL R4 K29 + 0x8C10091E, // 0092 GETMET R4 R4 K30 + 0x5818001F, // 0093 LDCONST R6 K31 + 0x581C0020, // 0094 LDCONST R7 K32 + 0x7C100600, // 0095 CALL R4 3 + 0x80000000, // 0096 RET 0 }) ) ); @@ -271,41 +275,41 @@ be_local_closure(class_Matter_Autoconf_autoconf_device_map, /* name */ be_str_weak(autoconf_device_map), &be_const_str_solidified, ( &(const binstruction[262]) { /* code */ - 0xA4064000, // 0000 IMPORT R1 K32 + 0xA4064200, // 0000 IMPORT R1 K33 0x60080013, // 0001 GETGBL R2 G19 0x7C080000, // 0002 CALL R2 0 0xB80E0800, // 0003 GETNGBL R3 K4 - 0x880C0721, // 0004 GETMBR R3 R3 K33 + 0x880C0722, // 0004 GETMBR R3 R3 K34 0x58100006, // 0005 LDCONST R4 K6 - 0xA4164400, // 0006 IMPORT R5 K34 - 0x8C180B23, // 0007 GETMET R6 R5 K35 + 0xA4164600, // 0006 IMPORT R5 K35 + 0x8C180B24, // 0007 GETMET R6 R5 K36 0x58200006, // 0008 LDCONST R8 K6 0x7C180400, // 0009 CALL R6 2 0x4C1C0000, // 000A LDNIL R7 0x201C0C07, // 000B NE R7 R6 R7 0x781E0066, // 000C JMPF R7 #0074 0x601C000C, // 000D GETGBL R7 G12 - 0x8C200D10, // 000E GETMET R8 R6 K16 - 0x58280024, // 000F LDCONST R10 K36 - 0x582C000C, // 0010 LDCONST R11 K12 + 0x8C200D07, // 000E GETMET R8 R6 K7 + 0x58280025, // 000F LDCONST R10 K37 + 0x582C000E, // 0010 LDCONST R11 K14 0x7C200600, // 0011 CALL R8 3 0x7C1C0200, // 0012 CALL R7 1 - 0x58100025, // 0013 LDCONST R4 K37 + 0x58100026, // 0013 LDCONST R4 K38 0x24200F06, // 0014 GT R8 R7 K6 0x7822005D, // 0015 JMPF R8 #0074 - 0x1C200F25, // 0016 EQ R8 R7 K37 + 0x1C200F26, // 0016 EQ R8 R7 K38 0x7822001E, // 0017 JMPF R8 #0037 0x60200008, // 0018 GETGBL R8 G8 0x5C240600, // 0019 MOVE R9 R3 0x7C200200, // 001A CALL R8 1 0x60240013, // 001B GETGBL R9 G19 0x7C240000, // 001C CALL R9 0 - 0x98262326, // 001D SETIDX R9 K17 K38 + 0x98262527, // 001D SETIDX R9 K18 K39 0x98081009, // 001E SETIDX R2 R8 R9 - 0x000C0725, // 001F ADD R3 R3 K37 - 0x58200025, // 0020 LDCONST R8 K37 + 0x000C0726, // 001F ADD R3 R3 K38 + 0x58200026, // 0020 LDCONST R8 K38 0x4C240000, // 0021 LDNIL R9 - 0x8C280B23, // 0022 GETMET R10 R5 K35 + 0x8C280B24, // 0022 GETMET R10 R5 K36 0x5C301000, // 0023 MOVE R12 R8 0x7C280400, // 0024 CALL R10 2 0x5C241400, // 0025 MOVE R9 R10 @@ -317,152 +321,152 @@ be_local_closure(class_Matter_Autoconf_autoconf_device_map, /* name */ 0x7C280200, // 002B CALL R10 1 0x602C0013, // 002C GETGBL R11 G19 0x7C2C0000, // 002D CALL R11 0 - 0x982E2326, // 002E SETIDX R11 K17 K38 - 0x00301125, // 002F ADD R12 R8 K37 - 0x982E440C, // 0030 SETIDX R11 K34 R12 + 0x982E2527, // 002E SETIDX R11 K18 K39 + 0x00301126, // 002F ADD R12 R8 K38 + 0x982E460C, // 0030 SETIDX R11 K35 R12 0x9808140B, // 0031 SETIDX R2 R10 R11 - 0x000C0725, // 0032 ADD R3 R3 K37 - 0x00100925, // 0033 ADD R4 R4 K37 - 0x00201125, // 0034 ADD R8 R8 K37 + 0x000C0726, // 0032 ADD R3 R3 K38 + 0x00100926, // 0033 ADD R4 R4 K38 + 0x00201126, // 0034 ADD R8 R8 K38 0x7001FFEB, // 0035 JMP #0022 0x7002003C, // 0036 JMP #0074 - 0x1C200F09, // 0037 EQ R8 R7 K9 + 0x1C200F0B, // 0037 EQ R8 R7 K11 0x78220008, // 0038 JMPF R8 #0042 0x60200008, // 0039 GETGBL R8 G8 0x5C240600, // 003A MOVE R9 R3 0x7C200200, // 003B CALL R8 1 0x60240013, // 003C GETGBL R9 G19 0x7C240000, // 003D CALL R9 0 - 0x98262327, // 003E SETIDX R9 K17 K39 + 0x98262528, // 003E SETIDX R9 K18 K40 0x98081009, // 003F SETIDX R2 R8 R9 - 0x000C0725, // 0040 ADD R3 R3 K37 + 0x000C0726, // 0040 ADD R3 R3 K38 0x70020031, // 0041 JMP #0074 - 0x1C200F13, // 0042 EQ R8 R7 K19 + 0x1C200F14, // 0042 EQ R8 R7 K20 0x7822002B, // 0043 JMPF R8 #0070 0x60200008, // 0044 GETGBL R8 G8 0x5C240600, // 0045 MOVE R9 R3 0x7C200200, // 0046 CALL R8 1 0x60240013, // 0047 GETGBL R9 G19 0x7C240000, // 0048 CALL R9 0 - 0x98262328, // 0049 SETIDX R9 K17 K40 + 0x98262529, // 0049 SETIDX R9 K18 K41 0x98081009, // 004A SETIDX R2 R8 R9 - 0x000C0725, // 004B ADD R3 R3 K37 - 0x8C200B23, // 004C GETMET R8 R5 K35 - 0x58280025, // 004D LDCONST R10 K37 + 0x000C0726, // 004B ADD R3 R3 K38 + 0x8C200B24, // 004C GETMET R8 R5 K36 + 0x58280026, // 004D LDCONST R10 K38 0x7C200400, // 004E CALL R8 2 0x4C240000, // 004F LDNIL R9 0x20241009, // 0050 NE R9 R8 R9 0x7826001C, // 0051 JMPF R9 #006F 0x6024000C, // 0052 GETGBL R9 G12 - 0x8C281110, // 0053 GETMET R10 R8 K16 - 0x58300024, // 0054 LDCONST R12 K36 - 0x5834000C, // 0055 LDCONST R13 K12 + 0x8C281107, // 0053 GETMET R10 R8 K7 + 0x58300025, // 0054 LDCONST R12 K37 + 0x5834000E, // 0055 LDCONST R13 K14 0x7C280600, // 0056 CALL R10 3 0x7C240200, // 0057 CALL R9 1 - 0x1C281325, // 0058 EQ R10 R9 K37 + 0x1C281326, // 0058 EQ R10 R9 K38 0x782A0009, // 0059 JMPF R10 #0064 0x60280008, // 005A GETGBL R10 G8 0x5C2C0600, // 005B MOVE R11 R3 0x7C280200, // 005C CALL R10 1 0x602C0013, // 005D GETGBL R11 G19 0x7C2C0000, // 005E CALL R11 0 - 0x982E2326, // 005F SETIDX R11 K17 K38 + 0x982E2527, // 005F SETIDX R11 K18 K39 0x9808140B, // 0060 SETIDX R2 R10 R11 - 0x000C0725, // 0061 ADD R3 R3 K37 - 0x00100925, // 0062 ADD R4 R4 K37 + 0x000C0726, // 0061 ADD R3 R3 K38 + 0x00100926, // 0062 ADD R4 R4 K38 0x7002000A, // 0063 JMP #006F - 0x1C281309, // 0064 EQ R10 R9 K9 + 0x1C28130B, // 0064 EQ R10 R9 K11 0x782A0008, // 0065 JMPF R10 #006F 0x60280008, // 0066 GETGBL R10 G8 0x5C2C0600, // 0067 MOVE R11 R3 0x7C280200, // 0068 CALL R10 1 0x602C0013, // 0069 GETGBL R11 G19 0x7C2C0000, // 006A CALL R11 0 - 0x982E2327, // 006B SETIDX R11 K17 K39 + 0x982E2528, // 006B SETIDX R11 K18 K40 0x9808140B, // 006C SETIDX R2 R10 R11 - 0x000C0725, // 006D ADD R3 R3 K37 - 0x00100925, // 006E ADD R4 R4 K37 + 0x000C0726, // 006D ADD R3 R3 K38 + 0x00100926, // 006E ADD R4 R4 K38 0x70020003, // 006F JMP #0074 0x54220003, // 0070 LDINT R8 4 0x1C200E08, // 0071 EQ R8 R7 R8 0x78220000, // 0072 JMPF R8 #0074 0x7001FFFF, // 0073 JMP #0074 - 0xB81E3800, // 0074 GETNGBL R7 K28 - 0x8C1C0F29, // 0075 GETMET R7 R7 K41 - 0x5824002A, // 0076 LDCONST R9 K42 + 0xB81E3A00, // 0074 GETNGBL R7 K29 + 0x8C1C0F2A, // 0075 GETMET R7 R7 K42 + 0x5824002B, // 0076 LDCONST R9 K43 0x50280200, // 0077 LDBOOL R10 1 0 0x7C1C0600, // 0078 CALL R7 3 0x60200012, // 0079 GETGBL R8 G18 0x7C200000, // 007A CALL R8 0 - 0xB8260E00, // 007B GETNGBL R9 K7 + 0xB8261200, // 007B GETNGBL R9 K9 0x60280008, // 007C GETGBL R10 G8 0x5C2C0E00, // 007D MOVE R11 R7 0x7C280200, // 007E CALL R10 1 - 0x002A560A, // 007F ADD R10 K43 R10 - 0x582C0013, // 0080 LDCONST R11 K19 + 0x002A580A, // 007F ADD R10 K44 R10 + 0x582C0014, // 0080 LDCONST R11 K20 0x7C240400, // 0081 CALL R9 2 0x4C240000, // 0082 LDNIL R9 0x20240E09, // 0083 NE R9 R7 R9 0x7826004D, // 0084 JMPF R9 #00D3 - 0x8C240F2C, // 0085 GETMET R9 R7 K44 - 0x582C002D, // 0086 LDCONST R11 K45 + 0x8C240F2D, // 0085 GETMET R9 R7 K45 + 0x582C002E, // 0086 LDCONST R11 K46 0x7C240400, // 0087 CALL R9 2 0x78260049, // 0088 JMPF R9 #00D3 - 0x941C0F2D, // 0089 GETIDX R7 R7 K45 + 0x941C0F2E, // 0089 GETIDX R7 R7 K46 0x58240006, // 008A LDCONST R9 K6 0x50280200, // 008B LDBOOL R10 1 0 0x782A0045, // 008C JMPF R10 #00D3 0x60280008, // 008D GETGBL R10 G8 0x5C2C1200, // 008E MOVE R11 R9 0x7C280200, // 008F CALL R10 1 - 0x002A5C0A, // 0090 ADD R10 K46 R10 - 0x8C2C0F2C, // 0091 GETMET R11 R7 K44 + 0x002A5E0A, // 0090 ADD R10 K47 R10 + 0x8C2C0F2D, // 0091 GETMET R11 R7 K45 0x5C341400, // 0092 MOVE R13 R10 0x7C2C0400, // 0093 CALL R11 2 0x742E0000, // 0094 JMPT R11 #0096 0x7002003C, // 0095 JMP #00D3 0x942C0E0A, // 0096 GETIDX R11 R7 R10 - 0xB8320E00, // 0097 GETNGBL R12 K7 + 0xB8321200, // 0097 GETNGBL R12 K9 0x60340018, // 0098 GETGBL R13 G24 - 0x5838002F, // 0099 LDCONST R14 K47 + 0x58380030, // 0099 LDCONST R14 K48 0x5C3C1400, // 009A MOVE R15 R10 0x60400008, // 009B GETGBL R16 G8 0x5C441600, // 009C MOVE R17 R11 0x7C400200, // 009D CALL R16 1 0x7C340600, // 009E CALL R13 3 - 0x58380013, // 009F LDCONST R14 K19 + 0x58380014, // 009F LDCONST R14 K20 0x7C300400, // 00A0 CALL R12 2 - 0x8C301710, // 00A1 GETMET R12 R11 K16 - 0x58380030, // 00A2 LDCONST R14 K48 + 0x8C301707, // 00A1 GETMET R12 R11 K7 + 0x58380031, // 00A2 LDCONST R14 K49 0x543DFFFE, // 00A3 LDINT R15 -1 0x7C300600, // 00A4 CALL R12 3 - 0x8C341710, // 00A5 GETMET R13 R11 K16 - 0x583C0031, // 00A6 LDCONST R15 K49 + 0x8C341707, // 00A5 GETMET R13 R11 K7 + 0x583C0032, // 00A6 LDCONST R15 K50 0x5441FFFE, // 00A7 LDINT R16 -1 0x7C340600, // 00A8 CALL R13 3 0x24381906, // 00A9 GT R14 R12 K6 0x783A0002, // 00AA JMPF R14 #00AE 0x8C381103, // 00AB GETMET R14 R8 K3 - 0x04401925, // 00AC SUB R16 R12 K37 + 0x04401926, // 00AC SUB R16 R12 K38 0x7C380400, // 00AD CALL R14 2 0x24381B06, // 00AE GT R14 R13 K6 0x783A0002, // 00AF JMPF R14 #00B3 0x8C381103, // 00B0 GETMET R14 R8 K3 - 0x04401B25, // 00B1 SUB R16 R13 K37 + 0x04401B26, // 00B1 SUB R16 R13 K38 0x7C380400, // 00B2 CALL R14 2 - 0xB83A0E00, // 00B3 GETNGBL R14 K7 + 0xB83A1200, // 00B3 GETNGBL R14 K9 0x603C0018, // 00B4 GETGBL R15 G24 - 0x58400032, // 00B5 LDCONST R16 K50 + 0x58400033, // 00B5 LDCONST R16 K51 0x5C441800, // 00B6 MOVE R17 R12 0x5C481A00, // 00B7 MOVE R18 R13 0x7C3C0600, // 00B8 CALL R15 3 - 0x58400013, // 00B9 LDCONST R16 K19 + 0x58400014, // 00B9 LDCONST R16 K20 0x7C380400, // 00BA CALL R14 2 - 0x8C381710, // 00BB GETMET R14 R11 K16 - 0x58400033, // 00BC LDCONST R16 K51 + 0x8C381707, // 00BB GETMET R14 R11 K7 + 0x58400034, // 00BC LDCONST R16 K52 0x7C380400, // 00BD CALL R14 2 0x783A0002, // 00BE JMPF R14 #00C2 - 0x943C1D09, // 00BF GETIDX R15 R14 K9 + 0x943C1D0B, // 00BF GETIDX R15 R14 K11 0x243C1F06, // 00C0 GT R15 R15 K6 0x743E0000, // 00C1 JMPT R15 #00C3 0x503C0001, // 00C2 LDBOOL R15 0 1 @@ -473,25 +477,25 @@ be_local_closure(class_Matter_Autoconf_autoconf_device_map, /* name */ 0x60440013, // 00C7 GETGBL R17 G19 0x7C440000, // 00C8 CALL R17 0 0x783E0001, // 00C9 JMPF R15 #00CC - 0x58480034, // 00CA LDCONST R18 K52 + 0x58480035, // 00CA LDCONST R18 K53 0x70020000, // 00CB JMP #00CD - 0x58480035, // 00CC LDCONST R18 K53 - 0x98462212, // 00CD SETIDX R17 K17 R18 - 0x98466A09, // 00CE SETIDX R17 K53 R9 + 0x58480036, // 00CC LDCONST R18 K54 + 0x98462412, // 00CD SETIDX R17 K18 R18 + 0x98466C09, // 00CE SETIDX R17 K54 R9 0x98082011, // 00CF SETIDX R2 R16 R17 - 0x000C0725, // 00D0 ADD R3 R3 K37 - 0x00241325, // 00D1 ADD R9 R9 K37 + 0x000C0726, // 00D0 ADD R3 R3 K38 + 0x00241326, // 00D1 ADD R9 R9 K38 0x7001FFB7, // 00D2 JMP #008B 0x6024000C, // 00D3 GETGBL R9 G12 - 0xB82A3800, // 00D4 GETNGBL R10 K28 - 0x8C281536, // 00D5 GETMET R10 R10 K54 + 0xB82A3A00, // 00D4 GETNGBL R10 K29 + 0x8C281537, // 00D5 GETMET R10 R10 K55 0x7C280200, // 00D6 CALL R10 1 0x7C240200, // 00D7 CALL R9 1 0x58280006, // 00D8 LDCONST R10 K6 0x04241204, // 00D9 SUB R9 R9 R4 0x142C1409, // 00DA LT R11 R10 R9 0x782E0011, // 00DB JMPF R11 #00EE - 0x8C2C1110, // 00DC GETMET R11 R8 K16 + 0x8C2C1107, // 00DC GETMET R11 R8 K7 0x5C341400, // 00DD MOVE R13 R10 0x7C2C0400, // 00DE CALL R11 2 0x4C300000, // 00DF LDNIL R12 @@ -502,19 +506,19 @@ be_local_closure(class_Matter_Autoconf_autoconf_device_map, /* name */ 0x7C2C0200, // 00E4 CALL R11 1 0x60300013, // 00E5 GETGBL R12 G19 0x7C300000, // 00E6 CALL R12 0 - 0x98322337, // 00E7 SETIDX R12 K17 K55 - 0x00341525, // 00E8 ADD R13 R10 K37 - 0x98326E0D, // 00E9 SETIDX R12 K55 R13 + 0x98322538, // 00E7 SETIDX R12 K18 K56 + 0x00341526, // 00E8 ADD R13 R10 K38 + 0x9832700D, // 00E9 SETIDX R12 K56 R13 0x9808160C, // 00EA SETIDX R2 R11 R12 - 0x000C0725, // 00EB ADD R3 R3 K37 - 0x00281525, // 00EC ADD R10 R10 K37 + 0x000C0726, // 00EB ADD R3 R3 K38 + 0x00281526, // 00EC ADD R10 R10 K38 0x7001FFEB, // 00ED JMP #00DA - 0x8C2C0338, // 00EE GETMET R11 R1 K56 - 0xB8363800, // 00EF GETNGBL R13 K28 - 0x8C341B39, // 00F0 GETMET R13 R13 K57 + 0x8C2C0339, // 00EE GETMET R11 R1 K57 + 0xB8363A00, // 00EF GETNGBL R13 K29 + 0x8C341B3A, // 00F0 GETMET R13 R13 K58 0x7C340200, // 00F1 CALL R13 1 0x7C2C0400, // 00F2 CALL R11 2 - 0x8C30013A, // 00F3 GETMET R12 R0 K58 + 0x8C30013B, // 00F3 GETMET R12 R0 K59 0x5C381600, // 00F4 MOVE R14 R11 0x7C300400, // 00F5 CALL R12 2 0x60340010, // 00F6 GETGBL R13 G16 @@ -527,9 +531,9 @@ be_local_closure(class_Matter_Autoconf_autoconf_device_map, /* name */ 0x5C400600, // 00FD MOVE R16 R3 0x7C3C0200, // 00FE CALL R15 1 0x98081E0E, // 00FF SETIDX R2 R15 R14 - 0x000C0725, // 0100 ADD R3 R3 K37 + 0x000C0726, // 0100 ADD R3 R3 K38 0x7001FFF7, // 0101 JMP #00FA - 0x5834001B, // 0102 LDCONST R13 K27 + 0x5834001C, // 0102 LDCONST R13 K28 0xAC340200, // 0103 CATCH R13 1 0 0xB0080000, // 0104 RAISE 2 R0 R0 0x80040400, // 0105 RET 1 R2 @@ -582,7 +586,7 @@ be_local_closure(class_Matter_Autoconf_autoconf_sensors_list, /* name */ &be_const_str_solidified, ( &(const binstruction[121]) { /* code */ 0x88080100, // 0000 GETMBR R2 R0 K0 - 0x8808053B, // 0001 GETMBR R2 R2 K59 + 0x8808053C, // 0001 GETMBR R2 R2 K60 0x600C0012, // 0002 GETGBL R3 G18 0x7C0C0000, // 0003 CALL R3 0 0x60100010, // 0004 GETGBL R4 G16 @@ -599,19 +603,19 @@ be_local_closure(class_Matter_Autoconf_autoconf_sensors_list, /* name */ 0x60240013, // 000F GETGBL R9 G19 0x7C1C0400, // 0010 CALL R7 2 0x781E000A, // 0011 JMPF R7 #001D - 0x8C1C0D2C, // 0012 GETMET R7 R6 K44 - 0x5824003C, // 0013 LDCONST R9 K60 + 0x8C1C0D2D, // 0012 GETMET R7 R6 K45 + 0x5824003D, // 0013 LDCONST R9 K61 0x7C1C0400, // 0014 CALL R7 2 0x781E0006, // 0015 JMPF R7 #001D - 0x001C0B3D, // 0016 ADD R7 R5 K61 + 0x001C0B3E, // 0016 ADD R7 R5 K62 0x8C200703, // 0017 GETMET R8 R3 K3 0x60280013, // 0018 GETGBL R10 G19 0x7C280000, // 0019 CALL R10 0 - 0x982A233E, // 001A SETIDX R10 K17 K62 - 0x982A7E07, // 001B SETIDX R10 K63 R7 + 0x982A253F, // 001A SETIDX R10 K18 K63 + 0x982A8007, // 001B SETIDX R10 K64 R7 0x7C200400, // 001C CALL R8 2 0x7001FFEB, // 001D JMP #000A - 0x5810001B, // 001E LDCONST R4 K27 + 0x5810001C, // 001E LDCONST R4 K28 0xAC100200, // 001F CATCH R4 1 0 0xB0080000, // 0020 RAISE 2 R0 R0 0x60100010, // 0021 GETGBL R4 G16 @@ -628,19 +632,19 @@ be_local_closure(class_Matter_Autoconf_autoconf_sensors_list, /* name */ 0x60240013, // 002C GETGBL R9 G19 0x7C1C0400, // 002D CALL R7 2 0x781E000A, // 002E JMPF R7 #003A - 0x8C1C0D2C, // 002F GETMET R7 R6 K44 - 0x58240040, // 0030 LDCONST R9 K64 + 0x8C1C0D2D, // 002F GETMET R7 R6 K45 + 0x58240041, // 0030 LDCONST R9 K65 0x7C1C0400, // 0031 CALL R7 2 0x781E0006, // 0032 JMPF R7 #003A - 0x001C0B41, // 0033 ADD R7 R5 K65 + 0x001C0B42, // 0033 ADD R7 R5 K66 0x8C200703, // 0034 GETMET R8 R3 K3 0x60280013, // 0035 GETGBL R10 G19 0x7C280000, // 0036 CALL R10 0 - 0x982A2342, // 0037 SETIDX R10 K17 K66 - 0x982A7E07, // 0038 SETIDX R10 K63 R7 + 0x982A2543, // 0037 SETIDX R10 K18 K67 + 0x982A8007, // 0038 SETIDX R10 K64 R7 0x7C200400, // 0039 CALL R8 2 0x7001FFEB, // 003A JMP #0027 - 0x5810001B, // 003B LDCONST R4 K27 + 0x5810001C, // 003B LDCONST R4 K28 0xAC100200, // 003C CATCH R4 1 0 0xB0080000, // 003D RAISE 2 R0 R0 0x60100010, // 003E GETGBL R4 G16 @@ -657,19 +661,19 @@ be_local_closure(class_Matter_Autoconf_autoconf_sensors_list, /* name */ 0x60240013, // 0049 GETGBL R9 G19 0x7C1C0400, // 004A CALL R7 2 0x781E000A, // 004B JMPF R7 #0057 - 0x8C1C0D2C, // 004C GETMET R7 R6 K44 - 0x58240043, // 004D LDCONST R9 K67 + 0x8C1C0D2D, // 004C GETMET R7 R6 K45 + 0x58240044, // 004D LDCONST R9 K68 0x7C1C0400, // 004E CALL R7 2 0x781E0006, // 004F JMPF R7 #0057 - 0x001C0B44, // 0050 ADD R7 R5 K68 + 0x001C0B45, // 0050 ADD R7 R5 K69 0x8C200703, // 0051 GETMET R8 R3 K3 0x60280013, // 0052 GETGBL R10 G19 0x7C280000, // 0053 CALL R10 0 - 0x982A2345, // 0054 SETIDX R10 K17 K69 - 0x982A7E07, // 0055 SETIDX R10 K63 R7 + 0x982A2546, // 0054 SETIDX R10 K18 K70 + 0x982A8007, // 0055 SETIDX R10 K64 R7 0x7C200400, // 0056 CALL R8 2 0x7001FFEB, // 0057 JMP #0044 - 0x5810001B, // 0058 LDCONST R4 K27 + 0x5810001C, // 0058 LDCONST R4 K28 0xAC100200, // 0059 CATCH R4 1 0 0xB0080000, // 005A RAISE 2 R0 R0 0x60100010, // 005B GETGBL R4 G16 @@ -686,19 +690,19 @@ be_local_closure(class_Matter_Autoconf_autoconf_sensors_list, /* name */ 0x60240013, // 0066 GETGBL R9 G19 0x7C1C0400, // 0067 CALL R7 2 0x781E000A, // 0068 JMPF R7 #0074 - 0x8C1C0D2C, // 0069 GETMET R7 R6 K44 - 0x58240046, // 006A LDCONST R9 K70 + 0x8C1C0D2D, // 0069 GETMET R7 R6 K45 + 0x58240047, // 006A LDCONST R9 K71 0x7C1C0400, // 006B CALL R7 2 0x781E0006, // 006C JMPF R7 #0074 - 0x001C0B47, // 006D ADD R7 R5 K71 + 0x001C0B48, // 006D ADD R7 R5 K72 0x8C200703, // 006E GETMET R8 R3 K3 0x60280013, // 006F GETGBL R10 G19 0x7C280000, // 0070 CALL R10 0 - 0x982A2348, // 0071 SETIDX R10 K17 K72 - 0x982A7E07, // 0072 SETIDX R10 K63 R7 + 0x982A2549, // 0071 SETIDX R10 K18 K73 + 0x982A8007, // 0072 SETIDX R10 K64 R7 0x7C200400, // 0073 CALL R8 2 0x7001FFEB, // 0074 JMP #0061 - 0x5810001B, // 0075 LDCONST R4 K27 + 0x5810001C, // 0075 LDCONST R4 K28 0xAC100200, // 0076 CATCH R4 1 0 0xB0080000, // 0077 RAISE 2 R0 R0 0x80040600, // 0078 RET 1 R3 diff --git a/lib/libesp32/berry_matter/src/solidify/solidified_Matter_z_Commissioning.h b/lib/libesp32/berry_matter/src/solidify/solidified_Matter_z_Commissioning.h index fe75c6523..8014661c2 100644 --- a/lib/libesp32/berry_matter/src/solidify/solidified_Matter_z_Commissioning.h +++ b/lib/libesp32/berry_matter/src/solidify/solidified_Matter_z_Commissioning.h @@ -3,8 +3,8 @@ * Generated code, don't edit * \********************************************************************/ #include "be_constobj.h" -// compact class 'Matter_Commissioning' ktab size: 132, total: 272 (saved 1120 bytes) -static const bvalue be_ktab_class_Matter_Commissioning[132] = { +// compact class 'Matter_Commissioning' ktab size: 127, total: 259 (saved 1056 bytes) +static const bvalue be_ktab_class_Matter_Commissioning[127] = { /* K0 */ be_nested_str_weak(device), /* K1 */ be_nested_str_weak(sessions), /* K2 */ be_nested_str_weak(active_fabrics), @@ -128,15 +128,10 @@ static const bvalue be_ktab_class_Matter_Commissioning[132] = { /* K120 */ be_nested_str_weak(_CM1), /* K121 */ be_nested_str_weak(MTR_X3A_X20starting_X20mDNS_X20on_X20_X25s_X20_X27_X25s_X27_X20ptr_X20to_X20_X60_X25s_X2Elocal_X60), /* K122 */ be_nested_str_weak(millis), - /* K123 */ be_nested_str_weak(mdns_announce_PASE), - /* K124 */ be_nested_str_weak(add_rule), - /* K125 */ be_nested_str_weak(Wifi_X23Connected), - /* K126 */ be_nested_str_weak(Eth_X23Connected), - /* K127 */ be_nested_str_weak(_mdns_announce_hostname), - /* K128 */ be_nested_str_weak(matter_mdns_host), - /* K129 */ be_nested_str_weak(get_fabric), - /* K130 */ be_nested_str_weak(get_admin_vendor_name), - /* K131 */ be_nested_str_weak(MTR_X3A_X20_X2D_X2D_X2D_X20Commissioning_X20complete_X20for_X20Fabric_X20_X27_X25s_X27_X20_X28Vendor_X20_X25s_X29_X20_X2D_X2D_X2D), + /* K123 */ be_nested_str_weak(when_network_up), + /* K124 */ be_nested_str_weak(get_fabric), + /* K125 */ be_nested_str_weak(get_admin_vendor_name), + /* K126 */ be_nested_str_weak(MTR_X3A_X20_X2D_X2D_X2D_X20Commissioning_X20complete_X20for_X20Fabric_X20_X27_X25s_X27_X20_X28Vendor_X20_X25s_X29_X20_X2D_X2D_X2D), }; @@ -1551,15 +1546,15 @@ be_local_closure(class_Matter_Commissioning_mdns_announce_PASE, /* name */ ********************************************************************/ be_local_closure(class_Matter_Commissioning_start_basic_commissioning, /* name */ be_nested_proto( - 13, /* nstack */ + 11, /* nstack */ 8, /* argc */ 10, /* varg */ 0, /* has upvals */ NULL, /* no upvals */ 1, /* has sup protos */ - ( &(const struct bproto*[ 2]) { + ( &(const struct bproto*[ 1]) { be_nested_proto( - 4, /* nstack */ + 2, /* nstack */ 0, /* argc */ 0, /* varg */ 1, /* has upvals */ @@ -1569,55 +1564,16 @@ be_local_closure(class_Matter_Commissioning_start_basic_commissioning, /* name 0, /* has sup protos */ NULL, /* no sub protos */ 1, /* has constants */ - ( &(const bvalue[ 4]) { /* constants */ + ( &(const bvalue[ 1]) { /* constants */ /* K0 */ be_nested_str_weak(mdns_announce_PASE), - /* K1 */ be_nested_str_weak(tasmota), - /* K2 */ be_nested_str_weak(remove_rule), - /* K3 */ be_nested_str_weak(Wifi_X23Connected), }), be_str_weak(_anonymous_), &be_const_str_solidified, - ( &(const binstruction[ 9]) { /* code */ + ( &(const binstruction[ 4]) { /* code */ 0x68000000, // 0000 GETUPV R0 U0 0x8C000100, // 0001 GETMET R0 R0 K0 0x7C000200, // 0002 CALL R0 1 - 0xB8020200, // 0003 GETNGBL R0 K1 - 0x8C000102, // 0004 GETMET R0 R0 K2 - 0x58080003, // 0005 LDCONST R2 K3 - 0x580C0000, // 0006 LDCONST R3 K0 - 0x7C000600, // 0007 CALL R0 3 - 0x80000000, // 0008 RET 0 - }) - ), - be_nested_proto( - 4, /* nstack */ - 0, /* argc */ - 0, /* varg */ - 1, /* has upvals */ - ( &(const bupvaldesc[ 1]) { /* upvals */ - be_local_const_upval(1, 0), - }), - 0, /* has sup protos */ - NULL, /* no sub protos */ - 1, /* has constants */ - ( &(const bvalue[ 4]) { /* constants */ - /* K0 */ be_nested_str_weak(mdns_announce_PASE), - /* K1 */ be_nested_str_weak(tasmota), - /* K2 */ be_nested_str_weak(remove_rule), - /* K3 */ be_nested_str_weak(Eth_X23Connected), - }), - be_str_weak(_anonymous_), - &be_const_str_solidified, - ( &(const binstruction[ 9]) { /* code */ - 0x68000000, // 0000 GETUPV R0 U0 - 0x8C000100, // 0001 GETMET R0 R0 K0 - 0x7C000200, // 0002 CALL R0 1 - 0xB8020200, // 0003 GETNGBL R0 K1 - 0x8C000102, // 0004 GETMET R0 R0 K2 - 0x58080003, // 0005 LDCONST R2 K3 - 0x580C0000, // 0006 LDCONST R3 K0 - 0x7C000600, // 0007 CALL R0 3 - 0x80000000, // 0008 RET 0 + 0x80000000, // 0003 RET 0 }) ), }), @@ -1625,7 +1581,7 @@ be_local_closure(class_Matter_Commissioning_start_basic_commissioning, /* name &be_ktab_class_Matter_Commissioning, /* shared constants */ be_str_weak(start_basic_commissioning), &be_const_str_solidified, - ( &(const binstruction[40]) { /* code */ + ( &(const binstruction[19]) { /* code */ 0xB8221000, // 0000 GETNGBL R8 K8 0x8C20117A, // 0001 GETMET R8 R8 K122 0x7C200200, // 0002 CALL R8 1 @@ -1640,32 +1596,11 @@ be_local_closure(class_Matter_Commissioning_start_basic_commissioning, /* name 0x90022406, // 000B SETMBR R0 K18 R6 0x90022607, // 000C SETMBR R0 K19 R7 0xB8221000, // 000D GETNGBL R8 K8 - 0x8C201131, // 000E GETMET R8 R8 K49 - 0x7C200200, // 000F CALL R8 1 - 0x9420113E, // 0010 GETIDX R8 R8 K62 - 0x74220004, // 0011 JMPT R8 #0017 - 0xB8221000, // 0012 GETNGBL R8 K8 - 0x8C20112C, // 0013 GETMET R8 R8 K44 - 0x7C200200, // 0014 CALL R8 1 - 0x9420113E, // 0015 GETIDX R8 R8 K62 - 0x78220002, // 0016 JMPF R8 #001A - 0x8C20017B, // 0017 GETMET R8 R0 K123 - 0x7C200200, // 0018 CALL R8 1 - 0x7002000B, // 0019 JMP #0026 - 0xB8221000, // 001A GETNGBL R8 K8 - 0x8C20117C, // 001B GETMET R8 R8 K124 - 0x5828007D, // 001C LDCONST R10 K125 - 0x842C0000, // 001D CLOSURE R11 P0 - 0x5830007B, // 001E LDCONST R12 K123 - 0x7C200800, // 001F CALL R8 4 - 0xB8221000, // 0020 GETNGBL R8 K8 - 0x8C20117C, // 0021 GETMET R8 R8 K124 - 0x5828007E, // 0022 LDCONST R10 K126 - 0x842C0001, // 0023 CLOSURE R11 P1 - 0x5830007B, // 0024 LDCONST R12 K123 - 0x7C200800, // 0025 CALL R8 4 - 0xA0000000, // 0026 CLOSE R0 - 0x80000000, // 0027 RET 0 + 0x8C20117B, // 000E GETMET R8 R8 K123 + 0x84280000, // 000F CLOSURE R10 P0 + 0x7C200400, // 0010 CALL R8 2 + 0xA0000000, // 0011 CLOSE R0 + 0x80000000, // 0012 RET 0 }) ) ); @@ -1677,15 +1612,15 @@ be_local_closure(class_Matter_Commissioning_start_basic_commissioning, /* name ********************************************************************/ be_local_closure(class_Matter_Commissioning_start_mdns_announce_hostnames, /* name */ be_nested_proto( - 6, /* nstack */ + 4, /* nstack */ 1, /* argc */ 10, /* varg */ 0, /* has upvals */ NULL, /* no upvals */ 1, /* has sup protos */ - ( &(const struct bproto*[ 2]) { + ( &(const struct bproto*[ 1]) { be_nested_proto( - 4, /* nstack */ + 3, /* nstack */ 0, /* argc */ 0, /* varg */ 1, /* has upvals */ @@ -1696,58 +1631,34 @@ be_local_closure(class_Matter_Commissioning_start_mdns_announce_hostnames, /* NULL, /* no sub protos */ 1, /* has constants */ ( &(const bvalue[ 5]) { /* constants */ - /* K0 */ be_nested_str_weak(_mdns_announce_hostname), - /* K1 */ be_nested_str_weak(tasmota), - /* K2 */ be_nested_str_weak(remove_rule), - /* K3 */ be_nested_str_weak(Wifi_X23Connected), - /* K4 */ be_nested_str_weak(matter_mdns_host), + /* K0 */ be_nested_str_weak(tasmota), + /* K1 */ be_nested_str_weak(wifi), + /* K2 */ be_nested_str_weak(up), + /* K3 */ be_nested_str_weak(_mdns_announce_hostname), + /* K4 */ be_nested_str_weak(eth), }), be_str_weak(_anonymous_), &be_const_str_solidified, - ( &(const binstruction[10]) { /* code */ - 0x68000000, // 0000 GETUPV R0 U0 - 0x8C000100, // 0001 GETMET R0 R0 K0 - 0x50080000, // 0002 LDBOOL R2 0 0 + ( &(const binstruction[19]) { /* code */ + 0xB8020000, // 0000 GETNGBL R0 K0 + 0x8C000101, // 0001 GETMET R0 R0 K1 + 0x58080002, // 0002 LDCONST R2 K2 0x7C000400, // 0003 CALL R0 2 - 0xB8020200, // 0004 GETNGBL R0 K1 - 0x8C000102, // 0005 GETMET R0 R0 K2 - 0x58080003, // 0006 LDCONST R2 K3 - 0x580C0004, // 0007 LDCONST R3 K4 - 0x7C000600, // 0008 CALL R0 3 - 0x80000000, // 0009 RET 0 - }) - ), - be_nested_proto( - 4, /* nstack */ - 0, /* argc */ - 0, /* varg */ - 1, /* has upvals */ - ( &(const bupvaldesc[ 1]) { /* upvals */ - be_local_const_upval(1, 0), - }), - 0, /* has sup protos */ - NULL, /* no sub protos */ - 1, /* has constants */ - ( &(const bvalue[ 5]) { /* constants */ - /* K0 */ be_nested_str_weak(_mdns_announce_hostname), - /* K1 */ be_nested_str_weak(tasmota), - /* K2 */ be_nested_str_weak(remove_rule), - /* K3 */ be_nested_str_weak(Eth_X23Connected), - /* K4 */ be_nested_str_weak(matter_mdns_host), - }), - be_str_weak(_anonymous_), - &be_const_str_solidified, - ( &(const binstruction[10]) { /* code */ - 0x68000000, // 0000 GETUPV R0 U0 - 0x8C000100, // 0001 GETMET R0 R0 K0 - 0x50080200, // 0002 LDBOOL R2 1 0 - 0x7C000400, // 0003 CALL R0 2 - 0xB8020200, // 0004 GETNGBL R0 K1 - 0x8C000102, // 0005 GETMET R0 R0 K2 - 0x58080003, // 0006 LDCONST R2 K3 - 0x580C0004, // 0007 LDCONST R3 K4 - 0x7C000600, // 0008 CALL R0 3 - 0x80000000, // 0009 RET 0 + 0x78020003, // 0004 JMPF R0 #0009 + 0x68000000, // 0005 GETUPV R0 U0 + 0x8C000103, // 0006 GETMET R0 R0 K3 + 0x50080000, // 0007 LDBOOL R2 0 0 + 0x7C000400, // 0008 CALL R0 2 + 0xB8020000, // 0009 GETNGBL R0 K0 + 0x8C000104, // 000A GETMET R0 R0 K4 + 0x58080002, // 000B LDCONST R2 K2 + 0x7C000400, // 000C CALL R0 2 + 0x78020003, // 000D JMPF R0 #0012 + 0x68000000, // 000E GETUPV R0 U0 + 0x8C000103, // 000F GETMET R0 R0 K3 + 0x50080200, // 0010 LDBOOL R2 1 0 + 0x7C000400, // 0011 CALL R0 2 + 0x80000000, // 0012 RET 0 }) ), }), @@ -1755,39 +1666,13 @@ be_local_closure(class_Matter_Commissioning_start_mdns_announce_hostnames, /* &be_ktab_class_Matter_Commissioning, /* shared constants */ be_str_weak(start_mdns_announce_hostnames), &be_const_str_solidified, - ( &(const binstruction[32]) { /* code */ + ( &(const binstruction[ 6]) { /* code */ 0xB8061000, // 0000 GETNGBL R1 K8 - 0x8C040331, // 0001 GETMET R1 R1 K49 - 0x7C040200, // 0002 CALL R1 1 - 0x9404033E, // 0003 GETIDX R1 R1 K62 - 0x78060003, // 0004 JMPF R1 #0009 - 0x8C04017F, // 0005 GETMET R1 R0 K127 - 0x500C0000, // 0006 LDBOOL R3 0 0 - 0x7C040400, // 0007 CALL R1 2 - 0x70020005, // 0008 JMP #000F - 0xB8061000, // 0009 GETNGBL R1 K8 - 0x8C04037C, // 000A GETMET R1 R1 K124 - 0x580C007D, // 000B LDCONST R3 K125 - 0x84100000, // 000C CLOSURE R4 P0 - 0x58140080, // 000D LDCONST R5 K128 - 0x7C040800, // 000E CALL R1 4 - 0xB8061000, // 000F GETNGBL R1 K8 - 0x8C04032C, // 0010 GETMET R1 R1 K44 - 0x7C040200, // 0011 CALL R1 1 - 0x9404033E, // 0012 GETIDX R1 R1 K62 - 0x78060003, // 0013 JMPF R1 #0018 - 0x8C04017F, // 0014 GETMET R1 R0 K127 - 0x500C0200, // 0015 LDBOOL R3 1 0 - 0x7C040400, // 0016 CALL R1 2 - 0x70020005, // 0017 JMP #001E - 0xB8061000, // 0018 GETNGBL R1 K8 - 0x8C04037C, // 0019 GETMET R1 R1 K124 - 0x580C007E, // 001A LDCONST R3 K126 - 0x84100001, // 001B CLOSURE R4 P1 - 0x58140080, // 001C LDCONST R5 K128 - 0x7C040800, // 001D CALL R1 4 - 0xA0000000, // 001E CLOSE R0 - 0x80000000, // 001F RET 0 + 0x8C04037B, // 0001 GETMET R1 R1 K123 + 0x840C0000, // 0002 CLOSURE R3 P0 + 0x7C040400, // 0003 CALL R1 2 + 0xA0000000, // 0004 CLOSE R0 + 0x80000000, // 0005 RET 0 }) ) ); @@ -1872,7 +1757,7 @@ be_local_closure(class_Matter_Commissioning_start_commissioning_complete, /* n be_str_weak(start_commissioning_complete), &be_const_str_solidified, ( &(const binstruction[23]) { /* code */ - 0x8C080381, // 0000 GETMET R2 R1 K129 + 0x8C08037C, // 0000 GETMET R2 R1 K124 0x7C080200, // 0001 CALL R2 1 0x8C0C0504, // 0002 GETMET R3 R2 K4 0x7C0C0200, // 0003 CALL R3 1 @@ -1882,11 +1767,11 @@ be_local_closure(class_Matter_Commissioning_start_commissioning_complete, /* n 0x7C0C0200, // 0007 CALL R3 1 0x8C0C073B, // 0008 GETMET R3 R3 K59 0x7C0C0200, // 0009 CALL R3 1 - 0x8C100582, // 000A GETMET R4 R2 K130 + 0x8C10057D, // 000A GETMET R4 R2 K125 0x7C100200, // 000B CALL R4 1 0xB8164A00, // 000C GETNGBL R5 K37 0x60180018, // 000D GETGBL R6 G24 - 0x581C0083, // 000E LDCONST R7 K131 + 0x581C007E, // 000E LDCONST R7 K126 0x5C200600, // 000F MOVE R8 R3 0x5C240800, // 0010 MOVE R9 R4 0x7C180600, // 0011 CALL R6 3 diff --git a/lib/libesp32/berry_matter/src/solidify/solidified_Matter_zz_Device.h b/lib/libesp32/berry_matter/src/solidify/solidified_Matter_zz_Device.h index 65f3a8f99..3a94dcebb 100644 --- a/lib/libesp32/berry_matter/src/solidify/solidified_Matter_zz_Device.h +++ b/lib/libesp32/berry_matter/src/solidify/solidified_Matter_zz_Device.h @@ -4,263 +4,230 @@ \********************************************************************/ #include "be_constobj.h" extern const bclass be_class_Matter_Device; -// compact class 'Matter_Device' ktab size: 216, total: 463 (saved 1976 bytes) -static const bvalue be_ktab_class_Matter_Device[216] = { - /* K0 */ be_nested_str_weak(udp_server), - /* K1 */ be_nested_str_weak(send_UDP), - /* K2 */ be_nested_str_weak(is_zigbee_present), - /* K3 */ be_nested_str_weak(matter_zigbee), - /* K4 */ be_const_class(be_class_Matter_Device), - /* K5 */ be_nested_str_weak(keys), - /* K6 */ be_nested_str_weak(push), - /* K7 */ be_nested_str_weak(stop_iteration), - /* K8 */ be_const_int(1), - /* K9 */ be_const_int(0), - /* K10 */ be_nested_str_weak(), - /* K11 */ be_nested_str_weak(plugins), - /* K12 */ be_nested_str_weak(MtrInfo_one), - /* K13 */ be_nested_str_weak(endpoint), - /* K14 */ be_nested_str_weak(int), - /* K15 */ be_nested_str_weak(find_plugin_by_friendly_name), - /* K16 */ be_nested_str_weak(tasmota), - /* K17 */ be_nested_str_weak(resp_cmnd_done), - /* K18 */ be_nested_str_weak(read_sensors_scheduler), - /* K19 */ be_nested_str_weak(every_250ms), - /* K20 */ be_nested_str_weak(matter), - /* K21 */ be_nested_str_weak(Path), - /* K22 */ be_nested_str_weak(cluster), - /* K23 */ be_nested_str_weak(attribute), - /* K24 */ be_nested_str_weak(message_handler), - /* K25 */ be_nested_str_weak(im), - /* K26 */ be_nested_str_weak(subs_shop), - /* K27 */ be_nested_str_weak(attribute_updated_ctx), - /* K28 */ be_nested_str_weak(get_endpoint), - /* K29 */ be_nested_str_weak(find), - /* K30 */ be_nested_str_weak(plugins_config_remotes), - /* K31 */ be_nested_str_weak(json), - /* K32 */ be_nested_str_weak(update_remotes_info), - /* K33 */ be_nested_str_weak(_X7B_X22distinguish_X22_X3A_X25i_X2C_X22passcode_X22_X3A_X25i_X2C_X22ipv4only_X22_X3A_X25s_X2C_X22disable_bridge_mode_X22_X3A_X25s_X2C_X22nextep_X22_X3A_X25i), - /* K34 */ be_nested_str_weak(root_discriminator), - /* K35 */ be_nested_str_weak(root_passcode), - /* K36 */ be_nested_str_weak(ipv4only), - /* K37 */ be_nested_str_weak(true), - /* K38 */ be_nested_str_weak(false), - /* K39 */ be_nested_str_weak(disable_bridge_mode), - /* K40 */ be_nested_str_weak(next_ep), - /* K41 */ be_nested_str_weak(debug), - /* K42 */ be_nested_str_weak(_X2C_X22debug_X22_X3Atrue), - /* K43 */ be_nested_str_weak(plugins_persist), - /* K44 */ be_nested_str_weak(_X2C_X0A_X22config_X22_X3A), - /* K45 */ be_nested_str_weak(dump), - /* K46 */ be_nested_str_weak(plugins_config), - /* K47 */ be_nested_str_weak(_X2C_X0A_X22remotes_X22_X3A), - /* K48 */ be_nested_str_weak(_X7D), - /* K49 */ be_nested_str_weak(FILENAME), - /* K50 */ be_nested_str_weak(w), - /* K51 */ be_nested_str_weak(write), - /* K52 */ be_nested_str_weak(close), - /* K53 */ be_nested_str_weak(log), - /* K54 */ be_nested_str_weak(MTR_X3A_X20_X3DSaved_X20_X20_X20_X20_X20parameters_X25s), - /* K55 */ be_nested_str_weak(_X20and_X20configuration), - /* K56 */ be_const_int(2), - /* K57 */ be_nested_str_weak(MTR_X3A_X20Session_Store_X3A_X3Asave_X20Exception_X3A), - /* K58 */ be_nested_str_weak(_X7C), - /* K59 */ be_nested_str_weak(remove_driver), - /* K60 */ be_nested_str_weak(stop), - /* K61 */ be_nested_str_weak(remove), - /* K62 */ be_nested_str_weak(sessions), - /* K63 */ be_nested_str_weak(count_active_fabrics), - /* K64 */ be_nested_str_weak(save_param), - /* K65 */ be_nested_str_weak(autoconf), - /* K66 */ be_nested_str_weak(Autoconf), - /* K67 */ be_nested_str_weak(autoconf_device_map), - /* K68 */ be_nested_str_weak(adjust_next_ep), - /* K69 */ be_nested_str_weak(MTR_X3A_X20autoconfig_X20_X3D_X20), - /* K70 */ be_const_int(3), - /* K71 */ be_nested_str_weak(instantiate_plugins_from_config), - /* K72 */ be_nested_str_weak(msg_received), - /* K73 */ be_nested_str_weak(find_plugin_by_endpoint), - /* K74 */ be_nested_str_weak(status), - /* K75 */ be_nested_str_weak(UNSUPPORTED_ENDPOINT), - /* K76 */ be_nested_str_weak(contains_cluster), - /* K77 */ be_nested_str_weak(UNSUPPORTED_CLUSTER), - /* K78 */ be_nested_str_weak(contains_attribute), - /* K79 */ be_nested_str_weak(UNSUPPORTED_ATTRIBUTE), - /* K80 */ be_nested_str_weak(introspect), - /* K81 */ be_nested_str_weak(http_remotes), - /* K82 */ be_nested_str_weak(get), - /* K83 */ be_nested_str_weak(http_remote), - /* K84 */ be_nested_str_weak(MTR_X3A_X20remove_X20unused_X20remote_X3A_X20), - /* K85 */ be_nested_str_weak(addr), - /* K86 */ be_nested_str_weak(invoke_request), - /* K87 */ be_nested_str_weak(crypto), - /* K88 */ be_nested_str_weak(get_option), - /* K89 */ be_nested_str_weak(MATTER_OPTION), - /* K90 */ be_nested_str_weak(ui), - /* K91 */ be_nested_str_weak(UI), - /* K92 */ be_nested_str_weak(profiler), - /* K93 */ be_nested_str_weak(Profiler), - /* K94 */ be_nested_str_weak(started), - /* K95 */ be_nested_str_weak(tick), - /* K96 */ be_nested_str_weak(EP), - /* K97 */ be_nested_str_weak(commissioning), - /* K98 */ be_nested_str_weak(Commissioning), - /* K99 */ be_nested_str_weak(load_param), - /* K100 */ be_nested_str_weak(Session_Store), - /* K101 */ be_nested_str_weak(load_fabrics), - /* K102 */ be_nested_str_weak(MessageHandler), - /* K103 */ be_nested_str_weak(events), - /* K104 */ be_nested_str_weak(EventHandler), - /* K105 */ be_nested_str_weak(zigbee), - /* K106 */ be_nested_str_weak(init_zigbee), - /* K107 */ be_nested_str_weak(init_basic_commissioning), - /* K108 */ be_nested_str_weak(add_driver), - /* K109 */ be_nested_str_weak(register_commands), - /* K110 */ be_nested_str_weak(button_handler), - /* K111 */ be_nested_str_weak(get_name), - /* K112 */ be_nested_str_weak(wifi), - /* K113 */ be_nested_str_weak(up), - /* K114 */ be_nested_str_weak(eth), - /* K115 */ be_nested_str_weak(start), - /* K116 */ be_nested_str_weak(resp_cmnd_str), - /* K117 */ be_nested_str_weak(Invalid_X20JSON), - /* K118 */ be_nested_str_weak(find_key_i), - /* K119 */ be_nested_str_weak(Ep), - /* K120 */ be_nested_str_weak(Name), - /* K121 */ be_nested_str_weak(Invalid_X20_X27Ep_X27_X20attribute), - /* K122 */ be_nested_str_weak(Invalid_X20Device), - /* K123 */ be_nested_str_weak(VIRTUAL), - /* K124 */ be_nested_str_weak(Device_X20is_X20not_X20virtual), - /* K125 */ be_nested_str_weak(consolidate_update_commands), - /* K126 */ be_nested_str_weak(find_list_i), - /* K127 */ be_nested_str_weak(Invalid_X20attribute_X20_X27_X25s_X27), - /* K128 */ be_nested_str_weak(update_virtual), - /* K129 */ be_nested_str_weak(state_json), - /* K130 */ be_nested_str_weak(_X7B_X22_X25s_X22_X3A_X25s_X7D), - /* K131 */ be_nested_str_weak(resp_cmnd), - /* K132 */ be_nested_str_weak(Missing_X20_X27Device_X27_X20attribute), - /* K133 */ be_nested_str_weak(check_network), - /* K134 */ be_nested_str_weak(every_50ms), - /* K135 */ be_nested_str_weak(every_second), - /* K136 */ be_nested_str_weak(probe_sensor_time), - /* K137 */ be_nested_str_weak(probe_sensor_timestamp), - /* K138 */ be_nested_str_weak(jitter), - /* K139 */ be_nested_str_weak(plugins_classes), - /* K140 */ be_nested_str_weak(MTR_X3A_X20unknown_X20class_X20name_X20_X27), - /* K141 */ be_nested_str_weak(_X27_X20skipping), - /* K142 */ be_nested_str_weak(type), - /* K143 */ be_nested_str_weak(MTR_X3A_X20adding_X20endpoint_X20_X3D_X20_X25i_X20type_X3A_X25s_X25s), - /* K144 */ be_nested_str_weak(conf_to_log), - /* K145 */ be_nested_str_weak(signal_endpoints_changed), - /* K146 */ be_nested_str_weak(contains), - /* K147 */ be_nested_str_weak(MTR_X3A_X20Starting_X20UDP_X20server_X20on_X20port_X3A_X20), - /* K148 */ be_nested_str_weak(UDPServer), - /* K149 */ be_nested_str_weak(attribute_updated), - /* K150 */ be_nested_str_weak(AGGREGATOR_ENDPOINT), - /* K151 */ be_nested_str_weak(module), - /* K152 */ be_nested_str_weak(ARG), - /* K153 */ be_nested_str_weak(get_info), - /* K154 */ be_nested_str_weak(MTR_X3A_X20removing_X20fabric_X20), - /* K155 */ be_nested_str_weak(get_fabric_id), - /* K156 */ be_nested_str_weak(copy), - /* K157 */ be_nested_str_weak(reverse), - /* K158 */ be_nested_str_weak(tohex), - /* K159 */ be_nested_str_weak(remove_by_fabric), - /* K160 */ be_nested_str_weak(mdns_remove_op_discovery), - /* K161 */ be_nested_str_weak(remove_fabric), - /* K162 */ be_nested_str_weak(save_fabrics), - /* K163 */ be_nested_str_weak(k2l), - /* K164 */ be_nested_str_weak(_X20_X25s_X3A_X25s), - /* K165 */ be_nested_str_weak(DISPLAY_NAME), - /* K166 */ be_nested_str_weak(time_reached), - /* K167 */ be_nested_str_weak(_trigger_read_sensors), - /* K168 */ be_nested_str_weak(millis), - /* K169 */ be_nested_str_weak(get_timeout), - /* K170 */ be_nested_str_weak(set_timeout), - /* K171 */ be_nested_str_weak(HTTP_remote), - /* K172 */ be_nested_str_weak(set_info), - /* K173 */ be_nested_str_weak(PathGenerator), - /* K174 */ be_nested_str_weak(is_direct), - /* K175 */ be_nested_str_weak(next_attribute), - /* K176 */ be_nested_str_weak(get_pi), - /* K177 */ be_nested_str_weak(read), - /* K178 */ be_nested_str_weak(load), - /* K179 */ be_nested_str_weak(distinguish), - /* K180 */ be_nested_str_weak(passcode), - /* K181 */ be_nested_str_weak(nextep), - /* K182 */ be_nested_str_weak(config), - /* K183 */ be_nested_str_weak(MTR_X3A_X20Load_config_X20_X3D_X20_X25s), - /* K184 */ be_nested_str_weak(check_config_ep), - /* K185 */ be_nested_str_weak(remotes), - /* K186 */ be_nested_str_weak(MTR_X3A_X20load_remotes_X20_X3D_X20), - /* K187 */ be_nested_str_weak(io_error), - /* K188 */ be_nested_str_weak(MTR_X3A_X20load_param_X20Exception_X3A), - /* K189 */ be_nested_str_weak(random), - /* K190 */ be_nested_str_weak(generate_random_passcode), - /* K191 */ be_nested_str_weak(read_sensors), - /* K192 */ be_nested_str_weak(loglevel), - /* K193 */ be_nested_str_weak(MTR_X3A_X20read_sensors_X3A_X20), - /* K194 */ be_nested_str_weak(parse_sensors), - /* K195 */ be_nested_str_weak(MTR_X3A_X20unable_X20to_X20parse_X20read_sensors_X3A_X20), - /* K196 */ be_nested_str_weak(received_ack), - /* K197 */ be_nested_str_weak(MTR_X3A_X20invalid_X20entry_X20with_X20ep_X20_X270_X27), - /* K198 */ be_nested_str_weak(MTR_X3A_X20endpoint_X20_X25s_X20collides_X20wit_X20aggregator_X2C_X20relocating_X20to_X20_X25s), - /* K199 */ be_nested_str_weak(MTR_X3A_X20Cannot_X20remove_X20an_X20enpoint_X20not_X20configured_X3A_X20), - /* K200 */ be_nested_str_weak(MTR_X3A_X20deleting_X20endpoint_X20_X3D_X20_X25i), - /* K201 */ be_nested_str_weak(clean_remotes), - /* K202 */ be_nested_str_weak(add_cmd), - /* K203 */ be_nested_str_weak(MtrJoin), - /* K204 */ be_nested_str_weak(MtrUpdate), - /* K205 */ be_nested_str_weak(MtrInfo), - /* K206 */ be_nested_str_weak(stop_basic_commissioning), - /* K207 */ be_nested_str_weak(mdns_remove_op_discovery_all_fabrics), - /* K208 */ be_nested_str_weak(start_root_basic_commissioning), - /* K209 */ be_nested_str_weak(_X7B_X22MtrInfo_X22_X3A_X25s_X7D), - /* K210 */ be_nested_str_weak(publish_result), - /* K211 */ be_nested_str_weak(Matter_Zigbee_Mapper), - /* K212 */ be_nested_str_weak(autoconf_device), - /* K213 */ be_nested_str_weak(_start_udp), - /* K214 */ be_nested_str_weak(UDP_PORT), - /* K215 */ be_nested_str_weak(start_mdns_announce_hostnames), +// compact class 'Matter_Device' ktab size: 211, total: 453 (saved 1936 bytes) +static const bvalue be_ktab_class_Matter_Device[211] = { + /* K0 */ be_nested_str_weak(json), + /* K1 */ be_nested_str_weak(tasmota), + /* K2 */ be_nested_str_weak(read_sensors), + /* K3 */ be_nested_str_weak(loglevel), + /* K4 */ be_const_int(3), + /* K5 */ be_nested_str_weak(log), + /* K6 */ be_nested_str_weak(MTR_X3A_X20read_sensors_X3A_X20), + /* K7 */ be_nested_str_weak(load), + /* K8 */ be_const_int(0), + /* K9 */ be_nested_str_weak(plugins), + /* K10 */ be_nested_str_weak(parse_sensors), + /* K11 */ be_const_int(1), + /* K12 */ be_nested_str_weak(MTR_X3A_X20unable_X20to_X20parse_X20read_sensors_X3A_X20), + /* K13 */ be_nested_str_weak(probe_sensor_time), + /* K14 */ be_nested_str_weak(probe_sensor_timestamp), + /* K15 */ be_nested_str_weak(time_reached), + /* K16 */ be_nested_str_weak(_trigger_read_sensors), + /* K17 */ be_nested_str_weak(millis), + /* K18 */ be_nested_str_weak(button_handler), + /* K19 */ be_nested_str_weak(plugins_config), + /* K20 */ be_nested_str_weak(keys), + /* K21 */ be_nested_str_weak(push), + /* K22 */ be_nested_str_weak(stop_iteration), + /* K23 */ be_nested_str_weak(matter), + /* K24 */ be_nested_str_weak(AGGREGATOR_ENDPOINT), + /* K25 */ be_nested_str_weak(MTR_X3A_X20endpoint_X20_X25s_X20collides_X20wit_X20aggregator_X2C_X20relocating_X20to_X20_X25s), + /* K26 */ be_nested_str_weak(next_ep), + /* K27 */ be_const_int(2), + /* K28 */ be_nested_str_weak(remove), + /* K29 */ be_nested_str_weak(endpoint), + /* K30 */ be_nested_str_weak(invoke_request), + /* K31 */ be_nested_str_weak(status), + /* K32 */ be_nested_str_weak(UNSUPPORTED_ENDPOINT), + /* K33 */ be_nested_str_weak(attribute_updated), + /* K34 */ be_nested_str_weak(crypto), + /* K35 */ be_nested_str_weak(FILENAME), + /* K36 */ be_nested_str_weak(read), + /* K37 */ be_nested_str_weak(close), + /* K38 */ be_nested_str_weak(root_discriminator), + /* K39 */ be_nested_str_weak(find), + /* K40 */ be_nested_str_weak(distinguish), + /* K41 */ be_nested_str_weak(root_passcode), + /* K42 */ be_nested_str_weak(passcode), + /* K43 */ be_nested_str_weak(ipv4only), + /* K44 */ be_nested_str_weak(disable_bridge_mode), + /* K45 */ be_nested_str_weak(nextep), + /* K46 */ be_nested_str_weak(config), + /* K47 */ be_nested_str_weak(debug), + /* K48 */ be_nested_str_weak(MTR_X3A_X20Load_config_X20_X3D_X20_X25s), + /* K49 */ be_nested_str_weak(adjust_next_ep), + /* K50 */ be_nested_str_weak(check_config_ep), + /* K51 */ be_nested_str_weak(plugins_persist), + /* K52 */ be_nested_str_weak(plugins_config_remotes), + /* K53 */ be_nested_str_weak(remotes), + /* K54 */ be_nested_str_weak(MTR_X3A_X20load_remotes_X20_X3D_X20), + /* K55 */ be_nested_str_weak(io_error), + /* K56 */ be_nested_str_weak(MTR_X3A_X20load_param_X20Exception_X3A), + /* K57 */ be_nested_str_weak(_X7C), + /* K58 */ be_nested_str_weak(random), + /* K59 */ be_nested_str_weak(get), + /* K60 */ be_nested_str_weak(commissioning), + /* K61 */ be_nested_str_weak(generate_random_passcode), + /* K62 */ be_nested_str_weak(save_param), + /* K63 */ be_const_class(be_class_Matter_Device), + /* K64 */ be_nested_str_weak(), + /* K65 */ be_nested_str_weak(k2l), + /* K66 */ be_nested_str_weak(type), + /* K67 */ be_nested_str_weak(_X20_X25s_X3A_X25s), + /* K68 */ be_nested_str_weak(introspect), + /* K69 */ be_nested_str_weak(module), + /* K70 */ be_nested_str_weak(matter_zigbee), + /* K71 */ be_nested_str_weak(remove_driver), + /* K72 */ be_nested_str_weak(udp_server), + /* K73 */ be_nested_str_weak(stop), + /* K74 */ be_nested_str_weak(get_name), + /* K75 */ be_nested_str_weak(start_root_basic_commissioning), + /* K76 */ be_nested_str_weak(stop_basic_commissioning), + /* K77 */ be_nested_str_weak(resp_cmnd_done), + /* K78 */ be_nested_str_weak(MtrInfo_one), + /* K79 */ be_nested_str_weak(int), + /* K80 */ be_nested_str_weak(find_plugin_by_friendly_name), + /* K81 */ be_nested_str_weak(find_plugin_by_endpoint), + /* K82 */ be_nested_str_weak(state_json), + /* K83 */ be_nested_str_weak(_X7B_X22MtrInfo_X22_X3A_X25s_X7D), + /* K84 */ be_nested_str_weak(publish_result), + /* K85 */ be_nested_str_weak(cluster), + /* K86 */ be_nested_str_weak(attribute), + /* K87 */ be_nested_str_weak(contains_cluster), + /* K88 */ be_nested_str_weak(UNSUPPORTED_CLUSTER), + /* K89 */ be_nested_str_weak(contains_attribute), + /* K90 */ be_nested_str_weak(UNSUPPORTED_ATTRIBUTE), + /* K91 */ be_nested_str_weak(sessions), + /* K92 */ be_nested_str_weak(every_second), + /* K93 */ be_nested_str_weak(message_handler), + /* K94 */ be_nested_str_weak(events), + /* K95 */ be_nested_str_weak(plugins_classes), + /* K96 */ be_nested_str_weak(DISPLAY_NAME), + /* K97 */ be_nested_str_weak(ARG), + /* K98 */ be_nested_str_weak(PathGenerator), + /* K99 */ be_nested_str_weak(start), + /* K100 */ be_nested_str_weak(is_direct), + /* K101 */ be_nested_str_weak(next_attribute), + /* K102 */ be_nested_str_weak(get_pi), + /* K103 */ be_nested_str_weak(get_endpoint), + /* K104 */ be_nested_str_weak(MTR_X3A_X20removing_X20fabric_X20), + /* K105 */ be_nested_str_weak(get_fabric_id), + /* K106 */ be_nested_str_weak(copy), + /* K107 */ be_nested_str_weak(reverse), + /* K108 */ be_nested_str_weak(tohex), + /* K109 */ be_nested_str_weak(im), + /* K110 */ be_nested_str_weak(subs_shop), + /* K111 */ be_nested_str_weak(remove_by_fabric), + /* K112 */ be_nested_str_weak(mdns_remove_op_discovery), + /* K113 */ be_nested_str_weak(remove_fabric), + /* K114 */ be_nested_str_weak(save_fabrics), + /* K115 */ be_nested_str_weak(Path), + /* K116 */ be_nested_str_weak(attribute_updated_ctx), + /* K117 */ be_nested_str_weak(add_cmd), + /* K118 */ be_nested_str_weak(MtrJoin), + /* K119 */ be_nested_str_weak(MtrUpdate), + /* K120 */ be_nested_str_weak(MtrInfo), + /* K121 */ be_nested_str_weak(update_remotes_info), + /* K122 */ be_nested_str_weak(_X7B_X22distinguish_X22_X3A_X25i_X2C_X22passcode_X22_X3A_X25i_X2C_X22ipv4only_X22_X3A_X25s_X2C_X22disable_bridge_mode_X22_X3A_X25s_X2C_X22nextep_X22_X3A_X25i), + /* K123 */ be_nested_str_weak(true), + /* K124 */ be_nested_str_weak(false), + /* K125 */ be_nested_str_weak(_X2C_X22debug_X22_X3Atrue), + /* K126 */ be_nested_str_weak(_X2C_X0A_X22config_X22_X3A), + /* K127 */ be_nested_str_weak(dump), + /* K128 */ be_nested_str_weak(_X2C_X0A_X22remotes_X22_X3A), + /* K129 */ be_nested_str_weak(_X7D), + /* K130 */ be_nested_str_weak(w), + /* K131 */ be_nested_str_weak(write), + /* K132 */ be_nested_str_weak(MTR_X3A_X20_X3DSaved_X20_X20_X20_X20_X20parameters_X25s), + /* K133 */ be_nested_str_weak(_X20and_X20configuration), + /* K134 */ be_nested_str_weak(MTR_X3A_X20Session_Store_X3A_X3Asave_X20Exception_X3A), + /* K135 */ be_nested_str_weak(http_remotes), + /* K136 */ be_nested_str_weak(http_remote), + /* K137 */ be_nested_str_weak(MTR_X3A_X20remove_X20unused_X20remote_X3A_X20), + /* K138 */ be_nested_str_weak(addr), + /* K139 */ be_nested_str_weak(contains), + /* K140 */ be_nested_str_weak(MTR_X3A_X20Cannot_X20remove_X20an_X20enpoint_X20not_X20configured_X3A_X20), + /* K141 */ be_nested_str_weak(MTR_X3A_X20deleting_X20endpoint_X20_X3D_X20_X25i), + /* K142 */ be_nested_str_weak(clean_remotes), + /* K143 */ be_nested_str_weak(signal_endpoints_changed), + /* K144 */ be_nested_str_weak(MTR_X3A_X20Starting_X20UDP_X20server_X20on_X20port_X3A_X20), + /* K145 */ be_nested_str_weak(UDPServer), + /* K146 */ be_nested_str_weak(count_active_fabrics), + /* K147 */ be_nested_str_weak(get_option), + /* K148 */ be_nested_str_weak(MATTER_OPTION), + /* K149 */ be_nested_str_weak(ui), + /* K150 */ be_nested_str_weak(UI), + /* K151 */ be_nested_str_weak(profiler), + /* K152 */ be_nested_str_weak(Profiler), + /* K153 */ be_nested_str_weak(tick), + /* K154 */ be_nested_str_weak(EP), + /* K155 */ be_nested_str_weak(Commissioning), + /* K156 */ be_nested_str_weak(load_param), + /* K157 */ be_nested_str_weak(Session_Store), + /* K158 */ be_nested_str_weak(load_fabrics), + /* K159 */ be_nested_str_weak(MessageHandler), + /* K160 */ be_nested_str_weak(EventHandler), + /* K161 */ be_nested_str_weak(zigbee), + /* K162 */ be_nested_str_weak(init_zigbee), + /* K163 */ be_nested_str_weak(when_network_up), + /* K164 */ be_nested_str_weak(init_basic_commissioning), + /* K165 */ be_nested_str_weak(add_driver), + /* K166 */ be_nested_str_weak(register_commands), + /* K167 */ be_nested_str_weak(received_ack), + /* K168 */ be_nested_str_weak(read_sensors_scheduler), + /* K169 */ be_nested_str_weak(every_250ms), + /* K170 */ be_nested_str_weak(send_UDP), + /* K171 */ be_nested_str_weak(autoconf_device), + /* K172 */ be_nested_str_weak(_start_udp), + /* K173 */ be_nested_str_weak(UDP_PORT), + /* K174 */ be_nested_str_weak(start_mdns_announce_hostnames), + /* K175 */ be_nested_str_weak(get_info), + /* K176 */ be_nested_str_weak(every_50ms), + /* K177 */ be_nested_str_weak(get_timeout), + /* K178 */ be_nested_str_weak(set_timeout), + /* K179 */ be_nested_str_weak(HTTP_remote), + /* K180 */ be_nested_str_weak(set_info), + /* K181 */ be_nested_str_weak(msg_received), + /* K182 */ be_nested_str_weak(MTR_X3A_X20unknown_X20class_X20name_X20_X27), + /* K183 */ be_nested_str_weak(_X27_X20skipping), + /* K184 */ be_nested_str_weak(MTR_X3A_X20adding_X20endpoint_X20_X3D_X20_X25i_X20type_X3A_X25s_X25s), + /* K185 */ be_nested_str_weak(conf_to_log), + /* K186 */ be_nested_str_weak(autoconf), + /* K187 */ be_nested_str_weak(Autoconf), + /* K188 */ be_nested_str_weak(autoconf_device_map), + /* K189 */ be_nested_str_weak(MTR_X3A_X20autoconfig_X20_X3D_X20), + /* K190 */ be_nested_str_weak(instantiate_plugins_from_config), + /* K191 */ be_nested_str_weak(mdns_remove_op_discovery_all_fabrics), + /* K192 */ be_nested_str_weak(resp_cmnd_str), + /* K193 */ be_nested_str_weak(Invalid_X20JSON), + /* K194 */ be_nested_str_weak(find_key_i), + /* K195 */ be_nested_str_weak(Ep), + /* K196 */ be_nested_str_weak(Name), + /* K197 */ be_nested_str_weak(Invalid_X20_X27Ep_X27_X20attribute), + /* K198 */ be_nested_str_weak(Invalid_X20Device), + /* K199 */ be_nested_str_weak(VIRTUAL), + /* K200 */ be_nested_str_weak(Device_X20is_X20not_X20virtual), + /* K201 */ be_nested_str_weak(consolidate_update_commands), + /* K202 */ be_nested_str_weak(find_list_i), + /* K203 */ be_nested_str_weak(Invalid_X20attribute_X20_X27_X25s_X27), + /* K204 */ be_nested_str_weak(update_virtual), + /* K205 */ be_nested_str_weak(_X7B_X22_X25s_X22_X3A_X25s_X7D), + /* K206 */ be_nested_str_weak(resp_cmnd), + /* K207 */ be_nested_str_weak(Missing_X20_X27Device_X27_X20attribute), + /* K208 */ be_nested_str_weak(Matter_Zigbee_Mapper), + /* K209 */ be_nested_str_weak(is_zigbee_present), + /* K210 */ be_nested_str_weak(jitter), }; extern const bclass be_class_Matter_Device; /******************************************************************** -** Solidified function: msg_send +** Solidified function: _trigger_read_sensors ********************************************************************/ -be_local_closure(class_Matter_Device_msg_send, /* name */ +be_local_closure(class_Matter_Device__trigger_read_sensors, /* name */ be_nested_proto( - 5, /* nstack */ - 2, /* argc */ - 10, /* varg */ - 0, /* has upvals */ - NULL, /* no upvals */ - 0, /* has sup protos */ - NULL, /* no sub protos */ - 1, /* has constants */ - &be_ktab_class_Matter_Device, /* shared constants */ - be_str_weak(msg_send), - &be_const_str_solidified, - ( &(const binstruction[ 5]) { /* code */ - 0x88080100, // 0000 GETMBR R2 R0 K0 - 0x8C080501, // 0001 GETMET R2 R2 K1 - 0x5C100200, // 0002 MOVE R4 R1 - 0x7C080400, // 0003 CALL R2 2 - 0x80040400, // 0004 RET 1 R2 - }) - ) -); -/*******************************************************************/ - - -/******************************************************************** -** Solidified function: init_zigbee -********************************************************************/ -be_local_closure(class_Matter_Device_init_zigbee, /* name */ - be_nested_proto( - 4, /* nstack */ + 8, /* nstack */ 1, /* argc */ 10, /* varg */ 0, /* has upvals */ @@ -269,842 +236,57 @@ be_local_closure(class_Matter_Device_init_zigbee, /* name */ NULL, /* no sub protos */ 1, /* has constants */ &be_ktab_class_Matter_Device, /* shared constants */ - be_str_weak(init_zigbee), + be_str_weak(_trigger_read_sensors), &be_const_str_solidified, - ( &(const binstruction[ 9]) { /* code */ - 0x8C040102, // 0000 GETMET R1 R0 K2 - 0x7C040200, // 0001 CALL R1 1 - 0x78060004, // 0002 JMPF R1 #0008 - 0xA4060600, // 0003 IMPORT R1 K3 - 0x5C080200, // 0004 MOVE R2 R1 - 0x5C0C0000, // 0005 MOVE R3 R0 - 0x7C080200, // 0006 CALL R2 1 - 0x80040400, // 0007 RET 1 R2 - 0x80000000, // 0008 RET 0 - }) - ) -); -/*******************************************************************/ - - -/******************************************************************** -** Solidified function: k2l_num -********************************************************************/ -be_local_closure(class_Matter_Device_k2l_num, /* name */ - be_nested_proto( - 9, /* nstack */ - 1, /* argc */ - 12, /* varg */ - 0, /* has upvals */ - NULL, /* no upvals */ - 0, /* has sup protos */ - NULL, /* no sub protos */ - 1, /* has constants */ - &be_ktab_class_Matter_Device, /* shared constants */ - be_str_weak(k2l_num), - &be_const_str_solidified, - ( &(const binstruction[52]) { /* code */ - 0x58040004, // 0000 LDCONST R1 K4 - 0x60080012, // 0001 GETGBL R2 G18 - 0x7C080000, // 0002 CALL R2 0 - 0x4C0C0000, // 0003 LDNIL R3 - 0x1C0C0003, // 0004 EQ R3 R0 R3 - 0x780E0000, // 0005 JMPF R3 #0007 - 0x80040400, // 0006 RET 1 R2 - 0x600C0010, // 0007 GETGBL R3 G16 - 0x8C100105, // 0008 GETMET R4 R0 K5 - 0x7C100200, // 0009 CALL R4 1 - 0x7C0C0200, // 000A CALL R3 1 - 0xA8020007, // 000B EXBLK 0 #0014 - 0x5C100600, // 000C MOVE R4 R3 - 0x7C100000, // 000D CALL R4 0 - 0x8C140506, // 000E GETMET R5 R2 K6 - 0x601C0009, // 000F GETGBL R7 G9 - 0x5C200800, // 0010 MOVE R8 R4 - 0x7C1C0200, // 0011 CALL R7 1 - 0x7C140400, // 0012 CALL R5 2 - 0x7001FFF7, // 0013 JMP #000C - 0x580C0007, // 0014 LDCONST R3 K7 - 0xAC0C0200, // 0015 CATCH R3 1 0 - 0xB0080000, // 0016 RAISE 2 R0 R0 - 0x600C0010, // 0017 GETGBL R3 G16 - 0x6010000C, // 0018 GETGBL R4 G12 - 0x5C140400, // 0019 MOVE R5 R2 - 0x7C100200, // 001A CALL R4 1 - 0x04100908, // 001B SUB R4 R4 K8 - 0x40121004, // 001C CONNECT R4 K8 R4 - 0x7C0C0200, // 001D CALL R3 1 - 0xA8020010, // 001E EXBLK 0 #0030 - 0x5C100600, // 001F MOVE R4 R3 - 0x7C100000, // 0020 CALL R4 0 - 0x94140404, // 0021 GETIDX R5 R2 R4 - 0x5C180800, // 0022 MOVE R6 R4 - 0x241C0D09, // 0023 GT R7 R6 K9 - 0x781E0008, // 0024 JMPF R7 #002E - 0x041C0D08, // 0025 SUB R7 R6 K8 - 0x941C0407, // 0026 GETIDX R7 R2 R7 - 0x241C0E05, // 0027 GT R7 R7 R5 - 0x781E0004, // 0028 JMPF R7 #002E - 0x041C0D08, // 0029 SUB R7 R6 K8 - 0x941C0407, // 002A GETIDX R7 R2 R7 - 0x98080C07, // 002B SETIDX R2 R6 R7 - 0x04180D08, // 002C SUB R6 R6 K8 - 0x7001FFF4, // 002D JMP #0023 - 0x98080C05, // 002E SETIDX R2 R6 R5 - 0x7001FFEE, // 002F JMP #001F - 0x580C0007, // 0030 LDCONST R3 K7 - 0xAC0C0200, // 0031 CATCH R3 1 0 - 0xB0080000, // 0032 RAISE 2 R0 R0 - 0x80040400, // 0033 RET 1 R2 - }) - ) -); -/*******************************************************************/ - - -/******************************************************************** -** Solidified function: MtrInfo -********************************************************************/ -be_local_closure(class_Matter_Device_MtrInfo, /* name */ - be_nested_proto( - 10, /* nstack */ - 5, /* argc */ - 10, /* varg */ - 0, /* has upvals */ - NULL, /* no upvals */ - 0, /* has sup protos */ - NULL, /* no sub protos */ - 1, /* has constants */ - &be_ktab_class_Matter_Device, /* shared constants */ - be_str_weak(MtrInfo), - &be_const_str_solidified, - ( &(const binstruction[40]) { /* code */ - 0x1C14070A, // 0000 EQ R5 R3 K10 - 0x7815FFFF, // 0001 JMPF R5 #0002 - 0x1C14070A, // 0002 EQ R5 R3 K10 - 0x7816000D, // 0003 JMPF R5 #0012 - 0x60140010, // 0004 GETGBL R5 G16 - 0x8818010B, // 0005 GETMBR R6 R0 K11 - 0x7C140200, // 0006 CALL R5 1 - 0xA8020005, // 0007 EXBLK 0 #000E - 0x5C180A00, // 0008 MOVE R6 R5 - 0x7C180000, // 0009 CALL R6 0 - 0x8C1C010C, // 000A GETMET R7 R0 K12 - 0x88240D0D, // 000B GETMBR R9 R6 K13 - 0x7C1C0400, // 000C CALL R7 2 - 0x7001FFF9, // 000D JMP #0008 - 0x58140007, // 000E LDCONST R5 K7 - 0xAC140200, // 000F CATCH R5 1 0 - 0xB0080000, // 0010 RAISE 2 R0 R0 - 0x70020011, // 0011 JMP #0024 - 0x60140004, // 0012 GETGBL R5 G4 - 0x5C180800, // 0013 MOVE R6 R4 - 0x7C140200, // 0014 CALL R5 1 - 0x1C140B0E, // 0015 EQ R5 R5 K14 - 0x78160003, // 0016 JMPF R5 #001B - 0x8C14010C, // 0017 GETMET R5 R0 K12 - 0x5C1C0800, // 0018 MOVE R7 R4 - 0x7C140400, // 0019 CALL R5 2 - 0x70020008, // 001A JMP #0024 - 0x8C14010F, // 001B GETMET R5 R0 K15 - 0x5C1C0600, // 001C MOVE R7 R3 - 0x7C140400, // 001D CALL R5 2 - 0x4C180000, // 001E LDNIL R6 - 0x20180A06, // 001F NE R6 R5 R6 - 0x781A0002, // 0020 JMPF R6 #0024 - 0x8C18010C, // 0021 GETMET R6 R0 K12 - 0x88200B0D, // 0022 GETMBR R8 R5 K13 - 0x7C180400, // 0023 CALL R6 2 - 0xB8162000, // 0024 GETNGBL R5 K16 - 0x8C140B11, // 0025 GETMET R5 R5 K17 - 0x7C140200, // 0026 CALL R5 1 - 0x80000000, // 0027 RET 0 - }) - ) -); -/*******************************************************************/ - - -/******************************************************************** -** Solidified function: every_250ms -********************************************************************/ -be_local_closure(class_Matter_Device_every_250ms, /* name */ - be_nested_proto( - 4, /* nstack */ - 1, /* argc */ - 10, /* varg */ - 0, /* has upvals */ - NULL, /* no upvals */ - 0, /* has sup protos */ - NULL, /* no sub protos */ - 1, /* has constants */ - &be_ktab_class_Matter_Device, /* shared constants */ - be_str_weak(every_250ms), - &be_const_str_solidified, - ( &(const binstruction[15]) { /* code */ - 0x8C040112, // 0000 GETMET R1 R0 K18 - 0x7C040200, // 0001 CALL R1 1 - 0x58040009, // 0002 LDCONST R1 K9 - 0x6008000C, // 0003 GETGBL R2 G12 - 0x880C010B, // 0004 GETMBR R3 R0 K11 - 0x7C080200, // 0005 CALL R2 1 - 0x14080202, // 0006 LT R2 R1 R2 - 0x780A0005, // 0007 JMPF R2 #000E - 0x8808010B, // 0008 GETMBR R2 R0 K11 - 0x94080401, // 0009 GETIDX R2 R2 R1 - 0x8C080513, // 000A GETMET R2 R2 K19 - 0x7C080200, // 000B CALL R2 1 - 0x00040308, // 000C ADD R1 R1 K8 - 0x7001FFF4, // 000D JMP #0003 - 0x80000000, // 000E RET 0 - }) - ) -); -/*******************************************************************/ - - -/******************************************************************** -** Solidified function: attribute_updated -********************************************************************/ -be_local_closure(class_Matter_Device_attribute_updated, /* name */ - be_nested_proto( - 10, /* nstack */ - 5, /* argc */ - 10, /* varg */ - 0, /* has upvals */ - NULL, /* no upvals */ - 0, /* has sup protos */ - NULL, /* no sub protos */ - 1, /* has constants */ - &be_ktab_class_Matter_Device, /* shared constants */ - be_str_weak(attribute_updated), - &be_const_str_solidified, - ( &(const binstruction[18]) { /* code */ - 0x4C140000, // 0000 LDNIL R5 - 0x1C140805, // 0001 EQ R5 R4 R5 - 0x78160000, // 0002 JMPF R5 #0004 - 0x50100000, // 0003 LDBOOL R4 0 0 - 0xB8162800, // 0004 GETNGBL R5 K20 - 0x8C140B15, // 0005 GETMET R5 R5 K21 - 0x7C140200, // 0006 CALL R5 1 - 0x90161A01, // 0007 SETMBR R5 K13 R1 - 0x90162C02, // 0008 SETMBR R5 K22 R2 - 0x90162E03, // 0009 SETMBR R5 K23 R3 - 0x88180118, // 000A GETMBR R6 R0 K24 - 0x88180D19, // 000B GETMBR R6 R6 K25 - 0x88180D1A, // 000C GETMBR R6 R6 K26 - 0x8C180D1B, // 000D GETMET R6 R6 K27 - 0x5C200A00, // 000E MOVE R8 R5 - 0x5C240800, // 000F MOVE R9 R4 - 0x7C180600, // 0010 CALL R6 3 - 0x80000000, // 0011 RET 0 - }) - ) -); -/*******************************************************************/ - - -/******************************************************************** -** Solidified function: get_active_endpoints -********************************************************************/ -be_local_closure(class_Matter_Device_get_active_endpoints, /* name */ - be_nested_proto( - 9, /* nstack */ - 2, /* argc */ - 10, /* varg */ - 0, /* has upvals */ - NULL, /* no upvals */ - 0, /* has sup protos */ - NULL, /* no sub protos */ - 1, /* has constants */ - &be_ktab_class_Matter_Device, /* shared constants */ - be_str_weak(get_active_endpoints), - &be_const_str_solidified, - ( &(const binstruction[28]) { /* code */ - 0x60080012, // 0000 GETGBL R2 G18 - 0x7C080000, // 0001 CALL R2 0 - 0x600C0010, // 0002 GETGBL R3 G16 - 0x8810010B, // 0003 GETMBR R4 R0 K11 - 0x7C0C0200, // 0004 CALL R3 1 - 0xA8020011, // 0005 EXBLK 0 #0018 - 0x5C100600, // 0006 MOVE R4 R3 - 0x7C100000, // 0007 CALL R4 0 - 0x8C14091C, // 0008 GETMET R5 R4 K28 - 0x7C140200, // 0009 CALL R5 1 - 0x78060002, // 000A JMPF R1 #000E - 0x1C180B09, // 000B EQ R6 R5 K9 - 0x781A0000, // 000C JMPF R6 #000E - 0x7001FFF7, // 000D JMP #0006 - 0x8C18051D, // 000E GETMET R6 R2 K29 - 0x5C200A00, // 000F MOVE R8 R5 - 0x7C180400, // 0010 CALL R6 2 - 0x4C1C0000, // 0011 LDNIL R7 - 0x1C180C07, // 0012 EQ R6 R6 R7 - 0x781A0002, // 0013 JMPF R6 #0017 - 0x8C180506, // 0014 GETMET R6 R2 K6 - 0x5C200A00, // 0015 MOVE R8 R5 - 0x7C180400, // 0016 CALL R6 2 - 0x7001FFED, // 0017 JMP #0006 - 0x580C0007, // 0018 LDCONST R3 K7 - 0xAC0C0200, // 0019 CATCH R3 1 0 - 0xB0080000, // 001A RAISE 2 R0 R0 - 0x80040400, // 001B RET 1 R2 - }) - ) -); -/*******************************************************************/ - - -/******************************************************************** -** Solidified function: get_plugin_remote_info -********************************************************************/ -be_local_closure(class_Matter_Device_get_plugin_remote_info, /* name */ - be_nested_proto( - 6, /* nstack */ - 2, /* argc */ - 10, /* varg */ - 0, /* has upvals */ - NULL, /* no upvals */ - 0, /* has sup protos */ - NULL, /* no sub protos */ - 1, /* has constants */ - &be_ktab_class_Matter_Device, /* shared constants */ - be_str_weak(get_plugin_remote_info), - &be_const_str_solidified, - ( &(const binstruction[ 7]) { /* code */ - 0x8808011E, // 0000 GETMBR R2 R0 K30 - 0x8C08051D, // 0001 GETMET R2 R2 K29 - 0x5C100200, // 0002 MOVE R4 R1 - 0x60140013, // 0003 GETGBL R5 G19 - 0x7C140000, // 0004 CALL R5 0 - 0x7C080600, // 0005 CALL R2 3 - 0x80040400, // 0006 RET 1 R2 - }) - ) -); -/*******************************************************************/ - - -/******************************************************************** -** Solidified function: save_param -********************************************************************/ -be_local_closure(class_Matter_Device_save_param, /* name */ - be_nested_proto( - 9, /* nstack */ - 1, /* argc */ - 10, /* varg */ - 0, /* has upvals */ - NULL, /* no upvals */ - 0, /* has sup protos */ - NULL, /* no sub protos */ - 1, /* has constants */ - &be_ktab_class_Matter_Device, /* shared constants */ - be_str_weak(save_param), - &be_const_str_solidified, - ( &(const binstruction[83]) { /* code */ - 0xA4063E00, // 0000 IMPORT R1 K31 - 0x8C080120, // 0001 GETMET R2 R0 K32 - 0x7C080200, // 0002 CALL R2 1 - 0x60080018, // 0003 GETGBL R2 G24 - 0x580C0021, // 0004 LDCONST R3 K33 - 0x88100122, // 0005 GETMBR R4 R0 K34 - 0x88140123, // 0006 GETMBR R5 R0 K35 - 0x88180124, // 0007 GETMBR R6 R0 K36 - 0x781A0001, // 0008 JMPF R6 #000B - 0x58180025, // 0009 LDCONST R6 K37 - 0x70020000, // 000A JMP #000C - 0x58180026, // 000B LDCONST R6 K38 - 0x881C0127, // 000C GETMBR R7 R0 K39 - 0x781E0001, // 000D JMPF R7 #0010 - 0x581C0025, // 000E LDCONST R7 K37 - 0x70020000, // 000F JMP #0011 - 0x581C0026, // 0010 LDCONST R7 K38 - 0x88200128, // 0011 GETMBR R8 R0 K40 - 0x7C080C00, // 0012 CALL R2 6 - 0x880C0129, // 0013 GETMBR R3 R0 K41 - 0x780E0000, // 0014 JMPF R3 #0016 - 0x0008052A, // 0015 ADD R2 R2 K42 - 0x880C012B, // 0016 GETMBR R3 R0 K43 - 0x780E000E, // 0017 JMPF R3 #0027 - 0x0008052C, // 0018 ADD R2 R2 K44 - 0x8C0C032D, // 0019 GETMET R3 R1 K45 - 0x8814012E, // 001A GETMBR R5 R0 K46 - 0x7C0C0400, // 001B CALL R3 2 - 0x00080403, // 001C ADD R2 R2 R3 - 0x600C000C, // 001D GETGBL R3 G12 - 0x8810011E, // 001E GETMBR R4 R0 K30 - 0x7C0C0200, // 001F CALL R3 1 - 0x240C0709, // 0020 GT R3 R3 K9 - 0x780E0004, // 0021 JMPF R3 #0027 - 0x0008052F, // 0022 ADD R2 R2 K47 - 0x8C0C032D, // 0023 GETMET R3 R1 K45 - 0x8814011E, // 0024 GETMBR R5 R0 K30 - 0x7C0C0400, // 0025 CALL R3 2 - 0x00080403, // 0026 ADD R2 R2 R3 - 0x00080530, // 0027 ADD R2 R2 K48 - 0xA8020017, // 0028 EXBLK 0 #0041 - 0x600C0011, // 0029 GETGBL R3 G17 - 0x88100131, // 002A GETMBR R4 R0 K49 - 0x58140032, // 002B LDCONST R5 K50 - 0x7C0C0400, // 002C CALL R3 2 - 0x8C100733, // 002D GETMET R4 R3 K51 - 0x5C180400, // 002E MOVE R6 R2 - 0x7C100400, // 002F CALL R4 2 - 0x8C100734, // 0030 GETMET R4 R3 K52 - 0x7C100200, // 0031 CALL R4 1 - 0xB8126A00, // 0032 GETNGBL R4 K53 - 0x60140018, // 0033 GETGBL R5 G24 - 0x58180036, // 0034 LDCONST R6 K54 - 0x881C012B, // 0035 GETMBR R7 R0 K43 - 0x781E0001, // 0036 JMPF R7 #0039 - 0x581C0037, // 0037 LDCONST R7 K55 - 0x70020000, // 0038 JMP #003A - 0x581C000A, // 0039 LDCONST R7 K10 - 0x7C140400, // 003A CALL R5 2 - 0x58180038, // 003B LDCONST R6 K56 - 0x7C100400, // 003C CALL R4 2 - 0xA8040001, // 003D EXBLK 1 1 - 0x80040400, // 003E RET 1 R2 - 0xA8040001, // 003F EXBLK 1 1 - 0x70020010, // 0040 JMP #0052 - 0xAC0C0002, // 0041 CATCH R3 0 2 - 0x7002000D, // 0042 JMP #0051 - 0xB8166A00, // 0043 GETNGBL R5 K53 - 0x60180008, // 0044 GETGBL R6 G8 - 0x5C1C0600, // 0045 MOVE R7 R3 - 0x7C180200, // 0046 CALL R6 1 - 0x001A7206, // 0047 ADD R6 K57 R6 - 0x00180D3A, // 0048 ADD R6 R6 K58 - 0x601C0008, // 0049 GETGBL R7 G8 - 0x5C200800, // 004A MOVE R8 R4 - 0x7C1C0200, // 004B CALL R7 1 - 0x00180C07, // 004C ADD R6 R6 R7 - 0x581C0038, // 004D LDCONST R7 K56 - 0x7C140400, // 004E CALL R5 2 - 0x80040400, // 004F RET 1 R2 - 0x70020000, // 0050 JMP #0052 - 0xB0080000, // 0051 RAISE 2 R0 R0 - 0x80000000, // 0052 RET 0 - }) - ) -); -/*******************************************************************/ - - -/******************************************************************** -** Solidified function: stop -********************************************************************/ -be_local_closure(class_Matter_Device_stop, /* name */ - be_nested_proto( - 4, /* nstack */ - 1, /* argc */ - 10, /* varg */ - 0, /* has upvals */ - NULL, /* no upvals */ - 0, /* has sup protos */ - NULL, /* no sub protos */ - 1, /* has constants */ - &be_ktab_class_Matter_Device, /* shared constants */ - be_str_weak(stop), - &be_const_str_solidified, - ( &(const binstruction[10]) { /* code */ - 0xB8062000, // 0000 GETNGBL R1 K16 - 0x8C04033B, // 0001 GETMET R1 R1 K59 - 0x5C0C0000, // 0002 MOVE R3 R0 - 0x7C040400, // 0003 CALL R1 2 - 0x88040100, // 0004 GETMBR R1 R0 K0 - 0x78060002, // 0005 JMPF R1 #0009 - 0x88040100, // 0006 GETMBR R1 R0 K0 - 0x8C04033C, // 0007 GETMET R1 R1 K60 - 0x7C040200, // 0008 CALL R1 1 - 0x80000000, // 0009 RET 0 - }) - ) -); -/*******************************************************************/ - - -/******************************************************************** -** Solidified function: sort_distinct -********************************************************************/ -be_local_closure(class_Matter_Device_sort_distinct, /* name */ - be_nested_proto( - 7, /* nstack */ - 1, /* argc */ - 12, /* varg */ - 0, /* has upvals */ - NULL, /* no upvals */ - 0, /* has sup protos */ - NULL, /* no sub protos */ - 1, /* has constants */ - &be_ktab_class_Matter_Device, /* shared constants */ - be_str_weak(sort_distinct), - &be_const_str_solidified, - ( &(const binstruction[53]) { /* code */ - 0x58040004, // 0000 LDCONST R1 K4 - 0x60080010, // 0001 GETGBL R2 G16 - 0x600C000C, // 0002 GETGBL R3 G12 - 0x5C100000, // 0003 MOVE R4 R0 - 0x7C0C0200, // 0004 CALL R3 1 - 0x040C0708, // 0005 SUB R3 R3 K8 - 0x400E1003, // 0006 CONNECT R3 K8 R3 - 0x7C080200, // 0007 CALL R2 1 - 0xA8020010, // 0008 EXBLK 0 #001A - 0x5C0C0400, // 0009 MOVE R3 R2 - 0x7C0C0000, // 000A CALL R3 0 - 0x94100003, // 000B GETIDX R4 R0 R3 - 0x5C140600, // 000C MOVE R5 R3 - 0x24180B09, // 000D GT R6 R5 K9 - 0x781A0008, // 000E JMPF R6 #0018 - 0x04180B08, // 000F SUB R6 R5 K8 - 0x94180006, // 0010 GETIDX R6 R0 R6 - 0x24180C04, // 0011 GT R6 R6 R4 - 0x781A0004, // 0012 JMPF R6 #0018 - 0x04180B08, // 0013 SUB R6 R5 K8 - 0x94180006, // 0014 GETIDX R6 R0 R6 - 0x98000A06, // 0015 SETIDX R0 R5 R6 - 0x04140B08, // 0016 SUB R5 R5 K8 - 0x7001FFF4, // 0017 JMP #000D - 0x98000A04, // 0018 SETIDX R0 R5 R4 - 0x7001FFEE, // 0019 JMP #0009 - 0x58080007, // 001A LDCONST R2 K7 - 0xAC080200, // 001B CATCH R2 1 0 - 0xB0080000, // 001C RAISE 2 R0 R0 - 0x58080008, // 001D LDCONST R2 K8 - 0x600C000C, // 001E GETGBL R3 G12 - 0x5C100000, // 001F MOVE R4 R0 - 0x7C0C0200, // 0020 CALL R3 1 - 0x180C0708, // 0021 LE R3 R3 K8 - 0x780E0000, // 0022 JMPF R3 #0024 - 0x80040000, // 0023 RET 1 R0 - 0x940C0109, // 0024 GETIDX R3 R0 K9 - 0x6010000C, // 0025 GETGBL R4 G12 - 0x5C140000, // 0026 MOVE R5 R0 - 0x7C100200, // 0027 CALL R4 1 - 0x14100404, // 0028 LT R4 R2 R4 - 0x78120009, // 0029 JMPF R4 #0034 - 0x94100002, // 002A GETIDX R4 R0 R2 - 0x1C100803, // 002B EQ R4 R4 R3 - 0x78120003, // 002C JMPF R4 #0031 - 0x8C10013D, // 002D GETMET R4 R0 K61 - 0x5C180400, // 002E MOVE R6 R2 - 0x7C100400, // 002F CALL R4 2 - 0x70020001, // 0030 JMP #0033 - 0x940C0002, // 0031 GETIDX R3 R0 R2 - 0x00080508, // 0032 ADD R2 R2 K8 - 0x7001FFF0, // 0033 JMP #0025 - 0x80040000, // 0034 RET 1 R0 - }) - ) -); -/*******************************************************************/ - - -/******************************************************************** -** Solidified function: event_fabrics_saved -********************************************************************/ -be_local_closure(class_Matter_Device_event_fabrics_saved, /* name */ - be_nested_proto( - 3, /* nstack */ - 1, /* argc */ - 10, /* varg */ - 0, /* has upvals */ - NULL, /* no upvals */ - 0, /* has sup protos */ - NULL, /* no sub protos */ - 1, /* has constants */ - &be_ktab_class_Matter_Device, /* shared constants */ - be_str_weak(event_fabrics_saved), - &be_const_str_solidified, - ( &(const binstruction[12]) { /* code */ - 0x8804013E, // 0000 GETMBR R1 R0 K62 - 0x8C04033F, // 0001 GETMET R1 R1 K63 - 0x7C040200, // 0002 CALL R1 1 - 0x24040309, // 0003 GT R1 R1 K9 - 0x78060005, // 0004 JMPF R1 #000B - 0x8804012B, // 0005 GETMBR R1 R0 K43 - 0x74060003, // 0006 JMPT R1 #000B - 0x50040200, // 0007 LDBOOL R1 1 0 - 0x90025601, // 0008 SETMBR R0 K43 R1 - 0x8C040140, // 0009 GETMET R1 R0 K64 - 0x7C040200, // 000A CALL R1 1 - 0x80000000, // 000B RET 0 - }) - ) -); -/*******************************************************************/ - - -/******************************************************************** -** Solidified function: autoconf_device -********************************************************************/ -be_local_closure(class_Matter_Device_autoconf_device, /* name */ - be_nested_proto( - 5, /* nstack */ - 1, /* argc */ - 10, /* varg */ - 0, /* has upvals */ - NULL, /* no upvals */ - 0, /* has sup protos */ - NULL, /* no sub protos */ - 1, /* has constants */ - &be_ktab_class_Matter_Device, /* shared constants */ - be_str_weak(autoconf_device), - &be_const_str_solidified, - ( &(const binstruction[50]) { /* code */ - 0xA4063E00, // 0000 IMPORT R1 K31 - 0x6008000C, // 0001 GETGBL R2 G12 - 0x880C010B, // 0002 GETMBR R3 R0 K11 + ( &(const binstruction[48]) { /* code */ + 0xA4060000, // 0000 IMPORT R1 K0 + 0xB80A0200, // 0001 GETNGBL R2 K1 + 0x8C080502, // 0002 GETMET R2 R2 K2 0x7C080200, // 0003 CALL R2 1 - 0x24080509, // 0004 GT R2 R2 K9 - 0x780A0000, // 0005 JMPF R2 #0007 - 0x80000400, // 0006 RET 0 - 0x88080141, // 0007 GETMBR R2 R0 K65 - 0x4C0C0000, // 0008 LDNIL R3 - 0x1C080403, // 0009 EQ R2 R2 R3 - 0x780A0004, // 000A JMPF R2 #0010 - 0xB80A2800, // 000B GETNGBL R2 K20 - 0x8C080542, // 000C GETMET R2 R2 K66 - 0x5C100000, // 000D MOVE R4 R0 - 0x7C080400, // 000E CALL R2 2 - 0x90028202, // 000F SETMBR R0 K65 R2 - 0x8808012B, // 0010 GETMBR R2 R0 K43 - 0x740A000F, // 0011 JMPT R2 #0022 - 0x88080141, // 0012 GETMBR R2 R0 K65 - 0x8C080543, // 0013 GETMET R2 R2 K67 - 0x7C080200, // 0014 CALL R2 1 - 0x90025C02, // 0015 SETMBR R0 K46 R2 - 0x60080013, // 0016 GETGBL R2 G19 - 0x7C080000, // 0017 CALL R2 0 - 0x90023C02, // 0018 SETMBR R0 K30 R2 - 0x8C080144, // 0019 GETMET R2 R0 K68 - 0x7C080200, // 001A CALL R2 1 - 0xB80A6A00, // 001B GETNGBL R2 K53 - 0x600C0008, // 001C GETGBL R3 G8 - 0x8810012E, // 001D GETMBR R4 R0 K46 - 0x7C0C0200, // 001E CALL R3 1 - 0x000E8A03, // 001F ADD R3 K69 R3 - 0x58100046, // 0020 LDCONST R4 K70 - 0x7C080400, // 0021 CALL R2 2 - 0x88080141, // 0022 GETMBR R2 R0 K65 - 0x8C080547, // 0023 GETMET R2 R2 K71 - 0x8810012E, // 0024 GETMBR R4 R0 K46 - 0x7C080400, // 0025 CALL R2 2 - 0x8808012B, // 0026 GETMBR R2 R0 K43 - 0x740A0008, // 0027 JMPT R2 #0031 - 0x8808013E, // 0028 GETMBR R2 R0 K62 - 0x8C08053F, // 0029 GETMET R2 R2 K63 - 0x7C080200, // 002A CALL R2 1 - 0x24080509, // 002B GT R2 R2 K9 - 0x780A0003, // 002C JMPF R2 #0031 - 0x50080200, // 002D LDBOOL R2 1 0 - 0x90025602, // 002E SETMBR R0 K43 R2 - 0x8C080140, // 002F GETMET R2 R0 K64 - 0x7C080200, // 0030 CALL R2 1 - 0x80000000, // 0031 RET 0 - }) - ) -); -/*******************************************************************/ - - -/******************************************************************** -** Solidified function: msg_received -********************************************************************/ -be_local_closure(class_Matter_Device_msg_received, /* name */ - be_nested_proto( - 9, /* nstack */ - 4, /* argc */ - 10, /* varg */ - 0, /* has upvals */ - NULL, /* no upvals */ - 0, /* has sup protos */ - NULL, /* no sub protos */ - 1, /* has constants */ - &be_ktab_class_Matter_Device, /* shared constants */ - be_str_weak(msg_received), - &be_const_str_solidified, - ( &(const binstruction[ 7]) { /* code */ - 0x88100118, // 0000 GETMBR R4 R0 K24 - 0x8C100948, // 0001 GETMET R4 R4 K72 - 0x5C180200, // 0002 MOVE R6 R1 - 0x5C1C0400, // 0003 MOVE R7 R2 - 0x5C200600, // 0004 MOVE R8 R3 - 0x7C100800, // 0005 CALL R4 4 - 0x80040800, // 0006 RET 1 R4 - }) - ) -); -/*******************************************************************/ - - -/******************************************************************** -** Solidified function: resolve_attribute_read_solo -********************************************************************/ -be_local_closure(class_Matter_Device_resolve_attribute_read_solo, /* name */ - be_nested_proto( - 10, /* nstack */ - 2, /* argc */ - 10, /* varg */ - 0, /* has upvals */ - NULL, /* no upvals */ - 0, /* has sup protos */ - NULL, /* no sub protos */ - 1, /* has constants */ - &be_ktab_class_Matter_Device, /* shared constants */ - be_str_weak(resolve_attribute_read_solo), - &be_const_str_solidified, - ( &(const binstruction[47]) { /* code */ - 0x8808030D, // 0000 GETMBR R2 R1 K13 - 0x880C0316, // 0001 GETMBR R3 R1 K22 - 0x88100317, // 0002 GETMBR R4 R1 K23 - 0x4C140000, // 0003 LDNIL R5 - 0x1C140405, // 0004 EQ R5 R2 R5 - 0x74160005, // 0005 JMPT R5 #000C - 0x4C140000, // 0006 LDNIL R5 - 0x1C140605, // 0007 EQ R5 R3 R5 - 0x74160002, // 0008 JMPT R5 #000C - 0x4C140000, // 0009 LDNIL R5 - 0x1C140805, // 000A EQ R5 R4 R5 - 0x78160001, // 000B JMPF R5 #000E - 0x4C140000, // 000C LDNIL R5 - 0x80040A00, // 000D RET 1 R5 - 0x8C140149, // 000E GETMET R5 R0 K73 - 0x5C1C0400, // 000F MOVE R7 R2 - 0x7C140400, // 0010 CALL R5 2 - 0x4C180000, // 0011 LDNIL R6 - 0x1C180A06, // 0012 EQ R6 R5 R6 - 0x781A0005, // 0013 JMPF R6 #001A - 0xB81A2800, // 0014 GETNGBL R6 K20 - 0x88180D4B, // 0015 GETMBR R6 R6 K75 - 0x90069406, // 0016 SETMBR R1 K74 R6 - 0x4C180000, // 0017 LDNIL R6 - 0x80040C00, // 0018 RET 1 R6 - 0x70020013, // 0019 JMP #002E - 0x8C180B4C, // 001A GETMET R6 R5 K76 - 0x5C200600, // 001B MOVE R8 R3 - 0x7C180400, // 001C CALL R6 2 - 0x741A0005, // 001D JMPT R6 #0024 - 0xB81A2800, // 001E GETNGBL R6 K20 - 0x88180D4D, // 001F GETMBR R6 R6 K77 - 0x90069406, // 0020 SETMBR R1 K74 R6 - 0x4C180000, // 0021 LDNIL R6 - 0x80040C00, // 0022 RET 1 R6 - 0x70020009, // 0023 JMP #002E - 0x8C180B4E, // 0024 GETMET R6 R5 K78 - 0x5C200600, // 0025 MOVE R8 R3 - 0x5C240800, // 0026 MOVE R9 R4 - 0x7C180600, // 0027 CALL R6 3 - 0x741A0004, // 0028 JMPT R6 #002E - 0xB81A2800, // 0029 GETNGBL R6 K20 - 0x88180D4F, // 002A GETMBR R6 R6 K79 - 0x90069406, // 002B SETMBR R1 K74 R6 - 0x4C180000, // 002C LDNIL R6 - 0x80040C00, // 002D RET 1 R6 - 0x80040A00, // 002E RET 1 R5 - }) - ) -); -/*******************************************************************/ - - -/******************************************************************** -** Solidified function: clean_remotes -********************************************************************/ -be_local_closure(class_Matter_Device_clean_remotes, /* name */ - be_nested_proto( - 10, /* nstack */ - 1, /* argc */ - 10, /* varg */ - 0, /* has upvals */ - NULL, /* no upvals */ - 0, /* has sup protos */ - NULL, /* no sub protos */ - 1, /* has constants */ - &be_ktab_class_Matter_Device, /* shared constants */ - be_str_weak(clean_remotes), - &be_const_str_solidified, - ( &(const binstruction[80]) { /* code */ - 0xA406A000, // 0000 IMPORT R1 K80 - 0x88080151, // 0001 GETMBR R2 R0 K81 - 0x780A004B, // 0002 JMPF R2 #004F - 0x60080013, // 0003 GETGBL R2 G19 - 0x7C080000, // 0004 CALL R2 0 - 0x600C0010, // 0005 GETGBL R3 G16 - 0x88100151, // 0006 GETMBR R4 R0 K81 - 0x7C0C0200, // 0007 CALL R3 1 - 0xA8020003, // 0008 EXBLK 0 #000D - 0x5C100600, // 0009 MOVE R4 R3 - 0x7C100000, // 000A CALL R4 0 - 0x98080909, // 000B SETIDX R2 R4 K9 - 0x7001FFFB, // 000C JMP #0009 - 0x580C0007, // 000D LDCONST R3 K7 - 0xAC0C0200, // 000E CATCH R3 1 0 - 0xB0080000, // 000F RAISE 2 R0 R0 - 0x600C0010, // 0010 GETGBL R3 G16 - 0x8810010B, // 0011 GETMBR R4 R0 K11 - 0x7C0C0200, // 0012 CALL R3 1 - 0xA802000F, // 0013 EXBLK 0 #0024 - 0x5C100600, // 0014 MOVE R4 R3 - 0x7C100000, // 0015 CALL R4 0 - 0x8C140352, // 0016 GETMET R5 R1 K82 - 0x5C1C0800, // 0017 MOVE R7 R4 - 0x58200053, // 0018 LDCONST R8 K83 - 0x7C140600, // 0019 CALL R5 3 - 0x4C180000, // 001A LDNIL R6 - 0x20180A06, // 001B NE R6 R5 R6 - 0x781A0005, // 001C JMPF R6 #0023 - 0x8C18051D, // 001D GETMET R6 R2 K29 - 0x5C200A00, // 001E MOVE R8 R5 - 0x58240009, // 001F LDCONST R9 K9 - 0x7C180600, // 0020 CALL R6 3 - 0x00180D08, // 0021 ADD R6 R6 K8 - 0x98080A06, // 0022 SETIDX R2 R5 R6 - 0x7001FFEF, // 0023 JMP #0014 - 0x580C0007, // 0024 LDCONST R3 K7 - 0xAC0C0200, // 0025 CATCH R3 1 0 - 0xB0080000, // 0026 RAISE 2 R0 R0 - 0x600C0012, // 0027 GETGBL R3 G18 - 0x7C0C0000, // 0028 CALL R3 0 - 0x60100010, // 0029 GETGBL R4 G16 - 0x8C140505, // 002A GETMET R5 R2 K5 + 0xB80E0200, // 0004 GETNGBL R3 K1 + 0x8C0C0703, // 0005 GETMET R3 R3 K3 + 0x58140004, // 0006 LDCONST R5 K4 + 0x7C0C0400, // 0007 CALL R3 2 + 0x780E0006, // 0008 JMPF R3 #0010 + 0xB80E0A00, // 0009 GETNGBL R3 K5 + 0x60100008, // 000A GETGBL R4 G8 + 0x5C140400, // 000B MOVE R5 R2 + 0x7C100200, // 000C CALL R4 1 + 0x00120C04, // 000D ADD R4 K6 R4 + 0x58140004, // 000E LDCONST R5 K4 + 0x7C0C0400, // 000F CALL R3 2 + 0x4C0C0000, // 0010 LDNIL R3 + 0x1C0C0403, // 0011 EQ R3 R2 R3 + 0x780E0000, // 0012 JMPF R3 #0014 + 0x80000600, // 0013 RET 0 + 0x8C0C0307, // 0014 GETMET R3 R1 K7 + 0x5C140400, // 0015 MOVE R5 R2 + 0x7C0C0400, // 0016 CALL R3 2 + 0x4C100000, // 0017 LDNIL R4 + 0x20100604, // 0018 NE R4 R3 R4 + 0x7812000D, // 0019 JMPF R4 #0028 + 0x58100008, // 001A LDCONST R4 K8 + 0x6014000C, // 001B GETGBL R5 G12 + 0x88180109, // 001C GETMBR R6 R0 K9 + 0x7C140200, // 001D CALL R5 1 + 0x14140805, // 001E LT R5 R4 R5 + 0x78160006, // 001F JMPF R5 #0027 + 0x88140109, // 0020 GETMBR R5 R0 K9 + 0x94140A04, // 0021 GETIDX R5 R5 R4 + 0x8C140B0A, // 0022 GETMET R5 R5 K10 + 0x5C1C0600, // 0023 MOVE R7 R3 + 0x7C140400, // 0024 CALL R5 2 + 0x0010090B, // 0025 ADD R4 R4 K11 + 0x7001FFF3, // 0026 JMP #001B + 0x70020006, // 0027 JMP #002F + 0xB8120A00, // 0028 GETNGBL R4 K5 + 0x60140008, // 0029 GETGBL R5 G8 + 0x5C180400, // 002A MOVE R6 R2 0x7C140200, // 002B CALL R5 1 - 0x7C100200, // 002C CALL R4 1 - 0xA8020008, // 002D EXBLK 0 #0037 - 0x5C140800, // 002E MOVE R5 R4 - 0x7C140000, // 002F CALL R5 0 - 0x94180405, // 0030 GETIDX R6 R2 R5 - 0x1C180D09, // 0031 EQ R6 R6 K9 - 0x781A0002, // 0032 JMPF R6 #0036 - 0x8C180706, // 0033 GETMET R6 R3 K6 - 0x5C200A00, // 0034 MOVE R8 R5 - 0x7C180400, // 0035 CALL R6 2 - 0x7001FFF6, // 0036 JMP #002E - 0x58100007, // 0037 LDCONST R4 K7 - 0xAC100200, // 0038 CATCH R4 1 0 - 0xB0080000, // 0039 RAISE 2 R0 R0 - 0x60100010, // 003A GETGBL R4 G16 - 0x5C140600, // 003B MOVE R5 R3 - 0x7C100200, // 003C CALL R4 1 - 0xA802000D, // 003D EXBLK 0 #004C - 0x5C140800, // 003E MOVE R5 R4 - 0x7C140000, // 003F CALL R5 0 - 0xB81A6A00, // 0040 GETNGBL R6 K53 - 0x881C0B55, // 0041 GETMBR R7 R5 K85 - 0x001EA807, // 0042 ADD R7 K84 R7 - 0x58200046, // 0043 LDCONST R8 K70 - 0x7C180400, // 0044 CALL R6 2 - 0x8C180B34, // 0045 GETMET R6 R5 K52 - 0x7C180200, // 0046 CALL R6 1 - 0x88180151, // 0047 GETMBR R6 R0 K81 - 0x8C180D3D, // 0048 GETMET R6 R6 K61 - 0x88200B55, // 0049 GETMBR R8 R5 K85 - 0x7C180400, // 004A CALL R6 2 - 0x7001FFF1, // 004B JMP #003E - 0x58100007, // 004C LDCONST R4 K7 - 0xAC100200, // 004D CATCH R4 1 0 - 0xB0080000, // 004E RAISE 2 R0 R0 - 0x80000000, // 004F RET 0 + 0x00161805, // 002C ADD R5 K12 R5 + 0x58180004, // 002D LDCONST R6 K4 + 0x7C100400, // 002E CALL R4 2 + 0x80000000, // 002F RET 0 }) ) ); @@ -1112,58 +294,11 @@ be_local_closure(class_Matter_Device_clean_remotes, /* name */ /******************************************************************** -** Solidified function: invoke_request +** Solidified function: read_sensors_scheduler ********************************************************************/ -be_local_closure(class_Matter_Device_invoke_request, /* name */ +be_local_closure(class_Matter_Device_read_sensors_scheduler, /* name */ be_nested_proto( - 12, /* nstack */ - 4, /* argc */ - 10, /* varg */ - 0, /* has upvals */ - NULL, /* no upvals */ - 0, /* has sup protos */ - NULL, /* no sub protos */ - 1, /* has constants */ - &be_ktab_class_Matter_Device, /* shared constants */ - be_str_weak(invoke_request), - &be_const_str_solidified, - ( &(const binstruction[24]) { /* code */ - 0x58100009, // 0000 LDCONST R4 K9 - 0x8814070D, // 0001 GETMBR R5 R3 K13 - 0x6018000C, // 0002 GETGBL R6 G12 - 0x881C010B, // 0003 GETMBR R7 R0 K11 - 0x7C180200, // 0004 CALL R6 1 - 0x14180806, // 0005 LT R6 R4 R6 - 0x781A000C, // 0006 JMPF R6 #0014 - 0x8818010B, // 0007 GETMBR R6 R0 K11 - 0x94180C04, // 0008 GETIDX R6 R6 R4 - 0x881C0D0D, // 0009 GETMBR R7 R6 K13 - 0x1C1C0E05, // 000A EQ R7 R7 R5 - 0x781E0005, // 000B JMPF R7 #0012 - 0x8C1C0D56, // 000C GETMET R7 R6 K86 - 0x5C240200, // 000D MOVE R9 R1 - 0x5C280400, // 000E MOVE R10 R2 - 0x5C2C0600, // 000F MOVE R11 R3 - 0x7C1C0800, // 0010 CALL R7 4 - 0x80040E00, // 0011 RET 1 R7 - 0x00100908, // 0012 ADD R4 R4 K8 - 0x7001FFED, // 0013 JMP #0002 - 0xB81A2800, // 0014 GETNGBL R6 K20 - 0x88180D4B, // 0015 GETMBR R6 R6 K75 - 0x900E9406, // 0016 SETMBR R3 K74 R6 - 0x80000000, // 0017 RET 0 - }) - ) -); -/*******************************************************************/ - - -/******************************************************************** -** Solidified function: init -********************************************************************/ -be_local_closure(class_Matter_Device_init, /* name */ - be_nested_proto( - 6, /* nstack */ + 4, /* nstack */ 1, /* argc */ 10, /* varg */ 0, /* has upvals */ @@ -1172,89 +307,30 @@ be_local_closure(class_Matter_Device_init, /* name */ NULL, /* no sub protos */ 1, /* has constants */ &be_ktab_class_Matter_Device, /* shared constants */ - be_str_weak(init), + be_str_weak(read_sensors_scheduler), &be_const_str_solidified, - ( &(const binstruction[80]) { /* code */ - 0xA406AE00, // 0000 IMPORT R1 K87 - 0xB80A2000, // 0001 GETNGBL R2 K16 - 0x8C080558, // 0002 GETMET R2 R2 K88 - 0xB8122800, // 0003 GETNGBL R4 K20 - 0x88100959, // 0004 GETMBR R4 R4 K89 - 0x7C080400, // 0005 CALL R2 2 - 0x740A0006, // 0006 JMPT R2 #000E - 0xB80A2800, // 0007 GETNGBL R2 K20 - 0x8C08055B, // 0008 GETMET R2 R2 K91 - 0x5C100000, // 0009 MOVE R4 R0 - 0x50140000, // 000A LDBOOL R5 0 0 - 0x7C080600, // 000B CALL R2 3 - 0x9002B402, // 000C SETMBR R0 K90 R2 - 0x80000400, // 000D RET 0 - 0xB80A2800, // 000E GETNGBL R2 K20 - 0xB80E2800, // 000F GETNGBL R3 K20 - 0x8C0C075D, // 0010 GETMET R3 R3 K93 - 0x7C0C0200, // 0011 CALL R3 1 - 0x900AB803, // 0012 SETMBR R2 K92 R3 - 0x50080000, // 0013 LDBOOL R2 0 0 - 0x9002BC02, // 0014 SETMBR R0 K94 R2 - 0x9002BF09, // 0015 SETMBR R0 K95 K9 - 0x60080012, // 0016 GETGBL R2 G18 - 0x7C080000, // 0017 CALL R2 0 - 0x90021602, // 0018 SETMBR R0 K11 R2 - 0x50080000, // 0019 LDBOOL R2 0 0 - 0x90025602, // 001A SETMBR R0 K43 R2 - 0x60080013, // 001B GETGBL R2 G19 - 0x7C080000, // 001C CALL R2 0 - 0x90023C02, // 001D SETMBR R0 K30 R2 - 0x88080160, // 001E GETMBR R2 R0 K96 - 0x90025002, // 001F SETMBR R0 K40 R2 - 0x50080000, // 0020 LDBOOL R2 0 0 - 0x90024802, // 0021 SETMBR R0 K36 R2 - 0x50080000, // 0022 LDBOOL R2 0 0 - 0x90024E02, // 0023 SETMBR R0 K39 R2 - 0xB80A2800, // 0024 GETNGBL R2 K20 - 0x8C080562, // 0025 GETMET R2 R2 K98 - 0x5C100000, // 0026 MOVE R4 R0 - 0x7C080400, // 0027 CALL R2 2 - 0x9002C202, // 0028 SETMBR R0 K97 R2 - 0x8C080163, // 0029 GETMET R2 R0 K99 - 0x7C080200, // 002A CALL R2 1 - 0xB80A2800, // 002B GETNGBL R2 K20 - 0x8C080564, // 002C GETMET R2 R2 K100 - 0x5C100000, // 002D MOVE R4 R0 - 0x7C080400, // 002E CALL R2 2 - 0x90027C02, // 002F SETMBR R0 K62 R2 - 0x8808013E, // 0030 GETMBR R2 R0 K62 - 0x8C080565, // 0031 GETMET R2 R2 K101 - 0x7C080200, // 0032 CALL R2 1 - 0xB80A2800, // 0033 GETNGBL R2 K20 - 0x8C080566, // 0034 GETMET R2 R2 K102 - 0x5C100000, // 0035 MOVE R4 R0 - 0x7C080400, // 0036 CALL R2 2 - 0x90023002, // 0037 SETMBR R0 K24 R2 - 0xB80A2800, // 0038 GETNGBL R2 K20 - 0x8C080568, // 0039 GETMET R2 R2 K104 - 0x5C100000, // 003A MOVE R4 R0 - 0x7C080400, // 003B CALL R2 2 - 0x9002CE02, // 003C SETMBR R0 K103 R2 - 0x8C08016A, // 003D GETMET R2 R0 K106 - 0x7C080200, // 003E CALL R2 1 - 0x9002D202, // 003F SETMBR R0 K105 R2 - 0xB80A2800, // 0040 GETNGBL R2 K20 - 0x8C08055B, // 0041 GETMET R2 R2 K91 - 0x5C100000, // 0042 MOVE R4 R0 - 0x50140200, // 0043 LDBOOL R5 1 0 - 0x7C080600, // 0044 CALL R2 3 - 0x9002B402, // 0045 SETMBR R0 K90 R2 - 0x88080161, // 0046 GETMBR R2 R0 K97 - 0x8C08056B, // 0047 GETMET R2 R2 K107 - 0x7C080200, // 0048 CALL R2 1 - 0xB80A2000, // 0049 GETNGBL R2 K16 - 0x8C08056C, // 004A GETMET R2 R2 K108 - 0x5C100000, // 004B MOVE R4 R0 - 0x7C080400, // 004C CALL R2 2 - 0x8C08016D, // 004D GETMET R2 R0 K109 - 0x7C080200, // 004E CALL R2 1 - 0x80000000, // 004F RET 0 + ( &(const binstruction[21]) { /* code */ + 0x8804010D, // 0000 GETMBR R1 R0 K13 + 0x4C080000, // 0001 LDNIL R2 + 0x1C040202, // 0002 EQ R1 R1 R2 + 0x78060000, // 0003 JMPF R1 #0005 + 0x80000200, // 0004 RET 0 + 0x8804010E, // 0005 GETMBR R1 R0 K14 + 0x1C040308, // 0006 EQ R1 R1 K8 + 0x74060004, // 0007 JMPT R1 #000D + 0xB8060200, // 0008 GETNGBL R1 K1 + 0x8C04030F, // 0009 GETMET R1 R1 K15 + 0x880C010E, // 000A GETMBR R3 R0 K14 + 0x7C040400, // 000B CALL R1 2 + 0x78060006, // 000C JMPF R1 #0014 + 0x8C040110, // 000D GETMET R1 R0 K16 + 0x7C040200, // 000E CALL R1 1 + 0xB8060200, // 000F GETNGBL R1 K1 + 0x8C040311, // 0010 GETMET R1 R1 K17 + 0x880C010D, // 0011 GETMBR R3 R0 K13 + 0x7C040400, // 0012 CALL R1 2 + 0x90021C01, // 0013 SETMBR R0 K14 R1 + 0x80000000, // 0014 RET 0 }) ) ); @@ -1292,17 +368,17 @@ be_local_closure(class_Matter_Device_button_pressed, /* name */ 0x3C180406, // 000B SHR R6 R2 R6 0x541E00FE, // 000C LDINT R7 255 0x2C180C07, // 000D AND R6 R6 R7 - 0x8C1C016E, // 000E GETMET R7 R0 K110 - 0x00240B08, // 000F ADD R9 R5 K8 + 0x8C1C0112, // 000E GETMET R7 R0 K18 + 0x00240B0B, // 000F ADD R9 R5 K11 0x20280604, // 0010 NE R10 R3 R4 0x782A0001, // 0011 JMPF R10 #0014 - 0x58280008, // 0012 LDCONST R10 K8 + 0x5828000B, // 0012 LDCONST R10 K11 0x70020000, // 0013 JMP #0015 - 0x58280009, // 0014 LDCONST R10 K9 + 0x58280008, // 0014 LDCONST R10 K8 0x780E0001, // 0015 JMPF R3 #0018 - 0x582C0009, // 0016 LDCONST R11 K9 + 0x582C0008, // 0016 LDCONST R11 K8 0x70020000, // 0017 JMP #0019 - 0x582C0008, // 0018 LDCONST R11 K8 + 0x582C000B, // 0018 LDCONST R11 K11 0x5C300C00, // 0019 MOVE R12 R6 0x7C1C0A00, // 001A CALL R7 5 0x80000000, // 001B RET 0 @@ -1312,6 +388,518 @@ be_local_closure(class_Matter_Device_button_pressed, /* name */ /*******************************************************************/ +/******************************************************************** +** Solidified function: check_config_ep +********************************************************************/ +be_local_closure(class_Matter_Device_check_config_ep, /* name */ + be_nested_proto( + 10, /* nstack */ + 1, /* argc */ + 10, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + &be_ktab_class_Matter_Device, /* shared constants */ + be_str_weak(check_config_ep), + &be_const_str_solidified, + ( &(const binstruction[63]) { /* code */ + 0x50040000, // 0000 LDBOOL R1 0 0 + 0x60080012, // 0001 GETGBL R2 G18 + 0x7C080000, // 0002 CALL R2 0 + 0x600C0010, // 0003 GETGBL R3 G16 + 0x88100113, // 0004 GETMBR R4 R0 K19 + 0x8C100914, // 0005 GETMET R4 R4 K20 + 0x7C100200, // 0006 CALL R4 1 + 0x7C0C0200, // 0007 CALL R3 1 + 0xA8020007, // 0008 EXBLK 0 #0011 + 0x5C100600, // 0009 MOVE R4 R3 + 0x7C100000, // 000A CALL R4 0 + 0x8C140515, // 000B GETMET R5 R2 K21 + 0x601C0009, // 000C GETGBL R7 G9 + 0x5C200800, // 000D MOVE R8 R4 + 0x7C1C0200, // 000E CALL R7 1 + 0x7C140400, // 000F CALL R5 2 + 0x7001FFF7, // 0010 JMP #0009 + 0x580C0016, // 0011 LDCONST R3 K22 + 0xAC0C0200, // 0012 CATCH R3 1 0 + 0xB0080000, // 0013 RAISE 2 R0 R0 + 0x600C0010, // 0014 GETGBL R3 G16 + 0x5C100400, // 0015 MOVE R4 R2 + 0x7C0C0200, // 0016 CALL R3 1 + 0xA8020022, // 0017 EXBLK 0 #003B + 0x5C100600, // 0018 MOVE R4 R3 + 0x7C100000, // 0019 CALL R4 0 + 0xB8162E00, // 001A GETNGBL R5 K23 + 0x88140B18, // 001B GETMBR R5 R5 K24 + 0x1C140805, // 001C EQ R5 R4 R5 + 0x7816001B, // 001D JMPF R5 #003A + 0x50040200, // 001E LDBOOL R1 1 0 + 0xB8160A00, // 001F GETNGBL R5 K5 + 0x60180018, // 0020 GETGBL R6 G24 + 0x581C0019, // 0021 LDCONST R7 K25 + 0x5C200800, // 0022 MOVE R8 R4 + 0x8824011A, // 0023 GETMBR R9 R0 K26 + 0x7C180600, // 0024 CALL R6 3 + 0x581C001B, // 0025 LDCONST R7 K27 + 0x7C140400, // 0026 CALL R5 2 + 0x60140008, // 0027 GETGBL R5 G8 + 0x8818011A, // 0028 GETMBR R6 R0 K26 + 0x7C140200, // 0029 CALL R5 1 + 0x88180113, // 002A GETMBR R6 R0 K19 + 0x601C0008, // 002B GETGBL R7 G8 + 0x5C200800, // 002C MOVE R8 R4 + 0x7C1C0200, // 002D CALL R7 1 + 0x88200113, // 002E GETMBR R8 R0 K19 + 0x941C1007, // 002F GETIDX R7 R8 R7 + 0x98180A07, // 0030 SETIDX R6 R5 R7 + 0x88140113, // 0031 GETMBR R5 R0 K19 + 0x8C140B1C, // 0032 GETMET R5 R5 K28 + 0x601C0008, // 0033 GETGBL R7 G8 + 0x5C200800, // 0034 MOVE R8 R4 + 0x7C1C0200, // 0035 CALL R7 1 + 0x7C140400, // 0036 CALL R5 2 + 0x8814011A, // 0037 GETMBR R5 R0 K26 + 0x00140B0B, // 0038 ADD R5 R5 K11 + 0x90023405, // 0039 SETMBR R0 K26 R5 + 0x7001FFDC, // 003A JMP #0018 + 0x580C0016, // 003B LDCONST R3 K22 + 0xAC0C0200, // 003C CATCH R3 1 0 + 0xB0080000, // 003D RAISE 2 R0 R0 + 0x80040200, // 003E RET 1 R1 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: invoke_request +********************************************************************/ +be_local_closure(class_Matter_Device_invoke_request, /* name */ + be_nested_proto( + 12, /* nstack */ + 4, /* argc */ + 10, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + &be_ktab_class_Matter_Device, /* shared constants */ + be_str_weak(invoke_request), + &be_const_str_solidified, + ( &(const binstruction[24]) { /* code */ + 0x58100008, // 0000 LDCONST R4 K8 + 0x8814071D, // 0001 GETMBR R5 R3 K29 + 0x6018000C, // 0002 GETGBL R6 G12 + 0x881C0109, // 0003 GETMBR R7 R0 K9 + 0x7C180200, // 0004 CALL R6 1 + 0x14180806, // 0005 LT R6 R4 R6 + 0x781A000C, // 0006 JMPF R6 #0014 + 0x88180109, // 0007 GETMBR R6 R0 K9 + 0x94180C04, // 0008 GETIDX R6 R6 R4 + 0x881C0D1D, // 0009 GETMBR R7 R6 K29 + 0x1C1C0E05, // 000A EQ R7 R7 R5 + 0x781E0005, // 000B JMPF R7 #0012 + 0x8C1C0D1E, // 000C GETMET R7 R6 K30 + 0x5C240200, // 000D MOVE R9 R1 + 0x5C280400, // 000E MOVE R10 R2 + 0x5C2C0600, // 000F MOVE R11 R3 + 0x7C1C0800, // 0010 CALL R7 4 + 0x80040E00, // 0011 RET 1 R7 + 0x0010090B, // 0012 ADD R4 R4 K11 + 0x7001FFED, // 0013 JMP #0002 + 0xB81A2E00, // 0014 GETNGBL R6 K23 + 0x88180D20, // 0015 GETMBR R6 R6 K32 + 0x900E3E06, // 0016 SETMBR R3 K31 R6 + 0x80000000, // 0017 RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: signal_endpoints_changed +********************************************************************/ +be_local_closure(class_Matter_Device_signal_endpoints_changed, /* name */ + be_nested_proto( + 7, /* nstack */ + 1, /* argc */ + 10, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + &be_ktab_class_Matter_Device, /* shared constants */ + be_str_weak(signal_endpoints_changed), + &be_const_str_solidified, + ( &(const binstruction[14]) { /* code */ + 0x8C040121, // 0000 GETMET R1 R0 K33 + 0x580C0008, // 0001 LDCONST R3 K8 + 0x5412001C, // 0002 LDINT R4 29 + 0x58140004, // 0003 LDCONST R5 K4 + 0x50180000, // 0004 LDBOOL R6 0 0 + 0x7C040A00, // 0005 CALL R1 5 + 0x8C040121, // 0006 GETMET R1 R0 K33 + 0xB80E2E00, // 0007 GETNGBL R3 K23 + 0x880C0718, // 0008 GETMBR R3 R3 K24 + 0x5412001C, // 0009 LDINT R4 29 + 0x58140004, // 000A LDCONST R5 K4 + 0x50180000, // 000B LDBOOL R6 0 0 + 0x7C040A00, // 000C CALL R1 5 + 0x80000000, // 000D RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: load_param +********************************************************************/ +be_local_closure(class_Matter_Device_load_param, /* name */ + be_nested_proto( + 12, /* nstack */ + 1, /* argc */ + 10, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + &be_ktab_class_Matter_Device, /* shared constants */ + be_str_weak(load_param), + &be_const_str_solidified, + ( &(const binstruction[136]) { /* code */ + 0xA4064400, // 0000 IMPORT R1 K34 + 0x50080000, // 0001 LDBOOL R2 0 0 + 0xA8020056, // 0002 EXBLK 0 #005A + 0x600C0011, // 0003 GETGBL R3 G17 + 0x88100123, // 0004 GETMBR R4 R0 K35 + 0x7C0C0200, // 0005 CALL R3 1 + 0x8C100724, // 0006 GETMET R4 R3 K36 + 0x7C100200, // 0007 CALL R4 1 + 0x8C140725, // 0008 GETMET R5 R3 K37 + 0x7C140200, // 0009 CALL R5 1 + 0xA4160000, // 000A IMPORT R5 K0 + 0x8C180B07, // 000B GETMET R6 R5 K7 + 0x5C200800, // 000C MOVE R8 R4 + 0x7C180400, // 000D CALL R6 2 + 0x8C1C0D27, // 000E GETMET R7 R6 K39 + 0x58240028, // 000F LDCONST R9 K40 + 0x88280126, // 0010 GETMBR R10 R0 K38 + 0x7C1C0600, // 0011 CALL R7 3 + 0x90024C07, // 0012 SETMBR R0 K38 R7 + 0x8C1C0D27, // 0013 GETMET R7 R6 K39 + 0x5824002A, // 0014 LDCONST R9 K42 + 0x88280129, // 0015 GETMBR R10 R0 K41 + 0x7C1C0600, // 0016 CALL R7 3 + 0x90025207, // 0017 SETMBR R0 K41 R7 + 0x601C0017, // 0018 GETGBL R7 G23 + 0x8C200D27, // 0019 GETMET R8 R6 K39 + 0x5828002B, // 001A LDCONST R10 K43 + 0x502C0000, // 001B LDBOOL R11 0 0 + 0x7C200600, // 001C CALL R8 3 + 0x7C1C0200, // 001D CALL R7 1 + 0x90025607, // 001E SETMBR R0 K43 R7 + 0x601C0017, // 001F GETGBL R7 G23 + 0x8C200D27, // 0020 GETMET R8 R6 K39 + 0x5828002C, // 0021 LDCONST R10 K44 + 0x502C0000, // 0022 LDBOOL R11 0 0 + 0x7C200600, // 0023 CALL R8 3 + 0x7C1C0200, // 0024 CALL R7 1 + 0x90025807, // 0025 SETMBR R0 K44 R7 + 0x8C1C0D27, // 0026 GETMET R7 R6 K39 + 0x5824002D, // 0027 LDCONST R9 K45 + 0x8828011A, // 0028 GETMBR R10 R0 K26 + 0x7C1C0600, // 0029 CALL R7 3 + 0x90023407, // 002A SETMBR R0 K26 R7 + 0x8C1C0D27, // 002B GETMET R7 R6 K39 + 0x5824002E, // 002C LDCONST R9 K46 + 0x60280013, // 002D GETGBL R10 G19 + 0x7C280000, // 002E CALL R10 0 + 0x7C1C0600, // 002F CALL R7 3 + 0x90022607, // 0030 SETMBR R0 K19 R7 + 0x601C0017, // 0031 GETGBL R7 G23 + 0x8C200D27, // 0032 GETMET R8 R6 K39 + 0x5828002F, // 0033 LDCONST R10 K47 + 0x7C200400, // 0034 CALL R8 2 + 0x7C1C0200, // 0035 CALL R7 1 + 0x90025E07, // 0036 SETMBR R0 K47 R7 + 0x881C0113, // 0037 GETMBR R7 R0 K19 + 0x4C200000, // 0038 LDNIL R8 + 0x201C0E08, // 0039 NE R7 R7 R8 + 0x781E000D, // 003A JMPF R7 #0049 + 0xB81E0A00, // 003B GETNGBL R7 K5 + 0x60200018, // 003C GETGBL R8 G24 + 0x58240030, // 003D LDCONST R9 K48 + 0x88280113, // 003E GETMBR R10 R0 K19 + 0x7C200400, // 003F CALL R8 2 + 0x58240004, // 0040 LDCONST R9 K4 + 0x7C1C0400, // 0041 CALL R7 2 + 0x8C1C0131, // 0042 GETMET R7 R0 K49 + 0x7C1C0200, // 0043 CALL R7 1 + 0x8C1C0132, // 0044 GETMET R7 R0 K50 + 0x7C1C0200, // 0045 CALL R7 1 + 0x5C080E00, // 0046 MOVE R2 R7 + 0x501C0200, // 0047 LDBOOL R7 1 0 + 0x90026607, // 0048 SETMBR R0 K51 R7 + 0x8C1C0D27, // 0049 GETMET R7 R6 K39 + 0x58240035, // 004A LDCONST R9 K53 + 0x60280013, // 004B GETGBL R10 G19 + 0x7C280000, // 004C CALL R10 0 + 0x7C1C0600, // 004D CALL R7 3 + 0x90026807, // 004E SETMBR R0 K52 R7 + 0x881C0134, // 004F GETMBR R7 R0 K52 + 0x781E0006, // 0050 JMPF R7 #0058 + 0xB81E0A00, // 0051 GETNGBL R7 K5 + 0x60200008, // 0052 GETGBL R8 G8 + 0x88240134, // 0053 GETMBR R9 R0 K52 + 0x7C200200, // 0054 CALL R8 1 + 0x00226C08, // 0055 ADD R8 K54 R8 + 0x58240004, // 0056 LDCONST R9 K4 + 0x7C1C0400, // 0057 CALL R7 2 + 0xA8040001, // 0058 EXBLK 1 1 + 0x70020011, // 0059 JMP #006C + 0xAC0C0002, // 005A CATCH R3 0 2 + 0x7002000E, // 005B JMP #006B + 0x20140737, // 005C NE R5 R3 K55 + 0x7816000B, // 005D JMPF R5 #006A + 0xB8160A00, // 005E GETNGBL R5 K5 + 0x60180008, // 005F GETGBL R6 G8 + 0x5C1C0600, // 0060 MOVE R7 R3 + 0x7C180200, // 0061 CALL R6 1 + 0x001A7006, // 0062 ADD R6 K56 R6 + 0x00180D39, // 0063 ADD R6 R6 K57 + 0x601C0008, // 0064 GETGBL R7 G8 + 0x5C200800, // 0065 MOVE R8 R4 + 0x7C1C0200, // 0066 CALL R7 1 + 0x00180C07, // 0067 ADD R6 R6 R7 + 0x581C001B, // 0068 LDCONST R7 K27 + 0x7C140400, // 0069 CALL R5 2 + 0x70020000, // 006A JMP #006C + 0xB0080000, // 006B RAISE 2 R0 R0 + 0x880C0126, // 006C GETMBR R3 R0 K38 + 0x4C100000, // 006D LDNIL R4 + 0x1C0C0604, // 006E EQ R3 R3 R4 + 0x780E000A, // 006F JMPF R3 #007B + 0x8C0C033A, // 0070 GETMET R3 R1 K58 + 0x5814001B, // 0071 LDCONST R5 K27 + 0x7C0C0400, // 0072 CALL R3 2 + 0x8C0C073B, // 0073 GETMET R3 R3 K59 + 0x58140008, // 0074 LDCONST R5 K8 + 0x5818001B, // 0075 LDCONST R6 K27 + 0x7C0C0600, // 0076 CALL R3 3 + 0x54120FFE, // 0077 LDINT R4 4095 + 0x2C0C0604, // 0078 AND R3 R3 R4 + 0x90024C03, // 0079 SETMBR R0 K38 R3 + 0x50080200, // 007A LDBOOL R2 1 0 + 0x880C0129, // 007B GETMBR R3 R0 K41 + 0x4C100000, // 007C LDNIL R4 + 0x1C0C0604, // 007D EQ R3 R3 R4 + 0x780E0004, // 007E JMPF R3 #0084 + 0x880C013C, // 007F GETMBR R3 R0 K60 + 0x8C0C073D, // 0080 GETMET R3 R3 K61 + 0x7C0C0200, // 0081 CALL R3 1 + 0x90025203, // 0082 SETMBR R0 K41 R3 + 0x50080200, // 0083 LDBOOL R2 1 0 + 0x780A0001, // 0084 JMPF R2 #0087 + 0x8C0C013E, // 0085 GETMET R3 R0 K62 + 0x7C0C0200, // 0086 CALL R3 1 + 0x80000000, // 0087 RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: conf_to_log +********************************************************************/ +be_local_closure(class_Matter_Device_conf_to_log, /* name */ + be_nested_proto( + 9, /* nstack */ + 1, /* argc */ + 12, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + &be_ktab_class_Matter_Device, /* shared constants */ + be_str_weak(conf_to_log), + &be_const_str_solidified, + ( &(const binstruction[24]) { /* code */ + 0x5804003F, // 0000 LDCONST R1 K63 + 0x58080040, // 0001 LDCONST R2 K64 + 0x600C0010, // 0002 GETGBL R3 G16 + 0x8C100341, // 0003 GETMET R4 R1 K65 + 0x5C180000, // 0004 MOVE R6 R0 + 0x7C100400, // 0005 CALL R4 2 + 0x7C0C0200, // 0006 CALL R3 1 + 0xA802000B, // 0007 EXBLK 0 #0014 + 0x5C100600, // 0008 MOVE R4 R3 + 0x7C100000, // 0009 CALL R4 0 + 0x1C140942, // 000A EQ R5 R4 K66 + 0x78160000, // 000B JMPF R5 #000D + 0x7001FFFA, // 000C JMP #0008 + 0x60140018, // 000D GETGBL R5 G24 + 0x58180043, // 000E LDCONST R6 K67 + 0x5C1C0800, // 000F MOVE R7 R4 + 0x94200004, // 0010 GETIDX R8 R0 R4 + 0x7C140600, // 0011 CALL R5 3 + 0x00080405, // 0012 ADD R2 R2 R5 + 0x7001FFF3, // 0013 JMP #0008 + 0x580C0016, // 0014 LDCONST R3 K22 + 0xAC0C0200, // 0015 CATCH R3 1 0 + 0xB0080000, // 0016 RAISE 2 R0 R0 + 0x80040400, // 0017 RET 1 R2 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: is_zigbee_present +********************************************************************/ +be_local_closure(class_Matter_Device_is_zigbee_present, /* name */ + be_nested_proto( + 5, /* nstack */ + 1, /* argc */ + 10, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + &be_ktab_class_Matter_Device, /* shared constants */ + be_str_weak(is_zigbee_present), + &be_const_str_solidified, + ( &(const binstruction[ 7]) { /* code */ + 0xA4068800, // 0000 IMPORT R1 K68 + 0x8C080345, // 0001 GETMET R2 R1 K69 + 0x58100046, // 0002 LDCONST R4 K70 + 0x7C080400, // 0003 CALL R2 2 + 0x4C0C0000, // 0004 LDNIL R3 + 0x20080403, // 0005 NE R2 R2 R3 + 0x80040400, // 0006 RET 1 R2 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: k2l +********************************************************************/ +be_local_closure(class_Matter_Device_k2l, /* name */ + be_nested_proto( + 8, /* nstack */ + 1, /* argc */ + 12, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + &be_ktab_class_Matter_Device, /* shared constants */ + be_str_weak(k2l), + &be_const_str_solidified, + ( &(const binstruction[50]) { /* code */ + 0x5804003F, // 0000 LDCONST R1 K63 + 0x60080012, // 0001 GETGBL R2 G18 + 0x7C080000, // 0002 CALL R2 0 + 0x4C0C0000, // 0003 LDNIL R3 + 0x1C0C0003, // 0004 EQ R3 R0 R3 + 0x780E0000, // 0005 JMPF R3 #0007 + 0x80040400, // 0006 RET 1 R2 + 0x600C0010, // 0007 GETGBL R3 G16 + 0x8C100114, // 0008 GETMET R4 R0 K20 + 0x7C100200, // 0009 CALL R4 1 + 0x7C0C0200, // 000A CALL R3 1 + 0xA8020005, // 000B EXBLK 0 #0012 + 0x5C100600, // 000C MOVE R4 R3 + 0x7C100000, // 000D CALL R4 0 + 0x8C140515, // 000E GETMET R5 R2 K21 + 0x5C1C0800, // 000F MOVE R7 R4 + 0x7C140400, // 0010 CALL R5 2 + 0x7001FFF9, // 0011 JMP #000C + 0x580C0016, // 0012 LDCONST R3 K22 + 0xAC0C0200, // 0013 CATCH R3 1 0 + 0xB0080000, // 0014 RAISE 2 R0 R0 + 0x600C0010, // 0015 GETGBL R3 G16 + 0x6010000C, // 0016 GETGBL R4 G12 + 0x5C140400, // 0017 MOVE R5 R2 + 0x7C100200, // 0018 CALL R4 1 + 0x0410090B, // 0019 SUB R4 R4 K11 + 0x40121604, // 001A CONNECT R4 K11 R4 + 0x7C0C0200, // 001B CALL R3 1 + 0xA8020010, // 001C EXBLK 0 #002E + 0x5C100600, // 001D MOVE R4 R3 + 0x7C100000, // 001E CALL R4 0 + 0x94140404, // 001F GETIDX R5 R2 R4 + 0x5C180800, // 0020 MOVE R6 R4 + 0x241C0D08, // 0021 GT R7 R6 K8 + 0x781E0008, // 0022 JMPF R7 #002C + 0x041C0D0B, // 0023 SUB R7 R6 K11 + 0x941C0407, // 0024 GETIDX R7 R2 R7 + 0x241C0E05, // 0025 GT R7 R7 R5 + 0x781E0004, // 0026 JMPF R7 #002C + 0x041C0D0B, // 0027 SUB R7 R6 K11 + 0x941C0407, // 0028 GETIDX R7 R2 R7 + 0x98080C07, // 0029 SETIDX R2 R6 R7 + 0x04180D0B, // 002A SUB R6 R6 K11 + 0x7001FFF4, // 002B JMP #0021 + 0x98080C05, // 002C SETIDX R2 R6 R5 + 0x7001FFEE, // 002D JMP #001D + 0x580C0016, // 002E LDCONST R3 K22 + 0xAC0C0200, // 002F CATCH R3 1 0 + 0xB0080000, // 0030 RAISE 2 R0 R0 + 0x80040400, // 0031 RET 1 R2 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: stop +********************************************************************/ +be_local_closure(class_Matter_Device_stop, /* name */ + be_nested_proto( + 4, /* nstack */ + 1, /* argc */ + 10, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + &be_ktab_class_Matter_Device, /* shared constants */ + be_str_weak(stop), + &be_const_str_solidified, + ( &(const binstruction[10]) { /* code */ + 0xB8060200, // 0000 GETNGBL R1 K1 + 0x8C040347, // 0001 GETMET R1 R1 K71 + 0x5C0C0000, // 0002 MOVE R3 R0 + 0x7C040400, // 0003 CALL R1 2 + 0x88040148, // 0004 GETMBR R1 R0 K72 + 0x78060002, // 0005 JMPF R1 #0009 + 0x88040148, // 0006 GETMBR R1 R0 K72 + 0x8C040349, // 0007 GETMET R1 R1 K73 + 0x7C040200, // 0008 CALL R1 1 + 0x80000000, // 0009 RET 0 + }) + ) +); +/*******************************************************************/ + + /******************************************************************** ** Solidified function: find_plugin_by_friendly_name ********************************************************************/ @@ -1335,19 +923,19 @@ be_local_closure(class_Matter_Device_find_plugin_by_friendly_name, /* name */ 0x6008000C, // 0003 GETGBL R2 G12 0x5C0C0200, // 0004 MOVE R3 R1 0x7C080200, // 0005 CALL R2 1 - 0x1C080509, // 0006 EQ R2 R2 K9 + 0x1C080508, // 0006 EQ R2 R2 K8 0x780A0001, // 0007 JMPF R2 #000A 0x4C080000, // 0008 LDNIL R2 0x80040400, // 0009 RET 1 R2 - 0x58080009, // 000A LDCONST R2 K9 + 0x58080008, // 000A LDCONST R2 K8 0x600C000C, // 000B GETGBL R3 G12 - 0x8810010B, // 000C GETMBR R4 R0 K11 + 0x88100109, // 000C GETMBR R4 R0 K9 0x7C0C0200, // 000D CALL R3 1 0x140C0403, // 000E LT R3 R2 R3 0x780E0010, // 000F JMPF R3 #0021 - 0x880C010B, // 0010 GETMBR R3 R0 K11 + 0x880C0109, // 0010 GETMBR R3 R0 K9 0x940C0602, // 0011 GETIDX R3 R3 R2 - 0x8C10076F, // 0012 GETMET R4 R3 K111 + 0x8C10074A, // 0012 GETMET R4 R3 K74 0x7C100200, // 0013 CALL R4 1 0x4C140000, // 0014 LDNIL R5 0x20140805, // 0015 NE R5 R4 R5 @@ -1355,12 +943,12 @@ be_local_closure(class_Matter_Device_find_plugin_by_friendly_name, /* name */ 0x6014000C, // 0017 GETGBL R5 G12 0x5C180800, // 0018 MOVE R6 R4 0x7C140200, // 0019 CALL R5 1 - 0x24140B09, // 001A GT R5 R5 K9 + 0x24140B08, // 001A GT R5 R5 K8 0x78160002, // 001B JMPF R5 #001F 0x1C140801, // 001C EQ R5 R4 R1 0x78160000, // 001D JMPF R5 #001F 0x80040600, // 001E RET 1 R3 - 0x00080508, // 001F ADD R2 R2 K8 + 0x0008050B, // 001F ADD R2 R2 K11 0x7001FFE9, // 0020 JMP #000B 0x4C0C0000, // 0021 LDNIL R3 0x80040600, // 0022 RET 1 R3 @@ -1371,50 +959,11 @@ be_local_closure(class_Matter_Device_find_plugin_by_friendly_name, /* name */ /******************************************************************** -** Solidified function: check_network +** Solidified function: MtrJoin ********************************************************************/ -be_local_closure(class_Matter_Device_check_network, /* name */ +be_local_closure(class_Matter_Device_MtrJoin, /* name */ be_nested_proto( - 3, /* nstack */ - 1, /* argc */ - 10, /* varg */ - 0, /* has upvals */ - NULL, /* no upvals */ - 0, /* has sup protos */ - NULL, /* no sub protos */ - 1, /* has constants */ - &be_ktab_class_Matter_Device, /* shared constants */ - be_str_weak(check_network), - &be_const_str_solidified, - ( &(const binstruction[16]) { /* code */ - 0x8804015E, // 0000 GETMBR R1 R0 K94 - 0x78060000, // 0001 JMPF R1 #0003 - 0x80000200, // 0002 RET 0 - 0xB8062000, // 0003 GETNGBL R1 K16 - 0x8C040370, // 0004 GETMET R1 R1 K112 - 0x7C040200, // 0005 CALL R1 1 - 0x94040371, // 0006 GETIDX R1 R1 K113 - 0x74060004, // 0007 JMPT R1 #000D - 0xB8062000, // 0008 GETNGBL R1 K16 - 0x8C040372, // 0009 GETMET R1 R1 K114 - 0x7C040200, // 000A CALL R1 1 - 0x94040371, // 000B GETIDX R1 R1 K113 - 0x78060001, // 000C JMPF R1 #000F - 0x8C040173, // 000D GETMET R1 R0 K115 - 0x7C040200, // 000E CALL R1 1 - 0x80000000, // 000F RET 0 - }) - ) -); -/*******************************************************************/ - - -/******************************************************************** -** Solidified function: MtrUpdate -********************************************************************/ -be_local_closure(class_Matter_Device_MtrUpdate, /* name */ - be_nested_proto( - 18, /* nstack */ + 8, /* nstack */ 5, /* argc */ 10, /* varg */ 0, /* has upvals */ @@ -1423,135 +972,24 @@ be_local_closure(class_Matter_Device_MtrUpdate, /* name */ NULL, /* no sub protos */ 1, /* has constants */ &be_ktab_class_Matter_Device, /* shared constants */ - be_str_weak(MtrUpdate), + be_str_weak(MtrJoin), &be_const_str_solidified, - ( &(const binstruction[126]) { /* code */ - 0x4C140000, // 0000 LDNIL R5 - 0x1C140805, // 0001 EQ R5 R4 R5 - 0x78160004, // 0002 JMPF R5 #0008 - 0xB8162000, // 0003 GETNGBL R5 K16 - 0x8C140B74, // 0004 GETMET R5 R5 K116 - 0x581C0075, // 0005 LDCONST R7 K117 - 0x7C140400, // 0006 CALL R5 2 - 0x80040A00, // 0007 RET 1 R5 - 0xB8162000, // 0008 GETNGBL R5 K16 - 0x8C140B76, // 0009 GETMET R5 R5 K118 - 0x5C1C0800, // 000A MOVE R7 R4 - 0x58200077, // 000B LDCONST R8 K119 - 0x7C140600, // 000C CALL R5 3 - 0xB81A2000, // 000D GETNGBL R6 K16 - 0x8C180D76, // 000E GETMET R6 R6 K118 - 0x5C200800, // 000F MOVE R8 R4 - 0x58240078, // 0010 LDCONST R9 K120 - 0x7C180600, // 0011 CALL R6 3 - 0x74160000, // 0012 JMPT R5 #0014 - 0x781A0064, // 0013 JMPF R6 #0079 - 0x4C1C0000, // 0014 LDNIL R7 - 0x78160010, // 0015 JMPF R5 #0027 - 0x60200009, // 0016 GETGBL R8 G9 - 0x94240805, // 0017 GETIDX R9 R4 R5 - 0x7C200200, // 0018 CALL R8 1 - 0x18241109, // 0019 LE R9 R8 K9 - 0x78260004, // 001A JMPF R9 #0020 - 0xB8262000, // 001B GETNGBL R9 K16 - 0x8C241374, // 001C GETMET R9 R9 K116 - 0x582C0079, // 001D LDCONST R11 K121 - 0x7C240400, // 001E CALL R9 2 - 0x80041200, // 001F RET 1 R9 - 0x8C240149, // 0020 GETMET R9 R0 K73 - 0x5C2C1000, // 0021 MOVE R11 R8 - 0x7C240400, // 0022 CALL R9 2 - 0x5C1C1200, // 0023 MOVE R7 R9 - 0x8C24093D, // 0024 GETMET R9 R4 K61 - 0x5C2C0A00, // 0025 MOVE R11 R5 - 0x7C240400, // 0026 CALL R9 2 - 0x781A0009, // 0027 JMPF R6 #0032 - 0x4C200000, // 0028 LDNIL R8 - 0x1C200E08, // 0029 EQ R8 R7 R8 - 0x78220003, // 002A JMPF R8 #002F - 0x8C20010F, // 002B GETMET R8 R0 K15 - 0x94280806, // 002C GETIDX R10 R4 R6 - 0x7C200400, // 002D CALL R8 2 - 0x5C1C1000, // 002E MOVE R7 R8 - 0x8C20093D, // 002F GETMET R8 R4 K61 - 0x5C280C00, // 0030 MOVE R10 R6 - 0x7C200400, // 0031 CALL R8 2 - 0x4C200000, // 0032 LDNIL R8 - 0x1C200E08, // 0033 EQ R8 R7 R8 - 0x78220004, // 0034 JMPF R8 #003A - 0xB8222000, // 0035 GETNGBL R8 K16 - 0x8C201174, // 0036 GETMET R8 R8 K116 - 0x5828007A, // 0037 LDCONST R10 K122 - 0x7C200400, // 0038 CALL R8 2 - 0x80041000, // 0039 RET 1 R8 - 0x88200F7B, // 003A GETMBR R8 R7 K123 - 0x74220004, // 003B JMPT R8 #0041 - 0xB8222000, // 003C GETNGBL R8 K16 - 0x8C201174, // 003D GETMET R8 R8 K116 - 0x5828007C, // 003E LDCONST R10 K124 - 0x7C200400, // 003F CALL R8 2 - 0x80041000, // 0040 RET 1 R8 - 0x8C200F7D, // 0041 GETMET R8 R7 K125 - 0x7C200200, // 0042 CALL R8 1 - 0x60240013, // 0043 GETGBL R9 G19 - 0x7C240000, // 0044 CALL R9 0 - 0x60280010, // 0045 GETGBL R10 G16 - 0x8C2C0905, // 0046 GETMET R11 R4 K5 - 0x7C2C0200, // 0047 CALL R11 1 - 0x7C280200, // 0048 CALL R10 1 - 0xA8020016, // 0049 EXBLK 0 #0061 - 0x5C2C1400, // 004A MOVE R11 R10 - 0x7C2C0000, // 004B CALL R11 0 - 0xB8322000, // 004C GETNGBL R12 K16 - 0x8C30197E, // 004D GETMET R12 R12 K126 - 0x5C381000, // 004E MOVE R14 R8 - 0x5C3C1600, // 004F MOVE R15 R11 - 0x7C300600, // 0050 CALL R12 3 - 0x4C340000, // 0051 LDNIL R13 - 0x1C34180D, // 0052 EQ R13 R12 R13 - 0x78360008, // 0053 JMPF R13 #005D - 0xB8362000, // 0054 GETNGBL R13 K16 - 0x8C341B74, // 0055 GETMET R13 R13 K116 - 0x603C0018, // 0056 GETGBL R15 G24 - 0x5840007F, // 0057 LDCONST R16 K127 - 0x5C441600, // 0058 MOVE R17 R11 - 0x7C3C0400, // 0059 CALL R15 2 - 0x7C340400, // 005A CALL R13 2 - 0xA8040001, // 005B EXBLK 1 1 - 0x80001A00, // 005C RET 0 - 0x9434100C, // 005D GETIDX R13 R8 R12 - 0x9438080B, // 005E GETIDX R14 R4 R11 - 0x98241A0E, // 005F SETIDX R9 R13 R14 - 0x7001FFE8, // 0060 JMP #004A - 0x58280007, // 0061 LDCONST R10 K7 - 0xAC280200, // 0062 CATCH R10 1 0 - 0xB0080000, // 0063 RAISE 2 R0 R0 - 0x8C280F80, // 0064 GETMET R10 R7 K128 - 0x5C301200, // 0065 MOVE R12 R9 - 0x7C280400, // 0066 CALL R10 2 - 0x8C280F81, // 0067 GETMET R10 R7 K129 - 0x7C280200, // 0068 CALL R10 1 - 0x782A000A, // 0069 JMPF R10 #0075 - 0x602C0018, // 006A GETGBL R11 G24 - 0x58300082, // 006B LDCONST R12 K130 - 0x5C340200, // 006C MOVE R13 R1 - 0x5C381400, // 006D MOVE R14 R10 - 0x7C2C0600, // 006E CALL R11 3 - 0xB8322000, // 006F GETNGBL R12 K16 - 0x8C301983, // 0070 GETMET R12 R12 K131 - 0x5C381600, // 0071 MOVE R14 R11 - 0x7C300400, // 0072 CALL R12 2 - 0x80041800, // 0073 RET 1 R12 - 0x70020003, // 0074 JMP #0079 - 0xB82E2000, // 0075 GETNGBL R11 K16 - 0x8C2C1711, // 0076 GETMET R11 R11 K17 - 0x7C2C0200, // 0077 CALL R11 1 - 0x80041600, // 0078 RET 1 R11 - 0xB81E2000, // 0079 GETNGBL R7 K16 - 0x8C1C0F74, // 007A GETMET R7 R7 K116 - 0x58240084, // 007B LDCONST R9 K132 - 0x7C1C0400, // 007C CALL R7 2 - 0x80000000, // 007D RET 0 + ( &(const binstruction[15]) { /* code */ + 0x60140009, // 0000 GETGBL R5 G9 + 0x5C180600, // 0001 MOVE R6 R3 + 0x7C140200, // 0002 CALL R5 1 + 0x78160003, // 0003 JMPF R5 #0008 + 0x8818013C, // 0004 GETMBR R6 R0 K60 + 0x8C180D4B, // 0005 GETMET R6 R6 K75 + 0x7C180200, // 0006 CALL R6 1 + 0x70020002, // 0007 JMP #000B + 0x8818013C, // 0008 GETMBR R6 R0 K60 + 0x8C180D4C, // 0009 GETMET R6 R6 K76 + 0x7C180200, // 000A CALL R6 1 + 0xB81A0200, // 000B GETNGBL R6 K1 + 0x8C180D4D, // 000C GETMET R6 R6 K77 + 0x7C180200, // 000D CALL R6 1 + 0x80000000, // 000E RET 0 }) ) ); @@ -1559,12 +997,12 @@ be_local_closure(class_Matter_Device_MtrUpdate, /* name */ /******************************************************************** -** Solidified function: every_50ms +** Solidified function: get_plugin_remote_info ********************************************************************/ -be_local_closure(class_Matter_Device_every_50ms, /* name */ +be_local_closure(class_Matter_Device_get_plugin_remote_info, /* name */ be_nested_proto( - 3, /* nstack */ - 1, /* argc */ + 6, /* nstack */ + 2, /* argc */ 10, /* varg */ 0, /* has upvals */ NULL, /* no upvals */ @@ -1572,18 +1010,192 @@ be_local_closure(class_Matter_Device_every_50ms, /* name */ NULL, /* no sub protos */ 1, /* has constants */ &be_ktab_class_Matter_Device, /* shared constants */ - be_str_weak(every_50ms), + be_str_weak(get_plugin_remote_info), &be_const_str_solidified, - ( &(const binstruction[ 9]) { /* code */ - 0x8C040185, // 0000 GETMET R1 R0 K133 - 0x7C040200, // 0001 CALL R1 1 - 0x8804015F, // 0002 GETMBR R1 R0 K95 - 0x00040308, // 0003 ADD R1 R1 K8 - 0x9002BE01, // 0004 SETMBR R0 K95 R1 - 0x88040118, // 0005 GETMBR R1 R0 K24 - 0x8C040386, // 0006 GETMET R1 R1 K134 - 0x7C040200, // 0007 CALL R1 1 - 0x80000000, // 0008 RET 0 + ( &(const binstruction[ 7]) { /* code */ + 0x88080134, // 0000 GETMBR R2 R0 K52 + 0x8C080527, // 0001 GETMET R2 R2 K39 + 0x5C100200, // 0002 MOVE R4 R1 + 0x60140013, // 0003 GETGBL R5 G19 + 0x7C140000, // 0004 CALL R5 0 + 0x7C080600, // 0005 CALL R2 3 + 0x80040400, // 0006 RET 1 R2 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: MtrInfo +********************************************************************/ +be_local_closure(class_Matter_Device_MtrInfo, /* name */ + be_nested_proto( + 10, /* nstack */ + 5, /* argc */ + 10, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + &be_ktab_class_Matter_Device, /* shared constants */ + be_str_weak(MtrInfo), + &be_const_str_solidified, + ( &(const binstruction[40]) { /* code */ + 0x1C140740, // 0000 EQ R5 R3 K64 + 0x7815FFFF, // 0001 JMPF R5 #0002 + 0x1C140740, // 0002 EQ R5 R3 K64 + 0x7816000D, // 0003 JMPF R5 #0012 + 0x60140010, // 0004 GETGBL R5 G16 + 0x88180109, // 0005 GETMBR R6 R0 K9 + 0x7C140200, // 0006 CALL R5 1 + 0xA8020005, // 0007 EXBLK 0 #000E + 0x5C180A00, // 0008 MOVE R6 R5 + 0x7C180000, // 0009 CALL R6 0 + 0x8C1C014E, // 000A GETMET R7 R0 K78 + 0x88240D1D, // 000B GETMBR R9 R6 K29 + 0x7C1C0400, // 000C CALL R7 2 + 0x7001FFF9, // 000D JMP #0008 + 0x58140016, // 000E LDCONST R5 K22 + 0xAC140200, // 000F CATCH R5 1 0 + 0xB0080000, // 0010 RAISE 2 R0 R0 + 0x70020011, // 0011 JMP #0024 + 0x60140004, // 0012 GETGBL R5 G4 + 0x5C180800, // 0013 MOVE R6 R4 + 0x7C140200, // 0014 CALL R5 1 + 0x1C140B4F, // 0015 EQ R5 R5 K79 + 0x78160003, // 0016 JMPF R5 #001B + 0x8C14014E, // 0017 GETMET R5 R0 K78 + 0x5C1C0800, // 0018 MOVE R7 R4 + 0x7C140400, // 0019 CALL R5 2 + 0x70020008, // 001A JMP #0024 + 0x8C140150, // 001B GETMET R5 R0 K80 + 0x5C1C0600, // 001C MOVE R7 R3 + 0x7C140400, // 001D CALL R5 2 + 0x4C180000, // 001E LDNIL R6 + 0x20180A06, // 001F NE R6 R5 R6 + 0x781A0002, // 0020 JMPF R6 #0024 + 0x8C18014E, // 0021 GETMET R6 R0 K78 + 0x88200B1D, // 0022 GETMBR R8 R5 K29 + 0x7C180400, // 0023 CALL R6 2 + 0xB8160200, // 0024 GETNGBL R5 K1 + 0x8C140B4D, // 0025 GETMET R5 R5 K77 + 0x7C140200, // 0026 CALL R5 1 + 0x80000000, // 0027 RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: MtrInfo_one +********************************************************************/ +be_local_closure(class_Matter_Device_MtrInfo_one, /* name */ + be_nested_proto( + 9, /* nstack */ + 2, /* argc */ + 10, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + &be_ktab_class_Matter_Device, /* shared constants */ + be_str_weak(MtrInfo_one), + &be_const_str_solidified, + ( &(const binstruction[20]) { /* code */ + 0x8C080151, // 0000 GETMET R2 R0 K81 + 0x5C100200, // 0001 MOVE R4 R1 + 0x7C080400, // 0002 CALL R2 2 + 0x4C0C0000, // 0003 LDNIL R3 + 0x1C0C0403, // 0004 EQ R3 R2 R3 + 0x780E0000, // 0005 JMPF R3 #0007 + 0x80000600, // 0006 RET 0 + 0x8C0C0552, // 0007 GETMET R3 R2 K82 + 0x7C0C0200, // 0008 CALL R3 1 + 0x780E0008, // 0009 JMPF R3 #0013 + 0x60100018, // 000A GETGBL R4 G24 + 0x58140053, // 000B LDCONST R5 K83 + 0x5C180600, // 000C MOVE R6 R3 + 0x7C100400, // 000D CALL R4 2 + 0xB8160200, // 000E GETNGBL R5 K1 + 0x8C140B54, // 000F GETMET R5 R5 K84 + 0x5C1C0800, // 0010 MOVE R7 R4 + 0x58200040, // 0011 LDCONST R8 K64 + 0x7C140600, // 0012 CALL R5 3 + 0x80000000, // 0013 RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: resolve_attribute_read_solo +********************************************************************/ +be_local_closure(class_Matter_Device_resolve_attribute_read_solo, /* name */ + be_nested_proto( + 10, /* nstack */ + 2, /* argc */ + 10, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + &be_ktab_class_Matter_Device, /* shared constants */ + be_str_weak(resolve_attribute_read_solo), + &be_const_str_solidified, + ( &(const binstruction[47]) { /* code */ + 0x8808031D, // 0000 GETMBR R2 R1 K29 + 0x880C0355, // 0001 GETMBR R3 R1 K85 + 0x88100356, // 0002 GETMBR R4 R1 K86 + 0x4C140000, // 0003 LDNIL R5 + 0x1C140405, // 0004 EQ R5 R2 R5 + 0x74160005, // 0005 JMPT R5 #000C + 0x4C140000, // 0006 LDNIL R5 + 0x1C140605, // 0007 EQ R5 R3 R5 + 0x74160002, // 0008 JMPT R5 #000C + 0x4C140000, // 0009 LDNIL R5 + 0x1C140805, // 000A EQ R5 R4 R5 + 0x78160001, // 000B JMPF R5 #000E + 0x4C140000, // 000C LDNIL R5 + 0x80040A00, // 000D RET 1 R5 + 0x8C140151, // 000E GETMET R5 R0 K81 + 0x5C1C0400, // 000F MOVE R7 R2 + 0x7C140400, // 0010 CALL R5 2 + 0x4C180000, // 0011 LDNIL R6 + 0x1C180A06, // 0012 EQ R6 R5 R6 + 0x781A0005, // 0013 JMPF R6 #001A + 0xB81A2E00, // 0014 GETNGBL R6 K23 + 0x88180D20, // 0015 GETMBR R6 R6 K32 + 0x90063E06, // 0016 SETMBR R1 K31 R6 + 0x4C180000, // 0017 LDNIL R6 + 0x80040C00, // 0018 RET 1 R6 + 0x70020013, // 0019 JMP #002E + 0x8C180B57, // 001A GETMET R6 R5 K87 + 0x5C200600, // 001B MOVE R8 R3 + 0x7C180400, // 001C CALL R6 2 + 0x741A0005, // 001D JMPT R6 #0024 + 0xB81A2E00, // 001E GETNGBL R6 K23 + 0x88180D58, // 001F GETMBR R6 R6 K88 + 0x90063E06, // 0020 SETMBR R1 K31 R6 + 0x4C180000, // 0021 LDNIL R6 + 0x80040C00, // 0022 RET 1 R6 + 0x70020009, // 0023 JMP #002E + 0x8C180B59, // 0024 GETMET R6 R5 K89 + 0x5C200600, // 0025 MOVE R8 R3 + 0x5C240800, // 0026 MOVE R9 R4 + 0x7C180600, // 0027 CALL R6 3 + 0x741A0004, // 0028 JMPT R6 #002E + 0xB81A2E00, // 0029 GETNGBL R6 K23 + 0x88180D5A, // 002A GETMBR R6 R6 K90 + 0x90063E06, // 002B SETMBR R1 K31 R6 + 0x4C180000, // 002C LDNIL R6 + 0x80040C00, // 002D RET 1 R6 + 0x80040A00, // 002E RET 1 R5 }) ) ); @@ -1607,17 +1219,17 @@ be_local_closure(class_Matter_Device_every_second, /* name */ be_str_weak(every_second), &be_const_str_solidified, ( &(const binstruction[13]) { /* code */ - 0x8804013E, // 0000 GETMBR R1 R0 K62 - 0x8C040387, // 0001 GETMET R1 R1 K135 + 0x8804015B, // 0000 GETMBR R1 R0 K91 + 0x8C04035C, // 0001 GETMET R1 R1 K92 0x7C040200, // 0002 CALL R1 1 - 0x88040118, // 0003 GETMBR R1 R0 K24 - 0x8C040387, // 0004 GETMET R1 R1 K135 + 0x8804015D, // 0003 GETMBR R1 R0 K93 + 0x8C04035C, // 0004 GETMET R1 R1 K92 0x7C040200, // 0005 CALL R1 1 - 0x88040167, // 0006 GETMBR R1 R0 K103 - 0x8C040387, // 0007 GETMET R1 R1 K135 + 0x8804015E, // 0006 GETMBR R1 R0 K94 + 0x8C04035C, // 0007 GETMET R1 R1 K92 0x7C040200, // 0008 CALL R1 1 - 0x88040161, // 0009 GETMBR R1 R0 K97 - 0x8C040387, // 000A GETMET R1 R1 K135 + 0x8804013C, // 0009 GETMBR R1 R0 K60 + 0x8C04035C, // 000A GETMET R1 R1 K92 0x7C040200, // 000B CALL R1 1 0x80000000, // 000C RET 0 }) @@ -1627,9 +1239,85 @@ be_local_closure(class_Matter_Device_every_second, /* name */ /******************************************************************** -** Solidified function: add_read_sensors_schedule +** Solidified function: sort_distinct ********************************************************************/ -be_local_closure(class_Matter_Device_add_read_sensors_schedule, /* name */ +be_local_closure(class_Matter_Device_sort_distinct, /* name */ + be_nested_proto( + 7, /* nstack */ + 1, /* argc */ + 12, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + &be_ktab_class_Matter_Device, /* shared constants */ + be_str_weak(sort_distinct), + &be_const_str_solidified, + ( &(const binstruction[53]) { /* code */ + 0x5804003F, // 0000 LDCONST R1 K63 + 0x60080010, // 0001 GETGBL R2 G16 + 0x600C000C, // 0002 GETGBL R3 G12 + 0x5C100000, // 0003 MOVE R4 R0 + 0x7C0C0200, // 0004 CALL R3 1 + 0x040C070B, // 0005 SUB R3 R3 K11 + 0x400E1603, // 0006 CONNECT R3 K11 R3 + 0x7C080200, // 0007 CALL R2 1 + 0xA8020010, // 0008 EXBLK 0 #001A + 0x5C0C0400, // 0009 MOVE R3 R2 + 0x7C0C0000, // 000A CALL R3 0 + 0x94100003, // 000B GETIDX R4 R0 R3 + 0x5C140600, // 000C MOVE R5 R3 + 0x24180B08, // 000D GT R6 R5 K8 + 0x781A0008, // 000E JMPF R6 #0018 + 0x04180B0B, // 000F SUB R6 R5 K11 + 0x94180006, // 0010 GETIDX R6 R0 R6 + 0x24180C04, // 0011 GT R6 R6 R4 + 0x781A0004, // 0012 JMPF R6 #0018 + 0x04180B0B, // 0013 SUB R6 R5 K11 + 0x94180006, // 0014 GETIDX R6 R0 R6 + 0x98000A06, // 0015 SETIDX R0 R5 R6 + 0x04140B0B, // 0016 SUB R5 R5 K11 + 0x7001FFF4, // 0017 JMP #000D + 0x98000A04, // 0018 SETIDX R0 R5 R4 + 0x7001FFEE, // 0019 JMP #0009 + 0x58080016, // 001A LDCONST R2 K22 + 0xAC080200, // 001B CATCH R2 1 0 + 0xB0080000, // 001C RAISE 2 R0 R0 + 0x5808000B, // 001D LDCONST R2 K11 + 0x600C000C, // 001E GETGBL R3 G12 + 0x5C100000, // 001F MOVE R4 R0 + 0x7C0C0200, // 0020 CALL R3 1 + 0x180C070B, // 0021 LE R3 R3 K11 + 0x780E0000, // 0022 JMPF R3 #0024 + 0x80040000, // 0023 RET 1 R0 + 0x940C0108, // 0024 GETIDX R3 R0 K8 + 0x6010000C, // 0025 GETGBL R4 G12 + 0x5C140000, // 0026 MOVE R5 R0 + 0x7C100200, // 0027 CALL R4 1 + 0x14100404, // 0028 LT R4 R2 R4 + 0x78120009, // 0029 JMPF R4 #0034 + 0x94100002, // 002A GETIDX R4 R0 R2 + 0x1C100803, // 002B EQ R4 R4 R3 + 0x78120003, // 002C JMPF R4 #0031 + 0x8C10011C, // 002D GETMET R4 R0 K28 + 0x5C180400, // 002E MOVE R6 R2 + 0x7C100400, // 002F CALL R4 2 + 0x70020001, // 0030 JMP #0033 + 0x940C0002, // 0031 GETIDX R3 R0 R2 + 0x0008050B, // 0032 ADD R2 R2 K11 + 0x7001FFF0, // 0033 JMP #0025 + 0x80040000, // 0034 RET 1 R0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: get_plugin_class_displayname +********************************************************************/ +be_local_closure(class_Matter_Device_get_plugin_class_displayname, /* name */ be_nested_proto( 5, /* nstack */ 2, /* argc */ @@ -1640,306 +1328,18 @@ be_local_closure(class_Matter_Device_add_read_sensors_schedule, /* name */ NULL, /* no sub protos */ 1, /* has constants */ &be_ktab_class_Matter_Device, /* shared constants */ - be_str_weak(add_read_sensors_schedule), + be_str_weak(get_plugin_class_displayname), &be_const_str_solidified, - ( &(const binstruction[14]) { /* code */ - 0x88080188, // 0000 GETMBR R2 R0 K136 - 0x4C0C0000, // 0001 LDNIL R3 - 0x1C080403, // 0002 EQ R2 R2 R3 - 0x740A0002, // 0003 JMPT R2 #0007 - 0x88080188, // 0004 GETMBR R2 R0 K136 - 0x24080401, // 0005 GT R2 R2 R1 - 0x780A0005, // 0006 JMPF R2 #000D - 0x90031001, // 0007 SETMBR R0 K136 R1 - 0xB80A2800, // 0008 GETNGBL R2 K20 - 0x8C08058A, // 0009 GETMET R2 R2 K138 - 0x5C100200, // 000A MOVE R4 R1 - 0x7C080400, // 000B CALL R2 2 - 0x90031202, // 000C SETMBR R0 K137 R2 - 0x80000000, // 000D RET 0 - }) - ) -); -/*******************************************************************/ - - -/******************************************************************** -** Solidified function: bridge_add_endpoint -********************************************************************/ -be_local_closure(class_Matter_Device_bridge_add_endpoint, /* name */ - be_nested_proto( - 16, /* nstack */ - 3, /* argc */ - 10, /* varg */ - 0, /* has upvals */ - NULL, /* no upvals */ - 0, /* has sup protos */ - NULL, /* no sub protos */ - 1, /* has constants */ - &be_ktab_class_Matter_Device, /* shared constants */ - be_str_weak(bridge_add_endpoint), - &be_const_str_solidified, - ( &(const binstruction[68]) { /* code */ - 0x880C018B, // 0000 GETMBR R3 R0 K139 - 0x8C0C071D, // 0001 GETMET R3 R3 K29 - 0x5C140200, // 0002 MOVE R5 R1 - 0x7C0C0400, // 0003 CALL R3 2 - 0x4C100000, // 0004 LDNIL R4 - 0x1C100604, // 0005 EQ R4 R3 R4 - 0x78120008, // 0006 JMPF R4 #0010 - 0xB8126A00, // 0007 GETNGBL R4 K53 - 0x60140008, // 0008 GETGBL R5 G8 - 0x5C180200, // 0009 MOVE R6 R1 - 0x7C140200, // 000A CALL R5 1 - 0x00171805, // 000B ADD R5 K140 R5 - 0x00140B8D, // 000C ADD R5 R5 K141 - 0x58180046, // 000D LDCONST R6 K70 - 0x7C100400, // 000E CALL R4 2 - 0x80000800, // 000F RET 0 - 0x88100128, // 0010 GETMBR R4 R0 K40 - 0x60140008, // 0011 GETGBL R5 G8 - 0x5C180800, // 0012 MOVE R6 R4 - 0x7C140200, // 0013 CALL R5 1 - 0x5C180600, // 0014 MOVE R6 R3 - 0x5C1C0000, // 0015 MOVE R7 R0 - 0x5C200800, // 0016 MOVE R8 R4 - 0x5C240400, // 0017 MOVE R9 R2 - 0x7C180600, // 0018 CALL R6 3 - 0x881C010B, // 0019 GETMBR R7 R0 K11 - 0x8C1C0F06, // 001A GETMET R7 R7 K6 - 0x5C240C00, // 001B MOVE R9 R6 - 0x7C1C0400, // 001C CALL R7 2 - 0x601C0013, // 001D GETGBL R7 G19 - 0x7C1C0000, // 001E CALL R7 0 - 0x981F1C01, // 001F SETIDX R7 K142 R1 - 0x60200010, // 0020 GETGBL R8 G16 - 0x8C240505, // 0021 GETMET R9 R2 K5 - 0x7C240200, // 0022 CALL R9 1 - 0x7C200200, // 0023 CALL R8 1 - 0xA8020004, // 0024 EXBLK 0 #002A - 0x5C241000, // 0025 MOVE R9 R8 - 0x7C240000, // 0026 CALL R9 0 - 0x94280409, // 0027 GETIDX R10 R2 R9 - 0x981C120A, // 0028 SETIDX R7 R9 R10 - 0x7001FFFA, // 0029 JMP #0025 - 0x58200007, // 002A LDCONST R8 K7 - 0xAC200200, // 002B CATCH R8 1 0 - 0xB0080000, // 002C RAISE 2 R0 R0 - 0xB8226A00, // 002D GETNGBL R8 K53 - 0x60240018, // 002E GETGBL R9 G24 - 0x5828008F, // 002F LDCONST R10 K143 - 0x5C2C0800, // 0030 MOVE R11 R4 - 0x5C300200, // 0031 MOVE R12 R1 - 0x8C340190, // 0032 GETMET R13 R0 K144 - 0x5C3C0400, // 0033 MOVE R15 R2 - 0x7C340400, // 0034 CALL R13 2 - 0x7C240800, // 0035 CALL R9 4 - 0x58280038, // 0036 LDCONST R10 K56 - 0x7C200400, // 0037 CALL R8 2 - 0x8820012E, // 0038 GETMBR R8 R0 K46 - 0x98200A07, // 0039 SETIDX R8 R5 R7 - 0x50200200, // 003A LDBOOL R8 1 0 - 0x90025608, // 003B SETMBR R0 K43 R8 - 0x88200128, // 003C GETMBR R8 R0 K40 - 0x00201108, // 003D ADD R8 R8 K8 - 0x90025008, // 003E SETMBR R0 K40 R8 - 0x8C200140, // 003F GETMET R8 R0 K64 - 0x7C200200, // 0040 CALL R8 1 - 0x8C200191, // 0041 GETMET R8 R0 K145 - 0x7C200200, // 0042 CALL R8 1 - 0x80040800, // 0043 RET 1 R4 - }) - ) -); -/*******************************************************************/ - - -/******************************************************************** -** Solidified function: button_handler -********************************************************************/ -be_local_closure(class_Matter_Device_button_handler, /* name */ - be_nested_proto( - 14, /* nstack */ - 5, /* argc */ - 10, /* varg */ - 0, /* has upvals */ - NULL, /* no upvals */ - 0, /* has sup protos */ - NULL, /* no sub protos */ - 1, /* has constants */ - &be_ktab_class_Matter_Device, /* shared constants */ - be_str_weak(button_handler), - &be_const_str_solidified, - ( &(const binstruction[25]) { /* code */ - 0x58140009, // 0000 LDCONST R5 K9 - 0xA41AA000, // 0001 IMPORT R6 K80 - 0x601C000C, // 0002 GETGBL R7 G12 - 0x8820010B, // 0003 GETMBR R8 R0 K11 - 0x7C1C0200, // 0004 CALL R7 1 - 0x141C0A07, // 0005 LT R7 R5 R7 - 0x781E0010, // 0006 JMPF R7 #0018 - 0x881C010B, // 0007 GETMBR R7 R0 K11 - 0x941C0E05, // 0008 GETIDX R7 R7 R5 - 0x8C200D92, // 0009 GETMET R8 R6 K146 - 0x5C280E00, // 000A MOVE R10 R7 - 0x582C006E, // 000B LDCONST R11 K110 - 0x7C200600, // 000C CALL R8 3 - 0x78220007, // 000D JMPF R8 #0016 - 0x8820010B, // 000E GETMBR R8 R0 K11 - 0x94201005, // 000F GETIDX R8 R8 R5 - 0x8C20116E, // 0010 GETMET R8 R8 K110 - 0x5C280200, // 0011 MOVE R10 R1 - 0x5C2C0400, // 0012 MOVE R11 R2 - 0x5C300600, // 0013 MOVE R12 R3 - 0x5C340800, // 0014 MOVE R13 R4 - 0x7C200A00, // 0015 CALL R8 5 - 0x00140B08, // 0016 ADD R5 R5 K8 - 0x7001FFE9, // 0017 JMP #0002 - 0x80000000, // 0018 RET 0 - }) - ) -); -/*******************************************************************/ - - -/******************************************************************** -** Solidified function: _start_udp -********************************************************************/ -be_local_closure(class_Matter_Device__start_udp, /* name */ - be_nested_proto( - 7, /* nstack */ - 2, /* argc */ - 10, /* varg */ - 0, /* has upvals */ - NULL, /* no upvals */ - 1, /* has sup protos */ - ( &(const struct bproto*[ 1]) { - be_nested_proto( - 8, /* nstack */ - 3, /* argc */ - 0, /* varg */ - 1, /* has upvals */ - ( &(const bupvaldesc[ 1]) { /* upvals */ - be_local_const_upval(1, 0), - }), - 0, /* has sup protos */ - NULL, /* no sub protos */ - 1, /* has constants */ - ( &(const bvalue[ 1]) { /* constants */ - /* K0 */ be_nested_str_weak(msg_received), - }), - be_str_weak(_X3Clambda_X3E), - &be_const_str_solidified, - ( &(const binstruction[ 7]) { /* code */ - 0x680C0000, // 0000 GETUPV R3 U0 - 0x8C0C0700, // 0001 GETMET R3 R3 K0 - 0x5C140000, // 0002 MOVE R5 R0 - 0x5C180200, // 0003 MOVE R6 R1 - 0x5C1C0400, // 0004 MOVE R7 R2 - 0x7C0C0800, // 0005 CALL R3 4 - 0x80040600, // 0006 RET 1 R3 - }) - ), - }), - 1, /* has constants */ - &be_ktab_class_Matter_Device, /* shared constants */ - be_str_weak(_start_udp), - &be_const_str_solidified, - ( &(const binstruction[27]) { /* code */ - 0x88080100, // 0000 GETMBR R2 R0 K0 - 0x780A0000, // 0001 JMPF R2 #0003 - 0x80000400, // 0002 RET 0 - 0x4C080000, // 0003 LDNIL R2 - 0x1C080202, // 0004 EQ R2 R1 R2 - 0x780A0000, // 0005 JMPF R2 #0007 - 0x540615A3, // 0006 LDINT R1 5540 - 0xB80A6A00, // 0007 GETNGBL R2 K53 - 0x600C0008, // 0008 GETGBL R3 G8 - 0x5C100200, // 0009 MOVE R4 R1 - 0x7C0C0200, // 000A CALL R3 1 - 0x000F2603, // 000B ADD R3 K147 R3 - 0x58100038, // 000C LDCONST R4 K56 - 0x7C080400, // 000D CALL R2 2 - 0xB80A2800, // 000E GETNGBL R2 K20 - 0x8C080594, // 000F GETMET R2 R2 K148 - 0x5C100000, // 0010 MOVE R4 R0 - 0x5814000A, // 0011 LDCONST R5 K10 - 0x5C180200, // 0012 MOVE R6 R1 - 0x7C080800, // 0013 CALL R2 4 - 0x90020002, // 0014 SETMBR R0 K0 R2 - 0x88080100, // 0015 GETMBR R2 R0 K0 - 0x8C080573, // 0016 GETMET R2 R2 K115 - 0x84100000, // 0017 CLOSURE R4 P0 - 0x7C080400, // 0018 CALL R2 2 - 0xA0000000, // 0019 CLOSE R0 - 0x80000000, // 001A RET 0 - }) - ) -); -/*******************************************************************/ - - -/******************************************************************** -** Solidified function: signal_endpoints_changed -********************************************************************/ -be_local_closure(class_Matter_Device_signal_endpoints_changed, /* name */ - be_nested_proto( - 7, /* nstack */ - 1, /* argc */ - 10, /* varg */ - 0, /* has upvals */ - NULL, /* no upvals */ - 0, /* has sup protos */ - NULL, /* no sub protos */ - 1, /* has constants */ - &be_ktab_class_Matter_Device, /* shared constants */ - be_str_weak(signal_endpoints_changed), - &be_const_str_solidified, - ( &(const binstruction[14]) { /* code */ - 0x8C040195, // 0000 GETMET R1 R0 K149 - 0x580C0009, // 0001 LDCONST R3 K9 - 0x5412001C, // 0002 LDINT R4 29 - 0x58140046, // 0003 LDCONST R5 K70 - 0x50180000, // 0004 LDBOOL R6 0 0 - 0x7C040A00, // 0005 CALL R1 5 - 0x8C040195, // 0006 GETMET R1 R0 K149 - 0xB80E2800, // 0007 GETNGBL R3 K20 - 0x880C0796, // 0008 GETMBR R3 R3 K150 - 0x5412001C, // 0009 LDINT R4 29 - 0x58140046, // 000A LDCONST R5 K70 - 0x50180000, // 000B LDBOOL R6 0 0 - 0x7C040A00, // 000C CALL R1 5 - 0x80000000, // 000D RET 0 - }) - ) -); -/*******************************************************************/ - - -/******************************************************************** -** Solidified function: is_zigbee_present -********************************************************************/ -be_local_closure(class_Matter_Device_is_zigbee_present, /* name */ - be_nested_proto( - 5, /* nstack */ - 1, /* argc */ - 10, /* varg */ - 0, /* has upvals */ - NULL, /* no upvals */ - 0, /* has sup protos */ - NULL, /* no sub protos */ - 1, /* has constants */ - &be_ktab_class_Matter_Device, /* shared constants */ - be_str_weak(is_zigbee_present), - &be_const_str_solidified, - ( &(const binstruction[ 7]) { /* code */ - 0xA406A000, // 0000 IMPORT R1 K80 - 0x8C080397, // 0001 GETMET R2 R1 K151 - 0x58100003, // 0002 LDCONST R4 K3 + ( &(const binstruction[ 9]) { /* code */ + 0x8808015F, // 0000 GETMBR R2 R0 K95 + 0x8C080527, // 0001 GETMET R2 R2 K39 + 0x5C100200, // 0002 MOVE R4 R1 0x7C080400, // 0003 CALL R2 2 - 0x4C0C0000, // 0004 LDNIL R3 - 0x20080403, // 0005 NE R2 R2 R3 - 0x80040400, // 0006 RET 1 R2 + 0x780A0001, // 0004 JMPF R2 #0007 + 0x880C0560, // 0005 GETMBR R3 R2 K96 + 0x70020000, // 0006 JMP #0008 + 0x580C0040, // 0007 LDCONST R3 K64 + 0x80040600, // 0008 RET 1 R3 }) ) ); @@ -1963,14 +1363,14 @@ be_local_closure(class_Matter_Device_get_plugin_class_arg, /* name */ be_str_weak(get_plugin_class_arg), &be_const_str_solidified, ( &(const binstruction[ 9]) { /* code */ - 0x8808018B, // 0000 GETMBR R2 R0 K139 - 0x8C08051D, // 0001 GETMET R2 R2 K29 + 0x8808015F, // 0000 GETMBR R2 R0 K95 + 0x8C080527, // 0001 GETMET R2 R2 K39 0x5C100200, // 0002 MOVE R4 R1 0x7C080400, // 0003 CALL R2 2 0x780A0001, // 0004 JMPF R2 #0007 - 0x880C0598, // 0005 GETMBR R3 R2 K152 + 0x880C0561, // 0005 GETMBR R3 R2 K97 0x70020000, // 0006 JMP #0008 - 0x580C000A, // 0007 LDCONST R3 K10 + 0x580C0040, // 0007 LDCONST R3 K64 0x80040600, // 0008 RET 1 R3 }) ) @@ -1979,12 +1379,12 @@ be_local_closure(class_Matter_Device_get_plugin_class_arg, /* name */ /******************************************************************** -** Solidified function: update_remotes_info +** Solidified function: process_attribute_expansion ********************************************************************/ -be_local_closure(class_Matter_Device_update_remotes_info, /* name */ +be_local_closure(class_Matter_Device_process_attribute_expansion, /* name */ be_nested_proto( - 7, /* nstack */ - 1, /* argc */ + 12, /* nstack */ + 3, /* argc */ 10, /* varg */ 0, /* has upvals */ NULL, /* no upvals */ @@ -1992,42 +1392,77 @@ be_local_closure(class_Matter_Device_update_remotes_info, /* name */ NULL, /* no sub protos */ 1, /* has constants */ &be_ktab_class_Matter_Device, /* shared constants */ - be_str_weak(update_remotes_info), + be_str_weak(process_attribute_expansion), &be_const_str_solidified, - ( &(const binstruction[33]) { /* code */ - 0x60040013, // 0000 GETGBL R1 G19 - 0x7C040000, // 0001 CALL R1 0 - 0x88080151, // 0002 GETMBR R2 R0 K81 - 0x4C0C0000, // 0003 LDNIL R3 - 0x20080403, // 0004 NE R2 R2 R3 - 0x780A0018, // 0005 JMPF R2 #001F - 0x60080010, // 0006 GETGBL R2 G16 - 0x880C0151, // 0007 GETMBR R3 R0 K81 - 0x8C0C0705, // 0008 GETMET R3 R3 K5 - 0x7C0C0200, // 0009 CALL R3 1 - 0x7C080200, // 000A CALL R2 1 - 0xA802000F, // 000B EXBLK 0 #001C - 0x5C0C0400, // 000C MOVE R3 R2 - 0x7C0C0000, // 000D CALL R3 0 - 0x88100151, // 000E GETMBR R4 R0 K81 - 0x94100803, // 000F GETIDX R4 R4 R3 - 0x8C100999, // 0010 GETMET R4 R4 K153 - 0x7C100200, // 0011 CALL R4 1 - 0x4C140000, // 0012 LDNIL R5 - 0x20140805, // 0013 NE R5 R4 R5 - 0x78160005, // 0014 JMPF R5 #001B - 0x6014000C, // 0015 GETGBL R5 G12 - 0x5C180800, // 0016 MOVE R6 R4 - 0x7C140200, // 0017 CALL R5 1 - 0x24140B09, // 0018 GT R5 R5 K9 - 0x78160000, // 0019 JMPF R5 #001B - 0x98040604, // 001A SETIDX R1 R3 R4 - 0x7001FFEF, // 001B JMP #000C - 0x58080007, // 001C LDCONST R2 K7 - 0xAC080200, // 001D CATCH R2 1 0 - 0xB0080000, // 001E RAISE 2 R0 R0 - 0x90023C01, // 001F SETMBR R0 K30 R1 - 0x80040200, // 0020 RET 1 R1 + ( &(const binstruction[28]) { /* code */ + 0x880C031D, // 0000 GETMBR R3 R1 K29 + 0x88100355, // 0001 GETMBR R4 R1 K85 + 0x88140356, // 0002 GETMBR R5 R1 K86 + 0xB81A2E00, // 0003 GETNGBL R6 K23 + 0x8C180D62, // 0004 GETMET R6 R6 K98 + 0x5C200000, // 0005 MOVE R8 R0 + 0x7C180400, // 0006 CALL R6 2 + 0x8C1C0D63, // 0007 GETMET R7 R6 K99 + 0x5C240600, // 0008 MOVE R9 R3 + 0x5C280800, // 0009 MOVE R10 R4 + 0x5C2C0A00, // 000A MOVE R11 R5 + 0x7C1C0800, // 000B CALL R7 4 + 0x8C1C0D64, // 000C GETMET R7 R6 K100 + 0x7C1C0200, // 000D CALL R7 1 + 0x4C200000, // 000E LDNIL R8 + 0x8C240D65, // 000F GETMET R9 R6 K101 + 0x7C240200, // 0010 CALL R9 1 + 0x5C201200, // 0011 MOVE R8 R9 + 0x4C280000, // 0012 LDNIL R10 + 0x2024120A, // 0013 NE R9 R9 R10 + 0x78260005, // 0014 JMPF R9 #001B + 0x5C240400, // 0015 MOVE R9 R2 + 0x8C280D66, // 0016 GETMET R10 R6 K102 + 0x7C280200, // 0017 CALL R10 1 + 0x5C2C1000, // 0018 MOVE R11 R8 + 0x7C240400, // 0019 CALL R9 2 + 0x7001FFF3, // 001A JMP #000F + 0x80000000, // 001B RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: find_plugin_by_endpoint +********************************************************************/ +be_local_closure(class_Matter_Device_find_plugin_by_endpoint, /* name */ + be_nested_proto( + 6, /* nstack */ + 2, /* argc */ + 10, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + &be_ktab_class_Matter_Device, /* shared constants */ + be_str_weak(find_plugin_by_endpoint), + &be_const_str_solidified, + ( &(const binstruction[17]) { /* code */ + 0x58080008, // 0000 LDCONST R2 K8 + 0x600C000C, // 0001 GETGBL R3 G12 + 0x88100109, // 0002 GETMBR R4 R0 K9 + 0x7C0C0200, // 0003 CALL R3 1 + 0x140C0403, // 0004 LT R3 R2 R3 + 0x780E0008, // 0005 JMPF R3 #000F + 0x880C0109, // 0006 GETMBR R3 R0 K9 + 0x940C0602, // 0007 GETIDX R3 R3 R2 + 0x8C100767, // 0008 GETMET R4 R3 K103 + 0x7C100200, // 0009 CALL R4 1 + 0x1C100801, // 000A EQ R4 R4 R1 + 0x78120000, // 000B JMPF R4 #000D + 0x80040600, // 000C RET 1 R3 + 0x0008050B, // 000D ADD R2 R2 K11 + 0x7001FFF1, // 000E JMP #0001 + 0x4C0C0000, // 000F LDNIL R3 + 0x80040600, // 0010 RET 1 R3 }) ) ); @@ -2054,34 +1489,34 @@ be_local_closure(class_Matter_Device_remove_fabric, /* name */ 0x4C080000, // 0000 LDNIL R2 0x20080202, // 0001 NE R2 R1 R2 0x780A0019, // 0002 JMPF R2 #001D - 0xB80A6A00, // 0003 GETNGBL R2 K53 - 0x8C0C039B, // 0004 GETMET R3 R1 K155 + 0xB80A0A00, // 0003 GETNGBL R2 K5 + 0x8C0C0369, // 0004 GETMET R3 R1 K105 0x7C0C0200, // 0005 CALL R3 1 - 0x8C0C079C, // 0006 GETMET R3 R3 K156 + 0x8C0C076A, // 0006 GETMET R3 R3 K106 0x7C0C0200, // 0007 CALL R3 1 - 0x8C0C079D, // 0008 GETMET R3 R3 K157 + 0x8C0C076B, // 0008 GETMET R3 R3 K107 0x7C0C0200, // 0009 CALL R3 1 - 0x8C0C079E, // 000A GETMET R3 R3 K158 + 0x8C0C076C, // 000A GETMET R3 R3 K108 0x7C0C0200, // 000B CALL R3 1 - 0x000F3403, // 000C ADD R3 K154 R3 - 0x58100038, // 000D LDCONST R4 K56 + 0x000ED003, // 000C ADD R3 K104 R3 + 0x5810001B, // 000D LDCONST R4 K27 0x7C080400, // 000E CALL R2 2 - 0x88080118, // 000F GETMBR R2 R0 K24 - 0x88080519, // 0010 GETMBR R2 R2 K25 - 0x8808051A, // 0011 GETMBR R2 R2 K26 - 0x8C08059F, // 0012 GETMET R2 R2 K159 + 0x8808015D, // 000F GETMBR R2 R0 K93 + 0x8808056D, // 0010 GETMBR R2 R2 K109 + 0x8808056E, // 0011 GETMBR R2 R2 K110 + 0x8C08056F, // 0012 GETMET R2 R2 K111 0x5C100200, // 0013 MOVE R4 R1 0x7C080400, // 0014 CALL R2 2 - 0x88080161, // 0015 GETMBR R2 R0 K97 - 0x8C0805A0, // 0016 GETMET R2 R2 K160 + 0x8808013C, // 0015 GETMBR R2 R0 K60 + 0x8C080570, // 0016 GETMET R2 R2 K112 0x5C100200, // 0017 MOVE R4 R1 0x7C080400, // 0018 CALL R2 2 - 0x8808013E, // 0019 GETMBR R2 R0 K62 - 0x8C0805A1, // 001A GETMET R2 R2 K161 + 0x8808015B, // 0019 GETMBR R2 R0 K91 + 0x8C080571, // 001A GETMET R2 R2 K113 0x5C100200, // 001B MOVE R4 R1 0x7C080400, // 001C CALL R2 2 - 0x8808013E, // 001D GETMBR R2 R0 K62 - 0x8C0805A2, // 001E GETMET R2 R2 K162 + 0x8808015B, // 001D GETMBR R2 R0 K91 + 0x8C080572, // 001E GETMET R2 R2 K114 0x7C080200, // 001F CALL R2 1 0x80000000, // 0020 RET 0 }) @@ -2091,583 +1526,12 @@ be_local_closure(class_Matter_Device_remove_fabric, /* name */ /******************************************************************** -** Solidified function: conf_to_log +** Solidified function: attribute_updated ********************************************************************/ -be_local_closure(class_Matter_Device_conf_to_log, /* name */ - be_nested_proto( - 9, /* nstack */ - 1, /* argc */ - 12, /* varg */ - 0, /* has upvals */ - NULL, /* no upvals */ - 0, /* has sup protos */ - NULL, /* no sub protos */ - 1, /* has constants */ - &be_ktab_class_Matter_Device, /* shared constants */ - be_str_weak(conf_to_log), - &be_const_str_solidified, - ( &(const binstruction[24]) { /* code */ - 0x58040004, // 0000 LDCONST R1 K4 - 0x5808000A, // 0001 LDCONST R2 K10 - 0x600C0010, // 0002 GETGBL R3 G16 - 0x8C1003A3, // 0003 GETMET R4 R1 K163 - 0x5C180000, // 0004 MOVE R6 R0 - 0x7C100400, // 0005 CALL R4 2 - 0x7C0C0200, // 0006 CALL R3 1 - 0xA802000B, // 0007 EXBLK 0 #0014 - 0x5C100600, // 0008 MOVE R4 R3 - 0x7C100000, // 0009 CALL R4 0 - 0x1C14098E, // 000A EQ R5 R4 K142 - 0x78160000, // 000B JMPF R5 #000D - 0x7001FFFA, // 000C JMP #0008 - 0x60140018, // 000D GETGBL R5 G24 - 0x581800A4, // 000E LDCONST R6 K164 - 0x5C1C0800, // 000F MOVE R7 R4 - 0x94200004, // 0010 GETIDX R8 R0 R4 - 0x7C140600, // 0011 CALL R5 3 - 0x00080405, // 0012 ADD R2 R2 R5 - 0x7001FFF3, // 0013 JMP #0008 - 0x580C0007, // 0014 LDCONST R3 K7 - 0xAC0C0200, // 0015 CATCH R3 1 0 - 0xB0080000, // 0016 RAISE 2 R0 R0 - 0x80040400, // 0017 RET 1 R2 - }) - ) -); -/*******************************************************************/ - - -/******************************************************************** -** Solidified function: adjust_next_ep -********************************************************************/ -be_local_closure(class_Matter_Device_adjust_next_ep, /* name */ - be_nested_proto( - 5, /* nstack */ - 1, /* argc */ - 10, /* varg */ - 0, /* has upvals */ - NULL, /* no upvals */ - 0, /* has sup protos */ - NULL, /* no sub protos */ - 1, /* has constants */ - &be_ktab_class_Matter_Device, /* shared constants */ - be_str_weak(adjust_next_ep), - &be_const_str_solidified, - ( &(const binstruction[21]) { /* code */ - 0x60040010, // 0000 GETGBL R1 G16 - 0x8808012E, // 0001 GETMBR R2 R0 K46 - 0x8C080505, // 0002 GETMET R2 R2 K5 - 0x7C080200, // 0003 CALL R2 1 - 0x7C040200, // 0004 CALL R1 1 - 0xA802000A, // 0005 EXBLK 0 #0011 - 0x5C080200, // 0006 MOVE R2 R1 - 0x7C080000, // 0007 CALL R2 0 - 0x600C0009, // 0008 GETGBL R3 G9 - 0x5C100400, // 0009 MOVE R4 R2 - 0x7C0C0200, // 000A CALL R3 1 - 0x88100128, // 000B GETMBR R4 R0 K40 - 0x28100604, // 000C GE R4 R3 R4 - 0x78120001, // 000D JMPF R4 #0010 - 0x00100708, // 000E ADD R4 R3 K8 - 0x90025004, // 000F SETMBR R0 K40 R4 - 0x7001FFF4, // 0010 JMP #0006 - 0x58040007, // 0011 LDCONST R1 K7 - 0xAC040200, // 0012 CATCH R1 1 0 - 0xB0080000, // 0013 RAISE 2 R0 R0 - 0x80000000, // 0014 RET 0 - }) - ) -); -/*******************************************************************/ - - -/******************************************************************** -** Solidified function: reset_param -********************************************************************/ -be_local_closure(class_Matter_Device_reset_param, /* name */ - be_nested_proto( - 3, /* nstack */ - 1, /* argc */ - 10, /* varg */ - 0, /* has upvals */ - NULL, /* no upvals */ - 0, /* has sup protos */ - NULL, /* no sub protos */ - 1, /* has constants */ - &be_ktab_class_Matter_Device, /* shared constants */ - be_str_weak(reset_param), - &be_const_str_solidified, - ( &(const binstruction[ 7]) { /* code */ - 0x50040000, // 0000 LDBOOL R1 0 0 - 0x90025601, // 0001 SETMBR R0 K43 R1 - 0x88040160, // 0002 GETMBR R1 R0 K96 - 0x90025001, // 0003 SETMBR R0 K40 R1 - 0x8C040140, // 0004 GETMET R1 R0 K64 - 0x7C040200, // 0005 CALL R1 1 - 0x80000000, // 0006 RET 0 - }) - ) -); -/*******************************************************************/ - - -/******************************************************************** -** Solidified function: get_plugin_class_displayname -********************************************************************/ -be_local_closure(class_Matter_Device_get_plugin_class_displayname, /* name */ - be_nested_proto( - 5, /* nstack */ - 2, /* argc */ - 10, /* varg */ - 0, /* has upvals */ - NULL, /* no upvals */ - 0, /* has sup protos */ - NULL, /* no sub protos */ - 1, /* has constants */ - &be_ktab_class_Matter_Device, /* shared constants */ - be_str_weak(get_plugin_class_displayname), - &be_const_str_solidified, - ( &(const binstruction[ 9]) { /* code */ - 0x8808018B, // 0000 GETMBR R2 R0 K139 - 0x8C08051D, // 0001 GETMET R2 R2 K29 - 0x5C100200, // 0002 MOVE R4 R1 - 0x7C080400, // 0003 CALL R2 2 - 0x780A0001, // 0004 JMPF R2 #0007 - 0x880C05A5, // 0005 GETMBR R3 R2 K165 - 0x70020000, // 0006 JMP #0008 - 0x580C000A, // 0007 LDCONST R3 K10 - 0x80040600, // 0008 RET 1 R3 - }) - ) -); -/*******************************************************************/ - - -/******************************************************************** -** Solidified function: read_sensors_scheduler -********************************************************************/ -be_local_closure(class_Matter_Device_read_sensors_scheduler, /* name */ - be_nested_proto( - 4, /* nstack */ - 1, /* argc */ - 10, /* varg */ - 0, /* has upvals */ - NULL, /* no upvals */ - 0, /* has sup protos */ - NULL, /* no sub protos */ - 1, /* has constants */ - &be_ktab_class_Matter_Device, /* shared constants */ - be_str_weak(read_sensors_scheduler), - &be_const_str_solidified, - ( &(const binstruction[21]) { /* code */ - 0x88040188, // 0000 GETMBR R1 R0 K136 - 0x4C080000, // 0001 LDNIL R2 - 0x1C040202, // 0002 EQ R1 R1 R2 - 0x78060000, // 0003 JMPF R1 #0005 - 0x80000200, // 0004 RET 0 - 0x88040189, // 0005 GETMBR R1 R0 K137 - 0x1C040309, // 0006 EQ R1 R1 K9 - 0x74060004, // 0007 JMPT R1 #000D - 0xB8062000, // 0008 GETNGBL R1 K16 - 0x8C0403A6, // 0009 GETMET R1 R1 K166 - 0x880C0189, // 000A GETMBR R3 R0 K137 - 0x7C040400, // 000B CALL R1 2 - 0x78060006, // 000C JMPF R1 #0014 - 0x8C0401A7, // 000D GETMET R1 R0 K167 - 0x7C040200, // 000E CALL R1 1 - 0xB8062000, // 000F GETNGBL R1 K16 - 0x8C0403A8, // 0010 GETMET R1 R1 K168 - 0x880C0188, // 0011 GETMBR R3 R0 K136 - 0x7C040400, // 0012 CALL R1 2 - 0x90031201, // 0013 SETMBR R0 K137 R1 - 0x80000000, // 0014 RET 0 - }) - ) -); -/*******************************************************************/ - - -/******************************************************************** -** Solidified function: register_http_remote -********************************************************************/ -be_local_closure(class_Matter_Device_register_http_remote, /* name */ - be_nested_proto( - 9, /* nstack */ - 3, /* argc */ - 10, /* varg */ - 0, /* has upvals */ - NULL, /* no upvals */ - 0, /* has sup protos */ - NULL, /* no sub protos */ - 1, /* has constants */ - &be_ktab_class_Matter_Device, /* shared constants */ - be_str_weak(register_http_remote), - &be_const_str_solidified, - ( &(const binstruction[42]) { /* code */ - 0x880C0151, // 0000 GETMBR R3 R0 K81 - 0x4C100000, // 0001 LDNIL R4 - 0x1C0C0604, // 0002 EQ R3 R3 R4 - 0x780E0002, // 0003 JMPF R3 #0007 - 0x600C0013, // 0004 GETGBL R3 G19 - 0x7C0C0000, // 0005 CALL R3 0 - 0x9002A203, // 0006 SETMBR R0 K81 R3 - 0x4C0C0000, // 0007 LDNIL R3 - 0x88100151, // 0008 GETMBR R4 R0 K81 - 0x8C100992, // 0009 GETMET R4 R4 K146 - 0x5C180200, // 000A MOVE R6 R1 - 0x7C100400, // 000B CALL R4 2 - 0x78120009, // 000C JMPF R4 #0017 - 0x88100151, // 000D GETMBR R4 R0 K81 - 0x940C0801, // 000E GETIDX R3 R4 R1 - 0x8C1007A9, // 000F GETMET R4 R3 K169 - 0x7C100200, // 0010 CALL R4 1 - 0x14100404, // 0011 LT R4 R2 R4 - 0x78120002, // 0012 JMPF R4 #0016 - 0x8C1007AA, // 0013 GETMET R4 R3 K170 - 0x5C180400, // 0014 MOVE R6 R2 - 0x7C100400, // 0015 CALL R4 2 - 0x70020011, // 0016 JMP #0029 - 0xB8122800, // 0017 GETNGBL R4 K20 - 0x8C1009AB, // 0018 GETMET R4 R4 K171 - 0x5C180000, // 0019 MOVE R6 R0 - 0x5C1C0200, // 001A MOVE R7 R1 - 0x5C200400, // 001B MOVE R8 R2 - 0x7C100800, // 001C CALL R4 4 - 0x5C0C0800, // 001D MOVE R3 R4 - 0x8810011E, // 001E GETMBR R4 R0 K30 - 0x8C100992, // 001F GETMET R4 R4 K146 - 0x5C180200, // 0020 MOVE R6 R1 - 0x7C100400, // 0021 CALL R4 2 - 0x78120003, // 0022 JMPF R4 #0027 - 0x8C1007AC, // 0023 GETMET R4 R3 K172 - 0x8818011E, // 0024 GETMBR R6 R0 K30 - 0x94180C01, // 0025 GETIDX R6 R6 R1 - 0x7C100400, // 0026 CALL R4 2 - 0x88100151, // 0027 GETMBR R4 R0 K81 - 0x98100203, // 0028 SETIDX R4 R1 R3 - 0x80040600, // 0029 RET 1 R3 - }) - ) -); -/*******************************************************************/ - - -/******************************************************************** -** Solidified function: process_attribute_expansion -********************************************************************/ -be_local_closure(class_Matter_Device_process_attribute_expansion, /* name */ - be_nested_proto( - 12, /* nstack */ - 3, /* argc */ - 10, /* varg */ - 0, /* has upvals */ - NULL, /* no upvals */ - 0, /* has sup protos */ - NULL, /* no sub protos */ - 1, /* has constants */ - &be_ktab_class_Matter_Device, /* shared constants */ - be_str_weak(process_attribute_expansion), - &be_const_str_solidified, - ( &(const binstruction[28]) { /* code */ - 0x880C030D, // 0000 GETMBR R3 R1 K13 - 0x88100316, // 0001 GETMBR R4 R1 K22 - 0x88140317, // 0002 GETMBR R5 R1 K23 - 0xB81A2800, // 0003 GETNGBL R6 K20 - 0x8C180DAD, // 0004 GETMET R6 R6 K173 - 0x5C200000, // 0005 MOVE R8 R0 - 0x7C180400, // 0006 CALL R6 2 - 0x8C1C0D73, // 0007 GETMET R7 R6 K115 - 0x5C240600, // 0008 MOVE R9 R3 - 0x5C280800, // 0009 MOVE R10 R4 - 0x5C2C0A00, // 000A MOVE R11 R5 - 0x7C1C0800, // 000B CALL R7 4 - 0x8C1C0DAE, // 000C GETMET R7 R6 K174 - 0x7C1C0200, // 000D CALL R7 1 - 0x4C200000, // 000E LDNIL R8 - 0x8C240DAF, // 000F GETMET R9 R6 K175 - 0x7C240200, // 0010 CALL R9 1 - 0x5C201200, // 0011 MOVE R8 R9 - 0x4C280000, // 0012 LDNIL R10 - 0x2024120A, // 0013 NE R9 R9 R10 - 0x78260005, // 0014 JMPF R9 #001B - 0x5C240400, // 0015 MOVE R9 R2 - 0x8C280DB0, // 0016 GETMET R10 R6 K176 - 0x7C280200, // 0017 CALL R10 1 - 0x5C2C1000, // 0018 MOVE R11 R8 - 0x7C240400, // 0019 CALL R9 2 - 0x7001FFF3, // 001A JMP #000F - 0x80000000, // 001B RET 0 - }) - ) -); -/*******************************************************************/ - - -/******************************************************************** -** Solidified function: load_param -********************************************************************/ -be_local_closure(class_Matter_Device_load_param, /* name */ - be_nested_proto( - 12, /* nstack */ - 1, /* argc */ - 10, /* varg */ - 0, /* has upvals */ - NULL, /* no upvals */ - 0, /* has sup protos */ - NULL, /* no sub protos */ - 1, /* has constants */ - &be_ktab_class_Matter_Device, /* shared constants */ - be_str_weak(load_param), - &be_const_str_solidified, - ( &(const binstruction[136]) { /* code */ - 0xA406AE00, // 0000 IMPORT R1 K87 - 0x50080000, // 0001 LDBOOL R2 0 0 - 0xA8020056, // 0002 EXBLK 0 #005A - 0x600C0011, // 0003 GETGBL R3 G17 - 0x88100131, // 0004 GETMBR R4 R0 K49 - 0x7C0C0200, // 0005 CALL R3 1 - 0x8C1007B1, // 0006 GETMET R4 R3 K177 - 0x7C100200, // 0007 CALL R4 1 - 0x8C140734, // 0008 GETMET R5 R3 K52 - 0x7C140200, // 0009 CALL R5 1 - 0xA4163E00, // 000A IMPORT R5 K31 - 0x8C180BB2, // 000B GETMET R6 R5 K178 - 0x5C200800, // 000C MOVE R8 R4 - 0x7C180400, // 000D CALL R6 2 - 0x8C1C0D1D, // 000E GETMET R7 R6 K29 - 0x582400B3, // 000F LDCONST R9 K179 - 0x88280122, // 0010 GETMBR R10 R0 K34 - 0x7C1C0600, // 0011 CALL R7 3 - 0x90024407, // 0012 SETMBR R0 K34 R7 - 0x8C1C0D1D, // 0013 GETMET R7 R6 K29 - 0x582400B4, // 0014 LDCONST R9 K180 - 0x88280123, // 0015 GETMBR R10 R0 K35 - 0x7C1C0600, // 0016 CALL R7 3 - 0x90024607, // 0017 SETMBR R0 K35 R7 - 0x601C0017, // 0018 GETGBL R7 G23 - 0x8C200D1D, // 0019 GETMET R8 R6 K29 - 0x58280024, // 001A LDCONST R10 K36 - 0x502C0000, // 001B LDBOOL R11 0 0 - 0x7C200600, // 001C CALL R8 3 - 0x7C1C0200, // 001D CALL R7 1 - 0x90024807, // 001E SETMBR R0 K36 R7 - 0x601C0017, // 001F GETGBL R7 G23 - 0x8C200D1D, // 0020 GETMET R8 R6 K29 - 0x58280027, // 0021 LDCONST R10 K39 - 0x502C0000, // 0022 LDBOOL R11 0 0 - 0x7C200600, // 0023 CALL R8 3 - 0x7C1C0200, // 0024 CALL R7 1 - 0x90024E07, // 0025 SETMBR R0 K39 R7 - 0x8C1C0D1D, // 0026 GETMET R7 R6 K29 - 0x582400B5, // 0027 LDCONST R9 K181 - 0x88280128, // 0028 GETMBR R10 R0 K40 - 0x7C1C0600, // 0029 CALL R7 3 - 0x90025007, // 002A SETMBR R0 K40 R7 - 0x8C1C0D1D, // 002B GETMET R7 R6 K29 - 0x582400B6, // 002C LDCONST R9 K182 - 0x60280013, // 002D GETGBL R10 G19 - 0x7C280000, // 002E CALL R10 0 - 0x7C1C0600, // 002F CALL R7 3 - 0x90025C07, // 0030 SETMBR R0 K46 R7 - 0x601C0017, // 0031 GETGBL R7 G23 - 0x8C200D1D, // 0032 GETMET R8 R6 K29 - 0x58280029, // 0033 LDCONST R10 K41 - 0x7C200400, // 0034 CALL R8 2 - 0x7C1C0200, // 0035 CALL R7 1 - 0x90025207, // 0036 SETMBR R0 K41 R7 - 0x881C012E, // 0037 GETMBR R7 R0 K46 - 0x4C200000, // 0038 LDNIL R8 - 0x201C0E08, // 0039 NE R7 R7 R8 - 0x781E000D, // 003A JMPF R7 #0049 - 0xB81E6A00, // 003B GETNGBL R7 K53 - 0x60200018, // 003C GETGBL R8 G24 - 0x582400B7, // 003D LDCONST R9 K183 - 0x8828012E, // 003E GETMBR R10 R0 K46 - 0x7C200400, // 003F CALL R8 2 - 0x58240046, // 0040 LDCONST R9 K70 - 0x7C1C0400, // 0041 CALL R7 2 - 0x8C1C0144, // 0042 GETMET R7 R0 K68 - 0x7C1C0200, // 0043 CALL R7 1 - 0x8C1C01B8, // 0044 GETMET R7 R0 K184 - 0x7C1C0200, // 0045 CALL R7 1 - 0x5C080E00, // 0046 MOVE R2 R7 - 0x501C0200, // 0047 LDBOOL R7 1 0 - 0x90025607, // 0048 SETMBR R0 K43 R7 - 0x8C1C0D1D, // 0049 GETMET R7 R6 K29 - 0x582400B9, // 004A LDCONST R9 K185 - 0x60280013, // 004B GETGBL R10 G19 - 0x7C280000, // 004C CALL R10 0 - 0x7C1C0600, // 004D CALL R7 3 - 0x90023C07, // 004E SETMBR R0 K30 R7 - 0x881C011E, // 004F GETMBR R7 R0 K30 - 0x781E0006, // 0050 JMPF R7 #0058 - 0xB81E6A00, // 0051 GETNGBL R7 K53 - 0x60200008, // 0052 GETGBL R8 G8 - 0x8824011E, // 0053 GETMBR R9 R0 K30 - 0x7C200200, // 0054 CALL R8 1 - 0x00237408, // 0055 ADD R8 K186 R8 - 0x58240046, // 0056 LDCONST R9 K70 - 0x7C1C0400, // 0057 CALL R7 2 - 0xA8040001, // 0058 EXBLK 1 1 - 0x70020011, // 0059 JMP #006C - 0xAC0C0002, // 005A CATCH R3 0 2 - 0x7002000E, // 005B JMP #006B - 0x201407BB, // 005C NE R5 R3 K187 - 0x7816000B, // 005D JMPF R5 #006A - 0xB8166A00, // 005E GETNGBL R5 K53 - 0x60180008, // 005F GETGBL R6 G8 - 0x5C1C0600, // 0060 MOVE R7 R3 - 0x7C180200, // 0061 CALL R6 1 - 0x001B7806, // 0062 ADD R6 K188 R6 - 0x00180D3A, // 0063 ADD R6 R6 K58 - 0x601C0008, // 0064 GETGBL R7 G8 - 0x5C200800, // 0065 MOVE R8 R4 - 0x7C1C0200, // 0066 CALL R7 1 - 0x00180C07, // 0067 ADD R6 R6 R7 - 0x581C0038, // 0068 LDCONST R7 K56 - 0x7C140400, // 0069 CALL R5 2 - 0x70020000, // 006A JMP #006C - 0xB0080000, // 006B RAISE 2 R0 R0 - 0x880C0122, // 006C GETMBR R3 R0 K34 - 0x4C100000, // 006D LDNIL R4 - 0x1C0C0604, // 006E EQ R3 R3 R4 - 0x780E000A, // 006F JMPF R3 #007B - 0x8C0C03BD, // 0070 GETMET R3 R1 K189 - 0x58140038, // 0071 LDCONST R5 K56 - 0x7C0C0400, // 0072 CALL R3 2 - 0x8C0C0752, // 0073 GETMET R3 R3 K82 - 0x58140009, // 0074 LDCONST R5 K9 - 0x58180038, // 0075 LDCONST R6 K56 - 0x7C0C0600, // 0076 CALL R3 3 - 0x54120FFE, // 0077 LDINT R4 4095 - 0x2C0C0604, // 0078 AND R3 R3 R4 - 0x90024403, // 0079 SETMBR R0 K34 R3 - 0x50080200, // 007A LDBOOL R2 1 0 - 0x880C0123, // 007B GETMBR R3 R0 K35 - 0x4C100000, // 007C LDNIL R4 - 0x1C0C0604, // 007D EQ R3 R3 R4 - 0x780E0004, // 007E JMPF R3 #0084 - 0x880C0161, // 007F GETMBR R3 R0 K97 - 0x8C0C07BE, // 0080 GETMET R3 R3 K190 - 0x7C0C0200, // 0081 CALL R3 1 - 0x90024603, // 0082 SETMBR R0 K35 R3 - 0x50080200, // 0083 LDBOOL R2 1 0 - 0x780A0001, // 0084 JMPF R2 #0087 - 0x8C0C0140, // 0085 GETMET R3 R0 K64 - 0x7C0C0200, // 0086 CALL R3 1 - 0x80000000, // 0087 RET 0 - }) - ) -); -/*******************************************************************/ - - -/******************************************************************** -** Solidified function: _trigger_read_sensors -********************************************************************/ -be_local_closure(class_Matter_Device__trigger_read_sensors, /* name */ - be_nested_proto( - 8, /* nstack */ - 1, /* argc */ - 10, /* varg */ - 0, /* has upvals */ - NULL, /* no upvals */ - 0, /* has sup protos */ - NULL, /* no sub protos */ - 1, /* has constants */ - &be_ktab_class_Matter_Device, /* shared constants */ - be_str_weak(_trigger_read_sensors), - &be_const_str_solidified, - ( &(const binstruction[48]) { /* code */ - 0xA4063E00, // 0000 IMPORT R1 K31 - 0xB80A2000, // 0001 GETNGBL R2 K16 - 0x8C0805BF, // 0002 GETMET R2 R2 K191 - 0x7C080200, // 0003 CALL R2 1 - 0xB80E2000, // 0004 GETNGBL R3 K16 - 0x8C0C07C0, // 0005 GETMET R3 R3 K192 - 0x58140046, // 0006 LDCONST R5 K70 - 0x7C0C0400, // 0007 CALL R3 2 - 0x780E0006, // 0008 JMPF R3 #0010 - 0xB80E6A00, // 0009 GETNGBL R3 K53 - 0x60100008, // 000A GETGBL R4 G8 - 0x5C140400, // 000B MOVE R5 R2 - 0x7C100200, // 000C CALL R4 1 - 0x00138204, // 000D ADD R4 K193 R4 - 0x58140046, // 000E LDCONST R5 K70 - 0x7C0C0400, // 000F CALL R3 2 - 0x4C0C0000, // 0010 LDNIL R3 - 0x1C0C0403, // 0011 EQ R3 R2 R3 - 0x780E0000, // 0012 JMPF R3 #0014 - 0x80000600, // 0013 RET 0 - 0x8C0C03B2, // 0014 GETMET R3 R1 K178 - 0x5C140400, // 0015 MOVE R5 R2 - 0x7C0C0400, // 0016 CALL R3 2 - 0x4C100000, // 0017 LDNIL R4 - 0x20100604, // 0018 NE R4 R3 R4 - 0x7812000D, // 0019 JMPF R4 #0028 - 0x58100009, // 001A LDCONST R4 K9 - 0x6014000C, // 001B GETGBL R5 G12 - 0x8818010B, // 001C GETMBR R6 R0 K11 - 0x7C140200, // 001D CALL R5 1 - 0x14140805, // 001E LT R5 R4 R5 - 0x78160006, // 001F JMPF R5 #0027 - 0x8814010B, // 0020 GETMBR R5 R0 K11 - 0x94140A04, // 0021 GETIDX R5 R5 R4 - 0x8C140BC2, // 0022 GETMET R5 R5 K194 - 0x5C1C0600, // 0023 MOVE R7 R3 - 0x7C140400, // 0024 CALL R5 2 - 0x00100908, // 0025 ADD R4 R4 K8 - 0x7001FFF3, // 0026 JMP #001B - 0x70020006, // 0027 JMP #002F - 0xB8126A00, // 0028 GETNGBL R4 K53 - 0x60140008, // 0029 GETGBL R5 G8 - 0x5C180400, // 002A MOVE R6 R2 - 0x7C140200, // 002B CALL R5 1 - 0x00178605, // 002C ADD R5 K195 R5 - 0x58180046, // 002D LDCONST R6 K70 - 0x7C100400, // 002E CALL R4 2 - 0x80000000, // 002F RET 0 - }) - ) -); -/*******************************************************************/ - - -/******************************************************************** -** Solidified function: received_ack -********************************************************************/ -be_local_closure(class_Matter_Device_received_ack, /* name */ - be_nested_proto( - 5, /* nstack */ - 2, /* argc */ - 10, /* varg */ - 0, /* has upvals */ - NULL, /* no upvals */ - 0, /* has sup protos */ - NULL, /* no sub protos */ - 1, /* has constants */ - &be_ktab_class_Matter_Device, /* shared constants */ - be_str_weak(received_ack), - &be_const_str_solidified, - ( &(const binstruction[ 5]) { /* code */ - 0x88080100, // 0000 GETMBR R2 R0 K0 - 0x8C0805C4, // 0001 GETMET R2 R2 K196 - 0x5C100200, // 0002 MOVE R4 R1 - 0x7C080400, // 0003 CALL R2 2 - 0x80040400, // 0004 RET 1 R2 - }) - ) -); -/*******************************************************************/ - - -/******************************************************************** -** Solidified function: check_config_ep -********************************************************************/ -be_local_closure(class_Matter_Device_check_config_ep, /* name */ +be_local_closure(class_Matter_Device_attribute_updated, /* name */ be_nested_proto( 10, /* nstack */ - 1, /* argc */ + 5, /* argc */ 10, /* varg */ 0, /* has upvals */ NULL, /* no upvals */ @@ -2675,86 +1539,27 @@ be_local_closure(class_Matter_Device_check_config_ep, /* name */ NULL, /* no sub protos */ 1, /* has constants */ &be_ktab_class_Matter_Device, /* shared constants */ - be_str_weak(check_config_ep), + be_str_weak(attribute_updated), &be_const_str_solidified, - ( &(const binstruction[77]) { /* code */ - 0x50040000, // 0000 LDBOOL R1 0 0 - 0x60080012, // 0001 GETGBL R2 G18 - 0x7C080000, // 0002 CALL R2 0 - 0x600C0010, // 0003 GETGBL R3 G16 - 0x8810012E, // 0004 GETMBR R4 R0 K46 - 0x8C100905, // 0005 GETMET R4 R4 K5 - 0x7C100200, // 0006 CALL R4 1 - 0x7C0C0200, // 0007 CALL R3 1 - 0xA8020007, // 0008 EXBLK 0 #0011 - 0x5C100600, // 0009 MOVE R4 R3 - 0x7C100000, // 000A CALL R4 0 - 0x8C140506, // 000B GETMET R5 R2 K6 - 0x601C0009, // 000C GETGBL R7 G9 - 0x5C200800, // 000D MOVE R8 R4 - 0x7C1C0200, // 000E CALL R7 1 - 0x7C140400, // 000F CALL R5 2 - 0x7001FFF7, // 0010 JMP #0009 - 0x580C0007, // 0011 LDCONST R3 K7 - 0xAC0C0200, // 0012 CATCH R3 1 0 - 0xB0080000, // 0013 RAISE 2 R0 R0 - 0x600C0010, // 0014 GETGBL R3 G16 - 0x5C100400, // 0015 MOVE R4 R2 - 0x7C0C0200, // 0016 CALL R3 1 - 0xA8020030, // 0017 EXBLK 0 #0049 - 0x5C100600, // 0018 MOVE R4 R3 - 0x7C100000, // 0019 CALL R4 0 - 0x1C140909, // 001A EQ R5 R4 K9 - 0x7816000B, // 001B JMPF R5 #0028 - 0xB8166A00, // 001C GETNGBL R5 K53 - 0x581800C5, // 001D LDCONST R6 K197 - 0x581C0038, // 001E LDCONST R7 K56 - 0x7C140400, // 001F CALL R5 2 - 0x8814012E, // 0020 GETMBR R5 R0 K46 - 0x8C140B3D, // 0021 GETMET R5 R5 K61 - 0x601C0008, // 0022 GETGBL R7 G8 - 0x5C200800, // 0023 MOVE R8 R4 - 0x7C1C0200, // 0024 CALL R7 1 - 0x7C140400, // 0025 CALL R5 2 - 0x50040200, // 0026 LDBOOL R1 1 0 - 0x7002001F, // 0027 JMP #0048 - 0xB8162800, // 0028 GETNGBL R5 K20 - 0x88140B96, // 0029 GETMBR R5 R5 K150 - 0x1C140805, // 002A EQ R5 R4 R5 - 0x7816001B, // 002B JMPF R5 #0048 - 0x50040200, // 002C LDBOOL R1 1 0 - 0xB8166A00, // 002D GETNGBL R5 K53 - 0x60180018, // 002E GETGBL R6 G24 - 0x581C00C6, // 002F LDCONST R7 K198 - 0x5C200800, // 0030 MOVE R8 R4 - 0x88240128, // 0031 GETMBR R9 R0 K40 - 0x7C180600, // 0032 CALL R6 3 - 0x581C0038, // 0033 LDCONST R7 K56 - 0x7C140400, // 0034 CALL R5 2 - 0x60140008, // 0035 GETGBL R5 G8 - 0x88180128, // 0036 GETMBR R6 R0 K40 - 0x7C140200, // 0037 CALL R5 1 - 0x8818012E, // 0038 GETMBR R6 R0 K46 - 0x601C0008, // 0039 GETGBL R7 G8 - 0x5C200800, // 003A MOVE R8 R4 - 0x7C1C0200, // 003B CALL R7 1 - 0x8820012E, // 003C GETMBR R8 R0 K46 - 0x941C1007, // 003D GETIDX R7 R8 R7 - 0x98180A07, // 003E SETIDX R6 R5 R7 - 0x8814012E, // 003F GETMBR R5 R0 K46 - 0x8C140B3D, // 0040 GETMET R5 R5 K61 - 0x601C0008, // 0041 GETGBL R7 G8 - 0x5C200800, // 0042 MOVE R8 R4 - 0x7C1C0200, // 0043 CALL R7 1 - 0x7C140400, // 0044 CALL R5 2 - 0x88140128, // 0045 GETMBR R5 R0 K40 - 0x00140B08, // 0046 ADD R5 R5 K8 - 0x90025005, // 0047 SETMBR R0 K40 R5 - 0x7001FFCE, // 0048 JMP #0018 - 0x580C0007, // 0049 LDCONST R3 K7 - 0xAC0C0200, // 004A CATCH R3 1 0 - 0xB0080000, // 004B RAISE 2 R0 R0 - 0x80040200, // 004C RET 1 R1 + ( &(const binstruction[18]) { /* code */ + 0x4C140000, // 0000 LDNIL R5 + 0x1C140805, // 0001 EQ R5 R4 R5 + 0x78160000, // 0002 JMPF R5 #0004 + 0x50100000, // 0003 LDBOOL R4 0 0 + 0xB8162E00, // 0004 GETNGBL R5 K23 + 0x8C140B73, // 0005 GETMET R5 R5 K115 + 0x7C140200, // 0006 CALL R5 1 + 0x90163A01, // 0007 SETMBR R5 K29 R1 + 0x9016AA02, // 0008 SETMBR R5 K85 R2 + 0x9016AC03, // 0009 SETMBR R5 K86 R3 + 0x8818015D, // 000A GETMBR R6 R0 K93 + 0x88180D6D, // 000B GETMBR R6 R6 K109 + 0x88180D6E, // 000C GETMBR R6 R6 K110 + 0x8C180D74, // 000D GETMET R6 R6 K116 + 0x5C200A00, // 000E MOVE R8 R5 + 0x5C240800, // 000F MOVE R9 R4 + 0x7C180600, // 0010 CALL R6 3 + 0x80000000, // 0011 RET 0 }) ) ); @@ -2784,10 +1589,10 @@ be_local_closure(class_Matter_Device_button_multi_pressed, /* name */ 0x2C0C0604, // 0003 AND R3 R3 R4 0x541200FE, // 0004 LDINT R4 255 0x2C100404, // 0005 AND R4 R2 R4 - 0x8C14016E, // 0006 GETMET R5 R0 K110 - 0x001C0908, // 0007 ADD R7 R4 K8 - 0x58200038, // 0008 LDCONST R8 K56 - 0x58240009, // 0009 LDCONST R9 K9 + 0x8C140112, // 0006 GETMET R5 R0 K18 + 0x001C090B, // 0007 ADD R7 R4 K11 + 0x5820001B, // 0008 LDCONST R8 K27 + 0x58240008, // 0009 LDCONST R9 K8 0x5C280600, // 000A MOVE R10 R3 0x7C140A00, // 000B CALL R5 5 0x80000000, // 000C RET 0 @@ -2797,125 +1602,6 @@ be_local_closure(class_Matter_Device_button_multi_pressed, /* name */ /*******************************************************************/ -/******************************************************************** -** Solidified function: bridge_remove_endpoint -********************************************************************/ -be_local_closure(class_Matter_Device_bridge_remove_endpoint, /* name */ - be_nested_proto( - 10, /* nstack */ - 2, /* argc */ - 10, /* varg */ - 0, /* has upvals */ - NULL, /* no upvals */ - 0, /* has sup protos */ - NULL, /* no sub protos */ - 1, /* has constants */ - &be_ktab_class_Matter_Device, /* shared constants */ - be_str_weak(bridge_remove_endpoint), - &be_const_str_solidified, - ( &(const binstruction[56]) { /* code */ - 0xA40A3E00, // 0000 IMPORT R2 K31 - 0x600C0008, // 0001 GETGBL R3 G8 - 0x5C100200, // 0002 MOVE R4 R1 - 0x7C0C0200, // 0003 CALL R3 1 - 0x4C100000, // 0004 LDNIL R4 - 0x4C140000, // 0005 LDNIL R5 - 0x8818012E, // 0006 GETMBR R6 R0 K46 - 0x8C180D92, // 0007 GETMET R6 R6 K146 - 0x5C200600, // 0008 MOVE R8 R3 - 0x7C180400, // 0009 CALL R6 2 - 0x741A0004, // 000A JMPT R6 #0010 - 0xB81A6A00, // 000B GETNGBL R6 K53 - 0x001F8E03, // 000C ADD R7 K199 R3 - 0x58200046, // 000D LDCONST R8 K70 - 0x7C180400, // 000E CALL R6 2 - 0x80000C00, // 000F RET 0 - 0xB81A6A00, // 0010 GETNGBL R6 K53 - 0x601C0018, // 0011 GETGBL R7 G24 - 0x582000C8, // 0012 LDCONST R8 K200 - 0x5C240200, // 0013 MOVE R9 R1 - 0x7C1C0400, // 0014 CALL R7 2 - 0x58200038, // 0015 LDCONST R8 K56 - 0x7C180400, // 0016 CALL R6 2 - 0x8818012E, // 0017 GETMBR R6 R0 K46 - 0x8C180D3D, // 0018 GETMET R6 R6 K61 - 0x5C200600, // 0019 MOVE R8 R3 - 0x7C180400, // 001A CALL R6 2 - 0x50180200, // 001B LDBOOL R6 1 0 - 0x90025606, // 001C SETMBR R0 K43 R6 - 0x58180009, // 001D LDCONST R6 K9 - 0x601C000C, // 001E GETGBL R7 G12 - 0x8820010B, // 001F GETMBR R8 R0 K11 - 0x7C1C0200, // 0020 CALL R7 1 - 0x141C0C07, // 0021 LT R7 R6 R7 - 0x781E000D, // 0022 JMPF R7 #0031 - 0x881C010B, // 0023 GETMBR R7 R0 K11 - 0x941C0E06, // 0024 GETIDX R7 R7 R6 - 0x8C1C0F1C, // 0025 GETMET R7 R7 K28 - 0x7C1C0200, // 0026 CALL R7 1 - 0x1C1C0207, // 0027 EQ R7 R1 R7 - 0x781E0005, // 0028 JMPF R7 #002F - 0x881C010B, // 0029 GETMBR R7 R0 K11 - 0x8C1C0F3D, // 002A GETMET R7 R7 K61 - 0x5C240C00, // 002B MOVE R9 R6 - 0x7C1C0400, // 002C CALL R7 2 - 0x70020002, // 002D JMP #0031 - 0x70020000, // 002E JMP #0030 - 0x00180D08, // 002F ADD R6 R6 K8 - 0x7001FFEC, // 0030 JMP #001E - 0x8C1C01C9, // 0031 GETMET R7 R0 K201 - 0x7C1C0200, // 0032 CALL R7 1 - 0x8C1C0140, // 0033 GETMET R7 R0 K64 - 0x7C1C0200, // 0034 CALL R7 1 - 0x8C1C0191, // 0035 GETMET R7 R0 K145 - 0x7C1C0200, // 0036 CALL R7 1 - 0x80000000, // 0037 RET 0 - }) - ) -); -/*******************************************************************/ - - -/******************************************************************** -** Solidified function: find_plugin_by_endpoint -********************************************************************/ -be_local_closure(class_Matter_Device_find_plugin_by_endpoint, /* name */ - be_nested_proto( - 6, /* nstack */ - 2, /* argc */ - 10, /* varg */ - 0, /* has upvals */ - NULL, /* no upvals */ - 0, /* has sup protos */ - NULL, /* no sub protos */ - 1, /* has constants */ - &be_ktab_class_Matter_Device, /* shared constants */ - be_str_weak(find_plugin_by_endpoint), - &be_const_str_solidified, - ( &(const binstruction[17]) { /* code */ - 0x58080009, // 0000 LDCONST R2 K9 - 0x600C000C, // 0001 GETGBL R3 G12 - 0x8810010B, // 0002 GETMBR R4 R0 K11 - 0x7C0C0200, // 0003 CALL R3 1 - 0x140C0403, // 0004 LT R3 R2 R3 - 0x780E0008, // 0005 JMPF R3 #000F - 0x880C010B, // 0006 GETMBR R3 R0 K11 - 0x940C0602, // 0007 GETIDX R3 R3 R2 - 0x8C10071C, // 0008 GETMET R4 R3 K28 - 0x7C100200, // 0009 CALL R4 1 - 0x1C100801, // 000A EQ R4 R4 R1 - 0x78120000, // 000B JMPF R4 #000D - 0x80040600, // 000C RET 1 R3 - 0x00080508, // 000D ADD R2 R2 K8 - 0x7001FFF1, // 000E JMP #0001 - 0x4C0C0000, // 000F LDNIL R3 - 0x80040600, // 0010 RET 1 R3 - }) - ) -); -/*******************************************************************/ - - /******************************************************************** ** Solidified function: register_commands ********************************************************************/ @@ -3015,19 +1701,19 @@ be_local_closure(class_Matter_Device_register_commands, /* name */ be_str_weak(register_commands), &be_const_str_solidified, ( &(const binstruction[17]) { /* code */ - 0xB8062000, // 0000 GETNGBL R1 K16 - 0x8C0403CA, // 0001 GETMET R1 R1 K202 - 0x580C00CB, // 0002 LDCONST R3 K203 + 0xB8060200, // 0000 GETNGBL R1 K1 + 0x8C040375, // 0001 GETMET R1 R1 K117 + 0x580C0076, // 0002 LDCONST R3 K118 0x84100000, // 0003 CLOSURE R4 P0 0x7C040600, // 0004 CALL R1 3 - 0xB8062000, // 0005 GETNGBL R1 K16 - 0x8C0403CA, // 0006 GETMET R1 R1 K202 - 0x580C00CC, // 0007 LDCONST R3 K204 + 0xB8060200, // 0005 GETNGBL R1 K1 + 0x8C040375, // 0006 GETMET R1 R1 K117 + 0x580C0077, // 0007 LDCONST R3 K119 0x84100001, // 0008 CLOSURE R4 P1 0x7C040600, // 0009 CALL R1 3 - 0xB8062000, // 000A GETNGBL R1 K16 - 0x8C0403CA, // 000B GETMET R1 R1 K202 - 0x580C00CD, // 000C LDCONST R3 K205 + 0xB8060200, // 000A GETNGBL R1 K1 + 0x8C040375, // 000B GETMET R1 R1 K117 + 0x580C0078, // 000C LDCONST R3 K120 0x84100002, // 000D CLOSURE R4 P2 0x7C040600, // 000E CALL R1 3 0xA0000000, // 000F CLOSE R0 @@ -3038,6 +1724,1255 @@ be_local_closure(class_Matter_Device_register_commands, /* name */ /*******************************************************************/ +/******************************************************************** +** Solidified function: save_param +********************************************************************/ +be_local_closure(class_Matter_Device_save_param, /* name */ + be_nested_proto( + 9, /* nstack */ + 1, /* argc */ + 10, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + &be_ktab_class_Matter_Device, /* shared constants */ + be_str_weak(save_param), + &be_const_str_solidified, + ( &(const binstruction[83]) { /* code */ + 0xA4060000, // 0000 IMPORT R1 K0 + 0x8C080179, // 0001 GETMET R2 R0 K121 + 0x7C080200, // 0002 CALL R2 1 + 0x60080018, // 0003 GETGBL R2 G24 + 0x580C007A, // 0004 LDCONST R3 K122 + 0x88100126, // 0005 GETMBR R4 R0 K38 + 0x88140129, // 0006 GETMBR R5 R0 K41 + 0x8818012B, // 0007 GETMBR R6 R0 K43 + 0x781A0001, // 0008 JMPF R6 #000B + 0x5818007B, // 0009 LDCONST R6 K123 + 0x70020000, // 000A JMP #000C + 0x5818007C, // 000B LDCONST R6 K124 + 0x881C012C, // 000C GETMBR R7 R0 K44 + 0x781E0001, // 000D JMPF R7 #0010 + 0x581C007B, // 000E LDCONST R7 K123 + 0x70020000, // 000F JMP #0011 + 0x581C007C, // 0010 LDCONST R7 K124 + 0x8820011A, // 0011 GETMBR R8 R0 K26 + 0x7C080C00, // 0012 CALL R2 6 + 0x880C012F, // 0013 GETMBR R3 R0 K47 + 0x780E0000, // 0014 JMPF R3 #0016 + 0x0008057D, // 0015 ADD R2 R2 K125 + 0x880C0133, // 0016 GETMBR R3 R0 K51 + 0x780E000E, // 0017 JMPF R3 #0027 + 0x0008057E, // 0018 ADD R2 R2 K126 + 0x8C0C037F, // 0019 GETMET R3 R1 K127 + 0x88140113, // 001A GETMBR R5 R0 K19 + 0x7C0C0400, // 001B CALL R3 2 + 0x00080403, // 001C ADD R2 R2 R3 + 0x600C000C, // 001D GETGBL R3 G12 + 0x88100134, // 001E GETMBR R4 R0 K52 + 0x7C0C0200, // 001F CALL R3 1 + 0x240C0708, // 0020 GT R3 R3 K8 + 0x780E0004, // 0021 JMPF R3 #0027 + 0x00080580, // 0022 ADD R2 R2 K128 + 0x8C0C037F, // 0023 GETMET R3 R1 K127 + 0x88140134, // 0024 GETMBR R5 R0 K52 + 0x7C0C0400, // 0025 CALL R3 2 + 0x00080403, // 0026 ADD R2 R2 R3 + 0x00080581, // 0027 ADD R2 R2 K129 + 0xA8020017, // 0028 EXBLK 0 #0041 + 0x600C0011, // 0029 GETGBL R3 G17 + 0x88100123, // 002A GETMBR R4 R0 K35 + 0x58140082, // 002B LDCONST R5 K130 + 0x7C0C0400, // 002C CALL R3 2 + 0x8C100783, // 002D GETMET R4 R3 K131 + 0x5C180400, // 002E MOVE R6 R2 + 0x7C100400, // 002F CALL R4 2 + 0x8C100725, // 0030 GETMET R4 R3 K37 + 0x7C100200, // 0031 CALL R4 1 + 0xB8120A00, // 0032 GETNGBL R4 K5 + 0x60140018, // 0033 GETGBL R5 G24 + 0x58180084, // 0034 LDCONST R6 K132 + 0x881C0133, // 0035 GETMBR R7 R0 K51 + 0x781E0001, // 0036 JMPF R7 #0039 + 0x581C0085, // 0037 LDCONST R7 K133 + 0x70020000, // 0038 JMP #003A + 0x581C0040, // 0039 LDCONST R7 K64 + 0x7C140400, // 003A CALL R5 2 + 0x5818001B, // 003B LDCONST R6 K27 + 0x7C100400, // 003C CALL R4 2 + 0xA8040001, // 003D EXBLK 1 1 + 0x80040400, // 003E RET 1 R2 + 0xA8040001, // 003F EXBLK 1 1 + 0x70020010, // 0040 JMP #0052 + 0xAC0C0002, // 0041 CATCH R3 0 2 + 0x7002000D, // 0042 JMP #0051 + 0xB8160A00, // 0043 GETNGBL R5 K5 + 0x60180008, // 0044 GETGBL R6 G8 + 0x5C1C0600, // 0045 MOVE R7 R3 + 0x7C180200, // 0046 CALL R6 1 + 0x001B0C06, // 0047 ADD R6 K134 R6 + 0x00180D39, // 0048 ADD R6 R6 K57 + 0x601C0008, // 0049 GETGBL R7 G8 + 0x5C200800, // 004A MOVE R8 R4 + 0x7C1C0200, // 004B CALL R7 1 + 0x00180C07, // 004C ADD R6 R6 R7 + 0x581C001B, // 004D LDCONST R7 K27 + 0x7C140400, // 004E CALL R5 2 + 0x80040400, // 004F RET 1 R2 + 0x70020000, // 0050 JMP #0052 + 0xB0080000, // 0051 RAISE 2 R0 R0 + 0x80000000, // 0052 RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: clean_remotes +********************************************************************/ +be_local_closure(class_Matter_Device_clean_remotes, /* name */ + be_nested_proto( + 10, /* nstack */ + 1, /* argc */ + 10, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + &be_ktab_class_Matter_Device, /* shared constants */ + be_str_weak(clean_remotes), + &be_const_str_solidified, + ( &(const binstruction[80]) { /* code */ + 0xA4068800, // 0000 IMPORT R1 K68 + 0x88080187, // 0001 GETMBR R2 R0 K135 + 0x780A004B, // 0002 JMPF R2 #004F + 0x60080013, // 0003 GETGBL R2 G19 + 0x7C080000, // 0004 CALL R2 0 + 0x600C0010, // 0005 GETGBL R3 G16 + 0x88100187, // 0006 GETMBR R4 R0 K135 + 0x7C0C0200, // 0007 CALL R3 1 + 0xA8020003, // 0008 EXBLK 0 #000D + 0x5C100600, // 0009 MOVE R4 R3 + 0x7C100000, // 000A CALL R4 0 + 0x98080908, // 000B SETIDX R2 R4 K8 + 0x7001FFFB, // 000C JMP #0009 + 0x580C0016, // 000D LDCONST R3 K22 + 0xAC0C0200, // 000E CATCH R3 1 0 + 0xB0080000, // 000F RAISE 2 R0 R0 + 0x600C0010, // 0010 GETGBL R3 G16 + 0x88100109, // 0011 GETMBR R4 R0 K9 + 0x7C0C0200, // 0012 CALL R3 1 + 0xA802000F, // 0013 EXBLK 0 #0024 + 0x5C100600, // 0014 MOVE R4 R3 + 0x7C100000, // 0015 CALL R4 0 + 0x8C14033B, // 0016 GETMET R5 R1 K59 + 0x5C1C0800, // 0017 MOVE R7 R4 + 0x58200088, // 0018 LDCONST R8 K136 + 0x7C140600, // 0019 CALL R5 3 + 0x4C180000, // 001A LDNIL R6 + 0x20180A06, // 001B NE R6 R5 R6 + 0x781A0005, // 001C JMPF R6 #0023 + 0x8C180527, // 001D GETMET R6 R2 K39 + 0x5C200A00, // 001E MOVE R8 R5 + 0x58240008, // 001F LDCONST R9 K8 + 0x7C180600, // 0020 CALL R6 3 + 0x00180D0B, // 0021 ADD R6 R6 K11 + 0x98080A06, // 0022 SETIDX R2 R5 R6 + 0x7001FFEF, // 0023 JMP #0014 + 0x580C0016, // 0024 LDCONST R3 K22 + 0xAC0C0200, // 0025 CATCH R3 1 0 + 0xB0080000, // 0026 RAISE 2 R0 R0 + 0x600C0012, // 0027 GETGBL R3 G18 + 0x7C0C0000, // 0028 CALL R3 0 + 0x60100010, // 0029 GETGBL R4 G16 + 0x8C140514, // 002A GETMET R5 R2 K20 + 0x7C140200, // 002B CALL R5 1 + 0x7C100200, // 002C CALL R4 1 + 0xA8020008, // 002D EXBLK 0 #0037 + 0x5C140800, // 002E MOVE R5 R4 + 0x7C140000, // 002F CALL R5 0 + 0x94180405, // 0030 GETIDX R6 R2 R5 + 0x1C180D08, // 0031 EQ R6 R6 K8 + 0x781A0002, // 0032 JMPF R6 #0036 + 0x8C180715, // 0033 GETMET R6 R3 K21 + 0x5C200A00, // 0034 MOVE R8 R5 + 0x7C180400, // 0035 CALL R6 2 + 0x7001FFF6, // 0036 JMP #002E + 0x58100016, // 0037 LDCONST R4 K22 + 0xAC100200, // 0038 CATCH R4 1 0 + 0xB0080000, // 0039 RAISE 2 R0 R0 + 0x60100010, // 003A GETGBL R4 G16 + 0x5C140600, // 003B MOVE R5 R3 + 0x7C100200, // 003C CALL R4 1 + 0xA802000D, // 003D EXBLK 0 #004C + 0x5C140800, // 003E MOVE R5 R4 + 0x7C140000, // 003F CALL R5 0 + 0xB81A0A00, // 0040 GETNGBL R6 K5 + 0x881C0B8A, // 0041 GETMBR R7 R5 K138 + 0x001F1207, // 0042 ADD R7 K137 R7 + 0x58200004, // 0043 LDCONST R8 K4 + 0x7C180400, // 0044 CALL R6 2 + 0x8C180B25, // 0045 GETMET R6 R5 K37 + 0x7C180200, // 0046 CALL R6 1 + 0x88180187, // 0047 GETMBR R6 R0 K135 + 0x8C180D1C, // 0048 GETMET R6 R6 K28 + 0x88200B8A, // 0049 GETMBR R8 R5 K138 + 0x7C180400, // 004A CALL R6 2 + 0x7001FFF1, // 004B JMP #003E + 0x58100016, // 004C LDCONST R4 K22 + 0xAC100200, // 004D CATCH R4 1 0 + 0xB0080000, // 004E RAISE 2 R0 R0 + 0x80000000, // 004F RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: bridge_remove_endpoint +********************************************************************/ +be_local_closure(class_Matter_Device_bridge_remove_endpoint, /* name */ + be_nested_proto( + 10, /* nstack */ + 2, /* argc */ + 10, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + &be_ktab_class_Matter_Device, /* shared constants */ + be_str_weak(bridge_remove_endpoint), + &be_const_str_solidified, + ( &(const binstruction[56]) { /* code */ + 0xA40A0000, // 0000 IMPORT R2 K0 + 0x600C0008, // 0001 GETGBL R3 G8 + 0x5C100200, // 0002 MOVE R4 R1 + 0x7C0C0200, // 0003 CALL R3 1 + 0x4C100000, // 0004 LDNIL R4 + 0x4C140000, // 0005 LDNIL R5 + 0x88180113, // 0006 GETMBR R6 R0 K19 + 0x8C180D8B, // 0007 GETMET R6 R6 K139 + 0x5C200600, // 0008 MOVE R8 R3 + 0x7C180400, // 0009 CALL R6 2 + 0x741A0004, // 000A JMPT R6 #0010 + 0xB81A0A00, // 000B GETNGBL R6 K5 + 0x001F1803, // 000C ADD R7 K140 R3 + 0x58200004, // 000D LDCONST R8 K4 + 0x7C180400, // 000E CALL R6 2 + 0x80000C00, // 000F RET 0 + 0xB81A0A00, // 0010 GETNGBL R6 K5 + 0x601C0018, // 0011 GETGBL R7 G24 + 0x5820008D, // 0012 LDCONST R8 K141 + 0x5C240200, // 0013 MOVE R9 R1 + 0x7C1C0400, // 0014 CALL R7 2 + 0x5820001B, // 0015 LDCONST R8 K27 + 0x7C180400, // 0016 CALL R6 2 + 0x88180113, // 0017 GETMBR R6 R0 K19 + 0x8C180D1C, // 0018 GETMET R6 R6 K28 + 0x5C200600, // 0019 MOVE R8 R3 + 0x7C180400, // 001A CALL R6 2 + 0x50180200, // 001B LDBOOL R6 1 0 + 0x90026606, // 001C SETMBR R0 K51 R6 + 0x58180008, // 001D LDCONST R6 K8 + 0x601C000C, // 001E GETGBL R7 G12 + 0x88200109, // 001F GETMBR R8 R0 K9 + 0x7C1C0200, // 0020 CALL R7 1 + 0x141C0C07, // 0021 LT R7 R6 R7 + 0x781E000D, // 0022 JMPF R7 #0031 + 0x881C0109, // 0023 GETMBR R7 R0 K9 + 0x941C0E06, // 0024 GETIDX R7 R7 R6 + 0x8C1C0F67, // 0025 GETMET R7 R7 K103 + 0x7C1C0200, // 0026 CALL R7 1 + 0x1C1C0207, // 0027 EQ R7 R1 R7 + 0x781E0005, // 0028 JMPF R7 #002F + 0x881C0109, // 0029 GETMBR R7 R0 K9 + 0x8C1C0F1C, // 002A GETMET R7 R7 K28 + 0x5C240C00, // 002B MOVE R9 R6 + 0x7C1C0400, // 002C CALL R7 2 + 0x70020002, // 002D JMP #0031 + 0x70020000, // 002E JMP #0030 + 0x00180D0B, // 002F ADD R6 R6 K11 + 0x7001FFEC, // 0030 JMP #001E + 0x8C1C018E, // 0031 GETMET R7 R0 K142 + 0x7C1C0200, // 0032 CALL R7 1 + 0x8C1C013E, // 0033 GETMET R7 R0 K62 + 0x7C1C0200, // 0034 CALL R7 1 + 0x8C1C018F, // 0035 GETMET R7 R0 K143 + 0x7C1C0200, // 0036 CALL R7 1 + 0x80000000, // 0037 RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: _start_udp +********************************************************************/ +be_local_closure(class_Matter_Device__start_udp, /* name */ + be_nested_proto( + 7, /* nstack */ + 2, /* argc */ + 10, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 1, /* has sup protos */ + ( &(const struct bproto*[ 1]) { + be_nested_proto( + 8, /* nstack */ + 3, /* argc */ + 0, /* varg */ + 1, /* has upvals */ + ( &(const bupvaldesc[ 1]) { /* upvals */ + be_local_const_upval(1, 0), + }), + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[ 1]) { /* constants */ + /* K0 */ be_nested_str_weak(msg_received), + }), + be_str_weak(_X3Clambda_X3E), + &be_const_str_solidified, + ( &(const binstruction[ 7]) { /* code */ + 0x680C0000, // 0000 GETUPV R3 U0 + 0x8C0C0700, // 0001 GETMET R3 R3 K0 + 0x5C140000, // 0002 MOVE R5 R0 + 0x5C180200, // 0003 MOVE R6 R1 + 0x5C1C0400, // 0004 MOVE R7 R2 + 0x7C0C0800, // 0005 CALL R3 4 + 0x80040600, // 0006 RET 1 R3 + }) + ), + }), + 1, /* has constants */ + &be_ktab_class_Matter_Device, /* shared constants */ + be_str_weak(_start_udp), + &be_const_str_solidified, + ( &(const binstruction[27]) { /* code */ + 0x88080148, // 0000 GETMBR R2 R0 K72 + 0x780A0000, // 0001 JMPF R2 #0003 + 0x80000400, // 0002 RET 0 + 0x4C080000, // 0003 LDNIL R2 + 0x1C080202, // 0004 EQ R2 R1 R2 + 0x780A0000, // 0005 JMPF R2 #0007 + 0x540615A3, // 0006 LDINT R1 5540 + 0xB80A0A00, // 0007 GETNGBL R2 K5 + 0x600C0008, // 0008 GETGBL R3 G8 + 0x5C100200, // 0009 MOVE R4 R1 + 0x7C0C0200, // 000A CALL R3 1 + 0x000F2003, // 000B ADD R3 K144 R3 + 0x5810001B, // 000C LDCONST R4 K27 + 0x7C080400, // 000D CALL R2 2 + 0xB80A2E00, // 000E GETNGBL R2 K23 + 0x8C080591, // 000F GETMET R2 R2 K145 + 0x5C100000, // 0010 MOVE R4 R0 + 0x58140040, // 0011 LDCONST R5 K64 + 0x5C180200, // 0012 MOVE R6 R1 + 0x7C080800, // 0013 CALL R2 4 + 0x90029002, // 0014 SETMBR R0 K72 R2 + 0x88080148, // 0015 GETMBR R2 R0 K72 + 0x8C080563, // 0016 GETMET R2 R2 K99 + 0x84100000, // 0017 CLOSURE R4 P0 + 0x7C080400, // 0018 CALL R2 2 + 0xA0000000, // 0019 CLOSE R0 + 0x80000000, // 001A RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: event_fabrics_saved +********************************************************************/ +be_local_closure(class_Matter_Device_event_fabrics_saved, /* name */ + be_nested_proto( + 3, /* nstack */ + 1, /* argc */ + 10, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + &be_ktab_class_Matter_Device, /* shared constants */ + be_str_weak(event_fabrics_saved), + &be_const_str_solidified, + ( &(const binstruction[12]) { /* code */ + 0x8804015B, // 0000 GETMBR R1 R0 K91 + 0x8C040392, // 0001 GETMET R1 R1 K146 + 0x7C040200, // 0002 CALL R1 1 + 0x24040308, // 0003 GT R1 R1 K8 + 0x78060005, // 0004 JMPF R1 #000B + 0x88040133, // 0005 GETMBR R1 R0 K51 + 0x74060003, // 0006 JMPT R1 #000B + 0x50040200, // 0007 LDBOOL R1 1 0 + 0x90026601, // 0008 SETMBR R0 K51 R1 + 0x8C04013E, // 0009 GETMET R1 R0 K62 + 0x7C040200, // 000A CALL R1 1 + 0x80000000, // 000B RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: init +********************************************************************/ +be_local_closure(class_Matter_Device_init, /* name */ + be_nested_proto( + 6, /* nstack */ + 1, /* argc */ + 10, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 1, /* has sup protos */ + ( &(const struct bproto*[ 1]) { + be_nested_proto( + 2, /* nstack */ + 0, /* argc */ + 0, /* varg */ + 1, /* has upvals */ + ( &(const bupvaldesc[ 1]) { /* upvals */ + be_local_const_upval(1, 0), + }), + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[ 1]) { /* constants */ + /* K0 */ be_nested_str_weak(start), + }), + be_str_weak(_anonymous_), + &be_const_str_solidified, + ( &(const binstruction[ 4]) { /* code */ + 0x68000000, // 0000 GETUPV R0 U0 + 0x8C000100, // 0001 GETMET R0 R0 K0 + 0x7C000200, // 0002 CALL R0 1 + 0x80000000, // 0003 RET 0 + }) + ), + }), + 1, /* has constants */ + &be_ktab_class_Matter_Device, /* shared constants */ + be_str_weak(init), + &be_const_str_solidified, + ( &(const binstruction[83]) { /* code */ + 0xA4064400, // 0000 IMPORT R1 K34 + 0xB80A0200, // 0001 GETNGBL R2 K1 + 0x8C080593, // 0002 GETMET R2 R2 K147 + 0xB8122E00, // 0003 GETNGBL R4 K23 + 0x88100994, // 0004 GETMBR R4 R4 K148 + 0x7C080400, // 0005 CALL R2 2 + 0x740A0006, // 0006 JMPT R2 #000E + 0xB80A2E00, // 0007 GETNGBL R2 K23 + 0x8C080596, // 0008 GETMET R2 R2 K150 + 0x5C100000, // 0009 MOVE R4 R0 + 0x50140000, // 000A LDBOOL R5 0 0 + 0x7C080600, // 000B CALL R2 3 + 0x90032A02, // 000C SETMBR R0 K149 R2 + 0x80000400, // 000D RET 0 + 0xB80A2E00, // 000E GETNGBL R2 K23 + 0xB80E2E00, // 000F GETNGBL R3 K23 + 0x8C0C0798, // 0010 GETMET R3 R3 K152 + 0x7C0C0200, // 0011 CALL R3 1 + 0x900B2E03, // 0012 SETMBR R2 K151 R3 + 0x90033308, // 0013 SETMBR R0 K153 K8 + 0x60080012, // 0014 GETGBL R2 G18 + 0x7C080000, // 0015 CALL R2 0 + 0x90021202, // 0016 SETMBR R0 K9 R2 + 0x50080000, // 0017 LDBOOL R2 0 0 + 0x90026602, // 0018 SETMBR R0 K51 R2 + 0x60080013, // 0019 GETGBL R2 G19 + 0x7C080000, // 001A CALL R2 0 + 0x90026802, // 001B SETMBR R0 K52 R2 + 0x8808019A, // 001C GETMBR R2 R0 K154 + 0x90023402, // 001D SETMBR R0 K26 R2 + 0x50080000, // 001E LDBOOL R2 0 0 + 0x90025602, // 001F SETMBR R0 K43 R2 + 0x50080000, // 0020 LDBOOL R2 0 0 + 0x90025802, // 0021 SETMBR R0 K44 R2 + 0xB80A2E00, // 0022 GETNGBL R2 K23 + 0x8C08059B, // 0023 GETMET R2 R2 K155 + 0x5C100000, // 0024 MOVE R4 R0 + 0x7C080400, // 0025 CALL R2 2 + 0x90027802, // 0026 SETMBR R0 K60 R2 + 0x8C08019C, // 0027 GETMET R2 R0 K156 + 0x7C080200, // 0028 CALL R2 1 + 0xB80A2E00, // 0029 GETNGBL R2 K23 + 0x8C08059D, // 002A GETMET R2 R2 K157 + 0x5C100000, // 002B MOVE R4 R0 + 0x7C080400, // 002C CALL R2 2 + 0x9002B602, // 002D SETMBR R0 K91 R2 + 0x8808015B, // 002E GETMBR R2 R0 K91 + 0x8C08059E, // 002F GETMET R2 R2 K158 + 0x7C080200, // 0030 CALL R2 1 + 0xB80A2E00, // 0031 GETNGBL R2 K23 + 0x8C08059F, // 0032 GETMET R2 R2 K159 + 0x5C100000, // 0033 MOVE R4 R0 + 0x7C080400, // 0034 CALL R2 2 + 0x9002BA02, // 0035 SETMBR R0 K93 R2 + 0xB80A2E00, // 0036 GETNGBL R2 K23 + 0x8C0805A0, // 0037 GETMET R2 R2 K160 + 0x5C100000, // 0038 MOVE R4 R0 + 0x7C080400, // 0039 CALL R2 2 + 0x9002BC02, // 003A SETMBR R0 K94 R2 + 0x8C0801A2, // 003B GETMET R2 R0 K162 + 0x7C080200, // 003C CALL R2 1 + 0x90034202, // 003D SETMBR R0 K161 R2 + 0xB80A2E00, // 003E GETNGBL R2 K23 + 0x8C080596, // 003F GETMET R2 R2 K150 + 0x5C100000, // 0040 MOVE R4 R0 + 0x50140200, // 0041 LDBOOL R5 1 0 + 0x7C080600, // 0042 CALL R2 3 + 0x90032A02, // 0043 SETMBR R0 K149 R2 + 0xB80A0200, // 0044 GETNGBL R2 K1 + 0x8C0805A3, // 0045 GETMET R2 R2 K163 + 0x84100000, // 0046 CLOSURE R4 P0 + 0x7C080400, // 0047 CALL R2 2 + 0x8808013C, // 0048 GETMBR R2 R0 K60 + 0x8C0805A4, // 0049 GETMET R2 R2 K164 + 0x7C080200, // 004A CALL R2 1 + 0xB80A0200, // 004B GETNGBL R2 K1 + 0x8C0805A5, // 004C GETMET R2 R2 K165 + 0x5C100000, // 004D MOVE R4 R0 + 0x7C080400, // 004E CALL R2 2 + 0x8C0801A6, // 004F GETMET R2 R0 K166 + 0x7C080200, // 0050 CALL R2 1 + 0xA0000000, // 0051 CLOSE R0 + 0x80000000, // 0052 RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: get_active_endpoints +********************************************************************/ +be_local_closure(class_Matter_Device_get_active_endpoints, /* name */ + be_nested_proto( + 9, /* nstack */ + 2, /* argc */ + 10, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + &be_ktab_class_Matter_Device, /* shared constants */ + be_str_weak(get_active_endpoints), + &be_const_str_solidified, + ( &(const binstruction[28]) { /* code */ + 0x60080012, // 0000 GETGBL R2 G18 + 0x7C080000, // 0001 CALL R2 0 + 0x600C0010, // 0002 GETGBL R3 G16 + 0x88100109, // 0003 GETMBR R4 R0 K9 + 0x7C0C0200, // 0004 CALL R3 1 + 0xA8020011, // 0005 EXBLK 0 #0018 + 0x5C100600, // 0006 MOVE R4 R3 + 0x7C100000, // 0007 CALL R4 0 + 0x8C140967, // 0008 GETMET R5 R4 K103 + 0x7C140200, // 0009 CALL R5 1 + 0x78060002, // 000A JMPF R1 #000E + 0x1C180B08, // 000B EQ R6 R5 K8 + 0x781A0000, // 000C JMPF R6 #000E + 0x7001FFF7, // 000D JMP #0006 + 0x8C180527, // 000E GETMET R6 R2 K39 + 0x5C200A00, // 000F MOVE R8 R5 + 0x7C180400, // 0010 CALL R6 2 + 0x4C1C0000, // 0011 LDNIL R7 + 0x1C180C07, // 0012 EQ R6 R6 R7 + 0x781A0002, // 0013 JMPF R6 #0017 + 0x8C180515, // 0014 GETMET R6 R2 K21 + 0x5C200A00, // 0015 MOVE R8 R5 + 0x7C180400, // 0016 CALL R6 2 + 0x7001FFED, // 0017 JMP #0006 + 0x580C0016, // 0018 LDCONST R3 K22 + 0xAC0C0200, // 0019 CATCH R3 1 0 + 0xB0080000, // 001A RAISE 2 R0 R0 + 0x80040400, // 001B RET 1 R2 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: received_ack +********************************************************************/ +be_local_closure(class_Matter_Device_received_ack, /* name */ + be_nested_proto( + 5, /* nstack */ + 2, /* argc */ + 10, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + &be_ktab_class_Matter_Device, /* shared constants */ + be_str_weak(received_ack), + &be_const_str_solidified, + ( &(const binstruction[ 5]) { /* code */ + 0x88080148, // 0000 GETMBR R2 R0 K72 + 0x8C0805A7, // 0001 GETMET R2 R2 K167 + 0x5C100200, // 0002 MOVE R4 R1 + 0x7C080400, // 0003 CALL R2 2 + 0x80040400, // 0004 RET 1 R2 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: adjust_next_ep +********************************************************************/ +be_local_closure(class_Matter_Device_adjust_next_ep, /* name */ + be_nested_proto( + 5, /* nstack */ + 1, /* argc */ + 10, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + &be_ktab_class_Matter_Device, /* shared constants */ + be_str_weak(adjust_next_ep), + &be_const_str_solidified, + ( &(const binstruction[21]) { /* code */ + 0x60040010, // 0000 GETGBL R1 G16 + 0x88080113, // 0001 GETMBR R2 R0 K19 + 0x8C080514, // 0002 GETMET R2 R2 K20 + 0x7C080200, // 0003 CALL R2 1 + 0x7C040200, // 0004 CALL R1 1 + 0xA802000A, // 0005 EXBLK 0 #0011 + 0x5C080200, // 0006 MOVE R2 R1 + 0x7C080000, // 0007 CALL R2 0 + 0x600C0009, // 0008 GETGBL R3 G9 + 0x5C100400, // 0009 MOVE R4 R2 + 0x7C0C0200, // 000A CALL R3 1 + 0x8810011A, // 000B GETMBR R4 R0 K26 + 0x28100604, // 000C GE R4 R3 R4 + 0x78120001, // 000D JMPF R4 #0010 + 0x0010070B, // 000E ADD R4 R3 K11 + 0x90023404, // 000F SETMBR R0 K26 R4 + 0x7001FFF4, // 0010 JMP #0006 + 0x58040016, // 0011 LDCONST R1 K22 + 0xAC040200, // 0012 CATCH R1 1 0 + 0xB0080000, // 0013 RAISE 2 R0 R0 + 0x80000000, // 0014 RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: reset_param +********************************************************************/ +be_local_closure(class_Matter_Device_reset_param, /* name */ + be_nested_proto( + 3, /* nstack */ + 1, /* argc */ + 10, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + &be_ktab_class_Matter_Device, /* shared constants */ + be_str_weak(reset_param), + &be_const_str_solidified, + ( &(const binstruction[ 7]) { /* code */ + 0x50040000, // 0000 LDBOOL R1 0 0 + 0x90026601, // 0001 SETMBR R0 K51 R1 + 0x8804019A, // 0002 GETMBR R1 R0 K154 + 0x90023401, // 0003 SETMBR R0 K26 R1 + 0x8C04013E, // 0004 GETMET R1 R0 K62 + 0x7C040200, // 0005 CALL R1 1 + 0x80000000, // 0006 RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: every_250ms +********************************************************************/ +be_local_closure(class_Matter_Device_every_250ms, /* name */ + be_nested_proto( + 4, /* nstack */ + 1, /* argc */ + 10, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + &be_ktab_class_Matter_Device, /* shared constants */ + be_str_weak(every_250ms), + &be_const_str_solidified, + ( &(const binstruction[15]) { /* code */ + 0x8C0401A8, // 0000 GETMET R1 R0 K168 + 0x7C040200, // 0001 CALL R1 1 + 0x58040008, // 0002 LDCONST R1 K8 + 0x6008000C, // 0003 GETGBL R2 G12 + 0x880C0109, // 0004 GETMBR R3 R0 K9 + 0x7C080200, // 0005 CALL R2 1 + 0x14080202, // 0006 LT R2 R1 R2 + 0x780A0005, // 0007 JMPF R2 #000E + 0x88080109, // 0008 GETMBR R2 R0 K9 + 0x94080401, // 0009 GETIDX R2 R2 R1 + 0x8C0805A9, // 000A GETMET R2 R2 K169 + 0x7C080200, // 000B CALL R2 1 + 0x0004030B, // 000C ADD R1 R1 K11 + 0x7001FFF4, // 000D JMP #0003 + 0x80000000, // 000E RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: button_handler +********************************************************************/ +be_local_closure(class_Matter_Device_button_handler, /* name */ + be_nested_proto( + 14, /* nstack */ + 5, /* argc */ + 10, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + &be_ktab_class_Matter_Device, /* shared constants */ + be_str_weak(button_handler), + &be_const_str_solidified, + ( &(const binstruction[25]) { /* code */ + 0x58140008, // 0000 LDCONST R5 K8 + 0xA41A8800, // 0001 IMPORT R6 K68 + 0x601C000C, // 0002 GETGBL R7 G12 + 0x88200109, // 0003 GETMBR R8 R0 K9 + 0x7C1C0200, // 0004 CALL R7 1 + 0x141C0A07, // 0005 LT R7 R5 R7 + 0x781E0010, // 0006 JMPF R7 #0018 + 0x881C0109, // 0007 GETMBR R7 R0 K9 + 0x941C0E05, // 0008 GETIDX R7 R7 R5 + 0x8C200D8B, // 0009 GETMET R8 R6 K139 + 0x5C280E00, // 000A MOVE R10 R7 + 0x582C0012, // 000B LDCONST R11 K18 + 0x7C200600, // 000C CALL R8 3 + 0x78220007, // 000D JMPF R8 #0016 + 0x88200109, // 000E GETMBR R8 R0 K9 + 0x94201005, // 000F GETIDX R8 R8 R5 + 0x8C201112, // 0010 GETMET R8 R8 K18 + 0x5C280200, // 0011 MOVE R10 R1 + 0x5C2C0400, // 0012 MOVE R11 R2 + 0x5C300600, // 0013 MOVE R12 R3 + 0x5C340800, // 0014 MOVE R13 R4 + 0x7C200A00, // 0015 CALL R8 5 + 0x00140B0B, // 0016 ADD R5 R5 K11 + 0x7001FFE9, // 0017 JMP #0002 + 0x80000000, // 0018 RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: msg_send +********************************************************************/ +be_local_closure(class_Matter_Device_msg_send, /* name */ + be_nested_proto( + 5, /* nstack */ + 2, /* argc */ + 10, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + &be_ktab_class_Matter_Device, /* shared constants */ + be_str_weak(msg_send), + &be_const_str_solidified, + ( &(const binstruction[ 5]) { /* code */ + 0x88080148, // 0000 GETMBR R2 R0 K72 + 0x8C0805AA, // 0001 GETMET R2 R2 K170 + 0x5C100200, // 0002 MOVE R4 R1 + 0x7C080400, // 0003 CALL R2 2 + 0x80040400, // 0004 RET 1 R2 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: start +********************************************************************/ +be_local_closure(class_Matter_Device_start, /* name */ + be_nested_proto( + 4, /* nstack */ + 1, /* argc */ + 10, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + &be_ktab_class_Matter_Device, /* shared constants */ + be_str_weak(start), + &be_const_str_solidified, + ( &(const binstruction[ 9]) { /* code */ + 0x8C0401AB, // 0000 GETMET R1 R0 K171 + 0x7C040200, // 0001 CALL R1 1 + 0x8C0401AC, // 0002 GETMET R1 R0 K172 + 0x880C01AD, // 0003 GETMBR R3 R0 K173 + 0x7C040400, // 0004 CALL R1 2 + 0x8804013C, // 0005 GETMBR R1 R0 K60 + 0x8C0403AE, // 0006 GETMET R1 R1 K174 + 0x7C040200, // 0007 CALL R1 1 + 0x80000000, // 0008 RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: update_remotes_info +********************************************************************/ +be_local_closure(class_Matter_Device_update_remotes_info, /* name */ + be_nested_proto( + 7, /* nstack */ + 1, /* argc */ + 10, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + &be_ktab_class_Matter_Device, /* shared constants */ + be_str_weak(update_remotes_info), + &be_const_str_solidified, + ( &(const binstruction[33]) { /* code */ + 0x60040013, // 0000 GETGBL R1 G19 + 0x7C040000, // 0001 CALL R1 0 + 0x88080187, // 0002 GETMBR R2 R0 K135 + 0x4C0C0000, // 0003 LDNIL R3 + 0x20080403, // 0004 NE R2 R2 R3 + 0x780A0018, // 0005 JMPF R2 #001F + 0x60080010, // 0006 GETGBL R2 G16 + 0x880C0187, // 0007 GETMBR R3 R0 K135 + 0x8C0C0714, // 0008 GETMET R3 R3 K20 + 0x7C0C0200, // 0009 CALL R3 1 + 0x7C080200, // 000A CALL R2 1 + 0xA802000F, // 000B EXBLK 0 #001C + 0x5C0C0400, // 000C MOVE R3 R2 + 0x7C0C0000, // 000D CALL R3 0 + 0x88100187, // 000E GETMBR R4 R0 K135 + 0x94100803, // 000F GETIDX R4 R4 R3 + 0x8C1009AF, // 0010 GETMET R4 R4 K175 + 0x7C100200, // 0011 CALL R4 1 + 0x4C140000, // 0012 LDNIL R5 + 0x20140805, // 0013 NE R5 R4 R5 + 0x78160005, // 0014 JMPF R5 #001B + 0x6014000C, // 0015 GETGBL R5 G12 + 0x5C180800, // 0016 MOVE R6 R4 + 0x7C140200, // 0017 CALL R5 1 + 0x24140B08, // 0018 GT R5 R5 K8 + 0x78160000, // 0019 JMPF R5 #001B + 0x98040604, // 001A SETIDX R1 R3 R4 + 0x7001FFEF, // 001B JMP #000C + 0x58080016, // 001C LDCONST R2 K22 + 0xAC080200, // 001D CATCH R2 1 0 + 0xB0080000, // 001E RAISE 2 R0 R0 + 0x90026801, // 001F SETMBR R0 K52 R1 + 0x80040200, // 0020 RET 1 R1 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: every_50ms +********************************************************************/ +be_local_closure(class_Matter_Device_every_50ms, /* name */ + be_nested_proto( + 3, /* nstack */ + 1, /* argc */ + 10, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + &be_ktab_class_Matter_Device, /* shared constants */ + be_str_weak(every_50ms), + &be_const_str_solidified, + ( &(const binstruction[ 7]) { /* code */ + 0x88040199, // 0000 GETMBR R1 R0 K153 + 0x0004030B, // 0001 ADD R1 R1 K11 + 0x90033201, // 0002 SETMBR R0 K153 R1 + 0x8804015D, // 0003 GETMBR R1 R0 K93 + 0x8C0403B0, // 0004 GETMET R1 R1 K176 + 0x7C040200, // 0005 CALL R1 1 + 0x80000000, // 0006 RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: k2l_num +********************************************************************/ +be_local_closure(class_Matter_Device_k2l_num, /* name */ + be_nested_proto( + 9, /* nstack */ + 1, /* argc */ + 12, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + &be_ktab_class_Matter_Device, /* shared constants */ + be_str_weak(k2l_num), + &be_const_str_solidified, + ( &(const binstruction[52]) { /* code */ + 0x5804003F, // 0000 LDCONST R1 K63 + 0x60080012, // 0001 GETGBL R2 G18 + 0x7C080000, // 0002 CALL R2 0 + 0x4C0C0000, // 0003 LDNIL R3 + 0x1C0C0003, // 0004 EQ R3 R0 R3 + 0x780E0000, // 0005 JMPF R3 #0007 + 0x80040400, // 0006 RET 1 R2 + 0x600C0010, // 0007 GETGBL R3 G16 + 0x8C100114, // 0008 GETMET R4 R0 K20 + 0x7C100200, // 0009 CALL R4 1 + 0x7C0C0200, // 000A CALL R3 1 + 0xA8020007, // 000B EXBLK 0 #0014 + 0x5C100600, // 000C MOVE R4 R3 + 0x7C100000, // 000D CALL R4 0 + 0x8C140515, // 000E GETMET R5 R2 K21 + 0x601C0009, // 000F GETGBL R7 G9 + 0x5C200800, // 0010 MOVE R8 R4 + 0x7C1C0200, // 0011 CALL R7 1 + 0x7C140400, // 0012 CALL R5 2 + 0x7001FFF7, // 0013 JMP #000C + 0x580C0016, // 0014 LDCONST R3 K22 + 0xAC0C0200, // 0015 CATCH R3 1 0 + 0xB0080000, // 0016 RAISE 2 R0 R0 + 0x600C0010, // 0017 GETGBL R3 G16 + 0x6010000C, // 0018 GETGBL R4 G12 + 0x5C140400, // 0019 MOVE R5 R2 + 0x7C100200, // 001A CALL R4 1 + 0x0410090B, // 001B SUB R4 R4 K11 + 0x40121604, // 001C CONNECT R4 K11 R4 + 0x7C0C0200, // 001D CALL R3 1 + 0xA8020010, // 001E EXBLK 0 #0030 + 0x5C100600, // 001F MOVE R4 R3 + 0x7C100000, // 0020 CALL R4 0 + 0x94140404, // 0021 GETIDX R5 R2 R4 + 0x5C180800, // 0022 MOVE R6 R4 + 0x241C0D08, // 0023 GT R7 R6 K8 + 0x781E0008, // 0024 JMPF R7 #002E + 0x041C0D0B, // 0025 SUB R7 R6 K11 + 0x941C0407, // 0026 GETIDX R7 R2 R7 + 0x241C0E05, // 0027 GT R7 R7 R5 + 0x781E0004, // 0028 JMPF R7 #002E + 0x041C0D0B, // 0029 SUB R7 R6 K11 + 0x941C0407, // 002A GETIDX R7 R2 R7 + 0x98080C07, // 002B SETIDX R2 R6 R7 + 0x04180D0B, // 002C SUB R6 R6 K11 + 0x7001FFF4, // 002D JMP #0023 + 0x98080C05, // 002E SETIDX R2 R6 R5 + 0x7001FFEE, // 002F JMP #001F + 0x580C0016, // 0030 LDCONST R3 K22 + 0xAC0C0200, // 0031 CATCH R3 1 0 + 0xB0080000, // 0032 RAISE 2 R0 R0 + 0x80040400, // 0033 RET 1 R2 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: register_http_remote +********************************************************************/ +be_local_closure(class_Matter_Device_register_http_remote, /* name */ + be_nested_proto( + 9, /* nstack */ + 3, /* argc */ + 10, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + &be_ktab_class_Matter_Device, /* shared constants */ + be_str_weak(register_http_remote), + &be_const_str_solidified, + ( &(const binstruction[42]) { /* code */ + 0x880C0187, // 0000 GETMBR R3 R0 K135 + 0x4C100000, // 0001 LDNIL R4 + 0x1C0C0604, // 0002 EQ R3 R3 R4 + 0x780E0002, // 0003 JMPF R3 #0007 + 0x600C0013, // 0004 GETGBL R3 G19 + 0x7C0C0000, // 0005 CALL R3 0 + 0x90030E03, // 0006 SETMBR R0 K135 R3 + 0x4C0C0000, // 0007 LDNIL R3 + 0x88100187, // 0008 GETMBR R4 R0 K135 + 0x8C10098B, // 0009 GETMET R4 R4 K139 + 0x5C180200, // 000A MOVE R6 R1 + 0x7C100400, // 000B CALL R4 2 + 0x78120009, // 000C JMPF R4 #0017 + 0x88100187, // 000D GETMBR R4 R0 K135 + 0x940C0801, // 000E GETIDX R3 R4 R1 + 0x8C1007B1, // 000F GETMET R4 R3 K177 + 0x7C100200, // 0010 CALL R4 1 + 0x14100404, // 0011 LT R4 R2 R4 + 0x78120002, // 0012 JMPF R4 #0016 + 0x8C1007B2, // 0013 GETMET R4 R3 K178 + 0x5C180400, // 0014 MOVE R6 R2 + 0x7C100400, // 0015 CALL R4 2 + 0x70020011, // 0016 JMP #0029 + 0xB8122E00, // 0017 GETNGBL R4 K23 + 0x8C1009B3, // 0018 GETMET R4 R4 K179 + 0x5C180000, // 0019 MOVE R6 R0 + 0x5C1C0200, // 001A MOVE R7 R1 + 0x5C200400, // 001B MOVE R8 R2 + 0x7C100800, // 001C CALL R4 4 + 0x5C0C0800, // 001D MOVE R3 R4 + 0x88100134, // 001E GETMBR R4 R0 K52 + 0x8C10098B, // 001F GETMET R4 R4 K139 + 0x5C180200, // 0020 MOVE R6 R1 + 0x7C100400, // 0021 CALL R4 2 + 0x78120003, // 0022 JMPF R4 #0027 + 0x8C1007B4, // 0023 GETMET R4 R3 K180 + 0x88180134, // 0024 GETMBR R6 R0 K52 + 0x94180C01, // 0025 GETIDX R6 R6 R1 + 0x7C100400, // 0026 CALL R4 2 + 0x88100187, // 0027 GETMBR R4 R0 K135 + 0x98100203, // 0028 SETIDX R4 R1 R3 + 0x80040600, // 0029 RET 1 R3 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: msg_received +********************************************************************/ +be_local_closure(class_Matter_Device_msg_received, /* name */ + be_nested_proto( + 9, /* nstack */ + 4, /* argc */ + 10, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + &be_ktab_class_Matter_Device, /* shared constants */ + be_str_weak(msg_received), + &be_const_str_solidified, + ( &(const binstruction[ 7]) { /* code */ + 0x8810015D, // 0000 GETMBR R4 R0 K93 + 0x8C1009B5, // 0001 GETMET R4 R4 K181 + 0x5C180200, // 0002 MOVE R6 R1 + 0x5C1C0400, // 0003 MOVE R7 R2 + 0x5C200600, // 0004 MOVE R8 R3 + 0x7C100800, // 0005 CALL R4 4 + 0x80040800, // 0006 RET 1 R4 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: bridge_add_endpoint +********************************************************************/ +be_local_closure(class_Matter_Device_bridge_add_endpoint, /* name */ + be_nested_proto( + 16, /* nstack */ + 3, /* argc */ + 10, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + &be_ktab_class_Matter_Device, /* shared constants */ + be_str_weak(bridge_add_endpoint), + &be_const_str_solidified, + ( &(const binstruction[68]) { /* code */ + 0x880C015F, // 0000 GETMBR R3 R0 K95 + 0x8C0C0727, // 0001 GETMET R3 R3 K39 + 0x5C140200, // 0002 MOVE R5 R1 + 0x7C0C0400, // 0003 CALL R3 2 + 0x4C100000, // 0004 LDNIL R4 + 0x1C100604, // 0005 EQ R4 R3 R4 + 0x78120008, // 0006 JMPF R4 #0010 + 0xB8120A00, // 0007 GETNGBL R4 K5 + 0x60140008, // 0008 GETGBL R5 G8 + 0x5C180200, // 0009 MOVE R6 R1 + 0x7C140200, // 000A CALL R5 1 + 0x00176C05, // 000B ADD R5 K182 R5 + 0x00140BB7, // 000C ADD R5 R5 K183 + 0x58180004, // 000D LDCONST R6 K4 + 0x7C100400, // 000E CALL R4 2 + 0x80000800, // 000F RET 0 + 0x8810011A, // 0010 GETMBR R4 R0 K26 + 0x60140008, // 0011 GETGBL R5 G8 + 0x5C180800, // 0012 MOVE R6 R4 + 0x7C140200, // 0013 CALL R5 1 + 0x5C180600, // 0014 MOVE R6 R3 + 0x5C1C0000, // 0015 MOVE R7 R0 + 0x5C200800, // 0016 MOVE R8 R4 + 0x5C240400, // 0017 MOVE R9 R2 + 0x7C180600, // 0018 CALL R6 3 + 0x881C0109, // 0019 GETMBR R7 R0 K9 + 0x8C1C0F15, // 001A GETMET R7 R7 K21 + 0x5C240C00, // 001B MOVE R9 R6 + 0x7C1C0400, // 001C CALL R7 2 + 0x601C0013, // 001D GETGBL R7 G19 + 0x7C1C0000, // 001E CALL R7 0 + 0x981E8401, // 001F SETIDX R7 K66 R1 + 0x60200010, // 0020 GETGBL R8 G16 + 0x8C240514, // 0021 GETMET R9 R2 K20 + 0x7C240200, // 0022 CALL R9 1 + 0x7C200200, // 0023 CALL R8 1 + 0xA8020004, // 0024 EXBLK 0 #002A + 0x5C241000, // 0025 MOVE R9 R8 + 0x7C240000, // 0026 CALL R9 0 + 0x94280409, // 0027 GETIDX R10 R2 R9 + 0x981C120A, // 0028 SETIDX R7 R9 R10 + 0x7001FFFA, // 0029 JMP #0025 + 0x58200016, // 002A LDCONST R8 K22 + 0xAC200200, // 002B CATCH R8 1 0 + 0xB0080000, // 002C RAISE 2 R0 R0 + 0xB8220A00, // 002D GETNGBL R8 K5 + 0x60240018, // 002E GETGBL R9 G24 + 0x582800B8, // 002F LDCONST R10 K184 + 0x5C2C0800, // 0030 MOVE R11 R4 + 0x5C300200, // 0031 MOVE R12 R1 + 0x8C3401B9, // 0032 GETMET R13 R0 K185 + 0x5C3C0400, // 0033 MOVE R15 R2 + 0x7C340400, // 0034 CALL R13 2 + 0x7C240800, // 0035 CALL R9 4 + 0x5828001B, // 0036 LDCONST R10 K27 + 0x7C200400, // 0037 CALL R8 2 + 0x88200113, // 0038 GETMBR R8 R0 K19 + 0x98200A07, // 0039 SETIDX R8 R5 R7 + 0x50200200, // 003A LDBOOL R8 1 0 + 0x90026608, // 003B SETMBR R0 K51 R8 + 0x8820011A, // 003C GETMBR R8 R0 K26 + 0x0020110B, // 003D ADD R8 R8 K11 + 0x90023408, // 003E SETMBR R0 K26 R8 + 0x8C20013E, // 003F GETMET R8 R0 K62 + 0x7C200200, // 0040 CALL R8 1 + 0x8C20018F, // 0041 GETMET R8 R0 K143 + 0x7C200200, // 0042 CALL R8 1 + 0x80040800, // 0043 RET 1 R4 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: autoconf_device +********************************************************************/ +be_local_closure(class_Matter_Device_autoconf_device, /* name */ + be_nested_proto( + 5, /* nstack */ + 1, /* argc */ + 10, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + &be_ktab_class_Matter_Device, /* shared constants */ + be_str_weak(autoconf_device), + &be_const_str_solidified, + ( &(const binstruction[50]) { /* code */ + 0xA4060000, // 0000 IMPORT R1 K0 + 0x6008000C, // 0001 GETGBL R2 G12 + 0x880C0109, // 0002 GETMBR R3 R0 K9 + 0x7C080200, // 0003 CALL R2 1 + 0x24080508, // 0004 GT R2 R2 K8 + 0x780A0000, // 0005 JMPF R2 #0007 + 0x80000400, // 0006 RET 0 + 0x880801BA, // 0007 GETMBR R2 R0 K186 + 0x4C0C0000, // 0008 LDNIL R3 + 0x1C080403, // 0009 EQ R2 R2 R3 + 0x780A0004, // 000A JMPF R2 #0010 + 0xB80A2E00, // 000B GETNGBL R2 K23 + 0x8C0805BB, // 000C GETMET R2 R2 K187 + 0x5C100000, // 000D MOVE R4 R0 + 0x7C080400, // 000E CALL R2 2 + 0x90037402, // 000F SETMBR R0 K186 R2 + 0x88080133, // 0010 GETMBR R2 R0 K51 + 0x740A000F, // 0011 JMPT R2 #0022 + 0x880801BA, // 0012 GETMBR R2 R0 K186 + 0x8C0805BC, // 0013 GETMET R2 R2 K188 + 0x7C080200, // 0014 CALL R2 1 + 0x90022602, // 0015 SETMBR R0 K19 R2 + 0x60080013, // 0016 GETGBL R2 G19 + 0x7C080000, // 0017 CALL R2 0 + 0x90026802, // 0018 SETMBR R0 K52 R2 + 0x8C080131, // 0019 GETMET R2 R0 K49 + 0x7C080200, // 001A CALL R2 1 + 0xB80A0A00, // 001B GETNGBL R2 K5 + 0x600C0008, // 001C GETGBL R3 G8 + 0x88100113, // 001D GETMBR R4 R0 K19 + 0x7C0C0200, // 001E CALL R3 1 + 0x000F7A03, // 001F ADD R3 K189 R3 + 0x58100004, // 0020 LDCONST R4 K4 + 0x7C080400, // 0021 CALL R2 2 + 0x880801BA, // 0022 GETMBR R2 R0 K186 + 0x8C0805BE, // 0023 GETMET R2 R2 K190 + 0x88100113, // 0024 GETMBR R4 R0 K19 + 0x7C080400, // 0025 CALL R2 2 + 0x88080133, // 0026 GETMBR R2 R0 K51 + 0x740A0008, // 0027 JMPT R2 #0031 + 0x8808015B, // 0028 GETMBR R2 R0 K91 + 0x8C080592, // 0029 GETMET R2 R2 K146 + 0x7C080200, // 002A CALL R2 1 + 0x24080508, // 002B GT R2 R2 K8 + 0x780A0003, // 002C JMPF R2 #0031 + 0x50080200, // 002D LDBOOL R2 1 0 + 0x90026602, // 002E SETMBR R0 K51 R2 + 0x8C08013E, // 002F GETMET R2 R0 K62 + 0x7C080200, // 0030 CALL R2 1 + 0x80000000, // 0031 RET 0 + }) + ) +); +/*******************************************************************/ + + /******************************************************************** ** Solidified function: save_before_restart ********************************************************************/ @@ -3055,11 +2990,11 @@ be_local_closure(class_Matter_Device_save_before_restart, /* name */ be_str_weak(save_before_restart), &be_const_str_solidified, ( &(const binstruction[ 7]) { /* code */ - 0x88040161, // 0000 GETMBR R1 R0 K97 - 0x8C0403CE, // 0001 GETMET R1 R1 K206 + 0x8804013C, // 0000 GETMBR R1 R0 K60 + 0x8C04034C, // 0001 GETMET R1 R1 K76 0x7C040200, // 0002 CALL R1 1 - 0x88040161, // 0003 GETMBR R1 R0 K97 - 0x8C0403CF, // 0004 GETMET R1 R1 K207 + 0x8804013C, // 0003 GETMBR R1 R0 K60 + 0x8C0403BF, // 0004 GETMET R1 R1 K191 0x7C040200, // 0005 CALL R1 1 0x80000000, // 0006 RET 0 }) @@ -3069,11 +3004,11 @@ be_local_closure(class_Matter_Device_save_before_restart, /* name */ /******************************************************************** -** Solidified function: MtrJoin +** Solidified function: MtrUpdate ********************************************************************/ -be_local_closure(class_Matter_Device_MtrJoin, /* name */ +be_local_closure(class_Matter_Device_MtrUpdate, /* name */ be_nested_proto( - 8, /* nstack */ + 18, /* nstack */ 5, /* argc */ 10, /* varg */ 0, /* has upvals */ @@ -3082,140 +3017,135 @@ be_local_closure(class_Matter_Device_MtrJoin, /* name */ NULL, /* no sub protos */ 1, /* has constants */ &be_ktab_class_Matter_Device, /* shared constants */ - be_str_weak(MtrJoin), + be_str_weak(MtrUpdate), &be_const_str_solidified, - ( &(const binstruction[15]) { /* code */ - 0x60140009, // 0000 GETGBL R5 G9 - 0x5C180600, // 0001 MOVE R6 R3 - 0x7C140200, // 0002 CALL R5 1 - 0x78160003, // 0003 JMPF R5 #0008 - 0x88180161, // 0004 GETMBR R6 R0 K97 - 0x8C180DD0, // 0005 GETMET R6 R6 K208 - 0x7C180200, // 0006 CALL R6 1 - 0x70020002, // 0007 JMP #000B - 0x88180161, // 0008 GETMBR R6 R0 K97 - 0x8C180DCE, // 0009 GETMET R6 R6 K206 - 0x7C180200, // 000A CALL R6 1 - 0xB81A2000, // 000B GETNGBL R6 K16 - 0x8C180D11, // 000C GETMET R6 R6 K17 - 0x7C180200, // 000D CALL R6 1 - 0x80000000, // 000E RET 0 - }) - ) -); -/*******************************************************************/ - - -/******************************************************************** -** Solidified function: k2l -********************************************************************/ -be_local_closure(class_Matter_Device_k2l, /* name */ - be_nested_proto( - 8, /* nstack */ - 1, /* argc */ - 12, /* varg */ - 0, /* has upvals */ - NULL, /* no upvals */ - 0, /* has sup protos */ - NULL, /* no sub protos */ - 1, /* has constants */ - &be_ktab_class_Matter_Device, /* shared constants */ - be_str_weak(k2l), - &be_const_str_solidified, - ( &(const binstruction[50]) { /* code */ - 0x58040004, // 0000 LDCONST R1 K4 - 0x60080012, // 0001 GETGBL R2 G18 - 0x7C080000, // 0002 CALL R2 0 - 0x4C0C0000, // 0003 LDNIL R3 - 0x1C0C0003, // 0004 EQ R3 R0 R3 - 0x780E0000, // 0005 JMPF R3 #0007 - 0x80040400, // 0006 RET 1 R2 - 0x600C0010, // 0007 GETGBL R3 G16 - 0x8C100105, // 0008 GETMET R4 R0 K5 - 0x7C100200, // 0009 CALL R4 1 - 0x7C0C0200, // 000A CALL R3 1 - 0xA8020005, // 000B EXBLK 0 #0012 - 0x5C100600, // 000C MOVE R4 R3 - 0x7C100000, // 000D CALL R4 0 - 0x8C140506, // 000E GETMET R5 R2 K6 - 0x5C1C0800, // 000F MOVE R7 R4 - 0x7C140400, // 0010 CALL R5 2 - 0x7001FFF9, // 0011 JMP #000C - 0x580C0007, // 0012 LDCONST R3 K7 - 0xAC0C0200, // 0013 CATCH R3 1 0 - 0xB0080000, // 0014 RAISE 2 R0 R0 - 0x600C0010, // 0015 GETGBL R3 G16 - 0x6010000C, // 0016 GETGBL R4 G12 - 0x5C140400, // 0017 MOVE R5 R2 - 0x7C100200, // 0018 CALL R4 1 - 0x04100908, // 0019 SUB R4 R4 K8 - 0x40121004, // 001A CONNECT R4 K8 R4 - 0x7C0C0200, // 001B CALL R3 1 - 0xA8020010, // 001C EXBLK 0 #002E - 0x5C100600, // 001D MOVE R4 R3 - 0x7C100000, // 001E CALL R4 0 - 0x94140404, // 001F GETIDX R5 R2 R4 - 0x5C180800, // 0020 MOVE R6 R4 - 0x241C0D09, // 0021 GT R7 R6 K9 - 0x781E0008, // 0022 JMPF R7 #002C - 0x041C0D08, // 0023 SUB R7 R6 K8 - 0x941C0407, // 0024 GETIDX R7 R2 R7 - 0x241C0E05, // 0025 GT R7 R7 R5 - 0x781E0004, // 0026 JMPF R7 #002C - 0x041C0D08, // 0027 SUB R7 R6 K8 - 0x941C0407, // 0028 GETIDX R7 R2 R7 - 0x98080C07, // 0029 SETIDX R2 R6 R7 - 0x04180D08, // 002A SUB R6 R6 K8 - 0x7001FFF4, // 002B JMP #0021 - 0x98080C05, // 002C SETIDX R2 R6 R5 - 0x7001FFEE, // 002D JMP #001D - 0x580C0007, // 002E LDCONST R3 K7 - 0xAC0C0200, // 002F CATCH R3 1 0 - 0xB0080000, // 0030 RAISE 2 R0 R0 - 0x80040400, // 0031 RET 1 R2 - }) - ) -); -/*******************************************************************/ - - -/******************************************************************** -** Solidified function: MtrInfo_one -********************************************************************/ -be_local_closure(class_Matter_Device_MtrInfo_one, /* name */ - be_nested_proto( - 9, /* nstack */ - 2, /* argc */ - 10, /* varg */ - 0, /* has upvals */ - NULL, /* no upvals */ - 0, /* has sup protos */ - NULL, /* no sub protos */ - 1, /* has constants */ - &be_ktab_class_Matter_Device, /* shared constants */ - be_str_weak(MtrInfo_one), - &be_const_str_solidified, - ( &(const binstruction[20]) { /* code */ - 0x8C080149, // 0000 GETMET R2 R0 K73 - 0x5C100200, // 0001 MOVE R4 R1 - 0x7C080400, // 0002 CALL R2 2 - 0x4C0C0000, // 0003 LDNIL R3 - 0x1C0C0403, // 0004 EQ R3 R2 R3 - 0x780E0000, // 0005 JMPF R3 #0007 - 0x80000600, // 0006 RET 0 - 0x8C0C0581, // 0007 GETMET R3 R2 K129 - 0x7C0C0200, // 0008 CALL R3 1 - 0x780E0008, // 0009 JMPF R3 #0013 - 0x60100018, // 000A GETGBL R4 G24 - 0x581400D1, // 000B LDCONST R5 K209 - 0x5C180600, // 000C MOVE R6 R3 - 0x7C100400, // 000D CALL R4 2 - 0xB8162000, // 000E GETNGBL R5 K16 - 0x8C140BD2, // 000F GETMET R5 R5 K210 - 0x5C1C0800, // 0010 MOVE R7 R4 - 0x5820000A, // 0011 LDCONST R8 K10 - 0x7C140600, // 0012 CALL R5 3 - 0x80000000, // 0013 RET 0 + ( &(const binstruction[126]) { /* code */ + 0x4C140000, // 0000 LDNIL R5 + 0x1C140805, // 0001 EQ R5 R4 R5 + 0x78160004, // 0002 JMPF R5 #0008 + 0xB8160200, // 0003 GETNGBL R5 K1 + 0x8C140BC0, // 0004 GETMET R5 R5 K192 + 0x581C00C1, // 0005 LDCONST R7 K193 + 0x7C140400, // 0006 CALL R5 2 + 0x80040A00, // 0007 RET 1 R5 + 0xB8160200, // 0008 GETNGBL R5 K1 + 0x8C140BC2, // 0009 GETMET R5 R5 K194 + 0x5C1C0800, // 000A MOVE R7 R4 + 0x582000C3, // 000B LDCONST R8 K195 + 0x7C140600, // 000C CALL R5 3 + 0xB81A0200, // 000D GETNGBL R6 K1 + 0x8C180DC2, // 000E GETMET R6 R6 K194 + 0x5C200800, // 000F MOVE R8 R4 + 0x582400C4, // 0010 LDCONST R9 K196 + 0x7C180600, // 0011 CALL R6 3 + 0x74160000, // 0012 JMPT R5 #0014 + 0x781A0064, // 0013 JMPF R6 #0079 + 0x4C1C0000, // 0014 LDNIL R7 + 0x78160010, // 0015 JMPF R5 #0027 + 0x60200009, // 0016 GETGBL R8 G9 + 0x94240805, // 0017 GETIDX R9 R4 R5 + 0x7C200200, // 0018 CALL R8 1 + 0x18241108, // 0019 LE R9 R8 K8 + 0x78260004, // 001A JMPF R9 #0020 + 0xB8260200, // 001B GETNGBL R9 K1 + 0x8C2413C0, // 001C GETMET R9 R9 K192 + 0x582C00C5, // 001D LDCONST R11 K197 + 0x7C240400, // 001E CALL R9 2 + 0x80041200, // 001F RET 1 R9 + 0x8C240151, // 0020 GETMET R9 R0 K81 + 0x5C2C1000, // 0021 MOVE R11 R8 + 0x7C240400, // 0022 CALL R9 2 + 0x5C1C1200, // 0023 MOVE R7 R9 + 0x8C24091C, // 0024 GETMET R9 R4 K28 + 0x5C2C0A00, // 0025 MOVE R11 R5 + 0x7C240400, // 0026 CALL R9 2 + 0x781A0009, // 0027 JMPF R6 #0032 + 0x4C200000, // 0028 LDNIL R8 + 0x1C200E08, // 0029 EQ R8 R7 R8 + 0x78220003, // 002A JMPF R8 #002F + 0x8C200150, // 002B GETMET R8 R0 K80 + 0x94280806, // 002C GETIDX R10 R4 R6 + 0x7C200400, // 002D CALL R8 2 + 0x5C1C1000, // 002E MOVE R7 R8 + 0x8C20091C, // 002F GETMET R8 R4 K28 + 0x5C280C00, // 0030 MOVE R10 R6 + 0x7C200400, // 0031 CALL R8 2 + 0x4C200000, // 0032 LDNIL R8 + 0x1C200E08, // 0033 EQ R8 R7 R8 + 0x78220004, // 0034 JMPF R8 #003A + 0xB8220200, // 0035 GETNGBL R8 K1 + 0x8C2011C0, // 0036 GETMET R8 R8 K192 + 0x582800C6, // 0037 LDCONST R10 K198 + 0x7C200400, // 0038 CALL R8 2 + 0x80041000, // 0039 RET 1 R8 + 0x88200FC7, // 003A GETMBR R8 R7 K199 + 0x74220004, // 003B JMPT R8 #0041 + 0xB8220200, // 003C GETNGBL R8 K1 + 0x8C2011C0, // 003D GETMET R8 R8 K192 + 0x582800C8, // 003E LDCONST R10 K200 + 0x7C200400, // 003F CALL R8 2 + 0x80041000, // 0040 RET 1 R8 + 0x8C200FC9, // 0041 GETMET R8 R7 K201 + 0x7C200200, // 0042 CALL R8 1 + 0x60240013, // 0043 GETGBL R9 G19 + 0x7C240000, // 0044 CALL R9 0 + 0x60280010, // 0045 GETGBL R10 G16 + 0x8C2C0914, // 0046 GETMET R11 R4 K20 + 0x7C2C0200, // 0047 CALL R11 1 + 0x7C280200, // 0048 CALL R10 1 + 0xA8020016, // 0049 EXBLK 0 #0061 + 0x5C2C1400, // 004A MOVE R11 R10 + 0x7C2C0000, // 004B CALL R11 0 + 0xB8320200, // 004C GETNGBL R12 K1 + 0x8C3019CA, // 004D GETMET R12 R12 K202 + 0x5C381000, // 004E MOVE R14 R8 + 0x5C3C1600, // 004F MOVE R15 R11 + 0x7C300600, // 0050 CALL R12 3 + 0x4C340000, // 0051 LDNIL R13 + 0x1C34180D, // 0052 EQ R13 R12 R13 + 0x78360008, // 0053 JMPF R13 #005D + 0xB8360200, // 0054 GETNGBL R13 K1 + 0x8C341BC0, // 0055 GETMET R13 R13 K192 + 0x603C0018, // 0056 GETGBL R15 G24 + 0x584000CB, // 0057 LDCONST R16 K203 + 0x5C441600, // 0058 MOVE R17 R11 + 0x7C3C0400, // 0059 CALL R15 2 + 0x7C340400, // 005A CALL R13 2 + 0xA8040001, // 005B EXBLK 1 1 + 0x80001A00, // 005C RET 0 + 0x9434100C, // 005D GETIDX R13 R8 R12 + 0x9438080B, // 005E GETIDX R14 R4 R11 + 0x98241A0E, // 005F SETIDX R9 R13 R14 + 0x7001FFE8, // 0060 JMP #004A + 0x58280016, // 0061 LDCONST R10 K22 + 0xAC280200, // 0062 CATCH R10 1 0 + 0xB0080000, // 0063 RAISE 2 R0 R0 + 0x8C280FCC, // 0064 GETMET R10 R7 K204 + 0x5C301200, // 0065 MOVE R12 R9 + 0x7C280400, // 0066 CALL R10 2 + 0x8C280F52, // 0067 GETMET R10 R7 K82 + 0x7C280200, // 0068 CALL R10 1 + 0x782A000A, // 0069 JMPF R10 #0075 + 0x602C0018, // 006A GETGBL R11 G24 + 0x583000CD, // 006B LDCONST R12 K205 + 0x5C340200, // 006C MOVE R13 R1 + 0x5C381400, // 006D MOVE R14 R10 + 0x7C2C0600, // 006E CALL R11 3 + 0xB8320200, // 006F GETNGBL R12 K1 + 0x8C3019CE, // 0070 GETMET R12 R12 K206 + 0x5C381600, // 0071 MOVE R14 R11 + 0x7C300400, // 0072 CALL R12 2 + 0x80041800, // 0073 RET 1 R12 + 0x70020003, // 0074 JMP #0079 + 0xB82E0200, // 0075 GETNGBL R11 K1 + 0x8C2C174D, // 0076 GETMET R11 R11 K77 + 0x7C2C0200, // 0077 CALL R11 1 + 0x80041600, // 0078 RET 1 R11 + 0xB81E0200, // 0079 GETNGBL R7 K1 + 0x8C1C0FC0, // 007A GETMET R7 R7 K192 + 0x582400CF, // 007B LDCONST R9 K207 + 0x7C1C0400, // 007C CALL R7 2 + 0x80000000, // 007D RET 0 }) ) ); @@ -3239,10 +3169,10 @@ be_local_closure(class_Matter_Device_create_zb_mapper, /* name */ be_str_weak(create_zb_mapper), &be_const_str_solidified, ( &(const binstruction[ 8]) { /* code */ - 0x88080169, // 0000 GETMBR R2 R0 K105 + 0x880801A1, // 0000 GETMBR R2 R0 K161 0x780A0004, // 0001 JMPF R2 #0007 - 0x88080169, // 0002 GETMBR R2 R0 K105 - 0x8C0805D3, // 0003 GETMET R2 R2 K211 + 0x880801A1, // 0002 GETMBR R2 R0 K161 + 0x8C0805D0, // 0003 GETMET R2 R2 K208 0x5C100200, // 0004 MOVE R4 R1 0x7C080400, // 0005 CALL R2 2 0x80040400, // 0006 RET 1 R2 @@ -3254,9 +3184,9 @@ be_local_closure(class_Matter_Device_create_zb_mapper, /* name */ /******************************************************************** -** Solidified function: start +** Solidified function: init_zigbee ********************************************************************/ -be_local_closure(class_Matter_Device_start, /* name */ +be_local_closure(class_Matter_Device_init_zigbee, /* name */ be_nested_proto( 4, /* nstack */ 1, /* argc */ @@ -3267,22 +3197,54 @@ be_local_closure(class_Matter_Device_start, /* name */ NULL, /* no sub protos */ 1, /* has constants */ &be_ktab_class_Matter_Device, /* shared constants */ - be_str_weak(start), + be_str_weak(init_zigbee), + &be_const_str_solidified, + ( &(const binstruction[ 9]) { /* code */ + 0x8C0401D1, // 0000 GETMET R1 R0 K209 + 0x7C040200, // 0001 CALL R1 1 + 0x78060004, // 0002 JMPF R1 #0008 + 0xA4068C00, // 0003 IMPORT R1 K70 + 0x5C080200, // 0004 MOVE R2 R1 + 0x5C0C0000, // 0005 MOVE R3 R0 + 0x7C080200, // 0006 CALL R2 1 + 0x80040400, // 0007 RET 1 R2 + 0x80000000, // 0008 RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: add_read_sensors_schedule +********************************************************************/ +be_local_closure(class_Matter_Device_add_read_sensors_schedule, /* name */ + be_nested_proto( + 5, /* nstack */ + 2, /* argc */ + 10, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + &be_ktab_class_Matter_Device, /* shared constants */ + be_str_weak(add_read_sensors_schedule), &be_const_str_solidified, ( &(const binstruction[14]) { /* code */ - 0x8804015E, // 0000 GETMBR R1 R0 K94 - 0x78060000, // 0001 JMPF R1 #0003 - 0x80000200, // 0002 RET 0 - 0x8C0401D4, // 0003 GETMET R1 R0 K212 - 0x7C040200, // 0004 CALL R1 1 - 0x8C0401D5, // 0005 GETMET R1 R0 K213 - 0x880C01D6, // 0006 GETMBR R3 R0 K214 - 0x7C040400, // 0007 CALL R1 2 - 0x88040161, // 0008 GETMBR R1 R0 K97 - 0x8C0403D7, // 0009 GETMET R1 R1 K215 - 0x7C040200, // 000A CALL R1 1 - 0x50040200, // 000B LDBOOL R1 1 0 - 0x9002BC01, // 000C SETMBR R0 K94 R1 + 0x8808010D, // 0000 GETMBR R2 R0 K13 + 0x4C0C0000, // 0001 LDNIL R3 + 0x1C080403, // 0002 EQ R2 R2 R3 + 0x740A0002, // 0003 JMPT R2 #0007 + 0x8808010D, // 0004 GETMBR R2 R0 K13 + 0x24080401, // 0005 GT R2 R2 R1 + 0x780A0005, // 0006 JMPF R2 #000D + 0x90021A01, // 0007 SETMBR R0 K13 R1 + 0xB80A2E00, // 0008 GETNGBL R2 K23 + 0x8C0805D2, // 0009 GETMET R2 R2 K210 + 0x5C100200, // 000A MOVE R4 R1 + 0x7C080400, // 000B CALL R2 2 + 0x90021C02, // 000C SETMBR R0 K14 R2 0x80000000, // 000D RET 0 }) ) @@ -3296,61 +3258,47 @@ be_local_closure(class_Matter_Device_start, /* name */ be_local_class(Matter_Device, 24, NULL, - be_nested_map(84, + be_nested_map(83, ( (struct bmapnode*) &(const bmapnode[]) { - { be_const_key_weak(commissioning, -1), be_const_var(8) }, - { be_const_key_weak(msg_send, -1), be_const_closure(class_Matter_Device_msg_send_closure) }, - { be_const_key_weak(plugins_config, -1), be_const_var(3) }, - { be_const_key_weak(k2l_num, 73), be_const_static_closure(class_Matter_Device_k2l_num_closure) }, - { be_const_key_weak(plugins_persist, 7), be_const_var(2) }, - { be_const_key_weak(EP, -1), be_const_int(2) }, - { be_const_key_weak(MtrInfo, -1), be_const_closure(class_Matter_Device_MtrInfo_closure) }, - { be_const_key_weak(msg_received, -1), be_const_closure(class_Matter_Device_msg_received_closure) }, - { be_const_key_weak(every_250ms, 77), be_const_closure(class_Matter_Device_every_250ms_closure) }, - { be_const_key_weak(k2l, -1), be_const_static_closure(class_Matter_Device_k2l_closure) }, - { be_const_key_weak(init_zigbee, 12), be_const_closure(class_Matter_Device_init_zigbee_closure) }, - { be_const_key_weak(get_active_endpoints, -1), be_const_closure(class_Matter_Device_get_active_endpoints_closure) }, - { be_const_key_weak(MtrJoin, 56), be_const_closure(class_Matter_Device_MtrJoin_closure) }, - { be_const_key_weak(plugins_config_remotes, -1), be_const_var(4) }, - { be_const_key_weak(save_param, 37), be_const_closure(class_Matter_Device_save_param_closure) }, - { be_const_key_weak(register_commands, -1), be_const_closure(class_Matter_Device_register_commands_closure) }, - { be_const_key_weak(debug, 48), be_const_var(21) }, - { be_const_key_weak(stop, 68), be_const_closure(class_Matter_Device_stop_closure) }, - { be_const_key_weak(udp_server, 33), be_const_var(5) }, - { be_const_key_weak(find_plugin_by_endpoint, 66), be_const_closure(class_Matter_Device_find_plugin_by_endpoint_closure) }, - { be_const_key_weak(events, -1), be_const_var(14) }, - { be_const_key_weak(bridge_remove_endpoint, -1), be_const_closure(class_Matter_Device_bridge_remove_endpoint_closure) }, - { be_const_key_weak(event_fabrics_saved, -1), be_const_closure(class_Matter_Device_event_fabrics_saved_closure) }, - { be_const_key_weak(autoconf_device, -1), be_const_closure(class_Matter_Device_autoconf_device_closure) }, - { be_const_key_weak(check_network, -1), be_const_closure(class_Matter_Device_check_network_closure) }, - { be_const_key_weak(VENDOR_ID, -1), be_const_int(65521) }, - { be_const_key_weak(root_passcode, -1), be_const_var(17) }, - { be_const_key_weak(zigbee, -1), be_const_var(11) }, - { be_const_key_weak(sessions, -1), be_const_var(10) }, - { be_const_key_weak(resolve_attribute_read_solo, -1), be_const_closure(class_Matter_Device_resolve_attribute_read_solo_closure) }, - { be_const_key_weak(clean_remotes, 24), be_const_closure(class_Matter_Device_clean_remotes_closure) }, - { be_const_key_weak(get_plugin_remote_info, 79), be_const_closure(class_Matter_Device_get_plugin_remote_info_closure) }, - { be_const_key_weak(FILENAME, -1), be_nested_str_weak(_matter_device_X2Ejson) }, - { be_const_key_weak(check_config_ep, 13), be_const_closure(class_Matter_Device_check_config_ep_closure) }, - { be_const_key_weak(root_discriminator, -1), be_const_var(16) }, - { be_const_key_weak(invoke_request, -1), be_const_closure(class_Matter_Device_invoke_request_closure) }, - { be_const_key_weak(probe_sensor_time, -1), be_const_var(22) }, - { be_const_key_weak(button_handler, -1), be_const_closure(class_Matter_Device_button_handler_closure) }, - { be_const_key_weak(_start_udp, -1), be_const_closure(class_Matter_Device__start_udp_closure) }, - { be_const_key_weak(UDP_PORT, -1), be_const_int(5540) }, - { be_const_key_weak(find_plugin_by_friendly_name, -1), be_const_closure(class_Matter_Device_find_plugin_by_friendly_name_closure) }, - { be_const_key_weak(disable_bridge_mode, -1), be_const_var(19) }, + { be_const_key_weak(signal_endpoints_changed, -1), be_const_closure(class_Matter_Device_signal_endpoints_changed_closure) }, + { be_const_key_weak(probe_sensor_time, 22), be_const_var(22) }, + { be_const_key_weak(_trigger_read_sensors, -1), be_const_closure(class_Matter_Device__trigger_read_sensors_closure) }, + { be_const_key_weak(read_sensors_scheduler, 57), be_const_closure(class_Matter_Device_read_sensors_scheduler_closure) }, + { be_const_key_weak(button_pressed, -1), be_const_closure(class_Matter_Device_button_pressed_closure) }, + { be_const_key_weak(check_config_ep, -1), be_const_closure(class_Matter_Device_check_config_ep_closure) }, + { be_const_key_weak(invoke_request, 38), be_const_closure(class_Matter_Device_invoke_request_closure) }, + { be_const_key_weak(started, 0), be_const_var(0) }, { be_const_key_weak(load_param, -1), be_const_closure(class_Matter_Device_load_param_closure) }, - { be_const_key_weak(MtrUpdate, 15), be_const_closure(class_Matter_Device_MtrUpdate_closure) }, + { be_const_key_weak(udp_server, -1), be_const_var(5) }, + { be_const_key_weak(plugins_config_remotes, -1), be_const_var(4) }, + { be_const_key_weak(UDP_PORT, 23), be_const_int(5540) }, + { be_const_key_weak(init_zigbee, 36), be_const_closure(class_Matter_Device_init_zigbee_closure) }, + { be_const_key_weak(conf_to_log, -1), be_const_static_closure(class_Matter_Device_conf_to_log_closure) }, + { be_const_key_weak(is_zigbee_present, -1), be_const_closure(class_Matter_Device_is_zigbee_present_closure) }, + { be_const_key_weak(k2l, 31), be_const_static_closure(class_Matter_Device_k2l_closure) }, + { be_const_key_weak(autoconf, 75), be_const_var(9) }, + { be_const_key_weak(stop, -1), be_const_closure(class_Matter_Device_stop_closure) }, + { be_const_key_weak(create_zb_mapper, -1), be_const_closure(class_Matter_Device_create_zb_mapper_closure) }, + { be_const_key_weak(EP, 18), be_const_int(2) }, + { be_const_key_weak(MtrJoin, 29), be_const_closure(class_Matter_Device_MtrJoin_closure) }, + { be_const_key_weak(zigbee, -1), be_const_var(11) }, + { be_const_key_weak(MtrUpdate, -1), be_const_closure(class_Matter_Device_MtrUpdate_closure) }, + { be_const_key_weak(save_before_restart, -1), be_const_closure(class_Matter_Device_save_before_restart_closure) }, + { be_const_key_weak(MtrInfo_one, -1), be_const_closure(class_Matter_Device_MtrInfo_one_closure) }, + { be_const_key_weak(FILENAME, 80), be_nested_str_weak(_matter_device_X2Ejson) }, + { be_const_key_weak(autoconf_device, -1), be_const_closure(class_Matter_Device_autoconf_device_closure) }, + { be_const_key_weak(http_remotes, 79), be_const_var(15) }, + { be_const_key_weak(get_plugin_remote_info, 68), be_const_closure(class_Matter_Device_get_plugin_remote_info_closure) }, + { be_const_key_weak(MtrInfo, -1), be_const_closure(class_Matter_Device_MtrInfo_closure) }, + { be_const_key_weak(get_plugin_class_displayname, 32), be_const_closure(class_Matter_Device_get_plugin_class_displayname_closure) }, + { be_const_key_weak(plugins_persist, -1), be_const_var(2) }, + { be_const_key_weak(attribute_updated, -1), be_const_closure(class_Matter_Device_attribute_updated_closure) }, + { be_const_key_weak(sort_distinct, 76), be_const_static_closure(class_Matter_Device_sort_distinct_closure) }, + { be_const_key_weak(find_plugin_by_endpoint, -1), be_const_closure(class_Matter_Device_find_plugin_by_endpoint_closure) }, + { be_const_key_weak(tick, -1), be_const_var(13) }, + { be_const_key_weak(k2l_num, 67), be_const_static_closure(class_Matter_Device_k2l_num_closure) }, + { be_const_key_weak(ui, 74), be_const_var(12) }, { be_const_key_weak(every_50ms, -1), be_const_closure(class_Matter_Device_every_50ms_closure) }, - { be_const_key_weak(every_second, -1), be_const_closure(class_Matter_Device_every_second_closure) }, - { be_const_key_weak(process_attribute_expansion, -1), be_const_closure(class_Matter_Device_process_attribute_expansion_closure) }, - { be_const_key_weak(add_read_sensors_schedule, -1), be_const_closure(class_Matter_Device_add_read_sensors_schedule_closure) }, - { be_const_key_weak(profiler, 49), be_const_var(6) }, - { be_const_key_weak(register_http_remote, 5), be_const_closure(class_Matter_Device_register_http_remote_closure) }, - { be_const_key_weak(sort_distinct, 38), be_const_static_closure(class_Matter_Device_sort_distinct_closure) }, - { be_const_key_weak(signal_endpoints_changed, 57), be_const_closure(class_Matter_Device_signal_endpoints_changed_closure) }, - { be_const_key_weak(is_zigbee_present, 65), be_const_closure(class_Matter_Device_is_zigbee_present_closure) }, { be_const_key_weak(plugins_classes, -1), be_const_simple_instance(be_nested_simple_instance(&be_class_map, { be_const_map( * be_nested_map(60, ( (struct bmapnode*) &(const bmapnode[]) { @@ -3415,36 +3363,49 @@ be_local_class(Matter_Device, { be_const_key_weak(illuminance, -1), be_const_class(be_class_Matter_Plugin_Sensor_Illuminance) }, { be_const_key_weak(v_light3, -1), be_const_class(be_class_Matter_Plugin_Virt_Light3) }, })) ) } )) }, - { be_const_key_weak(adjust_next_ep, -1), be_const_closure(class_Matter_Device_adjust_next_ep_closure) }, - { be_const_key_weak(remove_fabric, -1), be_const_closure(class_Matter_Device_remove_fabric_closure) }, - { be_const_key_weak(get_plugin_class_displayname, 2), be_const_closure(class_Matter_Device_get_plugin_class_displayname_closure) }, - { be_const_key_weak(get_plugin_class_arg, -1), be_const_closure(class_Matter_Device_get_plugin_class_arg_closure) }, - { be_const_key_weak(started, 54), be_const_var(0) }, - { be_const_key_weak(ui, 62), be_const_var(12) }, - { be_const_key_weak(bridge_add_endpoint, 61), be_const_closure(class_Matter_Device_bridge_add_endpoint_closure) }, + { be_const_key_weak(button_multi_pressed, -1), be_const_closure(class_Matter_Device_button_multi_pressed_closure) }, { be_const_key_weak(PRODUCT_ID, -1), be_const_int(32768) }, { be_const_key_weak(message_handler, -1), be_const_var(7) }, - { be_const_key_weak(read_sensors_scheduler, 42), be_const_closure(class_Matter_Device_read_sensors_scheduler_closure) }, - { be_const_key_weak(next_ep, 53), be_const_var(20) }, - { be_const_key_weak(autoconf, -1), be_const_var(9) }, - { be_const_key_weak(conf_to_log, -1), be_const_static_closure(class_Matter_Device_conf_to_log_closure) }, - { be_const_key_weak(attribute_updated, 46), be_const_closure(class_Matter_Device_attribute_updated_closure) }, + { be_const_key_weak(debug, 61), be_const_var(21) }, + { be_const_key_weak(save_param, -1), be_const_closure(class_Matter_Device_save_param_closure) }, + { be_const_key_weak(plugins, 69), be_const_var(1) }, + { be_const_key_weak(bridge_remove_endpoint, -1), be_const_closure(class_Matter_Device_bridge_remove_endpoint_closure) }, { be_const_key_weak(update_remotes_info, -1), be_const_closure(class_Matter_Device_update_remotes_info_closure) }, - { be_const_key_weak(http_remotes, 41), be_const_var(15) }, - { be_const_key_weak(reset_param, 39), be_const_closure(class_Matter_Device_reset_param_closure) }, - { be_const_key_weak(_trigger_read_sensors, -1), be_const_closure(class_Matter_Device__trigger_read_sensors_closure) }, + { be_const_key_weak(event_fabrics_saved, 26), be_const_closure(class_Matter_Device_event_fabrics_saved_closure) }, + { be_const_key_weak(init, -1), be_const_closure(class_Matter_Device_init_closure) }, + { be_const_key_weak(profiler, -1), be_const_var(6) }, + { be_const_key_weak(get_plugin_class_arg, 12), be_const_closure(class_Matter_Device_get_plugin_class_arg_closure) }, + { be_const_key_weak(sessions, -1), be_const_var(10) }, + { be_const_key_weak(events, -1), be_const_var(14) }, + { be_const_key_weak(disable_bridge_mode, 47), be_const_var(19) }, + { be_const_key_weak(next_ep, -1), be_const_var(20) }, { be_const_key_weak(received_ack, -1), be_const_closure(class_Matter_Device_received_ack_closure) }, - { be_const_key_weak(plugins, -1), be_const_var(1) }, - { be_const_key_weak(button_multi_pressed, -1), be_const_closure(class_Matter_Device_button_multi_pressed_closure) }, - { be_const_key_weak(init, 21), be_const_closure(class_Matter_Device_init_closure) }, - { be_const_key_weak(ipv4only, 19), be_const_var(18) }, - { be_const_key_weak(button_pressed, -1), be_const_closure(class_Matter_Device_button_pressed_closure) }, - { be_const_key_weak(save_before_restart, -1), be_const_closure(class_Matter_Device_save_before_restart_closure) }, - { be_const_key_weak(probe_sensor_timestamp, -1), be_const_var(23) }, - { be_const_key_weak(tick, 9), be_const_var(13) }, - { be_const_key_weak(MtrInfo_one, -1), be_const_closure(class_Matter_Device_MtrInfo_one_closure) }, - { be_const_key_weak(create_zb_mapper, -1), be_const_closure(class_Matter_Device_create_zb_mapper_closure) }, + { be_const_key_weak(root_discriminator, 77), be_const_var(16) }, + { be_const_key_weak(adjust_next_ep, -1), be_const_closure(class_Matter_Device_adjust_next_ep_closure) }, + { be_const_key_weak(reset_param, 39), be_const_closure(class_Matter_Device_reset_param_closure) }, + { be_const_key_weak(every_250ms, -1), be_const_closure(class_Matter_Device_every_250ms_closure) }, + { be_const_key_weak(probe_sensor_timestamp, 70), be_const_var(23) }, + { be_const_key_weak(commissioning, 21), be_const_var(8) }, + { be_const_key_weak(plugins_config, -1), be_const_var(3) }, + { be_const_key_weak(button_handler, -1), be_const_closure(class_Matter_Device_button_handler_closure) }, + { be_const_key_weak(msg_send, -1), be_const_closure(class_Matter_Device_msg_send_closure) }, { be_const_key_weak(start, -1), be_const_closure(class_Matter_Device_start_closure) }, + { be_const_key_weak(get_active_endpoints, -1), be_const_closure(class_Matter_Device_get_active_endpoints_closure) }, + { be_const_key_weak(_start_udp, 78), be_const_closure(class_Matter_Device__start_udp_closure) }, + { be_const_key_weak(clean_remotes, -1), be_const_closure(class_Matter_Device_clean_remotes_closure) }, + { be_const_key_weak(register_commands, -1), be_const_closure(class_Matter_Device_register_commands_closure) }, + { be_const_key_weak(find_plugin_by_friendly_name, 35), be_const_closure(class_Matter_Device_find_plugin_by_friendly_name_closure) }, + { be_const_key_weak(register_http_remote, -1), be_const_closure(class_Matter_Device_register_http_remote_closure) }, + { be_const_key_weak(msg_received, -1), be_const_closure(class_Matter_Device_msg_received_closure) }, + { be_const_key_weak(remove_fabric, -1), be_const_closure(class_Matter_Device_remove_fabric_closure) }, + { be_const_key_weak(ipv4only, -1), be_const_var(18) }, + { be_const_key_weak(process_attribute_expansion, -1), be_const_closure(class_Matter_Device_process_attribute_expansion_closure) }, + { be_const_key_weak(VENDOR_ID, -1), be_const_int(65521) }, + { be_const_key_weak(every_second, -1), be_const_closure(class_Matter_Device_every_second_closure) }, + { be_const_key_weak(root_passcode, -1), be_const_var(17) }, + { be_const_key_weak(resolve_attribute_read_solo, -1), be_const_closure(class_Matter_Device_resolve_attribute_read_solo_closure) }, + { be_const_key_weak(bridge_add_endpoint, 1), be_const_closure(class_Matter_Device_bridge_add_endpoint_closure) }, + { be_const_key_weak(add_read_sensors_schedule, -1), be_const_closure(class_Matter_Device_add_read_sensors_schedule_closure) }, })), be_str_weak(Matter_Device) ); diff --git a/lib/libesp32/berry_tasmota/src/be_httpserver_lib.c b/lib/libesp32/berry_tasmota/src/be_httpserver_lib.c new file mode 100644 index 000000000..ba81c1b62 --- /dev/null +++ b/lib/libesp32/berry_tasmota/src/be_httpserver_lib.c @@ -0,0 +1,897 @@ +/* + be_httpserver_lib.c - HTTP server support for Berry using ESP-IDF HTTP server + + Copyright (C) 2025 Jonathan E. Peace + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +*/ + +#ifdef USE_BERRY_HTTPSERVER + +#include // For NULL, size_t +#include // For bool, true, false +#include // For string functions +#include // For malloc/free + +// ESP-IDF includes +#define LOG_LOCAL_LEVEL ESP_LOG_INFO +#include "esp_log.h" +#include "esp_http_server.h" +#include "freertos/FreeRTOS.h" +#include "freertos/queue.h" +#include "freertos/semphr.h" + +// Berry includes +#include "be_mapping.h" +#include "be_exec.h" +#include "be_vm.h" +#include "be_gc.h" + +// External function declarations +httpd_handle_t be_httpserver_get_handle(void); +void be_httpserver_set_disconnect_handler(httpd_close_func_t handler); +bool httpserver_has_queue(void); + +// Message types for queue +typedef enum { + HTTP_MSG_WEBSOCKET = 1, + HTTP_MSG_FILE = 2, + HTTP_MSG_WEB = 3 +} http_msg_type_t; + +// Message structure for queue +typedef struct { + http_msg_type_t type; + int client_id; + void *data; + size_t data_len; + void *user_data; + bvalue func; // Berry function value for web handlers + httpd_req_t *req; // HTTP request handle for async processing +} http_queue_msg_t; + +// Forward declarations for internal functions +void be_httpserver_process_websocket_msg(bvm *vm, int client_id, const char *data, size_t len); +bool httpserver_queue_message(http_msg_type_t type, int client_id, const void *data, size_t data_len, void *user_data); +bool httpserver_queue_web_request(int handler_id, httpd_req_t *req, bvalue func); + +// Logger tag +static const char *TAG = "HTTPSERVER"; + +// Global queue for handling messages in the main task context +static QueueHandle_t http_msg_queue = NULL; +static SemaphoreHandle_t http_queue_mutex = NULL; +static bool http_queue_initialized = false; + +// Maximum number of HTTP handlers +#define HTTP_HANDLER_MAX 5 + +// Handler storage +typedef struct { + bool active; // Whether this handler is in use + bvm *vm; // Berry VM instance + bvalue func; // Berry function to call for requests +} http_handler_t; + +static http_handler_t http_handlers[HTTP_HANDLER_MAX]; + +// Maximum concurrent HTTP server connections +#define HTTPD_MAX_CONNECTIONS 8 + +// Handle to HTTP server +static httpd_handle_t http_server = NULL; + +// Disconnect handler for WebSocket connections +static httpd_close_func_t http_server_disconn_handler = NULL; + +// Current HTTP request being processed (for Berry access) +static httpd_req_t *current_request = NULL; + +// Connection tracking +static struct { + int count; + SemaphoreHandle_t mutex; +} connection_tracking = {0, NULL}; + +// Connection cleanup function +// CONTEXT: ESP-IDF HTTP Server Task +// Called automatically by ESP-IDF when a client disconnects +static void http_connection_cleanup(void *arg) { + if (xSemaphoreTake(connection_tracking.mutex, pdMS_TO_TICKS(100)) == pdTRUE) { + connection_tracking.count--; + xSemaphoreGive(connection_tracking.mutex); + + // Call WebSocket disconnect handler if registered + if (http_server_disconn_handler) { + // arg is the socket file descriptor in this context + http_server_disconn_handler(NULL, (int)(intptr_t)arg); + } + } +} + +// WebSocket message processing function +// CONTEXT: Main Tasmota Task (Berry VM Context) +// This function runs in the main task when processing queued WebSocket messages +void be_httpserver_process_websocket_msg(bvm *vm, int client_id, const char *data, size_t data_len) { + // Log message details safely (handling NULL data for connect events) + if (data) { + ESP_LOGD(TAG, "Processing WebSocket message in main task context: client=%d, data='%s', len=%d", + client_id, data, (int)data_len); + } else { + ESP_LOGD(TAG, "Processing WebSocket event in main task context: client=%d", client_id); + } + + // Forward to the WebSocket handler in be_wsserver_lib.c + be_wsserver_handle_message(vm, client_id, data, data_len); +} + +// File request processing function +static void be_httpserver_process_file_request(bvm *vm, void *user_data) { + ESP_LOGI(TAG, "Processing file request (placeholder)"); + // Placeholder for file handling - to be extended as needed +} + + +// Initialize the message queue +static bool init_http_queue() { + if (!http_queue_initialized) { + http_msg_queue = xQueueCreate(10, sizeof(http_queue_msg_t)); + http_queue_mutex = xSemaphoreCreateMutex(); + + if (http_msg_queue != NULL && http_queue_mutex != NULL) { + http_queue_initialized = true; + ESP_LOGI(TAG, "HTTP queue initialized"); + return true; + } else { + ESP_LOGE(TAG, "Failed to create HTTP queue"); + return false; + } + } + return true; +} + +// Queue a message for processing in the main task +// CONTEXT: Any Task (typically ESP-IDF HTTP Server Task) +// This function is called to queue messages for processing in the main task +// TRANSITION: Current Task → Main Tasmota Task +bool httpserver_queue_message(http_msg_type_t type, int client_id, const void *data, size_t data_len, void *user_data) { + if (!http_queue_initialized) { + ESP_LOGE(TAG, "Queue not initialized"); + return false; + } + + if (!data && data_len > 0) { + ESP_LOGE(TAG, "Invalid data pointer with non-zero length"); + return false; + } + + // Take mutex to protect queue + if (xSemaphoreTake(http_queue_mutex, pdMS_TO_TICKS(100)) != pdTRUE) { + ESP_LOGE(TAG, "Failed to take mutex"); + return false; + } + + // Create a message to queue + http_queue_msg_t msg = {0};; + + msg.type = type; + msg.client_id = client_id; + msg.user_data = user_data; + + // Special case for HTTP_MSG_WEB is handled by httpserver_queue_web_request + if (type == HTTP_MSG_WEB) { + ESP_LOGE(TAG, "HTTP_MSG_WEB must use httpserver_queue_web_request"); + xSemaphoreGive(http_queue_mutex); + return false; + } + + // For other message types, copy the data if needed + if (data_len > 0) { + char *data_copy = malloc(data_len + 1); + if (!data_copy) { + ESP_LOGE(TAG, "Failed to allocate memory for data copy"); + xSemaphoreGive(http_queue_mutex); + return false; + } + + memcpy(data_copy, data, data_len); + data_copy[data_len] = '\0'; // Ensure null termination + + msg.data = data_copy; + msg.data_len = data_len; + } + + // Queue the message + if (xQueueSend(http_msg_queue, &msg, 0) != pdTRUE) { + // Queue is full, free the data if we allocated it + if (msg.data) { + free(msg.data); + } + ESP_LOGE(TAG, "Failed to queue message - queue is full"); + xSemaphoreGive(http_queue_mutex); + return false; + } + + // Message successfully queued + ESP_LOGD(TAG, "Message queued successfully (type %d, client %d)", type, client_id); + ESP_LOGD(TAG, "DIAGNOSTIC: Queue has %d messages waiting", uxQueueMessagesWaiting(http_msg_queue)); + + if (msg.data) { + ESP_LOGD(TAG, "QUEUE ITEM: type=%d, client=%d, data_len=%d, data_ptr=%p, user_data=%p", + msg.type, msg.client_id, (int)msg.data_len, msg.data, msg.user_data); + ESP_LOGD(TAG, "QUEUE DATA: '%s'", msg.data); + } + + xSemaphoreGive(http_queue_mutex); + return true; +} + +// Specialized function for queuing HTTP web requests with a Berry function +bool httpserver_queue_web_request(int handler_id, httpd_req_t *req, bvalue func) { + if (!http_queue_initialized) { + ESP_LOGE(TAG, "Queue not initialized"); + return false; + } + + if (!req) { + ESP_LOGE(TAG, "NULL request for web request"); + return false; + } + + // Create a copy of the request that we can process asynchronously + httpd_req_t *req_copy = NULL; + esp_err_t err = httpd_req_async_handler_begin(req, &req_copy); + if (err != ESP_OK) { + ESP_LOGE(TAG, "Failed to create async request: %d", err); + return false; + } + + // Take mutex to protect queue + if (xSemaphoreTake(http_queue_mutex, pdMS_TO_TICKS(100)) != pdTRUE) { + ESP_LOGE(TAG, "Failed to take mutex"); + // Release the request copy since we won't be using it + httpd_req_async_handler_complete(req_copy); + return false; + } + + // Create a message to queue + http_queue_msg_t msg = {0}; + + msg.type = HTTP_MSG_WEB; + msg.client_id = handler_id; + msg.user_data = NULL; + msg.func = func; // Store the function reference + msg.req = req_copy; // Store the COPY of the request handle + + // Queue the message + if (xQueueSend(http_msg_queue, &msg, 0) != pdTRUE) { + // Queue is full + ESP_LOGE(TAG, "Failed to queue web request - queue is full"); + // Release the request copy since we won't be using it + httpd_req_async_handler_complete(req_copy); + xSemaphoreGive(http_queue_mutex); + return false; + } + + // Message successfully queued + ESP_LOGD(TAG, "HTTP request queued successfully (type %d, handler %d)", msg.type, msg.client_id); + ESP_LOGD(TAG, "DIAGNOSTIC: Queue has %d messages waiting", uxQueueMessagesWaiting(http_msg_queue)); + ESP_LOGD(TAG, "QUEUE ITEM: type=%d, client=%d, data_len=%d, data_ptr=%p, user_data=%p, req=%p", + msg.type, msg.client_id, (int)msg.data_len, msg.data, msg.user_data, msg.req); + + xSemaphoreGive(http_queue_mutex); + return true; +} + + +// ------------------------------------------------------------------------ +// Web request processing function +// CONTEXT: Main Tasmota Task (Berry VM Context) +// This function processes queued web requests in the main task context +// ------------------------------------------------------------------------ + +void be_httpserver_process_web_request(bvm *vm, http_queue_msg_t *msg) { + ESP_LOGD(TAG, "Processing web request: msg=%p", msg); + + if (!msg) { + ESP_LOGE(TAG, "Web request has NULL message handle"); + return; + } + + ESP_LOGD(TAG, "Request details: req=%p, client_id=%d", msg->req, msg->client_id); + + if (!msg->req) { + ESP_LOGE(TAG, "Web request has NULL request handle"); + return; + } + + // Get handler ID (passed in client_id field) + int handler_id = msg->client_id; + if (handler_id < 0 || handler_id >= HTTP_HANDLER_MAX || !http_handlers[handler_id].active) { + ESP_LOGE(TAG, "Invalid handler ID from queue: %d", handler_id); + httpd_resp_set_status(msg->req, "500 Internal Server Error"); + httpd_resp_sendstr(msg->req, "Invalid handler ID"); + httpd_req_async_handler_complete(msg->req); + return; + } + + ESP_LOGI(TAG, "Processing web request for URI: %s with handler %d", msg->req->uri, handler_id); + + // Get the Berry VM and handler function + bvm *handler_vm = http_handlers[handler_id].vm; + + if (handler_vm == NULL) { + ESP_LOGE(TAG, "Berry VM is NULL for handler %d", handler_id); + httpd_resp_set_status(msg->req, "500 Internal Server Error"); + httpd_resp_sendstr(msg->req, "VM error"); + httpd_req_async_handler_complete(msg->req); + return; + } + + ESP_LOGI(TAG, "STACK: Before pushing function, stack top = %d", be_top(handler_vm)); + + // Push the function stored in the message + be_pushnil(handler_vm); + bvalue *top = be_indexof(handler_vm, -1); + *top = msg->func; + + current_request = msg->req; + + // Push URI as argument + be_pushstring(handler_vm, current_request->uri); + + // Check if this is a POST request and handle POST data + int arg_count = 1; // Start with 1 for the URI + + if (current_request->method == HTTP_POST) { + ESP_LOGI(TAG, "Processing POST request data"); + + // Get content length + int content_len = current_request->content_len; + ESP_LOGI(TAG, "POST content length: %d", content_len); + + if (content_len > 0) { + // Allocate buffer for POST data + char *post_data = malloc(content_len + 1); + if (post_data) { + // Read POST data + int received = httpd_req_recv(current_request, post_data, content_len); + if (received > 0) { + // Null-terminate the data + post_data[received] = '\0'; + ESP_LOGI(TAG, "Received POST data: %s", post_data); + + // Push POST data as second argument + be_pushstring(handler_vm, post_data); + arg_count = 2; // Now we have 2 arguments + } else { + ESP_LOGW(TAG, "Failed to read POST data, received: %d", received); + // Push nil as second argument + be_pushnil(handler_vm); + arg_count = 2; + } + free(post_data); + } else { + ESP_LOGE(TAG, "Failed to allocate memory for POST data"); + // Push nil as second argument + be_pushnil(handler_vm); + arg_count = 2; + } + } else { + // No content, push empty string as second argument + be_pushstring(handler_vm, ""); + arg_count = 2; + } + } + + // Call the Berry function + int result = be_pcall(handler_vm, arg_count); + + // Log stack state after call + ESP_LOGI(TAG, "STACK: After be_pcall, stack top = %d, result = %d", be_top(handler_vm), result); + + // Check for errors + if (result != 0) { + const char *err_msg = be_tostring(handler_vm, -1); + ESP_LOGE(TAG, "Berry handler error: %s", err_msg); + + // Send error response + httpd_resp_set_status(msg->req, "500 Internal Server Error"); + httpd_resp_sendstr(msg->req, (char*)err_msg); + + be_error_pop_all(handler_vm); // Clear entire stack on error + } else { + // Get return value + const char *response = be_tostring(handler_vm, -1); + ESP_LOGI(TAG, "Request processed. Response: %s", response ? response : "(null)"); + + // Send success response if httpserver.send() wasn't used + if (response != NULL) { + httpd_resp_set_type(msg->req, "text/html"); + httpd_resp_sendstr(msg->req, response); + } + + // Pop the argument (which has been replaced by the return value) + be_pop(handler_vm, 1); + } + + // Clear current_request AFTER all processing is done + current_request = NULL; + + // Complete the async request - ALWAYS call this to release the request + httpd_req_async_handler_complete(msg->req); + + // Pop the function if we didn't encounter an error + if (result == 0) { + // Pop the function + be_pop(handler_vm, 1); // Pop the function reference + } else { + ESP_LOGE(TAG, "Function parsing error: %d", result); + } + + // Log final stack state + ESP_LOGI(TAG, "STACK: Final state, stack top = %d", be_top(handler_vm)); +} + + +// ------------------------------------------------------------------------ +// Berry mapped C function to process queued messages +// CONTEXT: Main Tasmota Task (Berry VM Context) +// This function is registered to fast_loop() by the Berry app and is called +// periodically to process queued HTTP/WebSocket messages from the ESP-IDF HTTP server +// ------------------------------------------------------------------------ + +static int w_httpserver_process_queue(bvm *vm) { + if (!http_msg_queue) { + be_pushnil(vm); + be_return(vm); + } + + // Count of messages processed in this call + int processed = 0; + + // Process up to 5 messages in a single call to avoid blocking + for (int i = 0; i < 5; i++) { + // Take mutex before accessing queue + if (xSemaphoreTake(http_queue_mutex, 0) != pdTRUE) { + ESP_LOGW(TAG, "Failed to take mutex, will retry"); + break; + } + + // Process one message from the queue + http_queue_msg_t msg; + if (xQueueReceive(http_msg_queue, &msg, 0) == pdTRUE) { + // Release mutex while processing message + xSemaphoreGive(http_queue_mutex); + + // Count this message + processed++; + + // Diagnostic logging for queue state + ESP_LOGD(TAG, "QUEUE ITEM: type=%d, client=%d, data_len=%d, data_ptr=%p, user_data=%p, req=%p", + msg.type, msg.client_id, msg.data_len, msg.data, msg.user_data, msg.req); + + // Process message based on type + switch (msg.type) { + case HTTP_MSG_WEBSOCKET: + if (msg.data) { + ESP_LOGD(TAG, "QUEUE DATA: '%.*s'", msg.data_len, (char*)msg.data); + } else { + ESP_LOGD(TAG, "QUEUE DATA: '' (connect/disconnect event)"); + } + be_httpserver_process_websocket_msg(vm, msg.client_id, msg.data, msg.data_len); + // Free the data buffer we allocated + if (msg.data) { + free(msg.data); + } + break; + + case HTTP_MSG_FILE: + ESP_LOGI(TAG, "Processing file request"); + be_httpserver_process_file_request(vm, msg.user_data); + // user_data is not allocated by us, so don't free it + break; + + case HTTP_MSG_WEB: + ESP_LOGD(TAG, "Processing web request from queue"); + if (msg.req == NULL) { + ESP_LOGE(TAG, "CRITICAL ERROR: HTTP request pointer is NULL, skipping processing"); + break; + } + be_httpserver_process_web_request(vm, &msg); + break; + + default: + ESP_LOGW(TAG, "Unknown message type: %d", msg.type); + // Free data if it was allocated + if (msg.data) { + free(msg.data); + } + // If it's a request that wasn't processed, complete it + if (msg.req) { + httpd_req_async_handler_complete(msg.req); + } + break; + } + } else { + // No messages in queue + xSemaphoreGive(http_queue_mutex); + break; + } + } + + // Return the number of messages processed + be_pushint(vm, processed); + be_return(vm); +} + + +// ------------------------------------------------------------------------ +// HTTP Handler implementation +// ------------------------------------------------------------------------ + +// Forward declaration for handler implementation +static esp_err_t berry_http_handler_impl(httpd_req_t *req, int handler_id); + +// Macro to create handler functions for each supported endpoint +#define HTTP_HANDLER_FUNC(n) \ + static esp_err_t berry_http_handler_##n(httpd_req_t *req) { \ + return berry_http_handler_impl(req, n); \ + } + +// Generate handler functions +HTTP_HANDLER_FUNC(0) +HTTP_HANDLER_FUNC(1) +HTTP_HANDLER_FUNC(2) +HTTP_HANDLER_FUNC(3) +HTTP_HANDLER_FUNC(4) + +// Array of handler function pointers +typedef esp_err_t (*http_handler_func_t)(httpd_req_t *req); +static const http_handler_func_t berry_handlers[HTTP_HANDLER_MAX] = { + berry_http_handler_0, + berry_http_handler_1, + berry_http_handler_2, + berry_http_handler_3, + berry_http_handler_4 +}; + +// Implementation of HTTP handler dispatched by each numbered handler +static esp_err_t berry_http_handler_impl(httpd_req_t *req, int handler_id) { + if (handler_id < 0 || handler_id >= HTTP_HANDLER_MAX || !http_handlers[handler_id].active) { + ESP_LOGE(TAG, "Invalid or inactive handler ID: %d", handler_id); + httpd_resp_send_err(req, HTTPD_500_INTERNAL_SERVER_ERROR, "Invalid handler"); + httpd_req_async_handler_complete(req); + return ESP_FAIL; + } + + // Store current request for access in Berry functions + current_request = req; + + // Get the Berry VM and handler function + bvm *vm = http_handlers[handler_id].vm; + + if (vm == NULL) { + ESP_LOGE(TAG, "Berry VM is NULL for handler %d", handler_id); + httpd_resp_send_err(req, HTTPD_500_INTERNAL_SERVER_ERROR, "VM error"); + current_request = NULL; + httpd_req_async_handler_complete(req); + return ESP_FAIL; + } + + // Log initial stack state + ESP_LOGI(TAG, "HANDLER: Initial stack top = %d", be_top(vm)); + + // Queue message for processing in main task if available + if (httpserver_has_queue()) { + ESP_LOGI(TAG, "Queueing request for %s", req->uri); + + // Queue the request with the stored function value + if (!httpserver_queue_web_request(handler_id, req, http_handlers[handler_id].func)) { + httpd_resp_send_err(req, HTTPD_500_INTERNAL_SERVER_ERROR, "Failed to queue message"); + current_request = NULL; + httpd_req_async_handler_complete(req); + return ESP_FAIL; + } + + // Note: We don't send a response here - that will be done asynchronously + current_request = NULL; + + // Log final stack state + ESP_LOGI(TAG, "HANDLER: Final stack top = %d", be_top(vm)); + + return ESP_OK; + } + + // If no queue, we'll process directly with caution + ESP_LOGW(TAG, "Processing request directly - this may be unsafe!"); + + // Start the async handler + httpd_req_t *async_req = NULL; + esp_err_t ret = httpd_req_async_handler_begin(req, &async_req); + if (ret != ESP_OK || async_req == NULL) { + ESP_LOGE(TAG, "Failed to start async handler"); + httpd_resp_send_err(req, HTTPD_500_INTERNAL_SERVER_ERROR, "Failed to start async handler"); + current_request = NULL; + httpd_req_async_handler_complete(req); + return ESP_FAIL; + } + + // Get the initial stack size + int top = be_top(vm); + + // Push the handler function directly onto the stack (copy from stored value) + be_pushnil(vm); // Push a temporary placeholder + bvalue *top_ptr = be_indexof(vm, -1); + *top_ptr = http_handlers[handler_id].func; // Replace placeholder with stored function + + // Push the URI string (argument) onto the stack + be_pushstring(vm, req->uri); + + // Call the handler function with the URI as single argument + if (be_pcall(vm, 1) != 0) { + const char *err_msg = be_tostring(vm, -1); + ESP_LOGE(TAG, "Berry error: %s", err_msg ? err_msg : "unknown error"); + httpd_resp_send_err(req, HTTPD_500_INTERNAL_SERVER_ERROR, "Handler call failed"); + be_error_pop_all(vm); // Special case - clears entire stack on error + current_request = NULL; + httpd_req_async_handler_complete(req); + return ESP_FAIL; + } + + // Get the response string + const char *response = be_tostring(vm, -1); + if (response == NULL) { + ESP_LOGE(TAG, "Handler returned nil response"); + httpd_resp_send_err(req, HTTPD_500_INTERNAL_SERVER_ERROR, "Handler returned nil response"); + be_error_pop_all(vm); // Special case - clears entire stack on error + current_request = NULL; + httpd_req_async_handler_complete(req); + return ESP_FAIL; + } + + // Send the response + httpd_resp_set_type(req, "text/html"); + httpd_resp_sendstr(req, response); + + // Clean up + be_pop(vm, 1); // Pop return value + be_pop(vm, 1); // Pop function + current_request = NULL; + + // Complete the async handler + httpd_req_async_handler_complete(async_req); + + return ESP_OK; +} + +// ------------------------------------------------------------------------ +// Berry API Implementation +// ------------------------------------------------------------------------ + +// Start the HTTP server +static int w_httpserver_start(bvm *vm) { + int top = be_top(vm); + + if (http_server != NULL) { + be_pushbool(vm, true); // Server already running + be_return (vm); + } + + // Initialize connection tracking + connection_tracking.mutex = xSemaphoreCreateMutex(); + if (!connection_tracking.mutex) { + ESP_LOGE(TAG, "Failed to create connection tracking mutex"); + be_pushbool(vm, false); + be_return (vm); + } + + // Configure the server + httpd_config_t config = HTTPD_DEFAULT_CONFIG(); + config.stack_size = 8192; + config.max_uri_handlers = HTTP_HANDLER_MAX; + config.max_open_sockets = HTTPD_MAX_CONNECTIONS; + config.lru_purge_enable = true; // Enable LRU purging of connections + config.uri_match_fn = httpd_uri_match_wildcard; // Enable wildcard URI matching + + // Handle port parameter if provided + if (top > 0 && be_isint(vm, 1)) { + config.server_port = be_toint(vm, 1); + } + + ESP_LOGI(TAG, "Starting HTTP server on port %d", config.server_port); + esp_err_t ret = httpd_start(&http_server, &config); + + if (ret != ESP_OK) { + ESP_LOGE(TAG, "Failed to start HTTP server: %d", ret); + vSemaphoreDelete(connection_tracking.mutex); + be_pushbool(vm, false); + be_return (vm); + } + + ESP_LOGI(TAG, "HTTP server started successfully"); + + // Initialize the queue for thread-safe message passing + init_http_queue(); + + be_pushbool(vm, true); + be_return (vm); +} + +// Register a URI handler +static int w_httpserver_on(bvm *vm) { + int top = be_top(vm); + httpd_method_t http_method = HTTP_GET; // Default method + + if (top < 2 || http_server == NULL) { + be_raise(vm, "value_error", top < 2 ? "Missing arguments" : "Server not started"); + be_return(vm); + } + + if (!be_isstring(vm, 1) || !be_isfunction(vm, 2)) { + be_raise(vm, "type_error", "String and function required"); + be_return(vm); + } + + // Check for optional method argument + if (top >= 3) { + if (!be_isstring(vm, 3)) { + be_raise(vm, "type_error", "Method must be a string"); + be_return(vm); + } + const char *method_str = be_tostring(vm, 3); + if (strcasecmp(method_str, "POST") == 0) { + http_method = HTTP_POST; + } else if (strcasecmp(method_str, "GET") != 0) { + be_raise(vm, "value_error", "Method must be 'GET' or 'POST'"); + be_return(vm); + } + } + + const char *uri = be_tostring(vm, 1); + ESP_LOGI(TAG, "Registering handler for URI: %s, Method: %s", uri, + http_method == HTTP_GET ? "GET" : "POST"); + + // Find a free handler slot + int slot = -1; + for (int i = 0; i < HTTP_HANDLER_MAX; i++) { + if (!http_handlers[i].active) { + slot = i; + break; + } + } + + if (slot < 0) { + be_raise(vm, "runtime_error", "No more handler slots available"); + be_return(vm); + } + + // Store handler info + http_handlers[slot].vm = vm; + http_handlers[slot].active = true; + + // Store the function reference + be_pushvalue(vm, 2); + bvalue *v = be_indexof(vm, -1); + http_handlers[slot].func = *v; + be_pop(vm, 1); + + // Register the handler with ESP-IDF HTTP server + httpd_uri_t http_uri = { + .uri = uri, + .method = http_method, + .handler = berry_handlers[slot], + .user_ctx = NULL + }; + + esp_err_t ret = httpd_register_uri_handler(http_server, &http_uri); + if (ret != ESP_OK) { + ESP_LOGE(TAG, "Failed to register URI handler: %d", ret); + http_handlers[slot].active = false; + be_pushbool(vm, false); + be_return (vm); + } + + // Return the handler slot + be_pushint(vm, slot); + be_return (vm); +} + +// Stop the HTTP server +static int w_httpserver_stop(bvm *vm) { + if (http_server == NULL) { + be_pushbool(vm, false); // Server not running + be_return (vm); + } + + // Clean up handler registrations + for (int i = 0; i < HTTP_HANDLER_MAX; i++) { + if (http_handlers[i].active) { + http_handlers[i].active = false; + // Potentially unregister URI handlers here if needed + } + } + + // Stop the server + esp_err_t ret = httpd_stop(http_server); + http_server = NULL; + + // Clean up connection tracking + if (connection_tracking.mutex) { + vSemaphoreDelete(connection_tracking.mutex); + connection_tracking.mutex = NULL; + } + + be_pushbool(vm, ret == ESP_OK); + be_return (vm); +} + +// Simple wrapper around httpd_resp_sendstr +static int w_httpserver_send(bvm *vm) { + int argc = be_top(vm); + if (argc >= 1 && be_isstring(vm, 1)) { + const char* content = be_tostring(vm, 1); + + // Get the current request from the async message + httpd_req_t* req = current_request; + if (!req) { + be_raisef(vm, "request_error", "No active request"); + // Note: Don't call httpd_req_async_handler_complete here as there's no valid request + return 0; + } + + // Send the response + esp_err_t ret = httpd_resp_sendstr(req, content); + if (ret != ESP_OK) { + ESP_LOGE(TAG, "Failed to send response: %d", ret); + // Don't complete the handler here - let the main handler do it + be_pushbool(vm, false); + be_return (vm); + } + + be_pushbool(vm, true); + be_return (vm); + } + + be_return_nil(vm); +} + +// Set WebSocket disconnect handler +void be_httpserver_set_disconnect_handler(httpd_close_func_t handler) { + http_server_disconn_handler = handler; +} + +// Get HTTP server handle +httpd_handle_t be_httpserver_get_handle(void) { + return http_server; +} + +// Function to check if message queue is available (referenced by wsserver) +bool httpserver_has_queue() { + return http_queue_initialized; +} + +/* @const_object_info_begin +module httpserver (scope: global, strings: weak) { + start, func(w_httpserver_start) + on, func(w_httpserver_on) + send, func(w_httpserver_send) + stop, func(w_httpserver_stop) + process_queue, func(w_httpserver_process_queue) +} +@const_object_info_end */ + +#include "be_fixed_httpserver.h" + +#endif // USE_BERRY_HTTPSERVER \ No newline at end of file diff --git a/lib/libesp32/berry_tasmota/src/be_port.cpp b/lib/libesp32/berry_tasmota/src/be_port.cpp index db40e153f..c07200b2d 100644 --- a/lib/libesp32/berry_tasmota/src/be_port.cpp +++ b/lib/libesp32/berry_tasmota/src/be_port.cpp @@ -315,11 +315,11 @@ char* be_fgets(void *hfile, void *buffer, int size) uint8_t * buf = (uint8_t*) buffer; if (hfile != nullptr && buffer != nullptr && size > 0) { File * f_ptr = (File*) hfile; - int ret = f_ptr->readBytesUntil('\n', buf, size - 2); - // Serial.printf("be_fgets ret=%d\n", ret); + int ret = f_ptr->readBytesUntil('\n', buf, size - 1); + // Serial.printf("be_fgets size=%d ret=%d\n", size, ret); if (ret >= 0) { buf[ret] = 0; // add string terminator - if (ret > 0 && ret < size - 2) { + if (ret < size - 1) { buf[ret] = '\n'; buf[ret+1] = 0; } diff --git a/lib/libesp32/berry_tasmota/src/be_tasmota_lib.c b/lib/libesp32/berry_tasmota/src/be_tasmota_lib.c index 9ff788a38..71623a526 100644 --- a/lib/libesp32/berry_tasmota/src/be_tasmota_lib.c +++ b/lib/libesp32/berry_tasmota/src/be_tasmota_lib.c @@ -90,6 +90,7 @@ class be_class_tasmota (scope: global, name: Tasmota) { _crons, var // list of active crons _ccmd, var // list of active Tasmota commands implemented in Berry _drivers, var // list of active drivers + _wnu, var // list of closures to call when network is connected wire1, var // Tasmota I2C Wire1 wire2, var // Tasmota I2C Wire2 cmd_res, var // store the command result, nil if disables, true if capture enabled, contains return value @@ -106,7 +107,7 @@ class be_class_tasmota (scope: global, name: Tasmota) { init, closure(class_Tasmota_init_closure) get_free_heap, func(l_getFreeHeap) - arch, func(l_arch) + arch, static_func(l_arch) publish, func(be_mqtt_publish) publish_result, func(l_publish_result) publish_rule, func(l_publish_rule) @@ -183,6 +184,8 @@ class be_class_tasmota (scope: global, name: Tasmota) { exec_cmd, closure(class_Tasmota_exec_cmd_closure) gc, closure(class_Tasmota_gc_closure) event, closure(class_Tasmota_event_closure) + when_network_up, closure(class_Tasmota_when_network_up_closure) + run_network_up, closure(class_Tasmota_run_network_up_closure) add_driver, closure(class_Tasmota_add_driver_closure) remove_driver, closure(class_Tasmota_remove_driver_closure) load, closure(class_Tasmota_load_closure) diff --git a/lib/libesp32/berry_tasmota/src/be_tcpclient_lib.c b/lib/libesp32/berry_tasmota/src/be_tcpclient_lib.c index 5fe1c7e78..8e5702e14 100644 --- a/lib/libesp32/berry_tasmota/src/be_tcpclient_lib.c +++ b/lib/libesp32/berry_tasmota/src/be_tcpclient_lib.c @@ -6,8 +6,6 @@ *******************************************************************/ #include "be_constobj.h" -#ifdef USE_WEBCLIENT - extern int wc_tcp_init(bvm *vm); extern int wc_tcp_deinit(bvm *vm); @@ -44,5 +42,3 @@ class be_class_tcpclient (scope: global, name: tcpclient) { readbytes, func(wc_tcp_readbytes) } @const_object_info_end */ - -#endif // USE_WEBCLIENT diff --git a/lib/libesp32/berry_tasmota/src/be_tcpclientasyc_lib.c b/lib/libesp32/berry_tasmota/src/be_tcpclientasyc_lib.c index 16d5f7240..b0b0ce65b 100644 --- a/lib/libesp32/berry_tasmota/src/be_tcpclientasyc_lib.c +++ b/lib/libesp32/berry_tasmota/src/be_tcpclientasyc_lib.c @@ -5,8 +5,6 @@ *******************************************************************/ #include "be_constobj.h" -#ifdef USE_WEBCLIENT - extern int wc_tcpasync_init(bvm *vm); extern int wc_tcpasync_deinit(bvm *vm); @@ -42,5 +40,3 @@ class be_class_tcpclientasync (scope: global, name: tcpclientasync) { readbytes, func(wc_tcpasync_readbytes) } @const_object_info_end */ - -#endif // USE_WEBCLIENT diff --git a/lib/libesp32/berry_tasmota/src/be_udp_lib.c b/lib/libesp32/berry_tasmota/src/be_udp_lib.c index e49dc5e48..c41e66225 100644 --- a/lib/libesp32/berry_tasmota/src/be_udp_lib.c +++ b/lib/libesp32/berry_tasmota/src/be_udp_lib.c @@ -7,8 +7,6 @@ #include "be_constobj.h" #include "be_mapping.h" -#ifdef USE_WEBCLIENT - extern int be_udp_read(struct bvm *vm); extern void *be_udp_init_ntv(void); @@ -53,5 +51,3 @@ class be_class_udp (scope: global, name: udp) { close, ctype_func(be_udp_stop_ntv) } @const_object_info_end */ - -#endif // USE_WEBCLIENT diff --git a/lib/libesp32/berry_tasmota/src/be_webclient_lib.c b/lib/libesp32/berry_tasmota/src/be_webclient_lib.c index c49d189ec..735722432 100644 --- a/lib/libesp32/berry_tasmota/src/be_webclient_lib.c +++ b/lib/libesp32/berry_tasmota/src/be_webclient_lib.c @@ -6,8 +6,6 @@ *******************************************************************/ #include "be_constobj.h" -#ifdef USE_WEBCLIENT - extern int wc_init(bvm *vm); extern int wc_deinit(bvm *vm); extern int wc_urlencode(bvm *vm); @@ -72,5 +70,3 @@ class be_class_webclient (scope: global, name: webclient) { get_bytes, func(wc_getbytes) } @const_object_info_end */ - -#endif // USE_WEBCLIENT diff --git a/lib/libesp32/berry_tasmota/src/be_webfiles_lib.c b/lib/libesp32/berry_tasmota/src/be_webfiles_lib.c new file mode 100644 index 000000000..c2fecb1a7 --- /dev/null +++ b/lib/libesp32/berry_tasmota/src/be_webfiles_lib.c @@ -0,0 +1,400 @@ +/* + be_webfiles_lib.c - Static file server for Berry using ESP-IDF HTTP server + + Copyright (C) 2025 Jonathan E. Peace + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +*/ + +#ifdef USE_BERRY_WEBFILES + +#ifndef LOG_LOCAL_LEVEL +#define LOG_LOCAL_LEVEL ESP_LOG_INFO +#endif + +#include "be_constobj.h" +#include "be_mapping.h" + +// ESP-IDF includes +#include "esp_log.h" +#include "esp_http_server.h" +#include "esp_vfs.h" + +// External Berry/Tasmota includes +extern httpd_handle_t be_httpserver_get_handle(void); +extern bool httpserver_queue_message(int type, int client_id, + const char* data, size_t len, void* user_data); + +// Tag for logging +static const char *TAG = "WEBFILES"; + +// Default base path for files +static char base_path[64] = "/files"; + +// URI prefix for the file server +static char uri_prefix[32] = "/"; + +// Maximum file path length +#define FILE_PATH_MAX 128 + +// Scratch buffer size for file transfer +#define SCRATCH_BUFSIZE 4096 // 4KB scratch buffer for chunks + +// Static buffer for file sending - fixed allocation +static char scratch_buffer[SCRATCH_BUFSIZE]; + +// MIME Type Mapping +static const struct { + const char *extension; + const char *mimetype; +} mime_types[] = { + {".html", "text/html"}, + {".htm", "text/html"}, + {".js", "application/javascript"}, + {".mjs", "application/javascript"}, // ES modules + {".css", "text/css"}, + {".png", "image/png"}, + {".jpg", "image/jpeg"}, + {".jpeg", "image/jpeg"}, + {".gif", "image/gif"}, + {".ico", "image/x-icon"}, + {".svg", "image/svg+xml"}, + {".json", "application/json"}, + {".txt", "text/plain"}, + {".md", "text/markdown"}, + {".wasm", "application/wasm"}, // WebAssembly + {".map", "application/json"}, // Source maps + {".woff", "font/woff"}, + {".woff2", "font/woff2"}, + {".ttf", "font/ttf"}, + {".otf", "font/otf"}, + {".bin", "application/octet-stream"}, + {NULL, NULL} +}; + +// Get MIME type based on file extension +static const char* get_mime_type(const char *path) { + const char *ext = strrchr(path, '.'); + if (!ext) return "text/plain"; + + for (int i = 0; mime_types[i].extension; i++) { + if (strcasecmp(mime_types[i].extension, ext) == 0) { + return mime_types[i].mimetype; + } + } + return "text/plain"; +} + +// Build full path including base path +static const char* get_full_path(char *dest, const char *uri, size_t destsize) { + size_t base_len = strlen(base_path); + size_t prefix_len = strlen(uri_prefix); + size_t uri_len = strlen(uri); + + // Handle query parameters and fragments in URI + const char *query = strchr(uri, '?'); + if (query) { + uri_len = query - uri; + } + const char *fragment = strchr(uri, '#'); + if (fragment && (!query || fragment < query)) { + uri_len = fragment - uri; + } + + // Skip the URI prefix to get the relative path + const char *relative_path = uri; + if (prefix_len > 1 && strncmp(uri, uri_prefix, prefix_len) == 0) { + relative_path = uri + prefix_len - 1; // -1 because we want to keep the leading slash + uri_len -= (prefix_len - 1); + } + + // Check if path will fit in destination buffer + if (base_len + uri_len + 1 > destsize) { + ESP_LOGE(TAG, "Path too long"); + return NULL; + } + + // Construct full path + strcpy(dest, base_path); + if (base_len > 0 && base_path[base_len-1] == '/' && relative_path[0] == '/') { + // Avoid double slash + strlcpy(dest + base_len, relative_path + 1, uri_len); + } else { + strlcpy(dest + base_len, relative_path, uri_len + 1); + } + + return dest; +} + +// Set content type based on file extension +static void set_content_type_from_file(httpd_req_t *req, const char *filepath) { + const char* mime_type = get_mime_type(filepath); + httpd_resp_set_type(req, mime_type); + + // Set Cache-Control header for static assets + // Don't cache HTML, but cache other static assets + if (strstr(mime_type, "text/html") == NULL) { + // Cache for 1 hour (3600 seconds) + httpd_resp_set_hdr(req, "Cache-Control", "max-age=3600"); + } else { + // Don't cache HTML content + httpd_resp_set_hdr(req, "Cache-Control", "no-cache"); + } + + // Add CORS headers for development convenience + httpd_resp_set_hdr(req, "Access-Control-Allow-Origin", "*"); +} + +//checks if a .html, .css, or .js file exists with a .br suffix and serve that Brotli-compressed version instead + +static esp_err_t webfiles_handler(httpd_req_t *req) { + char filepath[FILE_PATH_MAX]; + char compressed_filepath[FILE_PATH_MAX]; + FILE *file = NULL; + struct stat file_stat; + bool use_compression = false; + const char* compression_type = NULL; // Only Gzip for now + + // Process any URL query parameters if needed + char *query = strchr(req->uri, '?'); + if (query) { + ESP_LOGI(TAG, "Request has query params: %s", query); + *query = '\0'; // Temporarily terminate URI at the query string for path resolution + } + + // Get the full file path from the URI + if (get_full_path(filepath, req->uri, sizeof(filepath)) == NULL) { + ESP_LOGE(TAG, "Failed to get file path for URI: %s", req->uri); + httpd_resp_send_err(req, HTTPD_404_NOT_FOUND, "File not found"); + return ESP_FAIL; + } + + // Restore query string if we modified it + if (query) *query = '?'; + + ESP_LOGI(TAG, "Requested file: %s", filepath); + + // Check if file is .html, .css, .js, or .svg and if a compressed version exists + const char *ext = strrchr(filepath, '.'); + if (ext && (strcasecmp(ext, ".html") == 0 || strcasecmp(ext, ".css") == 0 || + strcasecmp(ext, ".js") == 0 || strcasecmp(ext, ".svg") == 0)) { + + // Check what compression formats the client supports + char accept_encoding[64] = {0}; + if (httpd_req_get_hdr_value_str(req, "Accept-Encoding", accept_encoding, sizeof(accept_encoding)) == ESP_OK) { + ESP_LOGI(TAG, "Client supports compression: %s", accept_encoding); + if (!use_compression && strstr(accept_encoding, "gzip") != NULL) { + // Construct Gzip filepath + snprintf(compressed_filepath, sizeof(compressed_filepath), "%s.gz", filepath); + if (stat(compressed_filepath, &file_stat) == 0 && S_ISREG(file_stat.st_mode)) { + use_compression = true; + compression_type = "gzip"; + strcpy(filepath, compressed_filepath); // Use the .gz file + ESP_LOGI(TAG, "Found Gzip version: %s", filepath); + } + } + } + } + + // Check if file exists + if (stat(filepath, &file_stat) != 0) { + ESP_LOGE(TAG, "File does not exist: %s", filepath); + httpd_resp_send_err(req, HTTPD_404_NOT_FOUND, "File not found"); + return ESP_FAIL; + } + + // Check if it's a regular file + if (!S_ISREG(file_stat.st_mode)) { + ESP_LOGE(TAG, "Not a regular file: %s", filepath); + httpd_resp_send_err(req, HTTPD_404_NOT_FOUND, "Not a file"); + return ESP_FAIL; + } + + // Open the file for reading + file = fopen(filepath, "r"); + if (!file) { + ESP_LOGE(TAG, "Failed to open file: %s", filepath); + httpd_resp_send_err(req, HTTPD_500_INTERNAL_SERVER_ERROR, "Failed to open file"); + return ESP_FAIL; + } + + // Set content type based on file extension (use original path for MIME type if compressed) + char original_filepath[FILE_PATH_MAX]; + if (use_compression) { + // Strip compression extension for MIME type detection + strcpy(original_filepath, filepath); + char* dot_pos = strrchr(original_filepath, '.'); + if (dot_pos) { + *dot_pos = '\0'; // Remove compression extension + } + set_content_type_from_file(req, original_filepath); + } else { + set_content_type_from_file(req, filepath); + } + + // Set compression headers if applicable + if (use_compression) { + httpd_resp_set_hdr(req, "Content-Encoding", compression_type); + httpd_resp_set_hdr(req, "Vary", "Accept-Encoding"); + } + + // Send file in chunks for efficiency + size_t chunk_size; + size_t total_sent = 0; + + while ((chunk_size = fread(scratch_buffer, 1, SCRATCH_BUFSIZE, file)) > 0) { + if (httpd_resp_send_chunk(req, scratch_buffer, chunk_size) != ESP_OK) { + ESP_LOGE(TAG, "File send failed"); + fclose(file); + httpd_resp_send_chunk(req, NULL, 0); + return ESP_FAIL; + } + total_sent += chunk_size; + } + + // Close file + fclose(file); + + // Finish the HTTP response + httpd_resp_send_chunk(req, NULL, 0); + ESP_LOGI(TAG, "File sent successfully (%d bytes, %s)", (int)total_sent, use_compression ? compression_type : "uncompressed"); + + return ESP_OK; +} + +/**************************************************************** + * Berry Interface Functions + ****************************************************************/ + +// webfiles.serve(base_path, uri_prefix) -> bool +// Serve files from base_path at uri_prefix +static int w_webfiles_serve(bvm *vm) { + int initial_top = be_top(vm); + + if (be_top(vm) >= 2 && be_isstring(vm, 1) && be_isstring(vm, 2)) { + const char* path = be_tostring(vm, 1); + const char* prefix = be_tostring(vm, 2); + + ESP_LOGI(TAG, "Setting up file server with base path: %s, uri prefix: %s", path, prefix); + + struct stat st; + if (stat(path, &st) != 0 || !S_ISDIR(st.st_mode)) { + ESP_LOGE(TAG, "Input path is not a valid directory: %s", path); + be_pushbool(vm, false); + // Clean up stack before returning + while (be_top(vm) > initial_top) { + be_pop(vm, 1); + } + be_return (vm); // Return directly + } + + httpd_handle_t server = be_httpserver_get_handle(); + if (!server) { + ESP_LOGE(TAG, "HTTP server not running"); + be_pushbool(vm, false); + while (be_top(vm) > initial_top) { + be_pop(vm, 1); + } + be_return (vm); + } + + strlcpy(base_path, path, sizeof(base_path)); + strlcpy(uri_prefix, prefix, sizeof(uri_prefix)); + + + // Use a static buffer for the URI pattern + static char registered_uri_pattern[64]; // ADD static keyword + // Ensure it's null-terminated even if snprintf truncates + registered_uri_pattern[sizeof(registered_uri_pattern) - 1] = '\0'; + snprintf(registered_uri_pattern, sizeof(registered_uri_pattern), "%s*", prefix); + + ESP_LOGI(TAG, "Registering URI handler with pattern: %s", registered_uri_pattern); + + httpd_uri_t uri_handler = { + // Point to the static buffer + .uri = registered_uri_pattern, // Use the static buffer + .method = HTTP_GET, + .handler = webfiles_handler, + .is_websocket = false, + .user_ctx = NULL + }; + + esp_err_t ret = httpd_register_uri_handler(server, &uri_handler); + if (ret != ESP_OK) { + ESP_LOGE(TAG, "Failed to register URI handler: %d", ret); + be_pushbool(vm, false); + be_pop(vm, be_top(vm) - initial_top); + be_return (vm); + } + + be_pushbool(vm, true); + be_pop(vm, be_top(vm) - initial_top); + be_return (vm); + } + + be_pushbool(vm, false); + be_pop(vm, be_top(vm) - initial_top); + be_return (vm); +} + +// webfiles.serve_file(file_path, uri) -> bool +// Serve a specific file at a specific URI +static int w_webfiles_serve_file(bvm *vm) { + int initial_top = be_top(vm); + + if (be_top(vm) >= 2 && be_isstring(vm, 1) && be_isstring(vm, 2)) { + const char* file_path = be_tostring(vm, 1); + const char* uri = be_tostring(vm, 2); + + // Check if file exists + struct stat file_stat; + if (stat(file_path, &file_stat) == -1) { + ESP_LOGE(TAG, "File not found: %s", file_path); + be_pushbool(vm, false); + be_pop(vm, be_top(vm) - initial_top); + be_return (vm); + } + + // TODO: Implement custom handler for specific files + // This would require keeping track of file mappings + + ESP_LOGW(TAG, "serve_file not yet implemented"); + be_pushbool(vm, false); + be_pop(vm, be_top(vm) - initial_top); + be_return (vm); + } + + be_pushbool(vm, false); + be_pop(vm, be_top(vm) - initial_top); + be_return (vm); +} + +// Module definition +/* @const_object_info_begin +module webfiles (scope: global, strings: weak) { + serve, func(w_webfiles_serve) + serve_file, func(w_webfiles_serve_file) + + // MIME type constants + MIME_HTML, str("text/html") + MIME_JS, str("application/javascript") + MIME_CSS, str("text/css") + MIME_JSON, str("application/json") + MIME_TEXT, str("text/plain") + MIME_BINARY, str("application/octet-stream") +} +@const_object_info_end */ +#include "be_fixed_webfiles.h" + +#endif // USE_BERRY_WEBFILES diff --git a/lib/libesp32/berry_tasmota/src/be_wsserver_lib.c b/lib/libesp32/berry_tasmota/src/be_wsserver_lib.c new file mode 100644 index 000000000..330a99213 --- /dev/null +++ b/lib/libesp32/berry_tasmota/src/be_wsserver_lib.c @@ -0,0 +1,1326 @@ +/* + be_wsserver_lib.c - WebSocket server support for Berry using ESP-IDF HTTP server + + Copyright (C) 2025 Jonathan E. Peace + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +*/ + +#ifdef USE_BERRY_WSSERVER + +#ifndef LOG_LOCAL_LEVEL +#define LOG_LOCAL_LEVEL ESP_LOG_INFO +#endif + +#include "be_constobj.h" +#include "be_mapping.h" +#include "be_exec.h" +#include "be_vm.h" + +// Standard C includes +#include +#include +#include + +// ESP-IDF includes +#include "esp_http_server.h" +#include "esp_event.h" +#include "esp_log.h" +#include "esp_timer.h" + +// Socket-related includes +#include +#include + +#include "be_object.h" +#include "be_string.h" +#include "be_gc.h" +#include "be_exec.h" +#include "be_debug.h" +#include "be_map.h" +#include "be_list.h" +#include "be_module.h" +#include "be_vm.h" + +static const char *TAG = "WSS"; + +// Max number of concurrent clients +#define MAX_WS_CLIENTS 5 + +// Define event types +#define WSSERVER_EVENT_CONNECT 0 +#define WSSERVER_EVENT_DISCONNECT 1 +#define WSSERVER_EVENT_MESSAGE 2 + +// Message types for queue - match those in be_httpserver_lib.c +#define HTTP_MSG_WEBSOCKET 1 +#define HTTP_MSG_FILE 2 +#define HTTP_MSG_WEB 3 + +// Forward declaration for the HTTP server handle getter function +extern httpd_handle_t be_httpserver_get_handle(void); + +// Declarations for functions used by httpserver_lib +extern bool httpserver_has_queue(void); +extern bool httpserver_queue_message(int msg_type, int client_id, + const void *data, size_t data_len, void *user_data); + +// Client tracking structure +typedef struct { + int sockfd; + bool active; + int64_t last_activity; // Timestamp of any client activity +} ws_client_t; + +// Callback structure to properly store Berry callbacks +typedef struct be_wsserver_callback_t { + bvm *vm; // VM instance + bvalue func; // Berry function value + bool active; // Whether this callback is active +} be_wsserver_callback_t; + +// Forward declarations for all functions to prevent compiler errors +static void init_clients(void); +static int find_free_client_slot(void); +static int add_client(int sockfd); +static int find_client_by_fd(int sockfd); +static void remove_client(int slot); +static bool is_client_valid(int slot); +static void log_ws_frame_info(httpd_ws_frame_t *ws_pkt); +static void handle_ws_message(int client_id, const char *message, size_t len); +static void handle_client_disconnect(int client_slot); +static void callBerryWsDispatcher(bvm *vm, int client_id, const char *event_name, const char *payload, int arg_count); +static void http_server_disconnect_handler(void* arg, int sockfd); +static void check_clients(void); + +// Globals +static httpd_handle_t ws_server = NULL; +static bool wsserver_running = false; +static uint32_t ping_interval_s; // Ping interval in seconds +static uint32_t ping_timeout_s; // Activity timeout in seconds + +// Client status and context +static ws_client_t ws_clients[MAX_WS_CLIENTS] = {0}; + +// Storage for Berry callback functions +static be_wsserver_callback_t wsserver_callbacks[3]; // CONNECT, DISCONNECT, MESSAGE + +// Forward declaration for processing WebSocket messages in main task context +void be_wsserver_handle_message(bvm *vm, int client_id, const char* data, size_t len); + +// Utility function to log WebSocket frame information +static void log_ws_frame_info(httpd_ws_frame_t *ws_pkt) { + if (!ws_pkt) return; + + const char* type_str = "UNKNOWN"; + switch (ws_pkt->type) { + case HTTPD_WS_TYPE_CONTINUE: type_str = "CONTINUE"; break; + case HTTPD_WS_TYPE_TEXT: type_str = "TEXT"; break; + case HTTPD_WS_TYPE_BINARY: type_str = "BINARY"; break; + case HTTPD_WS_TYPE_CLOSE: type_str = "CLOSE"; break; + case HTTPD_WS_TYPE_PING: type_str = "PING"; break; + case HTTPD_WS_TYPE_PONG: type_str = "PONG"; break; + } + + ESP_LOGI(TAG, "WS frame: type=%s, len=%d, final=%d", + type_str, ws_pkt->len, ws_pkt->final ? 1 : 0); +} + +// Call a Berry callback function registered by wsserver.on() +// CONTEXT: Main Tasmota Task (Berry VM Context) +// This function is only called from the main task when processing queued events +static void callBerryWsDispatcher(bvm *vm, int client_id, const char *event_name, const char *payload, int arg_count) { + if (!vm) { + ESP_LOGE(TAG, "Berry VM is NULL in callBerryWsDispatcher"); + return; + } + + // Ensure parameters are valid + if (client_id < 0 || client_id >= MAX_WS_CLIENTS || !event_name) { + ESP_LOGE(TAG, "Invalid parameters in callBerryWsDispatcher"); + return; + } + + ESP_LOGI(TAG, "Calling Berry callback for event '%s', client %d, payload: %s", + event_name, client_id, payload ? payload : "nil"); + + // Map event name to event type + int event_type = -1; + if (strcmp(event_name, "connect") == 0) { + event_type = WSSERVER_EVENT_CONNECT; + } else if (strcmp(event_name, "disconnect") == 0) { + event_type = WSSERVER_EVENT_DISCONNECT; + } else if (strcmp(event_name, "message") == 0) { + event_type = WSSERVER_EVENT_MESSAGE; + } else { + ESP_LOGE(TAG, "Unknown event type: %s", event_name); + return; + } + + // Check if we have a registered callback for this event type + if (!wsserver_callbacks[event_type].active) { + ESP_LOGI(TAG, "No callback registered for event type %d (%s)", event_type, event_name); + return; + } + + ESP_LOGI(TAG, "Using registered callback for event type %d (%s)", event_type, event_name); + + // Save initial stack position for diagnostic logging + int initial_top = be_top(vm); + ESP_LOGI(TAG, "Stack before function push: top=%d", initial_top); + + // Push the callback function onto the stack + bvalue *reg = vm->top; + var_setval(reg, &wsserver_callbacks[event_type].func); + be_incrtop(vm); + + ESP_LOGI(TAG, "Stack after function push: top=%d", be_top(vm)); + + // Push the client ID first, event name second, payload third (if applicable) + // This matches Berry function signature: function(client, event, message) + be_pushint(vm, client_id); // Push client ID argument + be_pushstring(vm, event_name); // Push event name argument + + // Push payload argument for message events (optional) + if (arg_count > 2 && payload) { + be_pushstring(vm, payload); + } + + // Log the arguments about to be passed + ESP_LOGI(TAG, "Stack after arg push: top=%d, with %d arguments", be_top(vm), arg_count); + + // Call the callback function with the appropriate number of arguments + int call_result = be_pcall(vm, arg_count); + + ESP_LOGI(TAG, "Stack after be_pcall: top=%d", be_top(vm)); + + // Handle the Berry call result + if (call_result != BE_OK) { + ESP_LOGE(TAG, "Berry callback error for event '%s': %s", + event_name, be_tostring(vm, -1)); + + be_error_pop_all(vm); + } else { + // Pop all arguments (including return value) + be_pop(vm, arg_count); + + ESP_LOGI(TAG, "Stack after arg pop: top=%d", be_top(vm)); + + // Pop the function separately + be_pop(vm, 1); + + ESP_LOGI(TAG, "Final stack after cleanup: top=%d", be_top(vm)); + } +} + +// Process a WebSocket message in the main task context +// CONTEXT: Main Tasmota Task (Berry VM Context) +// This function processes messages from the queue in the main task +void be_wsserver_handle_message(bvm *vm, int client_id, const char* data, size_t len) { + if (!data) { + // This is either a connect or disconnect event (no data) + // Determine event type based on client state + if (is_client_valid(client_id)) { + // Client exists and is active - this is a connect event + ESP_LOGI(TAG, "Handling WebSocket connect event in main task: client=%d", client_id); + callBerryWsDispatcher(vm, client_id, "connect", NULL, 2); + } else { + // Client no longer active - this is a disconnect event + ESP_LOGI(TAG, "Handling WebSocket disconnect event in main task: client=%d", client_id); + callBerryWsDispatcher(vm, client_id, "disconnect", NULL, 2); + + // Mark client as inactive after processing + if (client_id >= 0 && client_id < MAX_WS_CLIENTS) { + ws_clients[client_id].sockfd = -1; + ws_clients[client_id].active = false; + } + } + } else { + // Normal message event with data + ESP_LOGI(TAG, "Handling WebSocket message event in main task: client=%d, len=%d, data=%s", + client_id, (int)len, data); + callBerryWsDispatcher(vm, client_id, "message", data, 3); + } +} + +// WebSocket Event Handler +// CONTEXT: ESP-IDF HTTP Server Task +static esp_err_t ws_handler(httpd_req_t *req) { + if (req->method == HTTP_GET) { + // Handshake handling + ESP_LOGI(TAG, "WebSocket handshake received"); + int sockfd = httpd_req_to_sockfd(req); + int client_slot = add_client(sockfd); + + if (client_slot >= 0) { + ESP_LOGI(TAG, "Client %d connected, socket fd: %d", client_slot, sockfd); + + // Queue connect event for processing in main task + // TRANSITION: ESP-IDF HTTP Server Task → Main Tasmota Task + // Use NULL as data to indicate this is a connect event + if (httpserver_has_queue()) { + bool queue_result = httpserver_queue_message(HTTP_MSG_WEBSOCKET, client_slot, + NULL, 0, NULL); + + if (queue_result) { + ESP_LOGI(TAG, "WebSocket connect event successfully queued"); + } else { + ESP_LOGE(TAG, "Failed to queue WebSocket connect event!"); + } + } else { + ESP_LOGW(TAG, "No queue available for connect event - fallback to direct processing"); + // Fallback to direct processing (not recommended) + if (wsserver_callbacks[WSSERVER_EVENT_CONNECT].active) { + const char *event_name = "connect"; + callBerryWsDispatcher(wsserver_callbacks[WSSERVER_EVENT_CONNECT].vm, + client_slot, event_name, NULL, 2); + } + } + } + + // Return success for the handshake + return ESP_OK; + } + + ESP_LOGD(TAG, "WebSocket frame received"); + int sockfd = httpd_req_to_sockfd(req); + int client_slot = find_client_by_fd(sockfd); + + if (client_slot < 0) { + ESP_LOGE(TAG, "Received frame from unknown client (socket: %d)", sockfd); + return ESP_FAIL; + } + + // ----- PRE-PROCESSING: Frame Validation & Memory Allocation ----- + + // Update activity time for ANY frame + ws_clients[client_slot].last_activity = esp_timer_get_time() / 1000; + + // Standard ESP-IDF WebSocket frame reception + httpd_ws_frame_t ws_pkt = {0}; + uint8_t *buf = NULL; + + ws_pkt.type = HTTPD_WS_TYPE_TEXT; // Default type + + // Get the frame length + esp_err_t ret = httpd_ws_recv_frame(req, &ws_pkt, 0); + if (ret != ESP_OK) { + ESP_LOGE(TAG, "httpd_ws_recv_frame failed with %d", ret); + return ret; + } + + ESP_LOGD(TAG, "Frame len is %d, type is %d", ws_pkt.len, ws_pkt.type); + + // Handle control frames immediately without involving Berry VM + if (ws_pkt.type == HTTPD_WS_TYPE_PONG) { + ESP_LOGI(TAG, "Received PONG from client %d", client_slot); + return ESP_OK; + } + + if (ws_pkt.type == HTTPD_WS_TYPE_CLOSE) { + ESP_LOGI(TAG, "Received CLOSE from client %d", client_slot); + handle_client_disconnect(client_slot); + return ESP_OK; + } + + if (ws_pkt.type == HTTPD_WS_TYPE_PING) { + ESP_LOGI(TAG, "Received PING from client %d", client_slot); + httpd_ws_frame_t pong = {0}; + pong.type = HTTPD_WS_TYPE_PONG; + pong.len = 0; + ret = httpd_ws_send_frame(req, &pong); + if (ret != ESP_OK) { + ESP_LOGE(TAG, "Failed to send PONG: %d", ret); + } + return ESP_OK; + } + + // Not a control frame , so allocate memory for the message payload + if (ws_pkt.len) { + buf = calloc(1, ws_pkt.len + 1); + if (buf == NULL) { + ESP_LOGE(TAG, "Failed to allocate memory for WS message"); + return ESP_ERR_NO_MEM; + } + ws_pkt.payload = buf; + // Receive the actual message + ret = httpd_ws_recv_frame(req, &ws_pkt, ws_pkt.len); + if (ret != ESP_OK) { + ESP_LOGE(TAG, "httpd_ws_recv_frame failed with %d", ret); + free(buf); + return ret; + } + + // Ensure null-termination for text frames + if (ws_pkt.type == HTTPD_WS_TYPE_TEXT) { + buf[ws_pkt.len] = 0; + } + } else { + // Empty message, nothing to process + return ESP_OK; + } + + // Process message based on type + if (ws_pkt.type == HTTPD_WS_TYPE_TEXT) { + ESP_LOGI(TAG, "Received TEXT WebSocket message: '%s'", buf); + handle_ws_message(client_slot, (char*)buf, ws_pkt.len); + } else if (ws_pkt.type == HTTPD_WS_TYPE_BINARY) { + ESP_LOGI(TAG, "Received BINARY WebSocket message, len=%d", ws_pkt.len); + handle_ws_message(client_slot, (char*)buf, ws_pkt.len); + } + + // Free the data copy regardless of send result + free(buf); + + return ESP_OK; +} + +// Handle a WebSocket message from a client +void handle_ws_message(int client_id, const char *message, size_t len) { + if (!message || len == 0) { + ESP_LOGE(TAG, "Received empty message from client %d", client_id); + return; + } + + // Update activity timestamp + if (client_id >= 0 && client_id < MAX_WS_CLIENTS && ws_clients[client_id].active) { + ws_clients[client_id].last_activity = esp_timer_get_time() / 1000; + } + + // If queue available, send to main task for processing + if (httpserver_has_queue()) { + ESP_LOGD(TAG, "Queueing WebSocket message from client %d: '%.*s'", client_id, (int)len, message); + + // Make a copy of the message data for the queue + char *data_copy = malloc(len); + if (!data_copy) { + ESP_LOGE(TAG, "Failed to allocate memory for message copy"); + return; + } + + memcpy(data_copy, message, len); + + // Queue the message + if (!httpserver_queue_message(HTTP_MSG_WEBSOCKET, client_id, data_copy, len, NULL)) { + ESP_LOGE(TAG, "Failed to queue WebSocket message"); + free(data_copy); + } + } else { + // No queue available, process directly (not recommended but fallback) + ESP_LOGW(TAG, "Processing WebSocket message directly without queue - this may be unsafe"); + callBerryWsDispatcher(NULL, client_id, "message", message, 2); + } +} + +// Handle client disconnection +// CONTEXT: ESP-IDF HTTP Server Task +// Called when the server detects a client disconnection +static void handle_client_disconnect(int client_slot) { + if (!is_client_valid(client_slot)) { + return; + } + + ESP_LOGI(TAG, "Client %d disconnected", client_slot); + + // Queue disconnect event for processing in main task + // Use NULL as data to indicate this is a disconnect event + if (httpserver_has_queue()) { + // Save sockfd for later removal + int sockfd = ws_clients[client_slot].sockfd; + + // Mark client as inactive BEFORE queuing the event + // This ensures the event processor knows it's a disconnect event + ws_clients[client_slot].active = false; + + bool queue_result = httpserver_queue_message(HTTP_MSG_WEBSOCKET, client_slot, + NULL, 0, NULL); + + if (queue_result) { + ESP_LOGD(TAG, "WebSocket disconnect event successfully queued"); + } else { + ESP_LOGE(TAG, "Failed to queue WebSocket disconnect event!"); + + // Fallback to direct processing + if (wsserver_callbacks[WSSERVER_EVENT_DISCONNECT].active) { + const char *event_name = "disconnect"; + callBerryWsDispatcher(wsserver_callbacks[WSSERVER_EVENT_DISCONNECT].vm, + client_slot, event_name, NULL, 2); + } + + // Ensure cleanup happens if queue fails + ws_clients[client_slot].sockfd = -1; + } + } else { + ESP_LOGW(TAG, "No queue available for disconnect event - fallback to direct processing"); + + // Fallback to direct processing (not recommended) + if (wsserver_callbacks[WSSERVER_EVENT_DISCONNECT].active) { + const char *event_name = "disconnect"; + callBerryWsDispatcher(wsserver_callbacks[WSSERVER_EVENT_DISCONNECT].vm, + client_slot, event_name, NULL, 2); + } + + // Always clean up client slot + ws_clients[client_slot].sockfd = -1; + ws_clients[client_slot].active = false; + } +} + +// Timer callback for pinging clients +static void ws_ping_timer_callback(void* arg) { + // Skip if server is not running or pings disabled + if (!wsserver_running || !ws_server || ping_interval_s == 0) return; + + int64_t now = esp_timer_get_time(); + + for (int i = 0; i < MAX_WS_CLIENTS; i++) { + if (ws_clients[i].active) { + // Check for inactivity timeout if enabled + if (ping_timeout_s > 0) { + // Calculate inactivity time based on milliseconds + int64_t inactivity_s = ((now / 1000) - ws_clients[i].last_activity) / 1000; // now/1000 for ms, then /1000 for seconds + + if (inactivity_s > ping_timeout_s) { + ESP_LOGI(TAG, "Client %d timed out (inactive for %d seconds)", + i, (int)inactivity_s); + + // Trigger session close + handle_client_disconnect(i); + continue; + } + } + + // Send ping + httpd_ws_frame_t ping = {0}; + ping.type = HTTPD_WS_TYPE_PING; + + ESP_LOGI(TAG, "Sending PING to client %d", i); + esp_err_t ret = httpd_ws_send_frame_async(ws_server, ws_clients[i].sockfd, &ping); + + if (ret != ESP_OK) { + ESP_LOGE(TAG, "Failed to send PING to client %d: %d", i, ret); + + // Trigger session close + handle_client_disconnect(i); + } + } + } +} + +// Client Management Functions +static void init_clients(void) { + for (int i = 0; i < MAX_WS_CLIENTS; i++) { + ws_clients[i].active = false; + ws_clients[i].sockfd = -1; + } +} + +static int find_free_client_slot(void) { + for (int i = 0; i < MAX_WS_CLIENTS; i++) { + if (!ws_clients[i].active) { + return i; + } + } + return -1; // No free slots +} + +static int add_client(int sockfd) { + int slot = find_free_client_slot(); + if (slot >= 0) { + ws_clients[slot].sockfd = sockfd; + ws_clients[slot].active = true; + ws_clients[slot].last_activity = esp_timer_get_time() / 1000; + ESP_LOGI(TAG, "Added client %d with socket %d", slot, sockfd); + return slot; + } + ESP_LOGE(TAG, "No free client slots available"); + return -1; +} + +static int find_client_by_fd(int sockfd) { + for (int i = 0; i < MAX_WS_CLIENTS; i++) { + if (ws_clients[i].active && ws_clients[i].sockfd == sockfd) { + return i; + } + } + return -1; +} + +static void remove_client(int slot) { + if (slot >= 0 && slot < MAX_WS_CLIENTS) { + ESP_LOGI(TAG, "Removing client %d with socket %d", slot, ws_clients[slot].sockfd); + ws_clients[slot].active = false; + ws_clients[slot].sockfd = -1; + } +} + +// Check if a client is valid and connected +static bool is_client_valid(int client_id) { + // Check for valid client ID range + if (client_id < 0 || client_id >= MAX_WS_CLIENTS) { + ESP_LOGE(TAG, "Invalid client ID: %d", client_id); + return false; + } + + // Check if client is active and has a valid socket + if (!ws_clients[client_id].active || ws_clients[client_id].sockfd < 0) { + ESP_LOGE(TAG, "Client %d is not active (active=%d, sockfd=%d)", + client_id, ws_clients[client_id].active, ws_clients[client_id].sockfd); + return false; + } + + return true; +} + +// Berry Interface Functions +static int w_wsserver_start(bvm *vm) { + if (wsserver_running) { + ESP_LOGI(TAG, "WebSocket server already running"); + // Don't just return true - we should still update the path or other parameters + // if they've changed, but don't re-register the handlers + if (be_top(vm) >= 1 && be_isstring(vm, 1)) { + const char* path = be_tostring(vm, 1); + + // Get optional ping parameters + if (be_top(vm) >= 3 && be_isint(vm, 3)) { + ping_interval_s = be_toint(vm, 3); + ESP_LOGD(TAG, "Updated ping interval to %d seconds", ping_interval_s); + } + + if (be_top(vm) >= 4 && be_isint(vm, 4)) { + ping_timeout_s = be_toint(vm, 4); + ESP_LOGD(TAG, "Updated ping timeout to %d seconds", ping_timeout_s); + } + } + + be_pushbool(vm, true); + be_return (vm); + } + + ESP_LOGI(TAG, "Init WebSocket server"); + if (be_top(vm) >= 1 && be_isstring(vm, 1)) { + const char* path = be_tostring(vm, 1); + ESP_LOGI(TAG, "Starting WebSocket server on path '%s'", path); + + // Get optional http_handle parameter + bool use_existing_handle = false; + if (be_top(vm) >= 2) { + // First try as comptr + if (be_iscomptr(vm, 2)) { + void* http_handle = be_tocomptr(vm, 2); + use_existing_handle = true; + if (http_handle == NULL) { + ESP_LOGE(TAG, "HTTP server handle is NULL"); + be_pushbool(vm, false); + be_return (vm); + } + + // Assign to global ws_server variable after validating it's not NULL + ws_server = http_handle; + ESP_LOGD(TAG, "Using existing HTTP server handle (comptr): %p", ws_server); + } + // If not comptr, try to get httpd_handle_t from Berry externally + else { + // First log that we're attempting to get the handle + ESP_LOGD(TAG, "Attempting to retrieve HTTP server handle via be_httpserver_get_handle()"); + + // Try to get the handle from the HTTP server + httpd_handle_t handle = be_httpserver_get_handle(); + ESP_LOGD(TAG, "Got HTTP server handle: %p", handle); + if (handle) { + use_existing_handle = true; + ws_server = handle; + ESP_LOGD(TAG, "Using HTTP server handle from httpserver module: %p", ws_server); + } else { + ESP_LOGE(TAG, "HTTP server module returned NULL handle"); + } + } + } + + // Get optional ping_interval parameter (0 = disabled) + ping_interval_s = 5; // Default: 5 seconds + ping_timeout_s = 10; // Default: 10 seconds + + if (be_top(vm) >= 3 && be_isint(vm, 3)) { + ping_interval_s = be_toint(vm, 3); + + // Optional ping_timeout parameter + if (be_top(vm) >= 4 && be_isint(vm, 4)) { + ping_timeout_s = be_toint(vm, 4); + } + + ESP_LOGI(TAG, "WebSocket ping configured: interval=%ds, timeout=%ds", + ping_interval_s, ping_timeout_s); + } + + // Initialize the client array + init_clients(); + + // Handle HTTP server setup + if (use_existing_handle) { + // If using an existing handle, just register our disconnect handler + ESP_LOGI(TAG, "Using existing HTTP server, skipping server creation"); + ESP_LOGI(TAG, "Registering disconnect handler with existing server"); + be_httpserver_set_disconnect_handler(http_server_disconnect_handler); + } else { + // Create a new HTTP server + ESP_LOGI(TAG, "No HTTP server provided, creating a new one"); + // Configure and start the HTTP server + httpd_config_t config = HTTPD_DEFAULT_CONFIG(); + config.server_port = 8080; // Use a different port from Tasmota web server + config.max_open_sockets = MAX_WS_CLIENTS + 2; // +2 for admin connections + config.max_uri_handlers = 2; // For WebSocket and potential health check + config.lru_purge_enable = true; // Enable LRU connection purging + config.recv_wait_timeout = 10; // 10 seconds timeout for receiving + config.send_wait_timeout = 10; // 10 seconds timeout for sending + config.core_id = 1; // Run on second core for better performance isolation + + // Set disconnect handler + config.close_fn = http_server_disconnect_handler; + ESP_LOGD(TAG, "Registering disconnect handler for new WebSocket server"); + + ESP_LOGI(TAG, "Starting new HTTP server on port %d", config.server_port); + esp_err_t ret = httpd_start(&ws_server, &config); + if (ret != ESP_OK) { + ESP_LOGE(TAG, "Failed to start server: %d (0x%x)", ret, ret); + wsserver_running = false; + ws_server = NULL; + be_pushbool(vm, false); + be_return (vm); + } + ESP_LOGI(TAG, "New HTTP server started on port %d", config.server_port); + } + + // Register URI handler for WebSocket endpoint + httpd_uri_t ws_uri = { + .uri = path, + .method = HTTP_GET, + .handler = ws_handler, // Use the connect handler which properly registers clients + .user_ctx = NULL, + .is_websocket = true, + .handle_ws_control_frames = true // Allow ESP-IDF to properly handle control frames + }; + + ESP_LOGI(TAG, "Registering WebSocket handler for '%s'", path); + esp_err_t ret = httpd_register_uri_handler(ws_server, &ws_uri); + if (ret != ESP_OK) { + // Check if the error is just that the handler already exists + if (ret == ESP_ERR_HTTPD_HANDLER_EXISTS) { + ESP_LOGW(TAG, "WebSocket handler for '%s' already exists, continuing", path); + // This is actually OK, just continue + } else { + ESP_LOGE(TAG, "Failed to register URI handler: %d (0x%x)", ret, ret); + // Only stop the server if we created it + if (!use_existing_handle) { + httpd_stop(ws_server); + } else { + // When using an existing handle, we need to be careful not to nullify it + // since it's managed externally + ESP_LOGI(TAG, "Using existing HTTP server, not stopping it despite URI registration failure"); + } + wsserver_running = false; // Mark as not running + be_pushbool(vm, false); + be_return (vm); + } + } + + // Set up ping timer if enabled - direct conversion from seconds to microseconds + if (ping_interval_s > 0) { + ESP_LOGI(TAG, "Starting ping timer with interval %ds", ping_interval_s); + esp_timer_handle_t ping_timer = NULL; + esp_timer_create_args_t timer_args = { + .callback = ws_ping_timer_callback, + .name = "ws_ping" + }; + esp_timer_create(&timer_args, &ping_timer); + esp_timer_start_periodic(ping_timer, ping_interval_s * 1000000); // seconds to microseconds + } + + wsserver_running = true; + ESP_LOGI(TAG, "WebSocket server started successfully"); + be_pushbool(vm, true); + be_return (vm); + } + + ESP_LOGE(TAG, "Invalid path parameter"); + be_pushbool(vm, false); + be_return (vm); +} + +static int w_wsserver_client_info(bvm *vm) { + int initial_top = be_top(vm); // Save initial stack position for debugging + + ESP_LOGI(TAG, "client_info: Initial stack top: %d", initial_top); + + if (be_top(vm) >= 1 && be_isint(vm, 1)) { + int client_slot = be_toint(vm, 1); + + if (!is_client_valid(client_slot)) { + ESP_LOGE(TAG, "client_info: Invalid client %d, returning nil", client_slot); + be_pushnil(vm); + + // Check stack for consistency + int final_top = be_top(vm); + ESP_LOGI(TAG, "client_info: Invalid client path - Final stack: %d (expected %d)", + final_top, initial_top + 1); + be_return (vm); + } + + // Calculate time since last activity + int64_t now = esp_timer_get_time(); + int64_t inactive_time_ms = ((now / 1000) - ws_clients[client_slot].last_activity) / 1000; // convert to milliseconds + + // Create map with client info - this adds one item to the stack + be_newmap(vm); + int after_map_top = be_top(vm); + ESP_LOGI(TAG, "client_info: After map creation - Stack: %d", after_map_top); + + // Add client socket fd - Key + be_pushstring(vm, "socket"); + // Add client socket fd - Value + be_pushint(vm, ws_clients[client_slot].sockfd); + // Insert into map - consumes the key and value, leaving map on stack + be_data_insert(vm, -3); + // No need for explicit pop here as be_data_insert consumes key and value + + // Add last activity timestamp - Key + be_pushstring(vm, "last_activity"); + // Add last activity timestamp - Value + be_pushint(vm, (int)(ws_clients[client_slot].last_activity / 1000000)); // seconds + // Insert into map - consumes the key and value, leaving map on stack + be_data_insert(vm, -3); + // No need for explicit pop here as be_data_insert consumes key and value + + // Add inactivity duration - Key + be_pushstring(vm, "inactive_ms"); + // Add inactivity duration - Value + be_pushint(vm, (int)inactive_time_ms); + // Insert into map - consumes the key and value, leaving map on stack + be_data_insert(vm, -3); + // No need for explicit pop here as be_data_insert consumes key and value + + // At this point there should be exactly one item on the stack (the map) + // beyond what was there when we started + int final_top = be_top(vm); + ESP_LOGI(TAG, "client_info: Final stack: %d (expected %d)", final_top, initial_top + 1); + + // The map is already on the stack as our return value + be_return (vm); + } + + // If we reach here, either there were no parameters or the parameter was not an integer + ESP_LOGI(TAG, "client_info: Invalid parameters, returning nil"); + be_pushnil(vm); + + // Check stack for consistency + int final_top = be_top(vm); + ESP_LOGI(TAG, "client_info: Error path - Final stack: %d (expected %d)", + final_top, initial_top + 1); + be_return (vm); +} + +static int w_wsserver_count_clients(bvm *vm) { + int initial_top = be_top(vm); + ESP_LOGI(TAG, "wsserver_count_clients: Initial stack top: %d", initial_top); + + int count = 0; + for (int i = 0; i < MAX_WS_CLIENTS; i++) { + if (ws_clients[i].active) { + count++; + } + } + + be_pushint(vm, count); + + int final_top = be_top(vm); + ESP_LOGI(TAG, "wsserver_count_clients: Final stack: %d (expected %d), returning %d clients", + final_top, initial_top + 1, count); + be_return (vm); +} + +static int w_wsserver_send(bvm *vm) { + int initial_top = be_top(vm); + ESP_LOGI(TAG, "wsserver_send: Initial stack top: %d", initial_top); + + // First validate parameters + if (be_top(vm) < 2 || !be_isint(vm, 1)) { + ESP_LOGE(TAG, "Invalid parameters for send"); + be_pushbool(vm, false); + + int final_top = be_top(vm); + ESP_LOGI(TAG, "wsserver_send: Error path - Final stack: %d (expected %d)", + final_top, initial_top + 1); + be_return (vm); + } + + int client_slot = be_toint(vm, 1); + size_t len = 0; + const char* data = NULL; + uint8_t *data_copy = NULL; + + // First check if client is valid before processing the message + if (!is_client_valid(client_slot)) { + ESP_LOGE(TAG, "Invalid client ID: %d", client_slot); + be_pushbool(vm, false); + + int final_top = be_top(vm); + ESP_LOGI(TAG, "wsserver_send: Invalid client - Final stack: %d (expected %d)", + final_top, initial_top + 1); + be_return (vm); + } + + // Check if we're dealing with a string or bytes object + bool is_valid_data = false; + bool is_bytes = false; + + if (be_isstring(vm, 2)) { + is_valid_data = true; + } else if (be_isbytes(vm, 2)) { + is_valid_data = true; + is_bytes = true; + } + + if (!is_valid_data) { + ESP_LOGE(TAG, "Data must be a string or bytes object"); + be_pushbool(vm, false); + + int final_top = be_top(vm); + ESP_LOGI(TAG, "wsserver_send: Invalid data type - Final stack: %d (expected %d)", + final_top, initial_top + 1); + be_return (vm); + } + + // Get data and length based on type + if (is_bytes) { + // It's a bytes object - get raw length + data = be_tobytes(vm, 2, &len); + ESP_LOGI(TAG, "Got bytes object with length: %d", (int)len); + } else { + // For normal strings, get the length from Berry + len = be_strlen(vm, 2); + data = be_tostring(vm, 2); + ESP_LOGI(TAG, "Got string with length: %d", (int)len); + } + + if (len == 0 || data == NULL) { + ESP_LOGE(TAG, "Invalid data (empty or NULL)"); + be_pushbool(vm, false); + + int final_top = be_top(vm); + ESP_LOGI(TAG, "wsserver_send: Empty data - Final stack: %d (expected %d)", + final_top, initial_top + 1); + be_return (vm); + } + + // Check for optional binary flag parameter + bool is_binary = false; + if (be_top(vm) >= 3 && be_isbool(vm, 3)) { + is_binary = be_tobool(vm, 3); + } + + ESP_LOGI(TAG, "Sending %d bytes to client %d (type: %s)", + len, client_slot, is_binary ? "binary" : "text"); + + // Client was already checked at the start, but double check again for safety + if (!is_client_valid(client_slot)) { + ESP_LOGE(TAG, "Client ID %d became invalid during processing", client_slot); + be_pushbool(vm, false); + + int final_top = be_top(vm); + ESP_LOGI(TAG, "wsserver_send: Client became invalid - Final stack: %d (expected %d)", + final_top, initial_top + 1); + be_return (vm); + } + + httpd_ws_frame_t ws_pkt = {0}; + + // Create a copy of the data to ensure it remains valid during async operation + data_copy = (uint8_t *)malloc(len); + if (data_copy == NULL) { + ESP_LOGE(TAG, "Failed to allocate memory for data copy of size %d", len); + be_pushbool(vm, false); + + int final_top = be_top(vm); + ESP_LOGI(TAG, "wsserver_send: Memory allocation failed - Final stack: %d (expected %d)", + final_top, initial_top + 1); + be_return (vm); + } + + // Copy the data + memcpy(data_copy, data, len); + + ws_pkt.payload = data_copy; + ws_pkt.len = len; + ws_pkt.type = is_binary ? HTTPD_WS_TYPE_BINARY : HTTPD_WS_TYPE_TEXT; + ws_pkt.final = true; + ws_pkt.fragmented = false; + + // Get the client's socket + int sockfd = ws_clients[client_slot].sockfd; + + // Track last send attempt for this client + int64_t now = esp_timer_get_time(); + ws_clients[client_slot].last_activity = now; + + // Send the frame asynchronously + esp_err_t ret = httpd_ws_send_frame_async(ws_server, sockfd, &ws_pkt); + + // Free the data copy regardless of send result + free(data_copy); + + if (ret != ESP_OK) { + ESP_LOGE(TAG, "Failed to send message to client %d: %d (0x%x)", + client_slot, ret, ret); + + // Check if this is a fatal error indicating disconnection + if (ret == ESP_ERR_HTTPD_INVALID_REQ || ret == ESP_ERR_HTTPD_RESP_SEND) { + ESP_LOGE(TAG, "Fatal error sending to client %d, removing client", client_slot); + + // Trigger session close + handle_client_disconnect(client_slot); + } + + be_pushbool(vm, false); + + int final_top = be_top(vm); + ESP_LOGI(TAG, "wsserver_send: Send failed - Final stack: %d (expected %d)", + final_top, initial_top + 1); + be_return (vm); + } + + // Success! + ESP_LOGI(TAG, "Successfully sent message to client %d", client_slot); + be_pushbool(vm, true); + + int final_top = be_top(vm); + ESP_LOGI(TAG, "wsserver_send: Success - Final stack: %d (expected %d)", + final_top, initial_top + 1); + be_return (vm); +} + +static int w_wsserver_close(bvm *vm) { + if (be_top(vm) >= 1 && be_isint(vm, 1)) { + int client_slot = be_toint(vm, 1); + + ESP_LOGI(TAG, "Closing client %d", client_slot); + + if (!is_client_valid(client_slot)) { + ESP_LOGE(TAG, "Invalid client ID: %d", client_slot); + be_pushbool(vm, false); + be_return (vm); + } + + // Send a close frame + httpd_ws_frame_t ws_pkt = {0}; + ws_pkt.type = HTTPD_WS_TYPE_CLOSE; + ws_pkt.len = 0; + + int sockfd = ws_clients[client_slot].sockfd; + esp_err_t ret = httpd_ws_send_frame_async(ws_server, sockfd, &ws_pkt); + if (ret != ESP_OK) { + ESP_LOGE(TAG, "Failed to send close frame: %d", ret); + } + + // Trigger session close + handle_client_disconnect(client_slot); + + be_pushbool(vm, (ret == ESP_OK)); + be_return (vm); + } + + ESP_LOGE(TAG, "Invalid parameters for close"); + be_pushbool(vm, false); + be_return (vm); +} + +static int w_wsserver_on(bvm *vm) { + // Save initial stack position for balance checking + int initial_top = be_top(vm); + + ESP_LOGI(TAG, "[ON-STACK] Initial stack position: %d", initial_top); + + if (be_top(vm) >= 2 && be_isint(vm, 1) && + (be_isfunction(vm, 2) || be_isclosure(vm, 2))) { // Accept both function and closure types + + // Extract event type value (we'll need this in both phases) + int event_type = be_toint(vm, 1); + + // Validate event type early + if (event_type < 0 || event_type >= 3) { + ESP_LOGE(TAG, "[ON-ERROR] Invalid event type: %d", event_type); + be_pushbool(vm, false); + be_return (vm); + } + + // Log function type for debugging + const char *type_str = be_isfunction(vm, 2) ? "function" : "closure"; + ESP_LOGI(TAG, "[ON-STACK] Registering %s callback (type %d)", type_str, event_type); + + // Make a safe copy of the function value - CRITICAL for stack stability + bvalue func_copy = *be_indexof(vm, 2); + bool is_gc_obj = be_isgcobj(&func_copy); + + // If there's already an active callback, unmark it for GC first + if (wsserver_callbacks[event_type].active) { + if (be_isgcobj(&wsserver_callbacks[event_type].func)) { + ESP_LOGI(TAG, "[ON-GC] Unmarking existing callback for event %d", event_type); + be_gc_fix_set(vm, wsserver_callbacks[event_type].func.v.gc, bfalse); + } + } + + // Store the callback information in our global registry + wsserver_callbacks[event_type].vm = vm; + wsserver_callbacks[event_type].active = true; + wsserver_callbacks[event_type].func = func_copy; // Store our copied function + + // Protect function from garbage collection if needed + if (is_gc_obj) { + ESP_LOGI(TAG, "[ON-GC] Marking callback as protected from GC for event %d", event_type); + be_gc_fix_set(vm, func_copy.v.gc, btrue); + } + + // Log event information + const char* event_name = + event_type == WSSERVER_EVENT_CONNECT ? "connect" : + event_type == WSSERVER_EVENT_DISCONNECT ? "disconnect" : "message"; + + ESP_LOGI(TAG, "[ON-EVENT] Registered %s callback (event %d)", event_name, event_type); + + // Return success + be_pushbool(vm, true); + be_return (vm); + } + + ESP_LOGE(TAG, "[ON-ERROR] Invalid parameters for on"); + be_pushbool(vm, false); + be_return (vm); +} + +static int w_wsserver_is_connected(bvm *vm) { + int initial_top = be_top(vm); + ESP_LOGI(TAG, "wsserver_is_connected: Initial stack top: %d", initial_top); + + if (be_top(vm) >= 1 && be_isint(vm, 1)) { + int client_slot = be_toint(vm, 1); + bool valid = is_client_valid(client_slot); + ESP_LOGI(TAG, "Checking if client %d is connected: %s", client_slot, valid ? "yes" : "no"); + be_pushbool(vm, valid); + + int final_top = be_top(vm); + ESP_LOGI(TAG, "wsserver_is_connected: Success - Final stack: %d (expected %d)", + final_top, initial_top + 1); + be_return (vm); + } + + ESP_LOGE(TAG, "Invalid parameters for is_connected"); + be_pushbool(vm, false); + + int final_top = be_top(vm); + ESP_LOGI(TAG, "wsserver_is_connected: Invalid parameters - Final stack: %d (expected %d)", + final_top, initial_top + 1); + be_return (vm); +} + +static int w_wsserver_stop(bvm *vm) { + if (!wsserver_running) { + ESP_LOGI(TAG, "WebSocket server not running"); + be_pushbool(vm, true); + + int final_top = be_top(vm); + ESP_LOGI(TAG, "wsserver_stop: Server not running - Final stack: %d (expected %d)", + final_top, 1); + be_return (vm); + } + + ESP_LOGI(TAG, "Stopping WebSocket server"); + + // ---- PHASE 1: Prepare data and handle Berry resources ---- + // First clear callbacks to release GC holds + for (int i = 0; i < 3; i++) { + if (wsserver_callbacks[i].active) { + if (be_isgcobj(&wsserver_callbacks[i].func)) { + ESP_LOGI(TAG, "Unmarking callback for event %d from GC protection", i); + be_gc_fix_set(vm, wsserver_callbacks[i].func.v.gc, bfalse); + } + } + } + + // ---- PHASE 2: External system operations ---- + // Close all client connections + int client_count = 0; + for (int i = 0; i < MAX_WS_CLIENTS; i++) { + if (ws_clients[i].active) { + client_count++; + + // Send close frame + httpd_ws_frame_t ws_pkt = {0}; + ws_pkt.type = HTTPD_WS_TYPE_CLOSE; + ws_pkt.len = 0; + + ESP_LOGI(TAG, "Sending close frame to client %d (socket: %d)", + i, ws_clients[i].sockfd); + + httpd_ws_send_frame_async(ws_server, ws_clients[i].sockfd, &ws_pkt); + + // Trigger session close + handle_client_disconnect(i); + } + } + + // Log how many clients were closed + ESP_LOGI(TAG, "Closed connections to %d client(s)", client_count); + + // Stop HTTP server + ESP_LOGI(TAG, "Stopping HTTP server"); + esp_err_t ret = httpd_stop(ws_server); + if (ret != ESP_OK) { + ESP_LOGE(TAG, "Failed to stop server: %d (0x%x)", ret, ret); + } else { + ESP_LOGI(TAG, "HTTP server stopped successfully"); + } + + ws_server = NULL; + wsserver_running = false; + + be_pushbool(vm, (ret == ESP_OK)); + + int final_top = be_top(vm); + ESP_LOGI(TAG, "wsserver_stop: Final stack: %d (expected %d), success: %s", + final_top, 2, (ret == ESP_OK) ? "true" : "false"); + be_return (vm); +} + +// Deinitialize callbacks for VM shutdown +void be_wsserver_cb_deinit(bvm *vm) { + ESP_LOGI(TAG, "[DEINIT] Starting callback deinitialization for VM %p", vm); + + // Track all callbacks we're operating on + int count_active = 0; + int count_gc_protected = 0; + + // Clear all callbacks for this VM instance + for (int i = 0; i < 3; i++) { + if (wsserver_callbacks[i].vm == vm) { + const char* event_name = + i == WSSERVER_EVENT_CONNECT ? "connect" : + i == WSSERVER_EVENT_DISCONNECT ? "disconnect" : "message"; + + ESP_LOGI(TAG, "[DEINIT] Found active callback for event %d (%s)", i, event_name); + count_active++; + + // Check if it's GC protected + if (wsserver_callbacks[i].active && be_isgcobj(&wsserver_callbacks[i].func)) { + ESP_LOGI(TAG, "[DEINIT-GC] Callback for event %d is GC protected, unmarking", i); + count_gc_protected++; + + // Log the type of the function before unmarking + int func_type = wsserver_callbacks[i].func.type; + const char *type_str = + func_type == BE_FUNCTION ? "function" : + func_type == BE_CLOSURE ? "closure" : + func_type == BE_NTVCLOS ? "native_closure" : "other"; + ESP_LOGI(TAG, "[DEINIT-GC] Callback type: %s (%d)", type_str, func_type); + + // Unmark from garbage collection + be_gc_fix_set(vm, wsserver_callbacks[i].func.v.gc, bfalse); + ESP_LOGI(TAG, "[DEINIT-GC] Successfully unmarked callback for event %d", i); + } else if (wsserver_callbacks[i].active) { + ESP_LOGI(TAG, "[DEINIT-GC] Callback for event %d is not a GC object, no need to unmark", i); + } + + // Mark as inactive + wsserver_callbacks[i].active = false; + ESP_LOGI(TAG, "[DEINIT] Deactivated callback for event %d", i); + } + } + + ESP_LOGI(TAG, "[DEINIT] Completed callback deinitialization: %d active callbacks, %d GC protected", + count_active, count_gc_protected); +} + +// Handle disconnect event from the HTTP server +static void http_server_disconnect_handler(void* arg, int sockfd) { + ESP_LOGI(TAG, "HTTP server disconnect handler called for socket %d", sockfd); + + // Find the client slot for this socket + int client_slot = find_client_by_fd(sockfd); + if (client_slot < 0) { + ESP_LOGI(TAG, "No WebSocket client found for socket %d", sockfd); + return; + } + + ESP_LOGI(TAG, "Found WebSocket client %d for socket %d", client_slot, sockfd); + + // Queue disconnect event for processing in main task + if (httpserver_has_queue()) { + // Mark client as inactive BEFORE queuing the event + // This ensures the event processor knows it's a disconnect event + ws_clients[client_slot].active = false; + + bool queue_result = httpserver_queue_message(HTTP_MSG_WEBSOCKET, client_slot, + NULL, 0, NULL); + + if (queue_result) { + ESP_LOGI(TAG, "WebSocket disconnect event successfully queued from HTTP handler"); + } else { + ESP_LOGE(TAG, "Failed to queue WebSocket disconnect event from HTTP handler!"); + // Fallback to direct handling + handle_client_disconnect(client_slot); + } + } else { + ESP_LOGW(TAG, "No queue available for disconnect event - fallback to direct processing"); + handle_client_disconnect(client_slot); + } +} + +// Disconnect handler for httpd_register_uri_handler +esp_err_t websocket_disconnect_handler(httpd_handle_t hd, int sockfd) { + ESP_LOGI(TAG, "WebSocket disconnect handler called for socket %d", sockfd); + + int client_slot = find_client_by_fd(sockfd); + if (client_slot >= 0) { + // Call Berry disconnect callback directly + handle_client_disconnect(client_slot); + } + + return ESP_OK; +} + +// Module definition +/* @const_object_info_begin +module wsserver (scope: global, strings: weak) { + CONNECT, int(WSSERVER_EVENT_CONNECT) + DISCONNECT, int(WSSERVER_EVENT_DISCONNECT) + MESSAGE, int(WSSERVER_EVENT_MESSAGE) + + start, func(w_wsserver_start) + stop, func(w_wsserver_stop) + send, func(w_wsserver_send) + close, func(w_wsserver_close) + on, func(w_wsserver_on) + is_connected, func(w_wsserver_is_connected) + client_info, func(w_wsserver_client_info) + count_clients, func(w_wsserver_count_clients) + + // Constants for supported frame types + TEXT, int(HTTPD_WS_TYPE_TEXT) + BINARY, int(HTTPD_WS_TYPE_BINARY) + + // Constants for maximum clients + MAX_CLIENTS, int(MAX_WS_CLIENTS) +} +@const_object_info_end */ +#include "be_fixed_wsserver.h" + +#endif // USE_BERRY_WSSERVER diff --git a/lib/libesp32/berry_tasmota/src/embedded/leds.be b/lib/libesp32/berry_tasmota/src/embedded/leds.be index 3a17e047c..06d952652 100644 --- a/lib/libesp32/berry_tasmota/src/embedded/leds.be +++ b/lib/libesp32/berry_tasmota/src/embedded/leds.be @@ -158,18 +158,6 @@ class Leds : Leds_ntv def get_gamma() return self.gamma end - # def rotate_left(rot, first, last) - # self.call_native(20, rot, first, last) - # end - # def rotate_right(rot, first, last) - # self.call_native(21, rot, first, last) - # end - # def shift_left(rot, first, last) - # self.call_native(22, rot, first, last) - # end - # def shift_right(rot, first, last) - # self.call_native(22, rot, first, last) - # end # apply gamma and bri def to_gamma(rgb, bri) @@ -252,217 +240,6 @@ class Leds : Leds_ntv end - def create_matrix(w, h, offset) - offset = int(offset) - w = int(w) - h = int(h) - if offset == nil offset = 0 end - if w * h + offset > self.leds || h < 0 || w < 0 || offset < 0 - raise "value_error", "out of range" - end - - # inner class - class Leds_matrix - var strip - var offset - var h, w - var alternate # are rows in alternate mode (even/odd are reversed) - var pix_buffer - var pix_size - - def init(strip, w, h, offset) - self.strip = strip - self.offset = offset - self.h = h - self.w = w - self.alternate = false - - self.pix_buffer = self.strip.pixels_buffer() - self.pix_size = self.strip.pixel_size() - end - - def clear() - self.clear_to(0x000000) - self.show() - end - - def begin() - # do nothing, already being handled by physical strip - end - def show(force) - # don't trigger on segment, you will need to trigger on full strip instead - if bool(force) || (self.offset == 0 && self.w * self.h == self.strip.leds) - self.strip.show() - self.pix_buffer = self.strip.pixels_buffer(self.pix_buffer) # update buffer after show() - end - end - def can_show() - return self.strip.can_show() - end - def is_dirty() ## DEPRECATED - return self.strip.is_dirty() - end - def dirty() ## DEPRECATED - self.strip.dirty() - end - def pixels_buffer() - return self.strip.pixels_buffer() - end - def pixel_size() - return self.pix_size - end - def pixel_count() - return self.w * self.h - end - def pixel_offset() - return self.offset - end - def clear_to(col, bri) - if (bri == nil) bri = self.strip.bri end - self.strip.call_native(9, self.strip.to_gamma(col, bri), self.offset, self.w * self.h) - end - def set_pixel_color(idx, col, bri) - if (bri == nil) bri = self.strip.bri end - self.strip.set_pixel_color(idx + self.offset, col, bri) - end - def get_pixel_color(idx) - return self.strip.get_pixel_color(idx + self.offseta) - end - - # setbytes(row, bytes) - # sets the raw bytes for `row`, copying at most 3 or 4 x col bytes - def set_bytes(row, buf, offset, len) - var h_bytes = self.h * self.pix_size - if (len > h_bytes) len = h_bytes end - var offset_in_matrix = (self.offset + row) * h_bytes - self.pix_buffer.setbytes(offset_in_matrix, buf, offset, len) - end - - # Leds_matrix specific - def set_alternate(alt) - self.alternate = alt - end - def get_alternate() - return self.alternate - end - - def set_matrix_pixel_color(x, y, col, bri) - if (bri == nil) bri = self.strip.bri end - if self.alternate && (y & 0x1) - # reversed line - self.strip.set_pixel_color(x * self.w + self.h - y - 1 + self.offset, col, bri) - else - self.strip.set_pixel_color(x * self.w + y + self.offset, col, bri) - end - end - - def scroll(direction, outshift, inshift) # 0 - up, 1 - left, 2 - down, 3 - right ; outshift mandatory, inshift optional - var buf = self.pix_buffer - var h = self.h - var sz = self.w * 3 # row size in bytes - var pos - if direction%2 == 0 #up/down - if direction == 0 #up - outshift.setbytes(0,(buf[0..sz-1]).reverse(0,nil,3)) - var line = 0 - while line < (h-1) - pos = 0 - var offset_dst = line * sz - var offset_src = ((line+2) * sz) - 3 - while pos < sz - var dst = pos + offset_dst - var src = offset_src - pos - buf[dst] = buf[src] - buf[dst+1] = buf[src+1] - buf[dst+2] = buf[src+2] - pos += 3 - end - line += 1 - end - var lastline = inshift ? inshift : outshift - if h%2 == 1 - lastline.reverse(0,nil,3) - end - buf.setbytes((h-1) * sz, lastline) - else # down - outshift.setbytes(0,(buf[size(buf)-sz..]).reverse(0,nil,3)) - var line = h - 1 - while line > 0 - buf.setbytes(line * sz,(buf[(line-1) * sz..line * sz-1]).reverse(0,nil,3)) - line -= 1 - end - var lastline = inshift ? inshift : outshift - if h%2 == 1 - lastline.reverse(0,nil,3) - end - buf.setbytes(0, lastline) - end - else # left/right - var line = 0 - var step = 3 - if direction == 3 # right - step *= -1 - end - while line < h - pos = line * sz - if step > 0 - var line_end = pos + sz - step - outshift[(line * 3)] = buf[pos] - outshift[(line * 3) + 1] = buf[pos+1] - outshift[(line * 3) + 2] = buf[pos+2] - while pos < line_end - buf[pos] = buf[pos+3] - buf[pos+1] = buf[pos+4] - buf[pos+2] = buf[pos+5] - pos += step - end - if inshift == nil - buf[line_end] = outshift[(line * 3)] - buf[line_end+1] = outshift[(line * 3) + 1] - buf[line_end+2] = outshift[(line * 3) + 2] - else - buf[line_end] = inshift[(line * 3)] - buf[line_end+1] = inshift[(line * 3) + 1] - buf[line_end+2] = inshift[(line * 3) + 2] - end - else - var line_end = pos - pos = pos + sz + step - outshift[(line * 3)] = buf[pos] - outshift[(line * 3) + 1] = buf[pos+1] - outshift[(line * 3) + 2] = buf[pos+2] - while pos > line_end - buf[pos] = buf[pos-3] - buf[pos+1] = buf[pos-2] - buf[pos+2] = buf[pos-1] - pos += step - end - if inshift == nil - buf[line_end] = outshift[(line * 3)] - buf[line_end+1] = outshift[(line * 3) + 1] - buf[line_end+2] = outshift[(line * 3) + 2] - else - buf[line_end] = inshift[(line * 3)] - buf[line_end+1] = inshift[(line * 3) + 1] - buf[line_end+2] = inshift[(line * 3) + 2] - end - end - step *= -1 - line += 1 - end - end - end - end - - return Leds_matrix(self, w, h, offset) - - end - - static def matrix(w, h, gpio, rmt) - var strip = Leds(w * h, gpio, rmt) - var matrix = strip.create_matrix(w, h, 0) - return matrix - end end @@ -483,26 +260,3 @@ end anim() -# - -#- - -var s = Leds(25, gpio.pin(gpio.WS2812, 1)).create_matrix(5, 5) -s.set_alternate(true) -s.clear_to(0x400000) -s.show() -x = 0 -y = 0 - -def anim() - s.clear_to(0x400000) - s.set_matrix_pixel_color(x, y, 0x004000) - s.show() - y = (y + 1) % 5 - if y == 0 - x = (x + 1) % 5 - end - tasmota.set_timer(200, anim) -end -anim() - --# diff --git a/lib/libesp32/berry_tasmota/src/embedded/tapp.be b/lib/libesp32/berry_tasmota/src/embedded/tapp.be index 095d9ff2c..ddf123211 100644 --- a/lib/libesp32/berry_tasmota/src/embedded/tapp.be +++ b/lib/libesp32/berry_tasmota/src/embedded/tapp.be @@ -8,29 +8,34 @@ tapp_module.init = def (m) class Tapp + # we make sure the instance is registered as a driver to receive the "autoexec" event def init() tasmota.add_driver(self) end - def autoexec() + # Takes a list of files, and run any tapp file's autoexec.be + static def autoexec_dir(dir_name) import path import string - - var dir = path.listdir("/") - - for d: dir - if string.find(d, ".tapp") > 0 - tasmota.log(format("TAP: Loaded Tasmota App '%s'", d), 2) - tasmota.load(d + "#autoexec.be") + for d: path.listdir(dir_name) + if string.endswith(d, ".tapp") + log(f"TAP: Loaded Tasmota App '{dir_name}{d}'", 2) + tasmota.load(dir_name + d + "#autoexec.be") end end end + + # react to the "autoexec" event that is triggered at first tick when Berry starts + # Note: this is alled before the file "/autoexec.be" is loaded + # + # We run all `*.tapp` that are located in "/.extensions/" and in "/" in this order + def autoexec() + self.autoexec_dir("/.extensions/") + self.autoexec_dir("/") + end end return Tapp() # return an instance of this class end -# aa = autoconf_module.init(autoconf_module) -# import webserver -# webserver.on('/ac2', / -> aa.page_autoconf_mgr(), webserver.HTTP_GET) return tapp_module diff --git a/lib/libesp32/berry_tasmota/src/embedded/tasmota_class.be b/lib/libesp32/berry_tasmota/src/embedded/tasmota_class.be index ef15f2cc3..df6daf398 100644 --- a/lib/libesp32/berry_tasmota/src/embedded/tasmota_class.be +++ b/lib/libesp32/berry_tasmota/src/embedded/tasmota_class.be @@ -13,6 +13,7 @@ class Tasmota var _crons var _ccmd var _drivers + var _wnu # when_connected: list of closures to call when network is connected, or nil var wire1 var wire2 var cmd_res # store the command result, nil if disables, true if capture enabled, contains return value @@ -723,9 +724,45 @@ class Tasmota end end + # add a closure to the list to be called when network is connected + # or call immediately if network is already up + def when_network_up(cl) + self.check_not_method(cl) + var is_connected = tasmota.wifi()['up'] || tasmota.eth()['up'] + if is_connected + cl() # call closure + else + if (self._wnu == nil) + self._wnu = [ cl ] # create list + else + self._wnu.push(cl) # append to list + end + end + end + + # run all pending closures when network is up + def run_network_up() + if (self._wnu == nil) return end + var is_connected = tasmota.wifi()['up'] || tasmota.eth()['up'] + if is_connected + # run all closures in a safe loop + while (size(self._wnu) > 0) + var cl = self._wnu[0] + self._wnu.remove(0) # failsafe, remove first to avoid an infinite loop if call fails + try + cl() + except .. as e,m + print(format("BRY: Exception> run_network_up '%s' - %s", e, m)) + end + end + self._wnu = nil # all done, clear list + end + end + def event(event_type, cmd, idx, payload, raw) import introspect if event_type=='every_50ms' + if (self._wnu) self.run_network_up() end # capture when network becomes connected self.run_timers() end #- first run deferred events -# diff --git a/lib/libesp32/berry_tasmota/src/embedded/webserver_async.be b/lib/libesp32/berry_tasmota/src/embedded/webserver_async.be index cd819f25c..c5c97d027 100644 --- a/lib/libesp32/berry_tasmota/src/embedded/webserver_async.be +++ b/lib/libesp32/berry_tasmota/src/embedded/webserver_async.be @@ -238,7 +238,10 @@ class webserver_async # pre: self.buf_in is not empty # post: self.buf_in has made progress (smaller or '') def parse_http_req_line() - var m = global._re_http_srv.match2(self.buf_in, self.buf_in_offset) + import re + # print("parse_http_req_line", "self.buf_in=", self.buf_in) + var m = re.match2(self.server.re_http_srv, self.buf_in, self.buf_in_offset) + # print(f"{m=}") # Ex: "GET / HTTP/1.1\r\n" if m var offset = m[0] @@ -261,16 +264,18 @@ class webserver_async ############################################################# # parse incoming headers def parse_http_headers() + import re while true # print("parse_http_headers", "self.buf_in_offset=", self.buf_in_offset) - var m = global._re_http_srv_header.match2(self.buf_in, self.buf_in_offset) - # print("m=", m) + var m = re.match2(self.server.re_http_srv_header, self.buf_in, self.buf_in_offset) + # print(f"{m=}") # Ex: [32, 'Content-Type', 'application/json'] if m self.event_http_header(m[1], m[2]) self.buf_in_offset += m[0] else # no more headers - var m2 = global._re_http_srv_body.match2(self.buf_in, self.buf_in_offset) + var m2 = re.match2(self.server.re_http_srv_body, self.buf_in, self.buf_in_offset) + # print(f"{m2=}") if m2 # end of headers # we keep \r\n which is used by pattern @@ -519,9 +524,16 @@ class webserver_async var p1 # temporary object bytes() to avoid reallocation # static var TIMEOUT = 1000 # default timeout: 1000ms + + ############################################################# + # pre-compile REGEX + # # static var HTTP_REQ = "^(\\w+) (\\S+) HTTP\\/(\\d\\.\\d)\r\n" # static var HTTP_HEADER_REGEX = "([A-Za-z0-9-]+): (.*?)\r\n" # extract a header with its 2 parts # static var HTTP_BODY_REGEX = "\r\n" # end of headers + static var re_http_srv = re.compilebytes("^(\\w+) (\\S+) HTTP\\/(\\d\\.\\d)\r\n") + static var re_http_srv_header = re.compilebytes("([A-Za-z0-9-]+): (.*?)\r\n") + static var re_http_srv_body = re.compilebytes("\r\n") ############################################################# # init @@ -535,27 +547,12 @@ class webserver_async self.cors = false self.p1 = bytes(100) # reserve 100 bytes by default # TODO what about max_clients ? - self.compile_re() # register cb tasmota.add_driver(self) self.fastloop_cb = def () self.loop() end tasmota.add_fast_loop(self.fastloop_cb) end - ############################################################# - # compile once for all the regex - def compile_re() - import re - if !global.contains("_re_http_srv") - # global._re_http_srv = re.compile(self.HTTP_REQ) - # global._re_http_srv_header = re.compile(self.HTTP_HEADER_REGEX) - # global._re_http_srv_body = re.compile(self.HTTP_BODY_REGEX) - global._re_http_srv = re.compile("^(\\w+) (\\S+) HTTP\\/(\\d\\.\\d)\r\n") - global._re_http_srv_header = re.compile("([A-Za-z0-9-]+): (.*?)\r\n") - global._re_http_srv_body = re.compile("\r\n") - end - end - ############################################################# # enable or disable chunked mode (enabled by default) def set_chunked(chunked) diff --git a/lib/libesp32/berry_tasmota/src/solidify/solidified_leds.h b/lib/libesp32/berry_tasmota/src/solidify/solidified_leds.h index 2d94561e7..41a220eb8 100644 --- a/lib/libesp32/berry_tasmota/src/solidify/solidified_leds.h +++ b/lib/libesp32/berry_tasmota/src/solidify/solidified_leds.h @@ -4,8 +4,6 @@ \********************************************************************/ #include "be_constobj.h" extern const bclass be_class_Leds_segment; -extern const bclass be_class_Leds; -extern const bclass be_class_Leds_matrix; // compact class 'Leds_segment' ktab size: 16, total: 34 (saved 144 bytes) static const bvalue be_ktab_class_Leds_segment[16] = { /* K0 */ be_nested_str(offset), @@ -468,976 +466,43 @@ be_local_class(Leds_segment, })), (bstring*) &be_const_str_Leds_segment ); -// compact class 'Leds_matrix' ktab size: 28, total: 72 (saved 352 bytes) -static const bvalue be_ktab_class_Leds_matrix[28] = { - /* K0 */ be_nested_str(strip), - /* K1 */ be_nested_str(is_dirty), - /* K2 */ be_nested_str(dirty), - /* K3 */ be_nested_str(bri), - /* K4 */ be_nested_str(alternate), - /* K5 */ be_const_int(1), - /* K6 */ be_nested_str(set_pixel_color), - /* K7 */ be_nested_str(w), - /* K8 */ be_nested_str(h), - /* K9 */ be_nested_str(offset), - /* K10 */ be_nested_str(can_show), - /* K11 */ be_nested_str(pix_size), - /* K12 */ be_nested_str(pix_buffer), - /* K13 */ be_nested_str(setbytes), - /* K14 */ be_const_int(0), - /* K15 */ be_nested_str(leds), - /* K16 */ be_nested_str(show), - /* K17 */ be_nested_str(pixels_buffer), - /* K18 */ be_nested_str(get_pixel_color), - /* K19 */ be_nested_str(offseta), - /* K20 */ be_nested_str(call_native), - /* K21 */ be_nested_str(to_gamma), - /* K22 */ be_nested_str(pixel_size), - /* K23 */ be_nested_str(clear_to), - /* K24 */ be_const_int(3), - /* K25 */ be_const_int(2), - /* K26 */ be_nested_str(reverse), - /* K27 */ be_const_int(2147483647), -}; - - -extern const bclass be_class_Leds_matrix; - -/******************************************************************** -** Solidified function: is_dirty -********************************************************************/ -be_local_closure(class_Leds_matrix_is_dirty, /* name */ - be_nested_proto( - 3, /* nstack */ - 1, /* argc */ - 10, /* varg */ - 0, /* has upvals */ - NULL, /* no upvals */ - 0, /* has sup protos */ - NULL, /* no sub protos */ - 1, /* has constants */ - &be_ktab_class_Leds_matrix, /* shared constants */ - &be_const_str_is_dirty, - &be_const_str_solidified, - ( &(const binstruction[ 4]) { /* code */ - 0x88040100, // 0000 GETMBR R1 R0 K0 - 0x8C040301, // 0001 GETMET R1 R1 K1 - 0x7C040200, // 0002 CALL R1 1 - 0x80040200, // 0003 RET 1 R1 - }) - ) -); -/*******************************************************************/ - - -/******************************************************************** -** Solidified function: dirty -********************************************************************/ -be_local_closure(class_Leds_matrix_dirty, /* name */ - be_nested_proto( - 3, /* nstack */ - 1, /* argc */ - 10, /* varg */ - 0, /* has upvals */ - NULL, /* no upvals */ - 0, /* has sup protos */ - NULL, /* no sub protos */ - 1, /* has constants */ - &be_ktab_class_Leds_matrix, /* shared constants */ - &be_const_str_dirty, - &be_const_str_solidified, - ( &(const binstruction[ 4]) { /* code */ - 0x88040100, // 0000 GETMBR R1 R0 K0 - 0x8C040302, // 0001 GETMET R1 R1 K2 - 0x7C040200, // 0002 CALL R1 1 - 0x80000000, // 0003 RET 0 - }) - ) -); -/*******************************************************************/ - - -/******************************************************************** -** Solidified function: set_matrix_pixel_color -********************************************************************/ -be_local_closure(class_Leds_matrix_set_matrix_pixel_color, /* name */ - be_nested_proto( - 10, /* nstack */ - 5, /* argc */ - 10, /* varg */ - 0, /* has upvals */ - NULL, /* no upvals */ - 0, /* has sup protos */ - NULL, /* no sub protos */ - 1, /* has constants */ - &be_ktab_class_Leds_matrix, /* shared constants */ - &be_const_str_set_matrix_pixel_color, - &be_const_str_solidified, - ( &(const binstruction[34]) { /* code */ - 0x4C140000, // 0000 LDNIL R5 - 0x1C140805, // 0001 EQ R5 R4 R5 - 0x78160001, // 0002 JMPF R5 #0005 - 0x88140100, // 0003 GETMBR R5 R0 K0 - 0x88100B03, // 0004 GETMBR R4 R5 K3 - 0x88140104, // 0005 GETMBR R5 R0 K4 - 0x7816000F, // 0006 JMPF R5 #0017 - 0x2C140505, // 0007 AND R5 R2 K5 - 0x7816000D, // 0008 JMPF R5 #0017 - 0x88140100, // 0009 GETMBR R5 R0 K0 - 0x8C140B06, // 000A GETMET R5 R5 K6 - 0x881C0107, // 000B GETMBR R7 R0 K7 - 0x081C0207, // 000C MUL R7 R1 R7 - 0x88200108, // 000D GETMBR R8 R0 K8 - 0x001C0E08, // 000E ADD R7 R7 R8 - 0x041C0E02, // 000F SUB R7 R7 R2 - 0x041C0F05, // 0010 SUB R7 R7 K5 - 0x88200109, // 0011 GETMBR R8 R0 K9 - 0x001C0E08, // 0012 ADD R7 R7 R8 - 0x5C200600, // 0013 MOVE R8 R3 - 0x5C240800, // 0014 MOVE R9 R4 - 0x7C140800, // 0015 CALL R5 4 - 0x70020009, // 0016 JMP #0021 - 0x88140100, // 0017 GETMBR R5 R0 K0 - 0x8C140B06, // 0018 GETMET R5 R5 K6 - 0x881C0107, // 0019 GETMBR R7 R0 K7 - 0x081C0207, // 001A MUL R7 R1 R7 - 0x001C0E02, // 001B ADD R7 R7 R2 - 0x88200109, // 001C GETMBR R8 R0 K9 - 0x001C0E08, // 001D ADD R7 R7 R8 - 0x5C200600, // 001E MOVE R8 R3 - 0x5C240800, // 001F MOVE R9 R4 - 0x7C140800, // 0020 CALL R5 4 - 0x80000000, // 0021 RET 0 - }) - ) -); -/*******************************************************************/ - - -/******************************************************************** -** Solidified function: can_show -********************************************************************/ -be_local_closure(class_Leds_matrix_can_show, /* name */ - be_nested_proto( - 3, /* nstack */ - 1, /* argc */ - 10, /* varg */ - 0, /* has upvals */ - NULL, /* no upvals */ - 0, /* has sup protos */ - NULL, /* no sub protos */ - 1, /* has constants */ - &be_ktab_class_Leds_matrix, /* shared constants */ - &be_const_str_can_show, - &be_const_str_solidified, - ( &(const binstruction[ 4]) { /* code */ - 0x88040100, // 0000 GETMBR R1 R0 K0 - 0x8C04030A, // 0001 GETMET R1 R1 K10 - 0x7C040200, // 0002 CALL R1 1 - 0x80040200, // 0003 RET 1 R1 - }) - ) -); -/*******************************************************************/ - - -/******************************************************************** -** Solidified function: set_bytes -********************************************************************/ -be_local_closure(class_Leds_matrix_set_bytes, /* name */ - be_nested_proto( - 13, /* nstack */ - 5, /* argc */ - 10, /* varg */ - 0, /* has upvals */ - NULL, /* no upvals */ - 0, /* has sup protos */ - NULL, /* no sub protos */ - 1, /* has constants */ - &be_ktab_class_Leds_matrix, /* shared constants */ - &be_const_str_set_bytes, - &be_const_str_solidified, - ( &(const binstruction[17]) { /* code */ - 0x88140108, // 0000 GETMBR R5 R0 K8 - 0x8818010B, // 0001 GETMBR R6 R0 K11 - 0x08140A06, // 0002 MUL R5 R5 R6 - 0x24180805, // 0003 GT R6 R4 R5 - 0x781A0000, // 0004 JMPF R6 #0006 - 0x5C100A00, // 0005 MOVE R4 R5 - 0x88180109, // 0006 GETMBR R6 R0 K9 - 0x00180C01, // 0007 ADD R6 R6 R1 - 0x08180C05, // 0008 MUL R6 R6 R5 - 0x881C010C, // 0009 GETMBR R7 R0 K12 - 0x8C1C0F0D, // 000A GETMET R7 R7 K13 - 0x5C240C00, // 000B MOVE R9 R6 - 0x5C280400, // 000C MOVE R10 R2 - 0x5C2C0600, // 000D MOVE R11 R3 - 0x5C300800, // 000E MOVE R12 R4 - 0x7C1C0A00, // 000F CALL R7 5 - 0x80000000, // 0010 RET 0 - }) - ) -); -/*******************************************************************/ - - -/******************************************************************** -** Solidified function: show -********************************************************************/ -be_local_closure(class_Leds_matrix_show, /* name */ - be_nested_proto( - 5, /* nstack */ - 2, /* argc */ - 10, /* varg */ - 0, /* has upvals */ - NULL, /* no upvals */ - 0, /* has sup protos */ - NULL, /* no sub protos */ - 1, /* has constants */ - &be_ktab_class_Leds_matrix, /* shared constants */ - &be_const_str_show, - &be_const_str_solidified, - ( &(const binstruction[23]) { /* code */ - 0x60080017, // 0000 GETGBL R2 G23 - 0x5C0C0200, // 0001 MOVE R3 R1 - 0x7C080200, // 0002 CALL R2 1 - 0x740A0009, // 0003 JMPT R2 #000E - 0x88080109, // 0004 GETMBR R2 R0 K9 - 0x1C08050E, // 0005 EQ R2 R2 K14 - 0x780A000E, // 0006 JMPF R2 #0016 - 0x88080107, // 0007 GETMBR R2 R0 K7 - 0x880C0108, // 0008 GETMBR R3 R0 K8 - 0x08080403, // 0009 MUL R2 R2 R3 - 0x880C0100, // 000A GETMBR R3 R0 K0 - 0x880C070F, // 000B GETMBR R3 R3 K15 - 0x1C080403, // 000C EQ R2 R2 R3 - 0x780A0007, // 000D JMPF R2 #0016 - 0x88080100, // 000E GETMBR R2 R0 K0 - 0x8C080510, // 000F GETMET R2 R2 K16 - 0x7C080200, // 0010 CALL R2 1 - 0x88080100, // 0011 GETMBR R2 R0 K0 - 0x8C080511, // 0012 GETMET R2 R2 K17 - 0x8810010C, // 0013 GETMBR R4 R0 K12 - 0x7C080400, // 0014 CALL R2 2 - 0x90021802, // 0015 SETMBR R0 K12 R2 - 0x80000000, // 0016 RET 0 - }) - ) -); -/*******************************************************************/ - - -/******************************************************************** -** Solidified function: get_alternate -********************************************************************/ -be_local_closure(class_Leds_matrix_get_alternate, /* name */ - be_nested_proto( - 2, /* nstack */ - 1, /* argc */ - 10, /* varg */ - 0, /* has upvals */ - NULL, /* no upvals */ - 0, /* has sup protos */ - NULL, /* no sub protos */ - 1, /* has constants */ - &be_ktab_class_Leds_matrix, /* shared constants */ - &be_const_str_get_alternate, - &be_const_str_solidified, - ( &(const binstruction[ 2]) { /* code */ - 0x88040104, // 0000 GETMBR R1 R0 K4 - 0x80040200, // 0001 RET 1 R1 - }) - ) -); -/*******************************************************************/ - - -/******************************************************************** -** Solidified function: pixel_offset -********************************************************************/ -be_local_closure(class_Leds_matrix_pixel_offset, /* name */ - be_nested_proto( - 2, /* nstack */ - 1, /* argc */ - 10, /* varg */ - 0, /* has upvals */ - NULL, /* no upvals */ - 0, /* has sup protos */ - NULL, /* no sub protos */ - 1, /* has constants */ - &be_ktab_class_Leds_matrix, /* shared constants */ - &be_const_str_pixel_offset, - &be_const_str_solidified, - ( &(const binstruction[ 2]) { /* code */ - 0x88040109, // 0000 GETMBR R1 R0 K9 - 0x80040200, // 0001 RET 1 R1 - }) - ) -); -/*******************************************************************/ - - -/******************************************************************** -** Solidified function: get_pixel_color -********************************************************************/ -be_local_closure(class_Leds_matrix_get_pixel_color, /* name */ - be_nested_proto( - 5, /* nstack */ - 2, /* argc */ - 10, /* varg */ - 0, /* has upvals */ - NULL, /* no upvals */ - 0, /* has sup protos */ - NULL, /* no sub protos */ - 1, /* has constants */ - &be_ktab_class_Leds_matrix, /* shared constants */ - &be_const_str_get_pixel_color, - &be_const_str_solidified, - ( &(const binstruction[ 6]) { /* code */ - 0x88080100, // 0000 GETMBR R2 R0 K0 - 0x8C080512, // 0001 GETMET R2 R2 K18 - 0x88100113, // 0002 GETMBR R4 R0 K19 - 0x00100204, // 0003 ADD R4 R1 R4 - 0x7C080400, // 0004 CALL R2 2 - 0x80040400, // 0005 RET 1 R2 - }) - ) -); -/*******************************************************************/ - - -/******************************************************************** -** Solidified function: pixel_size -********************************************************************/ -be_local_closure(class_Leds_matrix_pixel_size, /* name */ - be_nested_proto( - 2, /* nstack */ - 1, /* argc */ - 10, /* varg */ - 0, /* has upvals */ - NULL, /* no upvals */ - 0, /* has sup protos */ - NULL, /* no sub protos */ - 1, /* has constants */ - &be_ktab_class_Leds_matrix, /* shared constants */ - &be_const_str_pixel_size, - &be_const_str_solidified, - ( &(const binstruction[ 2]) { /* code */ - 0x8804010B, // 0000 GETMBR R1 R0 K11 - 0x80040200, // 0001 RET 1 R1 - }) - ) -); -/*******************************************************************/ - - -/******************************************************************** -** Solidified function: clear_to -********************************************************************/ -be_local_closure(class_Leds_matrix_clear_to, /* name */ - be_nested_proto( - 10, /* nstack */ - 3, /* argc */ - 10, /* varg */ - 0, /* has upvals */ - NULL, /* no upvals */ - 0, /* has sup protos */ - NULL, /* no sub protos */ - 1, /* has constants */ - &be_ktab_class_Leds_matrix, /* shared constants */ - &be_const_str_clear_to, - &be_const_str_solidified, - ( &(const binstruction[19]) { /* code */ - 0x4C0C0000, // 0000 LDNIL R3 - 0x1C0C0403, // 0001 EQ R3 R2 R3 - 0x780E0001, // 0002 JMPF R3 #0005 - 0x880C0100, // 0003 GETMBR R3 R0 K0 - 0x88080703, // 0004 GETMBR R2 R3 K3 - 0x880C0100, // 0005 GETMBR R3 R0 K0 - 0x8C0C0714, // 0006 GETMET R3 R3 K20 - 0x54160008, // 0007 LDINT R5 9 - 0x88180100, // 0008 GETMBR R6 R0 K0 - 0x8C180D15, // 0009 GETMET R6 R6 K21 - 0x5C200200, // 000A MOVE R8 R1 - 0x5C240400, // 000B MOVE R9 R2 - 0x7C180600, // 000C CALL R6 3 - 0x881C0109, // 000D GETMBR R7 R0 K9 - 0x88200107, // 000E GETMBR R8 R0 K7 - 0x88240108, // 000F GETMBR R9 R0 K8 - 0x08201009, // 0010 MUL R8 R8 R9 - 0x7C0C0A00, // 0011 CALL R3 5 - 0x80000000, // 0012 RET 0 - }) - ) -); -/*******************************************************************/ - - -/******************************************************************** -** Solidified function: begin -********************************************************************/ -be_local_closure(class_Leds_matrix_begin, /* name */ - be_nested_proto( - 1, /* nstack */ - 1, /* argc */ - 10, /* varg */ - 0, /* has upvals */ - NULL, /* no upvals */ - 0, /* has sup protos */ - NULL, /* no sub protos */ - 1, /* has constants */ - &be_ktab_class_Leds_matrix, /* shared constants */ - &be_const_str_begin, - &be_const_str_solidified, - ( &(const binstruction[ 1]) { /* code */ - 0x80000000, // 0000 RET 0 - }) - ) -); -/*******************************************************************/ - - -/******************************************************************** -** Solidified function: set_alternate -********************************************************************/ -be_local_closure(class_Leds_matrix_set_alternate, /* name */ - be_nested_proto( - 2, /* nstack */ - 2, /* argc */ - 10, /* varg */ - 0, /* has upvals */ - NULL, /* no upvals */ - 0, /* has sup protos */ - NULL, /* no sub protos */ - 1, /* has constants */ - &be_ktab_class_Leds_matrix, /* shared constants */ - &be_const_str_set_alternate, - &be_const_str_solidified, - ( &(const binstruction[ 2]) { /* code */ - 0x90020801, // 0000 SETMBR R0 K4 R1 - 0x80000000, // 0001 RET 0 - }) - ) -); -/*******************************************************************/ - - -/******************************************************************** -** Solidified function: init -********************************************************************/ -be_local_closure(class_Leds_matrix_init, /* name */ - be_nested_proto( - 7, /* nstack */ - 5, /* argc */ - 10, /* varg */ - 0, /* has upvals */ - NULL, /* no upvals */ - 0, /* has sup protos */ - NULL, /* no sub protos */ - 1, /* has constants */ - &be_ktab_class_Leds_matrix, /* shared constants */ - &be_const_str_init, - &be_const_str_solidified, - ( &(const binstruction[15]) { /* code */ - 0x90020001, // 0000 SETMBR R0 K0 R1 - 0x90021204, // 0001 SETMBR R0 K9 R4 - 0x90021003, // 0002 SETMBR R0 K8 R3 - 0x90020E02, // 0003 SETMBR R0 K7 R2 - 0x50140000, // 0004 LDBOOL R5 0 0 - 0x90020805, // 0005 SETMBR R0 K4 R5 - 0x88140100, // 0006 GETMBR R5 R0 K0 - 0x8C140B11, // 0007 GETMET R5 R5 K17 - 0x7C140200, // 0008 CALL R5 1 - 0x90021805, // 0009 SETMBR R0 K12 R5 - 0x88140100, // 000A GETMBR R5 R0 K0 - 0x8C140B16, // 000B GETMET R5 R5 K22 - 0x7C140200, // 000C CALL R5 1 - 0x90021605, // 000D SETMBR R0 K11 R5 - 0x80000000, // 000E RET 0 - }) - ) -); -/*******************************************************************/ - - -/******************************************************************** -** Solidified function: clear -********************************************************************/ -be_local_closure(class_Leds_matrix_clear, /* name */ - be_nested_proto( - 4, /* nstack */ - 1, /* argc */ - 10, /* varg */ - 0, /* has upvals */ - NULL, /* no upvals */ - 0, /* has sup protos */ - NULL, /* no sub protos */ - 1, /* has constants */ - &be_ktab_class_Leds_matrix, /* shared constants */ - &be_const_str_clear, - &be_const_str_solidified, - ( &(const binstruction[ 6]) { /* code */ - 0x8C040117, // 0000 GETMET R1 R0 K23 - 0x580C000E, // 0001 LDCONST R3 K14 - 0x7C040400, // 0002 CALL R1 2 - 0x8C040110, // 0003 GETMET R1 R0 K16 - 0x7C040200, // 0004 CALL R1 1 - 0x80000000, // 0005 RET 0 - }) - ) -); -/*******************************************************************/ - - -/******************************************************************** -** Solidified function: scroll -********************************************************************/ -be_local_closure(class_Leds_matrix_scroll, /* name */ - be_nested_proto( - 17, /* nstack */ - 4, /* argc */ - 10, /* varg */ - 0, /* has upvals */ - NULL, /* no upvals */ - 0, /* has sup protos */ - NULL, /* no sub protos */ - 1, /* has constants */ - &be_ktab_class_Leds_matrix, /* shared constants */ - &be_const_str_scroll, - &be_const_str_solidified, - ( &(const binstruction[258]) { /* code */ - 0x8810010C, // 0000 GETMBR R4 R0 K12 - 0x88140108, // 0001 GETMBR R5 R0 K8 - 0x88180107, // 0002 GETMBR R6 R0 K7 - 0x08180D18, // 0003 MUL R6 R6 K24 - 0x4C1C0000, // 0004 LDNIL R7 - 0x10200319, // 0005 MOD R8 R1 K25 - 0x1C20110E, // 0006 EQ R8 R8 K14 - 0x7822006B, // 0007 JMPF R8 #0074 - 0x1C20030E, // 0008 EQ R8 R1 K14 - 0x78220037, // 0009 JMPF R8 #0042 - 0x8C20050D, // 000A GETMET R8 R2 K13 - 0x5828000E, // 000B LDCONST R10 K14 - 0x042C0D05, // 000C SUB R11 R6 K5 - 0x402E1C0B, // 000D CONNECT R11 K14 R11 - 0x942C080B, // 000E GETIDX R11 R4 R11 - 0x8C2C171A, // 000F GETMET R11 R11 K26 - 0x5834000E, // 0010 LDCONST R13 K14 - 0x4C380000, // 0011 LDNIL R14 - 0x583C0018, // 0012 LDCONST R15 K24 - 0x7C2C0800, // 0013 CALL R11 4 - 0x7C200600, // 0014 CALL R8 3 - 0x5820000E, // 0015 LDCONST R8 K14 - 0x04240B05, // 0016 SUB R9 R5 K5 - 0x14241009, // 0017 LT R9 R8 R9 - 0x78260016, // 0018 JMPF R9 #0030 - 0x581C000E, // 0019 LDCONST R7 K14 - 0x08241006, // 001A MUL R9 R8 R6 - 0x00281119, // 001B ADD R10 R8 K25 - 0x08281406, // 001C MUL R10 R10 R6 - 0x04281518, // 001D SUB R10 R10 K24 - 0x142C0E06, // 001E LT R11 R7 R6 - 0x782E000D, // 001F JMPF R11 #002E - 0x002C0E09, // 0020 ADD R11 R7 R9 - 0x04301407, // 0021 SUB R12 R10 R7 - 0x9434080C, // 0022 GETIDX R13 R4 R12 - 0x9810160D, // 0023 SETIDX R4 R11 R13 - 0x00341705, // 0024 ADD R13 R11 K5 - 0x00381905, // 0025 ADD R14 R12 K5 - 0x9438080E, // 0026 GETIDX R14 R4 R14 - 0x98101A0E, // 0027 SETIDX R4 R13 R14 - 0x00341719, // 0028 ADD R13 R11 K25 - 0x00381919, // 0029 ADD R14 R12 K25 - 0x9438080E, // 002A GETIDX R14 R4 R14 - 0x98101A0E, // 002B SETIDX R4 R13 R14 - 0x001C0F18, // 002C ADD R7 R7 K24 - 0x7001FFEF, // 002D JMP #001E - 0x00201105, // 002E ADD R8 R8 K5 - 0x7001FFE5, // 002F JMP #0016 - 0x780E0001, // 0030 JMPF R3 #0033 - 0x5C240600, // 0031 MOVE R9 R3 - 0x70020000, // 0032 JMP #0034 - 0x5C240400, // 0033 MOVE R9 R2 - 0x10280B19, // 0034 MOD R10 R5 K25 - 0x1C281505, // 0035 EQ R10 R10 K5 - 0x782A0004, // 0036 JMPF R10 #003C - 0x8C28131A, // 0037 GETMET R10 R9 K26 - 0x5830000E, // 0038 LDCONST R12 K14 - 0x4C340000, // 0039 LDNIL R13 - 0x58380018, // 003A LDCONST R14 K24 - 0x7C280800, // 003B CALL R10 4 - 0x8C28090D, // 003C GETMET R10 R4 K13 - 0x04300B05, // 003D SUB R12 R5 K5 - 0x08301806, // 003E MUL R12 R12 R6 - 0x5C341200, // 003F MOVE R13 R9 - 0x7C280600, // 0040 CALL R10 3 - 0x70020030, // 0041 JMP #0073 - 0x8C20050D, // 0042 GETMET R8 R2 K13 - 0x5828000E, // 0043 LDCONST R10 K14 - 0x602C000C, // 0044 GETGBL R11 G12 - 0x5C300800, // 0045 MOVE R12 R4 - 0x7C2C0200, // 0046 CALL R11 1 - 0x042C1606, // 0047 SUB R11 R11 R6 - 0x402C171B, // 0048 CONNECT R11 R11 K27 - 0x942C080B, // 0049 GETIDX R11 R4 R11 - 0x8C2C171A, // 004A GETMET R11 R11 K26 - 0x5834000E, // 004B LDCONST R13 K14 - 0x4C380000, // 004C LDNIL R14 - 0x583C0018, // 004D LDCONST R15 K24 - 0x7C2C0800, // 004E CALL R11 4 - 0x7C200600, // 004F CALL R8 3 - 0x04200B05, // 0050 SUB R8 R5 K5 - 0x2424110E, // 0051 GT R9 R8 K14 - 0x7826000F, // 0052 JMPF R9 #0063 - 0x8C24090D, // 0053 GETMET R9 R4 K13 - 0x082C1006, // 0054 MUL R11 R8 R6 - 0x04301105, // 0055 SUB R12 R8 K5 - 0x08301806, // 0056 MUL R12 R12 R6 - 0x08341006, // 0057 MUL R13 R8 R6 - 0x04341B05, // 0058 SUB R13 R13 K5 - 0x4030180D, // 0059 CONNECT R12 R12 R13 - 0x9430080C, // 005A GETIDX R12 R4 R12 - 0x8C30191A, // 005B GETMET R12 R12 K26 - 0x5838000E, // 005C LDCONST R14 K14 - 0x4C3C0000, // 005D LDNIL R15 - 0x58400018, // 005E LDCONST R16 K24 - 0x7C300800, // 005F CALL R12 4 - 0x7C240600, // 0060 CALL R9 3 - 0x04201105, // 0061 SUB R8 R8 K5 - 0x7001FFED, // 0062 JMP #0051 - 0x780E0001, // 0063 JMPF R3 #0066 - 0x5C240600, // 0064 MOVE R9 R3 - 0x70020000, // 0065 JMP #0067 - 0x5C240400, // 0066 MOVE R9 R2 - 0x10280B19, // 0067 MOD R10 R5 K25 - 0x1C281505, // 0068 EQ R10 R10 K5 - 0x782A0004, // 0069 JMPF R10 #006F - 0x8C28131A, // 006A GETMET R10 R9 K26 - 0x5830000E, // 006B LDCONST R12 K14 - 0x4C340000, // 006C LDNIL R13 - 0x58380018, // 006D LDCONST R14 K24 - 0x7C280800, // 006E CALL R10 4 - 0x8C28090D, // 006F GETMET R10 R4 K13 - 0x5830000E, // 0070 LDCONST R12 K14 - 0x5C341200, // 0071 MOVE R13 R9 - 0x7C280600, // 0072 CALL R10 3 - 0x7002008C, // 0073 JMP #0101 - 0x5820000E, // 0074 LDCONST R8 K14 - 0x58240018, // 0075 LDCONST R9 K24 - 0x1C280318, // 0076 EQ R10 R1 K24 - 0x782A0001, // 0077 JMPF R10 #007A - 0x5429FFFE, // 0078 LDINT R10 -1 - 0x0824120A, // 0079 MUL R9 R9 R10 - 0x14281005, // 007A LT R10 R8 R5 - 0x782A0084, // 007B JMPF R10 #0101 - 0x08281006, // 007C MUL R10 R8 R6 - 0x5C1C1400, // 007D MOVE R7 R10 - 0x2428130E, // 007E GT R10 R9 K14 - 0x782A003E, // 007F JMPF R10 #00BF - 0x00280E06, // 0080 ADD R10 R7 R6 - 0x04281409, // 0081 SUB R10 R10 R9 - 0x082C1118, // 0082 MUL R11 R8 K24 - 0x94300807, // 0083 GETIDX R12 R4 R7 - 0x9808160C, // 0084 SETIDX R2 R11 R12 - 0x082C1118, // 0085 MUL R11 R8 K24 - 0x002C1705, // 0086 ADD R11 R11 K5 - 0x00300F05, // 0087 ADD R12 R7 K5 - 0x9430080C, // 0088 GETIDX R12 R4 R12 - 0x9808160C, // 0089 SETIDX R2 R11 R12 - 0x082C1118, // 008A MUL R11 R8 K24 - 0x002C1719, // 008B ADD R11 R11 K25 - 0x00300F19, // 008C ADD R12 R7 K25 - 0x9430080C, // 008D GETIDX R12 R4 R12 - 0x9808160C, // 008E SETIDX R2 R11 R12 - 0x142C0E0A, // 008F LT R11 R7 R10 - 0x782E000E, // 0090 JMPF R11 #00A0 - 0x002C0F18, // 0091 ADD R11 R7 K24 - 0x942C080B, // 0092 GETIDX R11 R4 R11 - 0x98100E0B, // 0093 SETIDX R4 R7 R11 - 0x002C0F05, // 0094 ADD R11 R7 K5 - 0x54320003, // 0095 LDINT R12 4 - 0x00300E0C, // 0096 ADD R12 R7 R12 - 0x9430080C, // 0097 GETIDX R12 R4 R12 - 0x9810160C, // 0098 SETIDX R4 R11 R12 - 0x002C0F19, // 0099 ADD R11 R7 K25 - 0x54320004, // 009A LDINT R12 5 - 0x00300E0C, // 009B ADD R12 R7 R12 - 0x9430080C, // 009C GETIDX R12 R4 R12 - 0x9810160C, // 009D SETIDX R4 R11 R12 - 0x001C0E09, // 009E ADD R7 R7 R9 - 0x7001FFEE, // 009F JMP #008F - 0x4C2C0000, // 00A0 LDNIL R11 - 0x1C2C060B, // 00A1 EQ R11 R3 R11 - 0x782E000D, // 00A2 JMPF R11 #00B1 - 0x082C1118, // 00A3 MUL R11 R8 K24 - 0x942C040B, // 00A4 GETIDX R11 R2 R11 - 0x9810140B, // 00A5 SETIDX R4 R10 R11 - 0x002C1505, // 00A6 ADD R11 R10 K5 - 0x08301118, // 00A7 MUL R12 R8 K24 - 0x00301905, // 00A8 ADD R12 R12 K5 - 0x9430040C, // 00A9 GETIDX R12 R2 R12 - 0x9810160C, // 00AA SETIDX R4 R11 R12 - 0x002C1519, // 00AB ADD R11 R10 K25 - 0x08301118, // 00AC MUL R12 R8 K24 - 0x00301919, // 00AD ADD R12 R12 K25 - 0x9430040C, // 00AE GETIDX R12 R2 R12 - 0x9810160C, // 00AF SETIDX R4 R11 R12 - 0x7002000C, // 00B0 JMP #00BE - 0x082C1118, // 00B1 MUL R11 R8 K24 - 0x942C060B, // 00B2 GETIDX R11 R3 R11 - 0x9810140B, // 00B3 SETIDX R4 R10 R11 - 0x002C1505, // 00B4 ADD R11 R10 K5 - 0x08301118, // 00B5 MUL R12 R8 K24 - 0x00301905, // 00B6 ADD R12 R12 K5 - 0x9430060C, // 00B7 GETIDX R12 R3 R12 - 0x9810160C, // 00B8 SETIDX R4 R11 R12 - 0x002C1519, // 00B9 ADD R11 R10 K25 - 0x08301118, // 00BA MUL R12 R8 K24 - 0x00301919, // 00BB ADD R12 R12 K25 - 0x9430060C, // 00BC GETIDX R12 R3 R12 - 0x9810160C, // 00BD SETIDX R4 R11 R12 - 0x7002003D, // 00BE JMP #00FD - 0x5C280E00, // 00BF MOVE R10 R7 - 0x002C0E06, // 00C0 ADD R11 R7 R6 - 0x002C1609, // 00C1 ADD R11 R11 R9 - 0x5C1C1600, // 00C2 MOVE R7 R11 - 0x082C1118, // 00C3 MUL R11 R8 K24 - 0x94300807, // 00C4 GETIDX R12 R4 R7 - 0x9808160C, // 00C5 SETIDX R2 R11 R12 - 0x082C1118, // 00C6 MUL R11 R8 K24 - 0x002C1705, // 00C7 ADD R11 R11 K5 - 0x00300F05, // 00C8 ADD R12 R7 K5 - 0x9430080C, // 00C9 GETIDX R12 R4 R12 - 0x9808160C, // 00CA SETIDX R2 R11 R12 - 0x082C1118, // 00CB MUL R11 R8 K24 - 0x002C1719, // 00CC ADD R11 R11 K25 - 0x00300F19, // 00CD ADD R12 R7 K25 - 0x9430080C, // 00CE GETIDX R12 R4 R12 - 0x9808160C, // 00CF SETIDX R2 R11 R12 - 0x242C0E0A, // 00D0 GT R11 R7 R10 - 0x782E000C, // 00D1 JMPF R11 #00DF - 0x042C0F18, // 00D2 SUB R11 R7 K24 - 0x942C080B, // 00D3 GETIDX R11 R4 R11 - 0x98100E0B, // 00D4 SETIDX R4 R7 R11 - 0x002C0F05, // 00D5 ADD R11 R7 K5 - 0x04300F19, // 00D6 SUB R12 R7 K25 - 0x9430080C, // 00D7 GETIDX R12 R4 R12 - 0x9810160C, // 00D8 SETIDX R4 R11 R12 - 0x002C0F19, // 00D9 ADD R11 R7 K25 - 0x04300F05, // 00DA SUB R12 R7 K5 - 0x9430080C, // 00DB GETIDX R12 R4 R12 - 0x9810160C, // 00DC SETIDX R4 R11 R12 - 0x001C0E09, // 00DD ADD R7 R7 R9 - 0x7001FFF0, // 00DE JMP #00D0 - 0x4C2C0000, // 00DF LDNIL R11 - 0x1C2C060B, // 00E0 EQ R11 R3 R11 - 0x782E000D, // 00E1 JMPF R11 #00F0 - 0x082C1118, // 00E2 MUL R11 R8 K24 - 0x942C040B, // 00E3 GETIDX R11 R2 R11 - 0x9810140B, // 00E4 SETIDX R4 R10 R11 - 0x002C1505, // 00E5 ADD R11 R10 K5 - 0x08301118, // 00E6 MUL R12 R8 K24 - 0x00301905, // 00E7 ADD R12 R12 K5 - 0x9430040C, // 00E8 GETIDX R12 R2 R12 - 0x9810160C, // 00E9 SETIDX R4 R11 R12 - 0x002C1519, // 00EA ADD R11 R10 K25 - 0x08301118, // 00EB MUL R12 R8 K24 - 0x00301919, // 00EC ADD R12 R12 K25 - 0x9430040C, // 00ED GETIDX R12 R2 R12 - 0x9810160C, // 00EE SETIDX R4 R11 R12 - 0x7002000C, // 00EF JMP #00FD - 0x082C1118, // 00F0 MUL R11 R8 K24 - 0x942C060B, // 00F1 GETIDX R11 R3 R11 - 0x9810140B, // 00F2 SETIDX R4 R10 R11 - 0x002C1505, // 00F3 ADD R11 R10 K5 - 0x08301118, // 00F4 MUL R12 R8 K24 - 0x00301905, // 00F5 ADD R12 R12 K5 - 0x9430060C, // 00F6 GETIDX R12 R3 R12 - 0x9810160C, // 00F7 SETIDX R4 R11 R12 - 0x002C1519, // 00F8 ADD R11 R10 K25 - 0x08301118, // 00F9 MUL R12 R8 K24 - 0x00301919, // 00FA ADD R12 R12 K25 - 0x9430060C, // 00FB GETIDX R12 R3 R12 - 0x9810160C, // 00FC SETIDX R4 R11 R12 - 0x5429FFFE, // 00FD LDINT R10 -1 - 0x0824120A, // 00FE MUL R9 R9 R10 - 0x00201105, // 00FF ADD R8 R8 K5 - 0x7001FF78, // 0100 JMP #007A - 0x80000000, // 0101 RET 0 - }) - ) -); -/*******************************************************************/ - - -/******************************************************************** -** Solidified function: pixel_count -********************************************************************/ -be_local_closure(class_Leds_matrix_pixel_count, /* name */ - be_nested_proto( - 3, /* nstack */ - 1, /* argc */ - 10, /* varg */ - 0, /* has upvals */ - NULL, /* no upvals */ - 0, /* has sup protos */ - NULL, /* no sub protos */ - 1, /* has constants */ - &be_ktab_class_Leds_matrix, /* shared constants */ - &be_const_str_pixel_count, - &be_const_str_solidified, - ( &(const binstruction[ 4]) { /* code */ - 0x88040107, // 0000 GETMBR R1 R0 K7 - 0x88080108, // 0001 GETMBR R2 R0 K8 - 0x08040202, // 0002 MUL R1 R1 R2 - 0x80040200, // 0003 RET 1 R1 - }) - ) -); -/*******************************************************************/ - - -/******************************************************************** -** Solidified function: set_pixel_color -********************************************************************/ -be_local_closure(class_Leds_matrix_set_pixel_color, /* name */ - be_nested_proto( - 9, /* nstack */ - 4, /* argc */ - 10, /* varg */ - 0, /* has upvals */ - NULL, /* no upvals */ - 0, /* has sup protos */ - NULL, /* no sub protos */ - 1, /* has constants */ - &be_ktab_class_Leds_matrix, /* shared constants */ - &be_const_str_set_pixel_color, - &be_const_str_solidified, - ( &(const binstruction[13]) { /* code */ - 0x4C100000, // 0000 LDNIL R4 - 0x1C100604, // 0001 EQ R4 R3 R4 - 0x78120001, // 0002 JMPF R4 #0005 - 0x88100100, // 0003 GETMBR R4 R0 K0 - 0x880C0903, // 0004 GETMBR R3 R4 K3 - 0x88100100, // 0005 GETMBR R4 R0 K0 - 0x8C100906, // 0006 GETMET R4 R4 K6 - 0x88180109, // 0007 GETMBR R6 R0 K9 - 0x00180206, // 0008 ADD R6 R1 R6 - 0x5C1C0400, // 0009 MOVE R7 R2 - 0x5C200600, // 000A MOVE R8 R3 - 0x7C100800, // 000B CALL R4 4 - 0x80000000, // 000C RET 0 - }) - ) -); -/*******************************************************************/ - - -/******************************************************************** -** Solidified function: pixels_buffer -********************************************************************/ -be_local_closure(class_Leds_matrix_pixels_buffer, /* name */ - be_nested_proto( - 3, /* nstack */ - 1, /* argc */ - 10, /* varg */ - 0, /* has upvals */ - NULL, /* no upvals */ - 0, /* has sup protos */ - NULL, /* no sub protos */ - 1, /* has constants */ - &be_ktab_class_Leds_matrix, /* shared constants */ - &be_const_str_pixels_buffer, - &be_const_str_solidified, - ( &(const binstruction[ 4]) { /* code */ - 0x88040100, // 0000 GETMBR R1 R0 K0 - 0x8C040311, // 0001 GETMET R1 R1 K17 - 0x7C040200, // 0002 CALL R1 1 - 0x80040200, // 0003 RET 1 R1 - }) - ) -); -/*******************************************************************/ - - -/******************************************************************** -** Solidified class: Leds_matrix -********************************************************************/ -be_local_class(Leds_matrix, - 7, - NULL, - be_nested_map(26, - ( (struct bmapnode*) &(const bmapnode[]) { - { be_const_key(is_dirty, -1), be_const_closure(class_Leds_matrix_is_dirty_closure) }, - { be_const_key(pixels_buffer, -1), be_const_closure(class_Leds_matrix_pixels_buffer_closure) }, - { be_const_key(set_matrix_pixel_color, 10), be_const_closure(class_Leds_matrix_set_matrix_pixel_color_closure) }, - { be_const_key(can_show, -1), be_const_closure(class_Leds_matrix_can_show_closure) }, - { be_const_key(offset, -1), be_const_var(1) }, - { be_const_key(set_bytes, 15), be_const_closure(class_Leds_matrix_set_bytes_closure) }, - { be_const_key(show, -1), be_const_closure(class_Leds_matrix_show_closure) }, - { be_const_key(alternate, -1), be_const_var(4) }, - { be_const_key(set_pixel_color, -1), be_const_closure(class_Leds_matrix_set_pixel_color_closure) }, - { be_const_key(pixel_count, -1), be_const_closure(class_Leds_matrix_pixel_count_closure) }, - { be_const_key(w, -1), be_const_var(3) }, - { be_const_key(dirty, 24), be_const_closure(class_Leds_matrix_dirty_closure) }, - { be_const_key(get_alternate, 13), be_const_closure(class_Leds_matrix_get_alternate_closure) }, - { be_const_key(get_pixel_color, -1), be_const_closure(class_Leds_matrix_get_pixel_color_closure) }, - { be_const_key(pix_size, -1), be_const_var(6) }, - { be_const_key(strip, -1), be_const_var(0) }, - { be_const_key(clear_to, 21), be_const_closure(class_Leds_matrix_clear_to_closure) }, - { be_const_key(init, -1), be_const_closure(class_Leds_matrix_init_closure) }, - { be_const_key(set_alternate, 8), be_const_closure(class_Leds_matrix_set_alternate_closure) }, - { be_const_key(pix_buffer, 17), be_const_var(5) }, - { be_const_key(clear, -1), be_const_closure(class_Leds_matrix_clear_closure) }, - { be_const_key(begin, -1), be_const_closure(class_Leds_matrix_begin_closure) }, - { be_const_key(scroll, -1), be_const_closure(class_Leds_matrix_scroll_closure) }, - { be_const_key(h, 9), be_const_var(2) }, - { be_const_key(pixel_offset, -1), be_const_closure(class_Leds_matrix_pixel_offset_closure) }, - { be_const_key(pixel_size, 1), be_const_closure(class_Leds_matrix_pixel_size_closure) }, - })), - (bstring*) &be_const_str_Leds_matrix -); -// compact class 'Leds' ktab size: 39, total: 74 (saved 280 bytes) -static const bvalue be_ktab_class_Leds[39] = { +// compact class 'Leds' ktab size: 35, total: 65 (saved 240 bytes) +static const bvalue be_ktab_class_Leds[35] = { /* K0 */ be_nested_str(leds), /* K1 */ be_const_int(0), /* K2 */ be_nested_str(value_error), /* K3 */ be_nested_str(out_X20of_X20range), /* K4 */ be_const_class(be_class_Leds_segment), - /* K5 */ be_nested_str(gamma), - /* K6 */ be_const_class(be_class_Leds), - /* K7 */ be_nested_str(Leds), - /* K8 */ be_nested_str(create_matrix), - /* K9 */ be_nested_str(call_native), - /* K10 */ be_nested_str(pixel_size), - /* K11 */ be_nested_str(pixel_count), - /* K12 */ be_nested_str(_change_buffer), - /* K13 */ be_nested_str(animate), - /* K14 */ be_const_int(2), - /* K15 */ be_nested_str(bri), - /* K16 */ be_nested_str(to_gamma), - /* K17 */ be_nested_str(clear_to), - /* K18 */ be_nested_str(show), - /* K19 */ be_nested_str(apply_bri_gamma), - /* K20 */ be_const_int(1), - /* K21 */ be_const_class(be_class_Leds_matrix), - /* K22 */ be_const_int(3), - /* K23 */ be_nested_str(gpio), - /* K24 */ be_nested_str(pin), - /* K25 */ be_nested_str(WS2812), - /* K26 */ be_nested_str(ctor), - /* K27 */ be_nested_str(light), - /* K28 */ be_nested_str(get), - /* K29 */ be_nested_str(global), - /* K30 */ be_nested_str(contains), - /* K31 */ be_nested_str(_lhw), - /* K32 */ be_nested_str(find), - /* K33 */ be_nested_str(number_X20of_X20leds_X20do_X20not_X20match_X20with_X20previous_X20instanciation_X20_X25s_X20vs_X20_X25s), - /* K34 */ be_nested_str(_p), - /* K35 */ be_nested_str(begin), - /* K36 */ be_nested_str(internal_error), - /* K37 */ be_nested_str(couldn_X27t_X20not_X20initialize_X20noepixelbus), - /* K38 */ be_nested_str(WS2812_GRB), + /* K5 */ be_nested_str(bri), + /* K6 */ be_nested_str(call_native), + /* K7 */ be_const_int(1), + /* K8 */ be_nested_str(clear_to), + /* K9 */ be_nested_str(show), + /* K10 */ be_const_int(2), + /* K11 */ be_nested_str(apply_bri_gamma), + /* K12 */ be_nested_str(gamma), + /* K13 */ be_nested_str(gpio), + /* K14 */ be_nested_str(pin), + /* K15 */ be_nested_str(WS2812), + /* K16 */ be_nested_str(ctor), + /* K17 */ be_nested_str(pixel_count), + /* K18 */ be_nested_str(light), + /* K19 */ be_nested_str(get), + /* K20 */ be_nested_str(global), + /* K21 */ be_nested_str(contains), + /* K22 */ be_nested_str(_lhw), + /* K23 */ be_nested_str(find), + /* K24 */ be_nested_str(number_X20of_X20leds_X20do_X20not_X20match_X20with_X20previous_X20instanciation_X20_X25s_X20vs_X20_X25s), + /* K25 */ be_nested_str(_p), + /* K26 */ be_nested_str(animate), + /* K27 */ be_nested_str(begin), + /* K28 */ be_nested_str(internal_error), + /* K29 */ be_nested_str(couldn_X27t_X20not_X20initialize_X20noepixelbus), + /* K30 */ be_nested_str(to_gamma), + /* K31 */ be_const_int(3), + /* K32 */ be_nested_str(WS2812_GRB), + /* K33 */ be_nested_str(pixel_size), + /* K34 */ be_nested_str(_change_buffer), }; @@ -1490,71 +555,11 @@ be_local_closure(class_Leds_create_segment, /* name */ /******************************************************************** -** Solidified function: get_gamma +** Solidified function: set_bri ********************************************************************/ -be_local_closure(class_Leds_get_gamma, /* name */ +be_local_closure(class_Leds_set_bri, /* name */ be_nested_proto( - 2, /* nstack */ - 1, /* argc */ - 10, /* varg */ - 0, /* has upvals */ - NULL, /* no upvals */ - 0, /* has sup protos */ - NULL, /* no sub protos */ - 1, /* has constants */ - &be_ktab_class_Leds, /* shared constants */ - &be_const_str_get_gamma, - &be_const_str_solidified, - ( &(const binstruction[ 2]) { /* code */ - 0x88040105, // 0000 GETMBR R1 R0 K5 - 0x80040200, // 0001 RET 1 R1 - }) - ) -); -/*******************************************************************/ - - -/******************************************************************** -** Solidified function: matrix -********************************************************************/ -be_local_closure(class_Leds_matrix, /* name */ - be_nested_proto( - 11, /* nstack */ - 4, /* argc */ - 12, /* varg */ - 0, /* has upvals */ - NULL, /* no upvals */ - 0, /* has sup protos */ - NULL, /* no sub protos */ - 1, /* has constants */ - &be_ktab_class_Leds, /* shared constants */ - &be_const_str_matrix, - &be_const_str_solidified, - ( &(const binstruction[12]) { /* code */ - 0x58100006, // 0000 LDCONST R4 K6 - 0xB8160E00, // 0001 GETNGBL R5 K7 - 0x08180001, // 0002 MUL R6 R0 R1 - 0x5C1C0400, // 0003 MOVE R7 R2 - 0x5C200600, // 0004 MOVE R8 R3 - 0x7C140600, // 0005 CALL R5 3 - 0x8C180B08, // 0006 GETMET R6 R5 K8 - 0x5C200000, // 0007 MOVE R8 R0 - 0x5C240200, // 0008 MOVE R9 R1 - 0x58280001, // 0009 LDCONST R10 K1 - 0x7C180800, // 000A CALL R6 4 - 0x80040C00, // 000B RET 1 R6 - }) - ) -); -/*******************************************************************/ - - -/******************************************************************** -** Solidified function: pixels_buffer -********************************************************************/ -be_local_closure(class_Leds_pixels_buffer, /* name */ - be_nested_proto( - 7, /* nstack */ + 3, /* nstack */ 2, /* argc */ 10, /* varg */ 0, /* has upvals */ @@ -1563,36 +568,18 @@ be_local_closure(class_Leds_pixels_buffer, /* name */ NULL, /* no sub protos */ 1, /* has constants */ &be_ktab_class_Leds, /* shared constants */ - &be_const_str_pixels_buffer, + &be_const_str_set_bri, &be_const_str_solidified, - ( &(const binstruction[27]) { /* code */ - 0x8C080109, // 0000 GETMET R2 R0 K9 - 0x54120005, // 0001 LDINT R4 6 - 0x7C080400, // 0002 CALL R2 2 - 0x8C0C010A, // 0003 GETMET R3 R0 K10 - 0x7C0C0200, // 0004 CALL R3 1 - 0x8C10010B, // 0005 GETMET R4 R0 K11 - 0x7C100200, // 0006 CALL R4 1 - 0x080C0604, // 0007 MUL R3 R3 R4 - 0x4C100000, // 0008 LDNIL R4 - 0x1C100204, // 0009 EQ R4 R1 R4 - 0x74120004, // 000A JMPT R4 #0010 - 0x6010000C, // 000B GETGBL R4 G12 - 0x5C140400, // 000C MOVE R5 R2 - 0x7C100200, // 000D CALL R4 1 - 0x20100803, // 000E NE R4 R4 R3 - 0x78120005, // 000F JMPF R4 #0016 - 0x60100015, // 0010 GETGBL R4 G21 - 0x5C140400, // 0011 MOVE R5 R2 - 0x5C180600, // 0012 MOVE R6 R3 - 0x7C100400, // 0013 CALL R4 2 - 0x80040800, // 0014 RET 1 R4 - 0x70020003, // 0015 JMP #001A - 0x8C10030C, // 0016 GETMET R4 R1 K12 - 0x5C180400, // 0017 MOVE R6 R2 - 0x7C100400, // 0018 CALL R4 2 - 0x80040200, // 0019 RET 1 R1 - 0x80000000, // 001A RET 0 + ( &(const binstruction[ 9]) { /* code */ + 0x14080301, // 0000 LT R2 R1 K1 + 0x780A0000, // 0001 JMPF R2 #0003 + 0x58040001, // 0002 LDCONST R1 K1 + 0x540A00FE, // 0003 LDINT R2 255 + 0x24080202, // 0004 GT R2 R1 R2 + 0x780A0000, // 0005 JMPF R2 #0007 + 0x540600FE, // 0006 LDINT R1 255 + 0x90020A01, // 0007 SETMBR R0 K5 R1 + 0x80000000, // 0008 RET 0 }) ) ); @@ -1600,34 +587,9 @@ be_local_closure(class_Leds_pixels_buffer, /* name */ /******************************************************************** -** Solidified function: get_animate +** Solidified function: begin ********************************************************************/ -be_local_closure(class_Leds_get_animate, /* name */ - be_nested_proto( - 2, /* nstack */ - 1, /* argc */ - 10, /* varg */ - 0, /* has upvals */ - NULL, /* no upvals */ - 0, /* has sup protos */ - NULL, /* no sub protos */ - 1, /* has constants */ - &be_ktab_class_Leds, /* shared constants */ - &be_const_str_get_animate, - &be_const_str_solidified, - ( &(const binstruction[ 2]) { /* code */ - 0x8804010D, // 0000 GETMBR R1 R0 K13 - 0x80040200, // 0001 RET 1 R1 - }) - ) -); -/*******************************************************************/ - - -/******************************************************************** -** Solidified function: show -********************************************************************/ -be_local_closure(class_Leds_show, /* name */ +be_local_closure(class_Leds_begin, /* name */ be_nested_proto( 4, /* nstack */ 1, /* argc */ @@ -1638,11 +600,11 @@ be_local_closure(class_Leds_show, /* name */ NULL, /* no sub protos */ 1, /* has constants */ &be_ktab_class_Leds, /* shared constants */ - &be_const_str_show, + &be_const_str_begin, &be_const_str_solidified, ( &(const binstruction[ 4]) { /* code */ - 0x8C040109, // 0000 GETMET R1 R0 K9 - 0x580C000E, // 0001 LDCONST R3 K14 + 0x8C040106, // 0000 GETMET R1 R0 K6 + 0x580C0007, // 0001 LDCONST R3 K7 0x7C040400, // 0002 CALL R1 2 0x80000000, // 0003 RET 0 }) @@ -1651,69 +613,6 @@ be_local_closure(class_Leds_show, /* name */ /*******************************************************************/ -/******************************************************************** -** Solidified function: set_pixel_color -********************************************************************/ -be_local_closure(class_Leds_set_pixel_color, /* name */ - be_nested_proto( - 12, /* nstack */ - 4, /* argc */ - 10, /* varg */ - 0, /* has upvals */ - NULL, /* no upvals */ - 0, /* has sup protos */ - NULL, /* no sub protos */ - 1, /* has constants */ - &be_ktab_class_Leds, /* shared constants */ - &be_const_str_set_pixel_color, - &be_const_str_solidified, - ( &(const binstruction[13]) { /* code */ - 0x4C100000, // 0000 LDNIL R4 - 0x1C100604, // 0001 EQ R4 R3 R4 - 0x78120000, // 0002 JMPF R4 #0004 - 0x880C010F, // 0003 GETMBR R3 R0 K15 - 0x8C100109, // 0004 GETMET R4 R0 K9 - 0x541A0009, // 0005 LDINT R6 10 - 0x5C1C0200, // 0006 MOVE R7 R1 - 0x8C200110, // 0007 GETMET R8 R0 K16 - 0x5C280400, // 0008 MOVE R10 R2 - 0x5C2C0600, // 0009 MOVE R11 R3 - 0x7C200600, // 000A CALL R8 3 - 0x7C100800, // 000B CALL R4 4 - 0x80000000, // 000C RET 0 - }) - ) -); -/*******************************************************************/ - - -/******************************************************************** -** Solidified function: is_dirty -********************************************************************/ -be_local_closure(class_Leds_is_dirty, /* name */ - be_nested_proto( - 4, /* nstack */ - 1, /* argc */ - 10, /* varg */ - 0, /* has upvals */ - NULL, /* no upvals */ - 0, /* has sup protos */ - NULL, /* no sub protos */ - 1, /* has constants */ - &be_ktab_class_Leds, /* shared constants */ - &be_const_str_is_dirty, - &be_const_str_solidified, - ( &(const binstruction[ 4]) { /* code */ - 0x8C040109, // 0000 GETMET R1 R0 K9 - 0x540E0003, // 0001 LDINT R3 4 - 0x7C040400, // 0002 CALL R1 2 - 0x80040200, // 0003 RET 1 R1 - }) - ) -); -/*******************************************************************/ - - /******************************************************************** ** Solidified function: clear ********************************************************************/ @@ -1731,10 +630,10 @@ be_local_closure(class_Leds_clear, /* name */ &be_const_str_clear, &be_const_str_solidified, ( &(const binstruction[ 6]) { /* code */ - 0x8C040111, // 0000 GETMET R1 R0 K17 + 0x8C040108, // 0000 GETMET R1 R0 K8 0x580C0001, // 0001 LDCONST R3 K1 0x7C040400, // 0002 CALL R1 2 - 0x8C040112, // 0003 GETMET R1 R0 K18 + 0x8C040109, // 0003 GETMET R1 R0 K9 0x7C040200, // 0004 CALL R1 1 0x80000000, // 0005 RET 0 }) @@ -1744,9 +643,9 @@ be_local_closure(class_Leds_clear, /* name */ /******************************************************************** -** Solidified function: pixel_size +** Solidified function: show ********************************************************************/ -be_local_closure(class_Leds_pixel_size, /* name */ +be_local_closure(class_Leds_show, /* name */ be_nested_proto( 4, /* nstack */ 1, /* argc */ @@ -1757,40 +656,13 @@ be_local_closure(class_Leds_pixel_size, /* name */ NULL, /* no sub protos */ 1, /* has constants */ &be_ktab_class_Leds, /* shared constants */ - &be_const_str_pixel_size, + &be_const_str_show, &be_const_str_solidified, ( &(const binstruction[ 4]) { /* code */ - 0x8C040109, // 0000 GETMET R1 R0 K9 - 0x540E0006, // 0001 LDINT R3 7 + 0x8C040106, // 0000 GETMET R1 R0 K6 + 0x580C000A, // 0001 LDCONST R3 K10 0x7C040400, // 0002 CALL R1 2 - 0x80040200, // 0003 RET 1 R1 - }) - ) -); -/*******************************************************************/ - - -/******************************************************************** -** Solidified function: pixel_count -********************************************************************/ -be_local_closure(class_Leds_pixel_count, /* name */ - be_nested_proto( - 4, /* nstack */ - 1, /* argc */ - 10, /* varg */ - 0, /* has upvals */ - NULL, /* no upvals */ - 0, /* has sup protos */ - NULL, /* no sub protos */ - 1, /* has constants */ - &be_ktab_class_Leds, /* shared constants */ - &be_const_str_pixel_count, - &be_const_str_solidified, - ( &(const binstruction[ 4]) { /* code */ - 0x8C040109, // 0000 GETMET R1 R0 K9 - 0x540E0007, // 0001 LDINT R3 8 - 0x7C040400, // 0002 CALL R1 2 - 0x80040200, // 0003 RET 1 R1 + 0x80000000, // 0003 RET 0 }) ) ); @@ -1817,11 +689,11 @@ be_local_closure(class_Leds_to_gamma, /* name */ 0x4C0C0000, // 0000 LDNIL R3 0x1C0C0403, // 0001 EQ R3 R2 R3 0x780E0000, // 0002 JMPF R3 #0004 - 0x8808010F, // 0003 GETMBR R2 R0 K15 - 0x8C0C0113, // 0004 GETMET R3 R0 K19 + 0x88080105, // 0003 GETMBR R2 R0 K5 + 0x8C0C010B, // 0004 GETMET R3 R0 K11 0x5C140200, // 0005 MOVE R5 R1 0x5C180400, // 0006 MOVE R6 R2 - 0x881C0105, // 0007 GETMBR R7 R0 K5 + 0x881C010C, // 0007 GETMBR R7 R0 K12 0x7C0C0800, // 0008 CALL R3 4 0x80040600, // 0009 RET 1 R3 }) @@ -1831,11 +703,124 @@ be_local_closure(class_Leds_to_gamma, /* name */ /******************************************************************** -** Solidified function: begin +** Solidified function: init ********************************************************************/ -be_local_closure(class_Leds_begin, /* name */ +be_local_closure(class_Leds_init, /* name */ be_nested_proto( - 4, /* nstack */ + 12, /* nstack */ + 5, /* argc */ + 10, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + &be_ktab_class_Leds, /* shared constants */ + &be_const_str_init, + &be_const_str_solidified, + ( &(const binstruction[90]) { /* code */ + 0xA4161A00, // 0000 IMPORT R5 K13 + 0x50180200, // 0001 LDBOOL R6 1 0 + 0x90021806, // 0002 SETMBR R0 K12 R6 + 0x4C180000, // 0003 LDNIL R6 + 0x1C180206, // 0004 EQ R6 R1 R6 + 0x741A0008, // 0005 JMPT R6 #000F + 0x4C180000, // 0006 LDNIL R6 + 0x1C180406, // 0007 EQ R6 R2 R6 + 0x741A0005, // 0008 JMPT R6 #000F + 0x8C180B0E, // 0009 GETMET R6 R5 K14 + 0x88200B0F, // 000A GETMBR R8 R5 K15 + 0x58240001, // 000B LDCONST R9 K1 + 0x7C180600, // 000C CALL R6 3 + 0x1C180406, // 000D EQ R6 R2 R6 + 0x781A000A, // 000E JMPF R6 #001A + 0x8C180110, // 000F GETMET R6 R0 K16 + 0x7C180200, // 0010 CALL R6 1 + 0x8C180111, // 0011 GETMET R6 R0 K17 + 0x7C180200, // 0012 CALL R6 1 + 0x90020006, // 0013 SETMBR R0 K0 R6 + 0xA41A2400, // 0014 IMPORT R6 K18 + 0x8C1C0D13, // 0015 GETMET R7 R6 K19 + 0x7C1C0200, // 0016 CALL R7 1 + 0x941C0F05, // 0017 GETIDX R7 R7 K5 + 0x90020A07, // 0018 SETMBR R0 K5 R7 + 0x70020039, // 0019 JMP #0054 + 0x60180009, // 001A GETGBL R6 G9 + 0x5C1C0200, // 001B MOVE R7 R1 + 0x7C180200, // 001C CALL R6 1 + 0x5C040C00, // 001D MOVE R1 R6 + 0x90020001, // 001E SETMBR R0 K0 R1 + 0x541A007E, // 001F LDINT R6 127 + 0x90020A06, // 0020 SETMBR R0 K5 R6 + 0xB81A2800, // 0021 GETNGBL R6 K20 + 0x8C180D15, // 0022 GETMET R6 R6 K21 + 0x58200016, // 0023 LDCONST R8 K22 + 0x7C180400, // 0024 CALL R6 2 + 0x741A0003, // 0025 JMPT R6 #002A + 0xB81A2800, // 0026 GETNGBL R6 K20 + 0x601C0013, // 0027 GETGBL R7 G19 + 0x7C1C0000, // 0028 CALL R7 0 + 0x901A2C07, // 0029 SETMBR R6 K22 R7 + 0xB81A2800, // 002A GETNGBL R6 K20 + 0x88180D16, // 002B GETMBR R6 R6 K22 + 0x8C180D17, // 002C GETMET R6 R6 K23 + 0x5C200200, // 002D MOVE R8 R1 + 0x7C180400, // 002E CALL R6 2 + 0x4C1C0000, // 002F LDNIL R7 + 0x20180C07, // 0030 NE R6 R6 R7 + 0x781A0016, // 0031 JMPF R6 #0049 + 0xB81A2800, // 0032 GETNGBL R6 K20 + 0x88180D16, // 0033 GETMBR R6 R6 K22 + 0x8C180D17, // 0034 GETMET R6 R6 K23 + 0x5C200200, // 0035 MOVE R8 R1 + 0x7C180400, // 0036 CALL R6 2 + 0x881C0100, // 0037 GETMBR R7 R0 K0 + 0x88200D00, // 0038 GETMBR R8 R6 K0 + 0x201C0E08, // 0039 NE R7 R7 R8 + 0x781E0005, // 003A JMPF R7 #0041 + 0x601C0018, // 003B GETGBL R7 G24 + 0x58200018, // 003C LDCONST R8 K24 + 0x88240100, // 003D GETMBR R9 R0 K0 + 0x88280D00, // 003E GETMBR R10 R6 K0 + 0x7C1C0600, // 003F CALL R7 3 + 0xB0060407, // 0040 RAISE 1 K2 R7 + 0x881C0D19, // 0041 GETMBR R7 R6 K25 + 0x90023207, // 0042 SETMBR R0 K25 R7 + 0x881C0D1A, // 0043 GETMBR R7 R6 K26 + 0x90023407, // 0044 SETMBR R0 K26 R7 + 0xB81E2800, // 0045 GETNGBL R7 K20 + 0x881C0F16, // 0046 GETMBR R7 R7 K22 + 0x981C0200, // 0047 SETIDX R7 R1 R0 + 0x7002000A, // 0048 JMP #0054 + 0x8C180110, // 0049 GETMET R6 R0 K16 + 0x5C200200, // 004A MOVE R8 R1 + 0x5C240400, // 004B MOVE R9 R2 + 0x5C280600, // 004C MOVE R10 R3 + 0x5C2C0800, // 004D MOVE R11 R4 + 0x7C180A00, // 004E CALL R6 5 + 0xB81A2800, // 004F GETNGBL R6 K20 + 0x88180D16, // 0050 GETMBR R6 R6 K22 + 0x98180200, // 0051 SETIDX R6 R1 R0 + 0x8C18011B, // 0052 GETMET R6 R0 K27 + 0x7C180200, // 0053 CALL R6 1 + 0x88180119, // 0054 GETMBR R6 R0 K25 + 0x4C1C0000, // 0055 LDNIL R7 + 0x1C180C07, // 0056 EQ R6 R6 R7 + 0x781A0000, // 0057 JMPF R6 #0059 + 0xB006391D, // 0058 RAISE 1 K28 K29 + 0x80000000, // 0059 RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: get_animate +********************************************************************/ +be_local_closure(class_Leds_get_animate, /* name */ + be_nested_proto( + 2, /* nstack */ 1, /* argc */ 10, /* varg */ 0, /* has upvals */ @@ -1844,159 +829,11 @@ be_local_closure(class_Leds_begin, /* name */ NULL, /* no sub protos */ 1, /* has constants */ &be_ktab_class_Leds, /* shared constants */ - &be_const_str_begin, + &be_const_str_get_animate, &be_const_str_solidified, - ( &(const binstruction[ 4]) { /* code */ - 0x8C040109, // 0000 GETMET R1 R0 K9 - 0x580C0014, // 0001 LDCONST R3 K20 - 0x7C040400, // 0002 CALL R1 2 - 0x80000000, // 0003 RET 0 - }) - ) -); -/*******************************************************************/ - - -/******************************************************************** -** Solidified function: create_matrix -********************************************************************/ -be_local_closure(class_Leds_create_matrix, /* name */ - be_nested_proto( - 10, /* nstack */ - 4, /* argc */ - 10, /* varg */ - 0, /* has upvals */ - NULL, /* no upvals */ - 0, /* has sup protos */ - NULL, /* no sub protos */ - 1, /* has constants */ - &be_ktab_class_Leds, /* shared constants */ - &be_const_str_create_matrix, - &be_const_str_solidified, - ( &(const binstruction[37]) { /* code */ - 0x60100009, // 0000 GETGBL R4 G9 - 0x5C140600, // 0001 MOVE R5 R3 - 0x7C100200, // 0002 CALL R4 1 - 0x5C0C0800, // 0003 MOVE R3 R4 - 0x60100009, // 0004 GETGBL R4 G9 - 0x5C140200, // 0005 MOVE R5 R1 - 0x7C100200, // 0006 CALL R4 1 - 0x5C040800, // 0007 MOVE R1 R4 - 0x60100009, // 0008 GETGBL R4 G9 - 0x5C140400, // 0009 MOVE R5 R2 - 0x7C100200, // 000A CALL R4 1 - 0x5C080800, // 000B MOVE R2 R4 - 0x4C100000, // 000C LDNIL R4 - 0x1C100604, // 000D EQ R4 R3 R4 - 0x78120000, // 000E JMPF R4 #0010 - 0x580C0001, // 000F LDCONST R3 K1 - 0x08100202, // 0010 MUL R4 R1 R2 - 0x00100803, // 0011 ADD R4 R4 R3 - 0x88140100, // 0012 GETMBR R5 R0 K0 - 0x24100805, // 0013 GT R4 R4 R5 - 0x74120005, // 0014 JMPT R4 #001B - 0x14100501, // 0015 LT R4 R2 K1 - 0x74120003, // 0016 JMPT R4 #001B - 0x14100301, // 0017 LT R4 R1 K1 - 0x74120001, // 0018 JMPT R4 #001B - 0x14100701, // 0019 LT R4 R3 K1 - 0x78120000, // 001A JMPF R4 #001C - 0xB0060503, // 001B RAISE 1 K2 K3 - 0x58100015, // 001C LDCONST R4 K21 - 0xB4000015, // 001D CLASS K21 - 0x5C140800, // 001E MOVE R5 R4 - 0x5C180000, // 001F MOVE R6 R0 - 0x5C1C0200, // 0020 MOVE R7 R1 - 0x5C200400, // 0021 MOVE R8 R2 - 0x5C240600, // 0022 MOVE R9 R3 - 0x7C140800, // 0023 CALL R5 4 - 0x80040A00, // 0024 RET 1 R5 - }) - ) -); -/*******************************************************************/ - - -/******************************************************************** -** Solidified function: dirty -********************************************************************/ -be_local_closure(class_Leds_dirty, /* name */ - be_nested_proto( - 4, /* nstack */ - 1, /* argc */ - 10, /* varg */ - 0, /* has upvals */ - NULL, /* no upvals */ - 0, /* has sup protos */ - NULL, /* no sub protos */ - 1, /* has constants */ - &be_ktab_class_Leds, /* shared constants */ - &be_const_str_dirty, - &be_const_str_solidified, - ( &(const binstruction[ 4]) { /* code */ - 0x8C040109, // 0000 GETMET R1 R0 K9 - 0x540E0004, // 0001 LDINT R3 5 - 0x7C040400, // 0002 CALL R1 2 - 0x80000000, // 0003 RET 0 - }) - ) -); -/*******************************************************************/ - - -/******************************************************************** -** Solidified function: set_bri -********************************************************************/ -be_local_closure(class_Leds_set_bri, /* name */ - be_nested_proto( - 3, /* nstack */ - 2, /* argc */ - 10, /* varg */ - 0, /* has upvals */ - NULL, /* no upvals */ - 0, /* has sup protos */ - NULL, /* no sub protos */ - 1, /* has constants */ - &be_ktab_class_Leds, /* shared constants */ - &be_const_str_set_bri, - &be_const_str_solidified, - ( &(const binstruction[ 9]) { /* code */ - 0x14080301, // 0000 LT R2 R1 K1 - 0x780A0000, // 0001 JMPF R2 #0003 - 0x58040001, // 0002 LDCONST R1 K1 - 0x540A00FE, // 0003 LDINT R2 255 - 0x24080202, // 0004 GT R2 R1 R2 - 0x780A0000, // 0005 JMPF R2 #0007 - 0x540600FE, // 0006 LDINT R1 255 - 0x90021E01, // 0007 SETMBR R0 K15 R1 - 0x80000000, // 0008 RET 0 - }) - ) -); -/*******************************************************************/ - - -/******************************************************************** -** Solidified function: can_show -********************************************************************/ -be_local_closure(class_Leds_can_show, /* name */ - be_nested_proto( - 4, /* nstack */ - 1, /* argc */ - 10, /* varg */ - 0, /* has upvals */ - NULL, /* no upvals */ - 0, /* has sup protos */ - NULL, /* no sub protos */ - 1, /* has constants */ - &be_ktab_class_Leds, /* shared constants */ - &be_const_str_can_show, - &be_const_str_solidified, - ( &(const binstruction[ 4]) { /* code */ - 0x8C040109, // 0000 GETMET R1 R0 K9 - 0x580C0016, // 0001 LDCONST R3 K22 - 0x7C040400, // 0002 CALL R1 2 - 0x80040200, // 0003 RET 1 R1 + ( &(const binstruction[ 2]) { /* code */ + 0x8804011A, // 0000 GETMBR R1 R0 K26 + 0x80040200, // 0001 RET 1 R1 }) ) ); @@ -2020,7 +857,7 @@ be_local_closure(class_Leds_set_animate, /* name */ &be_const_str_set_animate, &be_const_str_solidified, ( &(const binstruction[ 2]) { /* code */ - 0x90021A01, // 0000 SETMBR R0 K13 R1 + 0x90023401, // 0000 SETMBR R0 K26 R1 0x80000000, // 0001 RET 0 }) ) @@ -2029,11 +866,67 @@ be_local_closure(class_Leds_set_animate, /* name */ /******************************************************************** -** Solidified function: get_bri +** Solidified function: set_gamma ********************************************************************/ -be_local_closure(class_Leds_get_bri, /* name */ +be_local_closure(class_Leds_set_gamma, /* name */ be_nested_proto( - 2, /* nstack */ + 4, /* nstack */ + 2, /* argc */ + 10, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + &be_ktab_class_Leds, /* shared constants */ + &be_const_str_set_gamma, + &be_const_str_solidified, + ( &(const binstruction[ 5]) { /* code */ + 0x60080017, // 0000 GETGBL R2 G23 + 0x5C0C0200, // 0001 MOVE R3 R1 + 0x7C080200, // 0002 CALL R2 1 + 0x90021802, // 0003 SETMBR R0 K12 R2 + 0x80000000, // 0004 RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: get_pixel_color +********************************************************************/ +be_local_closure(class_Leds_get_pixel_color, /* name */ + be_nested_proto( + 6, /* nstack */ + 2, /* argc */ + 10, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + &be_ktab_class_Leds, /* shared constants */ + &be_const_str_get_pixel_color, + &be_const_str_solidified, + ( &(const binstruction[ 5]) { /* code */ + 0x8C080106, // 0000 GETMET R2 R0 K6 + 0x5412000A, // 0001 LDINT R4 11 + 0x5C140200, // 0002 MOVE R5 R1 + 0x7C080600, // 0003 CALL R2 3 + 0x80040400, // 0004 RET 1 R2 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: dirty +********************************************************************/ +be_local_closure(class_Leds_dirty, /* name */ + be_nested_proto( + 4, /* nstack */ 1, /* argc */ 10, /* varg */ 0, /* has upvals */ @@ -2042,62 +935,13 @@ be_local_closure(class_Leds_get_bri, /* name */ NULL, /* no sub protos */ 1, /* has constants */ &be_ktab_class_Leds, /* shared constants */ - &be_const_str_get_bri, + &be_const_str_dirty, &be_const_str_solidified, - ( &(const binstruction[ 2]) { /* code */ - 0x8804010F, // 0000 GETMBR R1 R0 K15 - 0x80040200, // 0001 RET 1 R1 - }) - ) -); -/*******************************************************************/ - - -/******************************************************************** -** Solidified function: clear_to -********************************************************************/ -be_local_closure(class_Leds_clear_to, /* name */ - be_nested_proto( - 12, /* nstack */ - 5, /* argc */ - 10, /* varg */ - 0, /* has upvals */ - NULL, /* no upvals */ - 0, /* has sup protos */ - NULL, /* no sub protos */ - 1, /* has constants */ - &be_ktab_class_Leds, /* shared constants */ - &be_const_str_clear_to, - &be_const_str_solidified, - ( &(const binstruction[28]) { /* code */ - 0x4C140000, // 0000 LDNIL R5 - 0x1C140405, // 0001 EQ R5 R2 R5 - 0x78160000, // 0002 JMPF R5 #0004 - 0x8808010F, // 0003 GETMBR R2 R0 K15 - 0x4C140000, // 0004 LDNIL R5 - 0x20140605, // 0005 NE R5 R3 R5 - 0x7816000C, // 0006 JMPF R5 #0014 - 0x4C140000, // 0007 LDNIL R5 - 0x20140805, // 0008 NE R5 R4 R5 - 0x78160009, // 0009 JMPF R5 #0014 - 0x8C140109, // 000A GETMET R5 R0 K9 - 0x541E0008, // 000B LDINT R7 9 - 0x8C200110, // 000C GETMET R8 R0 K16 - 0x5C280200, // 000D MOVE R10 R1 - 0x5C2C0400, // 000E MOVE R11 R2 - 0x7C200600, // 000F CALL R8 3 - 0x5C240600, // 0010 MOVE R9 R3 - 0x5C280800, // 0011 MOVE R10 R4 - 0x7C140A00, // 0012 CALL R5 5 - 0x70020006, // 0013 JMP #001B - 0x8C140109, // 0014 GETMET R5 R0 K9 - 0x541E0008, // 0015 LDINT R7 9 - 0x8C200110, // 0016 GETMET R8 R0 K16 - 0x5C280200, // 0017 MOVE R10 R1 - 0x5C2C0400, // 0018 MOVE R11 R2 - 0x7C200600, // 0019 CALL R8 3 - 0x7C140600, // 001A CALL R5 3 - 0x80000000, // 001B RET 0 + ( &(const binstruction[ 4]) { /* code */ + 0x8C040106, // 0000 GETMET R1 R0 K6 + 0x540E0004, // 0001 LDINT R3 5 + 0x7C040400, // 0002 CALL R1 2 + 0x80000000, // 0003 RET 0 }) ) ); @@ -2129,37 +973,9 @@ be_local_closure(class_Leds_pixel_offset, /* name */ /******************************************************************** -** Solidified function: get_pixel_color +** Solidified function: clear_to ********************************************************************/ -be_local_closure(class_Leds_get_pixel_color, /* name */ - be_nested_proto( - 6, /* nstack */ - 2, /* argc */ - 10, /* varg */ - 0, /* has upvals */ - NULL, /* no upvals */ - 0, /* has sup protos */ - NULL, /* no sub protos */ - 1, /* has constants */ - &be_ktab_class_Leds, /* shared constants */ - &be_const_str_get_pixel_color, - &be_const_str_solidified, - ( &(const binstruction[ 5]) { /* code */ - 0x8C080109, // 0000 GETMET R2 R0 K9 - 0x5412000A, // 0001 LDINT R4 11 - 0x5C140200, // 0002 MOVE R5 R1 - 0x7C080600, // 0003 CALL R2 3 - 0x80040400, // 0004 RET 1 R2 - }) - ) -); -/*******************************************************************/ - - -/******************************************************************** -** Solidified function: init -********************************************************************/ -be_local_closure(class_Leds_init, /* name */ +be_local_closure(class_Leds_clear_to, /* name */ be_nested_proto( 12, /* nstack */ 5, /* argc */ @@ -2170,99 +986,231 @@ be_local_closure(class_Leds_init, /* name */ NULL, /* no sub protos */ 1, /* has constants */ &be_ktab_class_Leds, /* shared constants */ - &be_const_str_init, + &be_const_str_clear_to, &be_const_str_solidified, - ( &(const binstruction[90]) { /* code */ - 0xA4162E00, // 0000 IMPORT R5 K23 - 0x50180200, // 0001 LDBOOL R6 1 0 - 0x90020A06, // 0002 SETMBR R0 K5 R6 - 0x4C180000, // 0003 LDNIL R6 - 0x1C180206, // 0004 EQ R6 R1 R6 - 0x741A0008, // 0005 JMPT R6 #000F - 0x4C180000, // 0006 LDNIL R6 - 0x1C180406, // 0007 EQ R6 R2 R6 - 0x741A0005, // 0008 JMPT R6 #000F - 0x8C180B18, // 0009 GETMET R6 R5 K24 - 0x88200B19, // 000A GETMBR R8 R5 K25 - 0x58240001, // 000B LDCONST R9 K1 - 0x7C180600, // 000C CALL R6 3 - 0x1C180406, // 000D EQ R6 R2 R6 - 0x781A000A, // 000E JMPF R6 #001A - 0x8C18011A, // 000F GETMET R6 R0 K26 - 0x7C180200, // 0010 CALL R6 1 - 0x8C18010B, // 0011 GETMET R6 R0 K11 - 0x7C180200, // 0012 CALL R6 1 - 0x90020006, // 0013 SETMBR R0 K0 R6 - 0xA41A3600, // 0014 IMPORT R6 K27 - 0x8C1C0D1C, // 0015 GETMET R7 R6 K28 - 0x7C1C0200, // 0016 CALL R7 1 - 0x941C0F0F, // 0017 GETIDX R7 R7 K15 - 0x90021E07, // 0018 SETMBR R0 K15 R7 - 0x70020039, // 0019 JMP #0054 - 0x60180009, // 001A GETGBL R6 G9 - 0x5C1C0200, // 001B MOVE R7 R1 - 0x7C180200, // 001C CALL R6 1 - 0x5C040C00, // 001D MOVE R1 R6 - 0x90020001, // 001E SETMBR R0 K0 R1 - 0x541A007E, // 001F LDINT R6 127 - 0x90021E06, // 0020 SETMBR R0 K15 R6 - 0xB81A3A00, // 0021 GETNGBL R6 K29 - 0x8C180D1E, // 0022 GETMET R6 R6 K30 - 0x5820001F, // 0023 LDCONST R8 K31 - 0x7C180400, // 0024 CALL R6 2 - 0x741A0003, // 0025 JMPT R6 #002A - 0xB81A3A00, // 0026 GETNGBL R6 K29 - 0x601C0013, // 0027 GETGBL R7 G19 - 0x7C1C0000, // 0028 CALL R7 0 - 0x901A3E07, // 0029 SETMBR R6 K31 R7 - 0xB81A3A00, // 002A GETNGBL R6 K29 - 0x88180D1F, // 002B GETMBR R6 R6 K31 - 0x8C180D20, // 002C GETMET R6 R6 K32 - 0x5C200200, // 002D MOVE R8 R1 - 0x7C180400, // 002E CALL R6 2 - 0x4C1C0000, // 002F LDNIL R7 - 0x20180C07, // 0030 NE R6 R6 R7 - 0x781A0016, // 0031 JMPF R6 #0049 - 0xB81A3A00, // 0032 GETNGBL R6 K29 - 0x88180D1F, // 0033 GETMBR R6 R6 K31 - 0x8C180D20, // 0034 GETMET R6 R6 K32 - 0x5C200200, // 0035 MOVE R8 R1 - 0x7C180400, // 0036 CALL R6 2 - 0x881C0100, // 0037 GETMBR R7 R0 K0 - 0x88200D00, // 0038 GETMBR R8 R6 K0 - 0x201C0E08, // 0039 NE R7 R7 R8 - 0x781E0005, // 003A JMPF R7 #0041 - 0x601C0018, // 003B GETGBL R7 G24 - 0x58200021, // 003C LDCONST R8 K33 - 0x88240100, // 003D GETMBR R9 R0 K0 - 0x88280D00, // 003E GETMBR R10 R6 K0 - 0x7C1C0600, // 003F CALL R7 3 - 0xB0060407, // 0040 RAISE 1 K2 R7 - 0x881C0D22, // 0041 GETMBR R7 R6 K34 - 0x90024407, // 0042 SETMBR R0 K34 R7 - 0x881C0D0D, // 0043 GETMBR R7 R6 K13 - 0x90021A07, // 0044 SETMBR R0 K13 R7 - 0xB81E3A00, // 0045 GETNGBL R7 K29 - 0x881C0F1F, // 0046 GETMBR R7 R7 K31 - 0x981C0200, // 0047 SETIDX R7 R1 R0 - 0x7002000A, // 0048 JMP #0054 - 0x8C18011A, // 0049 GETMET R6 R0 K26 - 0x5C200200, // 004A MOVE R8 R1 - 0x5C240400, // 004B MOVE R9 R2 - 0x5C280600, // 004C MOVE R10 R3 - 0x5C2C0800, // 004D MOVE R11 R4 - 0x7C180A00, // 004E CALL R6 5 - 0xB81A3A00, // 004F GETNGBL R6 K29 - 0x88180D1F, // 0050 GETMBR R6 R6 K31 - 0x98180200, // 0051 SETIDX R6 R1 R0 - 0x8C180123, // 0052 GETMET R6 R0 K35 - 0x7C180200, // 0053 CALL R6 1 - 0x88180122, // 0054 GETMBR R6 R0 K34 - 0x4C1C0000, // 0055 LDNIL R7 - 0x1C180C07, // 0056 EQ R6 R6 R7 - 0x781A0000, // 0057 JMPF R6 #0059 - 0xB0064925, // 0058 RAISE 1 K36 K37 - 0x80000000, // 0059 RET 0 + ( &(const binstruction[28]) { /* code */ + 0x4C140000, // 0000 LDNIL R5 + 0x1C140405, // 0001 EQ R5 R2 R5 + 0x78160000, // 0002 JMPF R5 #0004 + 0x88080105, // 0003 GETMBR R2 R0 K5 + 0x4C140000, // 0004 LDNIL R5 + 0x20140605, // 0005 NE R5 R3 R5 + 0x7816000C, // 0006 JMPF R5 #0014 + 0x4C140000, // 0007 LDNIL R5 + 0x20140805, // 0008 NE R5 R4 R5 + 0x78160009, // 0009 JMPF R5 #0014 + 0x8C140106, // 000A GETMET R5 R0 K6 + 0x541E0008, // 000B LDINT R7 9 + 0x8C20011E, // 000C GETMET R8 R0 K30 + 0x5C280200, // 000D MOVE R10 R1 + 0x5C2C0400, // 000E MOVE R11 R2 + 0x7C200600, // 000F CALL R8 3 + 0x5C240600, // 0010 MOVE R9 R3 + 0x5C280800, // 0011 MOVE R10 R4 + 0x7C140A00, // 0012 CALL R5 5 + 0x70020006, // 0013 JMP #001B + 0x8C140106, // 0014 GETMET R5 R0 K6 + 0x541E0008, // 0015 LDINT R7 9 + 0x8C20011E, // 0016 GETMET R8 R0 K30 + 0x5C280200, // 0017 MOVE R10 R1 + 0x5C2C0400, // 0018 MOVE R11 R2 + 0x7C200600, // 0019 CALL R8 3 + 0x7C140600, // 001A CALL R5 3 + 0x80000000, // 001B RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: set_pixel_color +********************************************************************/ +be_local_closure(class_Leds_set_pixel_color, /* name */ + be_nested_proto( + 12, /* nstack */ + 4, /* argc */ + 10, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + &be_ktab_class_Leds, /* shared constants */ + &be_const_str_set_pixel_color, + &be_const_str_solidified, + ( &(const binstruction[13]) { /* code */ + 0x4C100000, // 0000 LDNIL R4 + 0x1C100604, // 0001 EQ R4 R3 R4 + 0x78120000, // 0002 JMPF R4 #0004 + 0x880C0105, // 0003 GETMBR R3 R0 K5 + 0x8C100106, // 0004 GETMET R4 R0 K6 + 0x541A0009, // 0005 LDINT R6 10 + 0x5C1C0200, // 0006 MOVE R7 R1 + 0x8C20011E, // 0007 GETMET R8 R0 K30 + 0x5C280400, // 0008 MOVE R10 R2 + 0x5C2C0600, // 0009 MOVE R11 R3 + 0x7C200600, // 000A CALL R8 3 + 0x7C100800, // 000B CALL R4 4 + 0x80000000, // 000C RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: pixel_count +********************************************************************/ +be_local_closure(class_Leds_pixel_count, /* name */ + be_nested_proto( + 4, /* nstack */ + 1, /* argc */ + 10, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + &be_ktab_class_Leds, /* shared constants */ + &be_const_str_pixel_count, + &be_const_str_solidified, + ( &(const binstruction[ 4]) { /* code */ + 0x8C040106, // 0000 GETMET R1 R0 K6 + 0x540E0007, // 0001 LDINT R3 8 + 0x7C040400, // 0002 CALL R1 2 + 0x80040200, // 0003 RET 1 R1 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: get_bri +********************************************************************/ +be_local_closure(class_Leds_get_bri, /* name */ + be_nested_proto( + 2, /* nstack */ + 1, /* argc */ + 10, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + &be_ktab_class_Leds, /* shared constants */ + &be_const_str_get_bri, + &be_const_str_solidified, + ( &(const binstruction[ 2]) { /* code */ + 0x88040105, // 0000 GETMBR R1 R0 K5 + 0x80040200, // 0001 RET 1 R1 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: get_gamma +********************************************************************/ +be_local_closure(class_Leds_get_gamma, /* name */ + be_nested_proto( + 2, /* nstack */ + 1, /* argc */ + 10, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + &be_ktab_class_Leds, /* shared constants */ + &be_const_str_get_gamma, + &be_const_str_solidified, + ( &(const binstruction[ 2]) { /* code */ + 0x8804010C, // 0000 GETMBR R1 R0 K12 + 0x80040200, // 0001 RET 1 R1 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: is_dirty +********************************************************************/ +be_local_closure(class_Leds_is_dirty, /* name */ + be_nested_proto( + 4, /* nstack */ + 1, /* argc */ + 10, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + &be_ktab_class_Leds, /* shared constants */ + &be_const_str_is_dirty, + &be_const_str_solidified, + ( &(const binstruction[ 4]) { /* code */ + 0x8C040106, // 0000 GETMET R1 R0 K6 + 0x540E0003, // 0001 LDINT R3 4 + 0x7C040400, // 0002 CALL R1 2 + 0x80040200, // 0003 RET 1 R1 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: can_show +********************************************************************/ +be_local_closure(class_Leds_can_show, /* name */ + be_nested_proto( + 4, /* nstack */ + 1, /* argc */ + 10, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + &be_ktab_class_Leds, /* shared constants */ + &be_const_str_can_show, + &be_const_str_solidified, + ( &(const binstruction[ 4]) { /* code */ + 0x8C040106, // 0000 GETMET R1 R0 K6 + 0x580C001F, // 0001 LDCONST R3 K31 + 0x7C040400, // 0002 CALL R1 2 + 0x80040200, // 0003 RET 1 R1 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: pixel_size +********************************************************************/ +be_local_closure(class_Leds_pixel_size, /* name */ + be_nested_proto( + 4, /* nstack */ + 1, /* argc */ + 10, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + &be_ktab_class_Leds, /* shared constants */ + &be_const_str_pixel_size, + &be_const_str_solidified, + ( &(const binstruction[ 4]) { /* code */ + 0x8C040106, // 0000 GETMET R1 R0 K6 + 0x540E0006, // 0001 LDINT R3 7 + 0x7C040400, // 0002 CALL R1 2 + 0x80040200, // 0003 RET 1 R1 }) ) ); @@ -2289,15 +1237,15 @@ be_local_closure(class_Leds_ctor, /* name */ 0x4C140000, // 0000 LDNIL R5 0x1C140405, // 0001 EQ R5 R2 R5 0x78160003, // 0002 JMPF R5 #0007 - 0x8C140109, // 0003 GETMET R5 R0 K9 + 0x8C140106, // 0003 GETMET R5 R0 K6 0x581C0001, // 0004 LDCONST R7 K1 0x7C140400, // 0005 CALL R5 2 0x7002000A, // 0006 JMP #0012 0x4C140000, // 0007 LDNIL R5 0x1C140605, // 0008 EQ R5 R3 R5 0x78160000, // 0009 JMPF R5 #000B - 0x880C0126, // 000A GETMBR R3 R0 K38 - 0x8C140109, // 000B GETMET R5 R0 K9 + 0x880C0120, // 000A GETMBR R3 R0 K32 + 0x8C140106, // 000B GETMET R5 R0 K6 0x581C0001, // 000C LDCONST R7 K1 0x5C200200, // 000D MOVE R8 R1 0x5C240400, // 000E MOVE R9 R2 @@ -2312,11 +1260,11 @@ be_local_closure(class_Leds_ctor, /* name */ /******************************************************************** -** Solidified function: set_gamma +** Solidified function: pixels_buffer ********************************************************************/ -be_local_closure(class_Leds_set_gamma, /* name */ +be_local_closure(class_Leds_pixels_buffer, /* name */ be_nested_proto( - 4, /* nstack */ + 7, /* nstack */ 2, /* argc */ 10, /* varg */ 0, /* has upvals */ @@ -2325,14 +1273,36 @@ be_local_closure(class_Leds_set_gamma, /* name */ NULL, /* no sub protos */ 1, /* has constants */ &be_ktab_class_Leds, /* shared constants */ - &be_const_str_set_gamma, + &be_const_str_pixels_buffer, &be_const_str_solidified, - ( &(const binstruction[ 5]) { /* code */ - 0x60080017, // 0000 GETGBL R2 G23 - 0x5C0C0200, // 0001 MOVE R3 R1 - 0x7C080200, // 0002 CALL R2 1 - 0x90020A02, // 0003 SETMBR R0 K5 R2 - 0x80000000, // 0004 RET 0 + ( &(const binstruction[27]) { /* code */ + 0x8C080106, // 0000 GETMET R2 R0 K6 + 0x54120005, // 0001 LDINT R4 6 + 0x7C080400, // 0002 CALL R2 2 + 0x8C0C0121, // 0003 GETMET R3 R0 K33 + 0x7C0C0200, // 0004 CALL R3 1 + 0x8C100111, // 0005 GETMET R4 R0 K17 + 0x7C100200, // 0006 CALL R4 1 + 0x080C0604, // 0007 MUL R3 R3 R4 + 0x4C100000, // 0008 LDNIL R4 + 0x1C100204, // 0009 EQ R4 R1 R4 + 0x74120004, // 000A JMPT R4 #0010 + 0x6010000C, // 000B GETGBL R4 G12 + 0x5C140400, // 000C MOVE R5 R2 + 0x7C100200, // 000D CALL R4 1 + 0x20100803, // 000E NE R4 R4 R3 + 0x78120005, // 000F JMPF R4 #0016 + 0x60100015, // 0010 GETGBL R4 G21 + 0x5C140400, // 0011 MOVE R5 R2 + 0x5C180600, // 0012 MOVE R6 R3 + 0x7C100400, // 0013 CALL R4 2 + 0x80040800, // 0014 RET 1 R4 + 0x70020003, // 0015 JMP #001A + 0x8C100322, // 0016 GETMET R4 R1 K34 + 0x5C180400, // 0017 MOVE R6 R2 + 0x7C100400, // 0018 CALL R4 2 + 0x80040200, // 0019 RET 1 R1 + 0x80000000, // 001A RET 0 }) ) ); @@ -2346,37 +1316,35 @@ extern const bclass be_class_Leds_ntv; be_local_class(Leds, 4, &be_class_Leds_ntv, - be_nested_map(29, + be_nested_map(27, ( (struct bmapnode*) &(const bmapnode[]) { - { be_const_key(pixels_buffer, -1), be_const_closure(class_Leds_pixels_buffer_closure) }, - { be_const_key(get_gamma, 26), be_const_closure(class_Leds_get_gamma_closure) }, + { be_const_key(leds, 8), be_const_var(1) }, + { be_const_key(create_segment, 25), be_const_closure(class_Leds_create_segment_closure) }, { be_const_key(clear, -1), be_const_closure(class_Leds_clear_closure) }, - { be_const_key(matrix, 13), be_const_static_closure(class_Leds_matrix_closure) }, - { be_const_key(init, 23), be_const_closure(class_Leds_init_closure) }, + { be_const_key(begin, -1), be_const_closure(class_Leds_begin_closure) }, + { be_const_key(ctor, 9), be_const_closure(class_Leds_ctor_closure) }, + { be_const_key(pixel_size, -1), be_const_closure(class_Leds_pixel_size_closure) }, + { be_const_key(to_gamma, -1), be_const_closure(class_Leds_to_gamma_closure) }, { be_const_key(get_animate, -1), be_const_closure(class_Leds_get_animate_closure) }, - { be_const_key(get_pixel_color, 12), be_const_closure(class_Leds_get_pixel_color_closure) }, + { be_const_key(set_animate, 7), be_const_closure(class_Leds_set_animate_closure) }, + { be_const_key(dirty, -1), be_const_closure(class_Leds_dirty_closure) }, + { be_const_key(set_gamma, 4), be_const_closure(class_Leds_set_gamma_closure) }, + { be_const_key(get_pixel_color, -1), be_const_closure(class_Leds_get_pixel_color_closure) }, + { be_const_key(pixel_offset, 2), be_const_closure(class_Leds_pixel_offset_closure) }, + { be_const_key(pixel_count, -1), be_const_closure(class_Leds_pixel_count_closure) }, + { be_const_key(set_bri, 12), be_const_closure(class_Leds_set_bri_closure) }, + { be_const_key(clear_to, -1), be_const_closure(class_Leds_clear_to_closure) }, { be_const_key(set_pixel_color, -1), be_const_closure(class_Leds_set_pixel_color_closure) }, { be_const_key(animate, -1), be_const_var(3) }, + { be_const_key(gamma, 13), be_const_var(0) }, + { be_const_key(get_bri, -1), be_const_closure(class_Leds_get_bri_closure) }, + { be_const_key(get_gamma, -1), be_const_closure(class_Leds_get_gamma_closure) }, + { be_const_key(bri, -1), be_const_var(2) }, { be_const_key(is_dirty, -1), be_const_closure(class_Leds_is_dirty_closure) }, - { be_const_key(create_segment, 4), be_const_closure(class_Leds_create_segment_closure) }, - { be_const_key(pixel_offset, -1), be_const_closure(class_Leds_pixel_offset_closure) }, - { be_const_key(clear_to, -1), be_const_closure(class_Leds_clear_to_closure) }, - { be_const_key(begin, 0), be_const_closure(class_Leds_begin_closure) }, - { be_const_key(set_animate, -1), be_const_closure(class_Leds_set_animate_closure) }, - { be_const_key(can_show, 24), be_const_closure(class_Leds_can_show_closure) }, - { be_const_key(create_matrix, -1), be_const_closure(class_Leds_create_matrix_closure) }, - { be_const_key(dirty, -1), be_const_closure(class_Leds_dirty_closure) }, - { be_const_key(set_bri, -1), be_const_closure(class_Leds_set_bri_closure) }, - { be_const_key(leds, 15), be_const_var(1) }, - { be_const_key(gamma, -1), be_const_var(0) }, - { be_const_key(bri, 14), be_const_var(2) }, - { be_const_key(get_bri, 11), be_const_closure(class_Leds_get_bri_closure) }, - { be_const_key(to_gamma, 2), be_const_closure(class_Leds_to_gamma_closure) }, - { be_const_key(pixel_count, -1), be_const_closure(class_Leds_pixel_count_closure) }, - { be_const_key(show, 6), be_const_closure(class_Leds_show_closure) }, - { be_const_key(pixel_size, -1), be_const_closure(class_Leds_pixel_size_closure) }, - { be_const_key(ctor, -1), be_const_closure(class_Leds_ctor_closure) }, - { be_const_key(set_gamma, -1), be_const_closure(class_Leds_set_gamma_closure) }, + { be_const_key(can_show, -1), be_const_closure(class_Leds_can_show_closure) }, + { be_const_key(init, 5), be_const_closure(class_Leds_init_closure) }, + { be_const_key(show, -1), be_const_closure(class_Leds_show_closure) }, + { be_const_key(pixels_buffer, -1), be_const_closure(class_Leds_pixels_buffer_closure) }, })), (bstring*) &be_const_str_Leds ); diff --git a/lib/libesp32/berry_tasmota/src/solidify/solidified_tapp.h b/lib/libesp32/berry_tasmota/src/solidify/solidified_tapp.h index 56da5bbc5..a645429bd 100644 --- a/lib/libesp32/berry_tasmota/src/solidify/solidified_tapp.h +++ b/lib/libesp32/berry_tasmota/src/solidify/solidified_tapp.h @@ -3,23 +3,26 @@ * Generated code, don't edit * \********************************************************************/ #include "be_constobj.h" -// compact class 'Tapp' ktab size: 15, total: 16 (saved 8 bytes) -static const bvalue be_ktab_class_Tapp[15] = { +extern const bclass be_class_Tapp; +// compact class 'Tapp' ktab size: 17, total: 18 (saved 8 bytes) +static const bvalue be_ktab_class_Tapp[17] = { /* K0 */ be_nested_str(tasmota), /* K1 */ be_nested_str(add_driver), - /* K2 */ be_nested_str(path), - /* K3 */ be_nested_str(string), - /* K4 */ be_nested_str(listdir), - /* K5 */ be_nested_str(_X2F), - /* K6 */ be_nested_str(find), - /* K7 */ be_nested_str(_X2Etapp), - /* K8 */ be_const_int(0), - /* K9 */ be_nested_str(log), - /* K10 */ be_nested_str(TAP_X3A_X20Loaded_X20Tasmota_X20App_X20_X27_X25s_X27), - /* K11 */ be_const_int(2), - /* K12 */ be_nested_str(load), - /* K13 */ be_nested_str(_X23autoexec_X2Ebe), - /* K14 */ be_nested_str(stop_iteration), + /* K2 */ be_nested_str(autoexec_dir), + /* K3 */ be_nested_str(_X2F_X2Eextensions_X2F), + /* K4 */ be_nested_str(_X2F), + /* K5 */ be_const_class(be_class_Tapp), + /* K6 */ be_nested_str(path), + /* K7 */ be_nested_str(string), + /* K8 */ be_nested_str(listdir), + /* K9 */ be_nested_str(endswith), + /* K10 */ be_nested_str(_X2Etapp), + /* K11 */ be_nested_str(log), + /* K12 */ be_nested_str(TAP_X3A_X20Loaded_X20Tasmota_X20App_X20_X27_X25s_X25s_X27), + /* K13 */ be_const_int(2), + /* K14 */ be_nested_str(load), + /* K15 */ be_nested_str(_X23autoexec_X2Ebe), + /* K16 */ be_nested_str(stop_iteration), }; @@ -58,7 +61,7 @@ be_local_closure(class_Tapp_init, /* name */ ********************************************************************/ be_local_closure(class_Tapp_autoexec, /* name */ be_nested_proto( - 11, /* nstack */ + 4, /* nstack */ 1, /* argc */ 10, /* varg */ 0, /* has upvals */ @@ -69,38 +72,68 @@ be_local_closure(class_Tapp_autoexec, /* name */ &be_ktab_class_Tapp, /* shared constants */ &be_const_str_autoexec, &be_const_str_solidified, + ( &(const binstruction[ 7]) { /* code */ + 0x8C040102, // 0000 GETMET R1 R0 K2 + 0x580C0003, // 0001 LDCONST R3 K3 + 0x7C040400, // 0002 CALL R1 2 + 0x8C040102, // 0003 GETMET R1 R0 K2 + 0x580C0004, // 0004 LDCONST R3 K4 + 0x7C040400, // 0005 CALL R1 2 + 0x80000000, // 0006 RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: autoexec_dir +********************************************************************/ +be_local_closure(class_Tapp_autoexec_dir, /* name */ + be_nested_proto( + 11, /* nstack */ + 1, /* argc */ + 12, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + &be_ktab_class_Tapp, /* shared constants */ + &be_const_str_autoexec_dir, + &be_const_str_solidified, ( &(const binstruction[34]) { /* code */ - 0xA4060400, // 0000 IMPORT R1 K2 - 0xA40A0600, // 0001 IMPORT R2 K3 - 0x8C0C0304, // 0002 GETMET R3 R1 K4 - 0x58140005, // 0003 LDCONST R5 K5 - 0x7C0C0400, // 0004 CALL R3 2 - 0x60100010, // 0005 GETGBL R4 G16 - 0x5C140600, // 0006 MOVE R5 R3 + 0x58040005, // 0000 LDCONST R1 K5 + 0xA40A0C00, // 0001 IMPORT R2 K6 + 0xA40E0E00, // 0002 IMPORT R3 K7 + 0x60100010, // 0003 GETGBL R4 G16 + 0x8C140508, // 0004 GETMET R5 R2 K8 + 0x5C1C0000, // 0005 MOVE R7 R0 + 0x7C140400, // 0006 CALL R5 2 0x7C100200, // 0007 CALL R4 1 0xA8020014, // 0008 EXBLK 0 #001E 0x5C140800, // 0009 MOVE R5 R4 0x7C140000, // 000A CALL R5 0 - 0x8C180506, // 000B GETMET R6 R2 K6 + 0x8C180709, // 000B GETMET R6 R3 K9 0x5C200A00, // 000C MOVE R8 R5 - 0x58240007, // 000D LDCONST R9 K7 + 0x5824000A, // 000D LDCONST R9 K10 0x7C180600, // 000E CALL R6 3 - 0x24180D08, // 000F GT R6 R6 K8 - 0x781A000B, // 0010 JMPF R6 #001D - 0xB81A0000, // 0011 GETNGBL R6 K0 - 0x8C180D09, // 0012 GETMET R6 R6 K9 - 0x60200018, // 0013 GETGBL R8 G24 - 0x5824000A, // 0014 LDCONST R9 K10 - 0x5C280A00, // 0015 MOVE R10 R5 - 0x7C200400, // 0016 CALL R8 2 - 0x5824000B, // 0017 LDCONST R9 K11 - 0x7C180600, // 0018 CALL R6 3 - 0xB81A0000, // 0019 GETNGBL R6 K0 - 0x8C180D0C, // 001A GETMET R6 R6 K12 - 0x00200B0D, // 001B ADD R8 R5 K13 + 0x781A000C, // 000F JMPF R6 #001D + 0xB81A1600, // 0010 GETNGBL R6 K11 + 0x601C0018, // 0011 GETGBL R7 G24 + 0x5820000C, // 0012 LDCONST R8 K12 + 0x5C240000, // 0013 MOVE R9 R0 + 0x5C280A00, // 0014 MOVE R10 R5 + 0x7C1C0600, // 0015 CALL R7 3 + 0x5820000D, // 0016 LDCONST R8 K13 + 0x7C180400, // 0017 CALL R6 2 + 0xB81A0000, // 0018 GETNGBL R6 K0 + 0x8C180D0E, // 0019 GETMET R6 R6 K14 + 0x00200005, // 001A ADD R8 R0 R5 + 0x0020110F, // 001B ADD R8 R8 K15 0x7C180400, // 001C CALL R6 2 0x7001FFEA, // 001D JMP #0009 - 0x5810000E, // 001E LDCONST R4 K14 + 0x58100010, // 001E LDCONST R4 K16 0xAC100200, // 001F CATCH R4 1 0 0xB0080000, // 0020 RAISE 2 R0 R0 0x80000000, // 0021 RET 0 @@ -116,10 +149,11 @@ be_local_closure(class_Tapp_autoexec, /* name */ be_local_class(Tapp, 0, NULL, - be_nested_map(2, + be_nested_map(3, ( (struct bmapnode*) &(const bmapnode[]) { + { be_const_key(init, -1), be_const_closure(class_Tapp_init_closure) }, { be_const_key(autoexec, -1), be_const_closure(class_Tapp_autoexec_closure) }, - { be_const_key(init, 0), be_const_closure(class_Tapp_init_closure) }, + { be_const_key(autoexec_dir, -1), be_const_static_closure(class_Tapp_autoexec_dir_closure) }, })), (bstring*) &be_const_str_Tapp ); diff --git a/lib/libesp32/berry_tasmota/src/solidify/solidified_tasmota_class.h b/lib/libesp32/berry_tasmota/src/solidify/solidified_tasmota_class.h index 89485aa48..2422b1489 100644 --- a/lib/libesp32/berry_tasmota/src/solidify/solidified_tasmota_class.h +++ b/lib/libesp32/berry_tasmota/src/solidify/solidified_tasmota_class.h @@ -4,177 +4,233 @@ \********************************************************************/ #include "be_constobj.h" extern const bclass be_class_Tasmota; -// compact class 'Tasmota' ktab size: 158, total: 304 (saved 1168 bytes) -static const bvalue be_ktab_class_Tasmota[158] = { - /* K0 */ be_nested_str(i2c_enabled), - /* K1 */ be_nested_str(wire1), - /* K2 */ be_nested_str(enabled), - /* K3 */ be_nested_str(detect), - /* K4 */ be_nested_str(wire2), - /* K5 */ be_nested_str(_crons), - /* K6 */ be_const_int(0), - /* K7 */ be_nested_str(size), - /* K8 */ be_nested_str(id), - /* K9 */ be_nested_str(trig), - /* K10 */ be_const_int(1), - /* K11 */ be_nested_str(introspect), - /* K12 */ be_nested_str(function), - /* K13 */ be_nested_str(type_error), - /* K14 */ be_nested_str(BRY_X3A_X20argument_X20must_X20be_X20a_X20function), - /* K15 */ be_nested_str(ismethod), - /* K16 */ be_nested_str(BRY_X3A_X20method_X20not_X20allowed_X2C_X20use_X20a_X20closure_X20like_X20_X27_X2F_X20args_X20_X2D_X3E_X20obj_X2Efunc_X28args_X29_X27), - /* K17 */ be_nested_str(string), - /* K18 */ be_nested_str(toupper), - /* K19 */ be_nested_str(time_dump), - /* K20 */ be_nested_str(_X2504d_X2D_X2502d_X2D_X2502dT_X2502d_X3A_X2502d_X3A_X2502d), - /* K21 */ be_nested_str(year), - /* K22 */ be_nested_str(month), - /* K23 */ be_nested_str(day), - /* K24 */ be_nested_str(hour), - /* K25 */ be_nested_str(min), - /* K26 */ be_nested_str(sec), - /* K27 */ be_nested_str(match), - /* K28 */ be_nested_str(trigger), - /* K29 */ be_nested_str(_drivers), - /* K30 */ be_nested_str(find), - /* K31 */ be_nested_str(pop), - /* K32 */ be_nested_str(_rules), - /* K33 */ be_nested_str(json), - /* K34 */ be_nested_str(load), - /* K35 */ be_nested_str(log), - /* K36 */ be_nested_str(BRY_X3A_X20ERROR_X2C_X20bad_X20json_X3A_X20), - /* K37 */ be_const_int(3), - /* K38 */ be_nested_str(Tele), - /* K39 */ be_nested_str(try_rule), - /* K40 */ be_nested_str(f), - /* K41 */ be_nested_str(ccronexpr), - /* K42 */ be_nested_str(now), - /* K43 */ be_nested_str(next), - /* K44 */ be_nested_str(time_reached), - /* K45 */ be_nested_str(_defer), - /* K46 */ be_nested_str(push), - /* K47 */ be_nested_str(tasmota), - /* K48 */ be_nested_str(global), - /* K49 */ be_nested_str(deferred_ready), - /* K50 */ be_nested_str(scale_uint), - /* K51 */ be_const_int(2), - /* K52 */ be_nested_str(_fl), - /* K53 */ be_nested_str(remove), - /* K54 */ be_nested_str(check_not_method), - /* K55 */ be_nested_str(remove_rule), - /* K56 */ be_nested_str(Trigger), - /* K57 */ be_nested_str(Rule_Matcher), - /* K58 */ be_nested_str(parse), - /* K59 */ be_nested_str(value_error), - /* K60 */ be_nested_str(the_X20second_X20argument_X20is_X20not_X20a_X20function), - /* K61 */ be_nested_str(ctypes_bytes_dyn), - /* K62 */ be_nested_str(_global_addr), - /* K63 */ be_nested_str(_global_def), - /* K64 */ be_nested_str(_settings_ptr), - /* K65 */ be_nested_str(get), - /* K66 */ be_nested_str(settings), - /* K67 */ be_nested_str(toptr), - /* K68 */ be_nested_str(_settings_def), - /* K69 */ be_nested_str(wd), - /* K70 */ be_nested_str(), - /* K71 */ be_nested_str(_debug_present), - /* K72 */ be_nested_str(contains), - /* K73 */ be_nested_str(debug), - /* K74 */ be_nested_str(add_cmd), - /* K75 */ be_nested_str(UrlFetch), - /* K76 */ be_nested_str(_timers), - /* K77 */ be_nested_str(millis), - /* K78 */ be_nested_str(split), - /* K79 */ be_nested_str(_X2F), - /* K80 */ be_nested_str(index_X2Ehtml), - /* K81 */ be_nested_str(webclient), - /* K82 */ be_nested_str(set_follow_redirects), - /* K83 */ be_nested_str(begin), - /* K84 */ be_nested_str(GET), - /* K85 */ be_nested_str(status_X3A_X20), - /* K86 */ be_nested_str(connection_error), - /* K87 */ be_nested_str(write_file), - /* K88 */ be_nested_str(close), - /* K89 */ be_nested_str(BRY_X3A_X20Fetched_X20), - /* K90 */ be_nested_str(rule), - /* K91 */ be_nested_str(instance), - /* K92 */ be_nested_str(instance_X20required), - /* K93 */ be_nested_str(cmd_res), - /* K94 */ be_nested_str(o), - /* K95 */ be_const_class(be_class_Tasmota), - /* K96 */ be_nested_str(gc), - /* K97 */ be_nested_str(collect), - /* K98 */ be_nested_str(allocated), - /* K99 */ be_nested_str(add_rule), - /* K100 */ be_nested_str(every_50ms), - /* K101 */ be_nested_str(run_timers), - /* K102 */ be_nested_str(every_250ms), - /* K103 */ be_nested_str(run_cron), - /* K104 */ be_nested_str(mqtt_data), - /* K105 */ be_nested_str(cmd), - /* K106 */ be_nested_str(exec_cmd), - /* K107 */ be_nested_str(tele), - /* K108 */ be_nested_str(exec_tele), - /* K109 */ be_nested_str(exec_rules), - /* K110 */ be_nested_str(BRY_X3A_X20Exception_X3E_X20_X27_X25s_X27_X20_X2D_X20_X25s), - /* K111 */ be_nested_str(traceback), - /* K112 */ be_nested_str(save_before_restart), - /* K113 */ be_nested_str(persist), - /* K114 */ be_nested_str(save), - /* K115 */ be_nested_str(keys), - /* K116 */ be_nested_str(_X3F), - /* K117 */ be_nested_str(stop_iteration), - /* K118 */ be_nested_str(tasmota_X2Eget_light_X28_X29_X20is_X20deprecated_X2C_X20use_X20light_X2Eget_X28_X29), - /* K119 */ be_nested_str(light), - /* K120 */ be_nested_str(argument_X20must_X20be_X20a_X20function), - /* K121 */ be_nested_str(fast_loop_enabled), - /* K122 */ be_nested_str(maxlog_level), - /* K123 */ be_nested_str(_cmd), - /* K124 */ be_nested_str(run_deferred), - /* K125 */ be_nested_str(_ccmd), - /* K126 */ be_nested_str(find_key_i), - /* K127 */ be_nested_str(resolvecmnd), - /* K128 */ be_nested_str(_find_op), - /* K129 */ be_const_int(2147483647), - /* K130 */ be_nested_str(path), - /* K131 */ be_nested_str(startswith), - /* K132 */ be_nested_str(_X23), - /* K133 */ be_nested_str(_X2E), - /* K134 */ be_nested_str(_X2Ebe), - /* K135 */ be_nested_str(endswith), - /* K136 */ be_nested_str(_X2Ebec), - /* K137 */ be_nested_str(c), - /* K138 */ be_nested_str(BRY_X3A_X20file_X20extension_X20is_X20not_X20_X27_X2Ebe_X27_X20nor_X20_X27_X2Ebec_X27), - /* K139 */ be_nested_str(exists), - /* K140 */ be_nested_str(BRY_X3A_X20corrupt_X20bytecode_X20_X27_X25s_X27), - /* K141 */ be_nested_str(BRY_X3A_X20bytecode_X20has_X20wrong_X20version_X20_X27_X25s_X27_X20_X28_X25s_X29), - /* K142 */ be_nested_str(BRY_X3A_X20file_X20_X27_X25s_X27_X20does_X20not_X20have_X20_X27_X2Ebe_X27_X20extension), - /* K143 */ be_nested_str(BRY_X3A_X20cannot_X20compile_X20file_X20in_X20read_X2Donly_X20archive), - /* K144 */ be_nested_str(file), - /* K145 */ be_nested_str(BRY_X3A_X20empty_X20compiled_X20file), - /* K146 */ be_nested_str(BRY_X3A_X20failed_X20to_X20load_X20_X27_X25s_X27_X20_X28_X25s_X20_X2D_X20_X25s_X29), - /* K147 */ be_nested_str(BRY_X3A_X20could_X20not_X20save_X20compiled_X20file_X20_X25s_X20_X28_X25s_X29), - /* K148 */ be_nested_str(tasmota_X2Eset_light_X28_X29_X20is_X20deprecated_X2C_X20use_X20light_X2Eset_X28_X29), - /* K149 */ be_nested_str(set), - /* K150 */ be_nested_str(cb), - /* K151 */ be_nested_str(gen_cb), - /* K152 */ be_nested_str(http), - /* K153 */ be_nested_str(resp_cmnd_str), - /* K154 */ be_nested_str(URL_X20must_X20start_X20with_X20_X27http_X28s_X29_X27), - /* K155 */ be_nested_str(urlfetch), - /* K156 */ be_nested_str(resp_cmnd_failed), - /* K157 */ be_nested_str(resp_cmnd_done), +// compact class 'Tasmota' ktab size: 164, total: 321 (saved 1256 bytes) +static const bvalue be_ktab_class_Tasmota[164] = { + /* K0 */ be_nested_str(check_not_method), + /* K1 */ be_nested_str(_crons), + /* K2 */ be_nested_str(ccronexpr), + /* K3 */ be_nested_str(next), + /* K4 */ be_nested_str(push), + /* K5 */ be_nested_str(Trigger), + /* K6 */ be_nested_str(_rules), + /* K7 */ be_const_int(0), + /* K8 */ be_nested_str(trig), + /* K9 */ be_nested_str(rule), + /* K10 */ be_nested_str(id), + /* K11 */ be_nested_str(remove), + /* K12 */ be_const_int(1), + /* K13 */ be_nested_str(introspect), + /* K14 */ be_nested_str(function), + /* K15 */ be_nested_str(type_error), + /* K16 */ be_nested_str(BRY_X3A_X20argument_X20must_X20be_X20a_X20function), + /* K17 */ be_nested_str(ismethod), + /* K18 */ be_nested_str(BRY_X3A_X20method_X20not_X20allowed_X2C_X20use_X20a_X20closure_X20like_X20_X27_X2F_X20args_X20_X2D_X3E_X20obj_X2Efunc_X28args_X29_X27), + /* K19 */ be_nested_str(remove_rule), + /* K20 */ be_nested_str(Rule_Matcher), + /* K21 */ be_nested_str(parse), + /* K22 */ be_nested_str(value_error), + /* K23 */ be_nested_str(the_X20second_X20argument_X20is_X20not_X20a_X20function), + /* K24 */ be_nested_str(tasmota), + /* K25 */ be_nested_str(scale_uint), + /* K26 */ be_const_int(2), + /* K27 */ be_const_int(3), + /* K28 */ be_nested_str(_timers), + /* K29 */ be_nested_str(millis), + /* K30 */ be_nested_str(_ccmd), + /* K31 */ be_nested_str(json), + /* K32 */ be_nested_str(load), + /* K33 */ be_nested_str(find_key_i), + /* K34 */ be_nested_str(resolvecmnd), + /* K35 */ be_nested_str(wifi), + /* K36 */ be_nested_str(up), + /* K37 */ be_nested_str(eth), + /* K38 */ be_nested_str(_wnu), + /* K39 */ be_nested_str(_defer), + /* K40 */ be_nested_str(global), + /* K41 */ be_nested_str(deferred_ready), + /* K42 */ be_nested_str(_fl), + /* K43 */ be_nested_str(cmd_res), + /* K44 */ be_nested_str(maxlog_level), + /* K45 */ be_nested_str(_cmd), + /* K46 */ be_nested_str(size), + /* K47 */ be_nested_str(instance), + /* K48 */ be_nested_str(instance_X20required), + /* K49 */ be_nested_str(_drivers), + /* K50 */ be_nested_str(find), + /* K51 */ be_nested_str(gc), + /* K52 */ be_nested_str(collect), + /* K53 */ be_nested_str(allocated), + /* K54 */ be_const_class(be_class_Tasmota), + /* K55 */ be_nested_str(i2c_enabled), + /* K56 */ be_nested_str(wire1), + /* K57 */ be_nested_str(enabled), + /* K58 */ be_nested_str(detect), + /* K59 */ be_nested_str(wire2), + /* K60 */ be_nested_str(string), + /* K61 */ be_nested_str(toupper), + /* K62 */ be_nested_str(run_deferred), + /* K63 */ be_nested_str(time_reached), + /* K64 */ be_nested_str(f), + /* K65 */ be_nested_str(ctypes_bytes_dyn), + /* K66 */ be_nested_str(_global_addr), + /* K67 */ be_nested_str(_global_def), + /* K68 */ be_nested_str(_settings_ptr), + /* K69 */ be_nested_str(get), + /* K70 */ be_nested_str(settings), + /* K71 */ be_nested_str(toptr), + /* K72 */ be_nested_str(_settings_def), + /* K73 */ be_nested_str(wd), + /* K74 */ be_nested_str(), + /* K75 */ be_nested_str(_debug_present), + /* K76 */ be_nested_str(contains), + /* K77 */ be_nested_str(debug), + /* K78 */ be_nested_str(add_cmd), + /* K79 */ be_nested_str(UrlFetch), + /* K80 */ be_nested_str(split), + /* K81 */ be_nested_str(_X2F), + /* K82 */ be_nested_str(pop), + /* K83 */ be_nested_str(index_X2Ehtml), + /* K84 */ be_nested_str(webclient), + /* K85 */ be_nested_str(set_follow_redirects), + /* K86 */ be_nested_str(begin), + /* K87 */ be_nested_str(GET), + /* K88 */ be_nested_str(status_X3A_X20), + /* K89 */ be_nested_str(connection_error), + /* K90 */ be_nested_str(write_file), + /* K91 */ be_nested_str(close), + /* K92 */ be_nested_str(log), + /* K93 */ be_nested_str(BRY_X3A_X20Fetched_X20), + /* K94 */ be_nested_str(http), + /* K95 */ be_nested_str(resp_cmnd_str), + /* K96 */ be_nested_str(URL_X20must_X20start_X20with_X20_X27http_X28s_X29_X27), + /* K97 */ be_nested_str(urlfetch), + /* K98 */ be_nested_str(resp_cmnd_failed), + /* K99 */ be_nested_str(resp_cmnd_done), + /* K100 */ be_nested_str(BRY_X3A_X20ERROR_X2C_X20bad_X20json_X3A_X20), + /* K101 */ be_nested_str(Tele), + /* K102 */ be_nested_str(try_rule), + /* K103 */ be_nested_str(keys), + /* K104 */ be_nested_str(_X3F), + /* K105 */ be_nested_str(stop_iteration), + /* K106 */ be_nested_str(add_rule), + /* K107 */ be_nested_str(argument_X20must_X20be_X20a_X20function), + /* K108 */ be_nested_str(fast_loop_enabled), + /* K109 */ be_nested_str(now), + /* K110 */ be_nested_str(path), + /* K111 */ be_nested_str(startswith), + /* K112 */ be_nested_str(_X23), + /* K113 */ be_const_int(2147483647), + /* K114 */ be_nested_str(_X2E), + /* K115 */ be_nested_str(_X2Ebe), + /* K116 */ be_nested_str(endswith), + /* K117 */ be_nested_str(_X2Ebec), + /* K118 */ be_nested_str(c), + /* K119 */ be_nested_str(BRY_X3A_X20file_X20extension_X20is_X20not_X20_X27_X2Ebe_X27_X20nor_X20_X27_X2Ebec_X27), + /* K120 */ be_nested_str(exists), + /* K121 */ be_nested_str(BRY_X3A_X20corrupt_X20bytecode_X20_X27_X25s_X27), + /* K122 */ be_nested_str(BRY_X3A_X20bytecode_X20has_X20wrong_X20version_X20_X27_X25s_X27_X20_X28_X25s_X29), + /* K123 */ be_nested_str(o), + /* K124 */ be_nested_str(cb), + /* K125 */ be_nested_str(gen_cb), + /* K126 */ be_nested_str(every_50ms), + /* K127 */ be_nested_str(run_network_up), + /* K128 */ be_nested_str(run_timers), + /* K129 */ be_nested_str(every_250ms), + /* K130 */ be_nested_str(run_cron), + /* K131 */ be_nested_str(mqtt_data), + /* K132 */ be_nested_str(cmd), + /* K133 */ be_nested_str(exec_cmd), + /* K134 */ be_nested_str(tele), + /* K135 */ be_nested_str(exec_tele), + /* K136 */ be_nested_str(exec_rules), + /* K137 */ be_nested_str(BRY_X3A_X20Exception_X3E_X20_X27_X25s_X27_X20_X2D_X20_X25s), + /* K138 */ be_nested_str(traceback), + /* K139 */ be_nested_str(save_before_restart), + /* K140 */ be_nested_str(persist), + /* K141 */ be_nested_str(save), + /* K142 */ be_nested_str(BRY_X3A_X20Exception_X3E_X20run_network_up_X20_X27_X25s_X27_X20_X2D_X20_X25s), + /* K143 */ be_nested_str(_find_op), + /* K144 */ be_nested_str(BRY_X3A_X20file_X20_X27_X25s_X27_X20does_X20not_X20have_X20_X27_X2Ebe_X27_X20extension), + /* K145 */ be_nested_str(BRY_X3A_X20cannot_X20compile_X20file_X20in_X20read_X2Donly_X20archive), + /* K146 */ be_nested_str(file), + /* K147 */ be_nested_str(BRY_X3A_X20empty_X20compiled_X20file), + /* K148 */ be_nested_str(BRY_X3A_X20failed_X20to_X20load_X20_X27_X25s_X27_X20_X28_X25s_X20_X2D_X20_X25s_X29), + /* K149 */ be_nested_str(BRY_X3A_X20could_X20not_X20save_X20compiled_X20file_X20_X25s_X20_X28_X25s_X29), + /* K150 */ be_nested_str(tasmota_X2Eget_light_X28_X29_X20is_X20deprecated_X2C_X20use_X20light_X2Eget_X28_X29), + /* K151 */ be_nested_str(light), + /* K152 */ be_nested_str(time_dump), + /* K153 */ be_nested_str(_X2504d_X2D_X2502d_X2D_X2502dT_X2502d_X3A_X2502d_X3A_X2502d), + /* K154 */ be_nested_str(year), + /* K155 */ be_nested_str(month), + /* K156 */ be_nested_str(day), + /* K157 */ be_nested_str(hour), + /* K158 */ be_nested_str(min), + /* K159 */ be_nested_str(sec), + /* K160 */ be_nested_str(tasmota_X2Eset_light_X28_X29_X20is_X20deprecated_X2C_X20use_X20light_X2Eset_X28_X29), + /* K161 */ be_nested_str(set), + /* K162 */ be_nested_str(match), + /* K163 */ be_nested_str(trigger), }; extern const bclass be_class_Tasmota; /******************************************************************** -** Solidified function: wire_scan +** Solidified function: add_cron ********************************************************************/ -be_local_closure(class_Tasmota_wire_scan, /* name */ +be_local_closure(class_Tasmota_add_cron, /* name */ be_nested_proto( - 6, /* nstack */ + 13, /* nstack */ + 4, /* argc */ + 10, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + &be_ktab_class_Tasmota, /* shared constants */ + &be_const_str_add_cron, + &be_const_str_solidified, + ( &(const binstruction[27]) { /* code */ + 0x8C100100, // 0000 GETMET R4 R0 K0 + 0x5C180400, // 0001 MOVE R6 R2 + 0x7C100400, // 0002 CALL R4 2 + 0x88100101, // 0003 GETMBR R4 R0 K1 + 0x4C140000, // 0004 LDNIL R5 + 0x1C100805, // 0005 EQ R4 R4 R5 + 0x78120002, // 0006 JMPF R4 #000A + 0x60100012, // 0007 GETGBL R4 G18 + 0x7C100000, // 0008 CALL R4 0 + 0x90020204, // 0009 SETMBR R0 K1 R4 + 0xB8120400, // 000A GETNGBL R4 K2 + 0x60140008, // 000B GETGBL R5 G8 + 0x5C180200, // 000C MOVE R6 R1 + 0x7C140200, // 000D CALL R5 1 + 0x7C100200, // 000E CALL R4 1 + 0x8C140903, // 000F GETMET R5 R4 K3 + 0x7C140200, // 0010 CALL R5 1 + 0x88180101, // 0011 GETMBR R6 R0 K1 + 0x8C180D04, // 0012 GETMET R6 R6 K4 + 0xB8220A00, // 0013 GETNGBL R8 K5 + 0x5C240A00, // 0014 MOVE R9 R5 + 0x5C280400, // 0015 MOVE R10 R2 + 0x5C2C0600, // 0016 MOVE R11 R3 + 0x5C300800, // 0017 MOVE R12 R4 + 0x7C200800, // 0018 CALL R8 4 + 0x7C180400, // 0019 CALL R6 2 + 0x80000000, // 001A RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: remove_rule +********************************************************************/ +be_local_closure(class_Tasmota_remove_rule, /* name */ + be_nested_proto( + 7, /* nstack */ 3, /* argc */ 10, /* varg */ 0, /* has upvals */ @@ -183,82 +239,36 @@ be_local_closure(class_Tasmota_wire_scan, /* name */ NULL, /* no sub protos */ 1, /* has constants */ &be_ktab_class_Tasmota, /* shared constants */ - &be_const_str_wire_scan, + &be_const_str_remove_rule, &be_const_str_solidified, - ( &(const binstruction[33]) { /* code */ - 0x4C0C0000, // 0000 LDNIL R3 - 0x200C0403, // 0001 NE R3 R2 R3 - 0x780E0005, // 0002 JMPF R3 #0009 - 0x8C0C0100, // 0003 GETMET R3 R0 K0 - 0x5C140400, // 0004 MOVE R5 R2 - 0x7C0C0400, // 0005 CALL R3 2 - 0x740E0001, // 0006 JMPT R3 #0009 - 0x4C0C0000, // 0007 LDNIL R3 - 0x80040600, // 0008 RET 1 R3 - 0x880C0101, // 0009 GETMBR R3 R0 K1 - 0x8C0C0702, // 000A GETMET R3 R3 K2 - 0x7C0C0200, // 000B CALL R3 1 - 0x780E0006, // 000C JMPF R3 #0014 - 0x880C0101, // 000D GETMBR R3 R0 K1 - 0x8C0C0703, // 000E GETMET R3 R3 K3 - 0x5C140200, // 000F MOVE R5 R1 - 0x7C0C0400, // 0010 CALL R3 2 - 0x780E0001, // 0011 JMPF R3 #0014 - 0x880C0101, // 0012 GETMBR R3 R0 K1 - 0x80040600, // 0013 RET 1 R3 - 0x880C0104, // 0014 GETMBR R3 R0 K4 - 0x8C0C0702, // 0015 GETMET R3 R3 K2 - 0x7C0C0200, // 0016 CALL R3 1 - 0x780E0006, // 0017 JMPF R3 #001F - 0x880C0104, // 0018 GETMBR R3 R0 K4 - 0x8C0C0703, // 0019 GETMET R3 R3 K3 - 0x5C140200, // 001A MOVE R5 R1 - 0x7C0C0400, // 001B CALL R3 2 - 0x780E0001, // 001C JMPF R3 #001F - 0x880C0104, // 001D GETMBR R3 R0 K4 - 0x80040600, // 001E RET 1 R3 - 0x4C0C0000, // 001F LDNIL R3 - 0x80040600, // 0020 RET 1 R3 - }) - ) -); -/*******************************************************************/ - - -/******************************************************************** -** Solidified function: next_cron -********************************************************************/ -be_local_closure(class_Tasmota_next_cron, /* name */ - be_nested_proto( - 6, /* nstack */ - 2, /* argc */ - 10, /* varg */ - 0, /* has upvals */ - NULL, /* no upvals */ - 0, /* has sup protos */ - NULL, /* no sub protos */ - 1, /* has constants */ - &be_ktab_class_Tasmota, /* shared constants */ - &be_const_str_next_cron, - &be_const_str_solidified, - ( &(const binstruction[17]) { /* code */ - 0x88080105, // 0000 GETMBR R2 R0 K5 - 0x780A000D, // 0001 JMPF R2 #0010 - 0x580C0006, // 0002 LDCONST R3 K6 - 0x8C100507, // 0003 GETMET R4 R2 K7 - 0x7C100200, // 0004 CALL R4 1 - 0x14100604, // 0005 LT R4 R3 R4 - 0x78120008, // 0006 JMPF R4 #0010 - 0x94100403, // 0007 GETIDX R4 R2 R3 - 0x88100908, // 0008 GETMBR R4 R4 K8 - 0x1C100801, // 0009 EQ R4 R4 R1 - 0x78120002, // 000A JMPF R4 #000E - 0x94100403, // 000B GETIDX R4 R2 R3 - 0x88100909, // 000C GETMBR R4 R4 K9 - 0x80040800, // 000D RET 1 R4 - 0x000C070A, // 000E ADD R3 R3 K10 - 0x7001FFF2, // 000F JMP #0003 - 0x80000000, // 0010 RET 0 + ( &(const binstruction[27]) { /* code */ + 0x880C0106, // 0000 GETMBR R3 R0 K6 + 0x780E0017, // 0001 JMPF R3 #001A + 0x580C0007, // 0002 LDCONST R3 K7 + 0x6010000C, // 0003 GETGBL R4 G12 + 0x88140106, // 0004 GETMBR R5 R0 K6 + 0x7C100200, // 0005 CALL R4 1 + 0x14100604, // 0006 LT R4 R3 R4 + 0x78120011, // 0007 JMPF R4 #001A + 0x88100106, // 0008 GETMBR R4 R0 K6 + 0x94100803, // 0009 GETIDX R4 R4 R3 + 0x88100908, // 000A GETMBR R4 R4 K8 + 0x88100909, // 000B GETMBR R4 R4 K9 + 0x1C100801, // 000C EQ R4 R4 R1 + 0x78120009, // 000D JMPF R4 #0018 + 0x88100106, // 000E GETMBR R4 R0 K6 + 0x94100803, // 000F GETIDX R4 R4 R3 + 0x8810090A, // 0010 GETMBR R4 R4 K10 + 0x1C100802, // 0011 EQ R4 R4 R2 + 0x78120004, // 0012 JMPF R4 #0018 + 0x88100106, // 0013 GETMBR R4 R0 K6 + 0x8C10090B, // 0014 GETMET R4 R4 K11 + 0x5C180600, // 0015 MOVE R6 R3 + 0x7C100400, // 0016 CALL R4 2 + 0x70020000, // 0017 JMP #0019 + 0x000C070C, // 0018 ADD R3 R3 K12 + 0x7001FFE8, // 0019 JMP #0003 + 0x80000000, // 001A RET 0 }) ) ); @@ -282,20 +292,20 @@ be_local_closure(class_Tasmota_check_not_method, /* name */ &be_const_str_check_not_method, &be_const_str_solidified, ( &(const binstruction[15]) { /* code */ - 0xA40A1600, // 0000 IMPORT R2 K11 + 0xA40A1A00, // 0000 IMPORT R2 K13 0x600C0004, // 0001 GETGBL R3 G4 0x5C100200, // 0002 MOVE R4 R1 0x7C0C0200, // 0003 CALL R3 1 - 0x200C070C, // 0004 NE R3 R3 K12 + 0x200C070E, // 0004 NE R3 R3 K14 0x780E0000, // 0005 JMPF R3 #0007 - 0xB0061B0E, // 0006 RAISE 1 K13 K14 - 0x8C0C050F, // 0007 GETMET R3 R2 K15 + 0xB0061F10, // 0006 RAISE 1 K15 K16 + 0x8C0C0511, // 0007 GETMET R3 R2 K17 0x5C140200, // 0008 MOVE R5 R1 0x7C0C0400, // 0009 CALL R3 2 0x50100200, // 000A LDBOOL R4 1 0 0x1C0C0604, // 000B EQ R3 R3 R4 0x780E0000, // 000C JMPF R3 #000E - 0xB0061B10, // 000D RAISE 1 K13 K16 + 0xB0061F12, // 000D RAISE 1 K15 K18 0x80000000, // 000E RET 0 }) ) @@ -304,169 +314,12 @@ be_local_closure(class_Tasmota_check_not_method, /* name */ /******************************************************************** -** Solidified function: find_list_i +** Solidified function: add_rule ********************************************************************/ -be_local_closure(class_Tasmota_find_list_i, /* name */ - be_nested_proto( - 9, /* nstack */ - 3, /* argc */ - 10, /* varg */ - 0, /* has upvals */ - NULL, /* no upvals */ - 0, /* has sup protos */ - NULL, /* no sub protos */ - 1, /* has constants */ - &be_ktab_class_Tasmota, /* shared constants */ - &be_const_str_find_list_i, - &be_const_str_solidified, - ( &(const binstruction[20]) { /* code */ - 0xA40E2200, // 0000 IMPORT R3 K17 - 0x58100006, // 0001 LDCONST R4 K6 - 0x8C140712, // 0002 GETMET R5 R3 K18 - 0x5C1C0400, // 0003 MOVE R7 R2 - 0x7C140400, // 0004 CALL R5 2 - 0x6018000C, // 0005 GETGBL R6 G12 - 0x5C1C0200, // 0006 MOVE R7 R1 - 0x7C180200, // 0007 CALL R6 1 - 0x14180806, // 0008 LT R6 R4 R6 - 0x781A0007, // 0009 JMPF R6 #0012 - 0x8C180712, // 000A GETMET R6 R3 K18 - 0x94200204, // 000B GETIDX R8 R1 R4 - 0x7C180400, // 000C CALL R6 2 - 0x1C180C05, // 000D EQ R6 R6 R5 - 0x781A0000, // 000E JMPF R6 #0010 - 0x80040800, // 000F RET 1 R4 - 0x0010090A, // 0010 ADD R4 R4 K10 - 0x7001FFF2, // 0011 JMP #0005 - 0x4C180000, // 0012 LDNIL R6 - 0x80040C00, // 0013 RET 1 R6 - }) - ) -); -/*******************************************************************/ - - -/******************************************************************** -** Solidified function: time_str -********************************************************************/ -be_local_closure(class_Tasmota_time_str, /* name */ - be_nested_proto( - 11, /* nstack */ - 2, /* argc */ - 10, /* varg */ - 0, /* has upvals */ - NULL, /* no upvals */ - 0, /* has sup protos */ - NULL, /* no sub protos */ - 1, /* has constants */ - &be_ktab_class_Tasmota, /* shared constants */ - &be_const_str_time_str, - &be_const_str_solidified, - ( &(const binstruction[13]) { /* code */ - 0x8C080113, // 0000 GETMET R2 R0 K19 - 0x5C100200, // 0001 MOVE R4 R1 - 0x7C080400, // 0002 CALL R2 2 - 0x600C0018, // 0003 GETGBL R3 G24 - 0x58100014, // 0004 LDCONST R4 K20 - 0x94140515, // 0005 GETIDX R5 R2 K21 - 0x94180516, // 0006 GETIDX R6 R2 K22 - 0x941C0517, // 0007 GETIDX R7 R2 K23 - 0x94200518, // 0008 GETIDX R8 R2 K24 - 0x94240519, // 0009 GETIDX R9 R2 K25 - 0x9428051A, // 000A GETIDX R10 R2 K26 - 0x7C0C0E00, // 000B CALL R3 7 - 0x80040600, // 000C RET 1 R3 - }) - ) -); -/*******************************************************************/ - - -/******************************************************************** -** Solidified function: try_rule -********************************************************************/ -be_local_closure(class_Tasmota_try_rule, /* name */ - be_nested_proto( - 9, /* nstack */ - 4, /* argc */ - 10, /* varg */ - 0, /* has upvals */ - NULL, /* no upvals */ - 0, /* has sup protos */ - NULL, /* no sub protos */ - 1, /* has constants */ - &be_ktab_class_Tasmota, /* shared constants */ - &be_const_str_try_rule, - &be_const_str_solidified, - ( &(const binstruction[18]) { /* code */ - 0x8C10051B, // 0000 GETMET R4 R2 K27 - 0x5C180200, // 0001 MOVE R6 R1 - 0x7C100400, // 0002 CALL R4 2 - 0x4C140000, // 0003 LDNIL R5 - 0x20140805, // 0004 NE R5 R4 R5 - 0x78160009, // 0005 JMPF R5 #0010 - 0x4C140000, // 0006 LDNIL R5 - 0x20140605, // 0007 NE R5 R3 R5 - 0x78160004, // 0008 JMPF R5 #000E - 0x5C140600, // 0009 MOVE R5 R3 - 0x5C180800, // 000A MOVE R6 R4 - 0x881C051C, // 000B GETMBR R7 R2 K28 - 0x5C200200, // 000C MOVE R8 R1 - 0x7C140600, // 000D CALL R5 3 - 0x50140200, // 000E LDBOOL R5 1 0 - 0x80040A00, // 000F RET 1 R5 - 0x50140000, // 0010 LDBOOL R5 0 0 - 0x80040A00, // 0011 RET 1 R5 - }) - ) -); -/*******************************************************************/ - - -/******************************************************************** -** Solidified function: remove_driver -********************************************************************/ -be_local_closure(class_Tasmota_remove_driver, /* name */ - be_nested_proto( - 6, /* nstack */ - 2, /* argc */ - 10, /* varg */ - 0, /* has upvals */ - NULL, /* no upvals */ - 0, /* has sup protos */ - NULL, /* no sub protos */ - 1, /* has constants */ - &be_ktab_class_Tasmota, /* shared constants */ - &be_const_str_remove_driver, - &be_const_str_solidified, - ( &(const binstruction[14]) { /* code */ - 0x8808011D, // 0000 GETMBR R2 R0 K29 - 0x780A000A, // 0001 JMPF R2 #000D - 0x8808011D, // 0002 GETMBR R2 R0 K29 - 0x8C08051E, // 0003 GETMET R2 R2 K30 - 0x5C100200, // 0004 MOVE R4 R1 - 0x7C080400, // 0005 CALL R2 2 - 0x4C0C0000, // 0006 LDNIL R3 - 0x200C0403, // 0007 NE R3 R2 R3 - 0x780E0003, // 0008 JMPF R3 #000D - 0x880C011D, // 0009 GETMBR R3 R0 K29 - 0x8C0C071F, // 000A GETMET R3 R3 K31 - 0x5C140400, // 000B MOVE R5 R2 - 0x7C0C0400, // 000C CALL R3 2 - 0x80000000, // 000D RET 0 - }) - ) -); -/*******************************************************************/ - - -/******************************************************************** -** Solidified function: exec_tele -********************************************************************/ -be_local_closure(class_Tasmota_exec_tele, /* name */ +be_local_closure(class_Tasmota_add_rule, /* name */ be_nested_proto( 12, /* nstack */ - 2, /* argc */ + 5, /* argc */ 10, /* varg */ 0, /* has upvals */ NULL, /* no upvals */ @@ -474,145 +327,46 @@ be_local_closure(class_Tasmota_exec_tele, /* name */ NULL, /* no sub protos */ 1, /* has constants */ &be_ktab_class_Tasmota, /* shared constants */ - &be_const_str_exec_tele, + &be_const_str_add_rule, &be_const_str_solidified, - ( &(const binstruction[41]) { /* code */ - 0x88080120, // 0000 GETMBR R2 R0 K32 - 0x780A0024, // 0001 JMPF R2 #0027 - 0xA40A4200, // 0002 IMPORT R2 K33 - 0x8C0C0522, // 0003 GETMET R3 R2 K34 - 0x5C140200, // 0004 MOVE R5 R1 - 0x7C0C0400, // 0005 CALL R3 2 - 0x50100000, // 0006 LDBOOL R4 0 0 - 0x4C140000, // 0007 LDNIL R5 - 0x1C140605, // 0008 EQ R5 R3 R5 - 0x78160004, // 0009 JMPF R5 #000F - 0x8C140123, // 000A GETMET R5 R0 K35 - 0x001E4801, // 000B ADD R7 K36 R1 - 0x58200025, // 000C LDCONST R8 K37 - 0x7C140600, // 000D CALL R5 3 - 0x5C0C0200, // 000E MOVE R3 R1 - 0x60140013, // 000F GETGBL R5 G19 - 0x7C140000, // 0010 CALL R5 0 - 0x98164C03, // 0011 SETIDX R5 K38 R3 - 0x5C0C0A00, // 0012 MOVE R3 R5 - 0x58140006, // 0013 LDCONST R5 K6 - 0x6018000C, // 0014 GETGBL R6 G12 - 0x881C0120, // 0015 GETMBR R7 R0 K32 - 0x7C180200, // 0016 CALL R6 1 - 0x14180A06, // 0017 LT R6 R5 R6 - 0x781A000C, // 0018 JMPF R6 #0026 - 0x88180120, // 0019 GETMBR R6 R0 K32 - 0x94180C05, // 001A GETIDX R6 R6 R5 - 0x8C1C0127, // 001B GETMET R7 R0 K39 - 0x5C240600, // 001C MOVE R9 R3 - 0x88280D09, // 001D GETMBR R10 R6 K9 - 0x882C0D28, // 001E GETMBR R11 R6 K40 - 0x7C1C0800, // 001F CALL R7 4 - 0x741E0001, // 0020 JMPT R7 #0023 - 0x74120000, // 0021 JMPT R4 #0023 - 0x50100001, // 0022 LDBOOL R4 0 1 - 0x50100200, // 0023 LDBOOL R4 1 0 - 0x00140B0A, // 0024 ADD R5 R5 K10 - 0x7001FFED, // 0025 JMP #0014 - 0x80040800, // 0026 RET 1 R4 - 0x50080000, // 0027 LDBOOL R2 0 0 - 0x80040400, // 0028 RET 1 R2 - }) - ) -); -/*******************************************************************/ - - -/******************************************************************** -** Solidified function: run_cron -********************************************************************/ -be_local_closure(class_Tasmota_run_cron, /* name */ - be_nested_proto( - 9, /* nstack */ - 1, /* argc */ - 10, /* varg */ - 0, /* has upvals */ - NULL, /* no upvals */ - 0, /* has sup protos */ - NULL, /* no sub protos */ - 1, /* has constants */ - &be_ktab_class_Tasmota, /* shared constants */ - &be_const_str_run_cron, - &be_const_str_solidified, - ( &(const binstruction[34]) { /* code */ - 0x88040105, // 0000 GETMBR R1 R0 K5 - 0x7806001E, // 0001 JMPF R1 #0021 - 0x58040006, // 0002 LDCONST R1 K6 - 0xB80A5200, // 0003 GETNGBL R2 K41 - 0x8C08052A, // 0004 GETMET R2 R2 K42 - 0x7C080200, // 0005 CALL R2 1 - 0x880C0105, // 0006 GETMBR R3 R0 K5 - 0x8C0C0707, // 0007 GETMET R3 R3 K7 - 0x7C0C0200, // 0008 CALL R3 1 - 0x140C0203, // 0009 LT R3 R1 R3 - 0x780E0015, // 000A JMPF R3 #0021 - 0x880C0105, // 000B GETMBR R3 R0 K5 - 0x940C0601, // 000C GETIDX R3 R3 R1 - 0x88100709, // 000D GETMBR R4 R3 K9 - 0x1C100906, // 000E EQ R4 R4 K6 - 0x78120003, // 000F JMPF R4 #0014 - 0x8C10072B, // 0010 GETMET R4 R3 K43 - 0x7C100200, // 0011 CALL R4 1 - 0x900E1204, // 0012 SETMBR R3 K9 R4 - 0x7002000A, // 0013 JMP #001F - 0x8C10072C, // 0014 GETMET R4 R3 K44 - 0x7C100200, // 0015 CALL R4 1 - 0x78120007, // 0016 JMPF R4 #001F - 0x88100728, // 0017 GETMBR R4 R3 K40 - 0x8C14072B, // 0018 GETMET R5 R3 K43 - 0x7C140200, // 0019 CALL R5 1 - 0x900E1205, // 001A SETMBR R3 K9 R5 - 0x5C180800, // 001B MOVE R6 R4 - 0x5C1C0400, // 001C MOVE R7 R2 - 0x5C200A00, // 001D MOVE R8 R5 - 0x7C180400, // 001E CALL R6 2 - 0x0004030A, // 001F ADD R1 R1 K10 - 0x7001FFE4, // 0020 JMP #0006 - 0x80000000, // 0021 RET 0 - }) - ) -); -/*******************************************************************/ - - -/******************************************************************** -** Solidified function: defer -********************************************************************/ -be_local_closure(class_Tasmota_defer, /* name */ - be_nested_proto( - 5, /* nstack */ - 2, /* argc */ - 10, /* varg */ - 0, /* has upvals */ - NULL, /* no upvals */ - 0, /* has sup protos */ - NULL, /* no sub protos */ - 1, /* has constants */ - &be_ktab_class_Tasmota, /* shared constants */ - &be_const_str_defer, - &be_const_str_solidified, - ( &(const binstruction[15]) { /* code */ - 0x8808012D, // 0000 GETMBR R2 R0 K45 - 0x4C0C0000, // 0001 LDNIL R3 - 0x1C080403, // 0002 EQ R2 R2 R3 - 0x780A0002, // 0003 JMPF R2 #0007 - 0x60080012, // 0004 GETGBL R2 G18 - 0x7C080000, // 0005 CALL R2 0 - 0x90025A02, // 0006 SETMBR R0 K45 R2 - 0x8808012D, // 0007 GETMBR R2 R0 K45 - 0x8C08052E, // 0008 GETMET R2 R2 K46 - 0x5C100200, // 0009 MOVE R4 R1 - 0x7C080400, // 000A CALL R2 2 - 0xB80A5E00, // 000B GETNGBL R2 K47 - 0x88080530, // 000C GETMBR R2 R2 K48 - 0x900A630A, // 000D SETMBR R2 K49 K10 - 0x80000000, // 000E RET 0 + ( &(const binstruction[37]) { /* code */ + 0x8C140100, // 0000 GETMET R5 R0 K0 + 0x5C1C0400, // 0001 MOVE R7 R2 + 0x7C140400, // 0002 CALL R5 2 + 0x88140106, // 0003 GETMBR R5 R0 K6 + 0x4C180000, // 0004 LDNIL R6 + 0x1C140A06, // 0005 EQ R5 R5 R6 + 0x78160002, // 0006 JMPF R5 #000A + 0x60140012, // 0007 GETGBL R5 G18 + 0x7C140000, // 0008 CALL R5 0 + 0x90020C05, // 0009 SETMBR R0 K6 R5 + 0x60140004, // 000A GETGBL R5 G4 + 0x5C180400, // 000B MOVE R6 R2 + 0x7C140200, // 000C CALL R5 1 + 0x1C140B0E, // 000D EQ R5 R5 K14 + 0x78160013, // 000E JMPF R5 #0023 + 0x4C140000, // 000F LDNIL R5 + 0x20140605, // 0010 NE R5 R3 R5 + 0x78160003, // 0011 JMPF R5 #0016 + 0x8C140113, // 0012 GETMET R5 R0 K19 + 0x5C1C0200, // 0013 MOVE R7 R1 + 0x5C200600, // 0014 MOVE R8 R3 + 0x7C140600, // 0015 CALL R5 3 + 0x88140106, // 0016 GETMBR R5 R0 K6 + 0x8C140B04, // 0017 GETMET R5 R5 K4 + 0xB81E0A00, // 0018 GETNGBL R7 K5 + 0x88200114, // 0019 GETMBR R8 R0 K20 + 0x8C201115, // 001A GETMET R8 R8 K21 + 0x5C280200, // 001B MOVE R10 R1 + 0x7C200400, // 001C CALL R8 2 + 0x5C240400, // 001D MOVE R9 R2 + 0x5C280600, // 001E MOVE R10 R3 + 0x5C2C0800, // 001F MOVE R11 R4 + 0x7C1C0800, // 0020 CALL R7 4 + 0x7C140400, // 0021 CALL R5 2 + 0x70020000, // 0022 JMP #0024 + 0xB0062D17, // 0023 RAISE 1 K22 K23 + 0x80000000, // 0024 RET 0 }) ) ); @@ -645,7 +399,7 @@ be_local_closure(class_Tasmota_hs2rgb, /* name */ 0x541600FE, // 0006 LDINT R5 255 0x541A0167, // 0007 LDINT R6 360 0x10040206, // 0008 MOD R1 R1 R6 - 0x24180506, // 0009 GT R6 R2 K6 + 0x24180507, // 0009 GT R6 R2 K7 0x781A0031, // 000A JMPF R6 #003D 0x541A003B, // 000B LDINT R6 60 0x0C180206, // 000C DIV R6 R1 R6 @@ -653,38 +407,38 @@ be_local_closure(class_Tasmota_hs2rgb, /* name */ 0x101C0207, // 000E MOD R7 R1 R7 0x542200FE, // 000F LDINT R8 255 0x04201002, // 0010 SUB R8 R8 R2 - 0xB8265E00, // 0011 GETNGBL R9 K47 - 0x8C241332, // 0012 GETMET R9 R9 K50 + 0xB8263000, // 0011 GETNGBL R9 K24 + 0x8C241319, // 0012 GETMET R9 R9 K25 0x5C2C0E00, // 0013 MOVE R11 R7 - 0x58300006, // 0014 LDCONST R12 K6 + 0x58300007, // 0014 LDCONST R12 K7 0x5436003B, // 0015 LDINT R13 60 0x543A00FE, // 0016 LDINT R14 255 0x5C3C1000, // 0017 MOVE R15 R8 0x7C240C00, // 0018 CALL R9 6 - 0xB82A5E00, // 0019 GETNGBL R10 K47 - 0x8C281532, // 001A GETMET R10 R10 K50 + 0xB82A3000, // 0019 GETNGBL R10 K24 + 0x8C281519, // 001A GETMET R10 R10 K25 0x5C300E00, // 001B MOVE R12 R7 - 0x58340006, // 001C LDCONST R13 K6 + 0x58340007, // 001C LDCONST R13 K7 0x543A003B, // 001D LDINT R14 60 0x5C3C1000, // 001E MOVE R15 R8 0x544200FE, // 001F LDINT R16 255 0x7C280C00, // 0020 CALL R10 6 - 0x1C2C0D06, // 0021 EQ R11 R6 K6 + 0x1C2C0D07, // 0021 EQ R11 R6 K7 0x782E0002, // 0022 JMPF R11 #0026 0x5C141400, // 0023 MOVE R5 R10 0x5C101000, // 0024 MOVE R4 R8 0x70020016, // 0025 JMP #003D - 0x1C2C0D0A, // 0026 EQ R11 R6 K10 + 0x1C2C0D0C, // 0026 EQ R11 R6 K12 0x782E0002, // 0027 JMPF R11 #002B 0x5C0C1200, // 0028 MOVE R3 R9 0x5C101000, // 0029 MOVE R4 R8 0x70020011, // 002A JMP #003D - 0x1C2C0D33, // 002B EQ R11 R6 K51 + 0x1C2C0D1A, // 002B EQ R11 R6 K26 0x782E0002, // 002C JMPF R11 #0030 0x5C0C1000, // 002D MOVE R3 R8 0x5C101400, // 002E MOVE R4 R10 0x7002000C, // 002F JMP #003D - 0x1C2C0D25, // 0030 EQ R11 R6 K37 + 0x1C2C0D1B, // 0030 EQ R11 R6 K27 0x782E0002, // 0031 JMPF R11 #0035 0x5C0C1000, // 0032 MOVE R3 R8 0x5C141200, // 0033 MOVE R5 R9 @@ -710,239 +464,6 @@ be_local_closure(class_Tasmota_hs2rgb, /* name */ /*******************************************************************/ -/******************************************************************** -** Solidified function: remove_fast_loop -********************************************************************/ -be_local_closure(class_Tasmota_remove_fast_loop, /* name */ - be_nested_proto( - 6, /* nstack */ - 2, /* argc */ - 10, /* varg */ - 0, /* has upvals */ - NULL, /* no upvals */ - 0, /* has sup protos */ - NULL, /* no sub protos */ - 1, /* has constants */ - &be_ktab_class_Tasmota, /* shared constants */ - &be_const_str_remove_fast_loop, - &be_const_str_solidified, - ( &(const binstruction[15]) { /* code */ - 0x88080134, // 0000 GETMBR R2 R0 K52 - 0x740A0000, // 0001 JMPT R2 #0003 - 0x80000400, // 0002 RET 0 - 0x88080134, // 0003 GETMBR R2 R0 K52 - 0x8C08051E, // 0004 GETMET R2 R2 K30 - 0x5C100200, // 0005 MOVE R4 R1 - 0x7C080400, // 0006 CALL R2 2 - 0x4C0C0000, // 0007 LDNIL R3 - 0x200C0403, // 0008 NE R3 R2 R3 - 0x780E0003, // 0009 JMPF R3 #000E - 0x880C0134, // 000A GETMBR R3 R0 K52 - 0x8C0C0735, // 000B GETMET R3 R3 K53 - 0x5C140400, // 000C MOVE R5 R2 - 0x7C0C0400, // 000D CALL R3 2 - 0x80000000, // 000E RET 0 - }) - ) -); -/*******************************************************************/ - - -/******************************************************************** -** Solidified function: add_rule -********************************************************************/ -be_local_closure(class_Tasmota_add_rule, /* name */ - be_nested_proto( - 12, /* nstack */ - 5, /* argc */ - 10, /* varg */ - 0, /* has upvals */ - NULL, /* no upvals */ - 0, /* has sup protos */ - NULL, /* no sub protos */ - 1, /* has constants */ - &be_ktab_class_Tasmota, /* shared constants */ - &be_const_str_add_rule, - &be_const_str_solidified, - ( &(const binstruction[37]) { /* code */ - 0x8C140136, // 0000 GETMET R5 R0 K54 - 0x5C1C0400, // 0001 MOVE R7 R2 - 0x7C140400, // 0002 CALL R5 2 - 0x88140120, // 0003 GETMBR R5 R0 K32 - 0x4C180000, // 0004 LDNIL R6 - 0x1C140A06, // 0005 EQ R5 R5 R6 - 0x78160002, // 0006 JMPF R5 #000A - 0x60140012, // 0007 GETGBL R5 G18 - 0x7C140000, // 0008 CALL R5 0 - 0x90024005, // 0009 SETMBR R0 K32 R5 - 0x60140004, // 000A GETGBL R5 G4 - 0x5C180400, // 000B MOVE R6 R2 - 0x7C140200, // 000C CALL R5 1 - 0x1C140B0C, // 000D EQ R5 R5 K12 - 0x78160013, // 000E JMPF R5 #0023 - 0x4C140000, // 000F LDNIL R5 - 0x20140605, // 0010 NE R5 R3 R5 - 0x78160003, // 0011 JMPF R5 #0016 - 0x8C140137, // 0012 GETMET R5 R0 K55 - 0x5C1C0200, // 0013 MOVE R7 R1 - 0x5C200600, // 0014 MOVE R8 R3 - 0x7C140600, // 0015 CALL R5 3 - 0x88140120, // 0016 GETMBR R5 R0 K32 - 0x8C140B2E, // 0017 GETMET R5 R5 K46 - 0xB81E7000, // 0018 GETNGBL R7 K56 - 0x88200139, // 0019 GETMBR R8 R0 K57 - 0x8C20113A, // 001A GETMET R8 R8 K58 - 0x5C280200, // 001B MOVE R10 R1 - 0x7C200400, // 001C CALL R8 2 - 0x5C240400, // 001D MOVE R9 R2 - 0x5C280600, // 001E MOVE R10 R3 - 0x5C2C0800, // 001F MOVE R11 R4 - 0x7C1C0800, // 0020 CALL R7 4 - 0x7C140400, // 0021 CALL R5 2 - 0x70020000, // 0022 JMP #0024 - 0xB006773C, // 0023 RAISE 1 K59 K60 - 0x80000000, // 0024 RET 0 - }) - ) -); -/*******************************************************************/ - - -/******************************************************************** -** Solidified function: init -********************************************************************/ -be_local_closure(class_Tasmota_init, /* name */ - be_nested_proto( - 7, /* nstack */ - 1, /* argc */ - 10, /* varg */ - 0, /* has upvals */ - NULL, /* no upvals */ - 1, /* has sup protos */ - ( &(const struct bproto*[ 1]) { - be_nested_proto( - 10, /* nstack */ - 4, /* argc */ - 0, /* varg */ - 1, /* has upvals */ - ( &(const bupvaldesc[ 1]) { /* upvals */ - be_local_const_upval(1, 0), - }), - 0, /* has sup protos */ - NULL, /* no sub protos */ - 1, /* has constants */ - ( &(const bvalue[ 1]) { /* constants */ - /* K0 */ be_nested_str(urlfetch_cmd), - }), - &be_const_str__anonymous_, - &be_const_str_solidified, - ( &(const binstruction[ 8]) { /* code */ - 0x68100000, // 0000 GETUPV R4 U0 - 0x8C100900, // 0001 GETMET R4 R4 K0 - 0x5C180000, // 0002 MOVE R6 R0 - 0x5C1C0200, // 0003 MOVE R7 R1 - 0x5C200400, // 0004 MOVE R8 R2 - 0x5C240600, // 0005 MOVE R9 R3 - 0x7C100A00, // 0006 CALL R4 5 - 0x80000000, // 0007 RET 0 - }) - ), - }), - 1, /* has constants */ - &be_ktab_class_Tasmota, /* shared constants */ - &be_const_str_init, - &be_const_str_solidified, - ( &(const binstruction[34]) { /* code */ - 0xB8067A00, // 0000 GETNGBL R1 K61 - 0x8808013E, // 0001 GETMBR R2 R0 K62 - 0x880C013F, // 0002 GETMBR R3 R0 K63 - 0x7C040400, // 0003 CALL R1 2 - 0x90026001, // 0004 SETMBR R0 K48 R1 - 0xA4061600, // 0005 IMPORT R1 K11 - 0x60080015, // 0006 GETGBL R2 G21 - 0x880C0140, // 0007 GETMBR R3 R0 K64 - 0x54120003, // 0008 LDINT R4 4 - 0x7C080400, // 0009 CALL R2 2 - 0x8C080541, // 000A GETMET R2 R2 K65 - 0x58100006, // 000B LDCONST R4 K6 - 0x54160003, // 000C LDINT R5 4 - 0x7C080600, // 000D CALL R2 3 - 0x780A0006, // 000E JMPF R2 #0016 - 0xB80E7A00, // 000F GETNGBL R3 K61 - 0x8C100343, // 0010 GETMET R4 R1 K67 - 0x5C180400, // 0011 MOVE R6 R2 - 0x7C100400, // 0012 CALL R4 2 - 0x88140144, // 0013 GETMBR R5 R0 K68 - 0x7C0C0400, // 0014 CALL R3 2 - 0x90028403, // 0015 SETMBR R0 K66 R3 - 0x90028B46, // 0016 SETMBR R0 K69 K70 - 0xB80E6000, // 0017 GETNGBL R3 K48 - 0x8C0C0748, // 0018 GETMET R3 R3 K72 - 0x58140049, // 0019 LDCONST R5 K73 - 0x7C0C0400, // 001A CALL R3 2 - 0x90028E03, // 001B SETMBR R0 K71 R3 - 0x8C0C014A, // 001C GETMET R3 R0 K74 - 0x5814004B, // 001D LDCONST R5 K75 - 0x84180000, // 001E CLOSURE R6 P0 - 0x7C0C0600, // 001F CALL R3 3 - 0xA0000000, // 0020 CLOSE R0 - 0x80000000, // 0021 RET 0 - }) - ) -); -/*******************************************************************/ - - -/******************************************************************** -** Solidified function: add_cron -********************************************************************/ -be_local_closure(class_Tasmota_add_cron, /* name */ - be_nested_proto( - 13, /* nstack */ - 4, /* argc */ - 10, /* varg */ - 0, /* has upvals */ - NULL, /* no upvals */ - 0, /* has sup protos */ - NULL, /* no sub protos */ - 1, /* has constants */ - &be_ktab_class_Tasmota, /* shared constants */ - &be_const_str_add_cron, - &be_const_str_solidified, - ( &(const binstruction[27]) { /* code */ - 0x8C100136, // 0000 GETMET R4 R0 K54 - 0x5C180400, // 0001 MOVE R6 R2 - 0x7C100400, // 0002 CALL R4 2 - 0x88100105, // 0003 GETMBR R4 R0 K5 - 0x4C140000, // 0004 LDNIL R5 - 0x1C100805, // 0005 EQ R4 R4 R5 - 0x78120002, // 0006 JMPF R4 #000A - 0x60100012, // 0007 GETGBL R4 G18 - 0x7C100000, // 0008 CALL R4 0 - 0x90020A04, // 0009 SETMBR R0 K5 R4 - 0xB8125200, // 000A GETNGBL R4 K41 - 0x60140008, // 000B GETGBL R5 G8 - 0x5C180200, // 000C MOVE R6 R1 - 0x7C140200, // 000D CALL R5 1 - 0x7C100200, // 000E CALL R4 1 - 0x8C14092B, // 000F GETMET R5 R4 K43 - 0x7C140200, // 0010 CALL R5 1 - 0x88180105, // 0011 GETMBR R6 R0 K5 - 0x8C180D2E, // 0012 GETMET R6 R6 K46 - 0xB8227000, // 0013 GETNGBL R8 K56 - 0x5C240A00, // 0014 MOVE R9 R5 - 0x5C280400, // 0015 MOVE R10 R2 - 0x5C2C0600, // 0016 MOVE R11 R3 - 0x5C300800, // 0017 MOVE R12 R4 - 0x7C200800, // 0018 CALL R8 4 - 0x7C180400, // 0019 CALL R6 2 - 0x80000000, // 001A RET 0 - }) - ) -); -/*******************************************************************/ - - /******************************************************************** ** Solidified function: set_timer ********************************************************************/ @@ -960,20 +481,20 @@ be_local_closure(class_Tasmota_set_timer, /* name */ &be_const_str_set_timer, &be_const_str_solidified, ( &(const binstruction[21]) { /* code */ - 0x8C100136, // 0000 GETMET R4 R0 K54 + 0x8C100100, // 0000 GETMET R4 R0 K0 0x5C180400, // 0001 MOVE R6 R2 0x7C100400, // 0002 CALL R4 2 - 0x8810014C, // 0003 GETMBR R4 R0 K76 + 0x8810011C, // 0003 GETMBR R4 R0 K28 0x4C140000, // 0004 LDNIL R5 0x1C100805, // 0005 EQ R4 R4 R5 0x78120002, // 0006 JMPF R4 #000A 0x60100012, // 0007 GETGBL R4 G18 0x7C100000, // 0008 CALL R4 0 - 0x90029804, // 0009 SETMBR R0 K76 R4 - 0x8810014C, // 000A GETMBR R4 R0 K76 - 0x8C10092E, // 000B GETMET R4 R4 K46 - 0xB81A7000, // 000C GETNGBL R6 K56 - 0x8C1C014D, // 000D GETMET R7 R0 K77 + 0x90023804, // 0009 SETMBR R0 K28 R4 + 0x8810011C, // 000A GETMBR R4 R0 K28 + 0x8C100904, // 000B GETMET R4 R4 K4 + 0xB81A0A00, // 000C GETNGBL R6 K5 + 0x8C1C011D, // 000D GETMET R7 R0 K29 0x5C240200, // 000E MOVE R9 R1 0x7C1C0400, // 000F CALL R7 2 0x5C200400, // 0010 MOVE R8 R2 @@ -988,12 +509,12 @@ be_local_closure(class_Tasmota_set_timer, /* name */ /******************************************************************** -** Solidified function: urlfetch +** Solidified function: exec_cmd ********************************************************************/ -be_local_closure(class_Tasmota_urlfetch, /* name */ +be_local_closure(class_Tasmota_exec_cmd, /* name */ be_nested_proto( - 10, /* nstack */ - 3, /* argc */ + 12, /* nstack */ + 4, /* argc */ 10, /* varg */ 0, /* has upvals */ NULL, /* no upvals */ @@ -1001,57 +522,36 @@ be_local_closure(class_Tasmota_urlfetch, /* name */ NULL, /* no sub protos */ 1, /* has constants */ &be_ktab_class_Tasmota, /* shared constants */ - &be_const_str_urlfetch, + &be_const_str_exec_cmd, &be_const_str_solidified, - ( &(const binstruction[48]) { /* code */ - 0x4C0C0000, // 0000 LDNIL R3 - 0x1C0C0403, // 0001 EQ R3 R2 R3 - 0x780E000D, // 0002 JMPF R3 #0011 - 0xA40E2200, // 0003 IMPORT R3 K17 - 0x8C10074E, // 0004 GETMET R4 R3 K78 - 0x5C180200, // 0005 MOVE R6 R1 - 0x581C004F, // 0006 LDCONST R7 K79 - 0x7C100600, // 0007 CALL R4 3 - 0x8C10091F, // 0008 GETMET R4 R4 K31 - 0x7C100200, // 0009 CALL R4 1 - 0x5C080800, // 000A MOVE R2 R4 - 0x6010000C, // 000B GETGBL R4 G12 - 0x5C140400, // 000C MOVE R5 R2 - 0x7C100200, // 000D CALL R4 1 - 0x1C100906, // 000E EQ R4 R4 K6 - 0x78120000, // 000F JMPF R4 #0011 - 0x58080050, // 0010 LDCONST R2 K80 - 0xB80EA200, // 0011 GETNGBL R3 K81 - 0x7C0C0000, // 0012 CALL R3 0 - 0x8C100752, // 0013 GETMET R4 R3 K82 - 0x50180200, // 0014 LDBOOL R6 1 0 - 0x7C100400, // 0015 CALL R4 2 - 0x8C100753, // 0016 GETMET R4 R3 K83 - 0x5C180200, // 0017 MOVE R6 R1 - 0x7C100400, // 0018 CALL R4 2 - 0x8C100754, // 0019 GETMET R4 R3 K84 - 0x7C100200, // 001A CALL R4 1 - 0x541600C7, // 001B LDINT R5 200 - 0x20140805, // 001C NE R5 R4 R5 - 0x78160004, // 001D JMPF R5 #0023 - 0x60140008, // 001E GETGBL R5 G8 - 0x5C180800, // 001F MOVE R6 R4 - 0x7C140200, // 0020 CALL R5 1 - 0x0016AA05, // 0021 ADD R5 K85 R5 - 0xB006AC05, // 0022 RAISE 1 K86 R5 - 0x8C140757, // 0023 GETMET R5 R3 K87 - 0x5C1C0400, // 0024 MOVE R7 R2 - 0x7C140400, // 0025 CALL R5 2 - 0x8C180758, // 0026 GETMET R6 R3 K88 - 0x7C180200, // 0027 CALL R6 1 - 0x8C180123, // 0028 GETMET R6 R0 K35 - 0x60200008, // 0029 GETGBL R8 G8 - 0x5C240A00, // 002A MOVE R9 R5 - 0x7C200200, // 002B CALL R8 1 - 0x0022B208, // 002C ADD R8 K89 R8 - 0x58240025, // 002D LDCONST R9 K37 - 0x7C180600, // 002E CALL R6 3 - 0x80040800, // 002F RET 1 R4 + ( &(const binstruction[27]) { /* code */ + 0x8810011E, // 0000 GETMBR R4 R0 K30 + 0x78120016, // 0001 JMPF R4 #0019 + 0xA4123E00, // 0002 IMPORT R4 K31 + 0x8C140920, // 0003 GETMET R5 R4 K32 + 0x5C1C0600, // 0004 MOVE R7 R3 + 0x7C140400, // 0005 CALL R5 2 + 0x8C180121, // 0006 GETMET R6 R0 K33 + 0x8820011E, // 0007 GETMBR R8 R0 K30 + 0x5C240200, // 0008 MOVE R9 R1 + 0x7C180600, // 0009 CALL R6 3 + 0x4C1C0000, // 000A LDNIL R7 + 0x201C0C07, // 000B NE R7 R6 R7 + 0x781E000B, // 000C JMPF R7 #0019 + 0x8C1C0122, // 000D GETMET R7 R0 K34 + 0x5C240C00, // 000E MOVE R9 R6 + 0x7C1C0400, // 000F CALL R7 2 + 0x881C011E, // 0010 GETMBR R7 R0 K30 + 0x941C0E06, // 0011 GETIDX R7 R7 R6 + 0x5C200C00, // 0012 MOVE R8 R6 + 0x5C240400, // 0013 MOVE R9 R2 + 0x5C280600, // 0014 MOVE R10 R3 + 0x5C2C0A00, // 0015 MOVE R11 R5 + 0x7C1C0800, // 0016 CALL R7 4 + 0x501C0200, // 0017 LDBOOL R7 1 0 + 0x80040E00, // 0018 RET 1 R7 + 0x50100000, // 0019 LDBOOL R4 0 0 + 0x80040800, // 001A RET 1 R4 }) ) ); @@ -1059,11 +559,154 @@ be_local_closure(class_Tasmota_urlfetch, /* name */ /******************************************************************** -** Solidified function: remove_rule +** Solidified function: when_network_up ********************************************************************/ -be_local_closure(class_Tasmota_remove_rule, /* name */ +be_local_closure(class_Tasmota_when_network_up, /* name */ be_nested_proto( - 7, /* nstack */ + 6, /* nstack */ + 2, /* argc */ + 10, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + &be_ktab_class_Tasmota, /* shared constants */ + &be_const_str_when_network_up, + &be_const_str_solidified, + ( &(const binstruction[33]) { /* code */ + 0x8C080100, // 0000 GETMET R2 R0 K0 + 0x5C100200, // 0001 MOVE R4 R1 + 0x7C080400, // 0002 CALL R2 2 + 0xB80A3000, // 0003 GETNGBL R2 K24 + 0x8C080523, // 0004 GETMET R2 R2 K35 + 0x7C080200, // 0005 CALL R2 1 + 0x94080524, // 0006 GETIDX R2 R2 K36 + 0x740A0005, // 0007 JMPT R2 #000E + 0xB80A3000, // 0008 GETNGBL R2 K24 + 0x8C080525, // 0009 GETMET R2 R2 K37 + 0x7C080200, // 000A CALL R2 1 + 0x94080524, // 000B GETIDX R2 R2 K36 + 0x740A0000, // 000C JMPT R2 #000E + 0x50080001, // 000D LDBOOL R2 0 1 + 0x50080200, // 000E LDBOOL R2 1 0 + 0x780A0002, // 000F JMPF R2 #0013 + 0x5C0C0200, // 0010 MOVE R3 R1 + 0x7C0C0000, // 0011 CALL R3 0 + 0x7002000C, // 0012 JMP #0020 + 0x880C0126, // 0013 GETMBR R3 R0 K38 + 0x4C100000, // 0014 LDNIL R4 + 0x1C0C0604, // 0015 EQ R3 R3 R4 + 0x780E0004, // 0016 JMPF R3 #001C + 0x600C0012, // 0017 GETGBL R3 G18 + 0x7C0C0000, // 0018 CALL R3 0 + 0x40100601, // 0019 CONNECT R4 R3 R1 + 0x90024C03, // 001A SETMBR R0 K38 R3 + 0x70020003, // 001B JMP #0020 + 0x880C0126, // 001C GETMBR R3 R0 K38 + 0x8C0C0704, // 001D GETMET R3 R3 K4 + 0x5C140200, // 001E MOVE R5 R1 + 0x7C0C0400, // 001F CALL R3 2 + 0x80000000, // 0020 RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: run_deferred +********************************************************************/ +be_local_closure(class_Tasmota_run_deferred, /* name */ + be_nested_proto( + 6, /* nstack */ + 1, /* argc */ + 10, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + &be_ktab_class_Tasmota, /* shared constants */ + &be_const_str_run_deferred, + &be_const_str_solidified, + ( &(const binstruction[26]) { /* code */ + 0x88040127, // 0000 GETMBR R1 R0 K39 + 0x78060016, // 0001 JMPF R1 #0019 + 0x6004000C, // 0002 GETGBL R1 G12 + 0x88080127, // 0003 GETMBR R2 R0 K39 + 0x7C040200, // 0004 CALL R1 1 + 0x24080307, // 0005 GT R2 R1 K7 + 0x780A0009, // 0006 JMPF R2 #0011 + 0x88080127, // 0007 GETMBR R2 R0 K39 + 0x94080507, // 0008 GETIDX R2 R2 K7 + 0x880C0127, // 0009 GETMBR R3 R0 K39 + 0x8C0C070B, // 000A GETMET R3 R3 K11 + 0x58140007, // 000B LDCONST R5 K7 + 0x7C0C0400, // 000C CALL R3 2 + 0x0404030C, // 000D SUB R1 R1 K12 + 0x5C0C0400, // 000E MOVE R3 R2 + 0x7C0C0000, // 000F CALL R3 0 + 0x7001FFF3, // 0010 JMP #0005 + 0x6008000C, // 0011 GETGBL R2 G12 + 0x880C0127, // 0012 GETMBR R3 R0 K39 + 0x7C080200, // 0013 CALL R2 1 + 0x1C080507, // 0014 EQ R2 R2 K7 + 0x780A0002, // 0015 JMPF R2 #0019 + 0xB80A3000, // 0016 GETNGBL R2 K24 + 0x88080528, // 0017 GETMBR R2 R2 K40 + 0x900A5307, // 0018 SETMBR R2 K41 K7 + 0x80000000, // 0019 RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: fast_loop +********************************************************************/ +be_local_closure(class_Tasmota_fast_loop, /* name */ + be_nested_proto( + 5, /* nstack */ + 1, /* argc */ + 10, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + &be_ktab_class_Tasmota, /* shared constants */ + &be_const_str_fast_loop, + &be_const_str_solidified, + ( &(const binstruction[15]) { /* code */ + 0x8804012A, // 0000 GETMBR R1 R0 K42 + 0x5C080200, // 0001 MOVE R2 R1 + 0x740A0000, // 0002 JMPT R2 #0004 + 0x80000400, // 0003 RET 0 + 0x58080007, // 0004 LDCONST R2 K7 + 0x600C000C, // 0005 GETGBL R3 G12 + 0x5C100200, // 0006 MOVE R4 R1 + 0x7C0C0200, // 0007 CALL R3 1 + 0x140C0403, // 0008 LT R3 R2 R3 + 0x780E0003, // 0009 JMPF R3 #000E + 0x940C0202, // 000A GETIDX R3 R1 R2 + 0x7C0C0000, // 000B CALL R3 0 + 0x0008050C, // 000C ADD R2 R2 K12 + 0x7001FFF6, // 000D JMP #0005 + 0x80000000, // 000E RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: cmd +********************************************************************/ +be_local_closure(class_Tasmota_cmd, /* name */ + be_nested_proto( + 8, /* nstack */ 3, /* argc */ 10, /* varg */ 0, /* has upvals */ @@ -1072,36 +715,114 @@ be_local_closure(class_Tasmota_remove_rule, /* name */ NULL, /* no sub protos */ 1, /* has constants */ &be_ktab_class_Tasmota, /* shared constants */ - &be_const_str_remove_rule, + &be_const_str_cmd, &be_const_str_solidified, ( &(const binstruction[27]) { /* code */ - 0x880C0120, // 0000 GETMBR R3 R0 K32 - 0x780E0017, // 0001 JMPF R3 #001A - 0x580C0006, // 0002 LDCONST R3 K6 - 0x6010000C, // 0003 GETGBL R4 G12 - 0x88140120, // 0004 GETMBR R5 R0 K32 - 0x7C100200, // 0005 CALL R4 1 - 0x14100604, // 0006 LT R4 R3 R4 - 0x78120011, // 0007 JMPF R4 #001A - 0x88100120, // 0008 GETMBR R4 R0 K32 - 0x94100803, // 0009 GETIDX R4 R4 R3 - 0x88100909, // 000A GETMBR R4 R4 K9 - 0x8810095A, // 000B GETMBR R4 R4 K90 - 0x1C100801, // 000C EQ R4 R4 R1 - 0x78120009, // 000D JMPF R4 #0018 - 0x88100120, // 000E GETMBR R4 R0 K32 - 0x94100803, // 000F GETIDX R4 R4 R3 - 0x88100908, // 0010 GETMBR R4 R4 K8 - 0x1C100802, // 0011 EQ R4 R4 R2 - 0x78120004, // 0012 JMPF R4 #0018 - 0x88100120, // 0013 GETMBR R4 R0 K32 - 0x8C100935, // 0014 GETMET R4 R4 K53 - 0x5C180600, // 0015 MOVE R6 R3 - 0x7C100400, // 0016 CALL R4 2 - 0x70020000, // 0017 JMP #0019 - 0x000C070A, // 0018 ADD R3 R3 K10 - 0x7001FFE8, // 0019 JMP #0003 - 0x80000000, // 001A RET 0 + 0x880C012B, // 0000 GETMBR R3 R0 K43 + 0x50100200, // 0001 LDBOOL R4 1 0 + 0x90025604, // 0002 SETMBR R0 K43 R4 + 0xB8123000, // 0003 GETNGBL R4 K24 + 0x88100928, // 0004 GETMBR R4 R4 K40 + 0x8810092C, // 0005 GETMBR R4 R4 K44 + 0x780A0004, // 0006 JMPF R2 #000C + 0x2814091A, // 0007 GE R5 R4 K26 + 0x78160002, // 0008 JMPF R5 #000C + 0xB8163000, // 0009 GETNGBL R5 K24 + 0x88140B28, // 000A GETMBR R5 R5 K40 + 0x9016590C, // 000B SETMBR R5 K44 K12 + 0x8C14012D, // 000C GETMET R5 R0 K45 + 0x5C1C0200, // 000D MOVE R7 R1 + 0x7C140400, // 000E CALL R5 2 + 0x4C140000, // 000F LDNIL R5 + 0x8818012B, // 0010 GETMBR R6 R0 K43 + 0x501C0200, // 0011 LDBOOL R7 1 0 + 0x20180C07, // 0012 NE R6 R6 R7 + 0x781A0000, // 0013 JMPF R6 #0015 + 0x8814012B, // 0014 GETMBR R5 R0 K43 + 0x90025603, // 0015 SETMBR R0 K43 R3 + 0x780A0002, // 0016 JMPF R2 #001A + 0xB81A3000, // 0017 GETNGBL R6 K24 + 0x88180D28, // 0018 GETMBR R6 R6 K40 + 0x901A5804, // 0019 SETMBR R6 K44 R4 + 0x80040A00, // 001A RET 1 R5 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: next_cron +********************************************************************/ +be_local_closure(class_Tasmota_next_cron, /* name */ + be_nested_proto( + 6, /* nstack */ + 2, /* argc */ + 10, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + &be_ktab_class_Tasmota, /* shared constants */ + &be_const_str_next_cron, + &be_const_str_solidified, + ( &(const binstruction[17]) { /* code */ + 0x88080101, // 0000 GETMBR R2 R0 K1 + 0x780A000D, // 0001 JMPF R2 #0010 + 0x580C0007, // 0002 LDCONST R3 K7 + 0x8C10052E, // 0003 GETMET R4 R2 K46 + 0x7C100200, // 0004 CALL R4 1 + 0x14100604, // 0005 LT R4 R3 R4 + 0x78120008, // 0006 JMPF R4 #0010 + 0x94100403, // 0007 GETIDX R4 R2 R3 + 0x8810090A, // 0008 GETMBR R4 R4 K10 + 0x1C100801, // 0009 EQ R4 R4 R1 + 0x78120002, // 000A JMPF R4 #000E + 0x94100403, // 000B GETIDX R4 R2 R3 + 0x88100908, // 000C GETMBR R4 R4 K8 + 0x80040800, // 000D RET 1 R4 + 0x000C070C, // 000E ADD R3 R3 K12 + 0x7001FFF2, // 000F JMP #0003 + 0x80000000, // 0010 RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: defer +********************************************************************/ +be_local_closure(class_Tasmota_defer, /* name */ + be_nested_proto( + 5, /* nstack */ + 2, /* argc */ + 10, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + &be_ktab_class_Tasmota, /* shared constants */ + &be_const_str_defer, + &be_const_str_solidified, + ( &(const binstruction[15]) { /* code */ + 0x88080127, // 0000 GETMBR R2 R0 K39 + 0x4C0C0000, // 0001 LDNIL R3 + 0x1C080403, // 0002 EQ R2 R2 R3 + 0x780A0002, // 0003 JMPF R2 #0007 + 0x60080012, // 0004 GETGBL R2 G18 + 0x7C080000, // 0005 CALL R2 0 + 0x90024E02, // 0006 SETMBR R0 K39 R2 + 0x88080127, // 0007 GETMBR R2 R0 K39 + 0x8C080504, // 0008 GETMET R2 R2 K4 + 0x5C100200, // 0009 MOVE R4 R1 + 0x7C080400, // 000A CALL R2 2 + 0xB80A3000, // 000B GETNGBL R2 K24 + 0x88080528, // 000C GETMBR R2 R2 K40 + 0x900A530C, // 000D SETMBR R2 K41 K12 + 0x80000000, // 000E RET 0 }) ) ); @@ -1128,27 +849,27 @@ be_local_closure(class_Tasmota_add_driver, /* name */ 0x60080004, // 0000 GETGBL R2 G4 0x5C0C0200, // 0001 MOVE R3 R1 0x7C080200, // 0002 CALL R2 1 - 0x2008055B, // 0003 NE R2 R2 K91 + 0x2008052F, // 0003 NE R2 R2 K47 0x780A0000, // 0004 JMPF R2 #0006 - 0xB006775C, // 0005 RAISE 1 K59 K92 - 0x8808011D, // 0006 GETMBR R2 R0 K29 + 0xB0062D30, // 0005 RAISE 1 K22 K48 + 0x88080131, // 0006 GETMBR R2 R0 K49 0x780A000B, // 0007 JMPF R2 #0014 - 0x8808011D, // 0008 GETMBR R2 R0 K29 - 0x8C08051E, // 0009 GETMET R2 R2 K30 + 0x88080131, // 0008 GETMBR R2 R0 K49 + 0x8C080532, // 0009 GETMET R2 R2 K50 0x5C100200, // 000A MOVE R4 R1 0x7C080400, // 000B CALL R2 2 0x4C0C0000, // 000C LDNIL R3 0x1C080403, // 000D EQ R2 R2 R3 0x780A0003, // 000E JMPF R2 #0013 - 0x8808011D, // 000F GETMBR R2 R0 K29 - 0x8C08052E, // 0010 GETMET R2 R2 K46 + 0x88080131, // 000F GETMBR R2 R0 K49 + 0x8C080504, // 0010 GETMET R2 R2 K4 0x5C100200, // 0011 MOVE R4 R1 0x7C080400, // 0012 CALL R2 2 0x70020003, // 0013 JMP #0018 0x60080012, // 0014 GETGBL R2 G18 0x7C080000, // 0015 CALL R2 0 0x400C0401, // 0016 CONNECT R3 R2 R1 - 0x90023A02, // 0017 SETMBR R0 K29 R2 + 0x90026202, // 0017 SETMBR R0 K49 R2 0x80000000, // 0018 RET 0 }) ) @@ -1157,12 +878,12 @@ be_local_closure(class_Tasmota_add_driver, /* name */ /******************************************************************** -** Solidified function: exec_rules +** Solidified function: remove_timer ********************************************************************/ -be_local_closure(class_Tasmota_exec_rules, /* name */ +be_local_closure(class_Tasmota_remove_timer, /* name */ be_nested_proto( - 14, /* nstack */ - 3, /* argc */ + 7, /* nstack */ + 2, /* argc */ 10, /* varg */ 0, /* has upvals */ NULL, /* no upvals */ @@ -1170,69 +891,56 @@ be_local_closure(class_Tasmota_exec_rules, /* name */ NULL, /* no sub protos */ 1, /* has constants */ &be_ktab_class_Tasmota, /* shared constants */ - &be_const_str_exec_rules, + &be_const_str_remove_timer, &be_const_str_solidified, - ( &(const binstruction[60]) { /* code */ - 0x880C015D, // 0000 GETMBR R3 R0 K93 - 0x88100120, // 0001 GETMBR R4 R0 K32 - 0x74120002, // 0002 JMPT R4 #0006 - 0x4C100000, // 0003 LDNIL R4 - 0x20100604, // 0004 NE R4 R3 R4 - 0x78120033, // 0005 JMPF R4 #003A - 0xA4124200, // 0006 IMPORT R4 K33 - 0x4C140000, // 0007 LDNIL R5 - 0x9002BA05, // 0008 SETMBR R0 K93 R5 - 0x50140000, // 0009 LDBOOL R5 0 0 - 0x8C180922, // 000A GETMET R6 R4 K34 - 0x5C200200, // 000B MOVE R8 R1 - 0x7C180400, // 000C CALL R6 2 - 0x4C1C0000, // 000D LDNIL R7 - 0x1C1C0C07, // 000E EQ R7 R6 R7 - 0x781E0004, // 000F JMPF R7 #0015 - 0x8C1C0123, // 0010 GETMET R7 R0 K35 - 0x00264801, // 0011 ADD R9 K36 R1 - 0x58280025, // 0012 LDCONST R10 K37 - 0x7C1C0600, // 0013 CALL R7 3 - 0x5C180200, // 0014 MOVE R6 R1 - 0x780A001E, // 0015 JMPF R2 #0035 - 0x881C0120, // 0016 GETMBR R7 R0 K32 - 0x781E001C, // 0017 JMPF R7 #0035 - 0x581C0006, // 0018 LDCONST R7 K6 - 0x6020000C, // 0019 GETGBL R8 G12 - 0x88240120, // 001A GETMBR R9 R0 K32 - 0x7C200200, // 001B CALL R8 1 - 0x14200E08, // 001C LT R8 R7 R8 - 0x78220016, // 001D JMPF R8 #0035 - 0x88200120, // 001E GETMBR R8 R0 K32 - 0x94201007, // 001F GETIDX R8 R8 R7 - 0x8C240127, // 0020 GETMET R9 R0 K39 - 0x5C2C0C00, // 0021 MOVE R11 R6 - 0x88301109, // 0022 GETMBR R12 R8 K9 - 0x88341128, // 0023 GETMBR R13 R8 K40 - 0x7C240800, // 0024 CALL R9 4 - 0x74160001, // 0025 JMPT R5 #0028 - 0x74260000, // 0026 JMPT R9 #0028 - 0x50140001, // 0027 LDBOOL R5 0 1 - 0x50140200, // 0028 LDBOOL R5 1 0 - 0x78260008, // 0029 JMPF R9 #0033 - 0x8828115E, // 002A GETMBR R10 R8 K94 - 0x502C0200, // 002B LDBOOL R11 1 0 - 0x1C28140B, // 002C EQ R10 R10 R11 - 0x782A0004, // 002D JMPF R10 #0033 - 0x88280120, // 002E GETMBR R10 R0 K32 - 0x8C281535, // 002F GETMET R10 R10 K53 - 0x5C300E00, // 0030 MOVE R12 R7 - 0x7C280400, // 0031 CALL R10 2 - 0x70020000, // 0032 JMP #0034 - 0x001C0F0A, // 0033 ADD R7 R7 K10 - 0x7001FFE3, // 0034 JMP #0019 - 0x4C1C0000, // 0035 LDNIL R7 - 0x201C0607, // 0036 NE R7 R3 R7 - 0x781E0000, // 0037 JMPF R7 #0039 - 0x9002BA06, // 0038 SETMBR R0 K93 R6 - 0x80040A00, // 0039 RET 1 R5 - 0x50100000, // 003A LDBOOL R4 0 0 - 0x80040800, // 003B RET 1 R4 + ( &(const binstruction[18]) { /* code */ + 0x8808011C, // 0000 GETMBR R2 R0 K28 + 0x780A000E, // 0001 JMPF R2 #0011 + 0x580C0007, // 0002 LDCONST R3 K7 + 0x8C10052E, // 0003 GETMET R4 R2 K46 + 0x7C100200, // 0004 CALL R4 1 + 0x14100604, // 0005 LT R4 R3 R4 + 0x78120009, // 0006 JMPF R4 #0011 + 0x94100403, // 0007 GETIDX R4 R2 R3 + 0x8810090A, // 0008 GETMBR R4 R4 K10 + 0x1C100801, // 0009 EQ R4 R4 R1 + 0x78120003, // 000A JMPF R4 #000F + 0x8C10050B, // 000B GETMET R4 R2 K11 + 0x5C180600, // 000C MOVE R6 R3 + 0x7C100400, // 000D CALL R4 2 + 0x70020000, // 000E JMP #0010 + 0x000C070C, // 000F ADD R3 R3 K12 + 0x7001FFF1, // 0010 JMP #0003 + 0x80000000, // 0011 RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: gc +********************************************************************/ +be_local_closure(class_Tasmota_gc, /* name */ + be_nested_proto( + 4, /* nstack */ + 1, /* argc */ + 10, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + &be_ktab_class_Tasmota, /* shared constants */ + &be_const_str_gc, + &be_const_str_solidified, + ( &(const binstruction[ 6]) { /* code */ + 0xA4066600, // 0000 IMPORT R1 K51 + 0x8C080334, // 0001 GETMET R2 R1 K52 + 0x7C080200, // 0002 CALL R2 1 + 0x8C080335, // 0003 GETMET R2 R1 K53 + 0x7C080200, // 0004 CALL R2 1 + 0x80040400, // 0005 RET 1 R2 }) ) ); @@ -1256,7 +964,7 @@ be_local_closure(class_Tasmota_int, /* name */ &be_const_str_int, &be_const_str_solidified, ( &(const binstruction[46]) { /* code */ - 0x580C005F, // 0000 LDCONST R3 K95 + 0x580C0036, // 0000 LDCONST R3 K54 0x60100009, // 0001 GETGBL R4 G9 0x5C140000, // 0002 MOVE R5 R0 0x7C100200, // 0003 CALL R4 1 @@ -1309,41 +1017,12 @@ be_local_closure(class_Tasmota_int, /* name */ /******************************************************************** -** Solidified function: gc +** Solidified function: wire_scan ********************************************************************/ -be_local_closure(class_Tasmota_gc, /* name */ - be_nested_proto( - 4, /* nstack */ - 1, /* argc */ - 10, /* varg */ - 0, /* has upvals */ - NULL, /* no upvals */ - 0, /* has sup protos */ - NULL, /* no sub protos */ - 1, /* has constants */ - &be_ktab_class_Tasmota, /* shared constants */ - &be_const_str_gc, - &be_const_str_solidified, - ( &(const binstruction[ 6]) { /* code */ - 0xA406C000, // 0000 IMPORT R1 K96 - 0x8C080361, // 0001 GETMET R2 R1 K97 - 0x7C080200, // 0002 CALL R2 1 - 0x8C080362, // 0003 GETMET R2 R1 K98 - 0x7C080200, // 0004 CALL R2 1 - 0x80040400, // 0005 RET 1 R2 - }) - ) -); -/*******************************************************************/ - - -/******************************************************************** -** Solidified function: run_deferred -********************************************************************/ -be_local_closure(class_Tasmota_run_deferred, /* name */ +be_local_closure(class_Tasmota_wire_scan, /* name */ be_nested_proto( 6, /* nstack */ - 1, /* argc */ + 3, /* argc */ 10, /* varg */ 0, /* has upvals */ NULL, /* no upvals */ @@ -1351,35 +1030,42 @@ be_local_closure(class_Tasmota_run_deferred, /* name */ NULL, /* no sub protos */ 1, /* has constants */ &be_ktab_class_Tasmota, /* shared constants */ - &be_const_str_run_deferred, + &be_const_str_wire_scan, &be_const_str_solidified, - ( &(const binstruction[26]) { /* code */ - 0x8804012D, // 0000 GETMBR R1 R0 K45 - 0x78060016, // 0001 JMPF R1 #0019 - 0x6004000C, // 0002 GETGBL R1 G12 - 0x8808012D, // 0003 GETMBR R2 R0 K45 - 0x7C040200, // 0004 CALL R1 1 - 0x24080306, // 0005 GT R2 R1 K6 - 0x780A0009, // 0006 JMPF R2 #0011 - 0x8808012D, // 0007 GETMBR R2 R0 K45 - 0x94080506, // 0008 GETIDX R2 R2 K6 - 0x880C012D, // 0009 GETMBR R3 R0 K45 - 0x8C0C0735, // 000A GETMET R3 R3 K53 - 0x58140006, // 000B LDCONST R5 K6 - 0x7C0C0400, // 000C CALL R3 2 - 0x0404030A, // 000D SUB R1 R1 K10 - 0x5C0C0400, // 000E MOVE R3 R2 - 0x7C0C0000, // 000F CALL R3 0 - 0x7001FFF3, // 0010 JMP #0005 - 0x6008000C, // 0011 GETGBL R2 G12 - 0x880C012D, // 0012 GETMBR R3 R0 K45 - 0x7C080200, // 0013 CALL R2 1 - 0x1C080506, // 0014 EQ R2 R2 K6 - 0x780A0002, // 0015 JMPF R2 #0019 - 0xB80A5E00, // 0016 GETNGBL R2 K47 - 0x88080530, // 0017 GETMBR R2 R2 K48 - 0x900A6306, // 0018 SETMBR R2 K49 K6 - 0x80000000, // 0019 RET 0 + ( &(const binstruction[33]) { /* code */ + 0x4C0C0000, // 0000 LDNIL R3 + 0x200C0403, // 0001 NE R3 R2 R3 + 0x780E0005, // 0002 JMPF R3 #0009 + 0x8C0C0137, // 0003 GETMET R3 R0 K55 + 0x5C140400, // 0004 MOVE R5 R2 + 0x7C0C0400, // 0005 CALL R3 2 + 0x740E0001, // 0006 JMPT R3 #0009 + 0x4C0C0000, // 0007 LDNIL R3 + 0x80040600, // 0008 RET 1 R3 + 0x880C0138, // 0009 GETMBR R3 R0 K56 + 0x8C0C0739, // 000A GETMET R3 R3 K57 + 0x7C0C0200, // 000B CALL R3 1 + 0x780E0006, // 000C JMPF R3 #0014 + 0x880C0138, // 000D GETMBR R3 R0 K56 + 0x8C0C073A, // 000E GETMET R3 R3 K58 + 0x5C140200, // 000F MOVE R5 R1 + 0x7C0C0400, // 0010 CALL R3 2 + 0x780E0001, // 0011 JMPF R3 #0014 + 0x880C0138, // 0012 GETMBR R3 R0 K56 + 0x80040600, // 0013 RET 1 R3 + 0x880C013B, // 0014 GETMBR R3 R0 K59 + 0x8C0C0739, // 0015 GETMET R3 R3 K57 + 0x7C0C0200, // 0016 CALL R3 1 + 0x780E0006, // 0017 JMPF R3 #001F + 0x880C013B, // 0018 GETMBR R3 R0 K59 + 0x8C0C073A, // 0019 GETMET R3 R3 K58 + 0x5C140200, // 001A MOVE R5 R1 + 0x7C0C0400, // 001B CALL R3 2 + 0x780E0001, // 001C JMPF R3 #001F + 0x880C013B, // 001D GETMBR R3 R0 K59 + 0x80040600, // 001E RET 1 R3 + 0x4C0C0000, // 001F LDNIL R3 + 0x80040600, // 0020 RET 1 R3 }) ) ); @@ -1387,12 +1073,12 @@ be_local_closure(class_Tasmota_run_deferred, /* name */ /******************************************************************** -** Solidified function: add_rule_once +** Solidified function: remove_fast_loop ********************************************************************/ -be_local_closure(class_Tasmota_add_rule_once, /* name */ +be_local_closure(class_Tasmota_remove_fast_loop, /* name */ be_nested_proto( - 10, /* nstack */ - 4, /* argc */ + 6, /* nstack */ + 2, /* argc */ 10, /* varg */ 0, /* has upvals */ NULL, /* no upvals */ @@ -1400,15 +1086,53 @@ be_local_closure(class_Tasmota_add_rule_once, /* name */ NULL, /* no sub protos */ 1, /* has constants */ &be_ktab_class_Tasmota, /* shared constants */ - &be_const_str_add_rule_once, + &be_const_str_remove_fast_loop, + &be_const_str_solidified, + ( &(const binstruction[15]) { /* code */ + 0x8808012A, // 0000 GETMBR R2 R0 K42 + 0x740A0000, // 0001 JMPT R2 #0003 + 0x80000400, // 0002 RET 0 + 0x8808012A, // 0003 GETMBR R2 R0 K42 + 0x8C080532, // 0004 GETMET R2 R2 K50 + 0x5C100200, // 0005 MOVE R4 R1 + 0x7C080400, // 0006 CALL R2 2 + 0x4C0C0000, // 0007 LDNIL R3 + 0x200C0403, // 0008 NE R3 R2 R3 + 0x780E0003, // 0009 JMPF R3 #000E + 0x880C012A, // 000A GETMBR R3 R0 K42 + 0x8C0C070B, // 000B GETMET R3 R3 K11 + 0x5C140400, // 000C MOVE R5 R2 + 0x7C0C0400, // 000D CALL R3 2 + 0x80000000, // 000E RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: remove_cmd +********************************************************************/ +be_local_closure(class_Tasmota_remove_cmd, /* name */ + be_nested_proto( + 5, /* nstack */ + 2, /* argc */ + 10, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + &be_ktab_class_Tasmota, /* shared constants */ + &be_const_str_remove_cmd, &be_const_str_solidified, ( &(const binstruction[ 7]) { /* code */ - 0x8C100163, // 0000 GETMET R4 R0 K99 - 0x5C180200, // 0001 MOVE R6 R1 - 0x5C1C0400, // 0002 MOVE R7 R2 - 0x5C200600, // 0003 MOVE R8 R3 - 0x50240200, // 0004 LDBOOL R9 1 0 - 0x7C100A00, // 0005 CALL R4 5 + 0x8808011E, // 0000 GETMBR R2 R0 K30 + 0x780A0003, // 0001 JMPF R2 #0006 + 0x8808011E, // 0002 GETMBR R2 R0 K30 + 0x8C08050B, // 0003 GETMET R2 R2 K11 + 0x5C100200, // 0004 MOVE R4 R1 + 0x7C080400, // 0005 CALL R2 2 0x80000000, // 0006 RET 0 }) ) @@ -1416,6 +1140,49 @@ be_local_closure(class_Tasmota_add_rule_once, /* name */ /*******************************************************************/ +/******************************************************************** +** Solidified function: find_list_i +********************************************************************/ +be_local_closure(class_Tasmota_find_list_i, /* name */ + be_nested_proto( + 9, /* nstack */ + 3, /* argc */ + 10, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + &be_ktab_class_Tasmota, /* shared constants */ + &be_const_str_find_list_i, + &be_const_str_solidified, + ( &(const binstruction[20]) { /* code */ + 0xA40E7800, // 0000 IMPORT R3 K60 + 0x58100007, // 0001 LDCONST R4 K7 + 0x8C14073D, // 0002 GETMET R5 R3 K61 + 0x5C1C0400, // 0003 MOVE R7 R2 + 0x7C140400, // 0004 CALL R5 2 + 0x6018000C, // 0005 GETGBL R6 G12 + 0x5C1C0200, // 0006 MOVE R7 R1 + 0x7C180200, // 0007 CALL R6 1 + 0x14180806, // 0008 LT R6 R4 R6 + 0x781A0007, // 0009 JMPF R6 #0012 + 0x8C18073D, // 000A GETMET R6 R3 K61 + 0x94200204, // 000B GETIDX R8 R1 R4 + 0x7C180400, // 000C CALL R6 2 + 0x1C180C05, // 000D EQ R6 R6 R5 + 0x781A0000, // 000E JMPF R6 #0010 + 0x80040800, // 000F RET 1 R4 + 0x0010090C, // 0010 ADD R4 R4 K12 + 0x7001FFF2, // 0011 JMP #0005 + 0x4C180000, // 0012 LDNIL R6 + 0x80040C00, // 0013 RET 1 R6 + }) + ) +); +/*******************************************************************/ + + /******************************************************************** ** Solidified function: remove_cron ********************************************************************/ @@ -1433,22 +1200,22 @@ be_local_closure(class_Tasmota_remove_cron, /* name */ &be_const_str_remove_cron, &be_const_str_solidified, ( &(const binstruction[18]) { /* code */ - 0x88080105, // 0000 GETMBR R2 R0 K5 + 0x88080101, // 0000 GETMBR R2 R0 K1 0x780A000E, // 0001 JMPF R2 #0011 - 0x580C0006, // 0002 LDCONST R3 K6 - 0x8C100507, // 0003 GETMET R4 R2 K7 + 0x580C0007, // 0002 LDCONST R3 K7 + 0x8C10052E, // 0003 GETMET R4 R2 K46 0x7C100200, // 0004 CALL R4 1 0x14100604, // 0005 LT R4 R3 R4 0x78120009, // 0006 JMPF R4 #0011 0x94100403, // 0007 GETIDX R4 R2 R3 - 0x88100908, // 0008 GETMBR R4 R4 K8 + 0x8810090A, // 0008 GETMBR R4 R4 K10 0x1C100801, // 0009 EQ R4 R4 R1 0x78120003, // 000A JMPF R4 #000F - 0x8C100535, // 000B GETMET R4 R2 K53 + 0x8C10050B, // 000B GETMET R4 R2 K11 0x5C180600, // 000C MOVE R6 R3 0x7C100400, // 000D CALL R4 2 0x70020000, // 000E JMP #0010 - 0x000C070A, // 000F ADD R3 R3 K10 + 0x000C070C, // 000F ADD R3 R3 K12 0x7001FFF1, // 0010 JMP #0003 0x80000000, // 0011 RET 0 }) @@ -1457,363 +1224,6 @@ be_local_closure(class_Tasmota_remove_cron, /* name */ /*******************************************************************/ -/******************************************************************** -** Solidified function: fast_loop -********************************************************************/ -be_local_closure(class_Tasmota_fast_loop, /* name */ - be_nested_proto( - 5, /* nstack */ - 1, /* argc */ - 10, /* varg */ - 0, /* has upvals */ - NULL, /* no upvals */ - 0, /* has sup protos */ - NULL, /* no sub protos */ - 1, /* has constants */ - &be_ktab_class_Tasmota, /* shared constants */ - &be_const_str_fast_loop, - &be_const_str_solidified, - ( &(const binstruction[15]) { /* code */ - 0x88040134, // 0000 GETMBR R1 R0 K52 - 0x5C080200, // 0001 MOVE R2 R1 - 0x740A0000, // 0002 JMPT R2 #0004 - 0x80000400, // 0003 RET 0 - 0x58080006, // 0004 LDCONST R2 K6 - 0x600C000C, // 0005 GETGBL R3 G12 - 0x5C100200, // 0006 MOVE R4 R1 - 0x7C0C0200, // 0007 CALL R3 1 - 0x140C0403, // 0008 LT R3 R2 R3 - 0x780E0003, // 0009 JMPF R3 #000E - 0x940C0202, // 000A GETIDX R3 R1 R2 - 0x7C0C0000, // 000B CALL R3 0 - 0x0008050A, // 000C ADD R2 R2 K10 - 0x7001FFF6, // 000D JMP #0005 - 0x80000000, // 000E RET 0 - }) - ) -); -/*******************************************************************/ - - -/******************************************************************** -** Solidified function: event -********************************************************************/ -be_local_closure(class_Tasmota_event, /* name */ - be_nested_proto( - 19, /* nstack */ - 6, /* argc */ - 10, /* varg */ - 0, /* has upvals */ - NULL, /* no upvals */ - 0, /* has sup protos */ - NULL, /* no sub protos */ - 1, /* has constants */ - &be_ktab_class_Tasmota, /* shared constants */ - &be_const_str_event, - &be_const_str_solidified, - ( &(const binstruction[108]) { /* code */ - 0xA41A1600, // 0000 IMPORT R6 K11 - 0x1C1C0364, // 0001 EQ R7 R1 K100 - 0x781E0001, // 0002 JMPF R7 #0005 - 0x8C1C0165, // 0003 GETMET R7 R0 K101 - 0x7C1C0200, // 0004 CALL R7 1 - 0x1C1C0366, // 0005 EQ R7 R1 K102 - 0x781E0001, // 0006 JMPF R7 #0009 - 0x8C1C0167, // 0007 GETMET R7 R0 K103 - 0x7C1C0200, // 0008 CALL R7 1 - 0x501C0000, // 0009 LDBOOL R7 0 0 - 0x50200000, // 000A LDBOOL R8 0 0 - 0x1C240368, // 000B EQ R9 R1 K104 - 0x78260000, // 000C JMPF R9 #000E - 0x50200200, // 000D LDBOOL R8 1 0 - 0x1C240369, // 000E EQ R9 R1 K105 - 0x78260006, // 000F JMPF R9 #0017 - 0x8C24016A, // 0010 GETMET R9 R0 K106 - 0x5C2C0400, // 0011 MOVE R11 R2 - 0x5C300600, // 0012 MOVE R12 R3 - 0x5C340800, // 0013 MOVE R13 R4 - 0x7C240800, // 0014 CALL R9 4 - 0x80041200, // 0015 RET 1 R9 - 0x7002004E, // 0016 JMP #0066 - 0x1C24036B, // 0017 EQ R9 R1 K107 - 0x78260004, // 0018 JMPF R9 #001E - 0x8C24016C, // 0019 GETMET R9 R0 K108 - 0x5C2C0800, // 001A MOVE R11 R4 - 0x7C240400, // 001B CALL R9 2 - 0x80041200, // 001C RET 1 R9 - 0x70020047, // 001D JMP #0066 - 0x1C24035A, // 001E EQ R9 R1 K90 - 0x78260007, // 001F JMPF R9 #0028 - 0x8C24016D, // 0020 GETMET R9 R0 K109 - 0x5C2C0800, // 0021 MOVE R11 R4 - 0x60300017, // 0022 GETGBL R12 G23 - 0x5C340600, // 0023 MOVE R13 R3 - 0x7C300200, // 0024 CALL R12 1 - 0x7C240600, // 0025 CALL R9 3 - 0x80041200, // 0026 RET 1 R9 - 0x7002003D, // 0027 JMP #0066 - 0x1C240360, // 0028 EQ R9 R1 K96 - 0x78260003, // 0029 JMPF R9 #002E - 0x8C240160, // 002A GETMET R9 R0 K96 - 0x7C240200, // 002B CALL R9 1 - 0x80041200, // 002C RET 1 R9 - 0x70020037, // 002D JMP #0066 - 0x8824011D, // 002E GETMBR R9 R0 K29 - 0x78260035, // 002F JMPF R9 #0066 - 0x58240006, // 0030 LDCONST R9 K6 - 0x6028000C, // 0031 GETGBL R10 G12 - 0x882C011D, // 0032 GETMBR R11 R0 K29 - 0x7C280200, // 0033 CALL R10 1 - 0x1428120A, // 0034 LT R10 R9 R10 - 0x782A002F, // 0035 JMPF R10 #0066 - 0x8828011D, // 0036 GETMBR R10 R0 K29 - 0x94281409, // 0037 GETIDX R10 R10 R9 - 0x8C2C0D41, // 0038 GETMET R11 R6 K65 - 0x5C341400, // 0039 MOVE R13 R10 - 0x5C380200, // 003A MOVE R14 R1 - 0x7C2C0600, // 003B CALL R11 3 - 0x60300004, // 003C GETGBL R12 G4 - 0x5C341600, // 003D MOVE R13 R11 - 0x7C300200, // 003E CALL R12 1 - 0x1C30190C, // 003F EQ R12 R12 K12 - 0x78320022, // 0040 JMPF R12 #0064 - 0xA8020011, // 0041 EXBLK 0 #0054 - 0x5C301600, // 0042 MOVE R12 R11 - 0x5C341400, // 0043 MOVE R13 R10 - 0x5C380400, // 0044 MOVE R14 R2 - 0x5C3C0600, // 0045 MOVE R15 R3 - 0x5C400800, // 0046 MOVE R16 R4 - 0x5C440A00, // 0047 MOVE R17 R5 - 0x7C300A00, // 0048 CALL R12 5 - 0x74320001, // 0049 JMPT R12 #004C - 0x741E0000, // 004A JMPT R7 #004C - 0x501C0001, // 004B LDBOOL R7 0 1 - 0x501C0200, // 004C LDBOOL R7 1 0 - 0x781E0003, // 004D JMPF R7 #0052 - 0x5C301000, // 004E MOVE R12 R8 - 0x74320001, // 004F JMPT R12 #0052 - 0xA8040001, // 0050 EXBLK 1 1 - 0x70020013, // 0051 JMP #0066 - 0xA8040001, // 0052 EXBLK 1 1 - 0x7002000F, // 0053 JMP #0064 - 0xAC300002, // 0054 CATCH R12 0 2 - 0x7002000C, // 0055 JMP #0063 - 0x60380001, // 0056 GETGBL R14 G1 - 0x603C0018, // 0057 GETGBL R15 G24 - 0x5840006E, // 0058 LDCONST R16 K110 - 0x5C441800, // 0059 MOVE R17 R12 - 0x5C481A00, // 005A MOVE R18 R13 - 0x7C3C0600, // 005B CALL R15 3 - 0x7C380200, // 005C CALL R14 1 - 0x88380147, // 005D GETMBR R14 R0 K71 - 0x783A0002, // 005E JMPF R14 #0062 - 0xA43A9200, // 005F IMPORT R14 K73 - 0x8C3C1D6F, // 0060 GETMET R15 R14 K111 - 0x7C3C0200, // 0061 CALL R15 1 - 0x70020000, // 0062 JMP #0064 - 0xB0080000, // 0063 RAISE 2 R0 R0 - 0x0024130A, // 0064 ADD R9 R9 K10 - 0x7001FFCA, // 0065 JMP #0031 - 0x1C240370, // 0066 EQ R9 R1 K112 - 0x78260002, // 0067 JMPF R9 #006B - 0xA426E200, // 0068 IMPORT R9 K113 - 0x8C281372, // 0069 GETMET R10 R9 K114 - 0x7C280200, // 006A CALL R10 1 - 0x80040E00, // 006B RET 1 R7 - }) - ) -); -/*******************************************************************/ - - -/******************************************************************** -** Solidified function: find_key_i -********************************************************************/ -be_local_closure(class_Tasmota_find_key_i, /* name */ - be_nested_proto( - 10, /* nstack */ - 3, /* argc */ - 10, /* varg */ - 0, /* has upvals */ - NULL, /* no upvals */ - 0, /* has sup protos */ - NULL, /* no sub protos */ - 1, /* has constants */ - &be_ktab_class_Tasmota, /* shared constants */ - &be_const_str_find_key_i, - &be_const_str_solidified, - ( &(const binstruction[30]) { /* code */ - 0xA40E2200, // 0000 IMPORT R3 K17 - 0x8C100712, // 0001 GETMET R4 R3 K18 - 0x5C180400, // 0002 MOVE R6 R2 - 0x7C100400, // 0003 CALL R4 2 - 0x6014000F, // 0004 GETGBL R5 G15 - 0x5C180200, // 0005 MOVE R6 R1 - 0x601C0013, // 0006 GETGBL R7 G19 - 0x7C140400, // 0007 CALL R5 2 - 0x78160013, // 0008 JMPF R5 #001D - 0x60140010, // 0009 GETGBL R5 G16 - 0x8C180373, // 000A GETMET R6 R1 K115 - 0x7C180200, // 000B CALL R6 1 - 0x7C140200, // 000C CALL R5 1 - 0xA802000B, // 000D EXBLK 0 #001A - 0x5C180A00, // 000E MOVE R6 R5 - 0x7C180000, // 000F CALL R6 0 - 0x8C1C0712, // 0010 GETMET R7 R3 K18 - 0x5C240C00, // 0011 MOVE R9 R6 - 0x7C1C0400, // 0012 CALL R7 2 - 0x1C1C0E04, // 0013 EQ R7 R7 R4 - 0x741E0001, // 0014 JMPT R7 #0017 - 0x1C1C0574, // 0015 EQ R7 R2 K116 - 0x781E0001, // 0016 JMPF R7 #0019 - 0xA8040001, // 0017 EXBLK 1 1 - 0x80040C00, // 0018 RET 1 R6 - 0x7001FFF3, // 0019 JMP #000E - 0x58140075, // 001A LDCONST R5 K117 - 0xAC140200, // 001B CATCH R5 1 0 - 0xB0080000, // 001C RAISE 2 R0 R0 - 0x80000000, // 001D RET 0 - }) - ) -); -/*******************************************************************/ - - -/******************************************************************** -** Solidified function: get_light -********************************************************************/ -be_local_closure(class_Tasmota_get_light, /* name */ - be_nested_proto( - 6, /* nstack */ - 2, /* argc */ - 10, /* varg */ - 0, /* has upvals */ - NULL, /* no upvals */ - 0, /* has sup protos */ - NULL, /* no sub protos */ - 1, /* has constants */ - &be_ktab_class_Tasmota, /* shared constants */ - &be_const_str_get_light, - &be_const_str_solidified, - ( &(const binstruction[16]) { /* code */ - 0x60080001, // 0000 GETGBL R2 G1 - 0x580C0076, // 0001 LDCONST R3 K118 - 0x7C080200, // 0002 CALL R2 1 - 0xA40AEE00, // 0003 IMPORT R2 K119 - 0x4C0C0000, // 0004 LDNIL R3 - 0x200C0203, // 0005 NE R3 R1 R3 - 0x780E0004, // 0006 JMPF R3 #000C - 0x8C0C0541, // 0007 GETMET R3 R2 K65 - 0x5C140200, // 0008 MOVE R5 R1 - 0x7C0C0400, // 0009 CALL R3 2 - 0x80040600, // 000A RET 1 R3 - 0x70020002, // 000B JMP #000F - 0x8C0C0541, // 000C GETMET R3 R2 K65 - 0x7C0C0200, // 000D CALL R3 1 - 0x80040600, // 000E RET 1 R3 - 0x80000000, // 000F RET 0 - }) - ) -); -/*******************************************************************/ - - -/******************************************************************** -** Solidified function: add_fast_loop -********************************************************************/ -be_local_closure(class_Tasmota_add_fast_loop, /* name */ - be_nested_proto( - 5, /* nstack */ - 2, /* argc */ - 10, /* varg */ - 0, /* has upvals */ - NULL, /* no upvals */ - 0, /* has sup protos */ - NULL, /* no sub protos */ - 1, /* has constants */ - &be_ktab_class_Tasmota, /* shared constants */ - &be_const_str_add_fast_loop, - &be_const_str_solidified, - ( &(const binstruction[23]) { /* code */ - 0x8C080136, // 0000 GETMET R2 R0 K54 - 0x5C100200, // 0001 MOVE R4 R1 - 0x7C080400, // 0002 CALL R2 2 - 0x88080134, // 0003 GETMBR R2 R0 K52 - 0x4C0C0000, // 0004 LDNIL R3 - 0x1C080403, // 0005 EQ R2 R2 R3 - 0x780A0002, // 0006 JMPF R2 #000A - 0x60080012, // 0007 GETGBL R2 G18 - 0x7C080000, // 0008 CALL R2 0 - 0x90026802, // 0009 SETMBR R0 K52 R2 - 0x60080004, // 000A GETGBL R2 G4 - 0x5C0C0200, // 000B MOVE R3 R1 - 0x7C080200, // 000C CALL R2 1 - 0x2008050C, // 000D NE R2 R2 K12 - 0x780A0000, // 000E JMPF R2 #0010 - 0xB0067778, // 000F RAISE 1 K59 K120 - 0x88080130, // 0010 GETMBR R2 R0 K48 - 0x900AF30A, // 0011 SETMBR R2 K121 K10 - 0x88080134, // 0012 GETMBR R2 R0 K52 - 0x8C08052E, // 0013 GETMET R2 R2 K46 - 0x5C100200, // 0014 MOVE R4 R1 - 0x7C080400, // 0015 CALL R2 2 - 0x80000000, // 0016 RET 0 - }) - ) -); -/*******************************************************************/ - - -/******************************************************************** -** Solidified function: cmd -********************************************************************/ -be_local_closure(class_Tasmota_cmd, /* name */ - be_nested_proto( - 8, /* nstack */ - 3, /* argc */ - 10, /* varg */ - 0, /* has upvals */ - NULL, /* no upvals */ - 0, /* has sup protos */ - NULL, /* no sub protos */ - 1, /* has constants */ - &be_ktab_class_Tasmota, /* shared constants */ - &be_const_str_cmd, - &be_const_str_solidified, - ( &(const binstruction[27]) { /* code */ - 0x880C015D, // 0000 GETMBR R3 R0 K93 - 0x50100200, // 0001 LDBOOL R4 1 0 - 0x9002BA04, // 0002 SETMBR R0 K93 R4 - 0xB8125E00, // 0003 GETNGBL R4 K47 - 0x88100930, // 0004 GETMBR R4 R4 K48 - 0x8810097A, // 0005 GETMBR R4 R4 K122 - 0x780A0004, // 0006 JMPF R2 #000C - 0x28140933, // 0007 GE R5 R4 K51 - 0x78160002, // 0008 JMPF R5 #000C - 0xB8165E00, // 0009 GETNGBL R5 K47 - 0x88140B30, // 000A GETMBR R5 R5 K48 - 0x9016F50A, // 000B SETMBR R5 K122 K10 - 0x8C14017B, // 000C GETMET R5 R0 K123 - 0x5C1C0200, // 000D MOVE R7 R1 - 0x7C140400, // 000E CALL R5 2 - 0x4C140000, // 000F LDNIL R5 - 0x8818015D, // 0010 GETMBR R6 R0 K93 - 0x501C0200, // 0011 LDBOOL R7 1 0 - 0x20180C07, // 0012 NE R6 R6 R7 - 0x781A0000, // 0013 JMPF R6 #0015 - 0x8814015D, // 0014 GETMBR R5 R0 K93 - 0x9002BA03, // 0015 SETMBR R0 K93 R3 - 0x780A0002, // 0016 JMPF R2 #001A - 0xB81A5E00, // 0017 GETNGBL R6 K47 - 0x88180D30, // 0018 GETMBR R6 R6 K48 - 0x901AF404, // 0019 SETMBR R6 K122 R4 - 0x80040A00, // 001A RET 1 R5 - }) - ) -); -/*******************************************************************/ - - /******************************************************************** ** Solidified function: run_timers ********************************************************************/ @@ -1831,31 +1241,31 @@ be_local_closure(class_Tasmota_run_timers, /* name */ &be_const_str_run_timers, &be_const_str_solidified, ( &(const binstruction[27]) { /* code */ - 0x8C04017C, // 0000 GETMET R1 R0 K124 + 0x8C04013E, // 0000 GETMET R1 R0 K62 0x7C040200, // 0001 CALL R1 1 - 0x8804014C, // 0002 GETMBR R1 R0 K76 + 0x8804011C, // 0002 GETMBR R1 R0 K28 0x78060015, // 0003 JMPF R1 #001A - 0x58040006, // 0004 LDCONST R1 K6 - 0x8808014C, // 0005 GETMBR R2 R0 K76 - 0x8C080507, // 0006 GETMET R2 R2 K7 + 0x58040007, // 0004 LDCONST R1 K7 + 0x8808011C, // 0005 GETMBR R2 R0 K28 + 0x8C08052E, // 0006 GETMET R2 R2 K46 0x7C080200, // 0007 CALL R2 1 0x14080202, // 0008 LT R2 R1 R2 0x780A000F, // 0009 JMPF R2 #001A - 0x8808014C, // 000A GETMBR R2 R0 K76 + 0x8808011C, // 000A GETMBR R2 R0 K28 0x94080401, // 000B GETIDX R2 R2 R1 - 0x8C0C012C, // 000C GETMET R3 R0 K44 - 0x88140509, // 000D GETMBR R5 R2 K9 + 0x8C0C013F, // 000C GETMET R3 R0 K63 + 0x88140508, // 000D GETMBR R5 R2 K8 0x7C0C0400, // 000E CALL R3 2 0x780E0007, // 000F JMPF R3 #0018 - 0x880C0528, // 0010 GETMBR R3 R2 K40 - 0x8810014C, // 0011 GETMBR R4 R0 K76 - 0x8C100935, // 0012 GETMET R4 R4 K53 + 0x880C0540, // 0010 GETMBR R3 R2 K64 + 0x8810011C, // 0011 GETMBR R4 R0 K28 + 0x8C10090B, // 0012 GETMET R4 R4 K11 0x5C180200, // 0013 MOVE R6 R1 0x7C100400, // 0014 CALL R4 2 0x5C100600, // 0015 MOVE R4 R3 0x7C100000, // 0016 CALL R4 0 0x70020000, // 0017 JMP #0019 - 0x0004030A, // 0018 ADD R1 R1 K10 + 0x0004030C, // 0018 ADD R1 R1 K12 0x7001FFEA, // 0019 JMP #0005 0x80000000, // 001A RET 0 }) @@ -1865,49 +1275,84 @@ be_local_closure(class_Tasmota_run_timers, /* name */ /******************************************************************** -** Solidified function: exec_cmd +** Solidified function: init ********************************************************************/ -be_local_closure(class_Tasmota_exec_cmd, /* name */ +be_local_closure(class_Tasmota_init, /* name */ be_nested_proto( - 12, /* nstack */ - 4, /* argc */ + 7, /* nstack */ + 1, /* argc */ 10, /* varg */ 0, /* has upvals */ NULL, /* no upvals */ - 0, /* has sup protos */ - NULL, /* no sub protos */ + 1, /* has sup protos */ + ( &(const struct bproto*[ 1]) { + be_nested_proto( + 10, /* nstack */ + 4, /* argc */ + 0, /* varg */ + 1, /* has upvals */ + ( &(const bupvaldesc[ 1]) { /* upvals */ + be_local_const_upval(1, 0), + }), + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[ 1]) { /* constants */ + /* K0 */ be_nested_str(urlfetch_cmd), + }), + &be_const_str__anonymous_, + &be_const_str_solidified, + ( &(const binstruction[ 8]) { /* code */ + 0x68100000, // 0000 GETUPV R4 U0 + 0x8C100900, // 0001 GETMET R4 R4 K0 + 0x5C180000, // 0002 MOVE R6 R0 + 0x5C1C0200, // 0003 MOVE R7 R1 + 0x5C200400, // 0004 MOVE R8 R2 + 0x5C240600, // 0005 MOVE R9 R3 + 0x7C100A00, // 0006 CALL R4 5 + 0x80000000, // 0007 RET 0 + }) + ), + }), 1, /* has constants */ &be_ktab_class_Tasmota, /* shared constants */ - &be_const_str_exec_cmd, + &be_const_str_init, &be_const_str_solidified, - ( &(const binstruction[27]) { /* code */ - 0x8810017D, // 0000 GETMBR R4 R0 K125 - 0x78120016, // 0001 JMPF R4 #0019 - 0xA4124200, // 0002 IMPORT R4 K33 - 0x8C140922, // 0003 GETMET R5 R4 K34 - 0x5C1C0600, // 0004 MOVE R7 R3 - 0x7C140400, // 0005 CALL R5 2 - 0x8C18017E, // 0006 GETMET R6 R0 K126 - 0x8820017D, // 0007 GETMBR R8 R0 K125 - 0x5C240200, // 0008 MOVE R9 R1 - 0x7C180600, // 0009 CALL R6 3 - 0x4C1C0000, // 000A LDNIL R7 - 0x201C0C07, // 000B NE R7 R6 R7 - 0x781E000B, // 000C JMPF R7 #0019 - 0x8C1C017F, // 000D GETMET R7 R0 K127 - 0x5C240C00, // 000E MOVE R9 R6 - 0x7C1C0400, // 000F CALL R7 2 - 0x881C017D, // 0010 GETMBR R7 R0 K125 - 0x941C0E06, // 0011 GETIDX R7 R7 R6 - 0x5C200C00, // 0012 MOVE R8 R6 - 0x5C240400, // 0013 MOVE R9 R2 - 0x5C280600, // 0014 MOVE R10 R3 - 0x5C2C0A00, // 0015 MOVE R11 R5 - 0x7C1C0800, // 0016 CALL R7 4 - 0x501C0200, // 0017 LDBOOL R7 1 0 - 0x80040E00, // 0018 RET 1 R7 - 0x50100000, // 0019 LDBOOL R4 0 0 - 0x80040800, // 001A RET 1 R4 + ( &(const binstruction[34]) { /* code */ + 0xB8068200, // 0000 GETNGBL R1 K65 + 0x88080142, // 0001 GETMBR R2 R0 K66 + 0x880C0143, // 0002 GETMBR R3 R0 K67 + 0x7C040400, // 0003 CALL R1 2 + 0x90025001, // 0004 SETMBR R0 K40 R1 + 0xA4061A00, // 0005 IMPORT R1 K13 + 0x60080015, // 0006 GETGBL R2 G21 + 0x880C0144, // 0007 GETMBR R3 R0 K68 + 0x54120003, // 0008 LDINT R4 4 + 0x7C080400, // 0009 CALL R2 2 + 0x8C080545, // 000A GETMET R2 R2 K69 + 0x58100007, // 000B LDCONST R4 K7 + 0x54160003, // 000C LDINT R5 4 + 0x7C080600, // 000D CALL R2 3 + 0x780A0006, // 000E JMPF R2 #0016 + 0xB80E8200, // 000F GETNGBL R3 K65 + 0x8C100347, // 0010 GETMET R4 R1 K71 + 0x5C180400, // 0011 MOVE R6 R2 + 0x7C100400, // 0012 CALL R4 2 + 0x88140148, // 0013 GETMBR R5 R0 K72 + 0x7C0C0400, // 0014 CALL R3 2 + 0x90028C03, // 0015 SETMBR R0 K70 R3 + 0x9002934A, // 0016 SETMBR R0 K73 K74 + 0xB80E5000, // 0017 GETNGBL R3 K40 + 0x8C0C074C, // 0018 GETMET R3 R3 K76 + 0x5814004D, // 0019 LDCONST R5 K77 + 0x7C0C0400, // 001A CALL R3 2 + 0x90029603, // 001B SETMBR R0 K75 R3 + 0x8C0C014E, // 001C GETMET R3 R0 K78 + 0x5814004F, // 001D LDCONST R5 K79 + 0x84180000, // 001E CLOSURE R6 P0 + 0x7C0C0600, // 001F CALL R3 3 + 0xA0000000, // 0020 CLOSE R0 + 0x80000000, // 0021 RET 0 }) ) ); @@ -1931,25 +1376,25 @@ be_local_closure(class_Tasmota_add_cmd, /* name */ &be_const_str_add_cmd, &be_const_str_solidified, ( &(const binstruction[20]) { /* code */ - 0x8C0C0136, // 0000 GETMET R3 R0 K54 + 0x8C0C0100, // 0000 GETMET R3 R0 K0 0x5C140400, // 0001 MOVE R5 R2 0x7C0C0400, // 0002 CALL R3 2 - 0x880C017D, // 0003 GETMBR R3 R0 K125 + 0x880C011E, // 0003 GETMBR R3 R0 K30 0x4C100000, // 0004 LDNIL R4 0x1C0C0604, // 0005 EQ R3 R3 R4 0x780E0002, // 0006 JMPF R3 #000A 0x600C0013, // 0007 GETGBL R3 G19 0x7C0C0000, // 0008 CALL R3 0 - 0x9002FA03, // 0009 SETMBR R0 K125 R3 + 0x90023C03, // 0009 SETMBR R0 K30 R3 0x600C0004, // 000A GETGBL R3 G4 0x5C100400, // 000B MOVE R4 R2 0x7C0C0200, // 000C CALL R3 1 - 0x1C0C070C, // 000D EQ R3 R3 K12 + 0x1C0C070E, // 000D EQ R3 R3 K14 0x780E0002, // 000E JMPF R3 #0012 - 0x880C017D, // 000F GETMBR R3 R0 K125 + 0x880C011E, // 000F GETMBR R3 R0 K30 0x980C0202, // 0010 SETIDX R3 R1 R2 0x70020000, // 0011 JMP #0013 - 0xB006773C, // 0012 RAISE 1 K59 K60 + 0xB0062D17, // 0012 RAISE 1 K22 K23 0x80000000, // 0013 RET 0 }) ) @@ -1958,11 +1403,139 @@ be_local_closure(class_Tasmota_add_cmd, /* name */ /******************************************************************** -** Solidified function: find_op +** Solidified function: urlfetch ********************************************************************/ -be_local_closure(class_Tasmota_find_op, /* name */ +be_local_closure(class_Tasmota_urlfetch, /* name */ be_nested_proto( - 7, /* nstack */ + 10, /* nstack */ + 3, /* argc */ + 10, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + &be_ktab_class_Tasmota, /* shared constants */ + &be_const_str_urlfetch, + &be_const_str_solidified, + ( &(const binstruction[48]) { /* code */ + 0x4C0C0000, // 0000 LDNIL R3 + 0x1C0C0403, // 0001 EQ R3 R2 R3 + 0x780E000D, // 0002 JMPF R3 #0011 + 0xA40E7800, // 0003 IMPORT R3 K60 + 0x8C100750, // 0004 GETMET R4 R3 K80 + 0x5C180200, // 0005 MOVE R6 R1 + 0x581C0051, // 0006 LDCONST R7 K81 + 0x7C100600, // 0007 CALL R4 3 + 0x8C100952, // 0008 GETMET R4 R4 K82 + 0x7C100200, // 0009 CALL R4 1 + 0x5C080800, // 000A MOVE R2 R4 + 0x6010000C, // 000B GETGBL R4 G12 + 0x5C140400, // 000C MOVE R5 R2 + 0x7C100200, // 000D CALL R4 1 + 0x1C100907, // 000E EQ R4 R4 K7 + 0x78120000, // 000F JMPF R4 #0011 + 0x58080053, // 0010 LDCONST R2 K83 + 0xB80EA800, // 0011 GETNGBL R3 K84 + 0x7C0C0000, // 0012 CALL R3 0 + 0x8C100755, // 0013 GETMET R4 R3 K85 + 0x50180200, // 0014 LDBOOL R6 1 0 + 0x7C100400, // 0015 CALL R4 2 + 0x8C100756, // 0016 GETMET R4 R3 K86 + 0x5C180200, // 0017 MOVE R6 R1 + 0x7C100400, // 0018 CALL R4 2 + 0x8C100757, // 0019 GETMET R4 R3 K87 + 0x7C100200, // 001A CALL R4 1 + 0x541600C7, // 001B LDINT R5 200 + 0x20140805, // 001C NE R5 R4 R5 + 0x78160004, // 001D JMPF R5 #0023 + 0x60140008, // 001E GETGBL R5 G8 + 0x5C180800, // 001F MOVE R6 R4 + 0x7C140200, // 0020 CALL R5 1 + 0x0016B005, // 0021 ADD R5 K88 R5 + 0xB006B205, // 0022 RAISE 1 K89 R5 + 0x8C14075A, // 0023 GETMET R5 R3 K90 + 0x5C1C0400, // 0024 MOVE R7 R2 + 0x7C140400, // 0025 CALL R5 2 + 0x8C18075B, // 0026 GETMET R6 R3 K91 + 0x7C180200, // 0027 CALL R6 1 + 0x8C18015C, // 0028 GETMET R6 R0 K92 + 0x60200008, // 0029 GETGBL R8 G8 + 0x5C240A00, // 002A MOVE R9 R5 + 0x7C200200, // 002B CALL R8 1 + 0x0022BA08, // 002C ADD R8 K93 R8 + 0x5824001B, // 002D LDCONST R9 K27 + 0x7C180600, // 002E CALL R6 3 + 0x80040800, // 002F RET 1 R4 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: urlfetch_cmd +********************************************************************/ +be_local_closure(class_Tasmota_urlfetch_cmd, /* name */ + be_nested_proto( + 10, /* nstack */ + 5, /* argc */ + 10, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + &be_ktab_class_Tasmota, /* shared constants */ + &be_const_str_urlfetch_cmd, + &be_const_str_solidified, + ( &(const binstruction[34]) { /* code */ + 0xA4167800, // 0000 IMPORT R5 K60 + 0x8C180B32, // 0001 GETMET R6 R5 K50 + 0x5C200600, // 0002 MOVE R8 R3 + 0x5824005E, // 0003 LDCONST R9 K94 + 0x7C180600, // 0004 CALL R6 3 + 0x20180D07, // 0005 NE R6 R6 K7 + 0x781A0003, // 0006 JMPF R6 #000B + 0x8C18015F, // 0007 GETMET R6 R0 K95 + 0x58200060, // 0008 LDCONST R8 K96 + 0x7C180400, // 0009 CALL R6 2 + 0x80000C00, // 000A RET 0 + 0xA802000A, // 000B EXBLK 0 #0017 + 0x8C180161, // 000C GETMET R6 R0 K97 + 0x5C200600, // 000D MOVE R8 R3 + 0x7C180400, // 000E CALL R6 2 + 0x141C0D07, // 000F LT R7 R6 K7 + 0x781E0003, // 0010 JMPF R7 #0015 + 0x8C1C0162, // 0011 GETMET R7 R0 K98 + 0x7C1C0200, // 0012 CALL R7 1 + 0xA8040001, // 0013 EXBLK 1 1 + 0x80000E00, // 0014 RET 0 + 0xA8040001, // 0015 EXBLK 1 1 + 0x70020006, // 0016 JMP #001E + 0xAC180002, // 0017 CATCH R6 0 2 + 0x70020003, // 0018 JMP #001D + 0x8C200162, // 0019 GETMET R8 R0 K98 + 0x7C200200, // 001A CALL R8 1 + 0x80001000, // 001B RET 0 + 0x70020000, // 001C JMP #001E + 0xB0080000, // 001D RAISE 2 R0 R0 + 0xB81A3000, // 001E GETNGBL R6 K24 + 0x8C180D63, // 001F GETMET R6 R6 K99 + 0x7C180200, // 0020 CALL R6 1 + 0x80000000, // 0021 RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: exec_tele +********************************************************************/ +be_local_closure(class_Tasmota_exec_tele, /* name */ + be_nested_proto( + 12, /* nstack */ 2, /* argc */ 10, /* varg */ 0, /* has upvals */ @@ -1971,40 +1544,236 @@ be_local_closure(class_Tasmota_find_op, /* name */ NULL, /* no sub protos */ 1, /* has constants */ &be_ktab_class_Tasmota, /* shared constants */ - &be_const_str_find_op, + &be_const_str_exec_tele, &be_const_str_solidified, - ( &(const binstruction[31]) { /* code */ - 0x8C080180, // 0000 GETMET R2 R0 K128 + ( &(const binstruction[41]) { /* code */ + 0x88080106, // 0000 GETMBR R2 R0 K6 + 0x780A0024, // 0001 JMPF R2 #0027 + 0xA40A3E00, // 0002 IMPORT R2 K31 + 0x8C0C0520, // 0003 GETMET R3 R2 K32 + 0x5C140200, // 0004 MOVE R5 R1 + 0x7C0C0400, // 0005 CALL R3 2 + 0x50100000, // 0006 LDBOOL R4 0 0 + 0x4C140000, // 0007 LDNIL R5 + 0x1C140605, // 0008 EQ R5 R3 R5 + 0x78160004, // 0009 JMPF R5 #000F + 0x8C14015C, // 000A GETMET R5 R0 K92 + 0x001EC801, // 000B ADD R7 K100 R1 + 0x5820001B, // 000C LDCONST R8 K27 + 0x7C140600, // 000D CALL R5 3 + 0x5C0C0200, // 000E MOVE R3 R1 + 0x60140013, // 000F GETGBL R5 G19 + 0x7C140000, // 0010 CALL R5 0 + 0x9816CA03, // 0011 SETIDX R5 K101 R3 + 0x5C0C0A00, // 0012 MOVE R3 R5 + 0x58140007, // 0013 LDCONST R5 K7 + 0x6018000C, // 0014 GETGBL R6 G12 + 0x881C0106, // 0015 GETMBR R7 R0 K6 + 0x7C180200, // 0016 CALL R6 1 + 0x14180A06, // 0017 LT R6 R5 R6 + 0x781A000C, // 0018 JMPF R6 #0026 + 0x88180106, // 0019 GETMBR R6 R0 K6 + 0x94180C05, // 001A GETIDX R6 R6 R5 + 0x8C1C0166, // 001B GETMET R7 R0 K102 + 0x5C240600, // 001C MOVE R9 R3 + 0x88280D08, // 001D GETMBR R10 R6 K8 + 0x882C0D40, // 001E GETMBR R11 R6 K64 + 0x7C1C0800, // 001F CALL R7 4 + 0x741E0001, // 0020 JMPT R7 #0023 + 0x74120000, // 0021 JMPT R4 #0023 + 0x50100001, // 0022 LDBOOL R4 0 1 + 0x50100200, // 0023 LDBOOL R4 1 0 + 0x00140B0C, // 0024 ADD R5 R5 K12 + 0x7001FFED, // 0025 JMP #0014 + 0x80040800, // 0026 RET 1 R4 + 0x50080000, // 0027 LDBOOL R2 0 0 + 0x80040400, // 0028 RET 1 R2 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: find_key_i +********************************************************************/ +be_local_closure(class_Tasmota_find_key_i, /* name */ + be_nested_proto( + 10, /* nstack */ + 3, /* argc */ + 10, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + &be_ktab_class_Tasmota, /* shared constants */ + &be_const_str_find_key_i, + &be_const_str_solidified, + ( &(const binstruction[30]) { /* code */ + 0xA40E7800, // 0000 IMPORT R3 K60 + 0x8C10073D, // 0001 GETMET R4 R3 K61 + 0x5C180400, // 0002 MOVE R6 R2 + 0x7C100400, // 0003 CALL R4 2 + 0x6014000F, // 0004 GETGBL R5 G15 + 0x5C180200, // 0005 MOVE R6 R1 + 0x601C0013, // 0006 GETGBL R7 G19 + 0x7C140400, // 0007 CALL R5 2 + 0x78160013, // 0008 JMPF R5 #001D + 0x60140010, // 0009 GETGBL R5 G16 + 0x8C180367, // 000A GETMET R6 R1 K103 + 0x7C180200, // 000B CALL R6 1 + 0x7C140200, // 000C CALL R5 1 + 0xA802000B, // 000D EXBLK 0 #001A + 0x5C180A00, // 000E MOVE R6 R5 + 0x7C180000, // 000F CALL R6 0 + 0x8C1C073D, // 0010 GETMET R7 R3 K61 + 0x5C240C00, // 0011 MOVE R9 R6 + 0x7C1C0400, // 0012 CALL R7 2 + 0x1C1C0E04, // 0013 EQ R7 R7 R4 + 0x741E0001, // 0014 JMPT R7 #0017 + 0x1C1C0568, // 0015 EQ R7 R2 K104 + 0x781E0001, // 0016 JMPF R7 #0019 + 0xA8040001, // 0017 EXBLK 1 1 + 0x80040C00, // 0018 RET 1 R6 + 0x7001FFF3, // 0019 JMP #000E + 0x58140069, // 001A LDCONST R5 K105 + 0xAC140200, // 001B CATCH R5 1 0 + 0xB0080000, // 001C RAISE 2 R0 R0 + 0x80000000, // 001D RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: add_rule_once +********************************************************************/ +be_local_closure(class_Tasmota_add_rule_once, /* name */ + be_nested_proto( + 10, /* nstack */ + 4, /* argc */ + 10, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + &be_ktab_class_Tasmota, /* shared constants */ + &be_const_str_add_rule_once, + &be_const_str_solidified, + ( &(const binstruction[ 7]) { /* code */ + 0x8C10016A, // 0000 GETMET R4 R0 K106 + 0x5C180200, // 0001 MOVE R6 R1 + 0x5C1C0400, // 0002 MOVE R7 R2 + 0x5C200600, // 0003 MOVE R8 R3 + 0x50240200, // 0004 LDBOOL R9 1 0 + 0x7C100A00, // 0005 CALL R4 5 + 0x80000000, // 0006 RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: add_fast_loop +********************************************************************/ +be_local_closure(class_Tasmota_add_fast_loop, /* name */ + be_nested_proto( + 5, /* nstack */ + 2, /* argc */ + 10, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + &be_ktab_class_Tasmota, /* shared constants */ + &be_const_str_add_fast_loop, + &be_const_str_solidified, + ( &(const binstruction[23]) { /* code */ + 0x8C080100, // 0000 GETMET R2 R0 K0 0x5C100200, // 0001 MOVE R4 R1 0x7C080400, // 0002 CALL R2 2 - 0x280C0506, // 0003 GE R3 R2 K6 - 0x780E0011, // 0004 JMPF R3 #0017 - 0x540E7FFE, // 0005 LDINT R3 32767 - 0x2C0C0403, // 0006 AND R3 R2 R3 - 0x5412000F, // 0007 LDINT R4 16 - 0x3C100404, // 0008 SHR R4 R2 R4 - 0x60140012, // 0009 GETGBL R5 G18 - 0x7C140000, // 000A CALL R5 0 - 0x0418070A, // 000B SUB R6 R3 K10 - 0x401A0C06, // 000C CONNECT R6 K6 R6 - 0x94180206, // 000D GETIDX R6 R1 R6 - 0x40180A06, // 000E CONNECT R6 R5 R6 - 0x0418090A, // 000F SUB R6 R4 K10 - 0x40180606, // 0010 CONNECT R6 R3 R6 - 0x94180206, // 0011 GETIDX R6 R1 R6 - 0x40180A06, // 0012 CONNECT R6 R5 R6 - 0x40180981, // 0013 CONNECT R6 R4 K129 - 0x94180206, // 0014 GETIDX R6 R1 R6 - 0x40180A06, // 0015 CONNECT R6 R5 R6 - 0x80040A00, // 0016 RET 1 R5 - 0x600C0012, // 0017 GETGBL R3 G18 - 0x7C0C0000, // 0018 CALL R3 0 - 0x40100601, // 0019 CONNECT R4 R3 R1 - 0x4C100000, // 001A LDNIL R4 - 0x40100604, // 001B CONNECT R4 R3 R4 - 0x4C100000, // 001C LDNIL R4 - 0x40100604, // 001D CONNECT R4 R3 R4 - 0x80040600, // 001E RET 1 R3 + 0x8808012A, // 0003 GETMBR R2 R0 K42 + 0x4C0C0000, // 0004 LDNIL R3 + 0x1C080403, // 0005 EQ R2 R2 R3 + 0x780A0002, // 0006 JMPF R2 #000A + 0x60080012, // 0007 GETGBL R2 G18 + 0x7C080000, // 0008 CALL R2 0 + 0x90025402, // 0009 SETMBR R0 K42 R2 + 0x60080004, // 000A GETGBL R2 G4 + 0x5C0C0200, // 000B MOVE R3 R1 + 0x7C080200, // 000C CALL R2 1 + 0x2008050E, // 000D NE R2 R2 K14 + 0x780A0000, // 000E JMPF R2 #0010 + 0xB0062D6B, // 000F RAISE 1 K22 K107 + 0x88080128, // 0010 GETMBR R2 R0 K40 + 0x900AD90C, // 0011 SETMBR R2 K108 K12 + 0x8808012A, // 0012 GETMBR R2 R0 K42 + 0x8C080504, // 0013 GETMET R2 R2 K4 + 0x5C100200, // 0014 MOVE R4 R1 + 0x7C080400, // 0015 CALL R2 2 + 0x80000000, // 0016 RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: run_cron +********************************************************************/ +be_local_closure(class_Tasmota_run_cron, /* name */ + be_nested_proto( + 9, /* nstack */ + 1, /* argc */ + 10, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + &be_ktab_class_Tasmota, /* shared constants */ + &be_const_str_run_cron, + &be_const_str_solidified, + ( &(const binstruction[34]) { /* code */ + 0x88040101, // 0000 GETMBR R1 R0 K1 + 0x7806001E, // 0001 JMPF R1 #0021 + 0x58040007, // 0002 LDCONST R1 K7 + 0xB80A0400, // 0003 GETNGBL R2 K2 + 0x8C08056D, // 0004 GETMET R2 R2 K109 + 0x7C080200, // 0005 CALL R2 1 + 0x880C0101, // 0006 GETMBR R3 R0 K1 + 0x8C0C072E, // 0007 GETMET R3 R3 K46 + 0x7C0C0200, // 0008 CALL R3 1 + 0x140C0203, // 0009 LT R3 R1 R3 + 0x780E0015, // 000A JMPF R3 #0021 + 0x880C0101, // 000B GETMBR R3 R0 K1 + 0x940C0601, // 000C GETIDX R3 R3 R1 + 0x88100708, // 000D GETMBR R4 R3 K8 + 0x1C100907, // 000E EQ R4 R4 K7 + 0x78120003, // 000F JMPF R4 #0014 + 0x8C100703, // 0010 GETMET R4 R3 K3 + 0x7C100200, // 0011 CALL R4 1 + 0x900E1004, // 0012 SETMBR R3 K8 R4 + 0x7002000A, // 0013 JMP #001F + 0x8C10073F, // 0014 GETMET R4 R3 K63 + 0x7C100200, // 0015 CALL R4 1 + 0x78120007, // 0016 JMPF R4 #001F + 0x88100740, // 0017 GETMBR R4 R3 K64 + 0x8C140703, // 0018 GETMET R5 R3 K3 + 0x7C140200, // 0019 CALL R5 1 + 0x900E1005, // 001A SETMBR R3 K8 R5 + 0x5C180800, // 001B MOVE R6 R4 + 0x5C1C0400, // 001C MOVE R7 R2 + 0x5C200A00, // 001D MOVE R8 R5 + 0x7C180400, // 001E CALL R6 2 + 0x0004030C, // 001F ADD R1 R1 K12 + 0x7001FFE4, // 0020 JMP #0006 + 0x80000000, // 0021 RET 0 }) ) ); @@ -2294,72 +2063,72 @@ be_local_closure(class_Tasmota_load, /* name */ 0x84140003, // 0003 CLOSURE R5 P3 0x84180004, // 0004 CLOSURE R6 P4 0x841C0005, // 0005 CLOSURE R7 P5 - 0xA4222200, // 0006 IMPORT R8 K17 - 0xA4270400, // 0007 IMPORT R9 K130 + 0xA4227800, // 0006 IMPORT R8 K60 + 0xA426DC00, // 0007 IMPORT R9 K110 0x6028000C, // 0008 GETGBL R10 G12 0x5C2C0200, // 0009 MOVE R11 R1 0x7C280200, // 000A CALL R10 1 - 0x1C281506, // 000B EQ R10 R10 K6 + 0x1C281507, // 000B EQ R10 R10 K7 0x782A0002, // 000C JMPF R10 #0010 0x50280000, // 000D LDBOOL R10 0 0 0xA0000000, // 000E CLOSE R0 0x80041400, // 000F RET 1 R10 - 0x8C281183, // 0010 GETMET R10 R8 K131 + 0x8C28116F, // 0010 GETMET R10 R8 K111 0x5C300200, // 0011 MOVE R12 R1 - 0x5834004F, // 0012 LDCONST R13 K79 + 0x58340051, // 0012 LDCONST R13 K81 0x7C280600, // 0013 CALL R10 3 0x742A0000, // 0014 JMPT R10 #0016 - 0x00069E01, // 0015 ADD R1 K79 R1 - 0x8C28111E, // 0016 GETMET R10 R8 K30 + 0x0006A201, // 0015 ADD R1 K81 R1 + 0x8C281132, // 0016 GETMET R10 R8 K50 0x5C300200, // 0017 MOVE R12 R1 - 0x58340084, // 0018 LDCONST R13 K132 + 0x58340070, // 0018 LDCONST R13 K112 0x7C280600, // 0019 CALL R10 3 - 0x242C1506, // 001A GT R11 R10 K6 + 0x242C1507, // 001A GT R11 R10 K7 0x782E0003, // 001B JMPF R11 #0020 - 0x0430150A, // 001C SUB R12 R10 K10 - 0x40320C0C, // 001D CONNECT R12 K6 R12 + 0x0430150C, // 001C SUB R12 R10 K12 + 0x40320E0C, // 001D CONNECT R12 K7 R12 0x9430020C, // 001E GETIDX R12 R1 R12 0x70020000, // 001F JMP #0021 0x5C300200, // 0020 MOVE R12 R1 0x782E0003, // 0021 JMPF R11 #0026 - 0x0034150A, // 0022 ADD R13 R10 K10 - 0x40341B81, // 0023 CONNECT R13 R13 K129 + 0x0034150C, // 0022 ADD R13 R10 K12 + 0x40341B71, // 0023 CONNECT R13 R13 K113 0x9434020D, // 0024 GETIDX R13 R1 R13 0x70020000, // 0025 JMP #0027 0x5C340200, // 0026 MOVE R13 R1 - 0x8C38111E, // 0027 GETMET R14 R8 K30 + 0x8C381132, // 0027 GETMET R14 R8 K50 0x5C401A00, // 0028 MOVE R16 R13 - 0x58440085, // 0029 LDCONST R17 K133 + 0x58440072, // 0029 LDCONST R17 K114 0x7C380600, // 002A CALL R14 3 - 0x14381D06, // 002B LT R14 R14 K6 + 0x14381D07, // 002B LT R14 R14 K7 0x783A0001, // 002C JMPF R14 #002F - 0x00040386, // 002D ADD R1 R1 K134 - 0x00341B86, // 002E ADD R13 R13 K134 - 0x8C381187, // 002F GETMET R14 R8 K135 + 0x00040373, // 002D ADD R1 R1 K115 + 0x00341B73, // 002E ADD R13 R13 K115 + 0x8C381174, // 002F GETMET R14 R8 K116 0x5C401A00, // 0030 MOVE R16 R13 - 0x58440086, // 0031 LDCONST R17 K134 + 0x58440073, // 0031 LDCONST R17 K115 0x7C380600, // 0032 CALL R14 3 - 0x8C3C1187, // 0033 GETMET R15 R8 K135 + 0x8C3C1174, // 0033 GETMET R15 R8 K116 0x5C441A00, // 0034 MOVE R17 R13 - 0x58480088, // 0035 LDCONST R18 K136 + 0x58480075, // 0035 LDCONST R18 K117 0x7C3C0600, // 0036 CALL R15 3 0x783E0001, // 0037 JMPF R15 #003A 0x5C400200, // 0038 MOVE R16 R1 0x70020000, // 0039 JMP #003B - 0x00400389, // 003A ADD R16 R1 K137 + 0x00400376, // 003A ADD R16 R1 K118 0x5C441C00, // 003B MOVE R17 R14 0x74460007, // 003C JMPT R17 #0045 0x5C441E00, // 003D MOVE R17 R15 0x74460005, // 003E JMPT R17 #0045 0x60440001, // 003F GETGBL R17 G1 - 0x5848008A, // 0040 LDCONST R18 K138 + 0x58480077, // 0040 LDCONST R18 K119 0x7C440200, // 0041 CALL R17 1 0x50440000, // 0042 LDBOOL R17 0 0 0xA0000000, // 0043 CLOSE R0 0x80042200, // 0044 RET 1 R17 0x50440000, // 0045 LDBOOL R17 0 0 0x783E0008, // 0046 JMPF R15 #0050 - 0x8C48138B, // 0047 GETMET R18 R9 K139 + 0x8C481378, // 0047 GETMET R18 R9 K120 0x5C502000, // 0048 MOVE R20 R16 0x7C480400, // 0049 CALL R18 2 0x744A0002, // 004A JMPT R18 #004E @@ -2368,11 +2137,11 @@ be_local_closure(class_Tasmota_load, /* name */ 0x80042400, // 004D RET 1 R18 0x50440200, // 004E LDBOOL R17 1 0 0x70020014, // 004F JMP #0065 - 0x8C48138B, // 0050 GETMET R18 R9 K139 + 0x8C481378, // 0050 GETMET R18 R9 K120 0x5C500200, // 0051 MOVE R20 R1 0x7C480400, // 0052 CALL R18 2 0x784A0007, // 0053 JMPF R18 #005C - 0x8C48138B, // 0054 GETMET R18 R9 K139 + 0x8C481378, // 0054 GETMET R18 R9 K120 0x5C502000, // 0055 MOVE R20 R16 0x7C480400, // 0056 CALL R18 2 0x784A0002, // 0057 JMPF R18 #005B @@ -2380,7 +2149,7 @@ be_local_closure(class_Tasmota_load, /* name */ 0x5C4C2000, // 0059 MOVE R19 R16 0x7C480200, // 005A CALL R18 1 0x70020008, // 005B JMP #0065 - 0x8C48138B, // 005C GETMET R18 R9 K139 + 0x8C481378, // 005C GETMET R18 R9 K120 0x5C502000, // 005D MOVE R20 R16 0x7C480400, // 005E CALL R18 2 0x784A0001, // 005F JMPF R18 #0062 @@ -2390,13 +2159,13 @@ be_local_closure(class_Tasmota_load, /* name */ 0xA0000000, // 0063 CLOSE R0 0x80042400, // 0064 RET 1 R18 0x782E0005, // 0065 JMPF R11 #006C - 0x00481984, // 0066 ADD R18 R12 K132 - 0x90028A12, // 0067 SETMBR R0 K69 R18 + 0x00481970, // 0066 ADD R18 R12 K112 + 0x90029212, // 0067 SETMBR R0 K73 R18 0x5C480400, // 0068 MOVE R18 R2 - 0x884C0145, // 0069 GETMBR R19 R0 K69 + 0x884C0149, // 0069 GETMBR R19 R0 K73 0x7C480200, // 006A CALL R18 1 0x70020000, // 006B JMP #006D - 0x90028B46, // 006C SETMBR R0 K69 K70 + 0x9002934A, // 006C SETMBR R0 K73 K74 0x4C480000, // 006D LDNIL R18 0x78460025, // 006E JMPF R17 #0095 0x5C4C0800, // 006F MOVE R19 R4 @@ -2408,7 +2177,7 @@ be_local_closure(class_Tasmota_load, /* name */ 0x78560007, // 0075 JMPF R21 #007E 0x60540001, // 0076 GETGBL R21 G1 0x60580018, // 0077 GETGBL R22 G24 - 0x585C008C, // 0078 LDCONST R23 K140 + 0x585C0079, // 0078 LDCONST R23 K121 0x5C602000, // 0079 MOVE R24 R16 0x7C580400, // 007A CALL R22 2 0x7C540200, // 007B CALL R21 1 @@ -2419,7 +2188,7 @@ be_local_closure(class_Tasmota_load, /* name */ 0x78560007, // 0080 JMPF R21 #0089 0x60540001, // 0081 GETGBL R21 G1 0x60580018, // 0082 GETGBL R22 G24 - 0x585C008D, // 0083 LDCONST R23 K141 + 0x585C007A, // 0083 LDCONST R23 K122 0x5C602000, // 0084 MOVE R24 R16 0x5C642600, // 0085 MOVE R25 R19 0x7C580600, // 0086 CALL R22 3 @@ -2448,7 +2217,7 @@ be_local_closure(class_Tasmota_load, /* name */ 0x7C4C0200, // 009D CALL R19 1 0x782E0002, // 009E JMPF R11 #00A2 0x5C500600, // 009F MOVE R20 R3 - 0x00541984, // 00A0 ADD R21 R12 K132 + 0x00541970, // 00A0 ADD R21 R12 K112 0x7C500200, // 00A1 CALL R20 1 0xA0000000, // 00A2 CLOSE R0 0x80042600, // 00A3 RET 1 R19 @@ -2458,6 +2227,415 @@ be_local_closure(class_Tasmota_load, /* name */ /*******************************************************************/ +/******************************************************************** +** Solidified function: exec_rules +********************************************************************/ +be_local_closure(class_Tasmota_exec_rules, /* name */ + be_nested_proto( + 14, /* nstack */ + 3, /* argc */ + 10, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + &be_ktab_class_Tasmota, /* shared constants */ + &be_const_str_exec_rules, + &be_const_str_solidified, + ( &(const binstruction[60]) { /* code */ + 0x880C012B, // 0000 GETMBR R3 R0 K43 + 0x88100106, // 0001 GETMBR R4 R0 K6 + 0x74120002, // 0002 JMPT R4 #0006 + 0x4C100000, // 0003 LDNIL R4 + 0x20100604, // 0004 NE R4 R3 R4 + 0x78120033, // 0005 JMPF R4 #003A + 0xA4123E00, // 0006 IMPORT R4 K31 + 0x4C140000, // 0007 LDNIL R5 + 0x90025605, // 0008 SETMBR R0 K43 R5 + 0x50140000, // 0009 LDBOOL R5 0 0 + 0x8C180920, // 000A GETMET R6 R4 K32 + 0x5C200200, // 000B MOVE R8 R1 + 0x7C180400, // 000C CALL R6 2 + 0x4C1C0000, // 000D LDNIL R7 + 0x1C1C0C07, // 000E EQ R7 R6 R7 + 0x781E0004, // 000F JMPF R7 #0015 + 0x8C1C015C, // 0010 GETMET R7 R0 K92 + 0x0026C801, // 0011 ADD R9 K100 R1 + 0x5828001B, // 0012 LDCONST R10 K27 + 0x7C1C0600, // 0013 CALL R7 3 + 0x5C180200, // 0014 MOVE R6 R1 + 0x780A001E, // 0015 JMPF R2 #0035 + 0x881C0106, // 0016 GETMBR R7 R0 K6 + 0x781E001C, // 0017 JMPF R7 #0035 + 0x581C0007, // 0018 LDCONST R7 K7 + 0x6020000C, // 0019 GETGBL R8 G12 + 0x88240106, // 001A GETMBR R9 R0 K6 + 0x7C200200, // 001B CALL R8 1 + 0x14200E08, // 001C LT R8 R7 R8 + 0x78220016, // 001D JMPF R8 #0035 + 0x88200106, // 001E GETMBR R8 R0 K6 + 0x94201007, // 001F GETIDX R8 R8 R7 + 0x8C240166, // 0020 GETMET R9 R0 K102 + 0x5C2C0C00, // 0021 MOVE R11 R6 + 0x88301108, // 0022 GETMBR R12 R8 K8 + 0x88341140, // 0023 GETMBR R13 R8 K64 + 0x7C240800, // 0024 CALL R9 4 + 0x74160001, // 0025 JMPT R5 #0028 + 0x74260000, // 0026 JMPT R9 #0028 + 0x50140001, // 0027 LDBOOL R5 0 1 + 0x50140200, // 0028 LDBOOL R5 1 0 + 0x78260008, // 0029 JMPF R9 #0033 + 0x8828117B, // 002A GETMBR R10 R8 K123 + 0x502C0200, // 002B LDBOOL R11 1 0 + 0x1C28140B, // 002C EQ R10 R10 R11 + 0x782A0004, // 002D JMPF R10 #0033 + 0x88280106, // 002E GETMBR R10 R0 K6 + 0x8C28150B, // 002F GETMET R10 R10 K11 + 0x5C300E00, // 0030 MOVE R12 R7 + 0x7C280400, // 0031 CALL R10 2 + 0x70020000, // 0032 JMP #0034 + 0x001C0F0C, // 0033 ADD R7 R7 K12 + 0x7001FFE3, // 0034 JMP #0019 + 0x4C1C0000, // 0035 LDNIL R7 + 0x201C0607, // 0036 NE R7 R3 R7 + 0x781E0000, // 0037 JMPF R7 #0039 + 0x90025606, // 0038 SETMBR R0 K43 R6 + 0x80040A00, // 0039 RET 1 R5 + 0x50100000, // 003A LDBOOL R4 0 0 + 0x80040800, // 003B RET 1 R4 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: remove_driver +********************************************************************/ +be_local_closure(class_Tasmota_remove_driver, /* name */ + be_nested_proto( + 6, /* nstack */ + 2, /* argc */ + 10, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + &be_ktab_class_Tasmota, /* shared constants */ + &be_const_str_remove_driver, + &be_const_str_solidified, + ( &(const binstruction[14]) { /* code */ + 0x88080131, // 0000 GETMBR R2 R0 K49 + 0x780A000A, // 0001 JMPF R2 #000D + 0x88080131, // 0002 GETMBR R2 R0 K49 + 0x8C080532, // 0003 GETMET R2 R2 K50 + 0x5C100200, // 0004 MOVE R4 R1 + 0x7C080400, // 0005 CALL R2 2 + 0x4C0C0000, // 0006 LDNIL R3 + 0x200C0403, // 0007 NE R3 R2 R3 + 0x780E0003, // 0008 JMPF R3 #000D + 0x880C0131, // 0009 GETMBR R3 R0 K49 + 0x8C0C0752, // 000A GETMET R3 R3 K82 + 0x5C140400, // 000B MOVE R5 R2 + 0x7C0C0400, // 000C CALL R3 2 + 0x80000000, // 000D RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: gen_cb +********************************************************************/ +be_local_closure(class_Tasmota_gen_cb, /* name */ + be_nested_proto( + 6, /* nstack */ + 2, /* argc */ + 10, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + &be_ktab_class_Tasmota, /* shared constants */ + &be_const_str_gen_cb, + &be_const_str_solidified, + ( &(const binstruction[ 5]) { /* code */ + 0xA40AF800, // 0000 IMPORT R2 K124 + 0x8C0C057D, // 0001 GETMET R3 R2 K125 + 0x5C140200, // 0002 MOVE R5 R1 + 0x7C0C0400, // 0003 CALL R3 2 + 0x80040600, // 0004 RET 1 R3 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: event +********************************************************************/ +be_local_closure(class_Tasmota_event, /* name */ + be_nested_proto( + 19, /* nstack */ + 6, /* argc */ + 10, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + &be_ktab_class_Tasmota, /* shared constants */ + &be_const_str_event, + &be_const_str_solidified, + ( &(const binstruction[112]) { /* code */ + 0xA41A1A00, // 0000 IMPORT R6 K13 + 0x1C1C037E, // 0001 EQ R7 R1 K126 + 0x781E0005, // 0002 JMPF R7 #0009 + 0x881C0126, // 0003 GETMBR R7 R0 K38 + 0x781E0001, // 0004 JMPF R7 #0007 + 0x8C1C017F, // 0005 GETMET R7 R0 K127 + 0x7C1C0200, // 0006 CALL R7 1 + 0x8C1C0180, // 0007 GETMET R7 R0 K128 + 0x7C1C0200, // 0008 CALL R7 1 + 0x1C1C0381, // 0009 EQ R7 R1 K129 + 0x781E0001, // 000A JMPF R7 #000D + 0x8C1C0182, // 000B GETMET R7 R0 K130 + 0x7C1C0200, // 000C CALL R7 1 + 0x501C0000, // 000D LDBOOL R7 0 0 + 0x50200000, // 000E LDBOOL R8 0 0 + 0x1C240383, // 000F EQ R9 R1 K131 + 0x78260000, // 0010 JMPF R9 #0012 + 0x50200200, // 0011 LDBOOL R8 1 0 + 0x1C240384, // 0012 EQ R9 R1 K132 + 0x78260006, // 0013 JMPF R9 #001B + 0x8C240185, // 0014 GETMET R9 R0 K133 + 0x5C2C0400, // 0015 MOVE R11 R2 + 0x5C300600, // 0016 MOVE R12 R3 + 0x5C340800, // 0017 MOVE R13 R4 + 0x7C240800, // 0018 CALL R9 4 + 0x80041200, // 0019 RET 1 R9 + 0x7002004E, // 001A JMP #006A + 0x1C240386, // 001B EQ R9 R1 K134 + 0x78260004, // 001C JMPF R9 #0022 + 0x8C240187, // 001D GETMET R9 R0 K135 + 0x5C2C0800, // 001E MOVE R11 R4 + 0x7C240400, // 001F CALL R9 2 + 0x80041200, // 0020 RET 1 R9 + 0x70020047, // 0021 JMP #006A + 0x1C240309, // 0022 EQ R9 R1 K9 + 0x78260007, // 0023 JMPF R9 #002C + 0x8C240188, // 0024 GETMET R9 R0 K136 + 0x5C2C0800, // 0025 MOVE R11 R4 + 0x60300017, // 0026 GETGBL R12 G23 + 0x5C340600, // 0027 MOVE R13 R3 + 0x7C300200, // 0028 CALL R12 1 + 0x7C240600, // 0029 CALL R9 3 + 0x80041200, // 002A RET 1 R9 + 0x7002003D, // 002B JMP #006A + 0x1C240333, // 002C EQ R9 R1 K51 + 0x78260003, // 002D JMPF R9 #0032 + 0x8C240133, // 002E GETMET R9 R0 K51 + 0x7C240200, // 002F CALL R9 1 + 0x80041200, // 0030 RET 1 R9 + 0x70020037, // 0031 JMP #006A + 0x88240131, // 0032 GETMBR R9 R0 K49 + 0x78260035, // 0033 JMPF R9 #006A + 0x58240007, // 0034 LDCONST R9 K7 + 0x6028000C, // 0035 GETGBL R10 G12 + 0x882C0131, // 0036 GETMBR R11 R0 K49 + 0x7C280200, // 0037 CALL R10 1 + 0x1428120A, // 0038 LT R10 R9 R10 + 0x782A002F, // 0039 JMPF R10 #006A + 0x88280131, // 003A GETMBR R10 R0 K49 + 0x94281409, // 003B GETIDX R10 R10 R9 + 0x8C2C0D45, // 003C GETMET R11 R6 K69 + 0x5C341400, // 003D MOVE R13 R10 + 0x5C380200, // 003E MOVE R14 R1 + 0x7C2C0600, // 003F CALL R11 3 + 0x60300004, // 0040 GETGBL R12 G4 + 0x5C341600, // 0041 MOVE R13 R11 + 0x7C300200, // 0042 CALL R12 1 + 0x1C30190E, // 0043 EQ R12 R12 K14 + 0x78320022, // 0044 JMPF R12 #0068 + 0xA8020011, // 0045 EXBLK 0 #0058 + 0x5C301600, // 0046 MOVE R12 R11 + 0x5C341400, // 0047 MOVE R13 R10 + 0x5C380400, // 0048 MOVE R14 R2 + 0x5C3C0600, // 0049 MOVE R15 R3 + 0x5C400800, // 004A MOVE R16 R4 + 0x5C440A00, // 004B MOVE R17 R5 + 0x7C300A00, // 004C CALL R12 5 + 0x74320001, // 004D JMPT R12 #0050 + 0x741E0000, // 004E JMPT R7 #0050 + 0x501C0001, // 004F LDBOOL R7 0 1 + 0x501C0200, // 0050 LDBOOL R7 1 0 + 0x781E0003, // 0051 JMPF R7 #0056 + 0x5C301000, // 0052 MOVE R12 R8 + 0x74320001, // 0053 JMPT R12 #0056 + 0xA8040001, // 0054 EXBLK 1 1 + 0x70020013, // 0055 JMP #006A + 0xA8040001, // 0056 EXBLK 1 1 + 0x7002000F, // 0057 JMP #0068 + 0xAC300002, // 0058 CATCH R12 0 2 + 0x7002000C, // 0059 JMP #0067 + 0x60380001, // 005A GETGBL R14 G1 + 0x603C0018, // 005B GETGBL R15 G24 + 0x58400089, // 005C LDCONST R16 K137 + 0x5C441800, // 005D MOVE R17 R12 + 0x5C481A00, // 005E MOVE R18 R13 + 0x7C3C0600, // 005F CALL R15 3 + 0x7C380200, // 0060 CALL R14 1 + 0x8838014B, // 0061 GETMBR R14 R0 K75 + 0x783A0002, // 0062 JMPF R14 #0066 + 0xA43A9A00, // 0063 IMPORT R14 K77 + 0x8C3C1D8A, // 0064 GETMET R15 R14 K138 + 0x7C3C0200, // 0065 CALL R15 1 + 0x70020000, // 0066 JMP #0068 + 0xB0080000, // 0067 RAISE 2 R0 R0 + 0x0024130C, // 0068 ADD R9 R9 K12 + 0x7001FFCA, // 0069 JMP #0035 + 0x1C24038B, // 006A EQ R9 R1 K139 + 0x78260002, // 006B JMPF R9 #006F + 0xA4271800, // 006C IMPORT R9 K140 + 0x8C28138D, // 006D GETMET R10 R9 K141 + 0x7C280200, // 006E CALL R10 1 + 0x80040E00, // 006F RET 1 R7 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: run_network_up +********************************************************************/ +be_local_closure(class_Tasmota_run_network_up, /* name */ + be_nested_proto( + 10, /* nstack */ + 1, /* argc */ + 10, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + &be_ktab_class_Tasmota, /* shared constants */ + &be_const_str_run_network_up, + &be_const_str_solidified, + ( &(const binstruction[49]) { /* code */ + 0x88040126, // 0000 GETMBR R1 R0 K38 + 0x4C080000, // 0001 LDNIL R2 + 0x1C040202, // 0002 EQ R1 R1 R2 + 0x78060000, // 0003 JMPF R1 #0005 + 0x80000200, // 0004 RET 0 + 0xB8063000, // 0005 GETNGBL R1 K24 + 0x8C040323, // 0006 GETMET R1 R1 K35 + 0x7C040200, // 0007 CALL R1 1 + 0x94040324, // 0008 GETIDX R1 R1 K36 + 0x74060005, // 0009 JMPT R1 #0010 + 0xB8063000, // 000A GETNGBL R1 K24 + 0x8C040325, // 000B GETMET R1 R1 K37 + 0x7C040200, // 000C CALL R1 1 + 0x94040324, // 000D GETIDX R1 R1 K36 + 0x74060000, // 000E JMPT R1 #0010 + 0x50040001, // 000F LDBOOL R1 0 1 + 0x50040200, // 0010 LDBOOL R1 1 0 + 0x7806001D, // 0011 JMPF R1 #0030 + 0x6008000C, // 0012 GETGBL R2 G12 + 0x880C0126, // 0013 GETMBR R3 R0 K38 + 0x7C080200, // 0014 CALL R2 1 + 0x24080507, // 0015 GT R2 R2 K7 + 0x780A0016, // 0016 JMPF R2 #002E + 0x88080126, // 0017 GETMBR R2 R0 K38 + 0x94080507, // 0018 GETIDX R2 R2 K7 + 0x880C0126, // 0019 GETMBR R3 R0 K38 + 0x8C0C070B, // 001A GETMET R3 R3 K11 + 0x58140007, // 001B LDCONST R5 K7 + 0x7C0C0400, // 001C CALL R3 2 + 0xA8020003, // 001D EXBLK 0 #0022 + 0x5C0C0400, // 001E MOVE R3 R2 + 0x7C0C0000, // 001F CALL R3 0 + 0xA8040001, // 0020 EXBLK 1 1 + 0x7002000A, // 0021 JMP #002D + 0xAC0C0002, // 0022 CATCH R3 0 2 + 0x70020007, // 0023 JMP #002C + 0x60140001, // 0024 GETGBL R5 G1 + 0x60180018, // 0025 GETGBL R6 G24 + 0x581C008E, // 0026 LDCONST R7 K142 + 0x5C200600, // 0027 MOVE R8 R3 + 0x5C240800, // 0028 MOVE R9 R4 + 0x7C180600, // 0029 CALL R6 3 + 0x7C140200, // 002A CALL R5 1 + 0x70020000, // 002B JMP #002D + 0xB0080000, // 002C RAISE 2 R0 R0 + 0x7001FFE3, // 002D JMP #0012 + 0x4C080000, // 002E LDNIL R2 + 0x90024C02, // 002F SETMBR R0 K38 R2 + 0x80000000, // 0030 RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: find_op +********************************************************************/ +be_local_closure(class_Tasmota_find_op, /* name */ + be_nested_proto( + 7, /* nstack */ + 2, /* argc */ + 10, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + &be_ktab_class_Tasmota, /* shared constants */ + &be_const_str_find_op, + &be_const_str_solidified, + ( &(const binstruction[31]) { /* code */ + 0x8C08018F, // 0000 GETMET R2 R0 K143 + 0x5C100200, // 0001 MOVE R4 R1 + 0x7C080400, // 0002 CALL R2 2 + 0x280C0507, // 0003 GE R3 R2 K7 + 0x780E0011, // 0004 JMPF R3 #0017 + 0x540E7FFE, // 0005 LDINT R3 32767 + 0x2C0C0403, // 0006 AND R3 R2 R3 + 0x5412000F, // 0007 LDINT R4 16 + 0x3C100404, // 0008 SHR R4 R2 R4 + 0x60140012, // 0009 GETGBL R5 G18 + 0x7C140000, // 000A CALL R5 0 + 0x0418070C, // 000B SUB R6 R3 K12 + 0x401A0E06, // 000C CONNECT R6 K7 R6 + 0x94180206, // 000D GETIDX R6 R1 R6 + 0x40180A06, // 000E CONNECT R6 R5 R6 + 0x0418090C, // 000F SUB R6 R4 K12 + 0x40180606, // 0010 CONNECT R6 R3 R6 + 0x94180206, // 0011 GETIDX R6 R1 R6 + 0x40180A06, // 0012 CONNECT R6 R5 R6 + 0x40180971, // 0013 CONNECT R6 R4 K113 + 0x94180206, // 0014 GETIDX R6 R1 R6 + 0x40180A06, // 0015 CONNECT R6 R5 R6 + 0x80040A00, // 0016 RET 1 R5 + 0x600C0012, // 0017 GETGBL R3 G18 + 0x7C0C0000, // 0018 CALL R3 0 + 0x40100601, // 0019 CONNECT R4 R3 R1 + 0x4C100000, // 001A LDNIL R4 + 0x40100604, // 001B CONNECT R4 R3 R4 + 0x4C100000, // 001C LDNIL R4 + 0x40100604, // 001D CONNECT R4 R3 R4 + 0x80040600, // 001E RET 1 R3 + }) + ) +); +/*******************************************************************/ + + /******************************************************************** ** Solidified function: compile ********************************************************************/ @@ -2475,29 +2653,29 @@ be_local_closure(class_Tasmota_compile, /* name */ &be_const_str_compile, &be_const_str_solidified, ( &(const binstruction[84]) { /* code */ - 0xA40A2200, // 0000 IMPORT R2 K17 - 0x8C0C0587, // 0001 GETMET R3 R2 K135 + 0xA40A7800, // 0000 IMPORT R2 K60 + 0x8C0C0574, // 0001 GETMET R3 R2 K116 0x5C140200, // 0002 MOVE R5 R1 - 0x58180086, // 0003 LDCONST R6 K134 + 0x58180073, // 0003 LDCONST R6 K115 0x7C0C0600, // 0004 CALL R3 3 0x740E0007, // 0005 JMPT R3 #000E 0x600C0001, // 0006 GETGBL R3 G1 0x60100018, // 0007 GETGBL R4 G24 - 0x5814008E, // 0008 LDCONST R5 K142 + 0x58140090, // 0008 LDCONST R5 K144 0x5C180200, // 0009 MOVE R6 R1 0x7C100400, // 000A CALL R4 2 0x7C0C0200, // 000B CALL R3 1 0x500C0000, // 000C LDBOOL R3 0 0 0x80040600, // 000D RET 1 R3 - 0x8C0C051E, // 000E GETMET R3 R2 K30 + 0x8C0C0532, // 000E GETMET R3 R2 K50 0x5C140200, // 000F MOVE R5 R1 - 0x58180084, // 0010 LDCONST R6 K132 + 0x58180070, // 0010 LDCONST R6 K112 0x7C0C0600, // 0011 CALL R3 3 - 0x240C0706, // 0012 GT R3 R3 K6 + 0x240C0707, // 0012 GT R3 R3 K7 0x780E0006, // 0013 JMPF R3 #001B 0x600C0001, // 0014 GETGBL R3 G1 0x60100018, // 0015 GETGBL R4 G24 - 0x5814008F, // 0016 LDCONST R5 K143 + 0x58140091, // 0016 LDCONST R5 K145 0x7C100200, // 0017 CALL R4 1 0x7C0C0200, // 0018 CALL R3 1 0x500C0000, // 0019 LDBOOL R3 0 0 @@ -2506,7 +2684,7 @@ be_local_closure(class_Tasmota_compile, /* name */ 0xA8020011, // 001C EXBLK 0 #002F 0x6010000D, // 001D GETGBL R4 G13 0x5C140200, // 001E MOVE R5 R1 - 0x58180090, // 001F LDCONST R6 K144 + 0x58180092, // 001F LDCONST R6 K146 0x7C100400, // 0020 CALL R4 2 0x5C0C0800, // 0021 MOVE R3 R4 0x4C100000, // 0022 LDNIL R4 @@ -2514,7 +2692,7 @@ be_local_closure(class_Tasmota_compile, /* name */ 0x78120007, // 0024 JMPF R4 #002D 0x60100001, // 0025 GETGBL R4 G1 0x60140018, // 0026 GETGBL R5 G24 - 0x58180091, // 0027 LDCONST R6 K145 + 0x58180093, // 0027 LDCONST R6 K147 0x7C140200, // 0028 CALL R5 1 0x7C100200, // 0029 CALL R4 1 0x50100000, // 002A LDBOOL R4 0 0 @@ -2526,7 +2704,7 @@ be_local_closure(class_Tasmota_compile, /* name */ 0x7002000A, // 0030 JMP #003C 0x60180001, // 0031 GETGBL R6 G1 0x601C0018, // 0032 GETGBL R7 G24 - 0x58200092, // 0033 LDCONST R8 K146 + 0x58200094, // 0033 LDCONST R8 K148 0x5C240200, // 0034 MOVE R9 R1 0x5C280800, // 0035 MOVE R10 R4 0x5C2C0A00, // 0036 MOVE R11 R5 @@ -2536,9 +2714,9 @@ be_local_closure(class_Tasmota_compile, /* name */ 0x80040C00, // 003A RET 1 R6 0x70020000, // 003B JMP #003D 0xB0080000, // 003C RAISE 2 R0 R0 - 0x00100389, // 003D ADD R4 R1 K137 + 0x00100376, // 003D ADD R4 R1 K118 0xA8020005, // 003E EXBLK 0 #0045 - 0x8C140172, // 003F GETMET R5 R0 K114 + 0x8C14018D, // 003F GETMET R5 R0 K141 0x5C1C0800, // 0040 MOVE R7 R4 0x5C200600, // 0041 MOVE R8 R3 0x7C140600, // 0042 CALL R5 3 @@ -2548,7 +2726,7 @@ be_local_closure(class_Tasmota_compile, /* name */ 0x70020009, // 0046 JMP #0051 0x60180001, // 0047 GETGBL R6 G1 0x601C0018, // 0048 GETGBL R7 G24 - 0x58200093, // 0049 LDCONST R8 K147 + 0x58200095, // 0049 LDCONST R8 K149 0x5C240800, // 004A MOVE R9 R4 0x5C280A00, // 004B MOVE R10 R5 0x7C1C0600, // 004C CALL R7 3 @@ -2565,6 +2743,81 @@ be_local_closure(class_Tasmota_compile, /* name */ /*******************************************************************/ +/******************************************************************** +** Solidified function: get_light +********************************************************************/ +be_local_closure(class_Tasmota_get_light, /* name */ + be_nested_proto( + 6, /* nstack */ + 2, /* argc */ + 10, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + &be_ktab_class_Tasmota, /* shared constants */ + &be_const_str_get_light, + &be_const_str_solidified, + ( &(const binstruction[16]) { /* code */ + 0x60080001, // 0000 GETGBL R2 G1 + 0x580C0096, // 0001 LDCONST R3 K150 + 0x7C080200, // 0002 CALL R2 1 + 0xA40B2E00, // 0003 IMPORT R2 K151 + 0x4C0C0000, // 0004 LDNIL R3 + 0x200C0203, // 0005 NE R3 R1 R3 + 0x780E0004, // 0006 JMPF R3 #000C + 0x8C0C0545, // 0007 GETMET R3 R2 K69 + 0x5C140200, // 0008 MOVE R5 R1 + 0x7C0C0400, // 0009 CALL R3 2 + 0x80040600, // 000A RET 1 R3 + 0x70020002, // 000B JMP #000F + 0x8C0C0545, // 000C GETMET R3 R2 K69 + 0x7C0C0200, // 000D CALL R3 1 + 0x80040600, // 000E RET 1 R3 + 0x80000000, // 000F RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: time_str +********************************************************************/ +be_local_closure(class_Tasmota_time_str, /* name */ + be_nested_proto( + 11, /* nstack */ + 2, /* argc */ + 10, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + &be_ktab_class_Tasmota, /* shared constants */ + &be_const_str_time_str, + &be_const_str_solidified, + ( &(const binstruction[13]) { /* code */ + 0x8C080198, // 0000 GETMET R2 R0 K152 + 0x5C100200, // 0001 MOVE R4 R1 + 0x7C080400, // 0002 CALL R2 2 + 0x600C0018, // 0003 GETGBL R3 G24 + 0x58100099, // 0004 LDCONST R4 K153 + 0x9414059A, // 0005 GETIDX R5 R2 K154 + 0x9418059B, // 0006 GETIDX R6 R2 K155 + 0x941C059C, // 0007 GETIDX R7 R2 K156 + 0x9420059D, // 0008 GETIDX R8 R2 K157 + 0x9424059E, // 0009 GETIDX R9 R2 K158 + 0x9428059F, // 000A GETIDX R10 R2 K159 + 0x7C0C0E00, // 000B CALL R3 7 + 0x80040600, // 000C RET 1 R3 + }) + ) +); +/*******************************************************************/ + + /******************************************************************** ** Solidified function: set_light ********************************************************************/ @@ -2583,19 +2836,19 @@ be_local_closure(class_Tasmota_set_light, /* name */ &be_const_str_solidified, ( &(const binstruction[18]) { /* code */ 0x600C0001, // 0000 GETGBL R3 G1 - 0x58100094, // 0001 LDCONST R4 K148 + 0x581000A0, // 0001 LDCONST R4 K160 0x7C0C0200, // 0002 CALL R3 1 - 0xA40EEE00, // 0003 IMPORT R3 K119 + 0xA40F2E00, // 0003 IMPORT R3 K151 0x4C100000, // 0004 LDNIL R4 0x20100404, // 0005 NE R4 R2 R4 0x78120005, // 0006 JMPF R4 #000D - 0x8C100795, // 0007 GETMET R4 R3 K149 + 0x8C1007A1, // 0007 GETMET R4 R3 K161 0x5C180200, // 0008 MOVE R6 R1 0x5C1C0400, // 0009 MOVE R7 R2 0x7C100600, // 000A CALL R4 3 0x80040800, // 000B RET 1 R4 0x70020003, // 000C JMP #0011 - 0x8C100795, // 000D GETMET R4 R3 K149 + 0x8C1007A1, // 000D GETMET R4 R3 K161 0x5C180200, // 000E MOVE R6 R1 0x7C100400, // 000F CALL R4 2 0x80040800, // 0010 RET 1 R4 @@ -2607,12 +2860,12 @@ be_local_closure(class_Tasmota_set_light, /* name */ /******************************************************************** -** Solidified function: gen_cb +** Solidified function: try_rule ********************************************************************/ -be_local_closure(class_Tasmota_gen_cb, /* name */ +be_local_closure(class_Tasmota_try_rule, /* name */ be_nested_proto( - 6, /* nstack */ - 2, /* argc */ + 9, /* nstack */ + 4, /* argc */ 10, /* varg */ 0, /* has upvals */ NULL, /* no upvals */ @@ -2620,142 +2873,27 @@ be_local_closure(class_Tasmota_gen_cb, /* name */ NULL, /* no sub protos */ 1, /* has constants */ &be_ktab_class_Tasmota, /* shared constants */ - &be_const_str_gen_cb, - &be_const_str_solidified, - ( &(const binstruction[ 5]) { /* code */ - 0xA40B2C00, // 0000 IMPORT R2 K150 - 0x8C0C0597, // 0001 GETMET R3 R2 K151 - 0x5C140200, // 0002 MOVE R5 R1 - 0x7C0C0400, // 0003 CALL R3 2 - 0x80040600, // 0004 RET 1 R3 - }) - ) -); -/*******************************************************************/ - - -/******************************************************************** -** Solidified function: urlfetch_cmd -********************************************************************/ -be_local_closure(class_Tasmota_urlfetch_cmd, /* name */ - be_nested_proto( - 10, /* nstack */ - 5, /* argc */ - 10, /* varg */ - 0, /* has upvals */ - NULL, /* no upvals */ - 0, /* has sup protos */ - NULL, /* no sub protos */ - 1, /* has constants */ - &be_ktab_class_Tasmota, /* shared constants */ - &be_const_str_urlfetch_cmd, - &be_const_str_solidified, - ( &(const binstruction[34]) { /* code */ - 0xA4162200, // 0000 IMPORT R5 K17 - 0x8C180B1E, // 0001 GETMET R6 R5 K30 - 0x5C200600, // 0002 MOVE R8 R3 - 0x58240098, // 0003 LDCONST R9 K152 - 0x7C180600, // 0004 CALL R6 3 - 0x20180D06, // 0005 NE R6 R6 K6 - 0x781A0003, // 0006 JMPF R6 #000B - 0x8C180199, // 0007 GETMET R6 R0 K153 - 0x5820009A, // 0008 LDCONST R8 K154 - 0x7C180400, // 0009 CALL R6 2 - 0x80000C00, // 000A RET 0 - 0xA802000A, // 000B EXBLK 0 #0017 - 0x8C18019B, // 000C GETMET R6 R0 K155 - 0x5C200600, // 000D MOVE R8 R3 - 0x7C180400, // 000E CALL R6 2 - 0x141C0D06, // 000F LT R7 R6 K6 - 0x781E0003, // 0010 JMPF R7 #0015 - 0x8C1C019C, // 0011 GETMET R7 R0 K156 - 0x7C1C0200, // 0012 CALL R7 1 - 0xA8040001, // 0013 EXBLK 1 1 - 0x80000E00, // 0014 RET 0 - 0xA8040001, // 0015 EXBLK 1 1 - 0x70020006, // 0016 JMP #001E - 0xAC180002, // 0017 CATCH R6 0 2 - 0x70020003, // 0018 JMP #001D - 0x8C20019C, // 0019 GETMET R8 R0 K156 - 0x7C200200, // 001A CALL R8 1 - 0x80001000, // 001B RET 0 - 0x70020000, // 001C JMP #001E - 0xB0080000, // 001D RAISE 2 R0 R0 - 0xB81A5E00, // 001E GETNGBL R6 K47 - 0x8C180D9D, // 001F GETMET R6 R6 K157 - 0x7C180200, // 0020 CALL R6 1 - 0x80000000, // 0021 RET 0 - }) - ) -); -/*******************************************************************/ - - -/******************************************************************** -** Solidified function: remove_cmd -********************************************************************/ -be_local_closure(class_Tasmota_remove_cmd, /* name */ - be_nested_proto( - 5, /* nstack */ - 2, /* argc */ - 10, /* varg */ - 0, /* has upvals */ - NULL, /* no upvals */ - 0, /* has sup protos */ - NULL, /* no sub protos */ - 1, /* has constants */ - &be_ktab_class_Tasmota, /* shared constants */ - &be_const_str_remove_cmd, - &be_const_str_solidified, - ( &(const binstruction[ 7]) { /* code */ - 0x8808017D, // 0000 GETMBR R2 R0 K125 - 0x780A0003, // 0001 JMPF R2 #0006 - 0x8808017D, // 0002 GETMBR R2 R0 K125 - 0x8C080535, // 0003 GETMET R2 R2 K53 - 0x5C100200, // 0004 MOVE R4 R1 - 0x7C080400, // 0005 CALL R2 2 - 0x80000000, // 0006 RET 0 - }) - ) -); -/*******************************************************************/ - - -/******************************************************************** -** Solidified function: remove_timer -********************************************************************/ -be_local_closure(class_Tasmota_remove_timer, /* name */ - be_nested_proto( - 7, /* nstack */ - 2, /* argc */ - 10, /* varg */ - 0, /* has upvals */ - NULL, /* no upvals */ - 0, /* has sup protos */ - NULL, /* no sub protos */ - 1, /* has constants */ - &be_ktab_class_Tasmota, /* shared constants */ - &be_const_str_remove_timer, + &be_const_str_try_rule, &be_const_str_solidified, ( &(const binstruction[18]) { /* code */ - 0x8808014C, // 0000 GETMBR R2 R0 K76 - 0x780A000E, // 0001 JMPF R2 #0011 - 0x580C0006, // 0002 LDCONST R3 K6 - 0x8C100507, // 0003 GETMET R4 R2 K7 - 0x7C100200, // 0004 CALL R4 1 - 0x14100604, // 0005 LT R4 R3 R4 - 0x78120009, // 0006 JMPF R4 #0011 - 0x94100403, // 0007 GETIDX R4 R2 R3 - 0x88100908, // 0008 GETMBR R4 R4 K8 - 0x1C100801, // 0009 EQ R4 R4 R1 - 0x78120003, // 000A JMPF R4 #000F - 0x8C100535, // 000B GETMET R4 R2 K53 - 0x5C180600, // 000C MOVE R6 R3 - 0x7C100400, // 000D CALL R4 2 - 0x70020000, // 000E JMP #0010 - 0x000C070A, // 000F ADD R3 R3 K10 - 0x7001FFF1, // 0010 JMP #0003 - 0x80000000, // 0011 RET 0 + 0x8C1005A2, // 0000 GETMET R4 R2 K162 + 0x5C180200, // 0001 MOVE R6 R1 + 0x7C100400, // 0002 CALL R4 2 + 0x4C140000, // 0003 LDNIL R5 + 0x20140805, // 0004 NE R5 R4 R5 + 0x78160009, // 0005 JMPF R5 #0010 + 0x4C140000, // 0006 LDNIL R5 + 0x20140605, // 0007 NE R5 R3 R5 + 0x78160004, // 0008 JMPF R5 #000E + 0x5C140600, // 0009 MOVE R5 R3 + 0x5C180800, // 000A MOVE R6 R4 + 0x881C05A3, // 000B GETMBR R7 R2 K163 + 0x5C200200, // 000C MOVE R8 R1 + 0x7C140600, // 000D CALL R5 3 + 0x50140200, // 000E LDBOOL R5 1 0 + 0x80040A00, // 000F RET 1 R5 + 0x50140000, // 0010 LDBOOL R5 0 0 + 0x80040A00, // 0011 RET 1 R5 }) ) ); @@ -2766,66 +2904,69 @@ be_local_closure(class_Tasmota_remove_timer, /* name */ ** Solidified class: Tasmota ********************************************************************/ be_local_class(Tasmota, - 14, + 15, NULL, - be_nested_map(56, + be_nested_map(59, ( (struct bmapnode*) &(const bmapnode[]) { - { be_const_key(wire_scan, 29), be_const_closure(class_Tasmota_wire_scan_closure) }, - { be_const_key(next_cron, -1), be_const_closure(class_Tasmota_next_cron_closure) }, - { be_const_key(remove_timer, -1), be_const_closure(class_Tasmota_remove_timer_closure) }, - { be_const_key(find_list_i, -1), be_const_closure(class_Tasmota_find_list_i_closure) }, - { be_const_key(time_str, 40), be_const_closure(class_Tasmota_time_str_closure) }, - { be_const_key(remove_cmd, 41), be_const_closure(class_Tasmota_remove_cmd_closure) }, - { be_const_key(wd, 12), be_const_var(12) }, - { be_const_key(urlfetch_cmd, 52), be_const_closure(class_Tasmota_urlfetch_cmd_closure) }, - { be_const_key(remove_driver, -1), be_const_closure(class_Tasmota_remove_driver_closure) }, - { be_const_key(exec_tele, -1), be_const_closure(class_Tasmota_exec_tele_closure) }, - { be_const_key(run_cron, -1), be_const_closure(class_Tasmota_run_cron_closure) }, - { be_const_key(set_light, -1), be_const_closure(class_Tasmota_set_light_closure) }, - { be_const_key(compile, -1), be_const_closure(class_Tasmota_compile_closure) }, - { be_const_key(hs2rgb, 16), be_const_closure(class_Tasmota_hs2rgb_closure) }, - { be_const_key(exec_rules, -1), be_const_closure(class_Tasmota_exec_rules_closure) }, - { be_const_key(add_rule, -1), be_const_closure(class_Tasmota_add_rule_closure) }, - { be_const_key(_ccmd, -1), be_const_var(5) }, - { be_const_key(_rules, -1), be_const_var(1) }, - { be_const_key(int, -1), be_const_static_closure(class_Tasmota_int_closure) }, - { be_const_key(init, 53), be_const_closure(class_Tasmota_init_closure) }, - { be_const_key(exec_cmd, 46), be_const_closure(class_Tasmota_exec_cmd_closure) }, - { be_const_key(add_cron, 7), be_const_closure(class_Tasmota_add_cron_closure) }, - { be_const_key(_defer, -1), be_const_var(3) }, - { be_const_key(run_timers, -1), be_const_closure(class_Tasmota_run_timers_closure) }, - { be_const_key(remove_rule, -1), be_const_closure(class_Tasmota_remove_rule_closure) }, - { be_const_key(_drivers, -1), be_const_var(6) }, - { be_const_key(urlfetch, 51), be_const_closure(class_Tasmota_urlfetch_closure) }, - { be_const_key(_crons, 50), be_const_var(4) }, - { be_const_key(_timers, 14), be_const_var(2) }, - { be_const_key(settings, -1), be_const_var(11) }, - { be_const_key(global, 18), be_const_var(10) }, - { be_const_key(check_not_method, 20), be_const_closure(class_Tasmota_check_not_method_closure) }, - { be_const_key(run_deferred, 11), be_const_closure(class_Tasmota_run_deferred_closure) }, - { be_const_key(add_rule_once, -1), be_const_closure(class_Tasmota_add_rule_once_closure) }, - { be_const_key(remove_cron, -1), be_const_closure(class_Tasmota_remove_cron_closure) }, - { be_const_key(defer, 10), be_const_closure(class_Tasmota_defer_closure) }, - { be_const_key(event, -1), be_const_closure(class_Tasmota_event_closure) }, - { be_const_key(_debug_present, -1), be_const_var(13) }, - { be_const_key(wire2, -1), be_const_var(8) }, - { be_const_key(remove_fast_loop, 36), be_const_closure(class_Tasmota_remove_fast_loop_closure) }, - { be_const_key(get_light, -1), be_const_closure(class_Tasmota_get_light_closure) }, - { be_const_key(find_key_i, -1), be_const_closure(class_Tasmota_find_key_i_closure) }, - { be_const_key(add_fast_loop, -1), be_const_closure(class_Tasmota_add_fast_loop_closure) }, + { be_const_key(add_cron, 2), be_const_closure(class_Tasmota_add_cron_closure) }, + { be_const_key(remove_rule, 7), be_const_closure(class_Tasmota_remove_rule_closure) }, + { be_const_key(global, -1), be_const_var(11) }, + { be_const_key(add_rule, 43), be_const_closure(class_Tasmota_add_rule_closure) }, + { be_const_key(hs2rgb, 23), be_const_closure(class_Tasmota_hs2rgb_closure) }, + { be_const_key(_crons, -1), be_const_var(4) }, + { be_const_key(cmd_res, -1), be_const_var(10) }, + { be_const_key(_fl, 45), be_const_var(0) }, + { be_const_key(exec_cmd, 20), be_const_closure(class_Tasmota_exec_cmd_closure) }, + { be_const_key(when_network_up, 52), be_const_closure(class_Tasmota_when_network_up_closure) }, + { be_const_key(_debug_present, -1), be_const_var(14) }, + { be_const_key(run_deferred, 15), be_const_closure(class_Tasmota_run_deferred_closure) }, + { be_const_key(settings, -1), be_const_var(12) }, + { be_const_key(fast_loop, -1), be_const_closure(class_Tasmota_fast_loop_closure) }, { be_const_key(cmd, -1), be_const_closure(class_Tasmota_cmd_closure) }, - { be_const_key(_fl, -1), be_const_var(0) }, - { be_const_key(try_rule, 23), be_const_closure(class_Tasmota_try_rule_closure) }, + { be_const_key(set_light, -1), be_const_closure(class_Tasmota_set_light_closure) }, { be_const_key(gc, -1), be_const_closure(class_Tasmota_gc_closure) }, + { be_const_key(defer, -1), be_const_closure(class_Tasmota_defer_closure) }, + { be_const_key(_drivers, 37), be_const_var(6) }, + { be_const_key(remove_timer, -1), be_const_closure(class_Tasmota_remove_timer_closure) }, + { be_const_key(remove_fast_loop, -1), be_const_closure(class_Tasmota_remove_fast_loop_closure) }, + { be_const_key(int, -1), be_const_static_closure(class_Tasmota_int_closure) }, + { be_const_key(wire_scan, -1), be_const_closure(class_Tasmota_wire_scan_closure) }, + { be_const_key(compile, -1), be_const_closure(class_Tasmota_compile_closure) }, + { be_const_key(wire1, -1), be_const_var(8) }, + { be_const_key(remove_cmd, -1), be_const_closure(class_Tasmota_remove_cmd_closure) }, + { be_const_key(find_list_i, -1), be_const_closure(class_Tasmota_find_list_i_closure) }, + { be_const_key(remove_cron, 30), be_const_closure(class_Tasmota_remove_cron_closure) }, + { be_const_key(find_op, 50), be_const_closure(class_Tasmota_find_op_closure) }, + { be_const_key(_rules, -1), be_const_var(1) }, + { be_const_key(_defer, -1), be_const_var(3) }, + { be_const_key(init, -1), be_const_closure(class_Tasmota_init_closure) }, + { be_const_key(_ccmd, -1), be_const_var(5) }, { be_const_key(add_cmd, -1), be_const_closure(class_Tasmota_add_cmd_closure) }, - { be_const_key(find_op, -1), be_const_closure(class_Tasmota_find_op_closure) }, - { be_const_key(load, -1), be_const_closure(class_Tasmota_load_closure) }, - { be_const_key(add_driver, 35), be_const_closure(class_Tasmota_add_driver_closure) }, - { be_const_key(cmd_res, -1), be_const_var(9) }, - { be_const_key(set_timer, -1), be_const_closure(class_Tasmota_set_timer_closure) }, - { be_const_key(wire1, -1), be_const_var(7) }, - { be_const_key(fast_loop, 5), be_const_closure(class_Tasmota_fast_loop_closure) }, - { be_const_key(gen_cb, 2), be_const_closure(class_Tasmota_gen_cb_closure) }, + { be_const_key(urlfetch, -1), be_const_closure(class_Tasmota_urlfetch_closure) }, + { be_const_key(urlfetch_cmd, 28), be_const_closure(class_Tasmota_urlfetch_cmd_closure) }, + { be_const_key(run_network_up, -1), be_const_closure(class_Tasmota_run_network_up_closure) }, + { be_const_key(event, 48), be_const_closure(class_Tasmota_event_closure) }, + { be_const_key(add_fast_loop, -1), be_const_closure(class_Tasmota_add_fast_loop_closure) }, + { be_const_key(set_timer, 42), be_const_closure(class_Tasmota_set_timer_closure) }, + { be_const_key(run_cron, -1), be_const_closure(class_Tasmota_run_cron_closure) }, + { be_const_key(wd, -1), be_const_var(13) }, + { be_const_key(_wnu, 38), be_const_var(7) }, + { be_const_key(find_key_i, 51), be_const_closure(class_Tasmota_find_key_i_closure) }, + { be_const_key(exec_rules, -1), be_const_closure(class_Tasmota_exec_rules_closure) }, + { be_const_key(load, 16), be_const_closure(class_Tasmota_load_closure) }, + { be_const_key(remove_driver, -1), be_const_closure(class_Tasmota_remove_driver_closure) }, + { be_const_key(gen_cb, -1), be_const_closure(class_Tasmota_gen_cb_closure) }, + { be_const_key(add_rule_once, 55), be_const_closure(class_Tasmota_add_rule_once_closure) }, + { be_const_key(wire2, 36), be_const_var(9) }, + { be_const_key(exec_tele, -1), be_const_closure(class_Tasmota_exec_tele_closure) }, + { be_const_key(_timers, -1), be_const_var(2) }, + { be_const_key(run_timers, 56), be_const_closure(class_Tasmota_run_timers_closure) }, + { be_const_key(get_light, -1), be_const_closure(class_Tasmota_get_light_closure) }, + { be_const_key(time_str, -1), be_const_closure(class_Tasmota_time_str_closure) }, + { be_const_key(add_driver, -1), be_const_closure(class_Tasmota_add_driver_closure) }, + { be_const_key(next_cron, -1), be_const_closure(class_Tasmota_next_cron_closure) }, + { be_const_key(check_not_method, 6), be_const_closure(class_Tasmota_check_not_method_closure) }, + { be_const_key(try_rule, -1), be_const_closure(class_Tasmota_try_rule_closure) }, })), (bstring*) &be_const_str_Tasmota ); diff --git a/lib/libesp32/berry_tasmota/src/solidify/solidified_webserver_async.h b/lib/libesp32/berry_tasmota/src/solidify/solidified_webserver_async.h index 5f9a8b2c4..5f0317511 100644 --- a/lib/libesp32/berry_tasmota/src/solidify/solidified_webserver_async.h +++ b/lib/libesp32/berry_tasmota/src/solidify/solidified_webserver_async.h @@ -3,7 +3,7 @@ * Generated code, don't edit * \********************************************************************/ #include "be_constobj.h" -// compact class 'webserver_async_cnx' ktab size: 76, total: 141 (saved 520 bytes) +// compact class 'webserver_async_cnx' ktab size: 76, total: 143 (saved 536 bytes) static const bvalue be_ktab_class_webserver_async_cnx[76] = { /* K0 */ be_nested_str_weak(server), /* K1 */ be_nested_str_weak(dispatch), @@ -67,15 +67,15 @@ static const bvalue be_ktab_class_webserver_async_cnx[76] = { /* K59 */ be_nested_str_weak(available), /* K60 */ be_nested_str_weak(read), /* K61 */ be_nested_str_weak(parse), - /* K62 */ be_nested_str_weak(global), - /* K63 */ be_nested_str_weak(_re_http_srv_header), - /* K64 */ be_nested_str_weak(match2), + /* K62 */ be_nested_str_weak(re), + /* K63 */ be_nested_str_weak(match2), + /* K64 */ be_nested_str_weak(re_http_srv_header), /* K65 */ be_nested_str_weak(event_http_header), - /* K66 */ be_nested_str_weak(_re_http_srv_body), + /* K66 */ be_nested_str_weak(re_http_srv_body), /* K67 */ be_const_int(2147483647), /* K68 */ be_nested_str_weak(log), /* K69 */ be_nested_str_weak(WEB_X3A_X20error_X20header_X20is_X20bigger_X20than_X201KB), - /* K70 */ be_nested_str_weak(_re_http_srv), + /* K70 */ be_nested_str_weak(re_http_srv), /* K71 */ be_nested_str_weak(req_version), /* K72 */ be_const_int(3), /* K73 */ be_nested_str_weak(loglevel), @@ -733,7 +733,7 @@ be_local_closure(class_webserver_async_cnx_set_chunked, /* name */ ********************************************************************/ be_local_closure(class_webserver_async_cnx_parse_http_headers, /* name */ be_nested_proto( - 6, /* nstack */ + 8, /* nstack */ 1, /* argc */ 10, /* varg */ 0, /* has upvals */ @@ -744,59 +744,60 @@ be_local_closure(class_webserver_async_cnx_parse_http_headers, /* name */ &be_ktab_class_webserver_async_cnx, /* shared constants */ be_str_weak(parse_http_headers), &be_const_str_solidified, - ( &(const binstruction[52]) { /* code */ - 0x50040200, // 0000 LDBOOL R1 1 0 - 0x78060030, // 0001 JMPF R1 #0033 - 0xB8067C00, // 0002 GETNGBL R1 K62 - 0x8804033F, // 0003 GETMBR R1 R1 K63 - 0x8C040340, // 0004 GETMET R1 R1 K64 - 0x880C0127, // 0005 GETMBR R3 R0 K39 - 0x88100129, // 0006 GETMBR R4 R0 K41 - 0x7C040600, // 0007 CALL R1 3 - 0x78060008, // 0008 JMPF R1 #0012 - 0x8C080141, // 0009 GETMET R2 R0 K65 - 0x94100336, // 000A GETIDX R4 R1 K54 - 0x94140338, // 000B GETIDX R5 R1 K56 - 0x7C080600, // 000C CALL R2 3 - 0x88080129, // 000D GETMBR R2 R0 K41 - 0x940C030D, // 000E GETIDX R3 R1 K13 - 0x00080403, // 000F ADD R2 R2 R3 - 0x90025202, // 0010 SETMBR R0 K41 R2 - 0x7002001F, // 0011 JMP #0032 - 0xB80A7C00, // 0012 GETNGBL R2 K62 - 0x88080542, // 0013 GETMBR R2 R2 K66 - 0x8C080540, // 0014 GETMET R2 R2 K64 - 0x88100127, // 0015 GETMBR R4 R0 K39 - 0x88140129, // 0016 GETMBR R5 R0 K41 - 0x7C080600, // 0017 CALL R2 3 - 0x780A000A, // 0018 JMPF R2 #0024 - 0x880C0129, // 0019 GETMBR R3 R0 K41 - 0x9410050D, // 001A GETIDX R4 R2 K13 - 0x000C0604, // 001B ADD R3 R3 R4 - 0x400C0743, // 001C CONNECT R3 R3 K67 - 0x88100127, // 001D GETMBR R4 R0 K39 - 0x940C0803, // 001E GETIDX R3 R4 R3 - 0x90024E03, // 001F SETMBR R0 K39 R3 - 0x9002530D, // 0020 SETMBR R0 K41 K13 - 0x90025538, // 0021 SETMBR R0 K42 K56 - 0x8C0C0139, // 0022 GETMET R3 R0 K57 - 0x7C0C0200, // 0023 CALL R3 1 - 0x600C000C, // 0024 GETGBL R3 G12 - 0x88100127, // 0025 GETMBR R4 R0 K39 - 0x7C0C0200, // 0026 CALL R3 1 - 0x541203FF, // 0027 LDINT R4 1024 - 0x240C0604, // 0028 GT R3 R3 R4 - 0x780E0006, // 0029 JMPF R3 #0031 - 0xB80E8800, // 002A GETNGBL R3 K68 - 0x58100045, // 002B LDCONST R4 K69 - 0x54160003, // 002C LDINT R5 4 - 0x7C0C0400, // 002D CALL R3 2 - 0x8C0C0122, // 002E GETMET R3 R0 K34 - 0x7C0C0200, // 002F CALL R3 1 - 0x90024F28, // 0030 SETMBR R0 K39 K40 - 0x80000600, // 0031 RET 0 - 0x7001FFCC, // 0032 JMP #0000 - 0x80000000, // 0033 RET 0 + ( &(const binstruction[53]) { /* code */ + 0xA4067C00, // 0000 IMPORT R1 K62 + 0x50080200, // 0001 LDBOOL R2 1 0 + 0x780A0030, // 0002 JMPF R2 #0034 + 0x8C08033F, // 0003 GETMET R2 R1 K63 + 0x88100100, // 0004 GETMBR R4 R0 K0 + 0x88100940, // 0005 GETMBR R4 R4 K64 + 0x88140127, // 0006 GETMBR R5 R0 K39 + 0x88180129, // 0007 GETMBR R6 R0 K41 + 0x7C080800, // 0008 CALL R2 4 + 0x780A0008, // 0009 JMPF R2 #0013 + 0x8C0C0141, // 000A GETMET R3 R0 K65 + 0x94140536, // 000B GETIDX R5 R2 K54 + 0x94180538, // 000C GETIDX R6 R2 K56 + 0x7C0C0600, // 000D CALL R3 3 + 0x880C0129, // 000E GETMBR R3 R0 K41 + 0x9410050D, // 000F GETIDX R4 R2 K13 + 0x000C0604, // 0010 ADD R3 R3 R4 + 0x90025203, // 0011 SETMBR R0 K41 R3 + 0x7002001F, // 0012 JMP #0033 + 0x8C0C033F, // 0013 GETMET R3 R1 K63 + 0x88140100, // 0014 GETMBR R5 R0 K0 + 0x88140B42, // 0015 GETMBR R5 R5 K66 + 0x88180127, // 0016 GETMBR R6 R0 K39 + 0x881C0129, // 0017 GETMBR R7 R0 K41 + 0x7C0C0800, // 0018 CALL R3 4 + 0x780E000A, // 0019 JMPF R3 #0025 + 0x88100129, // 001A GETMBR R4 R0 K41 + 0x9414070D, // 001B GETIDX R5 R3 K13 + 0x00100805, // 001C ADD R4 R4 R5 + 0x40100943, // 001D CONNECT R4 R4 K67 + 0x88140127, // 001E GETMBR R5 R0 K39 + 0x94100A04, // 001F GETIDX R4 R5 R4 + 0x90024E04, // 0020 SETMBR R0 K39 R4 + 0x9002530D, // 0021 SETMBR R0 K41 K13 + 0x90025538, // 0022 SETMBR R0 K42 K56 + 0x8C100139, // 0023 GETMET R4 R0 K57 + 0x7C100200, // 0024 CALL R4 1 + 0x6010000C, // 0025 GETGBL R4 G12 + 0x88140127, // 0026 GETMBR R5 R0 K39 + 0x7C100200, // 0027 CALL R4 1 + 0x541603FF, // 0028 LDINT R5 1024 + 0x24100805, // 0029 GT R4 R4 R5 + 0x78120006, // 002A JMPF R4 #0032 + 0xB8128800, // 002B GETNGBL R4 K68 + 0x58140045, // 002C LDCONST R5 K69 + 0x541A0003, // 002D LDINT R6 4 + 0x7C100400, // 002E CALL R4 2 + 0x8C100122, // 002F GETMET R4 R0 K34 + 0x7C100200, // 0030 CALL R4 1 + 0x90024F28, // 0031 SETMBR R0 K39 K40 + 0x80000800, // 0032 RET 0 + 0x7001FFCC, // 0033 JMP #0001 + 0x80000000, // 0034 RET 0 }) ) ); @@ -881,7 +882,7 @@ be_local_closure(class_webserver_async_cnx_content_stop, /* name */ ********************************************************************/ be_local_closure(class_webserver_async_cnx_parse_http_req_line, /* name */ be_nested_proto( - 9, /* nstack */ + 10, /* nstack */ 1, /* argc */ 10, /* varg */ 0, /* has upvals */ @@ -892,57 +893,58 @@ be_local_closure(class_webserver_async_cnx_parse_http_req_line, /* name */ &be_ktab_class_webserver_async_cnx, /* shared constants */ be_str_weak(parse_http_req_line), &be_const_str_solidified, - ( &(const binstruction[50]) { /* code */ - 0xB8067C00, // 0000 GETNGBL R1 K62 - 0x88040346, // 0001 GETMBR R1 R1 K70 - 0x8C040340, // 0002 GETMET R1 R1 K64 - 0x880C0127, // 0003 GETMBR R3 R0 K39 - 0x88100129, // 0004 GETMBR R4 R0 K41 - 0x7C040600, // 0005 CALL R1 3 - 0x7806001C, // 0006 JMPF R1 #0024 - 0x9408030D, // 0007 GETIDX R2 R1 K13 - 0x940C0336, // 0008 GETIDX R3 R1 K54 - 0x90020603, // 0009 SETMBR R0 K3 R3 - 0x940C0338, // 000A GETIDX R3 R1 K56 - 0x90020403, // 000B SETMBR R0 K2 R3 - 0x940C0348, // 000C GETIDX R3 R1 K72 - 0x90028E03, // 000D SETMBR R0 K71 R3 - 0x90025536, // 000E SETMBR R0 K42 K54 - 0x400C0543, // 000F CONNECT R3 R2 K67 - 0x88100127, // 0010 GETMBR R4 R0 K39 - 0x940C0803, // 0011 GETIDX R3 R4 R3 - 0x90024E03, // 0012 SETMBR R0 K39 R3 - 0xB80E5A00, // 0013 GETNGBL R3 K45 - 0x8C0C0749, // 0014 GETMET R3 R3 K73 - 0x54160003, // 0015 LDINT R5 4 - 0x7C0C0400, // 0016 CALL R3 2 - 0x780E0008, // 0017 JMPF R3 #0021 - 0xB80E8800, // 0018 GETNGBL R3 K68 - 0x60100018, // 0019 GETGBL R4 G24 - 0x5814004A, // 001A LDCONST R5 K74 - 0x88180103, // 001B GETMBR R6 R0 K3 - 0x881C0102, // 001C GETMBR R7 R0 K2 - 0x88200147, // 001D GETMBR R8 R0 K71 - 0x7C100800, // 001E CALL R4 4 - 0x54160003, // 001F LDINT R5 4 - 0x7C0C0400, // 0020 CALL R3 2 - 0x8C0C0137, // 0021 GETMET R3 R0 K55 - 0x7C0C0200, // 0022 CALL R3 1 - 0x7002000C, // 0023 JMP #0031 - 0x6008000C, // 0024 GETGBL R2 G12 - 0x880C0127, // 0025 GETMBR R3 R0 K39 - 0x7C080200, // 0026 CALL R2 1 - 0x540E0063, // 0027 LDINT R3 100 - 0x24080403, // 0028 GT R2 R2 R3 - 0x780A0006, // 0029 JMPF R2 #0031 - 0xB80A8800, // 002A GETNGBL R2 K68 - 0x580C004B, // 002B LDCONST R3 K75 - 0x54120003, // 002C LDINT R4 4 - 0x7C080400, // 002D CALL R2 2 - 0x8C080122, // 002E GETMET R2 R0 K34 - 0x7C080200, // 002F CALL R2 1 - 0x90024F28, // 0030 SETMBR R0 K39 K40 - 0x80000000, // 0031 RET 0 + ( &(const binstruction[51]) { /* code */ + 0xA4067C00, // 0000 IMPORT R1 K62 + 0x8C08033F, // 0001 GETMET R2 R1 K63 + 0x88100100, // 0002 GETMBR R4 R0 K0 + 0x88100946, // 0003 GETMBR R4 R4 K70 + 0x88140127, // 0004 GETMBR R5 R0 K39 + 0x88180129, // 0005 GETMBR R6 R0 K41 + 0x7C080800, // 0006 CALL R2 4 + 0x780A001C, // 0007 JMPF R2 #0025 + 0x940C050D, // 0008 GETIDX R3 R2 K13 + 0x94100536, // 0009 GETIDX R4 R2 K54 + 0x90020604, // 000A SETMBR R0 K3 R4 + 0x94100538, // 000B GETIDX R4 R2 K56 + 0x90020404, // 000C SETMBR R0 K2 R4 + 0x94100548, // 000D GETIDX R4 R2 K72 + 0x90028E04, // 000E SETMBR R0 K71 R4 + 0x90025536, // 000F SETMBR R0 K42 K54 + 0x40100743, // 0010 CONNECT R4 R3 K67 + 0x88140127, // 0011 GETMBR R5 R0 K39 + 0x94100A04, // 0012 GETIDX R4 R5 R4 + 0x90024E04, // 0013 SETMBR R0 K39 R4 + 0xB8125A00, // 0014 GETNGBL R4 K45 + 0x8C100949, // 0015 GETMET R4 R4 K73 + 0x541A0003, // 0016 LDINT R6 4 + 0x7C100400, // 0017 CALL R4 2 + 0x78120008, // 0018 JMPF R4 #0022 + 0xB8128800, // 0019 GETNGBL R4 K68 + 0x60140018, // 001A GETGBL R5 G24 + 0x5818004A, // 001B LDCONST R6 K74 + 0x881C0103, // 001C GETMBR R7 R0 K3 + 0x88200102, // 001D GETMBR R8 R0 K2 + 0x88240147, // 001E GETMBR R9 R0 K71 + 0x7C140800, // 001F CALL R5 4 + 0x541A0003, // 0020 LDINT R6 4 + 0x7C100400, // 0021 CALL R4 2 + 0x8C100137, // 0022 GETMET R4 R0 K55 + 0x7C100200, // 0023 CALL R4 1 + 0x7002000C, // 0024 JMP #0032 + 0x600C000C, // 0025 GETGBL R3 G12 + 0x88100127, // 0026 GETMBR R4 R0 K39 + 0x7C0C0200, // 0027 CALL R3 1 + 0x54120063, // 0028 LDINT R4 100 + 0x240C0604, // 0029 GT R3 R3 R4 + 0x780E0006, // 002A JMPF R3 #0032 + 0xB80E8800, // 002B GETNGBL R3 K68 + 0x5810004B, // 002C LDCONST R4 K75 + 0x54160003, // 002D LDINT R5 4 + 0x7C0C0400, // 002E CALL R3 2 + 0x8C0C0122, // 002F GETMET R3 R0 K34 + 0x7C0C0200, // 0030 CALL R3 1 + 0x90024F28, // 0031 SETMBR R0 K39 K40 + 0x80000000, // 0032 RET 0 }) ) ); @@ -1118,93 +1120,54 @@ be_local_class(webserver_async_dispatcher, be_str_weak(webserver_async_dispatcher) ); extern const bclass be_class_webserver_async; -// compact class 'webserver_async' ktab size: 48, total: 71 (saved 184 bytes) -static const bvalue be_ktab_class_webserver_async[48] = { - /* K0 */ be_nested_str_weak(chunked), - /* K1 */ be_nested_str_weak(re), - /* K2 */ be_nested_str_weak(global), - /* K3 */ be_nested_str_weak(contains), - /* K4 */ be_nested_str_weak(_re_http_srv), - /* K5 */ be_nested_str_weak(compile), - /* K6 */ be_nested_str_weak(_X5E_X28_X5Cw_X2B_X29_X20_X28_X5CS_X2B_X29_X20HTTP_X5C_X2F_X28_X5Cd_X5C_X2E_X5Cd_X29_X0D_X0A), - /* K7 */ be_nested_str_weak(_re_http_srv_header), - /* K8 */ be_nested_str_weak(_X28_X5BA_X2DZa_X2Dz0_X2D9_X2D_X5D_X2B_X29_X3A_X20_X28_X2E_X2A_X3F_X29_X0D_X0A), - /* K9 */ be_nested_str_weak(_re_http_srv_body), - /* K10 */ be_nested_str_weak(_X0D_X0A), - /* K11 */ be_nested_str_weak(cors), - /* K12 */ be_nested_str_weak(clean_connections), - /* K13 */ be_nested_str_weak(server), - /* K14 */ be_nested_str_weak(hasclient), - /* K15 */ be_nested_str_weak(webserver_async_cnx), - /* K16 */ be_nested_str_weak(acceptasync), - /* K17 */ be_nested_str_weak(set_chunked), - /* K18 */ be_nested_str_weak(connections), - /* K19 */ be_nested_str_weak(push), - /* K20 */ be_nested_str_weak(tasmota), - /* K21 */ be_nested_str_weak(remove_driver), - /* K22 */ be_nested_str_weak(remove_fast_loop), - /* K23 */ be_nested_str_weak(fastloop_cb), - /* K24 */ be_nested_str_weak(close), +// compact class 'webserver_async' ktab size: 37, total: 60 (saved 184 bytes) +static const bvalue be_ktab_class_webserver_async[37] = { + /* K0 */ be_nested_str_weak(clean_connections), + /* K1 */ be_nested_str_weak(server), + /* K2 */ be_nested_str_weak(hasclient), + /* K3 */ be_nested_str_weak(webserver_async_cnx), + /* K4 */ be_nested_str_weak(acceptasync), + /* K5 */ be_nested_str_weak(set_chunked), + /* K6 */ be_nested_str_weak(chunked), + /* K7 */ be_nested_str_weak(connections), + /* K8 */ be_nested_str_weak(push), + /* K9 */ be_nested_str_weak(cors), + /* K10 */ be_const_class(be_class_webserver_async), + /* K11 */ be_nested_str_weak(clear), + /* K12 */ be_const_int(0), + /* K13 */ be_nested_str_weak(resize), + /* K14 */ be_const_int(1), + /* K15 */ be_nested_str_weak(reverse), + /* K16 */ be_nested_str_weak(connected), + /* K17 */ be_nested_str_weak(close), + /* K18 */ be_nested_str_weak(remove), + /* K19 */ be_nested_str_weak(webserver_async_dispatcher), + /* K20 */ be_nested_str_weak(dispatchers), + /* K21 */ be_nested_str_weak(tasmota), + /* K22 */ be_nested_str_weak(remove_driver), + /* K23 */ be_nested_str_weak(remove_fast_loop), + /* K24 */ be_nested_str_weak(fastloop_cb), /* K25 */ be_nested_str_weak(stop_iteration), - /* K26 */ be_const_class(be_class_webserver_async), - /* K27 */ be_nested_str_weak(clear), - /* K28 */ be_const_int(0), - /* K29 */ be_nested_str_weak(resize), - /* K30 */ be_const_int(1), - /* K31 */ be_nested_str_weak(reverse), - /* K32 */ be_nested_str_weak(dispatchers), - /* K33 */ be_nested_str_weak(tcpserver), - /* K34 */ be_nested_str_weak(p1), - /* K35 */ be_nested_str_weak(compile_re), - /* K36 */ be_nested_str_weak(add_driver), - /* K37 */ be_nested_str_weak(add_fast_loop), - /* K38 */ be_nested_str_weak(connected), - /* K39 */ be_nested_str_weak(remove), - /* K40 */ be_nested_str_weak(append), - /* K41 */ be_nested_str_weak(webserver_async_dispatcher), - /* K42 */ be_nested_str_weak(dispatch), - /* K43 */ be_nested_str_weak(send), - /* K44 */ be_nested_str_weak(text_X2Fplain), - /* K45 */ be_nested_str_weak(write), - /* K46 */ be_nested_str_weak(Unsupported), - /* K47 */ be_nested_str_weak(content_stop), + /* K26 */ be_nested_str_weak(dispatch), + /* K27 */ be_nested_str_weak(send), + /* K28 */ be_nested_str_weak(text_X2Fplain), + /* K29 */ be_nested_str_weak(write), + /* K30 */ be_nested_str_weak(Unsupported), + /* K31 */ be_nested_str_weak(content_stop), + /* K32 */ be_nested_str_weak(tcpserver), + /* K33 */ be_nested_str_weak(p1), + /* K34 */ be_nested_str_weak(add_driver), + /* K35 */ be_nested_str_weak(add_fast_loop), + /* K36 */ be_nested_str_weak(append), }; extern const bclass be_class_webserver_async; /******************************************************************** -** Solidified function: set_chunked +** Solidified function: loop ********************************************************************/ -be_local_closure(class_webserver_async_set_chunked, /* name */ - be_nested_proto( - 4, /* nstack */ - 2, /* argc */ - 10, /* varg */ - 0, /* has upvals */ - NULL, /* no upvals */ - 0, /* has sup protos */ - NULL, /* no sub protos */ - 1, /* has constants */ - &be_ktab_class_webserver_async, /* shared constants */ - be_str_weak(set_chunked), - &be_const_str_solidified, - ( &(const binstruction[ 5]) { /* code */ - 0x60080017, // 0000 GETGBL R2 G23 - 0x5C0C0200, // 0001 MOVE R3 R1 - 0x7C080200, // 0002 CALL R2 1 - 0x90020002, // 0003 SETMBR R0 K0 R2 - 0x80000000, // 0004 RET 0 - }) - ) -); -/*******************************************************************/ - - -/******************************************************************** -** Solidified function: compile_re -********************************************************************/ -be_local_closure(class_webserver_async_compile_re, /* name */ +be_local_closure(class_webserver_async_loop, /* name */ be_nested_proto( 6, /* nstack */ 1, /* argc */ @@ -1215,31 +1178,30 @@ be_local_closure(class_webserver_async_compile_re, /* name */ NULL, /* no sub protos */ 1, /* has constants */ &be_ktab_class_webserver_async, /* shared constants */ - be_str_weak(compile_re), + be_str_weak(loop), &be_const_str_solidified, - ( &(const binstruction[22]) { /* code */ - 0xA4060200, // 0000 IMPORT R1 K1 - 0xB80A0400, // 0001 GETNGBL R2 K2 - 0x8C080503, // 0002 GETMET R2 R2 K3 - 0x58100004, // 0003 LDCONST R4 K4 - 0x7C080400, // 0004 CALL R2 2 - 0x740A000E, // 0005 JMPT R2 #0015 - 0xB80A0400, // 0006 GETNGBL R2 K2 - 0x8C0C0305, // 0007 GETMET R3 R1 K5 - 0x58140006, // 0008 LDCONST R5 K6 - 0x7C0C0400, // 0009 CALL R3 2 - 0x900A0803, // 000A SETMBR R2 K4 R3 - 0xB80A0400, // 000B GETNGBL R2 K2 - 0x8C0C0305, // 000C GETMET R3 R1 K5 - 0x58140008, // 000D LDCONST R5 K8 - 0x7C0C0400, // 000E CALL R3 2 - 0x900A0E03, // 000F SETMBR R2 K7 R3 - 0xB80A0400, // 0010 GETNGBL R2 K2 - 0x8C0C0305, // 0011 GETMET R3 R1 K5 - 0x5814000A, // 0012 LDCONST R5 K10 - 0x7C0C0400, // 0013 CALL R3 2 - 0x900A1203, // 0014 SETMBR R2 K9 R3 - 0x80000000, // 0015 RET 0 + ( &(const binstruction[21]) { /* code */ + 0x8C040100, // 0000 GETMET R1 R0 K0 + 0x7C040200, // 0001 CALL R1 1 + 0x88040101, // 0002 GETMBR R1 R0 K1 + 0x8C040302, // 0003 GETMET R1 R1 K2 + 0x7C040200, // 0004 CALL R1 1 + 0x7806000D, // 0005 JMPF R1 #0014 + 0x8C040103, // 0006 GETMET R1 R0 K3 + 0x5C0C0000, // 0007 MOVE R3 R0 + 0x88100101, // 0008 GETMBR R4 R0 K1 + 0x8C100904, // 0009 GETMET R4 R4 K4 + 0x7C100200, // 000A CALL R4 1 + 0x7C040600, // 000B CALL R1 3 + 0x8C080305, // 000C GETMET R2 R1 K5 + 0x88100106, // 000D GETMBR R4 R0 K6 + 0x7C080400, // 000E CALL R2 2 + 0x88080107, // 000F GETMBR R2 R0 K7 + 0x8C080508, // 0010 GETMET R2 R2 K8 + 0x5C100200, // 0011 MOVE R4 R1 + 0x7C080400, // 0012 CALL R2 2 + 0x7001FFED, // 0013 JMP #0002 + 0x80000000, // 0014 RET 0 }) ) ); @@ -1266,7 +1228,7 @@ be_local_closure(class_webserver_async_set_cors, /* name */ 0x60080017, // 0000 GETGBL R2 G23 0x5C0C0200, // 0001 MOVE R3 R1 0x7C080200, // 0002 CALL R2 1 - 0x90021602, // 0003 SETMBR R0 K11 R2 + 0x90021202, // 0003 SETMBR R0 K9 R2 0x80000000, // 0004 RET 0 }) ) @@ -1274,101 +1236,6 @@ be_local_closure(class_webserver_async_set_cors, /* name */ /*******************************************************************/ -/******************************************************************** -** Solidified function: loop -********************************************************************/ -be_local_closure(class_webserver_async_loop, /* name */ - be_nested_proto( - 6, /* nstack */ - 1, /* argc */ - 10, /* varg */ - 0, /* has upvals */ - NULL, /* no upvals */ - 0, /* has sup protos */ - NULL, /* no sub protos */ - 1, /* has constants */ - &be_ktab_class_webserver_async, /* shared constants */ - be_str_weak(loop), - &be_const_str_solidified, - ( &(const binstruction[21]) { /* code */ - 0x8C04010C, // 0000 GETMET R1 R0 K12 - 0x7C040200, // 0001 CALL R1 1 - 0x8804010D, // 0002 GETMBR R1 R0 K13 - 0x8C04030E, // 0003 GETMET R1 R1 K14 - 0x7C040200, // 0004 CALL R1 1 - 0x7806000D, // 0005 JMPF R1 #0014 - 0x8C04010F, // 0006 GETMET R1 R0 K15 - 0x5C0C0000, // 0007 MOVE R3 R0 - 0x8810010D, // 0008 GETMBR R4 R0 K13 - 0x8C100910, // 0009 GETMET R4 R4 K16 - 0x7C100200, // 000A CALL R4 1 - 0x7C040600, // 000B CALL R1 3 - 0x8C080311, // 000C GETMET R2 R1 K17 - 0x88100100, // 000D GETMBR R4 R0 K0 - 0x7C080400, // 000E CALL R2 2 - 0x88080112, // 000F GETMBR R2 R0 K18 - 0x8C080513, // 0010 GETMET R2 R2 K19 - 0x5C100200, // 0011 MOVE R4 R1 - 0x7C080400, // 0012 CALL R2 2 - 0x7001FFED, // 0013 JMP #0002 - 0x80000000, // 0014 RET 0 - }) - ) -); -/*******************************************************************/ - - -/******************************************************************** -** Solidified function: close -********************************************************************/ -be_local_closure(class_webserver_async_close, /* name */ - be_nested_proto( - 5, /* nstack */ - 1, /* argc */ - 10, /* varg */ - 0, /* has upvals */ - NULL, /* no upvals */ - 0, /* has sup protos */ - NULL, /* no sub protos */ - 1, /* has constants */ - &be_ktab_class_webserver_async, /* shared constants */ - be_str_weak(close), - &be_const_str_solidified, - ( &(const binstruction[28]) { /* code */ - 0xB8062800, // 0000 GETNGBL R1 K20 - 0x8C040315, // 0001 GETMET R1 R1 K21 - 0x5C0C0000, // 0002 MOVE R3 R0 - 0x7C040400, // 0003 CALL R1 2 - 0xB8062800, // 0004 GETNGBL R1 K20 - 0x8C040316, // 0005 GETMET R1 R1 K22 - 0x880C0117, // 0006 GETMBR R3 R0 K23 - 0x7C040400, // 0007 CALL R1 2 - 0x4C040000, // 0008 LDNIL R1 - 0x90022E01, // 0009 SETMBR R0 K23 R1 - 0x8804010D, // 000A GETMBR R1 R0 K13 - 0x8C040318, // 000B GETMET R1 R1 K24 - 0x7C040200, // 000C CALL R1 1 - 0x60040010, // 000D GETGBL R1 G16 - 0x88080112, // 000E GETMBR R2 R0 K18 - 0x7C040200, // 000F CALL R1 1 - 0xA8020004, // 0010 EXBLK 0 #0016 - 0x5C080200, // 0011 MOVE R2 R1 - 0x7C080000, // 0012 CALL R2 0 - 0x8C0C0518, // 0013 GETMET R3 R2 K24 - 0x7C0C0200, // 0014 CALL R3 1 - 0x7001FFFA, // 0015 JMP #0011 - 0x58040019, // 0016 LDCONST R1 K25 - 0xAC040200, // 0017 CATCH R1 1 0 - 0xB0080000, // 0018 RAISE 2 R0 R0 - 0x4C040000, // 0019 LDNIL R1 - 0x90022401, // 001A SETMBR R0 K18 R1 - 0x80000000, // 001B RET 0 - }) - ) -); -/*******************************************************************/ - - /******************************************************************** ** Solidified function: bytes_format_hex ********************************************************************/ @@ -1386,33 +1253,33 @@ be_local_closure(class_webserver_async_bytes_format_hex, /* name */ be_str_weak(bytes_format_hex), &be_const_str_solidified, ( &(const binstruction[50]) { /* code */ - 0x580C001A, // 0000 LDCONST R3 K26 - 0x8C10011B, // 0001 GETMET R4 R0 K27 + 0x580C000A, // 0000 LDCONST R3 K10 + 0x8C10010B, // 0001 GETMET R4 R0 K11 0x7C100200, // 0002 CALL R4 1 0x4C100000, // 0003 LDNIL R4 0x1C100204, // 0004 EQ R4 R1 R4 0x78120001, // 0005 JMPF R4 #0008 0x40100002, // 0006 CONNECT R4 R0 R2 0x80000800, // 0007 RET 0 - 0x1410031C, // 0008 LT R4 R1 K28 + 0x1410030C, // 0008 LT R4 R1 K12 0x78120000, // 0009 JMPF R4 #000B 0x44040200, // 000A NEG R1 R1 - 0x1410031C, // 000B LT R4 R1 K28 + 0x1410030C, // 000B LT R4 R1 K12 0x78120000, // 000C JMPF R4 #000E 0x80000800, // 000D RET 0 - 0x1C10031C, // 000E EQ R4 R1 K28 + 0x1C10030C, // 000E EQ R4 R1 K12 0x78120005, // 000F JMPF R4 #0016 - 0x8C10011D, // 0010 GETMET R4 R0 K29 - 0x5818001E, // 0011 LDCONST R6 K30 + 0x8C10010D, // 0010 GETMET R4 R0 K13 + 0x5818000E, // 0011 LDCONST R6 K14 0x7C100400, // 0012 CALL R4 2 0x5412002F, // 0013 LDINT R4 48 - 0x98023804, // 0014 SETIDX R0 K28 R4 + 0x98021804, // 0014 SETIDX R0 K12 R4 0x80000800, // 0015 RET 0 - 0x8C10011D, // 0016 GETMET R4 R0 K29 + 0x8C10010D, // 0016 GETMET R4 R0 K13 0x541A0007, // 0017 LDINT R6 8 0x7C100400, // 0018 CALL R4 2 - 0x5810001C, // 0019 LDCONST R4 K28 - 0x2414031C, // 001A GT R5 R1 K28 + 0x5810000C, // 0019 LDCONST R4 K12 + 0x2414030C, // 001A GT R5 R1 K12 0x7816000F, // 001B JMPF R5 #002C 0x5416000E, // 001C LDINT R5 15 0x2C140205, // 001D AND R5 R1 R5 @@ -1426,14 +1293,14 @@ be_local_closure(class_webserver_async_bytes_format_hex, /* name */ 0x541A0036, // 0025 LDINT R6 55 0x00180C05, // 0026 ADD R6 R6 R5 0x98000806, // 0027 SETIDX R0 R4 R6 - 0x0010091E, // 0028 ADD R4 R4 K30 + 0x0010090E, // 0028 ADD R4 R4 K14 0x541A0003, // 0029 LDINT R6 4 0x3C040206, // 002A SHR R1 R1 R6 0x7001FFED, // 002B JMP #001A - 0x8C14011D, // 002C GETMET R5 R0 K29 + 0x8C14010D, // 002C GETMET R5 R0 K13 0x5C1C0800, // 002D MOVE R7 R4 0x7C140400, // 002E CALL R5 2 - 0x8C14011F, // 002F GETMET R5 R0 K31 + 0x8C14010F, // 002F GETMET R5 R0 K15 0x7C140200, // 0030 CALL R5 1 0x80000000, // 0031 RET 0 }) @@ -1442,6 +1309,213 @@ be_local_closure(class_webserver_async_bytes_format_hex, /* name */ /*******************************************************************/ +/******************************************************************** +** Solidified function: clean_connections +********************************************************************/ +be_local_closure(class_webserver_async_clean_connections, /* name */ + be_nested_proto( + 6, /* nstack */ + 1, /* argc */ + 10, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + &be_ktab_class_webserver_async, /* shared constants */ + be_str_weak(clean_connections), + &be_const_str_solidified, + ( &(const binstruction[21]) { /* code */ + 0x5804000C, // 0000 LDCONST R1 K12 + 0x6008000C, // 0001 GETGBL R2 G12 + 0x880C0107, // 0002 GETMBR R3 R0 K7 + 0x7C080200, // 0003 CALL R2 1 + 0x14080202, // 0004 LT R2 R1 R2 + 0x780A000D, // 0005 JMPF R2 #0014 + 0x88080107, // 0006 GETMBR R2 R0 K7 + 0x94080401, // 0007 GETIDX R2 R2 R1 + 0x8C0C0510, // 0008 GETMET R3 R2 K16 + 0x7C0C0200, // 0009 CALL R3 1 + 0x740E0006, // 000A JMPT R3 #0012 + 0x8C0C0511, // 000B GETMET R3 R2 K17 + 0x7C0C0200, // 000C CALL R3 1 + 0x880C0107, // 000D GETMBR R3 R0 K7 + 0x8C0C0712, // 000E GETMET R3 R3 K18 + 0x5C140200, // 000F MOVE R5 R1 + 0x7C0C0400, // 0010 CALL R3 2 + 0x70020000, // 0011 JMP #0013 + 0x0004030E, // 0012 ADD R1 R1 K14 + 0x7001FFEC, // 0013 JMP #0001 + 0x80000000, // 0014 RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: on +********************************************************************/ +be_local_closure(class_webserver_async_on, /* name */ + be_nested_proto( + 11, /* nstack */ + 5, /* argc */ + 10, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + &be_ktab_class_webserver_async, /* shared constants */ + be_str_weak(on), + &be_const_str_solidified, + ( &(const binstruction[11]) { /* code */ + 0x8C140113, // 0000 GETMET R5 R0 K19 + 0x5C1C0200, // 0001 MOVE R7 R1 + 0x5C200400, // 0002 MOVE R8 R2 + 0x5C240600, // 0003 MOVE R9 R3 + 0x5C280800, // 0004 MOVE R10 R4 + 0x7C140A00, // 0005 CALL R5 5 + 0x88180114, // 0006 GETMBR R6 R0 K20 + 0x8C180D08, // 0007 GETMET R6 R6 K8 + 0x5C200A00, // 0008 MOVE R8 R5 + 0x7C180400, // 0009 CALL R6 2 + 0x80000000, // 000A RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: close +********************************************************************/ +be_local_closure(class_webserver_async_close, /* name */ + be_nested_proto( + 5, /* nstack */ + 1, /* argc */ + 10, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + &be_ktab_class_webserver_async, /* shared constants */ + be_str_weak(close), + &be_const_str_solidified, + ( &(const binstruction[28]) { /* code */ + 0xB8062A00, // 0000 GETNGBL R1 K21 + 0x8C040316, // 0001 GETMET R1 R1 K22 + 0x5C0C0000, // 0002 MOVE R3 R0 + 0x7C040400, // 0003 CALL R1 2 + 0xB8062A00, // 0004 GETNGBL R1 K21 + 0x8C040317, // 0005 GETMET R1 R1 K23 + 0x880C0118, // 0006 GETMBR R3 R0 K24 + 0x7C040400, // 0007 CALL R1 2 + 0x4C040000, // 0008 LDNIL R1 + 0x90023001, // 0009 SETMBR R0 K24 R1 + 0x88040101, // 000A GETMBR R1 R0 K1 + 0x8C040311, // 000B GETMET R1 R1 K17 + 0x7C040200, // 000C CALL R1 1 + 0x60040010, // 000D GETGBL R1 G16 + 0x88080107, // 000E GETMBR R2 R0 K7 + 0x7C040200, // 000F CALL R1 1 + 0xA8020004, // 0010 EXBLK 0 #0016 + 0x5C080200, // 0011 MOVE R2 R1 + 0x7C080000, // 0012 CALL R2 0 + 0x8C0C0511, // 0013 GETMET R3 R2 K17 + 0x7C0C0200, // 0014 CALL R3 1 + 0x7001FFFA, // 0015 JMP #0011 + 0x58040019, // 0016 LDCONST R1 K25 + 0xAC040200, // 0017 CATCH R1 1 0 + 0xB0080000, // 0018 RAISE 2 R0 R0 + 0x4C040000, // 0019 LDNIL R1 + 0x90020E01, // 001A SETMBR R0 K7 R1 + 0x80000000, // 001B RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: dispatch +********************************************************************/ +be_local_closure(class_webserver_async_dispatch, /* name */ + be_nested_proto( + 10, /* nstack */ + 4, /* argc */ + 10, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + &be_ktab_class_webserver_async, /* shared constants */ + be_str_weak(dispatch), + &be_const_str_solidified, + ( &(const binstruction[27]) { /* code */ + 0x5810000C, // 0000 LDCONST R4 K12 + 0x6014000C, // 0001 GETGBL R5 G12 + 0x88180114, // 0002 GETMBR R6 R0 K20 + 0x7C140200, // 0003 CALL R5 1 + 0x14140805, // 0004 LT R5 R4 R5 + 0x7816000A, // 0005 JMPF R5 #0011 + 0x88140114, // 0006 GETMBR R5 R0 K20 + 0x94140A04, // 0007 GETIDX R5 R5 R4 + 0x8C140B1A, // 0008 GETMET R5 R5 K26 + 0x5C1C0200, // 0009 MOVE R7 R1 + 0x5C200400, // 000A MOVE R8 R2 + 0x5C240600, // 000B MOVE R9 R3 + 0x7C140800, // 000C CALL R5 4 + 0x78160000, // 000D JMPF R5 #000F + 0x80000A00, // 000E RET 0 + 0x0010090E, // 000F ADD R4 R4 K14 + 0x7001FFEF, // 0010 JMP #0001 + 0x8C14031B, // 0011 GETMET R5 R1 K27 + 0x541E01F3, // 0012 LDINT R7 500 + 0x5820001C, // 0013 LDCONST R8 K28 + 0x7C140600, // 0014 CALL R5 3 + 0x8C14031D, // 0015 GETMET R5 R1 K29 + 0x581C001E, // 0016 LDCONST R7 K30 + 0x7C140400, // 0017 CALL R5 2 + 0x8C14031F, // 0018 GETMET R5 R1 K31 + 0x7C140200, // 0019 CALL R5 1 + 0x80000000, // 001A RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: set_chunked +********************************************************************/ +be_local_closure(class_webserver_async_set_chunked, /* name */ + be_nested_proto( + 4, /* nstack */ + 2, /* argc */ + 10, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + &be_ktab_class_webserver_async, /* shared constants */ + be_str_weak(set_chunked), + &be_const_str_solidified, + ( &(const binstruction[ 5]) { /* code */ + 0x60080017, // 0000 GETGBL R2 G23 + 0x5C0C0200, // 0001 MOVE R3 R1 + 0x7C080200, // 0002 CALL R2 1 + 0x90020C02, // 0003 SETMBR R0 K6 R2 + 0x80000000, // 0004 RET 0 + }) + ) +); +/*******************************************************************/ + + /******************************************************************** ** Solidified function: init ********************************************************************/ @@ -1482,83 +1556,37 @@ be_local_closure(class_webserver_async_init, /* name */ &be_ktab_class_webserver_async, /* shared constants */ be_str_weak(init), &be_const_str_solidified, - ( &(const binstruction[32]) { /* code */ + ( &(const binstruction[30]) { /* code */ 0x600C0012, // 0000 GETGBL R3 G18 0x7C0C0000, // 0001 CALL R3 0 - 0x90022403, // 0002 SETMBR R0 K18 R3 + 0x90020E03, // 0002 SETMBR R0 K7 R3 0x600C0012, // 0003 GETGBL R3 G18 0x7C0C0000, // 0004 CALL R3 0 - 0x90024003, // 0005 SETMBR R0 K32 R3 - 0xB80E4200, // 0006 GETNGBL R3 K33 + 0x90022803, // 0005 SETMBR R0 K20 R3 + 0xB80E4000, // 0006 GETNGBL R3 K32 0x5C100200, // 0007 MOVE R4 R1 0x7C0C0200, // 0008 CALL R3 1 - 0x90021A03, // 0009 SETMBR R0 K13 R3 + 0x90020203, // 0009 SETMBR R0 K1 R3 0x500C0200, // 000A LDBOOL R3 1 0 - 0x90020003, // 000B SETMBR R0 K0 R3 + 0x90020C03, // 000B SETMBR R0 K6 R3 0x500C0000, // 000C LDBOOL R3 0 0 - 0x90021603, // 000D SETMBR R0 K11 R3 + 0x90021203, // 000D SETMBR R0 K9 R3 0x600C0015, // 000E GETGBL R3 G21 0x54120063, // 000F LDINT R4 100 0x7C0C0200, // 0010 CALL R3 1 - 0x90024403, // 0011 SETMBR R0 K34 R3 - 0x8C0C0123, // 0012 GETMET R3 R0 K35 - 0x7C0C0200, // 0013 CALL R3 1 - 0xB80E2800, // 0014 GETNGBL R3 K20 - 0x8C0C0724, // 0015 GETMET R3 R3 K36 - 0x5C140000, // 0016 MOVE R5 R0 - 0x7C0C0400, // 0017 CALL R3 2 - 0x840C0000, // 0018 CLOSURE R3 P0 - 0x90022E03, // 0019 SETMBR R0 K23 R3 - 0xB80E2800, // 001A GETNGBL R3 K20 - 0x8C0C0725, // 001B GETMET R3 R3 K37 - 0x88140117, // 001C GETMBR R5 R0 K23 - 0x7C0C0400, // 001D CALL R3 2 - 0xA0000000, // 001E CLOSE R0 - 0x80000000, // 001F RET 0 - }) - ) -); -/*******************************************************************/ - - -/******************************************************************** -** Solidified function: clean_connections -********************************************************************/ -be_local_closure(class_webserver_async_clean_connections, /* name */ - be_nested_proto( - 6, /* nstack */ - 1, /* argc */ - 10, /* varg */ - 0, /* has upvals */ - NULL, /* no upvals */ - 0, /* has sup protos */ - NULL, /* no sub protos */ - 1, /* has constants */ - &be_ktab_class_webserver_async, /* shared constants */ - be_str_weak(clean_connections), - &be_const_str_solidified, - ( &(const binstruction[21]) { /* code */ - 0x5804001C, // 0000 LDCONST R1 K28 - 0x6008000C, // 0001 GETGBL R2 G12 - 0x880C0112, // 0002 GETMBR R3 R0 K18 - 0x7C080200, // 0003 CALL R2 1 - 0x14080202, // 0004 LT R2 R1 R2 - 0x780A000D, // 0005 JMPF R2 #0014 - 0x88080112, // 0006 GETMBR R2 R0 K18 - 0x94080401, // 0007 GETIDX R2 R2 R1 - 0x8C0C0526, // 0008 GETMET R3 R2 K38 - 0x7C0C0200, // 0009 CALL R3 1 - 0x740E0006, // 000A JMPT R3 #0012 - 0x8C0C0518, // 000B GETMET R3 R2 K24 - 0x7C0C0200, // 000C CALL R3 1 - 0x880C0112, // 000D GETMBR R3 R0 K18 - 0x8C0C0727, // 000E GETMET R3 R3 K39 - 0x5C140200, // 000F MOVE R5 R1 - 0x7C0C0400, // 0010 CALL R3 2 - 0x70020000, // 0011 JMP #0013 - 0x0004031E, // 0012 ADD R1 R1 K30 - 0x7001FFEC, // 0013 JMP #0001 - 0x80000000, // 0014 RET 0 + 0x90024203, // 0011 SETMBR R0 K33 R3 + 0xB80E2A00, // 0012 GETNGBL R3 K21 + 0x8C0C0722, // 0013 GETMET R3 R3 K34 + 0x5C140000, // 0014 MOVE R5 R0 + 0x7C0C0400, // 0015 CALL R3 2 + 0x840C0000, // 0016 CLOSURE R3 P0 + 0x90023003, // 0017 SETMBR R0 K24 R3 + 0xB80E2A00, // 0018 GETNGBL R3 K21 + 0x8C0C0723, // 0019 GETMET R3 R3 K35 + 0x88140118, // 001A GETMBR R5 R0 K24 + 0x7C0C0400, // 001B CALL R3 2 + 0xA0000000, // 001C CLOSE R0 + 0x80000000, // 001D RET 0 }) ) ); @@ -1582,14 +1610,14 @@ be_local_closure(class_webserver_async_bytes_append_int, /* name */ be_str_weak(bytes_append_int), &be_const_str_solidified, ( &(const binstruction[53]) { /* code */ - 0x580C001A, // 0000 LDCONST R3 K26 + 0x580C000A, // 0000 LDCONST R3 K10 0x6010000C, // 0001 GETGBL R4 G12 0x5C140000, // 0002 MOVE R5 R0 0x7C100200, // 0003 CALL R4 1 - 0x1C14031C, // 0004 EQ R5 R1 K28 + 0x1C14030C, // 0004 EQ R5 R1 K12 0x78160005, // 0005 JMPF R5 #000C - 0x8C14011D, // 0006 GETMET R5 R0 K29 - 0x001C091E, // 0007 ADD R7 R4 K30 + 0x8C14010D, // 0006 GETMET R5 R0 K13 + 0x001C090E, // 0007 ADD R7 R4 K14 0x7C140400, // 0008 CALL R5 2 0x5416002F, // 0009 LDINT R5 48 0x98000805, // 000A SETIDX R0 R4 R5 @@ -1598,40 +1626,40 @@ be_local_closure(class_webserver_async_bytes_append_int, /* name */ 0x20140205, // 000D NE R5 R1 R5 0x78160021, // 000E JMPF R5 #0031 0x50140000, // 000F LDBOOL R5 0 0 - 0x1418031C, // 0010 LT R6 R1 K28 + 0x1418030C, // 0010 LT R6 R1 K12 0x781A0001, // 0011 JMPF R6 #0014 0x44040200, // 0012 NEG R1 R1 0x50140200, // 0013 LDBOOL R5 1 0 - 0x1418031C, // 0014 LT R6 R1 K28 + 0x1418030C, // 0014 LT R6 R1 K12 0x781A0000, // 0015 JMPF R6 #0017 0x80040000, // 0016 RET 1 R0 0x78160005, // 0017 JMPF R5 #001E - 0x8C18011D, // 0018 GETMET R6 R0 K29 - 0x0020091E, // 0019 ADD R8 R4 K30 + 0x8C18010D, // 0018 GETMET R6 R0 K13 + 0x0020090E, // 0019 ADD R8 R4 K14 0x7C180400, // 001A CALL R6 2 0x541A002C, // 001B LDINT R6 45 0x98000806, // 001C SETIDX R0 R4 R6 - 0x0010091E, // 001D ADD R4 R4 K30 + 0x0010090E, // 001D ADD R4 R4 K14 0x5C180800, // 001E MOVE R6 R4 - 0x241C031C, // 001F GT R7 R1 K28 + 0x241C030C, // 001F GT R7 R1 K12 0x781E000B, // 0020 JMPF R7 #002D 0x541E0009, // 0021 LDINT R7 10 0x101C0207, // 0022 MOD R7 R1 R7 - 0x8C20011D, // 0023 GETMET R8 R0 K29 - 0x0028091E, // 0024 ADD R10 R4 K30 + 0x8C20010D, // 0023 GETMET R8 R0 K13 + 0x0028090E, // 0024 ADD R10 R4 K14 0x7C200400, // 0025 CALL R8 2 0x5422002F, // 0026 LDINT R8 48 0x00201007, // 0027 ADD R8 R8 R7 0x98000808, // 0028 SETIDX R0 R4 R8 - 0x0010091E, // 0029 ADD R4 R4 K30 + 0x0010090E, // 0029 ADD R4 R4 K14 0x54220009, // 002A LDINT R8 10 0x0C040208, // 002B DIV R1 R1 R8 0x7001FFF1, // 002C JMP #001F - 0x8C1C011F, // 002D GETMET R7 R0 K31 + 0x8C1C010F, // 002D GETMET R7 R0 K15 0x5C240C00, // 002E MOVE R9 R6 0x7C1C0400, // 002F CALL R7 2 0x70020002, // 0030 JMP #0034 - 0x8C140128, // 0031 GETMET R5 R0 K40 + 0x8C140124, // 0031 GETMET R5 R0 K36 0x5C1C0400, // 0032 MOVE R7 R2 0x7C140400, // 0033 CALL R5 2 0x80040000, // 0034 RET 1 R0 @@ -1641,119 +1669,37 @@ be_local_closure(class_webserver_async_bytes_append_int, /* name */ /*******************************************************************/ -/******************************************************************** -** Solidified function: on -********************************************************************/ -be_local_closure(class_webserver_async_on, /* name */ - be_nested_proto( - 11, /* nstack */ - 5, /* argc */ - 10, /* varg */ - 0, /* has upvals */ - NULL, /* no upvals */ - 0, /* has sup protos */ - NULL, /* no sub protos */ - 1, /* has constants */ - &be_ktab_class_webserver_async, /* shared constants */ - be_str_weak(on), - &be_const_str_solidified, - ( &(const binstruction[11]) { /* code */ - 0x8C140129, // 0000 GETMET R5 R0 K41 - 0x5C1C0200, // 0001 MOVE R7 R1 - 0x5C200400, // 0002 MOVE R8 R2 - 0x5C240600, // 0003 MOVE R9 R3 - 0x5C280800, // 0004 MOVE R10 R4 - 0x7C140A00, // 0005 CALL R5 5 - 0x88180120, // 0006 GETMBR R6 R0 K32 - 0x8C180D13, // 0007 GETMET R6 R6 K19 - 0x5C200A00, // 0008 MOVE R8 R5 - 0x7C180400, // 0009 CALL R6 2 - 0x80000000, // 000A RET 0 - }) - ) -); -/*******************************************************************/ - - -/******************************************************************** -** Solidified function: dispatch -********************************************************************/ -be_local_closure(class_webserver_async_dispatch, /* name */ - be_nested_proto( - 10, /* nstack */ - 4, /* argc */ - 10, /* varg */ - 0, /* has upvals */ - NULL, /* no upvals */ - 0, /* has sup protos */ - NULL, /* no sub protos */ - 1, /* has constants */ - &be_ktab_class_webserver_async, /* shared constants */ - be_str_weak(dispatch), - &be_const_str_solidified, - ( &(const binstruction[27]) { /* code */ - 0x5810001C, // 0000 LDCONST R4 K28 - 0x6014000C, // 0001 GETGBL R5 G12 - 0x88180120, // 0002 GETMBR R6 R0 K32 - 0x7C140200, // 0003 CALL R5 1 - 0x14140805, // 0004 LT R5 R4 R5 - 0x7816000A, // 0005 JMPF R5 #0011 - 0x88140120, // 0006 GETMBR R5 R0 K32 - 0x94140A04, // 0007 GETIDX R5 R5 R4 - 0x8C140B2A, // 0008 GETMET R5 R5 K42 - 0x5C1C0200, // 0009 MOVE R7 R1 - 0x5C200400, // 000A MOVE R8 R2 - 0x5C240600, // 000B MOVE R9 R3 - 0x7C140800, // 000C CALL R5 4 - 0x78160000, // 000D JMPF R5 #000F - 0x80000A00, // 000E RET 0 - 0x0010091E, // 000F ADD R4 R4 K30 - 0x7001FFEF, // 0010 JMP #0001 - 0x8C14032B, // 0011 GETMET R5 R1 K43 - 0x541E01F3, // 0012 LDINT R7 500 - 0x5820002C, // 0013 LDCONST R8 K44 - 0x7C140600, // 0014 CALL R5 3 - 0x8C14032D, // 0015 GETMET R5 R1 K45 - 0x581C002E, // 0016 LDCONST R7 K46 - 0x7C140400, // 0017 CALL R5 2 - 0x8C14032F, // 0018 GETMET R5 R1 K47 - 0x7C140200, // 0019 CALL R5 1 - 0x80000000, // 001A RET 0 - }) - ) -); -/*******************************************************************/ - - /******************************************************************** ** Solidified class: webserver_async ********************************************************************/ be_local_class(webserver_async, 8, NULL, - be_nested_map(21, + be_nested_map(23, ( (struct bmapnode*) &(const bmapnode[]) { - { be_const_key_weak(local_port, -1), be_const_var(0) }, - { be_const_key_weak(dispatchers, 11), be_const_var(4) }, - { be_const_key_weak(set_chunked, 10), be_const_closure(class_webserver_async_set_chunked_closure) }, - { be_const_key_weak(webserver_async_cnx, 20), be_const_class(be_class_webserver_async_cnx) }, - { be_const_key_weak(webserver_async_dispatcher, -1), be_const_class(be_class_webserver_async_dispatcher) }, - { be_const_key_weak(compile_re, -1), be_const_closure(class_webserver_async_compile_re_closure) }, - { be_const_key_weak(dispatch, 7), be_const_closure(class_webserver_async_dispatch_closure) }, - { be_const_key_weak(cors, 16), be_const_var(6) }, - { be_const_key_weak(connections, -1), be_const_var(3) }, - { be_const_key_weak(set_cors, 1), be_const_closure(class_webserver_async_set_cors_closure) }, - { be_const_key_weak(on, -1), be_const_closure(class_webserver_async_on_closure) }, - { be_const_key_weak(bytes_append_int, 18), be_const_static_closure(class_webserver_async_bytes_append_int_closure) }, - { be_const_key_weak(init, -1), be_const_closure(class_webserver_async_init_closure) }, - { be_const_key_weak(p1, -1), be_const_var(7) }, - { be_const_key_weak(fastloop_cb, -1), be_const_var(2) }, - { be_const_key_weak(server, 6), be_const_var(1) }, - { be_const_key_weak(clean_connections, 17), be_const_closure(class_webserver_async_clean_connections_closure) }, - { be_const_key_weak(bytes_format_hex, -1), be_const_static_closure(class_webserver_async_bytes_format_hex_closure) }, - { be_const_key_weak(close, 19), be_const_closure(class_webserver_async_close_closure) }, - { be_const_key_weak(loop, -1), be_const_closure(class_webserver_async_loop_closure) }, + { be_const_key_weak(loop, 22), be_const_closure(class_webserver_async_loop_closure) }, { be_const_key_weak(chunked, -1), be_const_var(5) }, + { be_const_key_weak(dispatchers, -1), be_const_var(4) }, + { be_const_key_weak(webserver_async_dispatcher, -1), be_const_class(be_class_webserver_async_dispatcher) }, + { be_const_key_weak(dispatch, -1), be_const_closure(class_webserver_async_dispatch_closure) }, + { be_const_key_weak(cors, -1), be_const_var(6) }, + { be_const_key_weak(clean_connections, 1), be_const_closure(class_webserver_async_clean_connections_closure) }, + { be_const_key_weak(re_http_srv, -1), be_const_bytes_instance(370000001D0000000300000062030260FB7E00507E02057762FC7E0301207E04055362FC7E0501200148015401540150012F7E060564012E05647E07010D010A7E017F) }, + { be_const_key_weak(set_chunked, -1), be_const_closure(class_webserver_async_set_chunked_closure) }, + { be_const_key_weak(on, -1), be_const_closure(class_webserver_async_on_closure) }, + { be_const_key_weak(close, -1), be_const_closure(class_webserver_async_close_closure) }, + { be_const_key_weak(fastloop_cb, 4), be_const_var(2) }, + { be_const_key_weak(server, 19), be_const_var(1) }, + { be_const_key_weak(set_cors, 15), be_const_closure(class_webserver_async_set_cors_closure) }, + { be_const_key_weak(init, -1), be_const_closure(class_webserver_async_init_closure) }, + { be_const_key_weak(p1, 8), be_const_var(7) }, + { be_const_key_weak(connections, -1), be_const_var(3) }, + { be_const_key_weak(local_port, 5), be_const_var(0) }, + { be_const_key_weak(bytes_append_int, -1), be_const_static_closure(class_webserver_async_bytes_append_int_closure) }, + { be_const_key_weak(re_http_srv_header, -1), be_const_bytes_instance(2B000000130000000200000062030260FB7E007E020304415A617A30392D2D62F47E03013A01207E0462030260FB7E05010D010A7E017F) }, + { be_const_key_weak(webserver_async_cnx, -1), be_const_class(be_class_webserver_async_cnx) }, + { be_const_key_weak(re_http_srv_body, 2), be_const_bytes_instance(0E000000080000000000000062030260FB7E00010D010A7E017F) }, + { be_const_key_weak(bytes_format_hex, -1), be_const_static_closure(class_webserver_async_bytes_format_hex_closure) }, })), be_str_weak(webserver_async) ); diff --git a/lib/libesp32/re1.5/dumpcode.c b/lib/libesp32/re1.5/dumpcode.c index d7781d849..0f7ce8edd 100644 --- a/lib/libesp32/re1.5/dumpcode.c +++ b/lib/libesp32/re1.5/dumpcode.c @@ -4,62 +4,82 @@ #include "re1.5.h" +// TASMOTA SPECIFIC +#ifndef INST_BUF_SIZE +#define INST_BUF_SIZE 96 +#endif + +void be_writebuffer(const char *buffer, size_t length); + +#define be_writestring(s) be_writebuffer((s), strlen(s)) + +#define logbuf(...) snprintf(__lbuf, sizeof(__lbuf), __VA_ARGS__) + +#define logfmt(...) \ + do { \ + char __lbuf[INST_BUF_SIZE]; \ + logbuf(__VA_ARGS__); \ + be_writestring(__lbuf); \ + } while (0) + +// all `printf` replaced with `logfmt` + void re1_5_dumpcode(ByteProg *prog) { int pc = 0; char *code = prog->insts; while (pc < prog->bytelen) { - printf("%2d: ", pc); + logfmt("%2d: ", pc); switch(code[pc++]) { default: assert(0); // re1_5_fatal("printprog"); case Split: - printf("split %d (%d)\n", pc + (signed char)code[pc] + 1, (signed char)code[pc]); + logfmt("split %d (%d)\n", pc + (signed char)code[pc] + 1, (signed char)code[pc]); pc++; break; case RSplit: - printf("rsplit %d (%d)\n", pc + (signed char)code[pc] + 1, (signed char)code[pc]); + logfmt("rsplit %d (%d)\n", pc + (signed char)code[pc] + 1, (signed char)code[pc]); pc++; break; case Jmp: - printf("jmp %d (%d)\n", pc + (signed char)code[pc] + 1, (signed char)code[pc]); + logfmt("jmp %d (%d)\n", pc + (signed char)code[pc] + 1, (signed char)code[pc]); pc++; break; case Char: - printf("char %c\n", code[pc++]); + logfmt("char %c\n", code[pc++]); break; case Any: - printf("any\n"); + logfmt("any\n"); break; case Class: case ClassNot: { int num = code[pc]; - printf("class%s %d", (code[pc - 1] == ClassNot ? "not" : ""), num); + logfmt("class%s %d", (code[pc - 1] == ClassNot ? "not" : ""), num); pc++; while (num--) { - printf(" 0x%02x-0x%02x", code[pc], code[pc + 1]); + logfmt(" 0x%02x-0x%02x", code[pc], code[pc + 1]); pc += 2; } - printf("\n"); + logfmt("\n"); break; } case NamedClass: - printf("namedclass %c\n", code[pc++]); + logfmt("namedclass %c\n", code[pc++]); break; case Match: - printf("match\n"); + logfmt("match\n"); break; case Save: - printf("save %d\n", (unsigned char)code[pc++]); + logfmt("save %d\n", (unsigned char)code[pc++]); break; case Bol: - printf("assert bol\n"); + logfmt("assert bol\n"); break; case Eol: - printf("assert eol\n"); + logfmt("assert eol\n"); break; } } - printf("Bytes: %d, insts: %d\n", prog->bytelen, prog->len); + logfmt("Bytes: %d, insts: %d\n", prog->bytelen, prog->len); } diff --git a/lib/libesp32_lvgl/LVGL_assets/src/lv_theme_haspmota.c b/lib/libesp32_lvgl/LVGL_assets/src/lv_theme_haspmota.c index f963f09c0..fefbf6fe8 100644 --- a/lib/libesp32_lvgl/LVGL_assets/src/lv_theme_haspmota.c +++ b/lib/libesp32_lvgl/LVGL_assets/src/lv_theme_haspmota.c @@ -1,24 +1,34 @@ /** - * @file lv_theme_defau.c - * - */ +* @file lv_theme_defau.c +* +*/ #include /********************* - * INCLUDES - *********************/ +* INCLUDES +*********************/ #include "../lvgl.h" /*To see all the widgets*/ #include "themes/lv_theme_private.h" #include "lv_theme_haspmota.h" -// #include "misc/lv_gc.h" TODO +#include "core/lv_global.h" /********************* - * DEFINES - *********************/ +* DEFINES +*********************/ + +// for lightweight logging +extern void berry_log_C(const char * berry_buf, ...); + + +struct _haspmota_theme_t; +typedef struct _haspmota_theme_t haspmota_theme_t; + +#define theme_def (*(haspmota_theme_t **)(&LV_GLOBAL_DEFAULT()->theme_default)) + #define MODE_DARK 1 -#define RADIUS_DEFAULT (disp_size == DISP_LARGE ? lv_display_dpx(theme.disp, 12) : lv_display_dpx(theme.disp, 8)) +#define RADIUS_DEFAULT LV_DPX_CALC(theme->disp_dpi, theme->disp_size == DISP_LARGE ? 12 : 8) /*SCREEN*/ #define LIGHT_COLOR_SCR lv_palette_lighten(LV_PALETTE_GREY, 4) @@ -26,77 +36,17 @@ #define LIGHT_COLOR_TEXT lv_palette_darken(LV_PALETTE_GREY, 4) #define LIGHT_COLOR_GREY lv_palette_lighten(LV_PALETTE_GREY, 2) #define DARK_COLOR_SCR lv_color_hex(0x15171A) -#define DARK_COLOR_CARD lv_color_hex(0x545b6a) -#define DARK_COLOR_TEXT lv_color_hex(0xefefef) +#define DARK_COLOR_CARD lv_color_hex(0x282b30) +#define DARK_COLOR_TEXT lv_palette_lighten(LV_PALETTE_GREY, 5) #define DARK_COLOR_GREY lv_color_hex(0x2f3237) #define TRANSITION_TIME LV_THEME_DEFAULT_TRANSITION_TIME -#define BORDER_WIDTH lv_display_dpx(theme.disp, 2) -#define OUTLINE_WIDTH lv_display_dpx(theme.disp, 3) +#define BORDER_WIDTH LV_DPX_CALC(theme->disp_dpi, 3) // Tasmota from 2 to 3 +#define OUTLINE_WIDTH LV_DPX_CALC(theme->disp_dpi, 3) -#define PAD_DEF (disp_size == DISP_LARGE ? lv_display_dpx(theme.disp, 24) : disp_size == DISP_MEDIUM ? lv_display_dpx(theme.disp, 20) : lv_display_dpx(theme.disp, 16)) -#define PAD_SMALL (disp_size == DISP_LARGE ? lv_display_dpx(theme.disp, 14) : disp_size == DISP_MEDIUM ? lv_display_dpx(theme.disp, 12) : lv_display_dpx(theme.disp, 10)) -#define PAD_TINY (disp_size == DISP_LARGE ? lv_display_dpx(theme.disp, 8) : disp_size == DISP_MEDIUM ? lv_display_dpx(theme.disp, 6) : lv_display_dpx(theme.disp, 2)) - -// OpenHASP specific -/*BUTTON*/ -#define COLOR_BTN (lv_color_lighten(HUE_COLOR, LV_OPA_30)) -#define COLOR_BTN_GRAD (lv_color_darken(HUE_COLOR, LV_OPA_30)) -#define COLOR_BTN_PR (lv_color_darken(COLOR_BTN_CHK, LV_OPA_20)) -#define COLOR_BTN_PR_GRAD lv_color_darken(COLOR_BTN_GRAD, LV_OPA_20) -#define COLOR_BTN_CHK lv_color_darken(COLOR_BTN_GRAD, LV_OPA_20) -#define COLOR_BTN_CHK_GRAD lv_color_darken(COLOR_BTN_GRAD, LV_OPA_10) -#define COLOR_BTN_CHK_PR (lv_color_darken(COLOR_BTN_CHK, LV_OPA_20)) -#define COLOR_BTN_CHK_PR_GRAD (lv_color_darken(COLOR_BTN_CHK_GRAD, LV_OPA_30)) -#define COLOR_BTN_DIS (IS_LIGHT ? lv_color_hex3(0xccc) : lv_color_hex3(0x888)) - -#define COLOR_BTN_BORDER (IS_LIGHT ? (lv_color_darken(HUE_COLOR, LV_OPA_50)) : (lv_color_lighten(HUE_COLOR, LV_OPA_40))) -#define COLOR_BTN_BORDER_PR (IS_LIGHT ? lv_color_hex3(0xccc) : lv_color_hex(0x5f656e)) -#define COLOR_BTN_BORDER_CHK (IS_LIGHT ? lv_color_hex(0x3b3e42) : lv_color_hex(0x5f656e)) -#define COLOR_BTN_BORDER_CHK_PR (IS_LIGHT ? lv_color_hex(0x3b3e42) : lv_color_hex(0x5f656e)) -#define COLOR_BTN_BORDER_INA (IS_LIGHT ? lv_color_hex3(0x888) : lv_color_hex(0x404040)) - -/*BACKGROUND*/ -#define COLOR_BG COLOR_BTN -#define COLOR_BG_PR COLOR_BTN_PR -#define COLOR_BG_CHK COLOR_BTN_CHK -#define COLOR_BG_PR_CHK COLOR_BTN_CHK_PR -#define COLOR_BG_DIS COLOR_BG - -#define COLOR_BG_BORDER (IS_LIGHT ? lv_color_hex(0xd6dde3) : lv_color_hex(0x808a97)) /*dfe7ed*/ -#define COLOR_BG_BORDER_PR (IS_LIGHT ? lv_color_hex3(0xccc) : lv_color_hex(0x5f656e)) -#define COLOR_BG_BORDER_CHK (IS_LIGHT ? lv_color_hex(0x3b3e42) : lv_color_hex(0x5f656e)) -#define COLOR_BG_BORDER_CHK_PR (IS_LIGHT ? lv_color_hex(0x3b3e42) : lv_color_hex(0x5f656e)) -#define COLOR_BG_BORDER_DIS (IS_LIGHT ? lv_color_hex(0xd6dde3) : lv_color_hex(0x5f656e)) - -#define COLOR_BG_TEXT lv_color_hex(0xeeeeee) -#define COLOR_BG_TEXT_PR LV_COLOR_WHITE -#define COLOR_BG_TEXT_CHK LV_COLOR_WHITE -#define COLOR_BG_TEXT_CHK_PR LV_COLOR_WHITE -#define COLOR_BG_TEXT_DIS (IS_LIGHT ? lv_color_hex3(0xaaa) : lv_color_hex3(0x999)) - -/*SECONDARY BACKGROUND*/ -#define COLOR_BG_SEC lv_color_lighten(theme.color_primary, LV_OPA_30) -#define COLOR_BG_GRAD COLOR_BTN_GRAD -#define COLOR_BG_SEC_BORDER (IS_LIGHT ? lv_color_hex(0xdfe7ed) : lv_color_hex(0x404040)) -#define COLOR_BG_SEC_TEXT (IS_LIGHT ? lv_color_hex(0x31404f) : lv_color_hex(0xa5a8ad)) -#define COLOR_BG_SEC_TEXT_DIS (IS_LIGHT ? lv_color_hex(0xaaaaaa) : lv_color_hex(0xa5a8ad)) - -// #define TRANSITION_TIME 0 /*((theme.flags & LV_THEME_HASP_FLAG_NO_TRANSITION) ? 0 : 150)*/ -// #define BORDER_WIDTH HASP_DPX(2) -// #define BORDER_COLOR ((theme.flags & IS_LIGHT) ? lv_color_make(0x40, 0x40, 0x40) : lv_color_make(0xb0, 0xb0, 0xb0)) -// #define OUTLINE_WIDTH ((theme.flags & LV_THEME_HASP_FLAG_NO_FOCUS) ? 0 : HASP_DPX(3)) -// #define OUTLINE_COLOR ((theme.flags & LV_THEME_HASP_FLAG_NO_FOCUS) ? BORDER_COLOR : theme.color_secondary) - -// #define IS_LIGHT (theme.flags & LV_THEME_HASP_FLAG_LIGHT) -// #define NO_FOCUS (theme.flags & LV_THEME_HASP_FLAG_NO_FOCUS) - -// #define PAD_DEF (lv_disp_get_size_category(NULL) <= 720 ? HASP_DPX(15) : (HASP_DPX(30))) // TODO - -/*SCROLLBAR*/ -#define SCROLLBAR_COLOR \ - (IS_LIGHT ? lv_color_mix(theme.color_primary, lv_color_hex3(0x999), LV_OPA_10) \ - : lv_color_mix(theme.color_primary, lv_color_hex3(0x999), LV_OPA_10)) +#define PAD_DEF LV_DPX_CALC(theme->disp_dpi, theme->disp_size == DISP_LARGE ? 24 : theme->disp_size == DISP_MEDIUM ? 20 : 16) +#define PAD_SMALL LV_DPX_CALC(theme->disp_dpi, theme->disp_size == DISP_LARGE ? 14 : theme->disp_size == DISP_MEDIUM ? 12 : 10) +#define PAD_TINY LV_DPX_CALC(theme->disp_dpi, theme->disp_size == DISP_LARGE ? 8 : theme->disp_size == DISP_MEDIUM ? 6 : 2) /********************** * TYPEDEFS @@ -107,6 +57,8 @@ typedef struct { lv_style_t scrollbar_scrolled; lv_style_t card; lv_style_t btn; + lv_style_t btn_border; // force button like border + lv_style_t btn_border_color; // addition, use a light grey border /*Utility*/ lv_style_t bg_color_primary; @@ -129,25 +81,25 @@ typedef struct { lv_style_t circle; lv_style_t no_radius; lv_style_t clip_corner; + lv_style_t rotary_scroll; #if LV_THEME_DEFAULT_GROW lv_style_t grow; #endif lv_style_t transition_delayed; lv_style_t transition_normal; lv_style_t anim; + lv_style_t anim_fast; /*Parts*/ lv_style_t knob; - lv_style_t indic; #if LV_USE_ARC lv_style_t arc_indic; lv_style_t arc_indic_primary; - lv_style_t arc_knob; // knob for arc with zero #endif #if LV_USE_CHART - lv_style_t chart_series, chart_indic, chart_ticks, chart_bg; + lv_style_t chart_series, chart_indic, chart_bg; #endif #if LV_USE_DROPDOWN @@ -170,32 +122,29 @@ typedef struct { lv_style_t table_cell; #endif -#if LV_USE_METER - lv_style_t meter_marker, meter_indic; -#endif - #if LV_USE_TEXTAREA lv_style_t ta_cursor, ta_placeholder; #endif #if LV_USE_CALENDAR - lv_style_t calendar_bg, calendar_day; + lv_style_t calendar_btnm_bg, calendar_btnm_day, calendar_header; #endif -#if LV_USE_COLORWHEEL - lv_style_t colorwheel_main; +#if LV_USE_MENU + lv_style_t menu_bg, menu_cont, menu_sidebar_cont, menu_main_cont, menu_page, menu_header_cont, menu_header_btn, + menu_section, menu_pressed, menu_separator; #endif #if LV_USE_MSGBOX - lv_style_t msgbox_bg, msgbox_btn_bg, msgbox_backdrop_bg; + lv_style_t msgbox_backdrop_bg; #endif #if LV_USE_KEYBOARD - lv_style_t keyboard_btn_bg; + lv_style_t keyboard_button_bg; #endif #if LV_USE_LIST - lv_style_t list_bg, list_btn, list_item_grow, list_label; + lv_style_t list_bg, list_btn, list_item_grow; #endif #if LV_USE_TABVIEW @@ -204,18 +153,37 @@ typedef struct { #if LV_USE_LED lv_style_t led; #endif -} my_theme_styles_t; -typedef struct { - lv_theme_t base; - uint8_t light :1; -}my_theme_t; +#if LV_USE_SCALE + lv_style_t scale; +#endif +} haspmota_theme_styles_t; typedef enum { DISP_SMALL = 3, DISP_MEDIUM = 2, DISP_LARGE = 1, -}disp_size_t; +} disp_size_t; + +struct _haspmota_theme_t { + lv_theme_t base; + disp_size_t disp_size; + int32_t disp_dpi; + lv_color_t color_scr; + lv_color_t color_text; + lv_color_t color_card; + lv_color_t color_grey; + bool inited; + haspmota_theme_styles_t styles; + + lv_color_filter_dsc_t dark_filter; + lv_color_filter_dsc_t grey_filter; + +#if LV_THEME_DEFAULT_TRANSITION_TIME + lv_style_transition_dsc_t trans_delayed; + lv_style_transition_dsc_t trans_normal; +#endif +}; /********************** * STATIC PROTOTYPES @@ -226,15 +194,7 @@ static void style_init_reset(lv_style_t * style); /********************** * STATIC VARIABLES **********************/ -static my_theme_styles_t * styles; -static lv_theme_t theme; -static disp_size_t disp_size; -static bool inited; -static lv_color_t color_scr; -static lv_color_t color_text; -static lv_color_t color_card; -static lv_color_t color_grey; - +static haspmota_theme_t * haspmota_theme = NULL; /********************** * MACROS @@ -244,7 +204,6 @@ static lv_color_t color_grey; * STATIC FUNCTIONS **********************/ - static lv_color_t dark_color_filter_cb(const lv_color_filter_dsc_t * f, lv_color_t c, lv_opa_t opa) { LV_UNUSED(f); @@ -254,377 +213,432 @@ static lv_color_t dark_color_filter_cb(const lv_color_filter_dsc_t * f, lv_color static lv_color_t grey_filter_cb(const lv_color_filter_dsc_t * f, lv_color_t color, lv_opa_t opa) { LV_UNUSED(f); - if(theme.flags & MODE_DARK) return lv_color_mix(lv_palette_darken(LV_PALETTE_GREY, 2), color, opa); + if(haspmota_theme->base.flags & MODE_DARK) return lv_color_mix(lv_palette_darken(LV_PALETTE_GREY, 2), color, opa); else return lv_color_mix(lv_palette_lighten(LV_PALETTE_GREY, 2), color, opa); } -static void style_init(void) +static void style_init(haspmota_theme_t * theme) { +#if TRANSITION_TIME static const lv_style_prop_t trans_props[] = { - LV_STYLE_BG_OPA, LV_STYLE_BG_COLOR, - LV_STYLE_TRANSFORM_WIDTH, LV_STYLE_TRANSFORM_HEIGHT, - LV_STYLE_TRANSLATE_Y, LV_STYLE_TRANSLATE_X, - /*LV_STYLE_TRANSFORM_ZOOM_X, LV_STYLE_TRANSFORM_ZOOM_Y,*/ LV_STYLE_TRANSFORM_ANGLE, - LV_STYLE_COLOR_FILTER_OPA, LV_STYLE_COLOR_FILTER_DSC, - 0 + LV_STYLE_BG_OPA, LV_STYLE_BG_COLOR, + LV_STYLE_TRANSFORM_WIDTH, LV_STYLE_TRANSFORM_HEIGHT, + LV_STYLE_TRANSLATE_Y, LV_STYLE_TRANSLATE_X, + LV_STYLE_TRANSFORM_ROTATION, + LV_STYLE_TRANSFORM_SCALE_X, LV_STYLE_TRANSFORM_SCALE_Y, + LV_STYLE_COLOR_FILTER_OPA, LV_STYLE_COLOR_FILTER_DSC, + 0 }; - - color_scr = theme.flags & MODE_DARK ? DARK_COLOR_SCR : LIGHT_COLOR_SCR; - color_text = theme.flags & MODE_DARK ? DARK_COLOR_TEXT : LIGHT_COLOR_TEXT; - color_card = theme.flags & MODE_DARK ? DARK_COLOR_CARD : LIGHT_COLOR_CARD; - color_grey = theme.flags & MODE_DARK ? DARK_COLOR_GREY : LIGHT_COLOR_GREY; - - static lv_style_transition_dsc_t trans_delayed; - lv_style_transition_dsc_init(&trans_delayed, trans_props, lv_anim_path_linear, TRANSITION_TIME, 70, NULL); - - static lv_style_transition_dsc_t trans_normal; - lv_style_transition_dsc_init(&trans_normal, trans_props, lv_anim_path_linear, TRANSITION_TIME, 0, NULL); - - style_init_reset(&styles->transition_delayed); - lv_style_set_transition(&styles->transition_delayed, &trans_delayed); /*Go back to default state with delay*/ - - style_init_reset(&styles->transition_normal); - lv_style_set_transition(&styles->transition_normal, &trans_normal); /*Go back to default state with delay*/ - - style_init_reset(&styles->scrollbar); - lv_style_set_bg_color(&styles->scrollbar, (theme.flags & MODE_DARK) ? lv_palette_darken(LV_PALETTE_GREY, 2) : lv_palette_main(LV_PALETTE_GREY)); - lv_style_set_radius(&styles->scrollbar, LV_RADIUS_CIRCLE); - lv_style_set_pad_right(&styles->scrollbar, lv_display_dpx(theme.disp, 7)); - lv_style_set_pad_top(&styles->scrollbar, lv_display_dpx(theme.disp, 7)); - lv_style_set_size(&styles->scrollbar, lv_display_dpx(theme.disp, 5), lv_display_dpx(theme.disp, 5)); - lv_style_set_bg_opa(&styles->scrollbar, LV_OPA_40); - lv_style_set_transition(&styles->scrollbar, &trans_normal); - - style_init_reset(&styles->scrollbar_scrolled); - lv_style_set_bg_opa(&styles->scrollbar_scrolled, LV_OPA_COVER); - - style_init_reset(&styles->scr); - lv_style_set_bg_opa(&styles->scr, LV_OPA_COVER); - lv_style_set_bg_color(&styles->scr, color_scr); - lv_style_set_text_color(&styles->scr, color_text); - lv_style_set_pad_row(&styles->scr, PAD_SMALL); - lv_style_set_pad_column(&styles->scr, PAD_SMALL); - lv_style_set_text_font(&styles->scr, theme.font_small); - lv_style_set_text_color(&styles->scr, color_text); - - style_init_reset(&styles->card); - lv_style_set_radius(&styles->card, RADIUS_DEFAULT); - lv_style_set_bg_opa(&styles->card, LV_OPA_TRANSP); // OpenHASP - lv_style_set_bg_color(&styles->card, color_card); - lv_style_set_border_color(&styles->card, color_grey); - lv_style_set_border_width(&styles->card, BORDER_WIDTH); - lv_style_set_border_post(&styles->card, true); - lv_style_set_text_color(&styles->card, color_text); - lv_style_set_pad_all(&styles->card, PAD_DEF); - lv_style_set_pad_row(&styles->card, PAD_SMALL); - lv_style_set_pad_column(&styles->card, PAD_SMALL); - lv_style_set_line_color(&styles->card, lv_palette_main(LV_PALETTE_GREY)); - lv_style_set_line_width(&styles->card, lv_display_dpx(theme.disp, 1)); - - style_init_reset(&styles->outline_primary); - lv_style_set_outline_color(&styles->outline_primary, theme.color_primary); - lv_style_set_outline_width(&styles->outline_primary, OUTLINE_WIDTH); - lv_style_set_outline_pad(&styles->outline_primary, OUTLINE_WIDTH); - lv_style_set_outline_opa(&styles->outline_primary, LV_OPA_50); - - style_init_reset(&styles->outline_secondary); - lv_style_set_outline_color(&styles->outline_secondary, theme.color_secondary); - lv_style_set_outline_width(&styles->outline_secondary, OUTLINE_WIDTH); - lv_style_set_outline_opa(&styles->outline_secondary, LV_OPA_50); - - style_init_reset(&styles->btn); - lv_style_set_radius(&styles->btn, (disp_size == DISP_LARGE ? lv_display_dpx(theme.disp, 16) : disp_size == DISP_MEDIUM ? lv_display_dpx(theme.disp, 12) : lv_display_dpx(theme.disp, 8))); - lv_style_set_bg_opa(&styles->btn, LV_OPA_COVER); - lv_style_set_bg_color(&styles->btn, color_grey); - // if(!(theme.flags & MODE_DARK)) { // OpenHASP - // lv_style_set_shadow_color(&styles->btn, lv_palette_lighten(LV_PALETTE_GREY, 3)); - // lv_style_set_shadow_width(&styles->btn, 1); - // lv_style_set_shadow_ofs_y(&styles->btn, lv_display_dpx(theme.disp, 4)); - // } - lv_style_set_text_color(&styles->btn, color_text); - lv_style_set_pad_hor(&styles->btn, PAD_DEF); - lv_style_set_pad_ver(&styles->btn, PAD_SMALL); - lv_style_set_pad_column(&styles->btn, lv_display_dpx(theme.disp, 5)); - lv_style_set_pad_row(&styles->btn, lv_display_dpx(theme.disp, 5)); - lv_style_set_text_font(&styles->btn, theme.font_normal); - - static lv_color_filter_dsc_t dark_filter; - lv_color_filter_dsc_init(&dark_filter, dark_color_filter_cb); - - static lv_color_filter_dsc_t grey_filter; - lv_color_filter_dsc_init(&grey_filter, grey_filter_cb); - - style_init_reset(&styles->pressed); - lv_style_set_color_filter_dsc(&styles->pressed, &dark_filter); - lv_style_set_color_filter_opa(&styles->pressed, 35); - - style_init_reset(&styles->disabled); - lv_style_set_color_filter_dsc(&styles->disabled, &grey_filter); - lv_style_set_color_filter_opa(&styles->disabled, LV_OPA_50); - - style_init_reset(&styles->clip_corner); - lv_style_set_clip_corner(&styles->clip_corner, true); - - style_init_reset(&styles->pad_normal); - lv_style_set_pad_all(&styles->pad_normal, PAD_DEF); - lv_style_set_pad_row(&styles->pad_normal, PAD_DEF); - lv_style_set_pad_column(&styles->pad_normal, PAD_DEF); - - style_init_reset(&styles->pad_small); - lv_style_set_pad_all(&styles->pad_small, PAD_SMALL); - lv_style_set_pad_gap(&styles->pad_small, PAD_SMALL); - - style_init_reset(&styles->pad_gap); - lv_style_set_pad_row(&styles->pad_gap, lv_display_dpx(theme.disp, 10)); - lv_style_set_pad_column(&styles->pad_gap, lv_display_dpx(theme.disp, 10)); - - style_init_reset(&styles->line_space_large); - lv_style_set_text_line_space(&styles->line_space_large, lv_display_dpx(theme.disp, 20)); - - style_init_reset(&styles->text_align_center); - lv_style_set_text_align(&styles->text_align_center, LV_TEXT_ALIGN_CENTER); - - style_init_reset(&styles->pad_zero); - lv_style_set_pad_all(&styles->pad_zero, 0); - lv_style_set_pad_row(&styles->pad_zero, 0); - lv_style_set_pad_column(&styles->pad_zero, 0); - - style_init_reset(&styles->pad_tiny); - lv_style_set_pad_all(&styles->pad_tiny, PAD_TINY); - lv_style_set_pad_row(&styles->pad_tiny, PAD_TINY); - lv_style_set_pad_column(&styles->pad_tiny, PAD_TINY); - - style_init_reset(&styles->bg_color_primary); - lv_style_set_bg_color(&styles->bg_color_primary, theme.color_primary); - lv_style_set_text_color(&styles->bg_color_primary, lv_color_white()); - lv_style_set_bg_opa(&styles->bg_color_primary, LV_OPA_COVER); - - style_init_reset(&styles->bg_color_primary_muted); - lv_style_set_bg_color(&styles->bg_color_primary_muted, theme.color_primary); - lv_style_set_text_color(&styles->bg_color_primary_muted, theme.color_primary); - lv_style_set_bg_opa(&styles->bg_color_primary_muted, LV_OPA_20); - - style_init_reset(&styles->bg_color_secondary); - lv_style_set_bg_color(&styles->bg_color_secondary, theme.color_secondary); - lv_style_set_text_color(&styles->bg_color_secondary, lv_color_white()); - lv_style_set_bg_opa(&styles->bg_color_secondary, LV_OPA_COVER); - - style_init_reset(&styles->bg_color_secondary_muted); - lv_style_set_bg_color(&styles->bg_color_secondary_muted, theme.color_secondary); - lv_style_set_text_color(&styles->bg_color_secondary_muted, theme.color_secondary); - lv_style_set_bg_opa(&styles->bg_color_secondary_muted, LV_OPA_20); - - style_init_reset(&styles->bg_color_grey); - lv_style_set_bg_color(&styles->bg_color_grey, color_grey); - lv_style_set_bg_opa(&styles->bg_color_grey, LV_OPA_COVER); - lv_style_set_text_color(&styles->bg_color_grey, color_text); - - style_init_reset(&styles->bg_color_white); - lv_style_set_bg_color(&styles->bg_color_white, color_card); - lv_style_set_bg_opa(&styles->bg_color_white, LV_OPA_COVER); - lv_style_set_text_color(&styles->bg_color_white, color_text); - - style_init_reset(&styles->circle); - lv_style_set_radius(&styles->circle, LV_RADIUS_CIRCLE); - - style_init_reset(&styles->no_radius); - lv_style_set_radius(&styles->no_radius, 0); - -#if LV_THEME_DEFAULT_GROW - style_init_reset(&styles->grow); - lv_style_set_transform_width(&styles->grow, lv_display_dpx(theme.disp, 3)); - lv_style_set_transform_height(&styles->grow, lv_display_dpx(theme.disp, 3)); #endif - style_init_reset(&styles->knob); - lv_style_set_bg_color(&styles->knob, theme.color_primary); - lv_style_set_bg_opa(&styles->knob, LV_OPA_COVER); - lv_style_set_pad_all(&styles->knob, lv_display_dpx(theme.disp, 6)); - lv_style_set_radius(&styles->knob, LV_RADIUS_CIRCLE); + // berry_log_C("HSP> theme->color_scr #%02X%02X%02X", theme->color_scr.red, theme->color_scr.green, theme->color_scr.blue); - style_init_reset(&styles->anim); - lv_style_set_anim_time(&styles->anim, 200); + style_init_reset(&theme->styles.transition_delayed); + style_init_reset(&theme->styles.transition_normal); +#if TRANSITION_TIME + lv_style_transition_dsc_init(&theme->trans_delayed, trans_props, lv_anim_path_linear, TRANSITION_TIME, 70, NULL); + lv_style_transition_dsc_init(&theme->trans_normal, trans_props, lv_anim_path_linear, TRANSITION_TIME, 0, NULL); + + lv_style_set_transition(&theme->styles.transition_delayed, + &theme->trans_delayed); /*Go back to default state with delay*/ + + lv_style_set_transition(&theme->styles.transition_normal, &theme->trans_normal); /*Go back to default state with delay*/ +#endif + + style_init_reset(&theme->styles.scrollbar); + lv_color_t sb_color = (theme->base.flags & MODE_DARK) ? lv_palette_darken(LV_PALETTE_GREY, + 2) : lv_palette_main(LV_PALETTE_GREY); + lv_style_set_bg_color(&theme->styles.scrollbar, sb_color); + + lv_style_set_radius(&theme->styles.scrollbar, LV_RADIUS_CIRCLE); + lv_style_set_pad_all(&theme->styles.scrollbar, LV_DPX_CALC(theme->disp_dpi, 7)); + lv_style_set_width(&theme->styles.scrollbar, LV_DPX_CALC(theme->disp_dpi, 5)); + lv_style_set_bg_opa(&theme->styles.scrollbar, LV_OPA_40); +#if TRANSITION_TIME + lv_style_set_transition(&theme->styles.scrollbar, &theme->trans_normal); +#endif + + style_init_reset(&theme->styles.scrollbar_scrolled); + lv_style_set_bg_opa(&theme->styles.scrollbar_scrolled, LV_OPA_COVER); + + style_init_reset(&theme->styles.scr); + lv_style_set_bg_opa(&theme->styles.scr, LV_OPA_COVER); + lv_style_set_bg_color(&theme->styles.scr, theme->color_scr); + lv_style_set_text_color(&theme->styles.scr, theme->color_text); + lv_style_set_text_font(&theme->styles.scr, theme->base.font_normal); + lv_style_set_pad_row(&theme->styles.scr, PAD_SMALL); + lv_style_set_pad_column(&theme->styles.scr, PAD_SMALL); + lv_style_set_rotary_sensitivity(&theme->styles.scr, theme->disp_dpi / 4 * 256); + + style_init_reset(&theme->styles.card); + lv_style_set_radius(&theme->styles.card, RADIUS_DEFAULT); + lv_style_set_bg_opa(&theme->styles.card, LV_OPA_COVER); + lv_style_set_bg_color(&theme->styles.card, theme->color_card); + lv_style_set_border_color(&theme->styles.card, theme->color_grey); + lv_style_set_border_width(&theme->styles.card, BORDER_WIDTH); + lv_style_set_border_post(&theme->styles.card, true); + lv_style_set_text_color(&theme->styles.card, theme->color_text); + lv_style_set_pad_all(&theme->styles.card, PAD_DEF); + lv_style_set_pad_row(&theme->styles.card, PAD_SMALL); + lv_style_set_pad_column(&theme->styles.card, PAD_SMALL); + lv_style_set_line_color(&theme->styles.card, lv_palette_main(LV_PALETTE_GREY)); + lv_style_set_line_width(&theme->styles.card, LV_DPX_CALC(theme->disp_dpi, 1)); + + style_init_reset(&theme->styles.outline_primary); + lv_style_set_outline_color(&theme->styles.outline_primary, theme->base.color_primary); + lv_style_set_outline_width(&theme->styles.outline_primary, OUTLINE_WIDTH); + lv_style_set_outline_pad(&theme->styles.outline_primary, OUTLINE_WIDTH); + lv_style_set_outline_opa(&theme->styles.outline_primary, LV_OPA_50); + + style_init_reset(&theme->styles.outline_secondary); + lv_style_set_outline_color(&theme->styles.outline_secondary, theme->base.color_secondary); + lv_style_set_outline_width(&theme->styles.outline_secondary, OUTLINE_WIDTH); + lv_style_set_outline_opa(&theme->styles.outline_secondary, LV_OPA_50); + + style_init_reset(&theme->styles.btn); + lv_style_set_text_font(&theme->styles.btn, theme->base.font_normal); + lv_style_set_radius(&theme->styles.btn, + LV_DPX_CALC(theme->disp_dpi, theme->disp_size == DISP_LARGE ? 16 : theme->disp_size == DISP_MEDIUM ? 12 : 10)); // Tasmota min 10 + lv_style_set_bg_opa(&theme->styles.btn, LV_OPA_COVER); + lv_style_set_bg_color(&theme->styles.btn, theme->color_grey); + lv_style_set_text_color(&theme->styles.btn, theme->color_text); + lv_style_set_pad_hor(&theme->styles.btn, PAD_DEF); + lv_style_set_pad_ver(&theme->styles.btn, PAD_SMALL); + lv_style_set_pad_column(&theme->styles.btn, LV_DPX_CALC(theme->disp_dpi, 5)); + lv_style_set_pad_row(&theme->styles.btn, LV_DPX_CALC(theme->disp_dpi, 5)); + + style_init_reset(&theme->styles.btn_border_color); + lv_style_set_border_color(&theme->styles.btn_border_color, lv_color_mix(theme->color_text, theme->color_grey, LV_OPA_80)); + + style_init_reset(&theme->styles.btn_border); + lv_style_set_border_width(&theme->styles.btn_border, BORDER_WIDTH); + lv_style_set_border_side(&theme->styles.btn_border, LV_BORDER_SIDE_FULL); + lv_style_set_border_opa(&theme->styles.btn_border, LV_OPA_COVER); + + lv_color_filter_dsc_init(&theme->dark_filter, dark_color_filter_cb); + lv_color_filter_dsc_init(&theme->grey_filter, grey_filter_cb); + + style_init_reset(&theme->styles.pressed); + lv_style_set_color_filter_dsc(&theme->styles.pressed, &theme->dark_filter); + lv_style_set_color_filter_opa(&theme->styles.pressed, LV_OPA_60); // Tasmota from 35 ot LV_OPA_60 (153) + + style_init_reset(&theme->styles.disabled); + lv_style_set_color_filter_dsc(&theme->styles.disabled, &theme->grey_filter); + lv_style_set_color_filter_opa(&theme->styles.disabled, LV_OPA_50); + + style_init_reset(&theme->styles.clip_corner); + lv_style_set_clip_corner(&theme->styles.clip_corner, true); + lv_style_set_border_post(&theme->styles.clip_corner, true); + + style_init_reset(&theme->styles.pad_normal); + lv_style_set_pad_all(&theme->styles.pad_normal, PAD_DEF); + lv_style_set_pad_row(&theme->styles.pad_normal, PAD_DEF); + lv_style_set_pad_column(&theme->styles.pad_normal, PAD_DEF); + + style_init_reset(&theme->styles.pad_small); + lv_style_set_pad_all(&theme->styles.pad_small, PAD_SMALL); + lv_style_set_pad_gap(&theme->styles.pad_small, PAD_SMALL); + + style_init_reset(&theme->styles.pad_gap); + lv_style_set_pad_row(&theme->styles.pad_gap, LV_DPX_CALC(theme->disp_dpi, 10)); + lv_style_set_pad_column(&theme->styles.pad_gap, LV_DPX_CALC(theme->disp_dpi, 10)); + + style_init_reset(&theme->styles.line_space_large); + lv_style_set_text_line_space(&theme->styles.line_space_large, LV_DPX_CALC(theme->disp_dpi, 20)); + + style_init_reset(&theme->styles.text_align_center); + lv_style_set_text_align(&theme->styles.text_align_center, LV_TEXT_ALIGN_CENTER); + + style_init_reset(&theme->styles.pad_zero); + lv_style_set_pad_all(&theme->styles.pad_zero, 0); + lv_style_set_pad_row(&theme->styles.pad_zero, 0); + lv_style_set_pad_column(&theme->styles.pad_zero, 0); + + style_init_reset(&theme->styles.pad_tiny); + lv_style_set_pad_all(&theme->styles.pad_tiny, PAD_TINY); + lv_style_set_pad_row(&theme->styles.pad_tiny, PAD_TINY); + lv_style_set_pad_column(&theme->styles.pad_tiny, PAD_TINY); + + style_init_reset(&theme->styles.bg_color_primary); + lv_style_set_bg_color(&theme->styles.bg_color_primary, theme->base.color_primary); + lv_style_set_text_color(&theme->styles.bg_color_primary, lv_color_white()); + lv_style_set_bg_opa(&theme->styles.bg_color_primary, LV_OPA_COVER); + + style_init_reset(&theme->styles.bg_color_primary_muted); + lv_style_set_bg_color(&theme->styles.bg_color_primary_muted, theme->base.color_primary); + lv_style_set_text_color(&theme->styles.bg_color_primary_muted, theme->base.color_primary); + lv_style_set_bg_opa(&theme->styles.bg_color_primary_muted, LV_OPA_20); + + style_init_reset(&theme->styles.bg_color_secondary); + lv_style_set_bg_color(&theme->styles.bg_color_secondary, theme->base.color_secondary); + lv_style_set_text_color(&theme->styles.bg_color_secondary, lv_color_white()); + lv_style_set_bg_opa(&theme->styles.bg_color_secondary, LV_OPA_COVER); + + style_init_reset(&theme->styles.bg_color_secondary_muted); + lv_style_set_bg_color(&theme->styles.bg_color_secondary_muted, theme->base.color_secondary); + lv_style_set_text_color(&theme->styles.bg_color_secondary_muted, theme->base.color_secondary); + lv_style_set_bg_opa(&theme->styles.bg_color_secondary_muted, LV_OPA_20); + + style_init_reset(&theme->styles.bg_color_grey); + lv_style_set_bg_color(&theme->styles.bg_color_grey, theme->color_grey); + lv_style_set_bg_opa(&theme->styles.bg_color_grey, LV_OPA_COVER); + lv_style_set_text_color(&theme->styles.bg_color_grey, theme->color_text); + + style_init_reset(&theme->styles.bg_color_white); + lv_style_set_bg_color(&theme->styles.bg_color_white, theme->color_card); + lv_style_set_bg_opa(&theme->styles.bg_color_white, LV_OPA_COVER); + lv_style_set_text_color(&theme->styles.bg_color_white, theme->color_text); + + style_init_reset(&theme->styles.circle); + lv_style_set_radius(&theme->styles.circle, LV_RADIUS_CIRCLE); + + style_init_reset(&theme->styles.no_radius); + lv_style_set_radius(&theme->styles.no_radius, 0); + + style_init_reset(&theme->styles.rotary_scroll); + lv_style_set_rotary_sensitivity(&theme->styles.rotary_scroll, theme->disp_dpi / 4 * 256); + +#if LV_THEME_DEFAULT_GROW + style_init_reset(&theme->styles.grow); + lv_style_set_transform_width(&theme->styles.grow, LV_DPX_CALC(theme->disp_dpi, 3)); + lv_style_set_transform_height(&theme->styles.grow, LV_DPX_CALC(theme->disp_dpi, 3)); +#endif + + style_init_reset(&theme->styles.knob); + lv_style_set_bg_color(&theme->styles.knob, theme->base.color_primary); + lv_style_set_bg_opa(&theme->styles.knob, LV_OPA_COVER); + lv_style_set_pad_all(&theme->styles.knob, LV_DPX_CALC(theme->disp_dpi, 6)); + lv_style_set_radius(&theme->styles.knob, LV_RADIUS_CIRCLE); + + style_init_reset(&theme->styles.anim); + lv_style_set_anim_duration(&theme->styles.anim, 200); + + style_init_reset(&theme->styles.anim_fast); + lv_style_set_anim_duration(&theme->styles.anim_fast, 120); #if LV_USE_ARC - style_init_reset(&styles->arc_indic); - lv_style_set_arc_color(&styles->arc_indic, color_grey); - lv_style_set_arc_width(&styles->arc_indic, lv_display_dpx(theme.disp, 18)); // OpenHASP - lv_style_set_arc_rounded(&styles->arc_indic, true); + style_init_reset(&theme->styles.arc_indic); + lv_style_set_arc_color(&theme->styles.arc_indic, theme->color_grey); + lv_style_set_arc_width(&theme->styles.arc_indic, LV_DPX_CALC(theme->disp_dpi, 15)); + lv_style_set_arc_rounded(&theme->styles.arc_indic, true); - style_init_reset(&styles->arc_indic_primary); - lv_style_set_arc_color(&styles->arc_indic_primary, theme.color_primary); - - // OpenHASP - style_init_reset(&styles->arc_knob); - lv_style_set_bg_color(&styles->arc_knob, theme.color_primary); - lv_style_set_bg_opa(&styles->arc_knob, LV_OPA_COVER); - lv_style_set_pad_all(&styles->arc_knob, lv_display_dpx(theme.disp, 4)); - lv_style_set_radius(&styles->arc_knob, LV_RADIUS_CIRCLE); + style_init_reset(&theme->styles.arc_indic_primary); + lv_style_set_arc_color(&theme->styles.arc_indic_primary, theme->base.color_primary); #endif #if LV_USE_DROPDOWN - style_init_reset(&styles->dropdown_list); - lv_style_set_max_height(&styles->dropdown_list, LV_DPI_DEF * 2); + style_init_reset(&theme->styles.dropdown_list); + lv_style_set_max_height(&theme->styles.dropdown_list, LV_DPI_DEF * 2); #endif -#if LV_USE_CHECKBOX - style_init_reset(&styles->cb_marker); - lv_style_set_pad_all(&styles->cb_marker, lv_display_dpx(theme.disp, 3)); - lv_style_set_border_width(&styles->cb_marker, BORDER_WIDTH); - lv_style_set_border_color(&styles->cb_marker, theme.color_primary); - lv_style_set_bg_color(&styles->cb_marker, color_card); - lv_style_set_bg_opa(&styles->cb_marker, LV_OPA_COVER); - lv_style_set_radius(&styles->cb_marker, RADIUS_DEFAULT / 2); - style_init_reset(&styles->cb_marker_checked); - lv_style_set_bg_image_src(&styles->cb_marker_checked, LV_SYMBOL_OK); - lv_style_set_text_color(&styles->cb_marker_checked, lv_color_white()); - lv_style_set_text_font(&styles->cb_marker_checked, theme.font_small); +#if LV_USE_CHECKBOX + style_init_reset(&theme->styles.cb_marker); + lv_style_set_pad_all(&theme->styles.cb_marker, LV_DPX_CALC(theme->disp_dpi, 3)); + lv_style_set_border_width(&theme->styles.cb_marker, BORDER_WIDTH); + lv_style_set_border_color(&theme->styles.cb_marker, theme->base.color_primary); + lv_style_set_bg_color(&theme->styles.cb_marker, theme->color_card); + lv_style_set_bg_opa(&theme->styles.cb_marker, LV_OPA_COVER); + lv_style_set_radius(&theme->styles.cb_marker, RADIUS_DEFAULT / 2); + lv_style_set_text_font(&theme->styles.cb_marker, theme->base.font_small); + lv_style_set_text_color(&theme->styles.cb_marker, lv_color_white()); + + style_init_reset(&theme->styles.cb_marker_checked); + lv_style_set_bg_image_src(&theme->styles.cb_marker_checked, LV_SYMBOL_OK); #endif #if LV_USE_SWITCH - style_init_reset(&styles->switch_knob); - lv_style_set_pad_all(&styles->switch_knob, - lv_display_dpx(theme.disp, 4)); - lv_style_set_bg_color(&styles->switch_knob, lv_color_white()); + style_init_reset(&theme->styles.switch_knob); + lv_style_set_pad_all(&theme->styles.switch_knob, - LV_DPX_CALC(theme->disp_dpi, 4)); + lv_style_set_bg_color(&theme->styles.switch_knob, lv_color_white()); #endif #if LV_USE_LINE - style_init_reset(&styles->line); - lv_style_set_line_width(&styles->line, 1); - lv_style_set_line_color(&styles->line, color_text); + style_init_reset(&theme->styles.line); + lv_style_set_line_width(&theme->styles.line, 1); + lv_style_set_line_color(&theme->styles.line, theme->color_text); #endif #if LV_USE_CHART - style_init_reset(&styles->chart_bg); - lv_style_set_border_post(&styles->chart_bg, false); - lv_style_set_pad_column(&styles->chart_bg, lv_display_dpx(theme.disp, 10)); - lv_style_set_line_color(&styles->chart_bg, color_grey); + style_init_reset(&theme->styles.chart_bg); + lv_style_set_border_post(&theme->styles.chart_bg, false); + lv_style_set_pad_column(&theme->styles.chart_bg, LV_DPX_CALC(theme->disp_dpi, 10)); + lv_style_set_line_color(&theme->styles.chart_bg, theme->color_grey); - style_init_reset(&styles->chart_series); - lv_style_set_line_width(&styles->chart_series, lv_display_dpx(theme.disp, 3)); - lv_style_set_radius(&styles->chart_series, lv_display_dpx(theme.disp, 3)); - lv_style_set_size(&styles->chart_series, lv_display_dpx(theme.disp, 8), lv_display_dpx(theme.disp, 8)); - lv_style_set_pad_column(&styles->chart_series, lv_display_dpx(theme.disp, 2)); + style_init_reset(&theme->styles.chart_series); + lv_style_set_line_width(&theme->styles.chart_series, LV_DPX_CALC(theme->disp_dpi, 3)); + lv_style_set_radius(&theme->styles.chart_series, LV_DPX_CALC(theme->disp_dpi, 3)); - style_init_reset(&styles->chart_indic); - lv_style_set_radius(&styles->chart_indic,LV_RADIUS_CIRCLE); - lv_style_set_size(&styles->chart_indic, lv_display_dpx(theme.disp, 8), lv_display_dpx(theme.disp, 8)); - lv_style_set_bg_color(&styles->chart_indic, theme.color_primary); - lv_style_set_bg_opa(&styles->chart_indic, LV_OPA_COVER); + int32_t chart_size = LV_DPX_CALC(theme->disp_dpi, 8); + lv_style_set_size(&theme->styles.chart_series, chart_size, chart_size); + lv_style_set_pad_column(&theme->styles.chart_series, LV_DPX_CALC(theme->disp_dpi, 2)); - style_init_reset(&styles->chart_ticks); - lv_style_set_line_width(&styles->chart_ticks, lv_display_dpx(theme.disp, 1)); - lv_style_set_line_color(&styles->chart_ticks, color_text); - lv_style_set_pad_all(&styles->chart_ticks, lv_display_dpx(theme.disp, 2)); - lv_style_set_text_color(&styles->chart_ticks, lv_palette_main(LV_PALETTE_GREY)); + style_init_reset(&theme->styles.chart_indic); + lv_style_set_radius(&theme->styles.chart_indic, LV_RADIUS_CIRCLE); + lv_style_set_size(&theme->styles.chart_indic, chart_size, chart_size); + lv_style_set_bg_color(&theme->styles.chart_indic, theme->base.color_primary); + lv_style_set_bg_opa(&theme->styles.chart_indic, LV_OPA_COVER); #endif -#if LV_USE_METER - style_init_reset(&styles->meter_marker); - lv_style_set_line_width(&styles->meter_marker, lv_display_dpx(theme.disp, 5)); - lv_style_set_line_color(&styles->meter_marker, color_text); - lv_style_set_size(&styles->meter_marker, lv_display_dpx(theme.disp, 20)); - lv_style_set_pad_left(&styles->meter_marker, lv_display_dpx(theme.disp, 15)); +#if LV_USE_MENU + style_init_reset(&theme->styles.menu_bg); + lv_style_set_pad_all(&theme->styles.menu_bg, 0); + lv_style_set_pad_gap(&theme->styles.menu_bg, 0); + lv_style_set_radius(&theme->styles.menu_bg, 0); + lv_style_set_clip_corner(&theme->styles.menu_bg, true); + lv_style_set_border_side(&theme->styles.menu_bg, LV_BORDER_SIDE_NONE); - style_init_reset(&styles->meter_indic); - lv_style_set_radius(&styles->meter_indic, LV_RADIUS_CIRCLE); - lv_style_set_bg_color(&styles->meter_indic, color_text); - lv_style_set_bg_opa(&styles->meter_indic, LV_OPA_COVER); - lv_style_set_size(&styles->meter_indic, lv_display_dpx(theme.disp, 15)); + style_init_reset(&theme->styles.menu_section); + lv_style_set_radius(&theme->styles.menu_section, RADIUS_DEFAULT); + lv_style_set_clip_corner(&theme->styles.menu_section, true); + lv_style_set_bg_opa(&theme->styles.menu_section, LV_OPA_COVER); + lv_style_set_bg_color(&theme->styles.menu_section, theme->color_card); + lv_style_set_text_color(&theme->styles.menu_section, theme->color_text); + + style_init_reset(&theme->styles.menu_cont); + lv_style_set_pad_hor(&theme->styles.menu_cont, PAD_SMALL); + lv_style_set_pad_ver(&theme->styles.menu_cont, PAD_SMALL); + lv_style_set_pad_gap(&theme->styles.menu_cont, PAD_SMALL); + lv_style_set_border_width(&theme->styles.menu_cont, LV_DPX_CALC(theme->disp_dpi, 1)); + lv_style_set_border_opa(&theme->styles.menu_cont, LV_OPA_10); + lv_style_set_border_color(&theme->styles.menu_cont, theme->color_text); + lv_style_set_border_side(&theme->styles.menu_cont, LV_BORDER_SIDE_NONE); + + style_init_reset(&theme->styles.menu_sidebar_cont); + lv_style_set_pad_all(&theme->styles.menu_sidebar_cont, 0); + lv_style_set_pad_gap(&theme->styles.menu_sidebar_cont, 0); + lv_style_set_border_width(&theme->styles.menu_sidebar_cont, LV_DPX_CALC(theme->disp_dpi, 1)); + lv_style_set_border_opa(&theme->styles.menu_sidebar_cont, LV_OPA_10); + lv_style_set_border_color(&theme->styles.menu_sidebar_cont, theme->color_text); + lv_style_set_border_side(&theme->styles.menu_sidebar_cont, LV_BORDER_SIDE_RIGHT); + + style_init_reset(&theme->styles.menu_main_cont); + lv_style_set_pad_all(&theme->styles.menu_main_cont, 0); + lv_style_set_pad_gap(&theme->styles.menu_main_cont, 0); + + style_init_reset(&theme->styles.menu_header_cont); + lv_style_set_pad_hor(&theme->styles.menu_header_cont, PAD_SMALL); + lv_style_set_pad_ver(&theme->styles.menu_header_cont, PAD_TINY); + lv_style_set_pad_gap(&theme->styles.menu_header_cont, PAD_SMALL); + + style_init_reset(&theme->styles.menu_header_btn); + lv_style_set_pad_hor(&theme->styles.menu_header_btn, PAD_TINY); + lv_style_set_pad_ver(&theme->styles.menu_header_btn, PAD_TINY); + lv_style_set_shadow_opa(&theme->styles.menu_header_btn, LV_OPA_TRANSP); + lv_style_set_bg_opa(&theme->styles.menu_header_btn, LV_OPA_TRANSP); + lv_style_set_text_color(&theme->styles.menu_header_btn, theme->color_text); + + style_init_reset(&theme->styles.menu_page); + lv_style_set_pad_hor(&theme->styles.menu_page, 0); + lv_style_set_pad_gap(&theme->styles.menu_page, 0); + + style_init_reset(&theme->styles.menu_pressed); + lv_style_set_bg_opa(&theme->styles.menu_pressed, LV_OPA_20); + lv_style_set_bg_color(&theme->styles.menu_pressed, lv_palette_main(LV_PALETTE_GREY)); + + style_init_reset(&theme->styles.menu_separator); + lv_style_set_bg_opa(&theme->styles.menu_separator, LV_OPA_TRANSP); + lv_style_set_pad_ver(&theme->styles.menu_separator, PAD_TINY); #endif #if LV_USE_TABLE - style_init_reset(&styles->table_cell); - lv_style_set_border_width(&styles->table_cell, lv_display_dpx(theme.disp, 1)); - lv_style_set_border_color(&styles->table_cell, color_grey); - lv_style_set_border_side(&styles->table_cell, LV_BORDER_SIDE_TOP | LV_BORDER_SIDE_BOTTOM ); + style_init_reset(&theme->styles.table_cell); + lv_style_set_border_width(&theme->styles.table_cell, LV_DPX_CALC(theme->disp_dpi, 1)); + lv_style_set_border_color(&theme->styles.table_cell, theme->color_grey); + lv_style_set_border_side(&theme->styles.table_cell, LV_BORDER_SIDE_TOP | LV_BORDER_SIDE_BOTTOM); #endif #if LV_USE_TEXTAREA - style_init_reset(&styles->ta_cursor); - lv_style_set_border_color(&styles->ta_cursor, color_text); - lv_style_set_border_width(&styles->ta_cursor, lv_display_dpx(theme.disp, 2)); - lv_style_set_pad_left(&styles->ta_cursor, lv_display_dpx(theme.disp, 1)); - lv_style_set_border_side(&styles->ta_cursor, LV_BORDER_SIDE_LEFT); - lv_style_set_anim_time(&styles->ta_cursor, 400); + style_init_reset(&theme->styles.ta_cursor); + lv_style_set_border_color(&theme->styles.ta_cursor, theme->color_text); + lv_style_set_border_width(&theme->styles.ta_cursor, LV_DPX_CALC(theme->disp_dpi, 2)); + lv_style_set_pad_left(&theme->styles.ta_cursor, - LV_DPX_CALC(theme->disp_dpi, 1)); + lv_style_set_border_side(&theme->styles.ta_cursor, LV_BORDER_SIDE_LEFT); + lv_style_set_anim_duration(&theme->styles.ta_cursor, 400); - style_init_reset(&styles->ta_placeholder); - lv_style_set_text_color(&styles->ta_placeholder, (theme.flags & MODE_DARK) ? lv_palette_darken(LV_PALETTE_GREY, 2) : lv_palette_lighten(LV_PALETTE_GREY, 1)); + style_init_reset(&theme->styles.ta_placeholder); + lv_style_set_text_color(&theme->styles.ta_placeholder, + (theme->base.flags & MODE_DARK) ? lv_palette_darken(LV_PALETTE_GREY, + 2) : lv_palette_lighten(LV_PALETTE_GREY, 1)); #endif #if LV_USE_CALENDAR - style_init_reset(&styles->calendar_bg); - lv_style_set_pad_all(&styles->calendar_bg, PAD_SMALL); - lv_style_set_pad_gap(&styles->calendar_bg, PAD_SMALL / 2); - lv_style_set_radius(&styles->calendar_bg, 0); + style_init_reset(&theme->styles.calendar_btnm_bg); + lv_style_set_pad_all(&theme->styles.calendar_btnm_bg, PAD_SMALL); + lv_style_set_pad_gap(&theme->styles.calendar_btnm_bg, PAD_SMALL / 2); - style_init_reset(&styles->calendar_day); - lv_style_set_border_width(&styles->calendar_day, lv_display_dpx(theme.disp, 1)); - lv_style_set_border_color(&styles->calendar_day, color_grey); - lv_style_set_bg_color(&styles->calendar_day, color_card); - lv_style_set_bg_opa(&styles->calendar_day, LV_OPA_20); -#endif + style_init_reset(&theme->styles.calendar_btnm_day); + lv_style_set_border_width(&theme->styles.calendar_btnm_day, LV_DPX_CALC(theme->disp_dpi, 1)); + lv_style_set_border_color(&theme->styles.calendar_btnm_day, theme->color_grey); + lv_style_set_bg_color(&theme->styles.calendar_btnm_day, theme->color_card); + lv_style_set_bg_opa(&theme->styles.calendar_btnm_day, LV_OPA_20); -#if LV_USE_COLORWHEEL - style_init_reset(&styles->colorwheel_main); - lv_style_set_arc_width(&styles->colorwheel_main, lv_display_dpx(theme.disp, 10)); + style_init_reset(&theme->styles.calendar_header); + lv_style_set_pad_hor(&theme->styles.calendar_header, PAD_SMALL); + lv_style_set_pad_top(&theme->styles.calendar_header, PAD_SMALL); + lv_style_set_pad_bottom(&theme->styles.calendar_header, PAD_TINY); + lv_style_set_pad_gap(&theme->styles.calendar_header, PAD_SMALL); #endif #if LV_USE_MSGBOX - /*To add space for for the button shadow*/ - style_init_reset(&styles->msgbox_btn_bg); - lv_style_set_pad_all(&styles->msgbox_btn_bg, lv_display_dpx(theme.disp, 4)); - - style_init_reset(&styles->msgbox_bg); - lv_style_set_max_width(&styles->msgbox_bg, lv_pct(100)); - - style_init_reset(&styles->msgbox_backdrop_bg); - lv_style_set_bg_color(&styles->msgbox_backdrop_bg, lv_palette_main(LV_PALETTE_GREY)); - lv_style_set_bg_opa(&styles->msgbox_backdrop_bg, LV_OPA_50); + style_init_reset(&theme->styles.msgbox_backdrop_bg); + lv_style_set_bg_color(&theme->styles.msgbox_backdrop_bg, lv_palette_main(LV_PALETTE_GREY)); + lv_style_set_bg_opa(&theme->styles.msgbox_backdrop_bg, LV_OPA_50); #endif #if LV_USE_KEYBOARD - style_init_reset(&styles->keyboard_btn_bg); - lv_style_set_shadow_width(&styles->keyboard_btn_bg, 0); - lv_style_set_radius(&styles->keyboard_btn_bg, disp_size == DISP_SMALL ? RADIUS_DEFAULT / 2 : RADIUS_DEFAULT); + style_init_reset(&theme->styles.keyboard_button_bg); + lv_style_set_shadow_width(&theme->styles.keyboard_button_bg, 0); + lv_style_set_radius(&theme->styles.keyboard_button_bg, + theme->disp_size == DISP_SMALL ? RADIUS_DEFAULT / 2 : RADIUS_DEFAULT); #endif #if LV_USE_TABVIEW - style_init_reset(&styles->tab_btn); - lv_style_set_border_color(&styles->tab_btn, theme.color_primary); - lv_style_set_border_width(&styles->tab_btn, BORDER_WIDTH * 2); - lv_style_set_border_side(&styles->tab_btn, LV_BORDER_SIDE_BOTTOM); + style_init_reset(&theme->styles.tab_btn); + lv_style_set_border_color(&theme->styles.tab_btn, theme->base.color_primary); + lv_style_set_border_width(&theme->styles.tab_btn, BORDER_WIDTH * 2); + lv_style_set_border_side(&theme->styles.tab_btn, LV_BORDER_SIDE_BOTTOM); + lv_style_set_pad_top(&theme->styles.tab_btn, BORDER_WIDTH * 2); - style_init_reset(&styles->tab_bg_focus); - lv_style_set_outline_pad(&styles->tab_bg_focus, -BORDER_WIDTH); + style_init_reset(&theme->styles.tab_bg_focus); + lv_style_set_outline_pad(&theme->styles.tab_bg_focus, -BORDER_WIDTH); #endif #if LV_USE_LIST - style_init_reset(&styles->list_bg); - lv_style_set_pad_hor(&styles->list_bg, PAD_DEF); - lv_style_set_pad_ver(&styles->list_bg, 0); - lv_style_set_pad_gap(&styles->list_bg, 0); - lv_style_set_clip_corner(&styles->list_bg, true); + style_init_reset(&theme->styles.list_bg); + lv_style_set_pad_hor(&theme->styles.list_bg, PAD_DEF); + lv_style_set_pad_ver(&theme->styles.list_bg, 0); + lv_style_set_pad_gap(&theme->styles.list_bg, 0); + lv_style_set_clip_corner(&theme->styles.list_bg, true); - style_init_reset(&styles->list_btn); - lv_style_set_border_width(&styles->list_btn, lv_display_dpx(theme.disp, 1)); - lv_style_set_border_color(&styles->list_btn, color_grey); - lv_style_set_border_side(&styles->list_btn, LV_BORDER_SIDE_BOTTOM); - lv_style_set_pad_all(&styles->list_btn, PAD_SMALL); - lv_style_set_pad_column(&styles->list_btn, PAD_SMALL); + style_init_reset(&theme->styles.list_btn); + lv_style_set_border_width(&theme->styles.list_btn, LV_DPX_CALC(theme->disp_dpi, 1)); + lv_style_set_border_color(&theme->styles.list_btn, theme->color_grey); + lv_style_set_border_side(&theme->styles.list_btn, LV_BORDER_SIDE_BOTTOM); + lv_style_set_pad_all(&theme->styles.list_btn, PAD_SMALL); + lv_style_set_pad_column(&theme->styles.list_btn, PAD_SMALL); - style_init_reset(&styles->list_item_grow); - lv_style_set_transform_width(&styles->list_item_grow, PAD_DEF); + style_init_reset(&theme->styles.list_item_grow); + lv_style_set_transform_width(&theme->styles.list_item_grow, PAD_DEF); #endif - #if LV_USE_LED - style_init_reset(&styles->led); - lv_style_set_bg_opa(&styles->led, LV_OPA_COVER); - lv_style_set_bg_color(&styles->led, lv_color_white()); - lv_style_set_bg_grad_color(&styles->led, lv_palette_main(LV_PALETTE_GREY)); - lv_style_set_radius(&styles->led, LV_RADIUS_CIRCLE); - lv_style_set_shadow_width(&styles->led, lv_display_dpx(theme.disp, 15)); - lv_style_set_shadow_color(&styles->led, lv_color_white()); - lv_style_set_shadow_spread(&styles->led, lv_display_dpx(theme.disp, 5)); + style_init_reset(&theme->styles.led); + lv_style_set_bg_opa(&theme->styles.led, LV_OPA_COVER); + lv_style_set_bg_color(&theme->styles.led, lv_color_white()); + lv_style_set_bg_grad_color(&theme->styles.led, lv_palette_main(LV_PALETTE_GREY)); + lv_style_set_radius(&theme->styles.led, LV_RADIUS_CIRCLE); + lv_style_set_shadow_width(&theme->styles.led, LV_DPX_CALC(theme->disp_dpi, 15)); + lv_style_set_shadow_color(&theme->styles.led, lv_color_white()); + lv_style_set_shadow_spread(&theme->styles.led, LV_DPX_CALC(theme->disp_dpi, 5)); +#endif + +#if LV_USE_SCALE + style_init_reset(&theme->styles.scale); + lv_style_set_line_color(&theme->styles.scale, theme->color_text); + lv_style_set_line_width(&theme->styles.scale, LV_DPX(2)); + lv_style_set_arc_color(&theme->styles.scale, theme->color_text); + lv_style_set_arc_width(&theme->styles.scale, LV_DPX(2)); + lv_style_set_length(&theme->styles.scale, LV_DPX(6)); + lv_style_set_bg_color(&theme->styles.scale, theme->color_card); // put a default grey background #endif } @@ -632,455 +646,595 @@ static void style_init(void) * GLOBAL FUNCTIONS **********************/ -lv_theme_t * lv_theme_haspmota_init(lv_display_t * disp, lv_color_t color_primary, lv_color_t color_secondary, bool dark, const lv_font_t * font) +lv_theme_t * lv_theme_haspmota_init(lv_display_t * disp, lv_color_t * colors, + const lv_font_t * font_small, const lv_font_t * font_normal, const lv_font_t * font_large) { - + // berry_log_C("HSP> called lv_theme_haspmota_init primary #%06X secondary #%06X scr #%06X text #%06X card #%06X grey #%06X", + // colors[0], colors[1], colors[2], colors[3], colors[4], colors[5]); /*This trick is required only to avoid the garbage collection of - *styles' data if LVGL is used in a binding (e.g. Micropython) - *In a general case styles could be in simple `static lv_style_t my_style...` variables*/ - if(!inited) { - // LV_GC_ROOT(_lv_theme_default_styles) = lv_mem_alloc(sizeof(my_theme_styles_t)); - styles = (my_theme_styles_t *) malloc(sizeof(my_theme_styles_t)); // TODO LVGL + *styles' data if LVGL is used in a binding (e.g. MicroPython) + *In a general case styles could be in a simple `static lv_style_t my_style...` variables*/ + + if(!haspmota_theme) { + haspmota_theme = lv_malloc_zeroed(sizeof(haspmota_theme_t)); } - if(LV_HOR_RES <= 320) disp_size = DISP_SMALL; - else if(LV_HOR_RES < 720) disp_size = DISP_MEDIUM; - else disp_size = DISP_LARGE; + haspmota_theme_t * theme = haspmota_theme; - theme.disp = disp; - theme.color_primary = color_primary; - theme.color_secondary = color_secondary; - theme.font_small = font; - theme.font_normal = font; - theme.font_large = font; - theme.apply_cb = theme_apply; - theme.flags = dark ? MODE_DARK : 0; + lv_display_t * new_disp = disp == NULL ? lv_display_get_default() : disp; + int32_t new_dpi = lv_display_get_dpi(new_disp); + int32_t hor_res = lv_display_get_horizontal_resolution(new_disp); + disp_size_t new_size; - style_init(); + if(hor_res <= 320) new_size = DISP_SMALL; + else if(hor_res < 720) new_size = DISP_MEDIUM; + else new_size = DISP_LARGE; - inited = true; + /* check theme information whether will change or not*/ + if(theme->inited && theme->disp_dpi == new_dpi && + theme->disp_size == new_size && + lv_color_eq(theme->base.color_primary, colors[0]) && + lv_color_eq(theme->base.color_secondary, colors[1]) && + theme->base.font_small == font_small && + theme->base.font_normal == font_normal && + theme->base.font_large == font_large) { + return (lv_theme_t *) theme; - if(disp == NULL || lv_disp_get_theme(disp) == &theme) lv_obj_report_style_change(NULL); + } - return (lv_theme_t *)&theme; + theme->disp_size = new_size; + theme->disp_dpi = new_dpi; + theme->base.disp = new_disp; + theme->base.color_primary = colors[0]; + theme->base.color_secondary = colors[1]; + theme->base.font_small = font_small; + theme->base.font_normal = font_normal; + theme->base.font_large = font_large; + theme->base.apply_cb = theme_apply; + + theme->color_scr = colors[2]; + theme->color_text = colors[3]; + theme->color_card = colors[4]; + theme->color_grey = colors[5]; + + // berry_log_C("HSP> called lv_theme_haspmota_init primary #%06X secondary #%06X scr #%06X text #%06X card #%06X grey #%06X", + // lv_color_to_int(theme->base.color_primary), lv_color_to_int(theme->base.color_secondary), lv_color_to_int(theme->color_scr), lv_color_to_int(theme->color_text), lv_color_to_int(theme->color_card), lv_color_to_int(theme->color_grey)); + + style_init(theme); + + if(disp == NULL || lv_display_get_theme(disp) == (lv_theme_t *)theme) lv_obj_report_style_change(NULL); + + theme->inited = true; + + return (lv_theme_t *) theme; } +void lv_theme_haspmota_deinit(void) +{ + haspmota_theme_t * theme = haspmota_theme; + if(theme) { + if(theme->inited) { + lv_style_t * theme_styles = (lv_style_t *)(&(theme->styles)); + uint32_t i; + for(i = 0; i < sizeof(haspmota_theme_styles_t) / sizeof(lv_style_t); i++) { + lv_style_reset(theme_styles + i); + } + + } + lv_free(haspmota_theme); + haspmota_theme = NULL; + } +} + +lv_theme_t * lv_theme_haspmota_get(void) +{ + return (lv_theme_t *)haspmota_theme; +} bool lv_theme_haspmota_is_inited(void) { - return inited; + return (haspmota_theme != NULL && haspmota_theme->inited); } - - static void theme_apply(lv_theme_t * th, lv_obj_t * obj) { LV_UNUSED(th); - if(lv_obj_get_parent(obj) == NULL) { - lv_obj_add_style(obj, &styles->scr, 0); - lv_obj_add_style(obj, &styles->scrollbar, LV_PART_SCROLLBAR); - lv_obj_add_style(obj, &styles->scrollbar_scrolled, LV_PART_SCROLLBAR | LV_STATE_SCROLLED); + haspmota_theme_t * theme = haspmota_theme; + lv_obj_t * parent = lv_obj_get_parent(obj); + + if(parent == NULL) { + lv_obj_add_style(obj, &theme->styles.scr, 0); + lv_obj_add_style(obj, &theme->styles.scrollbar, LV_PART_SCROLLBAR); + lv_obj_add_style(obj, &theme->styles.scrollbar_scrolled, LV_PART_SCROLLBAR | LV_STATE_SCROLLED); return; } if(lv_obj_check_type(obj, &lv_obj_class)) { #if LV_USE_TABVIEW - lv_obj_t * parent = lv_obj_get_parent(obj); /*Tabview content area*/ - if(lv_obj_check_type(parent, &lv_tabview_class)) { + if(lv_obj_check_type(parent, &lv_tabview_class) && lv_obj_get_child(parent, 1) == obj) { + return; + } + /*Tabview button container*/ + else if(lv_obj_check_type(parent, &lv_tabview_class) && lv_obj_get_child(parent, 0) == obj) { + lv_obj_add_style(obj, &theme->styles.bg_color_white, 0); + lv_obj_add_style(obj, &theme->styles.outline_primary, LV_STATE_FOCUS_KEY); + lv_obj_add_style(obj, &theme->styles.tab_bg_focus, LV_STATE_FOCUS_KEY); return; } /*Tabview pages*/ else if(lv_obj_check_type(lv_obj_get_parent(parent), &lv_tabview_class)) { - lv_obj_add_style(obj, &styles->pad_normal, 0); - lv_obj_add_style(obj, &styles->scrollbar, LV_PART_SCROLLBAR); - lv_obj_add_style(obj, &styles->scrollbar_scrolled, LV_PART_SCROLLBAR | LV_STATE_SCROLLED); + lv_obj_add_style(obj, &theme->styles.pad_normal, 0); + lv_obj_add_style(obj, &theme->styles.rotary_scroll, 0); + lv_obj_add_style(obj, &theme->styles.scrollbar, LV_PART_SCROLLBAR); + lv_obj_add_style(obj, &theme->styles.scrollbar_scrolled, LV_PART_SCROLLBAR | LV_STATE_SCROLLED); return; } #endif #if LV_USE_WIN /*Header*/ - if(lv_obj_get_index(obj) == 0 && lv_obj_check_type(lv_obj_get_parent(obj), &lv_win_class)) { - lv_obj_add_style(obj, &styles->bg_color_grey, 0); - lv_obj_add_style(obj, &styles->pad_tiny, 0); + if(lv_obj_check_type(parent, &lv_win_class) && lv_obj_get_child(parent, 0) == obj) { + lv_obj_add_style(obj, &theme->styles.bg_color_grey, 0); + lv_obj_add_style(obj, &theme->styles.pad_tiny, 0); return; } /*Content*/ - else if(lv_obj_get_index(obj) == 1 && lv_obj_check_type(lv_obj_get_parent(obj), &lv_win_class)) { - lv_obj_add_style(obj, &styles->scr, 0); - lv_obj_add_style(obj, &styles->pad_normal, 0); - lv_obj_add_style(obj, &styles->scrollbar, LV_PART_SCROLLBAR); - lv_obj_add_style(obj, &styles->scrollbar_scrolled, LV_PART_SCROLLBAR | LV_STATE_SCROLLED); + else if(lv_obj_check_type(parent, &lv_win_class) && lv_obj_get_child(parent, 1) == obj) { + lv_obj_add_style(obj, &theme->styles.scr, 0); + lv_obj_add_style(obj, &theme->styles.pad_normal, 0); + lv_obj_add_style(obj, &theme->styles.scrollbar, LV_PART_SCROLLBAR); + lv_obj_add_style(obj, &theme->styles.scrollbar_scrolled, LV_PART_SCROLLBAR | LV_STATE_SCROLLED); return; } #endif - lv_obj_add_style(obj, &styles->card, 0); - lv_obj_add_style(obj, &styles->scrollbar, LV_PART_SCROLLBAR); - lv_obj_add_style(obj, &styles->scrollbar_scrolled, LV_PART_SCROLLBAR | LV_STATE_SCROLLED); + +#if LV_USE_CALENDAR + if(lv_obj_check_type(parent, &lv_calendar_class)) { + /*No style*/ + return; + } +#endif + + lv_obj_add_style(obj, &theme->styles.card, 0); + lv_obj_add_style(obj, &theme->styles.scrollbar, LV_PART_SCROLLBAR); + lv_obj_add_style(obj, &theme->styles.scrollbar_scrolled, LV_PART_SCROLLBAR | LV_STATE_SCROLLED); } #if LV_USE_BUTTON else if(lv_obj_check_type(obj, &lv_button_class)) { - lv_obj_add_style(obj, &styles->btn, 0); - lv_obj_add_style(obj, &styles->bg_color_primary, 0); - lv_obj_add_style(obj, &styles->transition_delayed, 0); - lv_obj_add_style(obj, &styles->pressed, LV_STATE_PRESSED); - lv_obj_add_style(obj, &styles->transition_normal, LV_STATE_PRESSED); - lv_obj_add_style(obj, &styles->outline_primary, LV_STATE_FOCUS_KEY); -#if LV_THEME_DEFAULT_GROW - lv_obj_add_style(obj, &styles->grow, LV_STATE_PRESSED); + +#if LV_USE_TABVIEW + lv_obj_t * tv = lv_obj_get_parent(parent); /*parent is the tabview header*/ + if(tv && lv_obj_get_child(tv, 0) == parent) { /*The button is on the tab view header*/ + if(lv_obj_check_type(tv, &lv_tabview_class)) { + lv_obj_add_style(obj, &theme->styles.pressed, LV_STATE_PRESSED); + lv_obj_add_style(obj, &theme->styles.bg_color_primary_muted, LV_STATE_CHECKED); + lv_obj_add_style(obj, &theme->styles.tab_btn, LV_STATE_CHECKED); + lv_obj_add_style(obj, &theme->styles.outline_primary, LV_STATE_FOCUS_KEY); + lv_obj_add_style(obj, &theme->styles.outline_secondary, LV_STATE_EDITED); + lv_obj_add_style(obj, &theme->styles.tab_bg_focus, LV_STATE_FOCUS_KEY); + return; + } + } + +#endif + lv_obj_add_style(obj, &theme->styles.btn, 0); + lv_obj_add_style(obj, &theme->styles.btn_border, 0); + lv_obj_add_style(obj, &theme->styles.btn_border_color, 0); + lv_obj_add_style(obj, &theme->styles.bg_color_primary, 0); + lv_obj_add_style(obj, &theme->styles.transition_delayed, 0); + lv_obj_add_style(obj, &theme->styles.pressed, LV_STATE_PRESSED); + lv_obj_add_style(obj, &theme->styles.transition_normal, LV_STATE_PRESSED); + lv_obj_add_style(obj, &theme->styles.outline_primary, LV_STATE_FOCUS_KEY); +#if LV_THEME_DEFAULT_GROW + lv_obj_add_style(obj, &theme->styles.grow, LV_STATE_PRESSED); +#endif + lv_obj_add_style(obj, &theme->styles.bg_color_secondary, LV_STATE_CHECKED); + lv_obj_add_style(obj, &theme->styles.disabled, LV_STATE_DISABLED); + +#if LV_USE_MENU + if(lv_obj_check_type(parent, &lv_menu_sidebar_header_cont_class) || + lv_obj_check_type(parent, &lv_menu_main_header_cont_class)) { + lv_obj_add_style(obj, &theme->styles.menu_header_btn, 0); + lv_obj_add_style(obj, &theme->styles.menu_pressed, LV_STATE_PRESSED); + } #endif - lv_obj_add_style(obj, &styles->bg_color_secondary, LV_STATE_CHECKED); - lv_obj_add_style(obj, &styles->disabled, LV_STATE_DISABLED); } #endif #if LV_USE_LINE else if(lv_obj_check_type(obj, &lv_line_class)) { - lv_obj_add_style(obj, &styles->line, 0); + lv_obj_add_style(obj, &theme->styles.line, 0); } #endif #if LV_USE_BUTTONMATRIX else if(lv_obj_check_type(obj, &lv_buttonmatrix_class)) { -#if LV_USE_TABVIEW - if(lv_obj_check_type(lv_obj_get_parent(obj), &lv_tabview_class)) { - lv_obj_add_style(obj, &styles->bg_color_white, 0); - lv_obj_add_style(obj, &styles->outline_primary, LV_STATE_FOCUS_KEY); - lv_obj_add_style(obj, &styles->tab_bg_focus, LV_STATE_FOCUS_KEY); - lv_obj_add_style(obj, &styles->pressed, LV_PART_ITEMS | LV_STATE_PRESSED); - lv_obj_add_style(obj, &styles->bg_color_primary_muted, LV_PART_ITEMS | LV_STATE_CHECKED); - lv_obj_add_style(obj, &styles->tab_btn, LV_PART_ITEMS | LV_STATE_CHECKED); - lv_obj_add_style(obj, &styles->outline_primary, LV_PART_ITEMS | LV_STATE_FOCUS_KEY); - lv_obj_add_style(obj, &styles->outline_secondary, LV_PART_ITEMS | LV_STATE_EDITED); - lv_obj_add_style(obj, &styles->tab_bg_focus, LV_PART_ITEMS | LV_STATE_FOCUS_KEY); + +#if LV_USE_CALENDAR + if(lv_obj_check_type(parent, &lv_calendar_class)) { + lv_obj_add_style(obj, &theme->styles.calendar_btnm_bg, 0); + lv_obj_add_style(obj, &theme->styles.outline_primary, LV_STATE_FOCUS_KEY); + lv_obj_add_style(obj, &theme->styles.outline_secondary, LV_STATE_EDITED); + lv_obj_add_style(obj, &theme->styles.calendar_btnm_day, LV_PART_ITEMS); + lv_obj_add_style(obj, &theme->styles.pressed, LV_PART_ITEMS | LV_STATE_PRESSED); + lv_obj_add_style(obj, &theme->styles.disabled, LV_PART_ITEMS | LV_STATE_DISABLED); + lv_obj_add_style(obj, &theme->styles.outline_primary, LV_PART_ITEMS | LV_STATE_FOCUS_KEY); + lv_obj_add_style(obj, &theme->styles.outline_secondary, LV_PART_ITEMS | LV_STATE_EDITED); return; } #endif - lv_obj_add_style(obj, &styles->card, 0); - lv_obj_add_style(obj, &styles->outline_primary, LV_STATE_FOCUS_KEY); - lv_obj_add_style(obj, &styles->outline_secondary, LV_STATE_EDITED); - lv_obj_add_style(obj, &styles->btn, LV_PART_ITEMS); - lv_obj_add_style(obj, &styles->disabled, LV_PART_ITEMS | LV_STATE_DISABLED); - lv_obj_add_style(obj, &styles->pressed, LV_PART_ITEMS | LV_STATE_PRESSED); - lv_obj_add_style(obj, &styles->bg_color_primary, LV_PART_ITEMS | LV_STATE_CHECKED); - lv_obj_add_style(obj, &styles->outline_primary, LV_PART_ITEMS | LV_STATE_FOCUS_KEY); - lv_obj_add_style(obj, &styles->outline_secondary, LV_PART_ITEMS | LV_STATE_EDITED); + lv_obj_add_style(obj, &theme->styles.card, 0); + lv_obj_add_style(obj, &theme->styles.outline_primary, LV_STATE_FOCUS_KEY); + lv_obj_add_style(obj, &theme->styles.outline_secondary, LV_STATE_EDITED); + lv_obj_add_style(obj, &theme->styles.btn, LV_PART_ITEMS); + lv_obj_add_style(obj, &theme->styles.btn_border, LV_PART_ITEMS); + lv_obj_add_style(obj, &theme->styles.disabled, LV_PART_ITEMS | LV_STATE_DISABLED); + lv_obj_add_style(obj, &theme->styles.pressed, LV_PART_ITEMS | LV_STATE_PRESSED); + lv_obj_add_style(obj, &theme->styles.bg_color_primary, LV_PART_ITEMS | LV_STATE_CHECKED); + lv_obj_add_style(obj, &theme->styles.outline_primary, LV_PART_ITEMS | LV_STATE_FOCUS_KEY); + lv_obj_add_style(obj, &theme->styles.outline_secondary, LV_PART_ITEMS | LV_STATE_EDITED); } #endif #if LV_USE_BAR else if(lv_obj_check_type(obj, &lv_bar_class)) { - lv_obj_add_style(obj, &styles->bg_color_primary_muted, 0); - lv_obj_add_style(obj, &styles->circle, 0); - lv_obj_add_style(obj, &styles->outline_primary, LV_STATE_FOCUS_KEY); - lv_obj_add_style(obj, &styles->outline_secondary, LV_STATE_EDITED); - lv_obj_add_style(obj, &styles->bg_color_primary, LV_PART_INDICATOR); - lv_obj_add_style(obj, &styles->circle, LV_PART_INDICATOR); + lv_obj_add_style(obj, &theme->styles.btn_border_color, 0); + lv_obj_add_style(obj, &theme->styles.bg_color_primary_muted, 0); + lv_obj_add_style(obj, &theme->styles.circle, 0); + lv_obj_add_style(obj, &theme->styles.outline_primary, LV_STATE_FOCUS_KEY); + lv_obj_add_style(obj, &theme->styles.outline_secondary, LV_STATE_EDITED); + lv_obj_add_style(obj, &theme->styles.bg_color_primary, LV_PART_INDICATOR); + lv_obj_add_style(obj, &theme->styles.circle, LV_PART_INDICATOR); + lv_obj_add_style(obj, &theme->styles.btn_border_color, LV_PART_INDICATOR); } #endif #if LV_USE_SLIDER else if(lv_obj_check_type(obj, &lv_slider_class)) { - lv_obj_add_style(obj, &styles->bg_color_primary_muted, 0); - lv_obj_add_style(obj, &styles->circle, 0); - lv_obj_add_style(obj, &styles->outline_primary, LV_STATE_FOCUS_KEY); - lv_obj_add_style(obj, &styles->outline_secondary, LV_STATE_EDITED); - lv_obj_add_style(obj, &styles->bg_color_primary, LV_PART_INDICATOR); - lv_obj_add_style(obj, &styles->circle, LV_PART_INDICATOR); - lv_obj_add_style(obj, &styles->knob, LV_PART_KNOB); + lv_obj_add_style(obj, &theme->styles.btn_border_color, 0); + lv_obj_add_style(obj, &theme->styles.bg_color_primary_muted, 0); + lv_obj_add_style(obj, &theme->styles.circle, 0); + lv_obj_add_style(obj, &theme->styles.outline_primary, LV_STATE_FOCUS_KEY); + lv_obj_add_style(obj, &theme->styles.outline_secondary, LV_STATE_EDITED); + lv_obj_add_style(obj, &theme->styles.bg_color_primary, LV_PART_INDICATOR); + lv_obj_add_style(obj, &theme->styles.circle, LV_PART_INDICATOR); + lv_obj_add_style(obj, &theme->styles.btn_border_color, LV_PART_INDICATOR); + lv_obj_add_style(obj, &theme->styles.knob, LV_PART_KNOB); #if LV_THEME_DEFAULT_GROW - lv_obj_add_style(obj, &styles->grow, LV_PART_KNOB | LV_STATE_PRESSED); + lv_obj_add_style(obj, &theme->styles.grow, LV_PART_KNOB | LV_STATE_PRESSED); #endif - lv_obj_add_style(obj, &styles->transition_delayed, LV_PART_KNOB); - lv_obj_add_style(obj, &styles->transition_normal, LV_PART_KNOB | LV_STATE_PRESSED); + lv_obj_add_style(obj, &theme->styles.transition_delayed, LV_PART_KNOB); + lv_obj_add_style(obj, &theme->styles.transition_normal, LV_PART_KNOB | LV_STATE_PRESSED); } #endif #if LV_USE_TABLE else if(lv_obj_check_type(obj, &lv_table_class)) { - lv_obj_add_style(obj, &styles->card, 0); - lv_obj_add_style(obj, &styles->pad_zero, 0); - lv_obj_add_style(obj, &styles->no_radius, 0); - lv_obj_add_style(obj, &styles->outline_primary, LV_STATE_FOCUS_KEY); - lv_obj_add_style(obj, &styles->outline_secondary, LV_STATE_EDITED); - lv_obj_add_style(obj, &styles->scrollbar, LV_PART_SCROLLBAR); - lv_obj_add_style(obj, &styles->scrollbar_scrolled, LV_PART_SCROLLBAR | LV_STATE_SCROLLED); - lv_obj_add_style(obj, &styles->bg_color_white, LV_PART_ITEMS); - lv_obj_add_style(obj, &styles->table_cell, LV_PART_ITEMS); - lv_obj_add_style(obj, &styles->pad_normal, LV_PART_ITEMS); - lv_obj_add_style(obj, &styles->pressed, LV_PART_ITEMS | LV_STATE_PRESSED); - lv_obj_add_style(obj, &styles->bg_color_primary, LV_PART_ITEMS | LV_STATE_FOCUS_KEY); - lv_obj_add_style(obj, &styles->bg_color_secondary, LV_PART_ITEMS | LV_STATE_EDITED); + lv_obj_add_style(obj, &theme->styles.card, 0); + lv_obj_add_style(obj, &theme->styles.pad_zero, 0); + lv_obj_add_style(obj, &theme->styles.no_radius, 0); + lv_obj_add_style(obj, &theme->styles.outline_primary, LV_STATE_FOCUS_KEY); + lv_obj_add_style(obj, &theme->styles.outline_secondary, LV_STATE_EDITED); + lv_obj_add_style(obj, &theme->styles.scrollbar, LV_PART_SCROLLBAR); + lv_obj_add_style(obj, &theme->styles.scrollbar_scrolled, LV_PART_SCROLLBAR | LV_STATE_SCROLLED); + lv_obj_add_style(obj, &theme->styles.bg_color_white, LV_PART_ITEMS); + lv_obj_add_style(obj, &theme->styles.table_cell, LV_PART_ITEMS); + lv_obj_add_style(obj, &theme->styles.pad_normal, LV_PART_ITEMS); + lv_obj_add_style(obj, &theme->styles.pressed, LV_PART_ITEMS | LV_STATE_PRESSED); + lv_obj_add_style(obj, &theme->styles.bg_color_primary, LV_PART_ITEMS | LV_STATE_FOCUS_KEY); + lv_obj_add_style(obj, &theme->styles.bg_color_secondary, LV_PART_ITEMS | LV_STATE_EDITED); } #endif #if LV_USE_CHECKBOX else if(lv_obj_check_type(obj, &lv_checkbox_class)) { - lv_obj_add_style(obj, &styles->pad_gap, 0); - lv_obj_add_style(obj, &styles->outline_primary, LV_STATE_FOCUS_KEY); - lv_obj_add_style(obj, &styles->disabled, LV_PART_INDICATOR | LV_STATE_DISABLED); - lv_obj_add_style(obj, &styles->cb_marker, LV_PART_INDICATOR); - lv_obj_add_style(obj, &styles->bg_color_primary, LV_PART_INDICATOR | LV_STATE_CHECKED); - lv_obj_add_style(obj, &styles->cb_marker_checked, LV_PART_INDICATOR | LV_STATE_CHECKED); - lv_obj_add_style(obj, &styles->pressed, LV_PART_INDICATOR | LV_STATE_PRESSED); + lv_obj_add_style(obj, &theme->styles.pad_gap, 0); + lv_obj_add_style(obj, &theme->styles.outline_primary, LV_STATE_FOCUS_KEY); + lv_obj_add_style(obj, &theme->styles.disabled, LV_PART_INDICATOR | LV_STATE_DISABLED); + lv_obj_add_style(obj, &theme->styles.cb_marker, LV_PART_INDICATOR); + lv_obj_add_style(obj, &theme->styles.bg_color_primary, LV_PART_INDICATOR | LV_STATE_CHECKED); + lv_obj_add_style(obj, &theme->styles.cb_marker_checked, LV_PART_INDICATOR | LV_STATE_CHECKED); + lv_obj_add_style(obj, &theme->styles.pressed, LV_PART_INDICATOR | LV_STATE_PRESSED); #if LV_THEME_DEFAULT_GROW - lv_obj_add_style(obj, &styles->grow, LV_PART_INDICATOR | LV_STATE_PRESSED); + lv_obj_add_style(obj, &theme->styles.grow, LV_PART_INDICATOR | LV_STATE_PRESSED); #endif - lv_obj_add_style(obj, &styles->transition_normal, LV_PART_INDICATOR | LV_STATE_PRESSED); - lv_obj_add_style(obj, &styles->transition_delayed, LV_PART_INDICATOR); + lv_obj_add_style(obj, &theme->styles.transition_normal, LV_PART_INDICATOR | LV_STATE_PRESSED); + lv_obj_add_style(obj, &theme->styles.transition_delayed, LV_PART_INDICATOR); } #endif #if LV_USE_SWITCH else if(lv_obj_check_type(obj, &lv_switch_class)) { - lv_obj_add_style(obj, &styles->bg_color_grey, 0); - lv_obj_add_style(obj, &styles->circle, 0); - lv_obj_add_style(obj, &styles->disabled, LV_STATE_DISABLED); - lv_obj_add_style(obj, &styles->outline_primary, LV_STATE_FOCUS_KEY); - lv_obj_add_style(obj, &styles->bg_color_primary, LV_PART_INDICATOR | LV_STATE_CHECKED); - lv_obj_add_style(obj, &styles->circle, LV_PART_INDICATOR); - lv_obj_add_style(obj, &styles->disabled, LV_PART_INDICATOR | LV_STATE_DISABLED); - lv_obj_add_style(obj, &styles->knob, LV_PART_KNOB); - lv_obj_add_style(obj, &styles->bg_color_white, LV_PART_KNOB); - lv_obj_add_style(obj, &styles->switch_knob, LV_PART_KNOB); - lv_obj_add_style(obj, &styles->disabled, LV_PART_KNOB | LV_STATE_DISABLED); + lv_obj_add_style(obj, &theme->styles.bg_color_grey, 0); + lv_obj_add_style(obj, &theme->styles.circle, 0); + lv_obj_add_style(obj, &theme->styles.anim_fast, 0); + lv_obj_add_style(obj, &theme->styles.disabled, LV_STATE_DISABLED); + lv_obj_add_style(obj, &theme->styles.outline_primary, LV_STATE_FOCUS_KEY); + lv_obj_add_style(obj, &theme->styles.bg_color_primary, LV_PART_INDICATOR | LV_STATE_CHECKED); + lv_obj_add_style(obj, &theme->styles.circle, LV_PART_INDICATOR); + lv_obj_add_style(obj, &theme->styles.btn_border_color, LV_PART_INDICATOR); + lv_obj_add_style(obj, &theme->styles.disabled, LV_PART_INDICATOR | LV_STATE_DISABLED); + lv_obj_add_style(obj, &theme->styles.knob, LV_PART_KNOB); + lv_obj_add_style(obj, &theme->styles.bg_color_white, LV_PART_KNOB); + lv_obj_add_style(obj, &theme->styles.switch_knob, LV_PART_KNOB); + lv_obj_add_style(obj, &theme->styles.disabled, LV_PART_KNOB | LV_STATE_DISABLED); + + lv_obj_add_style(obj, &theme->styles.transition_normal, LV_PART_INDICATOR | LV_STATE_CHECKED); + lv_obj_add_style(obj, &theme->styles.transition_normal, LV_PART_INDICATOR); } #endif #if LV_USE_CHART else if(lv_obj_check_type(obj, &lv_chart_class)) { - lv_obj_add_style(obj, &styles->card, 0); - lv_obj_add_style(obj, &styles->pad_small, 0); - lv_obj_add_style(obj, &styles->chart_bg, 0); - lv_obj_add_style(obj, &styles->scrollbar, LV_PART_SCROLLBAR); - lv_obj_add_style(obj, &styles->scrollbar_scrolled, LV_PART_SCROLLBAR | LV_STATE_SCROLLED); - lv_obj_add_style(obj, &styles->chart_series, LV_PART_ITEMS); - lv_obj_add_style(obj, &styles->chart_indic, LV_PART_INDICATOR); - lv_obj_add_style(obj, &styles->chart_ticks, LV_PART_ITEMS); - lv_obj_add_style(obj, &styles->chart_series, LV_PART_CURSOR); + lv_obj_add_style(obj, &theme->styles.card, 0); + lv_obj_add_style(obj, &theme->styles.pad_small, 0); + lv_obj_add_style(obj, &theme->styles.chart_bg, 0); + lv_obj_add_style(obj, &theme->styles.scrollbar, LV_PART_SCROLLBAR); + lv_obj_add_style(obj, &theme->styles.scrollbar_scrolled, LV_PART_SCROLLBAR | LV_STATE_SCROLLED); + lv_obj_add_style(obj, &theme->styles.chart_series, LV_PART_ITEMS); + lv_obj_add_style(obj, &theme->styles.chart_indic, LV_PART_INDICATOR); + lv_obj_add_style(obj, &theme->styles.chart_series, LV_PART_CURSOR); } #endif #if LV_USE_ROLLER else if(lv_obj_check_type(obj, &lv_roller_class)) { - lv_obj_add_style(obj, &styles->card, 0); - lv_obj_add_style(obj, &styles->anim, 0); - lv_obj_add_style(obj, &styles->line_space_large, 0); - lv_obj_add_style(obj, &styles->text_align_center, 0); - lv_obj_add_style(obj, &styles->outline_primary, LV_STATE_FOCUS_KEY); - lv_obj_add_style(obj, &styles->outline_secondary, LV_STATE_EDITED); - lv_obj_add_style(obj, &styles->bg_color_primary, LV_PART_SELECTED); + lv_obj_add_style(obj, &theme->styles.card, 0); + lv_obj_add_style(obj, &theme->styles.anim, 0); + lv_obj_add_style(obj, &theme->styles.line_space_large, 0); + lv_obj_add_style(obj, &theme->styles.text_align_center, 0); + lv_obj_add_style(obj, &theme->styles.outline_primary, LV_STATE_FOCUS_KEY); + lv_obj_add_style(obj, &theme->styles.outline_secondary, LV_STATE_EDITED); + lv_obj_add_style(obj, &theme->styles.bg_color_primary, LV_PART_SELECTED); } #endif #if LV_USE_DROPDOWN else if(lv_obj_check_type(obj, &lv_dropdown_class)) { - lv_obj_add_style(obj, &styles->card, 0); - lv_obj_add_style(obj, &styles->pad_small, 0); - lv_obj_add_style(obj, &styles->transition_delayed, 0); - lv_obj_add_style(obj, &styles->transition_normal, LV_STATE_PRESSED); - lv_obj_add_style(obj, &styles->pressed, LV_STATE_PRESSED); - lv_obj_add_style(obj, &styles->outline_primary, LV_STATE_FOCUS_KEY); - lv_obj_add_style(obj, &styles->outline_secondary, LV_STATE_EDITED); - lv_obj_add_style(obj, &styles->transition_normal, LV_PART_INDICATOR); + lv_obj_add_style(obj, &theme->styles.card, 0); + lv_obj_add_style(obj, &theme->styles.pad_small, 0); + lv_obj_add_style(obj, &theme->styles.transition_delayed, 0); + lv_obj_add_style(obj, &theme->styles.transition_normal, LV_STATE_PRESSED); + lv_obj_add_style(obj, &theme->styles.pressed, LV_STATE_PRESSED); + lv_obj_add_style(obj, &theme->styles.outline_primary, LV_STATE_FOCUS_KEY); + lv_obj_add_style(obj, &theme->styles.outline_secondary, LV_STATE_EDITED); + lv_obj_add_style(obj, &theme->styles.transition_normal, LV_PART_INDICATOR); + lv_obj_add_style(obj, &theme->styles.disabled, LV_STATE_DISABLED); } else if(lv_obj_check_type(obj, &lv_dropdownlist_class)) { - lv_obj_add_style(obj, &styles->card, 0); - lv_obj_add_style(obj, &styles->clip_corner, 0); - lv_obj_add_style(obj, &styles->line_space_large, 0); - lv_obj_add_style(obj, &styles->dropdown_list, 0); - lv_obj_add_style(obj, &styles->scrollbar, LV_PART_SCROLLBAR); - lv_obj_add_style(obj, &styles->scrollbar_scrolled, LV_PART_SCROLLBAR | LV_STATE_SCROLLED); - lv_obj_add_style(obj, &styles->bg_color_white, LV_PART_SELECTED); - lv_obj_add_style(obj, &styles->bg_color_primary, LV_PART_SELECTED | LV_STATE_CHECKED); - lv_obj_add_style(obj, &styles->pressed, LV_PART_SELECTED | LV_STATE_PRESSED); + lv_obj_add_style(obj, &theme->styles.card, 0); + lv_obj_add_style(obj, &theme->styles.clip_corner, 0); + lv_obj_add_style(obj, &theme->styles.line_space_large, 0); + lv_obj_add_style(obj, &theme->styles.dropdown_list, 0); + lv_obj_add_style(obj, &theme->styles.scrollbar, LV_PART_SCROLLBAR); + lv_obj_add_style(obj, &theme->styles.scrollbar_scrolled, LV_PART_SCROLLBAR | LV_STATE_SCROLLED); + lv_obj_add_style(obj, &theme->styles.bg_color_white, LV_PART_SELECTED); + lv_obj_add_style(obj, &theme->styles.bg_color_primary, LV_PART_SELECTED | LV_STATE_CHECKED); + lv_obj_add_style(obj, &theme->styles.pressed, LV_PART_SELECTED | LV_STATE_PRESSED); } #endif #if LV_USE_ARC else if(lv_obj_check_type(obj, &lv_arc_class)) { - lv_obj_add_style(obj, &styles->arc_indic, 0); - lv_obj_add_style(obj, &styles->arc_indic, LV_PART_INDICATOR); - lv_obj_add_style(obj, &styles->arc_indic_primary, LV_PART_INDICATOR); - lv_obj_add_style(obj, &styles->arc_knob, LV_PART_KNOB); // OpenHASP + lv_obj_add_style(obj, &theme->styles.arc_indic, 0); + lv_obj_add_style(obj, &theme->styles.arc_indic, LV_PART_INDICATOR); + lv_obj_add_style(obj, &theme->styles.arc_indic_primary, LV_PART_INDICATOR); + lv_obj_add_style(obj, &theme->styles.knob, LV_PART_KNOB); + lv_obj_add_style(obj, &theme->styles.btn_border_color, LV_PART_KNOB); } #endif - #if LV_USE_SPINNER else if(lv_obj_check_type(obj, &lv_spinner_class)) { - lv_obj_add_style(obj, &styles->arc_indic, 0); - lv_obj_add_style(obj, &styles->arc_indic, LV_PART_INDICATOR); - lv_obj_add_style(obj, &styles->arc_indic_primary, LV_PART_INDICATOR); - } -#endif - -#if LV_USE_METER - else if(lv_obj_check_type(obj, &lv_meter_class)) { - lv_obj_add_style(obj, &styles->card, 0); - lv_obj_add_style(obj, &styles->circle, 0); - lv_obj_add_style(obj, &styles->meter_indic, LV_PART_INDICATOR); + lv_obj_add_style(obj, &theme->styles.arc_indic, 0); + lv_obj_add_style(obj, &theme->styles.arc_indic, LV_PART_INDICATOR); + lv_obj_add_style(obj, &theme->styles.arc_indic_primary, LV_PART_INDICATOR); } #endif #if LV_USE_TEXTAREA else if(lv_obj_check_type(obj, &lv_textarea_class)) { - lv_obj_add_style(obj, &styles->card, 0); - lv_obj_add_style(obj, &styles->pad_small, 0); - lv_obj_add_style(obj, &styles->outline_primary, LV_STATE_FOCUS_KEY); - lv_obj_add_style(obj, &styles->outline_secondary, LV_STATE_EDITED); - lv_obj_add_style(obj, &styles->scrollbar, LV_PART_SCROLLBAR); - lv_obj_add_style(obj, &styles->scrollbar_scrolled, LV_PART_SCROLLBAR | LV_STATE_SCROLLED); - lv_obj_add_style(obj, &styles->ta_cursor, LV_PART_CURSOR | LV_STATE_FOCUSED); - lv_obj_add_style(obj, &styles->ta_placeholder, LV_PART_TEXTAREA_PLACEHOLDER); + lv_obj_add_style(obj, &theme->styles.card, 0); + lv_obj_add_style(obj, &theme->styles.pad_small, 0); + lv_obj_add_style(obj, &theme->styles.disabled, LV_STATE_DISABLED); + lv_obj_add_style(obj, &theme->styles.outline_primary, LV_STATE_FOCUS_KEY); + lv_obj_add_style(obj, &theme->styles.outline_secondary, LV_STATE_EDITED); + lv_obj_add_style(obj, &theme->styles.scrollbar, LV_PART_SCROLLBAR); + lv_obj_add_style(obj, &theme->styles.scrollbar_scrolled, LV_PART_SCROLLBAR | LV_STATE_SCROLLED); + lv_obj_add_style(obj, &theme->styles.ta_cursor, LV_PART_CURSOR | LV_STATE_FOCUSED); + lv_obj_add_style(obj, &theme->styles.ta_placeholder, LV_PART_TEXTAREA_PLACEHOLDER); } #endif #if LV_USE_CALENDAR else if(lv_obj_check_type(obj, &lv_calendar_class)) { - lv_obj_add_style(obj, &styles->card, 0); - lv_obj_add_style(obj, &styles->calendar_bg, 0); - lv_obj_add_style(obj, &styles->outline_primary, LV_STATE_FOCUS_KEY); - lv_obj_add_style(obj, &styles->outline_secondary, LV_STATE_EDITED); - lv_obj_add_style(obj, &styles->calendar_day, LV_PART_ITEMS); - lv_obj_add_style(obj, &styles->pressed, LV_PART_ITEMS | LV_STATE_PRESSED); - lv_obj_add_style(obj, &styles->disabled, LV_PART_ITEMS | LV_STATE_DISABLED); - lv_obj_add_style(obj, &styles->outline_primary, LV_PART_ITEMS | LV_STATE_FOCUS_KEY); - lv_obj_add_style(obj, &styles->outline_secondary, LV_PART_ITEMS | LV_STATE_EDITED); + lv_obj_add_style(obj, &theme->styles.card, 0); + lv_obj_add_style(obj, &theme->styles.pad_zero, 0); } -#endif #if LV_USE_CALENDAR_HEADER_ARROW else if(lv_obj_check_type(obj, &lv_calendar_header_arrow_class)) { - lv_obj_add_style(obj, &styles->card, 0); + lv_obj_add_style(obj, &theme->styles.calendar_header, 0); } #endif #if LV_USE_CALENDAR_HEADER_DROPDOWN else if(lv_obj_check_type(obj, &lv_calendar_header_dropdown_class)) { - lv_obj_add_style(obj, &styles->card, 0); + lv_obj_add_style(obj, &theme->styles.calendar_header, 0); } #endif +#endif #if LV_USE_KEYBOARD else if(lv_obj_check_type(obj, &lv_keyboard_class)) { - lv_obj_add_style(obj, &styles->scr, 0); - lv_obj_add_style(obj, disp_size == DISP_LARGE ? &styles->pad_small : &styles->pad_tiny, 0); - lv_obj_add_style(obj, &styles->outline_primary, LV_STATE_FOCUS_KEY); - lv_obj_add_style(obj, &styles->outline_secondary, LV_STATE_EDITED); - lv_obj_add_style(obj, &styles->btn, LV_PART_ITEMS); - lv_obj_add_style(obj, &styles->disabled, LV_PART_ITEMS | LV_STATE_DISABLED); - lv_obj_add_style(obj, &styles->bg_color_white, LV_PART_ITEMS); - lv_obj_add_style(obj, &styles->keyboard_btn_bg, LV_PART_ITEMS); - lv_obj_add_style(obj, &styles->pressed, LV_PART_ITEMS | LV_STATE_PRESSED); - lv_obj_add_style(obj, &styles->bg_color_grey, LV_PART_ITEMS | LV_STATE_CHECKED); - lv_obj_add_style(obj, &styles->bg_color_primary_muted, LV_PART_ITEMS | LV_STATE_FOCUS_KEY); - lv_obj_add_style(obj, &styles->bg_color_secondary_muted, LV_PART_ITEMS | LV_STATE_EDITED); + lv_obj_add_style(obj, &theme->styles.scr, 0); + lv_obj_add_style(obj, theme->disp_size == DISP_LARGE ? &theme->styles.pad_small : &theme->styles.pad_tiny, 0); + lv_obj_add_style(obj, &theme->styles.outline_primary, LV_STATE_FOCUS_KEY); + lv_obj_add_style(obj, &theme->styles.outline_secondary, LV_STATE_EDITED); + lv_obj_add_style(obj, &theme->styles.btn, LV_PART_ITEMS); + lv_obj_add_style(obj, &theme->styles.btn_border, LV_PART_ITEMS); + lv_obj_add_style(obj, &theme->styles.btn_border_color, LV_PART_ITEMS); + lv_obj_add_style(obj, &theme->styles.disabled, LV_PART_ITEMS | LV_STATE_DISABLED); + lv_obj_add_style(obj, &theme->styles.bg_color_white, LV_PART_ITEMS); + lv_obj_add_style(obj, &theme->styles.keyboard_button_bg, LV_PART_ITEMS); + lv_obj_add_style(obj, &theme->styles.pressed, LV_PART_ITEMS | LV_STATE_PRESSED); + lv_obj_add_style(obj, &theme->styles.bg_color_grey, LV_PART_ITEMS | LV_STATE_CHECKED); + lv_obj_add_style(obj, &theme->styles.bg_color_primary_muted, LV_PART_ITEMS | LV_STATE_FOCUS_KEY); + lv_obj_add_style(obj, &theme->styles.bg_color_secondary_muted, LV_PART_ITEMS | LV_STATE_EDITED); } #endif #if LV_USE_LIST else if(lv_obj_check_type(obj, &lv_list_class)) { - lv_obj_add_style(obj, &styles->card, 0); - lv_obj_add_style(obj, &styles->list_bg, 0); - lv_obj_add_style(obj, &styles->scrollbar, LV_PART_SCROLLBAR); - lv_obj_add_style(obj, &styles->scrollbar_scrolled, LV_PART_SCROLLBAR | LV_STATE_SCROLLED); + lv_obj_add_style(obj, &theme->styles.card, 0); + lv_obj_add_style(obj, &theme->styles.list_bg, 0); + lv_obj_add_style(obj, &theme->styles.scrollbar, LV_PART_SCROLLBAR); + lv_obj_add_style(obj, &theme->styles.scrollbar_scrolled, LV_PART_SCROLLBAR | LV_STATE_SCROLLED); return; } else if(lv_obj_check_type(obj, &lv_list_text_class)) { - lv_obj_add_style(obj, &styles->bg_color_grey, 0); - lv_obj_add_style(obj, &styles->list_item_grow, 0); + lv_obj_add_style(obj, &theme->styles.bg_color_grey, 0); + lv_obj_add_style(obj, &theme->styles.list_item_grow, 0); } else if(lv_obj_check_type(obj, &lv_list_button_class)) { - lv_obj_add_style(obj, &styles->bg_color_white, 0); - lv_obj_add_style(obj, &styles->list_btn, 0); - lv_obj_add_style(obj, &styles->bg_color_primary, LV_STATE_FOCUS_KEY); - lv_obj_add_style(obj, &styles->list_item_grow, LV_STATE_FOCUS_KEY); - lv_obj_add_style(obj, &styles->list_item_grow, LV_STATE_PRESSED); - lv_obj_add_style(obj, &styles->pressed, LV_STATE_PRESSED); + lv_obj_add_style(obj, &theme->styles.bg_color_white, 0); + lv_obj_add_style(obj, &theme->styles.list_btn, 0); + lv_obj_add_style(obj, &theme->styles.btn_border_color, 0); + lv_obj_add_style(obj, &theme->styles.bg_color_primary, LV_STATE_FOCUS_KEY); + lv_obj_add_style(obj, &theme->styles.list_item_grow, LV_STATE_FOCUS_KEY); + lv_obj_add_style(obj, &theme->styles.list_item_grow, LV_STATE_PRESSED); + lv_obj_add_style(obj, &theme->styles.pressed, LV_STATE_PRESSED); } #endif +#if LV_USE_MENU + else if(lv_obj_check_type(obj, &lv_menu_class)) { + lv_obj_add_style(obj, &theme->styles.card, 0); + lv_obj_add_style(obj, &theme->styles.menu_bg, 0); + } + else if(lv_obj_check_type(obj, &lv_menu_sidebar_cont_class)) { + lv_obj_add_style(obj, &theme->styles.menu_sidebar_cont, 0); + lv_obj_add_style(obj, &theme->styles.scrollbar, LV_PART_SCROLLBAR); + lv_obj_add_style(obj, &theme->styles.scrollbar_scrolled, LV_PART_SCROLLBAR | LV_STATE_SCROLLED); + } + else if(lv_obj_check_type(obj, &lv_menu_main_cont_class)) { + lv_obj_add_style(obj, &theme->styles.menu_main_cont, 0); + lv_obj_add_style(obj, &theme->styles.scrollbar, LV_PART_SCROLLBAR); + lv_obj_add_style(obj, &theme->styles.scrollbar_scrolled, LV_PART_SCROLLBAR | LV_STATE_SCROLLED); + } + else if(lv_obj_check_type(obj, &lv_menu_cont_class)) { + lv_obj_add_style(obj, &theme->styles.menu_cont, 0); + lv_obj_add_style(obj, &theme->styles.menu_pressed, LV_STATE_PRESSED); + lv_obj_add_style(obj, &theme->styles.bg_color_primary_muted, LV_STATE_PRESSED | LV_STATE_CHECKED); + lv_obj_add_style(obj, &theme->styles.bg_color_primary_muted, LV_STATE_CHECKED); + lv_obj_add_style(obj, &theme->styles.bg_color_primary, LV_STATE_FOCUS_KEY); + } + else if(lv_obj_check_type(obj, &lv_menu_sidebar_header_cont_class) || + lv_obj_check_type(obj, &lv_menu_main_header_cont_class)) { + lv_obj_add_style(obj, &theme->styles.menu_header_cont, 0); + } + else if(lv_obj_check_type(obj, &lv_menu_page_class)) { + lv_obj_add_style(obj, &theme->styles.menu_page, 0); + lv_obj_add_style(obj, &theme->styles.scrollbar, LV_PART_SCROLLBAR); + lv_obj_add_style(obj, &theme->styles.scrollbar_scrolled, LV_PART_SCROLLBAR | LV_STATE_SCROLLED); + } + else if(lv_obj_check_type(obj, &lv_menu_section_class)) { + lv_obj_add_style(obj, &theme->styles.menu_section, 0); + } + else if(lv_obj_check_type(obj, &lv_menu_separator_class)) { + lv_obj_add_style(obj, &theme->styles.menu_separator, 0); + } +#endif #if LV_USE_MSGBOX else if(lv_obj_check_type(obj, &lv_msgbox_class)) { - lv_obj_add_style(obj, &styles->card, 0); - lv_obj_add_style(obj, &styles->pad_zero, 0); - lv_obj_add_style(obj, &styles->clip_corner, 0); + lv_obj_add_style(obj, &theme->styles.card, 0); + lv_obj_add_style(obj, &theme->styles.pad_zero, 0); + lv_obj_add_style(obj, &theme->styles.clip_corner, 0); return; } else if(lv_obj_check_type(obj, &lv_msgbox_backdrop_class)) { - lv_obj_add_style(obj, &styles->msgbox_backdrop_bg, 0); + lv_obj_add_style(obj, &theme->styles.msgbox_backdrop_bg, 0); return; } else if(lv_obj_check_type(obj, &lv_msgbox_header_class)) { - lv_obj_add_style(obj, &styles->pad_tiny, 0); - lv_obj_add_style(obj, &styles->bg_color_grey, 0); + lv_obj_add_style(obj, &theme->styles.pad_tiny, 0); + lv_obj_add_style(obj, &theme->styles.bg_color_grey, 0); return; } else if(lv_obj_check_type(obj, &lv_msgbox_footer_class)) { - lv_obj_add_style(obj, &styles->pad_tiny, 0); + lv_obj_add_style(obj, &theme->styles.pad_tiny, 0); return; } else if(lv_obj_check_type(obj, &lv_msgbox_content_class)) { - lv_obj_add_style(obj, &styles->scrollbar, LV_PART_SCROLLBAR); - lv_obj_add_style(obj, &styles->scrollbar_scrolled, LV_PART_SCROLLBAR | LV_STATE_SCROLLED); - lv_obj_add_style(obj, &styles->pad_tiny, 0); + lv_obj_add_style(obj, &theme->styles.scrollbar, LV_PART_SCROLLBAR); + lv_obj_add_style(obj, &theme->styles.scrollbar_scrolled, LV_PART_SCROLLBAR | LV_STATE_SCROLLED); + lv_obj_add_style(obj, &theme->styles.pad_tiny, 0); return; } else if(lv_obj_check_type(obj, &lv_msgbox_header_button_class) || lv_obj_check_type(obj, &lv_msgbox_footer_button_class)) { - lv_obj_add_style(obj, &styles->btn, 0); - lv_obj_add_style(obj, &styles->bg_color_primary, 0); - lv_obj_add_style(obj, &styles->transition_delayed, 0); - lv_obj_add_style(obj, &styles->pressed, LV_STATE_PRESSED); - lv_obj_add_style(obj, &styles->transition_normal, LV_STATE_PRESSED); - lv_obj_add_style(obj, &styles->outline_primary, LV_STATE_FOCUS_KEY); - lv_obj_add_style(obj, &styles->bg_color_secondary, LV_STATE_CHECKED); - lv_obj_add_style(obj, &styles->disabled, LV_STATE_DISABLED); + lv_obj_add_style(obj, &theme->styles.btn, 0); + lv_obj_add_style(obj, &theme->styles.btn_border, 0); + lv_obj_add_style(obj, &theme->styles.btn_border_color, 0); + lv_obj_add_style(obj, &theme->styles.bg_color_primary, 0); + lv_obj_add_style(obj, &theme->styles.transition_delayed, 0); + lv_obj_add_style(obj, &theme->styles.pressed, LV_STATE_PRESSED); + lv_obj_add_style(obj, &theme->styles.transition_normal, LV_STATE_PRESSED); + lv_obj_add_style(obj, &theme->styles.outline_primary, LV_STATE_FOCUS_KEY); + lv_obj_add_style(obj, &theme->styles.bg_color_secondary, LV_STATE_CHECKED); + lv_obj_add_style(obj, &theme->styles.disabled, LV_STATE_DISABLED); return; } + #endif + #if LV_USE_SPINBOX else if(lv_obj_check_type(obj, &lv_spinbox_class)) { - lv_obj_add_style(obj, &styles->card, 0); - lv_obj_add_style(obj, &styles->pad_small, 0); - lv_obj_add_style(obj, &styles->outline_primary, LV_STATE_FOCUS_KEY); - lv_obj_add_style(obj, &styles->outline_secondary, LV_STATE_EDITED); - lv_obj_add_style(obj, &styles->bg_color_primary, LV_PART_CURSOR); + lv_obj_add_style(obj, &theme->styles.card, 0); + lv_obj_add_style(obj, &theme->styles.pad_small, 0); + lv_obj_add_style(obj, &theme->styles.outline_primary, LV_STATE_FOCUS_KEY); + lv_obj_add_style(obj, &theme->styles.outline_secondary, LV_STATE_EDITED); + lv_obj_add_style(obj, &theme->styles.bg_color_primary, LV_PART_CURSOR); } #endif #if LV_USE_TILEVIEW else if(lv_obj_check_type(obj, &lv_tileview_class)) { - lv_obj_add_style(obj, &styles->scr, 0); - lv_obj_add_style(obj, &styles->scrollbar, LV_PART_SCROLLBAR); - lv_obj_add_style(obj, &styles->scrollbar_scrolled, LV_PART_SCROLLBAR | LV_STATE_SCROLLED); + lv_obj_add_style(obj, &theme->styles.scr, 0); + lv_obj_add_style(obj, &theme->styles.scrollbar, LV_PART_SCROLLBAR); + lv_obj_add_style(obj, &theme->styles.scrollbar_scrolled, LV_PART_SCROLLBAR | LV_STATE_SCROLLED); } else if(lv_obj_check_type(obj, &lv_tileview_tile_class)) { - lv_obj_add_style(obj, &styles->scrollbar, LV_PART_SCROLLBAR); - lv_obj_add_style(obj, &styles->scrollbar_scrolled, LV_PART_SCROLLBAR | LV_STATE_SCROLLED); + lv_obj_add_style(obj, &theme->styles.scrollbar, LV_PART_SCROLLBAR); + lv_obj_add_style(obj, &theme->styles.scrollbar_scrolled, LV_PART_SCROLLBAR | LV_STATE_SCROLLED); } #endif #if LV_USE_TABVIEW - if(lv_obj_check_type(obj, &lv_tabview_class)) { - lv_obj_add_style(obj, &styles->scr, 0); - lv_obj_add_style(obj, &styles->pad_zero, 0); - return; + else if(lv_obj_check_type(obj, &lv_tabview_class)) { + lv_obj_add_style(obj, &theme->styles.scr, 0); + lv_obj_add_style(obj, &theme->styles.pad_zero, 0); + lv_obj_add_style(obj, &theme->styles.btn_border, 0); + lv_obj_add_style(obj, &theme->styles.btn_border_color, 0); // add grey border } #endif -#if LV_USE_COLORWHEEL - else if(lv_obj_check_type(obj, &lv_colorwheel_class)) { - lv_obj_add_style(obj, &styles->colorwheel_main, 0); - lv_obj_add_style(obj, &styles->pad_normal, 0); - lv_obj_add_style(obj, &styles->bg_color_white, LV_PART_KNOB); - lv_obj_add_style(obj, &styles->pad_normal, LV_PART_KNOB); +#if LV_USE_WIN + else if(lv_obj_check_type(obj, &lv_win_class)) { + lv_obj_add_style(obj, &theme->styles.clip_corner, 0); } #endif #if LV_USE_LED else if(lv_obj_check_type(obj, &lv_led_class)) { - lv_obj_add_style(obj, &styles->led, 0); - } + lv_obj_add_style(obj, &theme->styles.led, 0); + } +#endif + +#if LV_USE_SCALE + else if(lv_obj_check_type(obj, &lv_scale_class)) { + lv_obj_add_style(obj, &theme->styles.scale, LV_PART_MAIN); + lv_obj_add_style(obj, &theme->styles.scale, LV_PART_INDICATOR); + lv_obj_add_style(obj, &theme->styles.scale, LV_PART_ITEMS); + } #endif } @@ -1090,6 +1244,10 @@ static void theme_apply(lv_theme_t * th, lv_obj_t * obj) static void style_init_reset(lv_style_t * style) { - if(inited) lv_style_reset(style); - else lv_style_init(style); + if(haspmota_theme) { + lv_style_reset(style); + } + else { + lv_style_init(style); + } } diff --git a/lib/libesp32_lvgl/LVGL_assets/src/lv_theme_haspmota.h b/lib/libesp32_lvgl/LVGL_assets/src/lv_theme_haspmota.h index ef40ba742..b161cc5f5 100644 --- a/lib/libesp32_lvgl/LVGL_assets/src/lv_theme_haspmota.h +++ b/lib/libesp32_lvgl/LVGL_assets/src/lv_theme_haspmota.h @@ -40,8 +40,7 @@ typedef enum { * @param font pointer to a font to use. * @return a pointer to reference this theme later */ -lv_theme_t * lv_theme_haspmota_init(lv_display_t * disp, lv_color_t color_primary, lv_color_t color_secondary, bool dark, const lv_font_t * font); - +lv_theme_t * lv_theme_haspmota_init(lv_display_t * disp, lv_color_t * colors, const lv_font_t * font_small, const lv_font_t * font_normal, const lv_font_t * font_large); bool lv_theme_haspmota_is_inited(void); /********************** diff --git a/lib/libesp32_lvgl/lv_binding_berry/generate/LVGL_API_Reference.md b/lib/libesp32_lvgl/lv_binding_berry/generate/LVGL_API_Reference.md index e89139c74..1a274905c 100644 --- a/lib/libesp32_lvgl/lv_binding_berry/generate/LVGL_API_Reference.md +++ b/lib/libesp32_lvgl/lv_binding_berry/generate/LVGL_API_Reference.md @@ -152,7 +152,7 @@ theme_get_font_large|lv.obj|lv.font|[lv_theme_get_font_large](https://docs.lvgl. theme_get_font_normal|lv.obj|lv.font|[lv_theme_get_font_normal](https://docs.lvgl.io/9.0/search.html?q=lv_theme_get_font_normal) theme_get_font_small|lv.obj|lv.font|[lv_theme_get_font_small](https://docs.lvgl.io/9.0/search.html?q=lv_theme_get_font_small) theme_get_from_obj|lv.obj|lv.theme|[lv_theme_get_from_obj](https://docs.lvgl.io/9.0/search.html?q=lv_theme_get_from_obj) -theme_haspmota_init|lv.display, lv.color, lv.color, bool, lv.font|lv.theme|[lv_theme_haspmota_init](https://docs.lvgl.io/9.0/search.html?q=lv_theme_haspmota_init) +theme_haspmota_init|lv.display, lv.color_arr, lv.font, lv.font, lv.font|lv.theme|[lv_theme_haspmota_init](https://docs.lvgl.io/9.0/search.html?q=lv_theme_haspmota_init) theme_haspmota_is_inited||bool|[lv_theme_haspmota_is_inited](https://docs.lvgl.io/9.0/search.html?q=lv_theme_haspmota_is_inited) theme_set_parent|lv.theme, lv.theme||[lv_theme_set_parent](https://docs.lvgl.io/9.0/search.html?q=lv_theme_set_parent) timer_create|\, int, \|lv.timer|[lv_timer_create](https://docs.lvgl.io/9.0/search.html?q=lv_timer_create) diff --git a/lib/libesp32_lvgl/lv_binding_berry/generate/be_lvgl_module.c b/lib/libesp32_lvgl/lv_binding_berry/generate/be_lvgl_module.c index 21e572462..de171d45e 100644 --- a/lib/libesp32_lvgl/lv_binding_berry/generate/be_lvgl_module.c +++ b/lib/libesp32_lvgl/lv_binding_berry/generate/be_lvgl_module.c @@ -174,7 +174,7 @@ const be_ntv_func_def_t lv_func[] = { { "theme_get_font_normal", { (const void*) &lv_theme_get_font_normal, "lv.font", "(lv.obj)" } }, { "theme_get_font_small", { (const void*) &lv_theme_get_font_small, "lv.font", "(lv.obj)" } }, { "theme_get_from_obj", { (const void*) &lv_theme_get_from_obj, "lv.theme", "(lv.obj)" } }, - { "theme_haspmota_init", { (const void*) &lv_theme_haspmota_init, "lv.theme", "(lv.display)(lv.color)(lv.color)b(lv.font)" } }, + { "theme_haspmota_init", { (const void*) &lv_theme_haspmota_init, "lv.theme", "(lv.display)(lv.color_arr)(lv.font)(lv.font)(lv.font)" } }, { "theme_haspmota_is_inited", { (const void*) &lv_theme_haspmota_is_inited, "b", "" } }, { "theme_set_parent", { (const void*) &lv_theme_set_parent, "", "(lv.theme)(lv.theme)" } }, { "timer_create", { (const void*) &lv_timer_create, "lv.timer", "^lv_timer_cb^i." } }, diff --git a/lib/libesp32_lvgl/lv_binding_berry/mapping/lv_funcs.h b/lib/libesp32_lvgl/lv_binding_berry/mapping/lv_funcs.h index 41c6cb08f..425c50633 100644 --- a/lib/libesp32_lvgl/lv_binding_berry/mapping/lv_funcs.h +++ b/lib/libesp32_lvgl/lv_binding_berry/mapping/lv_funcs.h @@ -1491,7 +1491,7 @@ lv_obj_t * lv_tileview_get_tile_active(lv_obj_t * obj) // ../../lvgl/src/widgets/win/lv_win.h // ../../LVGL_assets/src/lv_theme_haspmota.h -lv_theme_t * lv_theme_haspmota_init(lv_display_t * disp, lv_color_t color_primary, lv_color_t color_secondary, bool dark, const lv_font_t * font) +lv_theme_t * lv_theme_haspmota_init(lv_display_t * disp, lv_color_t * colors, const lv_font_t * font_small, const lv_font_t * font_normal, const lv_font_t * font_large) bool lv_theme_haspmota_is_inited(void) // ../src/lv_berry.h diff --git a/lib/libesp32_lvgl/lv_binding_berry/src/embedded/lvgl_extra.be b/lib/libesp32_lvgl/lv_binding_berry/src/embedded/lvgl_extra.be index be198b0f9..6f8215d5e 100644 --- a/lib/libesp32_lvgl/lv_binding_berry/src/embedded/lvgl_extra.be +++ b/lib/libesp32_lvgl/lv_binding_berry/src/embedded/lvgl_extra.be @@ -112,14 +112,32 @@ end class lv_style_prop_arr : bytes def init(l) if type(l) != 'instance' || !isinstance(l, list) raise "value_error", "argument must be a list" end - super(self).init(size(l) * 4) + super(self).init(size(l)) for e: l - self.add(int(e), 4) + self.add(int(e)) end end end +class lv_color_arr : bytes + def init(l) + if type(l) != 'instance' || !isinstance(l, list) raise "value_error", "argument must be a list" end + super(self).init(size(l) * 3) + for e: l + self.add(int(e), 3) + end + end + + def item(n) + return lv.color(self.get(n * 3, 3)) + end + + def setitem(n, v) + self.set(n * 3, int(v), 3) + end +end + class lv_str_arr : bytes var l # keep a copy of the list because we want the pointer to strings to remain valid def init(l) @@ -138,6 +156,7 @@ lv_extra.lv_int_arr = lv_int_arr lv_extra.lv_point_arr = lv_point_arr lv_extra.lv_style_prop_arr = lv_style_prop_arr lv_extra.lv_str_arr = lv_str_arr +lv_extra.lv_color_arr = lv_color_arr lv_extra.init = def (m) import global @@ -151,6 +170,7 @@ lv_extra.init = def (m) lv.point_arr = m.lv_point_arr lv.style_prop_arr = m.lv_style_prop_arr lv.str_arr = m.lv_str_arr + lv.color_arr = m.lv_color_arr return m end @@ -170,4 +190,4 @@ p2.x = 3 p2.y = 4 print(lv_point_arr([p1, p2])) --# \ No newline at end of file +-# diff --git a/lib/libesp32_lvgl/lv_binding_berry/src/solidify/solidified_lvgl_extra.h b/lib/libesp32_lvgl/lv_binding_berry/src/solidify/solidified_lvgl_extra.h index 9255abbd2..6727efec6 100644 --- a/lib/libesp32_lvgl/lv_binding_berry/src/solidify/solidified_lvgl_extra.h +++ b/lib/libesp32_lvgl/lv_binding_berry/src/solidify/solidified_lvgl_extra.h @@ -4,84 +4,6 @@ \********************************************************************/ #include "be_constobj.h" -extern const bclass be_class_lv_str_arr; - -/******************************************************************** -** Solidified function: init -********************************************************************/ -be_local_closure(class_lv_str_arr_init, /* name */ - be_nested_proto( - 11, /* nstack */ - 2, /* argc */ - 2, /* varg */ - 0, /* has upvals */ - NULL, /* no upvals */ - 0, /* has sup protos */ - NULL, /* no sub protos */ - 1, /* has constants */ - ( &(const bvalue[ 6]) { /* constants */ - /* K0 */ be_nested_str_weak(l), - /* K1 */ be_nested_str_weak(init), - /* K2 */ be_nested_str_weak(introspect), - /* K3 */ be_nested_str_weak(add), - /* K4 */ be_nested_str_weak(toptr), - /* K5 */ be_nested_str_weak(stop_iteration), - }), - be_str_weak(init), - &be_const_str_solidified, - ( &(const binstruction[31]) { /* code */ - 0x90020001, // 0000 SETMBR R0 K0 R1 - 0x60080003, // 0001 GETGBL R2 G3 - 0x5C0C0000, // 0002 MOVE R3 R0 - 0x7C080200, // 0003 CALL R2 1 - 0x8C080501, // 0004 GETMET R2 R2 K1 - 0x6010000C, // 0005 GETGBL R4 G12 - 0x5C140200, // 0006 MOVE R5 R1 - 0x7C100200, // 0007 CALL R4 1 - 0x54160003, // 0008 LDINT R5 4 - 0x08100805, // 0009 MUL R4 R4 R5 - 0x7C080400, // 000A CALL R2 2 - 0xA40A0400, // 000B IMPORT R2 K2 - 0x600C0010, // 000C GETGBL R3 G16 - 0x5C100200, // 000D MOVE R4 R1 - 0x7C0C0200, // 000E CALL R3 1 - 0xA802000A, // 000F EXBLK 0 #001B - 0x5C100600, // 0010 MOVE R4 R3 - 0x7C100000, // 0011 CALL R4 0 - 0x8C140103, // 0012 GETMET R5 R0 K3 - 0x601C0009, // 0013 GETGBL R7 G9 - 0x8C200504, // 0014 GETMET R8 R2 K4 - 0x5C280800, // 0015 MOVE R10 R4 - 0x7C200400, // 0016 CALL R8 2 - 0x7C1C0200, // 0017 CALL R7 1 - 0x54220003, // 0018 LDINT R8 4 - 0x7C140600, // 0019 CALL R5 3 - 0x7001FFF4, // 001A JMP #0010 - 0x580C0005, // 001B LDCONST R3 K5 - 0xAC0C0200, // 001C CATCH R3 1 0 - 0xB0080000, // 001D RAISE 2 R0 R0 - 0x80000000, // 001E RET 0 - }) - ) -); -/*******************************************************************/ - - -/******************************************************************** -** Solidified class: lv_str_arr -********************************************************************/ -extern const bclass be_class_bytes; -be_local_class(lv_str_arr, - 1, - &be_class_bytes, - be_nested_map(2, - ( (struct bmapnode*) &(const bmapnode[]) { - { be_const_key_weak(init, -1), be_const_closure(class_lv_str_arr_init_closure) }, - { be_const_key_weak(l, 0), be_const_var(0) }, - })), - be_str_weak(lv_str_arr) -); - extern const bclass be_class_lv_int_arr; /******************************************************************** @@ -355,88 +277,41 @@ be_local_class(lv_point_arr, })), be_str_weak(lv_point_arr) ); - -/******************************************************************** -** Solidified function: _anonymous_ -********************************************************************/ -be_local_closure(_anonymous_, /* name */ - be_nested_proto( - 4, /* nstack */ - 1, /* argc */ - 0, /* varg */ - 0, /* has upvals */ - NULL, /* no upvals */ - 0, /* has sup protos */ - NULL, /* no sub protos */ - 1, /* has constants */ - ( &(const bvalue[12]) { /* constants */ - /* K0 */ be_nested_str_weak(global), - /* K1 */ be_nested_str_weak(lv), - /* K2 */ be_nested_str_weak(lv_coord_arr), - /* K3 */ be_nested_str_weak(lv_int_arr), - /* K4 */ be_nested_str_weak(lv_point_arr), - /* K5 */ be_nested_str_weak(coord_arr), - /* K6 */ be_nested_str_weak(int_arr), - /* K7 */ be_nested_str_weak(point_arr), - /* K8 */ be_nested_str_weak(style_prop_arr), - /* K9 */ be_nested_str_weak(lv_style_prop_arr), - /* K10 */ be_nested_str_weak(str_arr), - /* K11 */ be_nested_str_weak(lv_str_arr), - }), - be_str_weak(_anonymous_), - &be_const_str_solidified, - ( &(const binstruction[19]) { /* code */ - 0xA4060000, // 0000 IMPORT R1 K0 - 0x88080301, // 0001 GETMBR R2 R1 K1 - 0x880C0102, // 0002 GETMBR R3 R0 K2 - 0x900A0403, // 0003 SETMBR R2 K2 R3 - 0x880C0103, // 0004 GETMBR R3 R0 K3 - 0x900A0603, // 0005 SETMBR R2 K3 R3 - 0x880C0104, // 0006 GETMBR R3 R0 K4 - 0x900A0803, // 0007 SETMBR R2 K4 R3 - 0x880C0102, // 0008 GETMBR R3 R0 K2 - 0x900A0A03, // 0009 SETMBR R2 K5 R3 - 0x880C0103, // 000A GETMBR R3 R0 K3 - 0x900A0C03, // 000B SETMBR R2 K6 R3 - 0x880C0104, // 000C GETMBR R3 R0 K4 - 0x900A0E03, // 000D SETMBR R2 K7 R3 - 0x880C0109, // 000E GETMBR R3 R0 K9 - 0x900A1003, // 000F SETMBR R2 K8 R3 - 0x880C010B, // 0010 GETMBR R3 R0 K11 - 0x900A1403, // 0011 SETMBR R2 K10 R3 - 0x80040000, // 0012 RET 1 R0 - }) - ) -); -/*******************************************************************/ +// compact class 'lv_color_arr' ktab size: 11, total: 13 (saved 16 bytes) +static const bvalue be_ktab_class_lv_color_arr[11] = { + /* K0 */ be_nested_str_weak(instance), + /* K1 */ be_nested_str_weak(value_error), + /* K2 */ be_nested_str_weak(argument_X20must_X20be_X20a_X20list), + /* K3 */ be_nested_str_weak(init), + /* K4 */ be_const_int(3), + /* K5 */ be_nested_str_weak(add), + /* K6 */ be_nested_str_weak(stop_iteration), + /* K7 */ be_nested_str_weak(lv), + /* K8 */ be_nested_str_weak(color), + /* K9 */ be_nested_str_weak(get), + /* K10 */ be_nested_str_weak(set), +}; -extern const bclass be_class_lv_style_prop_arr; +extern const bclass be_class_lv_color_arr; /******************************************************************** ** Solidified function: init ********************************************************************/ -be_local_closure(class_lv_style_prop_arr_init, /* name */ +be_local_closure(class_lv_color_arr_init, /* name */ be_nested_proto( 8, /* nstack */ 2, /* argc */ - 2, /* varg */ + 10, /* varg */ 0, /* has upvals */ NULL, /* no upvals */ 0, /* has sup protos */ NULL, /* no sub protos */ 1, /* has constants */ - ( &(const bvalue[ 6]) { /* constants */ - /* K0 */ be_nested_str_weak(instance), - /* K1 */ be_nested_str_weak(value_error), - /* K2 */ be_nested_str_weak(argument_X20must_X20be_X20a_X20list), - /* K3 */ be_nested_str_weak(init), - /* K4 */ be_nested_str_weak(add), - /* K5 */ be_nested_str_weak(stop_iteration), - }), + &be_ktab_class_lv_color_arr, /* shared constants */ be_str_weak(init), &be_const_str_solidified, - ( &(const binstruction[38]) { /* code */ + ( &(const binstruction[37]) { /* code */ 0x60080004, // 0000 GETGBL R2 G4 0x5C0C0200, // 0001 MOVE R3 R1 0x7C080200, // 0002 CALL R2 1 @@ -455,26 +330,25 @@ be_local_closure(class_lv_style_prop_arr_init, /* name */ 0x6010000C, // 000F GETGBL R4 G12 0x5C140200, // 0010 MOVE R5 R1 0x7C100200, // 0011 CALL R4 1 - 0x54160003, // 0012 LDINT R5 4 - 0x08100805, // 0013 MUL R4 R4 R5 - 0x7C080400, // 0014 CALL R2 2 - 0x60080010, // 0015 GETGBL R2 G16 - 0x5C0C0200, // 0016 MOVE R3 R1 - 0x7C080200, // 0017 CALL R2 1 - 0xA8020008, // 0018 EXBLK 0 #0022 - 0x5C0C0400, // 0019 MOVE R3 R2 - 0x7C0C0000, // 001A CALL R3 0 - 0x8C100104, // 001B GETMET R4 R0 K4 - 0x60180009, // 001C GETGBL R6 G9 - 0x5C1C0600, // 001D MOVE R7 R3 - 0x7C180200, // 001E CALL R6 1 - 0x541E0003, // 001F LDINT R7 4 - 0x7C100600, // 0020 CALL R4 3 - 0x7001FFF6, // 0021 JMP #0019 - 0x58080005, // 0022 LDCONST R2 K5 - 0xAC080200, // 0023 CATCH R2 1 0 - 0xB0080000, // 0024 RAISE 2 R0 R0 - 0x80000000, // 0025 RET 0 + 0x08100904, // 0012 MUL R4 R4 K4 + 0x7C080400, // 0013 CALL R2 2 + 0x60080010, // 0014 GETGBL R2 G16 + 0x5C0C0200, // 0015 MOVE R3 R1 + 0x7C080200, // 0016 CALL R2 1 + 0xA8020008, // 0017 EXBLK 0 #0021 + 0x5C0C0400, // 0018 MOVE R3 R2 + 0x7C0C0000, // 0019 CALL R3 0 + 0x8C100105, // 001A GETMET R4 R0 K5 + 0x60180009, // 001B GETGBL R6 G9 + 0x5C1C0600, // 001C MOVE R7 R3 + 0x7C180200, // 001D CALL R6 1 + 0x581C0004, // 001E LDCONST R7 K4 + 0x7C100600, // 001F CALL R4 3 + 0x7001FFF6, // 0020 JMP #0018 + 0x58080006, // 0021 LDCONST R2 K6 + 0xAC080200, // 0022 CATCH R2 1 0 + 0xB0080000, // 0023 RAISE 2 R0 R0 + 0x80000000, // 0024 RET 0 }) ) ); @@ -482,19 +356,142 @@ be_local_closure(class_lv_style_prop_arr_init, /* name */ /******************************************************************** -** Solidified class: lv_style_prop_arr +** Solidified function: item +********************************************************************/ +be_local_closure(class_lv_color_arr_item, /* name */ + be_nested_proto( + 8, /* nstack */ + 2, /* argc */ + 10, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + &be_ktab_class_lv_color_arr, /* shared constants */ + be_str_weak(item), + &be_const_str_solidified, + ( &(const binstruction[ 8]) { /* code */ + 0xB80A0E00, // 0000 GETNGBL R2 K7 + 0x8C080508, // 0001 GETMET R2 R2 K8 + 0x8C100109, // 0002 GETMET R4 R0 K9 + 0x08180304, // 0003 MUL R6 R1 K4 + 0x581C0004, // 0004 LDCONST R7 K4 + 0x7C100600, // 0005 CALL R4 3 + 0x7C080400, // 0006 CALL R2 2 + 0x80040400, // 0007 RET 1 R2 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: setitem +********************************************************************/ +be_local_closure(class_lv_color_arr_setitem, /* name */ + be_nested_proto( + 8, /* nstack */ + 3, /* argc */ + 10, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + &be_ktab_class_lv_color_arr, /* shared constants */ + be_str_weak(setitem), + &be_const_str_solidified, + ( &(const binstruction[ 8]) { /* code */ + 0x8C0C010A, // 0000 GETMET R3 R0 K10 + 0x08140304, // 0001 MUL R5 R1 K4 + 0x60180009, // 0002 GETGBL R6 G9 + 0x5C1C0400, // 0003 MOVE R7 R2 + 0x7C180200, // 0004 CALL R6 1 + 0x581C0004, // 0005 LDCONST R7 K4 + 0x7C0C0800, // 0006 CALL R3 4 + 0x80000000, // 0007 RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified class: lv_color_arr ********************************************************************/ extern const bclass be_class_bytes; -be_local_class(lv_style_prop_arr, +be_local_class(lv_color_arr, 0, &be_class_bytes, - be_nested_map(1, + be_nested_map(3, ( (struct bmapnode*) &(const bmapnode[]) { - { be_const_key_weak(init, -1), be_const_closure(class_lv_style_prop_arr_init_closure) }, + { be_const_key_weak(init, -1), be_const_closure(class_lv_color_arr_init_closure) }, + { be_const_key_weak(item, -1), be_const_closure(class_lv_color_arr_item_closure) }, + { be_const_key_weak(setitem, -1), be_const_closure(class_lv_color_arr_setitem_closure) }, })), - be_str_weak(lv_style_prop_arr) + be_str_weak(lv_color_arr) ); +/******************************************************************** +** Solidified function: _anonymous_ +********************************************************************/ +be_local_closure(_anonymous_, /* name */ + be_nested_proto( + 4, /* nstack */ + 1, /* argc */ + 0, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[14]) { /* constants */ + /* K0 */ be_nested_str_weak(global), + /* K1 */ be_nested_str_weak(lv), + /* K2 */ be_nested_str_weak(lv_coord_arr), + /* K3 */ be_nested_str_weak(lv_int_arr), + /* K4 */ be_nested_str_weak(lv_point_arr), + /* K5 */ be_nested_str_weak(coord_arr), + /* K6 */ be_nested_str_weak(int_arr), + /* K7 */ be_nested_str_weak(point_arr), + /* K8 */ be_nested_str_weak(style_prop_arr), + /* K9 */ be_nested_str_weak(lv_style_prop_arr), + /* K10 */ be_nested_str_weak(str_arr), + /* K11 */ be_nested_str_weak(lv_str_arr), + /* K12 */ be_nested_str_weak(color_arr), + /* K13 */ be_nested_str_weak(lv_color_arr), + }), + be_str_weak(_anonymous_), + &be_const_str_solidified, + ( &(const binstruction[21]) { /* code */ + 0xA4060000, // 0000 IMPORT R1 K0 + 0x88080301, // 0001 GETMBR R2 R1 K1 + 0x880C0102, // 0002 GETMBR R3 R0 K2 + 0x900A0403, // 0003 SETMBR R2 K2 R3 + 0x880C0103, // 0004 GETMBR R3 R0 K3 + 0x900A0603, // 0005 SETMBR R2 K3 R3 + 0x880C0104, // 0006 GETMBR R3 R0 K4 + 0x900A0803, // 0007 SETMBR R2 K4 R3 + 0x880C0102, // 0008 GETMBR R3 R0 K2 + 0x900A0A03, // 0009 SETMBR R2 K5 R3 + 0x880C0103, // 000A GETMBR R3 R0 K3 + 0x900A0C03, // 000B SETMBR R2 K6 R3 + 0x880C0104, // 000C GETMBR R3 R0 K4 + 0x900A0E03, // 000D SETMBR R2 K7 R3 + 0x880C0109, // 000E GETMBR R3 R0 K9 + 0x900A1003, // 000F SETMBR R2 K8 R3 + 0x880C010B, // 0010 GETMBR R3 R0 K11 + 0x900A1403, // 0011 SETMBR R2 K10 R3 + 0x880C010D, // 0012 GETMBR R3 R0 K13 + 0x900A1803, // 0013 SETMBR R2 K12 R3 + 0x80040000, // 0014 RET 1 R0 + }) + ) +); +/*******************************************************************/ + + extern const bclass be_class_lv_coord_arr; /******************************************************************** @@ -666,19 +663,179 @@ be_local_class(lv_coord_arr, be_str_weak(lv_coord_arr) ); +extern const bclass be_class_lv_style_prop_arr; + +/******************************************************************** +** Solidified function: init +********************************************************************/ +be_local_closure(class_lv_style_prop_arr_init, /* name */ + be_nested_proto( + 8, /* nstack */ + 2, /* argc */ + 2, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[ 6]) { /* constants */ + /* K0 */ be_nested_str_weak(instance), + /* K1 */ be_nested_str_weak(value_error), + /* K2 */ be_nested_str_weak(argument_X20must_X20be_X20a_X20list), + /* K3 */ be_nested_str_weak(init), + /* K4 */ be_nested_str_weak(add), + /* K5 */ be_nested_str_weak(stop_iteration), + }), + be_str_weak(init), + &be_const_str_solidified, + ( &(const binstruction[35]) { /* code */ + 0x60080004, // 0000 GETGBL R2 G4 + 0x5C0C0200, // 0001 MOVE R3 R1 + 0x7C080200, // 0002 CALL R2 1 + 0x20080500, // 0003 NE R2 R2 K0 + 0x740A0004, // 0004 JMPT R2 #000A + 0x6008000F, // 0005 GETGBL R2 G15 + 0x5C0C0200, // 0006 MOVE R3 R1 + 0x60100012, // 0007 GETGBL R4 G18 + 0x7C080400, // 0008 CALL R2 2 + 0x740A0000, // 0009 JMPT R2 #000B + 0xB0060302, // 000A RAISE 1 K1 K2 + 0x60080003, // 000B GETGBL R2 G3 + 0x5C0C0000, // 000C MOVE R3 R0 + 0x7C080200, // 000D CALL R2 1 + 0x8C080503, // 000E GETMET R2 R2 K3 + 0x6010000C, // 000F GETGBL R4 G12 + 0x5C140200, // 0010 MOVE R5 R1 + 0x7C100200, // 0011 CALL R4 1 + 0x7C080400, // 0012 CALL R2 2 + 0x60080010, // 0013 GETGBL R2 G16 + 0x5C0C0200, // 0014 MOVE R3 R1 + 0x7C080200, // 0015 CALL R2 1 + 0xA8020007, // 0016 EXBLK 0 #001F + 0x5C0C0400, // 0017 MOVE R3 R2 + 0x7C0C0000, // 0018 CALL R3 0 + 0x8C100104, // 0019 GETMET R4 R0 K4 + 0x60180009, // 001A GETGBL R6 G9 + 0x5C1C0600, // 001B MOVE R7 R3 + 0x7C180200, // 001C CALL R6 1 + 0x7C100400, // 001D CALL R4 2 + 0x7001FFF7, // 001E JMP #0017 + 0x58080005, // 001F LDCONST R2 K5 + 0xAC080200, // 0020 CATCH R2 1 0 + 0xB0080000, // 0021 RAISE 2 R0 R0 + 0x80000000, // 0022 RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified class: lv_style_prop_arr +********************************************************************/ +extern const bclass be_class_bytes; +be_local_class(lv_style_prop_arr, + 0, + &be_class_bytes, + be_nested_map(1, + ( (struct bmapnode*) &(const bmapnode[]) { + { be_const_key_weak(init, -1), be_const_closure(class_lv_style_prop_arr_init_closure) }, + })), + be_str_weak(lv_style_prop_arr) +); + +extern const bclass be_class_lv_str_arr; + +/******************************************************************** +** Solidified function: init +********************************************************************/ +be_local_closure(class_lv_str_arr_init, /* name */ + be_nested_proto( + 11, /* nstack */ + 2, /* argc */ + 2, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[ 6]) { /* constants */ + /* K0 */ be_nested_str_weak(l), + /* K1 */ be_nested_str_weak(init), + /* K2 */ be_nested_str_weak(introspect), + /* K3 */ be_nested_str_weak(add), + /* K4 */ be_nested_str_weak(toptr), + /* K5 */ be_nested_str_weak(stop_iteration), + }), + be_str_weak(init), + &be_const_str_solidified, + ( &(const binstruction[31]) { /* code */ + 0x90020001, // 0000 SETMBR R0 K0 R1 + 0x60080003, // 0001 GETGBL R2 G3 + 0x5C0C0000, // 0002 MOVE R3 R0 + 0x7C080200, // 0003 CALL R2 1 + 0x8C080501, // 0004 GETMET R2 R2 K1 + 0x6010000C, // 0005 GETGBL R4 G12 + 0x5C140200, // 0006 MOVE R5 R1 + 0x7C100200, // 0007 CALL R4 1 + 0x54160003, // 0008 LDINT R5 4 + 0x08100805, // 0009 MUL R4 R4 R5 + 0x7C080400, // 000A CALL R2 2 + 0xA40A0400, // 000B IMPORT R2 K2 + 0x600C0010, // 000C GETGBL R3 G16 + 0x5C100200, // 000D MOVE R4 R1 + 0x7C0C0200, // 000E CALL R3 1 + 0xA802000A, // 000F EXBLK 0 #001B + 0x5C100600, // 0010 MOVE R4 R3 + 0x7C100000, // 0011 CALL R4 0 + 0x8C140103, // 0012 GETMET R5 R0 K3 + 0x601C0009, // 0013 GETGBL R7 G9 + 0x8C200504, // 0014 GETMET R8 R2 K4 + 0x5C280800, // 0015 MOVE R10 R4 + 0x7C200400, // 0016 CALL R8 2 + 0x7C1C0200, // 0017 CALL R7 1 + 0x54220003, // 0018 LDINT R8 4 + 0x7C140600, // 0019 CALL R5 3 + 0x7001FFF4, // 001A JMP #0010 + 0x580C0005, // 001B LDCONST R3 K5 + 0xAC0C0200, // 001C CATCH R3 1 0 + 0xB0080000, // 001D RAISE 2 R0 R0 + 0x80000000, // 001E RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified class: lv_str_arr +********************************************************************/ +extern const bclass be_class_bytes; +be_local_class(lv_str_arr, + 1, + &be_class_bytes, + be_nested_map(2, + ( (struct bmapnode*) &(const bmapnode[]) { + { be_const_key_weak(init, -1), be_const_closure(class_lv_str_arr_init_closure) }, + { be_const_key_weak(l, 0), be_const_var(0) }, + })), + be_str_weak(lv_str_arr) +); + /******************************************************************** ** Solidified module: lv_extra ********************************************************************/ be_local_module(lv_extra, "lv_extra", - be_nested_map(6, + be_nested_map(7, ( (struct bmapnode*) &(const bmapnode[]) { - { be_const_key_weak(lv_coord_arr, 4), be_const_class(be_class_lv_coord_arr) }, - { be_const_key_weak(lv_int_arr, -1), be_const_class(be_class_lv_int_arr) }, + { be_const_key_weak(lv_style_prop_arr, 4), be_const_class(be_class_lv_style_prop_arr) }, + { be_const_key_weak(lv_str_arr, -1), be_const_class(be_class_lv_str_arr) }, + { be_const_key_weak(lv_coord_arr, -1), be_const_class(be_class_lv_coord_arr) }, + { be_const_key_weak(lv_int_arr, 0), be_const_class(be_class_lv_int_arr) }, { be_const_key_weak(lv_point_arr, -1), be_const_class(be_class_lv_point_arr) }, { be_const_key_weak(init, -1), be_const_closure(_anonymous__closure) }, - { be_const_key_weak(lv_style_prop_arr, -1), be_const_class(be_class_lv_style_prop_arr) }, - { be_const_key_weak(lv_str_arr, 0), be_const_class(be_class_lv_str_arr) }, + { be_const_key_weak(lv_color_arr, 2), be_const_class(be_class_lv_color_arr) }, })) ); BE_EXPORT_VARIABLE be_define_const_native_module(lv_extra); diff --git a/lib/libesp32_lvgl/lv_binding_berry/tools/convert.py b/lib/libesp32_lvgl/lv_binding_berry/tools/convert.py index 9558c1df0..9e89498d5 100644 --- a/lib/libesp32_lvgl/lv_binding_berry/tools/convert.py +++ b/lib/libesp32_lvgl/lv_binding_berry/tools/convert.py @@ -383,6 +383,7 @@ class type_mapper_class: "int32_t *": "lv_int_arr", "int32_t []": "lv_int_arr", "uint32_t *": "lv_int_arr", + "lv_color_t *": "lv_color_arr", # "float *": "lv_float_arr", # layouts "lv_flex_align_t": "i", diff --git a/lib/libesp32_lvgl/lv_haspmota/src/embedded/lv_haspmota.be b/lib/libesp32_lvgl/lv_haspmota/src/embedded/lv_haspmota.be index 6c4a1f3cf..b67e38824 100644 --- a/lib/libesp32_lvgl/lv_haspmota/src/embedded/lv_haspmota.be +++ b/lib/libesp32_lvgl/lv_haspmota/src/embedded/lv_haspmota.be @@ -2360,6 +2360,7 @@ class lvh_chart : lvh_obj var _ser1, _ser2 # y_min/y_max contain the main range for y. Since LVGL does not have getters, we need to memorize on our side the lates tvalues var _y_min, _y_max + var _y2_min, _y2_max # h_div/v_div contain the horizontal and vertical divisions, we need to memorize values because both are set from same API var _h_div, _v_div @@ -2367,6 +2368,8 @@ class lvh_chart : lvh_obj # default values from LVGL are 0..100 self._y_min = 0 self._y_max = 100 + self._y2_min = 0 + self._y2_max = 100 # default values #define LV_CHART_HDIV_DEF 3 #define LV_CHART_VDIV_DEF 5 @@ -2376,7 +2379,7 @@ class lvh_chart : lvh_obj self._lv_obj.set_update_mode(lv.CHART_UPDATE_MODE_SHIFT) self._ser1 = self._lv_obj.add_series(lv.color(0xEE4444), lv.CHART_AXIS_PRIMARY_Y) - self._ser2 = self._lv_obj.add_series(lv.color(0x44EE44), lv.CHART_AXIS_PRIMARY_Y) + self._ser2 = self._lv_obj.add_series(lv.color(0x44EE44), lv.CHART_AXIS_SECONDARY_Y) end def add_point(v) @@ -2399,6 +2402,12 @@ class lvh_chart : lvh_obj def get_y_max() return self._y_max end + def get_y2_min() + return self._y2_min + end + def get_y2_max() + return self._y2_max + end def set_y_min(_y_min) self._y_min = _y_min self._lv_obj.set_range(lv.CHART_AXIS_PRIMARY_Y, self._y_min, self._y_max) @@ -2407,6 +2416,14 @@ class lvh_chart : lvh_obj self._y_max = _y_max self._lv_obj.set_range(lv.CHART_AXIS_PRIMARY_Y, self._y_min, self._y_max) end + def set_y2_min(_y2_min) + self._y2_min = _y2_min + self._lv_obj.set_range(lv.CHART_AXIS_SECONDARY_Y, self._y2_min, self._y2_max) + end + def set_y2_max(_y2_max) + self._y2_max = _y2_max + self._lv_obj.set_range(lv.CHART_AXIS_SECONDARY_Y, self._y2_min, self._y2_max) + end def set_series1_color(color) self._lv_obj.set_series_color(self._ser1, self.parse_color(color)) @@ -2601,8 +2618,6 @@ class lvh_page self._lv_scr = lv.layer_top() # top layer, visible over all screens else self._lv_scr = lv.obj(0) # allocate a new screen - var bg_color = lv.scr_act().get_style_bg_color(0 #- lv.PART_MAIN | lv.STATE_DEFAULT -#) # bg_color of default screen - self._lv_scr.set_style_bg_color(bg_color, 0 #- lv.PART_MAIN | lv.STATE_DEFAULT -#) # set white background end # page object is also stored in the object map at id `0` as instance of `lvg_scr` @@ -2784,10 +2799,10 @@ end # main class controller, meant to be a singleton and the only externally used class class HASPmota - var dark # (bool) use dark theme? + var started # (bool) is HASPmota already started? var hres, vres # (int) resolution var scr # (lv_obj) default LVGL screen - var r16 # (lv_font) robotocondensed fonts size 16 + var r12, r16, r24 # (lv_font) robotocondensed fonts size 12, 16 and 24 # haspmota objects var lvh_pages # (list of lvg_page) list of pages var lvh_page_cur_idx # (int) current page index number @@ -2840,12 +2855,12 @@ class HASPmota # special cases static lvh_chart = lvh_chart - static def_templ_name = "pages.jsonl" # default template name + static var PAGES_JSONL = "pages.jsonl" # default template name def init() self.fix_lv_version() import re - self.re_page_target = re.compile("p\\d+") + self.re_page_target = re.compilebytes("p\\d+") # nothing to put here up to now end @@ -2860,35 +2875,72 @@ class HASPmota #==================================================================== # init # - # arg1: (bool) use dark theme if `true` + # Opt1: no arguments + # load "pages.jsonl" + # Opt2: + # arg1: (string) use it as template name + # + # Opt3: + # arg1: (bool) set dark mode (deprecated) + # arg2: (string) use it as template name # - # implicitly loads `pages.jsonl` from file-system // TODO allow to specicify file name #==================================================================== - def start(dark, templ_name) + def start(arg1, arg2) + if (self.started) return end + + var templ_name + if type(arg1) == 'string' + templ_name = arg1 + elif type(arg2) == 'string' + templ_name = arg2 + else + templ_name = self.PAGES_JSONL # use default PAGES.JSONL + end + import path - if templ_name == nil templ_name = self.def_templ_name end if !path.exists(templ_name) raise "io_erorr", "file '" + templ_name + "' not found" end # start lv if not already started. It does no harm to call lv.start() if LVGL was already started lv.start() - self.dark = bool(dark) - self.hres = lv.get_hor_res() # ex: 320 self.vres = lv.get_ver_res() # ex: 240 self.scr = lv.scr_act() # LVGL default screean object + try + self.r12 = lv.font_embedded("robotocondensed", 12) # TODO what if does not exist + except .. + self.r12 = lv.font_embedded("montserrat", 10) # TODO what if does not exist + end try self.r16 = lv.font_embedded("robotocondensed", 16) # TODO what if does not exist except .. self.r16 = lv.font_embedded("montserrat", 14) # TODO what if does not exist end + try + self.r24 = lv.font_embedded("robotocondensed", 24) # TODO what if does not exist + except .. + self.r24 = lv.font_embedded("montserrat", 20) # TODO what if does not exist + end # set the theme for HASPmota - var th2 = lv.theme_haspmota_init(0, lv.color(0xFF00FF), lv.color(0x303030), self.dark, self.r16) + var primary_color = self.lvh_root.parse_color(tasmota.webcolor(10 #-COL_BUTTON-#)) + var secondary_color = self.lvh_root.parse_color(tasmota.webcolor(11 #-COL_BUTTON_HOVER-#)) + var color_scr = self.lvh_root.parse_color(tasmota.webcolor(1 #-COL_BACKGROUND-#)) + var color_text = self.lvh_root.parse_color(tasmota.webcolor(9 #-COL_BUTTON_TEXT-#)) + var color_card = self.lvh_root.parse_color(tasmota.webcolor(2 #-COL_FORM-#)) + var color_grey = self.lvh_root.parse_color(tasmota.webcolor(2 #-COL_FORM-#)) + var color_reset = self.lvh_root.parse_color(tasmota.webcolor(12 #-COL_BUTTON_RESET-#)) + var color_reset_hover = self.lvh_root.parse_color(tasmota.webcolor(13 #-COL_BUTTON_RESET_HOVER-#)) + var color_save = self.lvh_root.parse_color(tasmota.webcolor(14 #-COL_BUTTON_SAVE-#)) + var color_save_hover = self.lvh_root.parse_color(tasmota.webcolor(15 #-COL_BUTTON_SAVE_HOVER-#)) + var colors = lv.color_arr([primary_color, secondary_color, color_scr, color_text, color_card, color_grey, + color_reset, color_reset_hover, color_save, color_save_hover]) + + var th2 = lv.theme_haspmota_init(0, colors, + self.r12, self.r16, self.r24) self.scr.get_disp().set_theme(th2) - self.scr.set_style_bg_color(self.dark ? lv.color(0x000000) : lv.color(0xFFFFFF),0) # set background to white # apply theme to layer_top, but keep it transparent lv.theme_apply(lv.layer_top()) lv.layer_top().set_style_bg_opa(0,0) @@ -2896,6 +2948,7 @@ class HASPmota self.lvh_pages = {} # load from JSONL self._load(templ_name) + self.started = true end ################################################################################# @@ -2948,21 +3001,20 @@ class HASPmota import string import json - var f = open(templ_name,"r") - var f_content = f.read() - f.close() - - var jsonl = string.split(f_content, "\n") - f = nil # allow deallocation - f_content = nil - + var f = open(templ_name) # parse each line - while size(jsonl) > 0 - var jline = json.load(jsonl[0]) + while f.tell() < f.size() # while we're not at the end of the file + var line = f.readline() + # if size is '1', the line is considered as empty because it's a '\n' character + if (size(line) <= 1) || (line[0] == '#') # skip empty lines and lines starting with '#' + continue + end + + var jline = json.load(line) if type(jline) == 'instance' if tasmota.loglevel(4) - tasmota.log(f"HSP: parsing line '{jsonl[0]}'", 4) + tasmota.log(f"HSP: parsing line '{line}'", 4) end self.parse_page(jline) # parse page first to create any page related objects, may change self.lvh_page_cur_idx_parsing # objects are created in the current page @@ -2972,14 +3024,13 @@ class HASPmota self.parse_obj(jline, self.lvh_pages[self.lvh_page_cur_idx_parsing]) # then parse object within this page else # check if it's invalid json - if size(string.tr(jsonl[0], " \t", "")) > 0 - tasmota.log(f"HSP: invalid JSON line '{jsonl[0]}'", 2) + if size(string.tr(line, " \t", "")) > 0 + tasmota.log(f"HSP: invalid JSON line '{line}'", 2) end end jline = nil - jsonl.remove(0) end - jsonl = nil # make all of it freeable + f.close() # current page is always 1 when we start var pages_sorted = self.pages_list_sorted(nil) # nil for full list @@ -3094,6 +3145,7 @@ class HASPmota # Returns: the target page object if changed, or `nil` if still on same page #==================================================================== def page_show(action, anim, duration) + import re # resolve between page numbers # p1 is either a number or nil (stored value) # p2 is the default value @@ -3129,7 +3181,7 @@ class HASPmota if (to_page == cur_page.id()) to_page = to_page_resolve(int(cur_page.next), sorted_pages_list[1], sorted_pages_list) end - elif self.re_page_target.match(action) + elif re.match(self.re_page_target, action) # action is supposed to be `p` format to_page = to_page_resolve(int(action[1..-1]), nil #-default to nil-#, sorted_pages_list) end diff --git a/lib/libesp32_lvgl/lv_haspmota/src/solidify/solidified_lv_haspmota.h b/lib/libesp32_lvgl/lv_haspmota/src/solidify/solidified_lv_haspmota.h index 52f67557f..e6dab9c53 100644 --- a/lib/libesp32_lvgl/lv_haspmota/src/solidify/solidified_lv_haspmota.h +++ b/lib/libesp32_lvgl/lv_haspmota/src/solidify/solidified_lv_haspmota.h @@ -10069,119 +10069,41 @@ be_local_class(lvh_tab, })), be_str_weak(lvh_tab) ); -// compact class 'lvh_chart' ktab size: 25, total: 56 (saved 248 bytes) -static const bvalue be_ktab_class_lvh_chart[25] = { +// compact class 'lvh_chart' ktab size: 28, total: 73 (saved 360 bytes) +static const bvalue be_ktab_class_lvh_chart[28] = { /* K0 */ be_nested_str_weak(_y_min), /* K1 */ be_nested_str_weak(_lv_obj), - /* K2 */ be_nested_str_weak(set_next_value), - /* K3 */ be_nested_str_weak(_ser1), - /* K4 */ be_nested_str_weak(add_point2), - /* K5 */ be_nested_str_weak(set_range), - /* K6 */ be_nested_str_weak(lv), - /* K7 */ be_nested_str_weak(CHART_AXIS_PRIMARY_Y), - /* K8 */ be_nested_str_weak(_y_max), - /* K9 */ be_nested_str_weak(_ser2), - /* K10 */ be_nested_str_weak(set_series_color), - /* K11 */ be_nested_str_weak(parse_color), - /* K12 */ be_const_int(0), - /* K13 */ be_nested_str_weak(_h_div), - /* K14 */ be_const_int(3), - /* K15 */ be_nested_str_weak(_v_div), - /* K16 */ be_nested_str_weak(set_update_mode), - /* K17 */ be_nested_str_weak(CHART_UPDATE_MODE_SHIFT), - /* K18 */ be_nested_str_weak(add_series), - /* K19 */ be_nested_str_weak(color), - /* K20 */ be_const_int(15615044), - /* K21 */ be_const_int(4517444), - /* K22 */ be_nested_str_weak(_val), - /* K23 */ be_nested_str_weak(add_point), + /* K2 */ be_nested_str_weak(set_range), + /* K3 */ be_nested_str_weak(lv), + /* K4 */ be_nested_str_weak(CHART_AXIS_PRIMARY_Y), + /* K5 */ be_nested_str_weak(_y_max), + /* K6 */ be_nested_str_weak(set_next_value), + /* K7 */ be_nested_str_weak(_ser2), + /* K8 */ be_nested_str_weak(set_series_color), + /* K9 */ be_nested_str_weak(_ser1), + /* K10 */ be_nested_str_weak(parse_color), + /* K11 */ be_nested_str_weak(_y2_max), + /* K12 */ be_nested_str_weak(CHART_AXIS_SECONDARY_Y), + /* K13 */ be_nested_str_weak(_y2_min), + /* K14 */ be_const_int(0), + /* K15 */ be_nested_str_weak(_h_div), + /* K16 */ be_const_int(3), + /* K17 */ be_nested_str_weak(_v_div), + /* K18 */ be_nested_str_weak(set_update_mode), + /* K19 */ be_nested_str_weak(CHART_UPDATE_MODE_SHIFT), + /* K20 */ be_nested_str_weak(add_series), + /* K21 */ be_nested_str_weak(color), + /* K22 */ be_const_int(15615044), + /* K23 */ be_const_int(4517444), /* K24 */ be_nested_str_weak(set_div_line_count), + /* K25 */ be_nested_str_weak(add_point2), + /* K26 */ be_nested_str_weak(_val), + /* K27 */ be_nested_str_weak(add_point), }; extern const bclass be_class_lvh_chart; -/******************************************************************** -** Solidified function: get_y_min -********************************************************************/ -be_local_closure(class_lvh_chart_get_y_min, /* name */ - be_nested_proto( - 2, /* nstack */ - 1, /* argc */ - 10, /* varg */ - 0, /* has upvals */ - NULL, /* no upvals */ - 0, /* has sup protos */ - NULL, /* no sub protos */ - 1, /* has constants */ - &be_ktab_class_lvh_chart, /* shared constants */ - be_str_weak(get_y_min), - &be_const_str_solidified, - ( &(const binstruction[ 2]) { /* code */ - 0x88040100, // 0000 GETMBR R1 R0 K0 - 0x80040200, // 0001 RET 1 R1 - }) - ) -); -/*******************************************************************/ - - -/******************************************************************** -** Solidified function: add_point -********************************************************************/ -be_local_closure(class_lvh_chart_add_point, /* name */ - be_nested_proto( - 6, /* nstack */ - 2, /* argc */ - 10, /* varg */ - 0, /* has upvals */ - NULL, /* no upvals */ - 0, /* has sup protos */ - NULL, /* no sub protos */ - 1, /* has constants */ - &be_ktab_class_lvh_chart, /* shared constants */ - be_str_weak(add_point), - &be_const_str_solidified, - ( &(const binstruction[ 6]) { /* code */ - 0x88080101, // 0000 GETMBR R2 R0 K1 - 0x8C080502, // 0001 GETMET R2 R2 K2 - 0x88100103, // 0002 GETMBR R4 R0 K3 - 0x5C140200, // 0003 MOVE R5 R1 - 0x7C080600, // 0004 CALL R2 3 - 0x80000000, // 0005 RET 0 - }) - ) -); -/*******************************************************************/ - - -/******************************************************************** -** Solidified function: set_val2 -********************************************************************/ -be_local_closure(class_lvh_chart_set_val2, /* name */ - be_nested_proto( - 5, /* nstack */ - 2, /* argc */ - 10, /* varg */ - 0, /* has upvals */ - NULL, /* no upvals */ - 0, /* has sup protos */ - NULL, /* no sub protos */ - 1, /* has constants */ - &be_ktab_class_lvh_chart, /* shared constants */ - be_str_weak(set_val2), - &be_const_str_solidified, - ( &(const binstruction[ 4]) { /* code */ - 0x8C080104, // 0000 GETMET R2 R0 K4 - 0x5C100200, // 0001 MOVE R4 R1 - 0x7C080400, // 0002 CALL R2 2 - 0x80000000, // 0003 RET 0 - }) - ) -); -/*******************************************************************/ - - /******************************************************************** ** Solidified function: set_y_min ********************************************************************/ @@ -10201,11 +10123,11 @@ be_local_closure(class_lvh_chart_set_y_min, /* name */ ( &(const binstruction[ 9]) { /* code */ 0x90020001, // 0000 SETMBR R0 K0 R1 0x88080101, // 0001 GETMBR R2 R0 K1 - 0x8C080505, // 0002 GETMET R2 R2 K5 - 0xB8120C00, // 0003 GETNGBL R4 K6 - 0x88100907, // 0004 GETMBR R4 R4 K7 + 0x8C080502, // 0002 GETMET R2 R2 K2 + 0xB8120600, // 0003 GETNGBL R4 K3 + 0x88100904, // 0004 GETMBR R4 R4 K4 0x88140100, // 0005 GETMBR R5 R0 K0 - 0x88180108, // 0006 GETMBR R6 R0 K8 + 0x88180105, // 0006 GETMBR R6 R0 K5 0x7C080800, // 0007 CALL R2 4 0x80000000, // 0008 RET 0 }) @@ -10232,8 +10154,8 @@ be_local_closure(class_lvh_chart_add_point2, /* name */ &be_const_str_solidified, ( &(const binstruction[ 6]) { /* code */ 0x88080101, // 0000 GETMBR R2 R0 K1 - 0x8C080502, // 0001 GETMET R2 R2 K2 - 0x88100109, // 0002 GETMBR R4 R0 K9 + 0x8C080506, // 0001 GETMET R2 R2 K6 + 0x88100107, // 0002 GETMBR R4 R0 K7 0x5C140200, // 0003 MOVE R5 R1 0x7C080600, // 0004 CALL R2 3 0x80000000, // 0005 RET 0 @@ -10261,40 +10183,9 @@ be_local_closure(class_lvh_chart_set_series1_color, /* name */ &be_const_str_solidified, ( &(const binstruction[ 8]) { /* code */ 0x88080101, // 0000 GETMBR R2 R0 K1 - 0x8C08050A, // 0001 GETMET R2 R2 K10 - 0x88100103, // 0002 GETMBR R4 R0 K3 - 0x8C14010B, // 0003 GETMET R5 R0 K11 - 0x5C1C0200, // 0004 MOVE R7 R1 - 0x7C140400, // 0005 CALL R5 2 - 0x7C080600, // 0006 CALL R2 3 - 0x80000000, // 0007 RET 0 - }) - ) -); -/*******************************************************************/ - - -/******************************************************************** -** Solidified function: set_series2_color -********************************************************************/ -be_local_closure(class_lvh_chart_set_series2_color, /* name */ - be_nested_proto( - 8, /* nstack */ - 2, /* argc */ - 10, /* varg */ - 0, /* has upvals */ - NULL, /* no upvals */ - 0, /* has sup protos */ - NULL, /* no sub protos */ - 1, /* has constants */ - &be_ktab_class_lvh_chart, /* shared constants */ - be_str_weak(set_series2_color), - &be_const_str_solidified, - ( &(const binstruction[ 8]) { /* code */ - 0x88080101, // 0000 GETMBR R2 R0 K1 - 0x8C08050A, // 0001 GETMET R2 R2 K10 + 0x8C080508, // 0001 GETMET R2 R2 K8 0x88100109, // 0002 GETMBR R4 R0 K9 - 0x8C14010B, // 0003 GETMET R5 R0 K11 + 0x8C14010A, // 0003 GETMET R5 R0 K10 0x5C1C0200, // 0004 MOVE R7 R1 0x7C140400, // 0005 CALL R5 2 0x7C080600, // 0006 CALL R2 3 @@ -10322,13 +10213,13 @@ be_local_closure(class_lvh_chart_set_y_max, /* name */ be_str_weak(set_y_max), &be_const_str_solidified, ( &(const binstruction[ 9]) { /* code */ - 0x90021001, // 0000 SETMBR R0 K8 R1 + 0x90020A01, // 0000 SETMBR R0 K5 R1 0x88080101, // 0001 GETMBR R2 R0 K1 - 0x8C080505, // 0002 GETMET R2 R2 K5 - 0xB8120C00, // 0003 GETNGBL R4 K6 - 0x88100907, // 0004 GETMBR R4 R4 K7 + 0x8C080502, // 0002 GETMET R2 R2 K2 + 0xB8120600, // 0003 GETNGBL R4 K3 + 0x88100904, // 0004 GETMBR R4 R4 K4 0x88140100, // 0005 GETMBR R5 R0 K0 - 0x88180108, // 0006 GETMBR R6 R0 K8 + 0x88180105, // 0006 GETMBR R6 R0 K5 0x7C080800, // 0007 CALL R2 4 0x80000000, // 0008 RET 0 }) @@ -10337,6 +10228,63 @@ be_local_closure(class_lvh_chart_set_y_max, /* name */ /*******************************************************************/ +/******************************************************************** +** Solidified function: set_y2_max +********************************************************************/ +be_local_closure(class_lvh_chart_set_y2_max, /* name */ + be_nested_proto( + 7, /* nstack */ + 2, /* argc */ + 10, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + &be_ktab_class_lvh_chart, /* shared constants */ + be_str_weak(set_y2_max), + &be_const_str_solidified, + ( &(const binstruction[ 9]) { /* code */ + 0x90021601, // 0000 SETMBR R0 K11 R1 + 0x88080101, // 0001 GETMBR R2 R0 K1 + 0x8C080502, // 0002 GETMET R2 R2 K2 + 0xB8120600, // 0003 GETNGBL R4 K3 + 0x8810090C, // 0004 GETMBR R4 R4 K12 + 0x8814010D, // 0005 GETMBR R5 R0 K13 + 0x8818010B, // 0006 GETMBR R6 R0 K11 + 0x7C080800, // 0007 CALL R2 4 + 0x80000000, // 0008 RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: get_y_min +********************************************************************/ +be_local_closure(class_lvh_chart_get_y_min, /* name */ + be_nested_proto( + 2, /* nstack */ + 1, /* argc */ + 10, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + &be_ktab_class_lvh_chart, /* shared constants */ + be_str_weak(get_y_min), + &be_const_str_solidified, + ( &(const binstruction[ 2]) { /* code */ + 0x88040100, // 0000 GETMBR R1 R0 K0 + 0x80040200, // 0001 RET 1 R1 + }) + ) +); +/*******************************************************************/ + + /******************************************************************** ** Solidified function: post_init ********************************************************************/ @@ -10353,39 +10301,42 @@ be_local_closure(class_lvh_chart_post_init, /* name */ &be_ktab_class_lvh_chart, /* shared constants */ be_str_weak(post_init), &be_const_str_solidified, - ( &(const binstruction[32]) { /* code */ - 0x9002010C, // 0000 SETMBR R0 K0 K12 + ( &(const binstruction[35]) { /* code */ + 0x9002010E, // 0000 SETMBR R0 K0 K14 0x54060063, // 0001 LDINT R1 100 - 0x90021001, // 0002 SETMBR R0 K8 R1 + 0x90020A01, // 0002 SETMBR R0 K5 R1 0x90021B0E, // 0003 SETMBR R0 K13 K14 - 0x54060004, // 0004 LDINT R1 5 - 0x90021E01, // 0005 SETMBR R0 K15 R1 - 0x88040101, // 0006 GETMBR R1 R0 K1 - 0x8C040310, // 0007 GETMET R1 R1 K16 - 0xB80E0C00, // 0008 GETNGBL R3 K6 - 0x880C0711, // 0009 GETMBR R3 R3 K17 - 0x7C040400, // 000A CALL R1 2 - 0x88040101, // 000B GETMBR R1 R0 K1 - 0x8C040312, // 000C GETMET R1 R1 K18 - 0xB80E0C00, // 000D GETNGBL R3 K6 - 0x8C0C0713, // 000E GETMET R3 R3 K19 - 0x58140014, // 000F LDCONST R5 K20 - 0x7C0C0400, // 0010 CALL R3 2 - 0xB8120C00, // 0011 GETNGBL R4 K6 - 0x88100907, // 0012 GETMBR R4 R4 K7 - 0x7C040600, // 0013 CALL R1 3 - 0x90020601, // 0014 SETMBR R0 K3 R1 - 0x88040101, // 0015 GETMBR R1 R0 K1 - 0x8C040312, // 0016 GETMET R1 R1 K18 - 0xB80E0C00, // 0017 GETNGBL R3 K6 - 0x8C0C0713, // 0018 GETMET R3 R3 K19 - 0x58140015, // 0019 LDCONST R5 K21 - 0x7C0C0400, // 001A CALL R3 2 - 0xB8120C00, // 001B GETNGBL R4 K6 - 0x88100907, // 001C GETMBR R4 R4 K7 - 0x7C040600, // 001D CALL R1 3 - 0x90021201, // 001E SETMBR R0 K9 R1 - 0x80000000, // 001F RET 0 + 0x54060063, // 0004 LDINT R1 100 + 0x90021601, // 0005 SETMBR R0 K11 R1 + 0x90021F10, // 0006 SETMBR R0 K15 K16 + 0x54060004, // 0007 LDINT R1 5 + 0x90022201, // 0008 SETMBR R0 K17 R1 + 0x88040101, // 0009 GETMBR R1 R0 K1 + 0x8C040312, // 000A GETMET R1 R1 K18 + 0xB80E0600, // 000B GETNGBL R3 K3 + 0x880C0713, // 000C GETMBR R3 R3 K19 + 0x7C040400, // 000D CALL R1 2 + 0x88040101, // 000E GETMBR R1 R0 K1 + 0x8C040314, // 000F GETMET R1 R1 K20 + 0xB80E0600, // 0010 GETNGBL R3 K3 + 0x8C0C0715, // 0011 GETMET R3 R3 K21 + 0x58140016, // 0012 LDCONST R5 K22 + 0x7C0C0400, // 0013 CALL R3 2 + 0xB8120600, // 0014 GETNGBL R4 K3 + 0x88100904, // 0015 GETMBR R4 R4 K4 + 0x7C040600, // 0016 CALL R1 3 + 0x90021201, // 0017 SETMBR R0 K9 R1 + 0x88040101, // 0018 GETMBR R1 R0 K1 + 0x8C040314, // 0019 GETMET R1 R1 K20 + 0xB80E0600, // 001A GETNGBL R3 K3 + 0x8C0C0715, // 001B GETMET R3 R3 K21 + 0x58140017, // 001C LDCONST R5 K23 + 0x7C0C0400, // 001D CALL R3 2 + 0xB8120600, // 001E GETNGBL R4 K3 + 0x8810090C, // 001F GETMBR R4 R4 K12 + 0x7C040600, // 0020 CALL R1 3 + 0x90020E01, // 0021 SETMBR R0 K7 R1 + 0x80000000, // 0022 RET 0 }) ) ); @@ -10393,9 +10344,9 @@ be_local_closure(class_lvh_chart_post_init, /* name */ /******************************************************************** -** Solidified function: get_y_max +** Solidified function: get_y2_min ********************************************************************/ -be_local_closure(class_lvh_chart_get_y_max, /* name */ +be_local_closure(class_lvh_chart_get_y2_min, /* name */ be_nested_proto( 2, /* nstack */ 1, /* argc */ @@ -10406,10 +10357,10 @@ be_local_closure(class_lvh_chart_get_y_max, /* name */ NULL, /* no sub protos */ 1, /* has constants */ &be_ktab_class_lvh_chart, /* shared constants */ - be_str_weak(get_y_max), + be_str_weak(get_y2_min), &be_const_str_solidified, ( &(const binstruction[ 2]) { /* code */ - 0x88040108, // 0000 GETMBR R1 R0 K8 + 0x8804010D, // 0000 GETMBR R1 R0 K13 0x80040200, // 0001 RET 1 R1 }) ) @@ -10418,11 +10369,11 @@ be_local_closure(class_lvh_chart_get_y_max, /* name */ /******************************************************************** -** Solidified function: set_val +** Solidified function: set_series2_color ********************************************************************/ -be_local_closure(class_lvh_chart_set_val, /* name */ +be_local_closure(class_lvh_chart_set_series2_color, /* name */ be_nested_proto( - 5, /* nstack */ + 8, /* nstack */ 2, /* argc */ 10, /* varg */ 0, /* has upvals */ @@ -10431,14 +10382,17 @@ be_local_closure(class_lvh_chart_set_val, /* name */ NULL, /* no sub protos */ 1, /* has constants */ &be_ktab_class_lvh_chart, /* shared constants */ - be_str_weak(set_val), + be_str_weak(set_series2_color), &be_const_str_solidified, - ( &(const binstruction[ 5]) { /* code */ - 0x90022C01, // 0000 SETMBR R0 K22 R1 - 0x8C080117, // 0001 GETMET R2 R0 K23 - 0x5C100200, // 0002 MOVE R4 R1 - 0x7C080400, // 0003 CALL R2 2 - 0x80000000, // 0004 RET 0 + ( &(const binstruction[ 8]) { /* code */ + 0x88080101, // 0000 GETMBR R2 R0 K1 + 0x8C080508, // 0001 GETMET R2 R2 K8 + 0x88100107, // 0002 GETMBR R4 R0 K7 + 0x8C14010A, // 0003 GETMET R5 R0 K10 + 0x5C1C0200, // 0004 MOVE R7 R1 + 0x7C140400, // 0005 CALL R5 2 + 0x7C080600, // 0006 CALL R2 3 + 0x80000000, // 0007 RET 0 }) ) ); @@ -10446,11 +10400,11 @@ be_local_closure(class_lvh_chart_set_val, /* name */ /******************************************************************** -** Solidified function: set_v_div_line_count +** Solidified function: set_y2_min ********************************************************************/ -be_local_closure(class_lvh_chart_set_v_div_line_count, /* name */ +be_local_closure(class_lvh_chart_set_y2_min, /* name */ be_nested_proto( - 6, /* nstack */ + 7, /* nstack */ 2, /* argc */ 10, /* varg */ 0, /* has upvals */ @@ -10459,16 +10413,18 @@ be_local_closure(class_lvh_chart_set_v_div_line_count, /* name */ NULL, /* no sub protos */ 1, /* has constants */ &be_ktab_class_lvh_chart, /* shared constants */ - be_str_weak(set_v_div_line_count), + be_str_weak(set_y2_min), &be_const_str_solidified, - ( &(const binstruction[ 7]) { /* code */ - 0x90021E01, // 0000 SETMBR R0 K15 R1 + ( &(const binstruction[ 9]) { /* code */ + 0x90021A01, // 0000 SETMBR R0 K13 R1 0x88080101, // 0001 GETMBR R2 R0 K1 - 0x8C080518, // 0002 GETMET R2 R2 K24 - 0x8810010D, // 0003 GETMBR R4 R0 K13 - 0x8814010F, // 0004 GETMBR R5 R0 K15 - 0x7C080600, // 0005 CALL R2 3 - 0x80000000, // 0006 RET 0 + 0x8C080502, // 0002 GETMET R2 R2 K2 + 0xB8120600, // 0003 GETNGBL R4 K3 + 0x8810090C, // 0004 GETMBR R4 R4 K12 + 0x8814010D, // 0005 GETMBR R5 R0 K13 + 0x8818010B, // 0006 GETMBR R6 R0 K11 + 0x7C080800, // 0007 CALL R2 4 + 0x80000000, // 0008 RET 0 }) ) ); @@ -10492,11 +10448,175 @@ be_local_closure(class_lvh_chart_set_h_div_line_count, /* name */ be_str_weak(set_h_div_line_count), &be_const_str_solidified, ( &(const binstruction[ 7]) { /* code */ - 0x90021A01, // 0000 SETMBR R0 K13 R1 + 0x90021E01, // 0000 SETMBR R0 K15 R1 0x88080101, // 0001 GETMBR R2 R0 K1 0x8C080518, // 0002 GETMET R2 R2 K24 - 0x8810010D, // 0003 GETMBR R4 R0 K13 - 0x8814010F, // 0004 GETMBR R5 R0 K15 + 0x8810010F, // 0003 GETMBR R4 R0 K15 + 0x88140111, // 0004 GETMBR R5 R0 K17 + 0x7C080600, // 0005 CALL R2 3 + 0x80000000, // 0006 RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: get_y2_max +********************************************************************/ +be_local_closure(class_lvh_chart_get_y2_max, /* name */ + be_nested_proto( + 2, /* nstack */ + 1, /* argc */ + 10, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + &be_ktab_class_lvh_chart, /* shared constants */ + be_str_weak(get_y2_max), + &be_const_str_solidified, + ( &(const binstruction[ 2]) { /* code */ + 0x8804010B, // 0000 GETMBR R1 R0 K11 + 0x80040200, // 0001 RET 1 R1 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: get_y_max +********************************************************************/ +be_local_closure(class_lvh_chart_get_y_max, /* name */ + be_nested_proto( + 2, /* nstack */ + 1, /* argc */ + 10, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + &be_ktab_class_lvh_chart, /* shared constants */ + be_str_weak(get_y_max), + &be_const_str_solidified, + ( &(const binstruction[ 2]) { /* code */ + 0x88040105, // 0000 GETMBR R1 R0 K5 + 0x80040200, // 0001 RET 1 R1 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: set_val2 +********************************************************************/ +be_local_closure(class_lvh_chart_set_val2, /* name */ + be_nested_proto( + 5, /* nstack */ + 2, /* argc */ + 10, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + &be_ktab_class_lvh_chart, /* shared constants */ + be_str_weak(set_val2), + &be_const_str_solidified, + ( &(const binstruction[ 4]) { /* code */ + 0x8C080119, // 0000 GETMET R2 R0 K25 + 0x5C100200, // 0001 MOVE R4 R1 + 0x7C080400, // 0002 CALL R2 2 + 0x80000000, // 0003 RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: set_val +********************************************************************/ +be_local_closure(class_lvh_chart_set_val, /* name */ + be_nested_proto( + 5, /* nstack */ + 2, /* argc */ + 10, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + &be_ktab_class_lvh_chart, /* shared constants */ + be_str_weak(set_val), + &be_const_str_solidified, + ( &(const binstruction[ 5]) { /* code */ + 0x90023401, // 0000 SETMBR R0 K26 R1 + 0x8C08011B, // 0001 GETMET R2 R0 K27 + 0x5C100200, // 0002 MOVE R4 R1 + 0x7C080400, // 0003 CALL R2 2 + 0x80000000, // 0004 RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: add_point +********************************************************************/ +be_local_closure(class_lvh_chart_add_point, /* name */ + be_nested_proto( + 6, /* nstack */ + 2, /* argc */ + 10, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + &be_ktab_class_lvh_chart, /* shared constants */ + be_str_weak(add_point), + &be_const_str_solidified, + ( &(const binstruction[ 6]) { /* code */ + 0x88080101, // 0000 GETMBR R2 R0 K1 + 0x8C080506, // 0001 GETMET R2 R2 K6 + 0x88100109, // 0002 GETMBR R4 R0 K9 + 0x5C140200, // 0003 MOVE R5 R1 + 0x7C080600, // 0004 CALL R2 3 + 0x80000000, // 0005 RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: set_v_div_line_count +********************************************************************/ +be_local_closure(class_lvh_chart_set_v_div_line_count, /* name */ + be_nested_proto( + 6, /* nstack */ + 2, /* argc */ + 10, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + &be_ktab_class_lvh_chart, /* shared constants */ + be_str_weak(set_v_div_line_count), + &be_const_str_solidified, + ( &(const binstruction[ 7]) { /* code */ + 0x90022201, // 0000 SETMBR R0 K17 R1 + 0x88080101, // 0001 GETMBR R2 R0 K1 + 0x8C080518, // 0002 GETMET R2 R2 K24 + 0x8810010F, // 0003 GETMBR R4 R0 K15 + 0x88140111, // 0004 GETMBR R5 R0 K17 0x7C080600, // 0005 CALL R2 3 0x80000000, // 0006 RET 0 }) @@ -10510,30 +10630,36 @@ be_local_closure(class_lvh_chart_set_h_div_line_count, /* name */ ********************************************************************/ extern const bclass be_class_lvh_obj; be_local_class(lvh_chart, - 6, + 8, &be_class_lvh_obj, - be_nested_map(20, + be_nested_map(26, ( (struct bmapnode*) &(const bmapnode[]) { - { be_const_key_weak(get_y_min, -1), be_const_closure(class_lvh_chart_get_y_min_closure) }, - { be_const_key_weak(_h_div, 16), be_const_var(4) }, - { be_const_key_weak(set_v_div_line_count, -1), be_const_closure(class_lvh_chart_set_v_div_line_count_closure) }, - { be_const_key_weak(set_val2, -1), be_const_closure(class_lvh_chart_set_val2_closure) }, { be_const_key_weak(set_y_min, -1), be_const_closure(class_lvh_chart_set_y_min_closure) }, { be_const_key_weak(add_point2, -1), be_const_closure(class_lvh_chart_add_point2_closure) }, + { be_const_key_weak(_v_div, -1), be_const_var(7) }, + { be_const_key_weak(_ser1, -1), be_const_var(0) }, { be_const_key_weak(_ser2, -1), be_const_var(1) }, - { be_const_key_weak(_ser1, 11), be_const_var(0) }, - { be_const_key_weak(_v_div, 18), be_const_var(5) }, + { be_const_key_weak(_y2_min, 6), be_const_var(4) }, + { be_const_key_weak(get_y2_max, -1), be_const_closure(class_lvh_chart_get_y2_max_closure) }, + { be_const_key_weak(set_v_div_line_count, -1), be_const_closure(class_lvh_chart_set_v_div_line_count_closure) }, + { be_const_key_weak(set_y_max, 24), be_const_closure(class_lvh_chart_set_y_max_closure) }, + { be_const_key_weak(_y2_max, -1), be_const_var(5) }, + { be_const_key_weak(_y_min, 2), be_const_var(2) }, { be_const_key_weak(set_series2_color, -1), be_const_closure(class_lvh_chart_set_series2_color_closure) }, - { be_const_key_weak(set_y_max, 1), be_const_closure(class_lvh_chart_set_y_max_closure) }, - { be_const_key_weak(_lv_class, -1), be_const_class(be_class_lv_chart) }, - { be_const_key_weak(_y_max, -1), be_const_var(3) }, - { be_const_key_weak(get_y_max, -1), be_const_closure(class_lvh_chart_get_y_max_closure) }, - { be_const_key_weak(_y_min, 13), be_const_var(2) }, + { be_const_key_weak(set_y2_min, -1), be_const_closure(class_lvh_chart_set_y2_min_closure) }, + { be_const_key_weak(set_h_div_line_count, 7), be_const_closure(class_lvh_chart_set_h_div_line_count_closure) }, + { be_const_key_weak(_h_div, 5), be_const_var(6) }, + { be_const_key_weak(_y_max, 25), be_const_var(3) }, + { be_const_key_weak(set_series1_color, 22), be_const_closure(class_lvh_chart_set_series1_color_closure) }, + { be_const_key_weak(set_val2, 19), be_const_closure(class_lvh_chart_set_val2_closure) }, + { be_const_key_weak(get_y2_min, 9), be_const_closure(class_lvh_chart_get_y2_min_closure) }, { be_const_key_weak(set_val, -1), be_const_closure(class_lvh_chart_set_val_closure) }, + { be_const_key_weak(set_y2_max, 15), be_const_closure(class_lvh_chart_set_y2_max_closure) }, + { be_const_key_weak(add_point, -1), be_const_closure(class_lvh_chart_add_point_closure) }, + { be_const_key_weak(get_y_max, -1), be_const_closure(class_lvh_chart_get_y_max_closure) }, + { be_const_key_weak(_lv_class, -1), be_const_class(be_class_lv_chart) }, { be_const_key_weak(post_init, -1), be_const_closure(class_lvh_chart_post_init_closure) }, - { be_const_key_weak(add_point, 2), be_const_closure(class_lvh_chart_add_point_closure) }, - { be_const_key_weak(set_series1_color, 0), be_const_closure(class_lvh_chart_set_series1_color_closure) }, - { be_const_key_weak(set_h_div_line_count, -1), be_const_closure(class_lvh_chart_set_h_div_line_count_closure) }, + { be_const_key_weak(get_y_min, -1), be_const_closure(class_lvh_chart_get_y_min_closure) }, })), be_str_weak(lvh_chart) ); @@ -11236,8 +11362,8 @@ be_local_class(lvh_scr, })), be_str_weak(lvh_scr) ); -// compact class 'lvh_page' ktab size: 47, total: 73 (saved 208 bytes) -static const bvalue be_ktab_class_lvh_page[47] = { +// compact class 'lvh_page' ktab size: 45, total: 70 (saved 200 bytes) +static const bvalue be_ktab_class_lvh_page[45] = { /* K0 */ be_nested_str_weak(_clear), /* K1 */ be_nested_str_weak(string), /* K2 */ be_nested_str_weak(introspect), @@ -11267,24 +11393,22 @@ static const bvalue be_ktab_class_lvh_page[47] = { /* K26 */ be_nested_str_weak(lv), /* K27 */ be_nested_str_weak(layer_top), /* K28 */ be_nested_str_weak(obj), - /* K29 */ be_nested_str_weak(scr_act), - /* K30 */ be_nested_str_weak(get_style_bg_color), - /* K31 */ be_nested_str_weak(set_style_bg_color), - /* K32 */ be_nested_str_weak(lvh_scr), - /* K33 */ be_nested_str_weak(p_X25s), - /* K34 */ be_nested_str_weak(p_X25sb0), - /* K35 */ be_nested_str_weak(_p), - /* K36 */ be_nested_str_weak(page_dir_to), - /* K37 */ be_nested_str_weak(_X7B_X22hasp_X22_X3A_X7B_X22p_X25i_X22_X3A_X22out_X22_X7D_X7D), - /* K38 */ be_nested_str_weak(lvh_page_cur_idx), - /* K39 */ be_nested_str_weak(tasmota), - /* K40 */ be_nested_str_weak(defer), - /* K41 */ be_nested_str_weak(_X7B_X22hasp_X22_X3A_X7B_X22p_X25i_X22_X3A_X22in_X22_X7D_X7D), - /* K42 */ be_nested_str_weak(screen_load), - /* K43 */ be_nested_str_weak(show_anim), - /* K44 */ be_nested_str_weak(SCR_LOAD_ANIM_NONE), - /* K45 */ be_nested_str_weak(screen_load_anim), - /* K46 */ be_nested_str_weak(_remove_page), + /* K29 */ be_nested_str_weak(lvh_scr), + /* K30 */ be_nested_str_weak(p_X25s), + /* K31 */ be_nested_str_weak(p_X25sb0), + /* K32 */ be_nested_str_weak(_p), + /* K33 */ be_nested_str_weak(scr_act), + /* K34 */ be_nested_str_weak(page_dir_to), + /* K35 */ be_nested_str_weak(_X7B_X22hasp_X22_X3A_X7B_X22p_X25i_X22_X3A_X22out_X22_X7D_X7D), + /* K36 */ be_nested_str_weak(lvh_page_cur_idx), + /* K37 */ be_nested_str_weak(tasmota), + /* K38 */ be_nested_str_weak(defer), + /* K39 */ be_nested_str_weak(_X7B_X22hasp_X22_X3A_X7B_X22p_X25i_X22_X3A_X22in_X22_X7D_X7D), + /* K40 */ be_nested_str_weak(screen_load), + /* K41 */ be_nested_str_weak(show_anim), + /* K42 */ be_nested_str_weak(SCR_LOAD_ANIM_NONE), + /* K43 */ be_nested_str_weak(screen_load_anim), + /* K44 */ be_nested_str_weak(_remove_page), }; @@ -11642,7 +11766,7 @@ be_local_closure(class_lvh_page_init, /* name */ &be_ktab_class_lvh_page, /* shared constants */ be_str_weak(init), &be_const_str_solidified, - ( &(const binstruction[58]) { /* code */ + ( &(const binstruction[47]) { /* code */ 0xA40E2E00, // 0000 IMPORT R3 K23 0x90023002, // 0001 SETMBR R0 K24 R2 0x60100009, // 0002 GETGBL R4 G9 @@ -11663,44 +11787,33 @@ be_local_closure(class_lvh_page_init, /* name */ 0x8C10091B, // 0011 GETMET R4 R4 K27 0x7C100200, // 0012 CALL R4 1 0x90022204, // 0013 SETMBR R0 K17 R4 - 0x7002000F, // 0014 JMP #0025 + 0x70020004, // 0014 JMP #001A 0xB8123400, // 0015 GETNGBL R4 K26 0x8C10091C, // 0016 GETMET R4 R4 K28 0x5818000D, // 0017 LDCONST R6 K13 0x7C100400, // 0018 CALL R4 2 0x90022204, // 0019 SETMBR R0 K17 R4 - 0xB8123400, // 001A GETNGBL R4 K26 - 0x8C10091D, // 001B GETMET R4 R4 K29 - 0x7C100200, // 001C CALL R4 1 - 0x8C10091E, // 001D GETMET R4 R4 K30 - 0x5818000D, // 001E LDCONST R6 K13 - 0x7C100400, // 001F CALL R4 2 - 0x88140111, // 0020 GETMBR R5 R0 K17 - 0x8C140B1F, // 0021 GETMET R5 R5 K31 - 0x5C1C0800, // 0022 MOVE R7 R4 - 0x5820000D, // 0023 LDCONST R8 K13 - 0x7C140600, // 0024 CALL R5 3 - 0x88100118, // 0025 GETMBR R4 R0 K24 - 0x88100920, // 0026 GETMBR R4 R4 K32 - 0x5C140800, // 0027 MOVE R5 R4 - 0x4C180000, // 0028 LDNIL R6 - 0x5C1C0000, // 0029 MOVE R7 R0 - 0x4C200000, // 002A LDNIL R8 - 0x88240111, // 002B GETMBR R9 R0 K17 - 0x7C140800, // 002C CALL R5 4 - 0x88180109, // 002D GETMBR R6 R0 K9 - 0x981A1A05, // 002E SETIDX R6 K13 R5 - 0x60180018, // 002F GETGBL R6 G24 - 0x581C0021, // 0030 LDCONST R7 K33 - 0x88200119, // 0031 GETMBR R8 R0 K25 - 0x7C180400, // 0032 CALL R6 2 - 0x900C0C00, // 0033 SETMBR R3 R6 R0 - 0x60180018, // 0034 GETGBL R6 G24 - 0x581C0022, // 0035 LDCONST R7 K34 - 0x88200119, // 0036 GETMBR R8 R0 K25 - 0x7C180400, // 0037 CALL R6 2 - 0x900C0C05, // 0038 SETMBR R3 R6 R5 - 0x80000000, // 0039 RET 0 + 0x88100118, // 001A GETMBR R4 R0 K24 + 0x8810091D, // 001B GETMBR R4 R4 K29 + 0x5C140800, // 001C MOVE R5 R4 + 0x4C180000, // 001D LDNIL R6 + 0x5C1C0000, // 001E MOVE R7 R0 + 0x4C200000, // 001F LDNIL R8 + 0x88240111, // 0020 GETMBR R9 R0 K17 + 0x7C140800, // 0021 CALL R5 4 + 0x88180109, // 0022 GETMBR R6 R0 K9 + 0x981A1A05, // 0023 SETIDX R6 K13 R5 + 0x60180018, // 0024 GETGBL R6 G24 + 0x581C001E, // 0025 LDCONST R7 K30 + 0x88200119, // 0026 GETMBR R8 R0 K25 + 0x7C180400, // 0027 CALL R6 2 + 0x900C0C00, // 0028 SETMBR R3 R6 R0 + 0x60180018, // 0029 GETGBL R6 G24 + 0x581C001F, // 002A LDCONST R7 K31 + 0x88200119, // 002B GETMBR R8 R0 K25 + 0x7C180400, // 002C CALL R6 2 + 0x900C0C05, // 002D SETMBR R3 R6 R5 + 0x80000000, // 002E RET 0 }) ) ); @@ -11782,11 +11895,11 @@ be_local_closure(class_lvh_page_show, /* name */ 0x4C0C0000, // 0004 LDNIL R3 0x80040600, // 0005 RET 1 R3 0x880C0111, // 0006 GETMBR R3 R0 K17 - 0x880C0723, // 0007 GETMBR R3 R3 K35 + 0x880C0720, // 0007 GETMBR R3 R3 K32 0xB8123400, // 0008 GETNGBL R4 K26 - 0x8C10091D, // 0009 GETMET R4 R4 K29 + 0x8C100921, // 0009 GETMET R4 R4 K33 0x7C100200, // 000A CALL R4 1 - 0x88100923, // 000B GETMBR R4 R4 K35 + 0x88100920, // 000B GETMBR R4 R4 K32 0x1C0C0604, // 000C EQ R3 R3 R4 0x780E0000, // 000D JMPF R3 #000F 0x80000600, // 000E RET 0 @@ -11798,46 +11911,46 @@ be_local_closure(class_lvh_page_show, /* name */ 0x1C0C0203, // 0014 EQ R3 R1 R3 0x780E0005, // 0015 JMPF R3 #001C 0x880C0118, // 0016 GETMBR R3 R0 K24 - 0x8C0C0724, // 0017 GETMET R3 R3 K36 + 0x8C0C0722, // 0017 GETMET R3 R3 K34 0x8C140116, // 0018 GETMET R5 R0 K22 0x7C140200, // 0019 CALL R5 1 0x7C0C0400, // 001A CALL R3 2 0x5C040600, // 001B MOVE R1 R3 0x600C0018, // 001C GETGBL R3 G24 - 0x58100025, // 001D LDCONST R4 K37 + 0x58100023, // 001D LDCONST R4 K35 0x88140118, // 001E GETMBR R5 R0 K24 - 0x88140B26, // 001F GETMBR R5 R5 K38 + 0x88140B24, // 001F GETMBR R5 R5 K36 0x7C0C0400, // 0020 CALL R3 2 - 0xB8124E00, // 0021 GETNGBL R4 K39 - 0x8C100928, // 0022 GETMET R4 R4 K40 + 0xB8124A00, // 0021 GETNGBL R4 K37 + 0x8C100926, // 0022 GETMET R4 R4 K38 0x84180000, // 0023 CLOSURE R6 P0 0x7C100400, // 0024 CALL R4 2 0x60100018, // 0025 GETGBL R4 G24 - 0x58140029, // 0026 LDCONST R5 K41 + 0x58140027, // 0026 LDCONST R5 K39 0x88180119, // 0027 GETMBR R6 R0 K25 0x7C100400, // 0028 CALL R4 2 - 0xB8164E00, // 0029 GETNGBL R5 K39 - 0x8C140B28, // 002A GETMET R5 R5 K40 + 0xB8164A00, // 0029 GETNGBL R5 K37 + 0x8C140B26, // 002A GETMET R5 R5 K38 0x841C0001, // 002B CLOSURE R7 P1 0x7C140400, // 002C CALL R5 2 0x88140118, // 002D GETMBR R5 R0 K24 0x88180119, // 002E GETMBR R6 R0 K25 - 0x90164C06, // 002F SETMBR R5 K38 R6 + 0x90164806, // 002F SETMBR R5 K36 R6 0x1C14030D, // 0030 EQ R5 R1 K13 0x78160004, // 0031 JMPF R5 #0037 0xB8163400, // 0032 GETNGBL R5 K26 - 0x8C140B2A, // 0033 GETMET R5 R5 K42 + 0x8C140B28, // 0033 GETMET R5 R5 K40 0x881C0111, // 0034 GETMBR R7 R0 K17 0x7C140400, // 0035 CALL R5 2 0x7002000D, // 0036 JMP #0045 - 0x8814012B, // 0037 GETMBR R5 R0 K43 + 0x88140129, // 0037 GETMBR R5 R0 K41 0x8C140B12, // 0038 GETMET R5 R5 K18 0x5C1C0200, // 0039 MOVE R7 R1 0xB8223400, // 003A GETNGBL R8 K26 - 0x8820112C, // 003B GETMBR R8 R8 K44 + 0x8820112A, // 003B GETMBR R8 R8 K42 0x7C140600, // 003C CALL R5 3 0xB81A3400, // 003D GETNGBL R6 K26 - 0x8C180D2D, // 003E GETMET R6 R6 K45 + 0x8C180D2B, // 003E GETMET R6 R6 K43 0x88200111, // 003F GETMBR R8 R0 K17 0x5C240A00, // 0040 MOVE R9 R5 0x5C280400, // 0041 MOVE R10 R2 @@ -11870,7 +11983,7 @@ be_local_closure(class_lvh_page__delete, /* name */ &be_const_str_solidified, ( &(const binstruction[ 7]) { /* code */ 0x88040118, // 0000 GETMBR R1 R0 K24 - 0x8C04032E, // 0001 GETMET R1 R1 K46 + 0x8C04032C, // 0001 GETMET R1 R1 K44 0x880C0119, // 0002 GETMBR R3 R0 K25 0x7C040400, // 0003 CALL R1 2 0x8C040100, // 0004 GETMET R1 R0 K0 @@ -11947,567 +12060,144 @@ be_local_class(lvh_page, be_str_weak(lvh_page) ); extern const bclass be_class_HASPmota; -// compact class 'HASPmota' ktab size: 124, total: 196 (saved 576 bytes) -static const bvalue be_ktab_class_HASPmota[124] = { - /* K0 */ be_nested_str_weak(global), - /* K1 */ be_nested_str_weak(introspect), - /* K2 */ be_nested_str_weak(find), - /* K3 */ be_nested_str_weak(id), - /* K4 */ be_nested_str_weak(obj), - /* K5 */ be_nested_str_weak(get_page_cur_parsing), - /* K6 */ be_const_int(0), - /* K7 */ be_nested_str_weak(HSP_X3A_X20invalid_X20_X27id_X27_X3A_X20_X25s_X20for_X20_X27obj_X27_X3A_X20_X25s), - /* K8 */ be_nested_str_weak(get_obj), - /* K9 */ be_nested_str_weak(parentid), - /* K10 */ be_nested_str_weak(_lv_obj), - /* K11 */ be_nested_str_weak(get_scr), - /* K12 */ be_nested_str_weak(get), - /* K13 */ be_nested_str_weak(lvh_), - /* K14 */ be_nested_str_weak(class), - /* K15 */ be_nested_str_weak(lvh_obj), - /* K16 */ be_nested_str_weak(module), - /* K17 */ be_nested_str_weak(HSP_X3A_X20Cannot_X20find_X20object_X20of_X20type_X20_X25s), - /* K18 */ be_nested_str_weak(add_obj), - /* K19 */ be_nested_str_weak(HSP_X3A_X20cannot_X20specify_X20_X27obj_X27_X3A_X27_X25s_X27_X20for_X20_X27id_X27_X3A0), - /* K20 */ be_nested_str_weak(keys), - /* K21 */ be_nested_str_weak(stop_iteration), - /* K22 */ be_nested_str_weak(post_config), - /* K23 */ be_nested_str_weak(berry_run), - /* K24 */ be_nested_str_weak(nil), - /* K25 */ be_nested_str_weak(HSP_X3A_X20unable_X20to_X20compile_X20berry_X20code_X20_X22_X25s_X22_X20_X2D_X20_X27_X25s_X27_X20_X2D_X20_X25s), - /* K26 */ be_nested_str_weak(function), - /* K27 */ be_nested_str_weak(HSP_X3A_X20unable_X20to_X20run_X20berry_X20code_X20_X22_X25s_X22_X20_X2D_X20_X27_X25s_X27_X20_X2D_X20_X25s), - /* K28 */ be_nested_str_weak(get_page_cur), - /* K29 */ be_nested_str_weak(pages_list_sorted), - /* K30 */ be_nested_str_weak(lvh_page_cur_idx), - /* K31 */ be_const_int(1), - /* K32 */ be_nested_str_weak(prev), - /* K33 */ be_nested_str_weak(next), - /* K34 */ be_nested_str_weak(back), - /* K35 */ be_nested_str_weak(delete), - /* K36 */ be_nested_str_weak(re_page_target), - /* K37 */ be_nested_str_weak(match), - /* K38 */ be_nested_str_weak(lvh_pages), - /* K39 */ be_nested_str_weak(show), - /* K40 */ be_nested_str_weak(page_show), - /* K41 */ be_nested_str_weak(lvh_page_cur_idx_parsing), - /* K42 */ be_nested_str_weak(contains), - /* K43 */ be_nested_str_weak(remove), - /* K44 */ be_nested_str_weak(p_X25s), - /* K45 */ be_nested_str_weak(string), - /* K46 */ be_nested_str_weak(json), - /* K47 */ be_nested_str_weak(r), - /* K48 */ be_nested_str_weak(read), - /* K49 */ be_nested_str_weak(close), - /* K50 */ be_nested_str_weak(split), - /* K51 */ be_nested_str_weak(_X0A), - /* K52 */ be_nested_str_weak(load), - /* K53 */ be_nested_str_weak(instance), - /* K54 */ be_nested_str_weak(tasmota), - /* K55 */ be_nested_str_weak(loglevel), - /* K56 */ be_nested_str_weak(log), - /* K57 */ be_nested_str_weak(HSP_X3A_X20parsing_X20line_X20_X27_X25s_X27), - /* K58 */ be_nested_str_weak(parse_page), - /* K59 */ be_nested_str_weak(value_error), - /* K60 */ be_nested_str_weak(no_X20page_X20_X27id_X27_X20defined), - /* K61 */ be_nested_str_weak(parse_obj), - /* K62 */ be_nested_str_weak(tr), - /* K63 */ be_nested_str_weak(_X20_X09), - /* K64 */ be_nested_str_weak(), - /* K65 */ be_nested_str_weak(HSP_X3A_X20invalid_X20JSON_X20line_X20_X27_X25s_X27), - /* K66 */ be_const_int(2), - /* K67 */ be_nested_str_weak(no_X20page_X20object_X20defined), - /* K68 */ be_nested_str_weak(fix_lv_version), - /* K69 */ be_nested_str_weak(re), - /* K70 */ be_nested_str_weak(compile), - /* K71 */ be_nested_str_weak(p_X5Cd_X2B), - /* K72 */ be_nested_str_weak(has), - /* K73 */ be_nested_str_weak(page), - /* K74 */ be_nested_str_weak(int), - /* K75 */ be_nested_str_weak(lvh_page), - /* K76 */ be_nested_str_weak(unable_X20to_X20parse_X20JSON_X20line), - /* K77 */ be_nested_str_weak(path), - /* K78 */ be_nested_str_weak(def_templ_name), - /* K79 */ be_nested_str_weak(exists), - /* K80 */ be_nested_str_weak(file_X20_X27), - /* K81 */ be_nested_str_weak(_X27_X20not_X20found), - /* K82 */ be_nested_str_weak(io_erorr), - /* K83 */ be_nested_str_weak(lv), - /* K84 */ be_nested_str_weak(start), - /* K85 */ be_nested_str_weak(dark), - /* K86 */ be_nested_str_weak(hres), - /* K87 */ be_nested_str_weak(get_hor_res), - /* K88 */ be_nested_str_weak(vres), - /* K89 */ be_nested_str_weak(get_ver_res), - /* K90 */ be_nested_str_weak(scr), - /* K91 */ be_nested_str_weak(scr_act), - /* K92 */ be_nested_str_weak(r16), - /* K93 */ be_nested_str_weak(font_embedded), - /* K94 */ be_nested_str_weak(robotocondensed), - /* K95 */ be_nested_str_weak(montserrat), - /* K96 */ be_nested_str_weak(theme_haspmota_init), - /* K97 */ be_nested_str_weak(color), - /* K98 */ be_const_int(16711935), - /* K99 */ be_const_int(3158064), - /* K100 */ be_nested_str_weak(get_disp), - /* K101 */ be_nested_str_weak(set_theme), - /* K102 */ be_nested_str_weak(set_style_bg_color), - /* K103 */ be_const_int(16777215), - /* K104 */ be_nested_str_weak(theme_apply), - /* K105 */ be_nested_str_weak(layer_top), - /* K106 */ be_nested_str_weak(set_style_bg_opa), - /* K107 */ be_nested_str_weak(_load), - /* K108 */ be_const_class(be_class_HASPmota), - /* K109 */ be_nested_str_weak(EVENT_CLICKED), - /* K110 */ be_nested_str_weak(_action), - /* K111 */ be_nested_str_weak(toptr), - /* K112 */ be_nested_str_weak(event), - /* K113 */ be_nested_str_weak(_p), - /* K114 */ be_nested_str_weak(lv_event), - /* K115 */ be_nested_str_weak(get_user_data), - /* K116 */ be_nested_str_weak(fromptr), - /* K117 */ be_nested_str_weak(event_cb), - /* K118 */ be_nested_str_weak(cb), - /* K119 */ be_nested_str_weak(gen_cb), - /* K120 */ be_nested_str_weak(add_event_cb), - /* K121 */ be_nested_str_weak(version), +// compact class 'HASPmota' ktab size: 125, total: 202 (saved 616 bytes) +static const bvalue be_ktab_class_HASPmota[125] = { + /* K0 */ be_nested_str_weak(introspect), + /* K1 */ be_nested_str_weak(toptr), + /* K2 */ be_nested_str_weak(event), + /* K3 */ be_nested_str_weak(_p), + /* K4 */ be_nested_str_weak(lv), + /* K5 */ be_nested_str_weak(lv_event), + /* K6 */ be_nested_str_weak(get_user_data), + /* K7 */ be_const_int(0), + /* K8 */ be_nested_str_weak(fromptr), + /* K9 */ be_nested_str_weak(instance), + /* K10 */ be_nested_str_weak(event_cb), + /* K11 */ be_nested_str_weak(pages_list_sorted), + /* K12 */ be_const_int(1), + /* K13 */ be_const_int(2), + /* K14 */ be_nested_str_weak(find), + /* K15 */ be_nested_str_weak(has), + /* K16 */ be_nested_str_weak(page), + /* K17 */ be_nested_str_weak(int), + /* K18 */ be_nested_str_weak(lvh_page_cur_idx_parsing), + /* K19 */ be_nested_str_weak(lvh_page_cur_idx), + /* K20 */ be_nested_str_weak(lvh_pages), + /* K21 */ be_nested_str_weak(contains), + /* K22 */ be_nested_str_weak(lvh_page), + /* K23 */ be_nested_str_weak(id), + /* K24 */ be_nested_str_weak(get_page_cur_parsing), + /* K25 */ be_nested_str_weak(prev), + /* K26 */ be_nested_str_weak(next), + /* K27 */ be_nested_str_weak(back), + /* K28 */ be_nested_str_weak(global), + /* K29 */ be_nested_str_weak(obj), + /* K30 */ be_nested_str_weak(HSP_X3A_X20invalid_X20_X27id_X27_X3A_X20_X25s_X20for_X20_X27obj_X27_X3A_X20_X25s), + /* K31 */ be_nested_str_weak(get_obj), + /* K32 */ be_nested_str_weak(parentid), + /* K33 */ be_nested_str_weak(_lv_obj), + /* K34 */ be_nested_str_weak(get_scr), + /* K35 */ be_nested_str_weak(get), + /* K36 */ be_nested_str_weak(lvh_), + /* K37 */ be_nested_str_weak(class), + /* K38 */ be_nested_str_weak(lvh_obj), + /* K39 */ be_nested_str_weak(module), + /* K40 */ be_nested_str_weak(HSP_X3A_X20Cannot_X20find_X20object_X20of_X20type_X20_X25s), + /* K41 */ be_nested_str_weak(add_obj), + /* K42 */ be_nested_str_weak(HSP_X3A_X20cannot_X20specify_X20_X27obj_X27_X3A_X27_X25s_X27_X20for_X20_X27id_X27_X3A0), + /* K43 */ be_nested_str_weak(keys), + /* K44 */ be_nested_str_weak(stop_iteration), + /* K45 */ be_nested_str_weak(post_config), + /* K46 */ be_nested_str_weak(berry_run), + /* K47 */ be_nested_str_weak(nil), + /* K48 */ be_nested_str_weak(HSP_X3A_X20unable_X20to_X20compile_X20berry_X20code_X20_X22_X25s_X22_X20_X2D_X20_X27_X25s_X27_X20_X2D_X20_X25s), + /* K49 */ be_nested_str_weak(function), + /* K50 */ be_nested_str_weak(HSP_X3A_X20unable_X20to_X20run_X20berry_X20code_X20_X22_X25s_X22_X20_X2D_X20_X27_X25s_X27_X20_X2D_X20_X25s), + /* K51 */ be_nested_str_weak(get_page_cur), + /* K52 */ be_nested_str_weak(page_show), + /* K53 */ be_nested_str_weak(delete), + /* K54 */ be_nested_str_weak(remove), + /* K55 */ be_nested_str_weak(p_X25s), + /* K56 */ be_const_class(be_class_HASPmota), + /* K57 */ be_nested_str_weak(started), + /* K58 */ be_nested_str_weak(string), + /* K59 */ be_nested_str_weak(PAGES_JSONL), + /* K60 */ be_nested_str_weak(path), + /* K61 */ be_nested_str_weak(exists), + /* K62 */ be_nested_str_weak(file_X20_X27), + /* K63 */ be_nested_str_weak(_X27_X20not_X20found), + /* K64 */ be_nested_str_weak(io_erorr), + /* K65 */ be_nested_str_weak(start), + /* K66 */ be_nested_str_weak(hres), + /* K67 */ be_nested_str_weak(get_hor_res), + /* K68 */ be_nested_str_weak(vres), + /* K69 */ be_nested_str_weak(get_ver_res), + /* K70 */ be_nested_str_weak(scr), + /* K71 */ be_nested_str_weak(scr_act), + /* K72 */ be_nested_str_weak(r12), + /* K73 */ be_nested_str_weak(font_embedded), + /* K74 */ be_nested_str_weak(robotocondensed), + /* K75 */ be_nested_str_weak(montserrat), + /* K76 */ be_nested_str_weak(r16), + /* K77 */ be_nested_str_weak(r24), + /* K78 */ be_nested_str_weak(lvh_root), + /* K79 */ be_nested_str_weak(parse_color), + /* K80 */ be_nested_str_weak(tasmota), + /* K81 */ be_nested_str_weak(webcolor), + /* K82 */ be_nested_str_weak(color_arr), + /* K83 */ be_nested_str_weak(theme_haspmota_init), + /* K84 */ be_nested_str_weak(get_disp), + /* K85 */ be_nested_str_weak(set_theme), + /* K86 */ be_nested_str_weak(theme_apply), + /* K87 */ be_nested_str_weak(layer_top), + /* K88 */ be_nested_str_weak(set_style_bg_opa), + /* K89 */ be_nested_str_weak(_load), + /* K90 */ be_nested_str_weak(version), + /* K91 */ be_nested_str_weak(EVENT_CLICKED), + /* K92 */ be_nested_str_weak(_action), + /* K93 */ be_nested_str_weak(cb), + /* K94 */ be_nested_str_weak(gen_cb), + /* K95 */ be_nested_str_weak(add_event_cb), + /* K96 */ be_nested_str_weak(json), + /* K97 */ be_nested_str_weak(load), + /* K98 */ be_nested_str_weak(parse_page), + /* K99 */ be_nested_str_weak(parse_obj), + /* K100 */ be_nested_str_weak(value_error), + /* K101 */ be_nested_str_weak(unable_X20to_X20parse_X20JSON_X20line), + /* K102 */ be_nested_str_weak(tell), + /* K103 */ be_nested_str_weak(size), + /* K104 */ be_nested_str_weak(readline), + /* K105 */ be_nested_str_weak(_X23), + /* K106 */ be_nested_str_weak(loglevel), + /* K107 */ be_nested_str_weak(log), + /* K108 */ be_nested_str_weak(HSP_X3A_X20parsing_X20line_X20_X27_X25s_X27), + /* K109 */ be_nested_str_weak(no_X20page_X20_X27id_X27_X20defined), + /* K110 */ be_nested_str_weak(tr), + /* K111 */ be_nested_str_weak(_X20_X09), + /* K112 */ be_nested_str_weak(), + /* K113 */ be_nested_str_weak(HSP_X3A_X20invalid_X20JSON_X20line_X20_X27_X25s_X27), + /* K114 */ be_nested_str_weak(close), + /* K115 */ be_nested_str_weak(no_X20page_X20object_X20defined), + /* K116 */ be_nested_str_weak(show), + /* K117 */ be_nested_str_weak(fix_lv_version), + /* K118 */ be_nested_str_weak(re), + /* K119 */ be_nested_str_weak(re_page_target), + /* K120 */ be_nested_str_weak(compilebytes), + /* K121 */ be_nested_str_weak(p_X5Cd_X2B), /* K122 */ be_nested_str_weak(push), /* K123 */ be_nested_str_weak(sort), + /* K124 */ be_nested_str_weak(match), }; extern const bclass be_class_HASPmota; /******************************************************************** -** Solidified function: parse_obj +** Solidified function: event_dispatch ********************************************************************/ -be_local_closure(class_HASPmota_parse_obj, /* name */ +be_local_closure(class_HASPmota_event_dispatch, /* name */ be_nested_proto( - 20, /* nstack */ - 3, /* argc */ - 10, /* varg */ - 0, /* has upvals */ - NULL, /* no upvals */ - 0, /* has sup protos */ - NULL, /* no sub protos */ - 1, /* has constants */ - &be_ktab_class_HASPmota, /* shared constants */ - be_str_weak(parse_obj), - &be_const_str_solidified, - ( &(const binstruction[239]) { /* code */ - 0xA40E0000, // 0000 IMPORT R3 K0 - 0xA4120200, // 0001 IMPORT R4 K1 - 0x60140009, // 0002 GETGBL R5 G9 - 0x8C180302, // 0003 GETMET R6 R1 K2 - 0x58200003, // 0004 LDCONST R8 K3 - 0x7C180400, // 0005 CALL R6 2 - 0x7C140200, // 0006 CALL R5 1 - 0x8C180302, // 0007 GETMET R6 R1 K2 - 0x58200004, // 0008 LDCONST R8 K4 - 0x7C180400, // 0009 CALL R6 2 - 0x4C1C0000, // 000A LDNIL R7 - 0x201C0C07, // 000B NE R7 R6 R7 - 0x781E0003, // 000C JMPF R7 #0011 - 0x601C0008, // 000D GETGBL R7 G8 - 0x5C200C00, // 000E MOVE R8 R6 - 0x7C1C0200, // 000F CALL R7 1 - 0x70020000, // 0010 JMP #0012 - 0x4C1C0000, // 0011 LDNIL R7 - 0x5C180E00, // 0012 MOVE R6 R7 - 0x8C1C0105, // 0013 GETMET R7 R0 K5 - 0x7C1C0200, // 0014 CALL R7 1 - 0x4C200000, // 0015 LDNIL R8 - 0x20200A08, // 0016 NE R8 R5 R8 - 0x78220011, // 0017 JMPF R8 #002A - 0x14200B06, // 0018 LT R8 R5 K6 - 0x74220002, // 0019 JMPT R8 #001D - 0x542200FD, // 001A LDINT R8 254 - 0x24200A08, // 001B GT R8 R5 R8 - 0x7822000C, // 001C JMPF R8 #002A - 0x20200B06, // 001D NE R8 R5 K6 - 0x74220002, // 001E JMPT R8 #0022 - 0x4C200000, // 001F LDNIL R8 - 0x1C200C08, // 0020 EQ R8 R6 R8 - 0x78220007, // 0021 JMPF R8 #002A - 0x60200001, // 0022 GETGBL R8 G1 - 0x60240018, // 0023 GETGBL R9 G24 - 0x58280007, // 0024 LDCONST R10 K7 - 0x5C2C0A00, // 0025 MOVE R11 R5 - 0x5C300C00, // 0026 MOVE R12 R6 - 0x7C240600, // 0027 CALL R9 3 - 0x7C200200, // 0028 CALL R8 1 - 0x80001000, // 0029 RET 0 - 0x8C200F08, // 002A GETMET R8 R7 K8 - 0x5C280A00, // 002B MOVE R10 R5 - 0x7C200400, // 002C CALL R8 2 - 0x4C240000, // 002D LDNIL R9 - 0x20240C09, // 002E NE R9 R6 R9 - 0x7826005F, // 002F JMPF R9 #0090 - 0x4C240000, // 0030 LDNIL R9 - 0x20240A09, // 0031 NE R9 R5 R9 - 0x7826005C, // 0032 JMPF R9 #0090 - 0x4C240000, // 0033 LDNIL R9 - 0x1C241009, // 0034 EQ R9 R8 R9 - 0x78260059, // 0035 JMPF R9 #0090 - 0x60240009, // 0036 GETGBL R9 G9 - 0x8C280302, // 0037 GETMET R10 R1 K2 - 0x58300009, // 0038 LDCONST R12 K9 - 0x7C280400, // 0039 CALL R10 2 - 0x7C240200, // 003A CALL R9 1 - 0x4C280000, // 003B LDNIL R10 - 0x4C2C0000, // 003C LDNIL R11 - 0x4C300000, // 003D LDNIL R12 - 0x2030120C, // 003E NE R12 R9 R12 - 0x78320007, // 003F JMPF R12 #0048 - 0x8C300F08, // 0040 GETMET R12 R7 K8 - 0x5C381200, // 0041 MOVE R14 R9 - 0x7C300400, // 0042 CALL R12 2 - 0x5C281800, // 0043 MOVE R10 R12 - 0x4C300000, // 0044 LDNIL R12 - 0x2030140C, // 0045 NE R12 R10 R12 - 0x78320000, // 0046 JMPF R12 #0048 - 0x882C150A, // 0047 GETMBR R11 R10 K10 - 0x4C300000, // 0048 LDNIL R12 - 0x1C30160C, // 0049 EQ R12 R11 R12 - 0x78320002, // 004A JMPF R12 #004E - 0x8C300F0B, // 004B GETMET R12 R7 K11 - 0x7C300200, // 004C CALL R12 1 - 0x5C2C1800, // 004D MOVE R11 R12 - 0x8C30090C, // 004E GETMET R12 R4 K12 - 0x5C380000, // 004F MOVE R14 R0 - 0x003E1A06, // 0050 ADD R15 K13 R6 - 0x7C300600, // 0051 CALL R12 3 - 0x4C340000, // 0052 LDNIL R13 - 0x4C380000, // 0053 LDNIL R14 - 0x1C38180E, // 0054 EQ R14 R12 R14 - 0x783A0010, // 0055 JMPF R14 #0067 - 0x8C38090C, // 0056 GETMET R14 R4 K12 - 0x5C400600, // 0057 MOVE R16 R3 - 0x5C440C00, // 0058 MOVE R17 R6 - 0x7C380600, // 0059 CALL R14 3 - 0x4C3C0000, // 005A LDNIL R15 - 0x203C1C0F, // 005B NE R15 R14 R15 - 0x783E0009, // 005C JMPF R15 #0067 - 0x603C0004, // 005D GETGBL R15 G4 - 0x5C401C00, // 005E MOVE R16 R14 - 0x7C3C0200, // 005F CALL R15 1 - 0x1C3C1F0E, // 0060 EQ R15 R15 K14 - 0x783E0004, // 0061 JMPF R15 #0067 - 0x5C3C1C00, // 0062 MOVE R15 R14 - 0x5C401600, // 0063 MOVE R16 R11 - 0x7C3C0200, // 0064 CALL R15 1 - 0x5C341E00, // 0065 MOVE R13 R15 - 0x8830010F, // 0066 GETMBR R12 R0 K15 - 0x4C380000, // 0067 LDNIL R14 - 0x1C38180E, // 0068 EQ R14 R12 R14 - 0x783A000F, // 0069 JMPF R14 #007A - 0x8C380910, // 006A GETMET R14 R4 K16 - 0x5C400C00, // 006B MOVE R16 R6 - 0x7C380400, // 006C CALL R14 2 - 0x4C3C0000, // 006D LDNIL R15 - 0x203C1C0F, // 006E NE R15 R14 R15 - 0x783E0009, // 006F JMPF R15 #007A - 0x603C0004, // 0070 GETGBL R15 G4 - 0x5C401C00, // 0071 MOVE R16 R14 - 0x7C3C0200, // 0072 CALL R15 1 - 0x1C3C1F0E, // 0073 EQ R15 R15 K14 - 0x783E0004, // 0074 JMPF R15 #007A - 0x5C3C1C00, // 0075 MOVE R15 R14 - 0x5C401600, // 0076 MOVE R16 R11 - 0x7C3C0200, // 0077 CALL R15 1 - 0x5C341E00, // 0078 MOVE R13 R15 - 0x8830010F, // 0079 GETMBR R12 R0 K15 - 0x4C380000, // 007A LDNIL R14 - 0x1C38180E, // 007B EQ R14 R12 R14 - 0x783A0006, // 007C JMPF R14 #0084 - 0x60380001, // 007D GETGBL R14 G1 - 0x603C0018, // 007E GETGBL R15 G24 - 0x58400011, // 007F LDCONST R16 K17 - 0x5C440C00, // 0080 MOVE R17 R6 - 0x7C3C0400, // 0081 CALL R15 2 - 0x7C380200, // 0082 CALL R14 1 - 0x80001C00, // 0083 RET 0 - 0x5C381800, // 0084 MOVE R14 R12 - 0x5C3C1600, // 0085 MOVE R15 R11 - 0x5C400400, // 0086 MOVE R16 R2 - 0x5C440200, // 0087 MOVE R17 R1 - 0x5C481A00, // 0088 MOVE R18 R13 - 0x5C4C1400, // 0089 MOVE R19 R10 - 0x7C380A00, // 008A CALL R14 5 - 0x5C201C00, // 008B MOVE R8 R14 - 0x8C380F12, // 008C GETMET R14 R7 K18 - 0x5C400A00, // 008D MOVE R16 R5 - 0x5C441000, // 008E MOVE R17 R8 - 0x7C380600, // 008F CALL R14 3 - 0x1C240B06, // 0090 EQ R9 R5 K6 - 0x7826000F, // 0091 JMPF R9 #00A2 - 0x4C240000, // 0092 LDNIL R9 - 0x20240C09, // 0093 NE R9 R6 R9 - 0x78260006, // 0094 JMPF R9 #009C - 0x60240001, // 0095 GETGBL R9 G1 - 0x60280018, // 0096 GETGBL R10 G24 - 0x582C0013, // 0097 LDCONST R11 K19 - 0x5C300C00, // 0098 MOVE R12 R6 - 0x7C280400, // 0099 CALL R10 2 - 0x7C240200, // 009A CALL R9 1 - 0x80001200, // 009B RET 0 - 0x8C240105, // 009C GETMET R9 R0 K5 - 0x7C240200, // 009D CALL R9 1 - 0x8C241308, // 009E GETMET R9 R9 K8 - 0x582C0006, // 009F LDCONST R11 K6 - 0x7C240400, // 00A0 CALL R9 2 - 0x5C201200, // 00A1 MOVE R8 R9 - 0x4C240000, // 00A2 LDNIL R9 - 0x20241009, // 00A3 NE R9 R8 R9 - 0x7826000C, // 00A4 JMPF R9 #00B2 - 0x60240010, // 00A5 GETGBL R9 G16 - 0x8C280314, // 00A6 GETMET R10 R1 K20 - 0x7C280200, // 00A7 CALL R10 1 - 0x7C240200, // 00A8 CALL R9 1 - 0xA8020004, // 00A9 EXBLK 0 #00AF - 0x5C281200, // 00AA MOVE R10 R9 - 0x7C280000, // 00AB CALL R10 0 - 0x942C020A, // 00AC GETIDX R11 R1 R10 - 0x9020140B, // 00AD SETMBR R8 R10 R11 - 0x7001FFFA, // 00AE JMP #00AA - 0x58240015, // 00AF LDCONST R9 K21 - 0xAC240200, // 00B0 CATCH R9 1 0 - 0xB0080000, // 00B1 RAISE 2 R0 R0 - 0x4C240000, // 00B2 LDNIL R9 - 0x20241009, // 00B3 NE R9 R8 R9 - 0x78260001, // 00B4 JMPF R9 #00B7 - 0x8C241116, // 00B5 GETMET R9 R8 K22 - 0x7C240200, // 00B6 CALL R9 1 - 0x4C240000, // 00B7 LDNIL R9 - 0x60280008, // 00B8 GETGBL R10 G8 - 0x8C2C0302, // 00B9 GETMET R11 R1 K2 - 0x58340017, // 00BA LDCONST R13 K23 - 0x7C2C0400, // 00BB CALL R11 2 - 0x7C280200, // 00BC CALL R10 1 - 0x202C1518, // 00BD NE R11 R10 K24 - 0x782E0012, // 00BE JMPF R11 #00D2 - 0xA8020005, // 00BF EXBLK 0 #00C6 - 0x602C000D, // 00C0 GETGBL R11 G13 - 0x5C301400, // 00C1 MOVE R12 R10 - 0x7C2C0200, // 00C2 CALL R11 1 - 0x5C241600, // 00C3 MOVE R9 R11 - 0xA8040001, // 00C4 EXBLK 1 1 - 0x7002000B, // 00C5 JMP #00D2 - 0xAC2C0002, // 00C6 CATCH R11 0 2 - 0x70020008, // 00C7 JMP #00D1 - 0x60340001, // 00C8 GETGBL R13 G1 - 0x60380018, // 00C9 GETGBL R14 G24 - 0x583C0019, // 00CA LDCONST R15 K25 - 0x5C401400, // 00CB MOVE R16 R10 - 0x5C441600, // 00CC MOVE R17 R11 - 0x5C481800, // 00CD MOVE R18 R12 - 0x7C380800, // 00CE CALL R14 4 - 0x7C340200, // 00CF CALL R13 1 - 0x70020000, // 00D0 JMP #00D2 - 0xB0080000, // 00D1 RAISE 2 R0 R0 - 0x4C2C0000, // 00D2 LDNIL R11 - 0x202C120B, // 00D3 NE R11 R9 R11 - 0x782E0018, // 00D4 JMPF R11 #00EE - 0xA802000B, // 00D5 EXBLK 0 #00E2 - 0x5C2C1200, // 00D6 MOVE R11 R9 - 0x7C2C0000, // 00D7 CALL R11 0 - 0x60300004, // 00D8 GETGBL R12 G4 - 0x5C341600, // 00D9 MOVE R13 R11 - 0x7C300200, // 00DA CALL R12 1 - 0x1C30191A, // 00DB EQ R12 R12 K26 - 0x78320002, // 00DC JMPF R12 #00E0 - 0x5C301600, // 00DD MOVE R12 R11 - 0x5C341000, // 00DE MOVE R13 R8 - 0x7C300200, // 00DF CALL R12 1 - 0xA8040001, // 00E0 EXBLK 1 1 - 0x7002000B, // 00E1 JMP #00EE - 0xAC2C0002, // 00E2 CATCH R11 0 2 - 0x70020008, // 00E3 JMP #00ED - 0x60340001, // 00E4 GETGBL R13 G1 - 0x60380018, // 00E5 GETGBL R14 G24 - 0x583C001B, // 00E6 LDCONST R15 K27 - 0x5C401400, // 00E7 MOVE R16 R10 - 0x5C441600, // 00E8 MOVE R17 R11 - 0x5C481800, // 00E9 MOVE R18 R12 - 0x7C380800, // 00EA CALL R14 4 - 0x7C340200, // 00EB CALL R13 1 - 0x70020000, // 00EC JMP #00EE - 0xB0080000, // 00ED RAISE 2 R0 R0 - 0x80000000, // 00EE RET 0 - }) - ) -); -/*******************************************************************/ - - -/******************************************************************** -** Solidified function: page_show -********************************************************************/ -be_local_closure(class_HASPmota_page_show, /* name */ - be_nested_proto( - 13, /* nstack */ - 4, /* argc */ - 10, /* varg */ - 0, /* has upvals */ - NULL, /* no upvals */ - 1, /* has sup protos */ - ( &(const struct bproto*[ 1]) { - be_nested_proto( - 6, /* nstack */ - 3, /* argc */ - 0, /* varg */ - 0, /* has upvals */ - NULL, /* no upvals */ - 0, /* has sup protos */ - NULL, /* no sub protos */ - 1, /* has constants */ - ( &(const bvalue[ 1]) { /* constants */ - /* K0 */ be_nested_str_weak(find), - }), - be_str_weak(to_page_resolve), - &be_const_str_solidified, - ( &(const binstruction[13]) { /* code */ - 0x4C0C0000, // 0000 LDNIL R3 - 0x200C0003, // 0001 NE R3 R0 R3 - 0x780E0007, // 0002 JMPF R3 #000B - 0x8C0C0500, // 0003 GETMET R3 R2 K0 - 0x5C140000, // 0004 MOVE R5 R0 - 0x7C0C0400, // 0005 CALL R3 2 - 0x4C100000, // 0006 LDNIL R4 - 0x200C0604, // 0007 NE R3 R3 R4 - 0x780E0001, // 0008 JMPF R3 #000B - 0x80040000, // 0009 RET 1 R0 - 0x70020000, // 000A JMP #000C - 0x80040200, // 000B RET 1 R1 - 0x80000000, // 000C RET 0 - }) - ), - }), - 1, /* has constants */ - &be_ktab_class_HASPmota, /* shared constants */ - be_str_weak(page_show), - &be_const_str_solidified, - ( &(const binstruction[108]) { /* code */ - 0x84100000, // 0000 CLOSURE R4 P0 - 0x4C140000, // 0001 LDNIL R5 - 0x8C18011C, // 0002 GETMET R6 R0 K28 - 0x7C180200, // 0003 CALL R6 1 - 0x8C1C011D, // 0004 GETMET R7 R0 K29 - 0x8824011E, // 0005 GETMBR R9 R0 K30 - 0x7C1C0400, // 0006 CALL R7 2 - 0x6020000C, // 0007 GETGBL R8 G12 - 0x5C240E00, // 0008 MOVE R9 R7 - 0x7C200200, // 0009 CALL R8 1 - 0x1820111F, // 000A LE R8 R8 K31 - 0x78220001, // 000B JMPF R8 #000E - 0x4C200000, // 000C LDNIL R8 - 0x80041000, // 000D RET 1 R8 - 0x1C200320, // 000E EQ R8 R1 K32 - 0x78220009, // 000F JMPF R8 #001A - 0x5C200800, // 0010 MOVE R8 R4 - 0x60240009, // 0011 GETGBL R9 G9 - 0x88280D20, // 0012 GETMBR R10 R6 K32 - 0x7C240200, // 0013 CALL R9 1 - 0x5429FFFE, // 0014 LDINT R10 -1 - 0x94280E0A, // 0015 GETIDX R10 R7 R10 - 0x5C2C0E00, // 0016 MOVE R11 R7 - 0x7C200600, // 0017 CALL R8 3 - 0x5C141000, // 0018 MOVE R5 R8 - 0x70020041, // 0019 JMP #005C - 0x1C200321, // 001A EQ R8 R1 K33 - 0x78220008, // 001B JMPF R8 #0025 - 0x5C200800, // 001C MOVE R8 R4 - 0x60240009, // 001D GETGBL R9 G9 - 0x88280D21, // 001E GETMBR R10 R6 K33 - 0x7C240200, // 001F CALL R9 1 - 0x94280F1F, // 0020 GETIDX R10 R7 K31 - 0x5C2C0E00, // 0021 MOVE R11 R7 - 0x7C200600, // 0022 CALL R8 3 - 0x5C141000, // 0023 MOVE R5 R8 - 0x70020036, // 0024 JMP #005C - 0x1C200322, // 0025 EQ R8 R1 K34 - 0x7822000B, // 0026 JMPF R8 #0033 - 0x5C200800, // 0027 MOVE R8 R4 - 0x60240009, // 0028 GETGBL R9 G9 - 0x88280D22, // 0029 GETMBR R10 R6 K34 - 0x7C240200, // 002A CALL R9 1 - 0x8C28011D, // 002B GETMET R10 R0 K29 - 0x4C300000, // 002C LDNIL R12 - 0x7C280400, // 002D CALL R10 2 - 0x94281506, // 002E GETIDX R10 R10 K6 - 0x5C2C0E00, // 002F MOVE R11 R7 - 0x7C200600, // 0030 CALL R8 3 - 0x5C141000, // 0031 MOVE R5 R8 - 0x70020028, // 0032 JMP #005C - 0x1C200323, // 0033 EQ R8 R1 K35 - 0x78220017, // 0034 JMPF R8 #004D - 0x5C200800, // 0035 MOVE R8 R4 - 0x60240009, // 0036 GETGBL R9 G9 - 0x88280D22, // 0037 GETMBR R10 R6 K34 - 0x7C240200, // 0038 CALL R9 1 - 0x8C28011D, // 0039 GETMET R10 R0 K29 - 0x4C300000, // 003A LDNIL R12 - 0x7C280400, // 003B CALL R10 2 - 0x94281506, // 003C GETIDX R10 R10 K6 - 0x5C2C0E00, // 003D MOVE R11 R7 - 0x7C200600, // 003E CALL R8 3 - 0x5C141000, // 003F MOVE R5 R8 - 0x8C200D03, // 0040 GETMET R8 R6 K3 - 0x7C200200, // 0041 CALL R8 1 - 0x1C200A08, // 0042 EQ R8 R5 R8 - 0x78220007, // 0043 JMPF R8 #004C - 0x5C200800, // 0044 MOVE R8 R4 - 0x60240009, // 0045 GETGBL R9 G9 - 0x88280D21, // 0046 GETMBR R10 R6 K33 - 0x7C240200, // 0047 CALL R9 1 - 0x94280F1F, // 0048 GETIDX R10 R7 K31 - 0x5C2C0E00, // 0049 MOVE R11 R7 - 0x7C200600, // 004A CALL R8 3 - 0x5C141000, // 004B MOVE R5 R8 - 0x7002000E, // 004C JMP #005C - 0x88200124, // 004D GETMBR R8 R0 K36 - 0x8C201125, // 004E GETMET R8 R8 K37 - 0x5C280200, // 004F MOVE R10 R1 - 0x7C200400, // 0050 CALL R8 2 - 0x78220009, // 0051 JMPF R8 #005C - 0x5C200800, // 0052 MOVE R8 R4 - 0x60240009, // 0053 GETGBL R9 G9 - 0x5429FFFE, // 0054 LDINT R10 -1 - 0x402A3E0A, // 0055 CONNECT R10 K31 R10 - 0x9428020A, // 0056 GETIDX R10 R1 R10 - 0x7C240200, // 0057 CALL R9 1 - 0x4C280000, // 0058 LDNIL R10 - 0x5C2C0E00, // 0059 MOVE R11 R7 - 0x7C200600, // 005A CALL R8 3 - 0x5C141000, // 005B MOVE R5 R8 - 0x4C200000, // 005C LDNIL R8 - 0x20200A08, // 005D NE R8 R5 R8 - 0x7822000B, // 005E JMPF R8 #006B - 0x24200B06, // 005F GT R8 R5 K6 - 0x78220009, // 0060 JMPF R8 #006B - 0x88200126, // 0061 GETMBR R8 R0 K38 - 0x94201005, // 0062 GETIDX R8 R8 R5 - 0x4C240000, // 0063 LDNIL R9 - 0x20241009, // 0064 NE R9 R8 R9 - 0x78260003, // 0065 JMPF R9 #006A - 0x8C241127, // 0066 GETMET R9 R8 K39 - 0x5C2C0400, // 0067 MOVE R11 R2 - 0x5C300600, // 0068 MOVE R12 R3 - 0x7C240600, // 0069 CALL R9 3 - 0x80041000, // 006A RET 1 R8 - 0x80000000, // 006B RET 0 - }) - ) -); -/*******************************************************************/ - - -/******************************************************************** -** Solidified function: _remove_page -********************************************************************/ -be_local_closure(class_HASPmota__remove_page, /* name */ - be_nested_proto( - 8, /* nstack */ + 9, /* nstack */ 2, /* argc */ 10, /* varg */ 0, /* has upvals */ @@ -12516,46 +12206,43 @@ be_local_closure(class_HASPmota__remove_page, /* name */ NULL, /* no sub protos */ 1, /* has constants */ &be_ktab_class_HASPmota, /* shared constants */ - be_str_weak(_remove_page), + be_str_weak(event_dispatch), &be_const_str_solidified, - ( &(const binstruction[37]) { /* code */ - 0x8C08011C, // 0000 GETMET R2 R0 K28 - 0x7C080200, // 0001 CALL R2 1 - 0x8C080503, // 0002 GETMET R2 R2 K3 - 0x7C080200, // 0003 CALL R2 1 - 0x1C0C0202, // 0004 EQ R3 R1 R2 - 0x780E0008, // 0005 JMPF R3 #000F - 0x8C0C0128, // 0006 GETMET R3 R0 K40 - 0x58140023, // 0007 LDCONST R5 K35 - 0x58180006, // 0008 LDCONST R6 K6 - 0x581C0006, // 0009 LDCONST R7 K6 - 0x7C0C0800, // 000A CALL R3 4 - 0x4C100000, // 000B LDNIL R4 - 0x1C100604, // 000C EQ R4 R3 R4 - 0x78120000, // 000D JMPF R4 #000F - 0x80000800, // 000E RET 0 - 0x880C0129, // 000F GETMBR R3 R0 K41 - 0x1C0C0601, // 0010 EQ R3 R3 R1 - 0x780E0001, // 0011 JMPF R3 #0014 - 0x880C011E, // 0012 GETMBR R3 R0 K30 - 0x90025203, // 0013 SETMBR R0 K41 R3 - 0x880C0126, // 0014 GETMBR R3 R0 K38 - 0x8C0C072A, // 0015 GETMET R3 R3 K42 - 0x5C140200, // 0016 MOVE R5 R1 - 0x7C0C0400, // 0017 CALL R3 2 - 0x780E0003, // 0018 JMPF R3 #001D - 0x880C0126, // 0019 GETMBR R3 R0 K38 - 0x8C0C072B, // 001A GETMET R3 R3 K43 - 0x5C140200, // 001B MOVE R5 R1 - 0x7C0C0400, // 001C CALL R3 2 - 0x600C0018, // 001D GETGBL R3 G24 - 0x5810002C, // 001E LDCONST R4 K44 - 0x5C140200, // 001F MOVE R5 R1 - 0x7C0C0400, // 0020 CALL R3 2 - 0xB8120000, // 0021 GETNGBL R4 K0 - 0x4C140000, // 0022 LDNIL R5 - 0x90100605, // 0023 SETMBR R4 R3 R5 - 0x80000000, // 0024 RET 0 + ( &(const binstruction[34]) { /* code */ + 0xA40A0000, // 0000 IMPORT R2 K0 + 0x8C0C0501, // 0001 GETMET R3 R2 K1 + 0x5C140200, // 0002 MOVE R5 R1 + 0x7C0C0400, // 0003 CALL R3 2 + 0x88100102, // 0004 GETMBR R4 R0 K2 + 0x78120002, // 0005 JMPF R4 #0009 + 0x88100102, // 0006 GETMBR R4 R0 K2 + 0x90120603, // 0007 SETMBR R4 K3 R3 + 0x70020004, // 0008 JMP #000E + 0xB8120800, // 0009 GETNGBL R4 K4 + 0x8C100905, // 000A GETMET R4 R4 K5 + 0x5C180600, // 000B MOVE R6 R3 + 0x7C100400, // 000C CALL R4 2 + 0x90020404, // 000D SETMBR R0 K2 R4 + 0x88100102, // 000E GETMBR R4 R0 K2 + 0x8C100906, // 000F GETMET R4 R4 K6 + 0x7C100200, // 0010 CALL R4 1 + 0x60140009, // 0011 GETGBL R5 G9 + 0x5C180800, // 0012 MOVE R6 R4 + 0x7C140200, // 0013 CALL R5 1 + 0x20140B07, // 0014 NE R5 R5 K7 + 0x7816000A, // 0015 JMPF R5 #0021 + 0x8C140508, // 0016 GETMET R5 R2 K8 + 0x5C1C0800, // 0017 MOVE R7 R4 + 0x7C140400, // 0018 CALL R5 2 + 0x60180004, // 0019 GETGBL R6 G4 + 0x5C1C0A00, // 001A MOVE R7 R5 + 0x7C180200, // 001B CALL R6 1 + 0x1C180D09, // 001C EQ R6 R6 K9 + 0x781A0002, // 001D JMPF R6 #0021 + 0x8C180B0A, // 001E GETMET R6 R5 K10 + 0x88200102, // 001F GETMBR R8 R0 K2 + 0x7C180400, // 0020 CALL R6 2 + 0x80000000, // 0021 RET 0 }) ) ); @@ -12563,38 +12250,11 @@ be_local_closure(class_HASPmota__remove_page, /* name */ /******************************************************************** -** Solidified function: get_page_cur_parsing +** Solidified function: page_dir_to ********************************************************************/ -be_local_closure(class_HASPmota_get_page_cur_parsing, /* name */ +be_local_closure(class_HASPmota_page_dir_to, /* name */ be_nested_proto( - 3, /* nstack */ - 1, /* argc */ - 10, /* varg */ - 0, /* has upvals */ - NULL, /* no upvals */ - 0, /* has sup protos */ - NULL, /* no sub protos */ - 1, /* has constants */ - &be_ktab_class_HASPmota, /* shared constants */ - be_str_weak(get_page_cur_parsing), - &be_const_str_solidified, - ( &(const binstruction[ 4]) { /* code */ - 0x88040126, // 0000 GETMBR R1 R0 K38 - 0x88080129, // 0001 GETMBR R2 R0 K41 - 0x94040202, // 0002 GETIDX R1 R1 R2 - 0x80040200, // 0003 RET 1 R1 - }) - ) -); -/*******************************************************************/ - - -/******************************************************************** -** Solidified function: _load -********************************************************************/ -be_local_closure(class_HASPmota__load, /* name */ - be_nested_proto( - 14, /* nstack */ + 7, /* nstack */ 2, /* argc */ 10, /* varg */ 0, /* has upvals */ @@ -12603,139 +12263,41 @@ be_local_closure(class_HASPmota__load, /* name */ NULL, /* no sub protos */ 1, /* has constants */ &be_ktab_class_HASPmota, /* shared constants */ - be_str_weak(_load), + be_str_weak(page_dir_to), &be_const_str_solidified, - ( &(const binstruction[99]) { /* code */ - 0xA40A5A00, // 0000 IMPORT R2 K45 - 0xA40E5C00, // 0001 IMPORT R3 K46 - 0x60100011, // 0002 GETGBL R4 G17 - 0x5C140200, // 0003 MOVE R5 R1 - 0x5818002F, // 0004 LDCONST R6 K47 - 0x7C100400, // 0005 CALL R4 2 - 0x8C140930, // 0006 GETMET R5 R4 K48 - 0x7C140200, // 0007 CALL R5 1 - 0x8C180931, // 0008 GETMET R6 R4 K49 - 0x7C180200, // 0009 CALL R6 1 - 0x8C180532, // 000A GETMET R6 R2 K50 - 0x5C200A00, // 000B MOVE R8 R5 - 0x58240033, // 000C LDCONST R9 K51 - 0x7C180600, // 000D CALL R6 3 - 0x4C100000, // 000E LDNIL R4 - 0x4C140000, // 000F LDNIL R5 - 0x601C000C, // 0010 GETGBL R7 G12 - 0x5C200C00, // 0011 MOVE R8 R6 - 0x7C1C0200, // 0012 CALL R7 1 - 0x241C0F06, // 0013 GT R7 R7 K6 - 0x781E0039, // 0014 JMPF R7 #004F - 0x8C1C0734, // 0015 GETMET R7 R3 K52 - 0x94240D06, // 0016 GETIDX R9 R6 K6 - 0x7C1C0400, // 0017 CALL R7 2 - 0x60200004, // 0018 GETGBL R8 G4 - 0x5C240E00, // 0019 MOVE R9 R7 - 0x7C200200, // 001A CALL R8 1 - 0x1C201135, // 001B EQ R8 R8 K53 - 0x7822001B, // 001C JMPF R8 #0039 - 0xB8226C00, // 001D GETNGBL R8 K54 - 0x8C201137, // 001E GETMET R8 R8 K55 - 0x542A0003, // 001F LDINT R10 4 - 0x7C200400, // 0020 CALL R8 2 - 0x78220007, // 0021 JMPF R8 #002A - 0xB8226C00, // 0022 GETNGBL R8 K54 - 0x8C201138, // 0023 GETMET R8 R8 K56 - 0x60280018, // 0024 GETGBL R10 G24 - 0x582C0039, // 0025 LDCONST R11 K57 - 0x94300D06, // 0026 GETIDX R12 R6 K6 - 0x7C280400, // 0027 CALL R10 2 - 0x542E0003, // 0028 LDINT R11 4 - 0x7C200600, // 0029 CALL R8 3 - 0x8C20013A, // 002A GETMET R8 R0 K58 - 0x5C280E00, // 002B MOVE R10 R7 - 0x7C200400, // 002C CALL R8 2 - 0x88200126, // 002D GETMBR R8 R0 K38 - 0x4C240000, // 002E LDNIL R9 - 0x1C201009, // 002F EQ R8 R8 R9 - 0x78220000, // 0030 JMPF R8 #0032 - 0xB006773C, // 0031 RAISE 1 K59 K60 - 0x8C20013D, // 0032 GETMET R8 R0 K61 - 0x5C280E00, // 0033 MOVE R10 R7 - 0x882C0126, // 0034 GETMBR R11 R0 K38 - 0x88300129, // 0035 GETMBR R12 R0 K41 - 0x942C160C, // 0036 GETIDX R11 R11 R12 - 0x7C200600, // 0037 CALL R8 3 - 0x70020010, // 0038 JMP #004A - 0x6020000C, // 0039 GETGBL R8 G12 - 0x8C24053E, // 003A GETMET R9 R2 K62 - 0x942C0D06, // 003B GETIDX R11 R6 K6 - 0x5830003F, // 003C LDCONST R12 K63 - 0x58340040, // 003D LDCONST R13 K64 - 0x7C240800, // 003E CALL R9 4 - 0x7C200200, // 003F CALL R8 1 - 0x24201106, // 0040 GT R8 R8 K6 - 0x78220007, // 0041 JMPF R8 #004A - 0xB8226C00, // 0042 GETNGBL R8 K54 - 0x8C201138, // 0043 GETMET R8 R8 K56 - 0x60280018, // 0044 GETGBL R10 G24 - 0x582C0041, // 0045 LDCONST R11 K65 - 0x94300D06, // 0046 GETIDX R12 R6 K6 - 0x7C280400, // 0047 CALL R10 2 - 0x582C0042, // 0048 LDCONST R11 K66 - 0x7C200600, // 0049 CALL R8 3 - 0x4C1C0000, // 004A LDNIL R7 - 0x8C200D2B, // 004B GETMET R8 R6 K43 - 0x58280006, // 004C LDCONST R10 K6 - 0x7C200400, // 004D CALL R8 2 - 0x7001FFC0, // 004E JMP #0010 - 0x4C180000, // 004F LDNIL R6 - 0x8C1C011D, // 0050 GETMET R7 R0 K29 - 0x4C240000, // 0051 LDNIL R9 - 0x7C1C0400, // 0052 CALL R7 2 - 0x6020000C, // 0053 GETGBL R8 G12 - 0x5C240E00, // 0054 MOVE R9 R7 - 0x7C200200, // 0055 CALL R8 1 - 0x1C201106, // 0056 EQ R8 R8 K6 - 0x78220000, // 0057 JMPF R8 #0059 - 0xB0067743, // 0058 RAISE 1 K59 K67 - 0x94200F06, // 0059 GETIDX R8 R7 K6 - 0x90023C08, // 005A SETMBR R0 K30 R8 - 0x88200126, // 005B GETMBR R8 R0 K38 - 0x8824011E, // 005C GETMBR R9 R0 K30 - 0x94201009, // 005D GETIDX R8 R8 R9 - 0x8C201127, // 005E GETMET R8 R8 K39 - 0x58280006, // 005F LDCONST R10 K6 - 0x582C0006, // 0060 LDCONST R11 K6 - 0x7C200600, // 0061 CALL R8 3 - 0x80000000, // 0062 RET 0 - }) - ) -); -/*******************************************************************/ - - -/******************************************************************** -** Solidified function: init -********************************************************************/ -be_local_closure(class_HASPmota_init, /* name */ - be_nested_proto( - 5, /* nstack */ - 1, /* argc */ - 10, /* varg */ - 0, /* has upvals */ - NULL, /* no upvals */ - 0, /* has sup protos */ - NULL, /* no sub protos */ - 1, /* has constants */ - &be_ktab_class_HASPmota, /* shared constants */ - be_str_weak(init), - &be_const_str_solidified, - ( &(const binstruction[ 8]) { /* code */ - 0x8C040144, // 0000 GETMET R1 R0 K68 - 0x7C040200, // 0001 CALL R1 1 - 0xA4068A00, // 0002 IMPORT R1 K69 - 0x8C080346, // 0003 GETMET R2 R1 K70 - 0x58100047, // 0004 LDCONST R4 K71 - 0x7C080400, // 0005 CALL R2 2 - 0x90024802, // 0006 SETMBR R0 K36 R2 - 0x80000000, // 0007 RET 0 + ( &(const binstruction[32]) { /* code */ + 0x8C08010B, // 0000 GETMET R2 R0 K11 + 0x58100007, // 0001 LDCONST R4 K7 + 0x7C080400, // 0002 CALL R2 2 + 0x4C0C0000, // 0003 LDNIL R3 + 0x1C0C0403, // 0004 EQ R3 R2 R3 + 0x780E0000, // 0005 JMPF R3 #0007 + 0x80060E00, // 0006 RET 1 K7 + 0x600C000C, // 0007 GETGBL R3 G12 + 0x5C100400, // 0008 MOVE R4 R2 + 0x7C0C0200, // 0009 CALL R3 1 + 0x1810070C, // 000A LE R4 R3 K12 + 0x78120000, // 000B JMPF R4 #000D + 0x80060E00, // 000C RET 1 K7 + 0x1C10070D, // 000D EQ R4 R3 K13 + 0x78120000, // 000E JMPF R4 #0010 + 0x80061800, // 000F RET 1 K12 + 0x8C10050E, // 0010 GETMET R4 R2 K14 + 0x5C180200, // 0011 MOVE R6 R1 + 0x7C100400, // 0012 CALL R4 2 + 0x4C140000, // 0013 LDNIL R5 + 0x1C140805, // 0014 EQ R5 R4 R5 + 0x78160000, // 0015 JMPF R5 #0017 + 0x80060E00, // 0016 RET 1 K7 + 0x0014070C, // 0017 ADD R5 R3 K12 + 0x0C140B0D, // 0018 DIV R5 R5 K13 + 0x18140805, // 0019 LE R5 R4 R5 + 0x78160001, // 001A JMPF R5 #001D + 0x80061800, // 001B RET 1 K12 + 0x70020001, // 001C JMP #001F + 0x5415FFFE, // 001D LDINT R5 -1 + 0x80040A00, // 001E RET 1 R5 + 0x80000000, // 001F RET 0 }) ) ); @@ -12759,64 +12321,64 @@ be_local_closure(class_HASPmota_parse_page, /* name */ be_str_weak(parse_page), &be_const_str_solidified, ( &(const binstruction[59]) { /* code */ - 0x8C080348, // 0000 GETMET R2 R1 K72 - 0x58100049, // 0001 LDCONST R4 K73 + 0x8C08030F, // 0000 GETMET R2 R1 K15 + 0x58100010, // 0001 LDCONST R4 K16 0x7C080400, // 0002 CALL R2 2 0x780A0035, // 0003 JMPF R2 #003A 0x60080004, // 0004 GETGBL R2 G4 - 0x940C0349, // 0005 GETIDX R3 R1 K73 + 0x940C0310, // 0005 GETIDX R3 R1 K16 0x7C080200, // 0006 CALL R2 1 - 0x1C08054A, // 0007 EQ R2 R2 K74 + 0x1C080511, // 0007 EQ R2 R2 K17 0x780A0030, // 0008 JMPF R2 #003A 0x60080009, // 0009 GETGBL R2 G9 - 0x940C0349, // 000A GETIDX R3 R1 K73 + 0x940C0310, // 000A GETIDX R3 R1 K16 0x7C080200, // 000B CALL R2 1 - 0x90025202, // 000C SETMBR R0 K41 R2 - 0x880C011E, // 000D GETMBR R3 R0 K30 + 0x90022402, // 000C SETMBR R0 K18 R2 + 0x880C0113, // 000D GETMBR R3 R0 K19 0x4C100000, // 000E LDNIL R4 0x1C0C0604, // 000F EQ R3 R3 R4 0x780E0000, // 0010 JMPF R3 #0012 - 0x90023C02, // 0011 SETMBR R0 K30 R2 - 0x880C0126, // 0012 GETMBR R3 R0 K38 - 0x8C0C072A, // 0013 GETMET R3 R3 K42 + 0x90022602, // 0011 SETMBR R0 K19 R2 + 0x880C0114, // 0012 GETMBR R3 R0 K20 + 0x8C0C0715, // 0013 GETMET R3 R3 K21 0x5C140400, // 0014 MOVE R5 R2 0x7C0C0400, // 0015 CALL R3 2 0x740E0006, // 0016 JMPT R3 #001E - 0x880C014B, // 0017 GETMBR R3 R0 K75 - 0x88100126, // 0018 GETMBR R4 R0 K38 + 0x880C0116, // 0017 GETMBR R3 R0 K22 + 0x88100114, // 0018 GETMBR R4 R0 K20 0x5C140600, // 0019 MOVE R5 R3 0x5C180400, // 001A MOVE R6 R2 0x5C1C0000, // 001B MOVE R7 R0 0x7C140400, // 001C CALL R5 2 0x98100405, // 001D SETIDX R4 R2 R5 - 0x8C0C0302, // 001E GETMET R3 R1 K2 - 0x58140003, // 001F LDCONST R5 K3 + 0x8C0C030E, // 001E GETMET R3 R1 K14 + 0x58140017, // 001F LDCONST R5 K23 0x7C0C0400, // 0020 CALL R3 2 - 0x1C0C0706, // 0021 EQ R3 R3 K6 + 0x1C0C0707, // 0021 EQ R3 R3 K7 0x780E0016, // 0022 JMPF R3 #003A - 0x8C0C0105, // 0023 GETMET R3 R0 K5 + 0x8C0C0118, // 0023 GETMET R3 R0 K24 0x7C0C0200, // 0024 CALL R3 1 0x60100009, // 0025 GETGBL R4 G9 - 0x8C140302, // 0026 GETMET R5 R1 K2 - 0x581C0020, // 0027 LDCONST R7 K32 + 0x8C14030E, // 0026 GETMET R5 R1 K14 + 0x581C0019, // 0027 LDCONST R7 K25 0x4C200000, // 0028 LDNIL R8 0x7C140600, // 0029 CALL R5 3 0x7C100200, // 002A CALL R4 1 - 0x900E4004, // 002B SETMBR R3 K32 R4 + 0x900E3204, // 002B SETMBR R3 K25 R4 0x60100009, // 002C GETGBL R4 G9 - 0x8C140302, // 002D GETMET R5 R1 K2 - 0x581C0021, // 002E LDCONST R7 K33 + 0x8C14030E, // 002D GETMET R5 R1 K14 + 0x581C001A, // 002E LDCONST R7 K26 0x4C200000, // 002F LDNIL R8 0x7C140600, // 0030 CALL R5 3 0x7C100200, // 0031 CALL R4 1 - 0x900E4204, // 0032 SETMBR R3 K33 R4 + 0x900E3404, // 0032 SETMBR R3 K26 R4 0x60100009, // 0033 GETGBL R4 G9 - 0x8C140302, // 0034 GETMET R5 R1 K2 - 0x581C0022, // 0035 LDCONST R7 K34 + 0x8C14030E, // 0034 GETMET R5 R1 K14 + 0x581C001B, // 0035 LDCONST R7 K27 0x4C200000, // 0036 LDNIL R8 0x7C140600, // 0037 CALL R5 3 0x7C100200, // 0038 CALL R4 1 - 0x900E4404, // 0039 SETMBR R3 K34 R4 + 0x900E3604, // 0039 SETMBR R3 K27 R4 0x80000000, // 003A RET 0 }) ) @@ -12825,55 +12387,11 @@ be_local_closure(class_HASPmota_parse_page, /* name */ /******************************************************************** -** Solidified function: parse +** Solidified function: parse_obj ********************************************************************/ -be_local_closure(class_HASPmota_parse, /* name */ +be_local_closure(class_HASPmota_parse_obj, /* name */ be_nested_proto( - 9, /* nstack */ - 2, /* argc */ - 10, /* varg */ - 0, /* has upvals */ - NULL, /* no upvals */ - 0, /* has sup protos */ - NULL, /* no sub protos */ - 1, /* has constants */ - &be_ktab_class_HASPmota, /* shared constants */ - be_str_weak(parse), - &be_const_str_solidified, - ( &(const binstruction[21]) { /* code */ - 0xA40A5C00, // 0000 IMPORT R2 K46 - 0x8C0C0534, // 0001 GETMET R3 R2 K52 - 0x5C140200, // 0002 MOVE R5 R1 - 0x7C0C0400, // 0003 CALL R3 2 - 0x60100004, // 0004 GETGBL R4 G4 - 0x5C140600, // 0005 MOVE R5 R3 - 0x7C100200, // 0006 CALL R4 1 - 0x1C100935, // 0007 EQ R4 R4 K53 - 0x78120009, // 0008 JMPF R4 #0013 - 0x8C10013A, // 0009 GETMET R4 R0 K58 - 0x5C180600, // 000A MOVE R6 R3 - 0x7C100400, // 000B CALL R4 2 - 0x8C10013D, // 000C GETMET R4 R0 K61 - 0x5C180600, // 000D MOVE R6 R3 - 0x881C0126, // 000E GETMBR R7 R0 K38 - 0x8820011E, // 000F GETMBR R8 R0 K30 - 0x941C0E08, // 0010 GETIDX R7 R7 R8 - 0x7C100600, // 0011 CALL R4 3 - 0x70020000, // 0012 JMP #0014 - 0xB006774C, // 0013 RAISE 1 K59 K76 - 0x80000000, // 0014 RET 0 - }) - ) -); -/*******************************************************************/ - - -/******************************************************************** -** Solidified function: start -********************************************************************/ -be_local_closure(class_HASPmota_start, /* name */ - be_nested_proto( - 11, /* nstack */ + 20, /* nstack */ 3, /* argc */ 10, /* varg */ 0, /* has upvals */ @@ -12882,114 +12400,248 @@ be_local_closure(class_HASPmota_start, /* name */ NULL, /* no sub protos */ 1, /* has constants */ &be_ktab_class_HASPmota, /* shared constants */ - be_str_weak(start), + be_str_weak(parse_obj), &be_const_str_solidified, - ( &(const binstruction[105]) { /* code */ - 0xA40E9A00, // 0000 IMPORT R3 K77 - 0x4C100000, // 0001 LDNIL R4 - 0x1C100404, // 0002 EQ R4 R2 R4 - 0x78120000, // 0003 JMPF R4 #0005 - 0x8808014E, // 0004 GETMBR R2 R0 K78 - 0x8C10074F, // 0005 GETMET R4 R3 K79 - 0x5C180400, // 0006 MOVE R6 R2 - 0x7C100400, // 0007 CALL R4 2 - 0x74120002, // 0008 JMPT R4 #000C - 0x0012A002, // 0009 ADD R4 K80 R2 - 0x00100951, // 000A ADD R4 R4 K81 - 0xB006A404, // 000B RAISE 1 K82 R4 - 0xB812A600, // 000C GETNGBL R4 K83 - 0x8C100954, // 000D GETMET R4 R4 K84 - 0x7C100200, // 000E CALL R4 1 - 0x60100017, // 000F GETGBL R4 G23 - 0x5C140200, // 0010 MOVE R5 R1 - 0x7C100200, // 0011 CALL R4 1 - 0x9002AA04, // 0012 SETMBR R0 K85 R4 - 0xB812A600, // 0013 GETNGBL R4 K83 - 0x8C100957, // 0014 GETMET R4 R4 K87 - 0x7C100200, // 0015 CALL R4 1 - 0x9002AC04, // 0016 SETMBR R0 K86 R4 - 0xB812A600, // 0017 GETNGBL R4 K83 - 0x8C100959, // 0018 GETMET R4 R4 K89 - 0x7C100200, // 0019 CALL R4 1 - 0x9002B004, // 001A SETMBR R0 K88 R4 - 0xB812A600, // 001B GETNGBL R4 K83 - 0x8C10095B, // 001C GETMET R4 R4 K91 - 0x7C100200, // 001D CALL R4 1 - 0x9002B404, // 001E SETMBR R0 K90 R4 - 0xA8020007, // 001F EXBLK 0 #0028 - 0xB812A600, // 0020 GETNGBL R4 K83 - 0x8C10095D, // 0021 GETMET R4 R4 K93 - 0x5818005E, // 0022 LDCONST R6 K94 - 0x541E000F, // 0023 LDINT R7 16 - 0x7C100600, // 0024 CALL R4 3 - 0x9002B804, // 0025 SETMBR R0 K92 R4 - 0xA8040001, // 0026 EXBLK 1 1 - 0x70020009, // 0027 JMP #0032 - 0xAC100000, // 0028 CATCH R4 0 0 - 0x70020006, // 0029 JMP #0031 - 0xB812A600, // 002A GETNGBL R4 K83 - 0x8C10095D, // 002B GETMET R4 R4 K93 - 0x5818005F, // 002C LDCONST R6 K95 - 0x541E000D, // 002D LDINT R7 14 - 0x7C100600, // 002E CALL R4 3 - 0x9002B804, // 002F SETMBR R0 K92 R4 - 0x70020000, // 0030 JMP #0032 - 0xB0080000, // 0031 RAISE 2 R0 R0 - 0xB812A600, // 0032 GETNGBL R4 K83 - 0x8C100960, // 0033 GETMET R4 R4 K96 - 0x58180006, // 0034 LDCONST R6 K6 - 0xB81EA600, // 0035 GETNGBL R7 K83 - 0x8C1C0F61, // 0036 GETMET R7 R7 K97 - 0x58240062, // 0037 LDCONST R9 K98 - 0x7C1C0400, // 0038 CALL R7 2 - 0xB822A600, // 0039 GETNGBL R8 K83 - 0x8C201161, // 003A GETMET R8 R8 K97 - 0x58280063, // 003B LDCONST R10 K99 - 0x7C200400, // 003C CALL R8 2 - 0x88240155, // 003D GETMBR R9 R0 K85 - 0x8828015C, // 003E GETMBR R10 R0 K92 - 0x7C100C00, // 003F CALL R4 6 - 0x8814015A, // 0040 GETMBR R5 R0 K90 - 0x8C140B64, // 0041 GETMET R5 R5 K100 - 0x7C140200, // 0042 CALL R5 1 - 0x8C140B65, // 0043 GETMET R5 R5 K101 - 0x5C1C0800, // 0044 MOVE R7 R4 - 0x7C140400, // 0045 CALL R5 2 - 0x8814015A, // 0046 GETMBR R5 R0 K90 - 0x8C140B66, // 0047 GETMET R5 R5 K102 - 0x881C0155, // 0048 GETMBR R7 R0 K85 - 0x781E0004, // 0049 JMPF R7 #004F - 0xB81EA600, // 004A GETNGBL R7 K83 - 0x8C1C0F61, // 004B GETMET R7 R7 K97 - 0x58240006, // 004C LDCONST R9 K6 - 0x7C1C0400, // 004D CALL R7 2 - 0x70020003, // 004E JMP #0053 - 0xB81EA600, // 004F GETNGBL R7 K83 - 0x8C1C0F61, // 0050 GETMET R7 R7 K97 - 0x58240067, // 0051 LDCONST R9 K103 - 0x7C1C0400, // 0052 CALL R7 2 - 0x58200006, // 0053 LDCONST R8 K6 - 0x7C140600, // 0054 CALL R5 3 - 0xB816A600, // 0055 GETNGBL R5 K83 - 0x8C140B68, // 0056 GETMET R5 R5 K104 - 0xB81EA600, // 0057 GETNGBL R7 K83 - 0x8C1C0F69, // 0058 GETMET R7 R7 K105 - 0x7C1C0200, // 0059 CALL R7 1 - 0x7C140400, // 005A CALL R5 2 - 0xB816A600, // 005B GETNGBL R5 K83 - 0x8C140B69, // 005C GETMET R5 R5 K105 - 0x7C140200, // 005D CALL R5 1 - 0x8C140B6A, // 005E GETMET R5 R5 K106 - 0x581C0006, // 005F LDCONST R7 K6 - 0x58200006, // 0060 LDCONST R8 K6 - 0x7C140600, // 0061 CALL R5 3 - 0x60140013, // 0062 GETGBL R5 G19 - 0x7C140000, // 0063 CALL R5 0 - 0x90024C05, // 0064 SETMBR R0 K38 R5 - 0x8C14016B, // 0065 GETMET R5 R0 K107 - 0x5C1C0400, // 0066 MOVE R7 R2 - 0x7C140400, // 0067 CALL R5 2 - 0x80000000, // 0068 RET 0 + ( &(const binstruction[239]) { /* code */ + 0xA40E3800, // 0000 IMPORT R3 K28 + 0xA4120000, // 0001 IMPORT R4 K0 + 0x60140009, // 0002 GETGBL R5 G9 + 0x8C18030E, // 0003 GETMET R6 R1 K14 + 0x58200017, // 0004 LDCONST R8 K23 + 0x7C180400, // 0005 CALL R6 2 + 0x7C140200, // 0006 CALL R5 1 + 0x8C18030E, // 0007 GETMET R6 R1 K14 + 0x5820001D, // 0008 LDCONST R8 K29 + 0x7C180400, // 0009 CALL R6 2 + 0x4C1C0000, // 000A LDNIL R7 + 0x201C0C07, // 000B NE R7 R6 R7 + 0x781E0003, // 000C JMPF R7 #0011 + 0x601C0008, // 000D GETGBL R7 G8 + 0x5C200C00, // 000E MOVE R8 R6 + 0x7C1C0200, // 000F CALL R7 1 + 0x70020000, // 0010 JMP #0012 + 0x4C1C0000, // 0011 LDNIL R7 + 0x5C180E00, // 0012 MOVE R6 R7 + 0x8C1C0118, // 0013 GETMET R7 R0 K24 + 0x7C1C0200, // 0014 CALL R7 1 + 0x4C200000, // 0015 LDNIL R8 + 0x20200A08, // 0016 NE R8 R5 R8 + 0x78220011, // 0017 JMPF R8 #002A + 0x14200B07, // 0018 LT R8 R5 K7 + 0x74220002, // 0019 JMPT R8 #001D + 0x542200FD, // 001A LDINT R8 254 + 0x24200A08, // 001B GT R8 R5 R8 + 0x7822000C, // 001C JMPF R8 #002A + 0x20200B07, // 001D NE R8 R5 K7 + 0x74220002, // 001E JMPT R8 #0022 + 0x4C200000, // 001F LDNIL R8 + 0x1C200C08, // 0020 EQ R8 R6 R8 + 0x78220007, // 0021 JMPF R8 #002A + 0x60200001, // 0022 GETGBL R8 G1 + 0x60240018, // 0023 GETGBL R9 G24 + 0x5828001E, // 0024 LDCONST R10 K30 + 0x5C2C0A00, // 0025 MOVE R11 R5 + 0x5C300C00, // 0026 MOVE R12 R6 + 0x7C240600, // 0027 CALL R9 3 + 0x7C200200, // 0028 CALL R8 1 + 0x80001000, // 0029 RET 0 + 0x8C200F1F, // 002A GETMET R8 R7 K31 + 0x5C280A00, // 002B MOVE R10 R5 + 0x7C200400, // 002C CALL R8 2 + 0x4C240000, // 002D LDNIL R9 + 0x20240C09, // 002E NE R9 R6 R9 + 0x7826005F, // 002F JMPF R9 #0090 + 0x4C240000, // 0030 LDNIL R9 + 0x20240A09, // 0031 NE R9 R5 R9 + 0x7826005C, // 0032 JMPF R9 #0090 + 0x4C240000, // 0033 LDNIL R9 + 0x1C241009, // 0034 EQ R9 R8 R9 + 0x78260059, // 0035 JMPF R9 #0090 + 0x60240009, // 0036 GETGBL R9 G9 + 0x8C28030E, // 0037 GETMET R10 R1 K14 + 0x58300020, // 0038 LDCONST R12 K32 + 0x7C280400, // 0039 CALL R10 2 + 0x7C240200, // 003A CALL R9 1 + 0x4C280000, // 003B LDNIL R10 + 0x4C2C0000, // 003C LDNIL R11 + 0x4C300000, // 003D LDNIL R12 + 0x2030120C, // 003E NE R12 R9 R12 + 0x78320007, // 003F JMPF R12 #0048 + 0x8C300F1F, // 0040 GETMET R12 R7 K31 + 0x5C381200, // 0041 MOVE R14 R9 + 0x7C300400, // 0042 CALL R12 2 + 0x5C281800, // 0043 MOVE R10 R12 + 0x4C300000, // 0044 LDNIL R12 + 0x2030140C, // 0045 NE R12 R10 R12 + 0x78320000, // 0046 JMPF R12 #0048 + 0x882C1521, // 0047 GETMBR R11 R10 K33 + 0x4C300000, // 0048 LDNIL R12 + 0x1C30160C, // 0049 EQ R12 R11 R12 + 0x78320002, // 004A JMPF R12 #004E + 0x8C300F22, // 004B GETMET R12 R7 K34 + 0x7C300200, // 004C CALL R12 1 + 0x5C2C1800, // 004D MOVE R11 R12 + 0x8C300923, // 004E GETMET R12 R4 K35 + 0x5C380000, // 004F MOVE R14 R0 + 0x003E4806, // 0050 ADD R15 K36 R6 + 0x7C300600, // 0051 CALL R12 3 + 0x4C340000, // 0052 LDNIL R13 + 0x4C380000, // 0053 LDNIL R14 + 0x1C38180E, // 0054 EQ R14 R12 R14 + 0x783A0010, // 0055 JMPF R14 #0067 + 0x8C380923, // 0056 GETMET R14 R4 K35 + 0x5C400600, // 0057 MOVE R16 R3 + 0x5C440C00, // 0058 MOVE R17 R6 + 0x7C380600, // 0059 CALL R14 3 + 0x4C3C0000, // 005A LDNIL R15 + 0x203C1C0F, // 005B NE R15 R14 R15 + 0x783E0009, // 005C JMPF R15 #0067 + 0x603C0004, // 005D GETGBL R15 G4 + 0x5C401C00, // 005E MOVE R16 R14 + 0x7C3C0200, // 005F CALL R15 1 + 0x1C3C1F25, // 0060 EQ R15 R15 K37 + 0x783E0004, // 0061 JMPF R15 #0067 + 0x5C3C1C00, // 0062 MOVE R15 R14 + 0x5C401600, // 0063 MOVE R16 R11 + 0x7C3C0200, // 0064 CALL R15 1 + 0x5C341E00, // 0065 MOVE R13 R15 + 0x88300126, // 0066 GETMBR R12 R0 K38 + 0x4C380000, // 0067 LDNIL R14 + 0x1C38180E, // 0068 EQ R14 R12 R14 + 0x783A000F, // 0069 JMPF R14 #007A + 0x8C380927, // 006A GETMET R14 R4 K39 + 0x5C400C00, // 006B MOVE R16 R6 + 0x7C380400, // 006C CALL R14 2 + 0x4C3C0000, // 006D LDNIL R15 + 0x203C1C0F, // 006E NE R15 R14 R15 + 0x783E0009, // 006F JMPF R15 #007A + 0x603C0004, // 0070 GETGBL R15 G4 + 0x5C401C00, // 0071 MOVE R16 R14 + 0x7C3C0200, // 0072 CALL R15 1 + 0x1C3C1F25, // 0073 EQ R15 R15 K37 + 0x783E0004, // 0074 JMPF R15 #007A + 0x5C3C1C00, // 0075 MOVE R15 R14 + 0x5C401600, // 0076 MOVE R16 R11 + 0x7C3C0200, // 0077 CALL R15 1 + 0x5C341E00, // 0078 MOVE R13 R15 + 0x88300126, // 0079 GETMBR R12 R0 K38 + 0x4C380000, // 007A LDNIL R14 + 0x1C38180E, // 007B EQ R14 R12 R14 + 0x783A0006, // 007C JMPF R14 #0084 + 0x60380001, // 007D GETGBL R14 G1 + 0x603C0018, // 007E GETGBL R15 G24 + 0x58400028, // 007F LDCONST R16 K40 + 0x5C440C00, // 0080 MOVE R17 R6 + 0x7C3C0400, // 0081 CALL R15 2 + 0x7C380200, // 0082 CALL R14 1 + 0x80001C00, // 0083 RET 0 + 0x5C381800, // 0084 MOVE R14 R12 + 0x5C3C1600, // 0085 MOVE R15 R11 + 0x5C400400, // 0086 MOVE R16 R2 + 0x5C440200, // 0087 MOVE R17 R1 + 0x5C481A00, // 0088 MOVE R18 R13 + 0x5C4C1400, // 0089 MOVE R19 R10 + 0x7C380A00, // 008A CALL R14 5 + 0x5C201C00, // 008B MOVE R8 R14 + 0x8C380F29, // 008C GETMET R14 R7 K41 + 0x5C400A00, // 008D MOVE R16 R5 + 0x5C441000, // 008E MOVE R17 R8 + 0x7C380600, // 008F CALL R14 3 + 0x1C240B07, // 0090 EQ R9 R5 K7 + 0x7826000F, // 0091 JMPF R9 #00A2 + 0x4C240000, // 0092 LDNIL R9 + 0x20240C09, // 0093 NE R9 R6 R9 + 0x78260006, // 0094 JMPF R9 #009C + 0x60240001, // 0095 GETGBL R9 G1 + 0x60280018, // 0096 GETGBL R10 G24 + 0x582C002A, // 0097 LDCONST R11 K42 + 0x5C300C00, // 0098 MOVE R12 R6 + 0x7C280400, // 0099 CALL R10 2 + 0x7C240200, // 009A CALL R9 1 + 0x80001200, // 009B RET 0 + 0x8C240118, // 009C GETMET R9 R0 K24 + 0x7C240200, // 009D CALL R9 1 + 0x8C24131F, // 009E GETMET R9 R9 K31 + 0x582C0007, // 009F LDCONST R11 K7 + 0x7C240400, // 00A0 CALL R9 2 + 0x5C201200, // 00A1 MOVE R8 R9 + 0x4C240000, // 00A2 LDNIL R9 + 0x20241009, // 00A3 NE R9 R8 R9 + 0x7826000C, // 00A4 JMPF R9 #00B2 + 0x60240010, // 00A5 GETGBL R9 G16 + 0x8C28032B, // 00A6 GETMET R10 R1 K43 + 0x7C280200, // 00A7 CALL R10 1 + 0x7C240200, // 00A8 CALL R9 1 + 0xA8020004, // 00A9 EXBLK 0 #00AF + 0x5C281200, // 00AA MOVE R10 R9 + 0x7C280000, // 00AB CALL R10 0 + 0x942C020A, // 00AC GETIDX R11 R1 R10 + 0x9020140B, // 00AD SETMBR R8 R10 R11 + 0x7001FFFA, // 00AE JMP #00AA + 0x5824002C, // 00AF LDCONST R9 K44 + 0xAC240200, // 00B0 CATCH R9 1 0 + 0xB0080000, // 00B1 RAISE 2 R0 R0 + 0x4C240000, // 00B2 LDNIL R9 + 0x20241009, // 00B3 NE R9 R8 R9 + 0x78260001, // 00B4 JMPF R9 #00B7 + 0x8C24112D, // 00B5 GETMET R9 R8 K45 + 0x7C240200, // 00B6 CALL R9 1 + 0x4C240000, // 00B7 LDNIL R9 + 0x60280008, // 00B8 GETGBL R10 G8 + 0x8C2C030E, // 00B9 GETMET R11 R1 K14 + 0x5834002E, // 00BA LDCONST R13 K46 + 0x7C2C0400, // 00BB CALL R11 2 + 0x7C280200, // 00BC CALL R10 1 + 0x202C152F, // 00BD NE R11 R10 K47 + 0x782E0012, // 00BE JMPF R11 #00D2 + 0xA8020005, // 00BF EXBLK 0 #00C6 + 0x602C000D, // 00C0 GETGBL R11 G13 + 0x5C301400, // 00C1 MOVE R12 R10 + 0x7C2C0200, // 00C2 CALL R11 1 + 0x5C241600, // 00C3 MOVE R9 R11 + 0xA8040001, // 00C4 EXBLK 1 1 + 0x7002000B, // 00C5 JMP #00D2 + 0xAC2C0002, // 00C6 CATCH R11 0 2 + 0x70020008, // 00C7 JMP #00D1 + 0x60340001, // 00C8 GETGBL R13 G1 + 0x60380018, // 00C9 GETGBL R14 G24 + 0x583C0030, // 00CA LDCONST R15 K48 + 0x5C401400, // 00CB MOVE R16 R10 + 0x5C441600, // 00CC MOVE R17 R11 + 0x5C481800, // 00CD MOVE R18 R12 + 0x7C380800, // 00CE CALL R14 4 + 0x7C340200, // 00CF CALL R13 1 + 0x70020000, // 00D0 JMP #00D2 + 0xB0080000, // 00D1 RAISE 2 R0 R0 + 0x4C2C0000, // 00D2 LDNIL R11 + 0x202C120B, // 00D3 NE R11 R9 R11 + 0x782E0018, // 00D4 JMPF R11 #00EE + 0xA802000B, // 00D5 EXBLK 0 #00E2 + 0x5C2C1200, // 00D6 MOVE R11 R9 + 0x7C2C0000, // 00D7 CALL R11 0 + 0x60300004, // 00D8 GETGBL R12 G4 + 0x5C341600, // 00D9 MOVE R13 R11 + 0x7C300200, // 00DA CALL R12 1 + 0x1C301931, // 00DB EQ R12 R12 K49 + 0x78320002, // 00DC JMPF R12 #00E0 + 0x5C301600, // 00DD MOVE R12 R11 + 0x5C341000, // 00DE MOVE R13 R8 + 0x7C300200, // 00DF CALL R12 1 + 0xA8040001, // 00E0 EXBLK 1 1 + 0x7002000B, // 00E1 JMP #00EE + 0xAC2C0002, // 00E2 CATCH R11 0 2 + 0x70020008, // 00E3 JMP #00ED + 0x60340001, // 00E4 GETGBL R13 G1 + 0x60380018, // 00E5 GETGBL R14 G24 + 0x583C0032, // 00E6 LDCONST R15 K50 + 0x5C401400, // 00E7 MOVE R16 R10 + 0x5C441600, // 00E8 MOVE R17 R11 + 0x5C481800, // 00E9 MOVE R18 R12 + 0x7C380800, // 00EA CALL R14 4 + 0x7C340200, // 00EB CALL R13 1 + 0x70020000, // 00EC JMP #00EE + 0xB0080000, // 00ED RAISE 2 R0 R0 + 0x80000000, // 00EE RET 0 }) ) ); @@ -13013,7 +12665,7 @@ be_local_closure(class_HASPmota_get_pages, /* name */ be_str_weak(get_pages), &be_const_str_solidified, ( &(const binstruction[ 4]) { /* code */ - 0x8C04011D, // 0000 GETMET R1 R0 K29 + 0x8C04010B, // 0000 GETMET R1 R0 K11 0x4C0C0000, // 0001 LDNIL R3 0x7C040400, // 0002 CALL R1 2 0x80040200, // 0003 RET 1 R1 @@ -13023,6 +12675,66 @@ be_local_closure(class_HASPmota_get_pages, /* name */ /*******************************************************************/ +/******************************************************************** +** Solidified function: _remove_page +********************************************************************/ +be_local_closure(class_HASPmota__remove_page, /* name */ + be_nested_proto( + 8, /* nstack */ + 2, /* argc */ + 10, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + &be_ktab_class_HASPmota, /* shared constants */ + be_str_weak(_remove_page), + &be_const_str_solidified, + ( &(const binstruction[37]) { /* code */ + 0x8C080133, // 0000 GETMET R2 R0 K51 + 0x7C080200, // 0001 CALL R2 1 + 0x8C080517, // 0002 GETMET R2 R2 K23 + 0x7C080200, // 0003 CALL R2 1 + 0x1C0C0202, // 0004 EQ R3 R1 R2 + 0x780E0008, // 0005 JMPF R3 #000F + 0x8C0C0134, // 0006 GETMET R3 R0 K52 + 0x58140035, // 0007 LDCONST R5 K53 + 0x58180007, // 0008 LDCONST R6 K7 + 0x581C0007, // 0009 LDCONST R7 K7 + 0x7C0C0800, // 000A CALL R3 4 + 0x4C100000, // 000B LDNIL R4 + 0x1C100604, // 000C EQ R4 R3 R4 + 0x78120000, // 000D JMPF R4 #000F + 0x80000800, // 000E RET 0 + 0x880C0112, // 000F GETMBR R3 R0 K18 + 0x1C0C0601, // 0010 EQ R3 R3 R1 + 0x780E0001, // 0011 JMPF R3 #0014 + 0x880C0113, // 0012 GETMBR R3 R0 K19 + 0x90022403, // 0013 SETMBR R0 K18 R3 + 0x880C0114, // 0014 GETMBR R3 R0 K20 + 0x8C0C0715, // 0015 GETMET R3 R3 K21 + 0x5C140200, // 0016 MOVE R5 R1 + 0x7C0C0400, // 0017 CALL R3 2 + 0x780E0003, // 0018 JMPF R3 #001D + 0x880C0114, // 0019 GETMBR R3 R0 K20 + 0x8C0C0736, // 001A GETMET R3 R3 K54 + 0x5C140200, // 001B MOVE R5 R1 + 0x7C0C0400, // 001C CALL R3 2 + 0x600C0018, // 001D GETGBL R3 G24 + 0x58100037, // 001E LDCONST R4 K55 + 0x5C140200, // 001F MOVE R5 R1 + 0x7C0C0400, // 0020 CALL R3 2 + 0xB8123800, // 0021 GETNGBL R4 K28 + 0x4C140000, // 0022 LDNIL R5 + 0x90100605, // 0023 SETMBR R4 R3 R5 + 0x80000000, // 0024 RET 0 + }) + ) +); +/*******************************************************************/ + + /******************************************************************** ** Solidified function: sort ********************************************************************/ @@ -13040,8 +12752,8 @@ be_local_closure(class_HASPmota_sort, /* name */ be_str_weak(sort), &be_const_str_solidified, ( &(const binstruction[24]) { /* code */ - 0x5804006C, // 0000 LDCONST R1 K108 - 0x58080006, // 0001 LDCONST R2 K6 + 0x58040038, // 0000 LDCONST R1 K56 + 0x58080007, // 0001 LDCONST R2 K7 0x600C000C, // 0002 GETGBL R3 G12 0x5C100000, // 0003 MOVE R4 R0 0x7C0C0200, // 0004 CALL R3 1 @@ -13049,19 +12761,19 @@ be_local_closure(class_HASPmota_sort, /* name */ 0x780E000F, // 0006 JMPF R3 #0017 0x940C0002, // 0007 GETIDX R3 R0 R2 0x5C100400, // 0008 MOVE R4 R2 - 0x24140906, // 0009 GT R5 R4 K6 + 0x24140907, // 0009 GT R5 R4 K7 0x78160008, // 000A JMPF R5 #0014 - 0x0414091F, // 000B SUB R5 R4 K31 + 0x0414090C, // 000B SUB R5 R4 K12 0x94140005, // 000C GETIDX R5 R0 R5 0x24140A03, // 000D GT R5 R5 R3 0x78160004, // 000E JMPF R5 #0014 - 0x0414091F, // 000F SUB R5 R4 K31 + 0x0414090C, // 000F SUB R5 R4 K12 0x94140005, // 0010 GETIDX R5 R0 R5 0x98000805, // 0011 SETIDX R0 R4 R5 - 0x0410091F, // 0012 SUB R4 R4 K31 + 0x0410090C, // 0012 SUB R4 R4 K12 0x7001FFF4, // 0013 JMP #0009 0x98000803, // 0014 SETIDX R0 R4 R3 - 0x0008051F, // 0015 ADD R2 R2 K31 + 0x0008050C, // 0015 ADD R2 R2 K12 0x7001FFEA, // 0016 JMP #0002 0x80040000, // 0017 RET 1 R0 }) @@ -13070,6 +12782,314 @@ be_local_closure(class_HASPmota_sort, /* name */ /*******************************************************************/ +/******************************************************************** +** Solidified function: get_page_cur +********************************************************************/ +be_local_closure(class_HASPmota_get_page_cur, /* name */ + be_nested_proto( + 3, /* nstack */ + 1, /* argc */ + 10, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + &be_ktab_class_HASPmota, /* shared constants */ + be_str_weak(get_page_cur), + &be_const_str_solidified, + ( &(const binstruction[ 4]) { /* code */ + 0x88040114, // 0000 GETMBR R1 R0 K20 + 0x88080113, // 0001 GETMBR R2 R0 K19 + 0x94040202, // 0002 GETIDX R1 R1 R2 + 0x80040200, // 0003 RET 1 R1 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: start +********************************************************************/ +be_local_closure(class_HASPmota_start, /* name */ + be_nested_proto( + 23, /* nstack */ + 3, /* argc */ + 10, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + &be_ktab_class_HASPmota, /* shared constants */ + be_str_weak(start), + &be_const_str_solidified, + ( &(const binstruction[220]) { /* code */ + 0x880C0139, // 0000 GETMBR R3 R0 K57 + 0x780E0000, // 0001 JMPF R3 #0003 + 0x80000600, // 0002 RET 0 + 0x4C0C0000, // 0003 LDNIL R3 + 0x60100004, // 0004 GETGBL R4 G4 + 0x5C140200, // 0005 MOVE R5 R1 + 0x7C100200, // 0006 CALL R4 1 + 0x1C10093A, // 0007 EQ R4 R4 K58 + 0x78120001, // 0008 JMPF R4 #000B + 0x5C0C0200, // 0009 MOVE R3 R1 + 0x70020007, // 000A JMP #0013 + 0x60100004, // 000B GETGBL R4 G4 + 0x5C140400, // 000C MOVE R5 R2 + 0x7C100200, // 000D CALL R4 1 + 0x1C10093A, // 000E EQ R4 R4 K58 + 0x78120001, // 000F JMPF R4 #0012 + 0x5C0C0400, // 0010 MOVE R3 R2 + 0x70020000, // 0011 JMP #0013 + 0x880C013B, // 0012 GETMBR R3 R0 K59 + 0xA4127800, // 0013 IMPORT R4 K60 + 0x8C14093D, // 0014 GETMET R5 R4 K61 + 0x5C1C0600, // 0015 MOVE R7 R3 + 0x7C140400, // 0016 CALL R5 2 + 0x74160002, // 0017 JMPT R5 #001B + 0x00167C03, // 0018 ADD R5 K62 R3 + 0x00140B3F, // 0019 ADD R5 R5 K63 + 0xB0068005, // 001A RAISE 1 K64 R5 + 0xB8160800, // 001B GETNGBL R5 K4 + 0x8C140B41, // 001C GETMET R5 R5 K65 + 0x7C140200, // 001D CALL R5 1 + 0xB8160800, // 001E GETNGBL R5 K4 + 0x8C140B43, // 001F GETMET R5 R5 K67 + 0x7C140200, // 0020 CALL R5 1 + 0x90028405, // 0021 SETMBR R0 K66 R5 + 0xB8160800, // 0022 GETNGBL R5 K4 + 0x8C140B45, // 0023 GETMET R5 R5 K69 + 0x7C140200, // 0024 CALL R5 1 + 0x90028805, // 0025 SETMBR R0 K68 R5 + 0xB8160800, // 0026 GETNGBL R5 K4 + 0x8C140B47, // 0027 GETMET R5 R5 K71 + 0x7C140200, // 0028 CALL R5 1 + 0x90028C05, // 0029 SETMBR R0 K70 R5 + 0xA8020007, // 002A EXBLK 0 #0033 + 0xB8160800, // 002B GETNGBL R5 K4 + 0x8C140B49, // 002C GETMET R5 R5 K73 + 0x581C004A, // 002D LDCONST R7 K74 + 0x5422000B, // 002E LDINT R8 12 + 0x7C140600, // 002F CALL R5 3 + 0x90029005, // 0030 SETMBR R0 K72 R5 + 0xA8040001, // 0031 EXBLK 1 1 + 0x70020009, // 0032 JMP #003D + 0xAC140000, // 0033 CATCH R5 0 0 + 0x70020006, // 0034 JMP #003C + 0xB8160800, // 0035 GETNGBL R5 K4 + 0x8C140B49, // 0036 GETMET R5 R5 K73 + 0x581C004B, // 0037 LDCONST R7 K75 + 0x54220009, // 0038 LDINT R8 10 + 0x7C140600, // 0039 CALL R5 3 + 0x90029005, // 003A SETMBR R0 K72 R5 + 0x70020000, // 003B JMP #003D + 0xB0080000, // 003C RAISE 2 R0 R0 + 0xA8020007, // 003D EXBLK 0 #0046 + 0xB8160800, // 003E GETNGBL R5 K4 + 0x8C140B49, // 003F GETMET R5 R5 K73 + 0x581C004A, // 0040 LDCONST R7 K74 + 0x5422000F, // 0041 LDINT R8 16 + 0x7C140600, // 0042 CALL R5 3 + 0x90029805, // 0043 SETMBR R0 K76 R5 + 0xA8040001, // 0044 EXBLK 1 1 + 0x70020009, // 0045 JMP #0050 + 0xAC140000, // 0046 CATCH R5 0 0 + 0x70020006, // 0047 JMP #004F + 0xB8160800, // 0048 GETNGBL R5 K4 + 0x8C140B49, // 0049 GETMET R5 R5 K73 + 0x581C004B, // 004A LDCONST R7 K75 + 0x5422000D, // 004B LDINT R8 14 + 0x7C140600, // 004C CALL R5 3 + 0x90029805, // 004D SETMBR R0 K76 R5 + 0x70020000, // 004E JMP #0050 + 0xB0080000, // 004F RAISE 2 R0 R0 + 0xA8020007, // 0050 EXBLK 0 #0059 + 0xB8160800, // 0051 GETNGBL R5 K4 + 0x8C140B49, // 0052 GETMET R5 R5 K73 + 0x581C004A, // 0053 LDCONST R7 K74 + 0x54220017, // 0054 LDINT R8 24 + 0x7C140600, // 0055 CALL R5 3 + 0x90029A05, // 0056 SETMBR R0 K77 R5 + 0xA8040001, // 0057 EXBLK 1 1 + 0x70020009, // 0058 JMP #0063 + 0xAC140000, // 0059 CATCH R5 0 0 + 0x70020006, // 005A JMP #0062 + 0xB8160800, // 005B GETNGBL R5 K4 + 0x8C140B49, // 005C GETMET R5 R5 K73 + 0x581C004B, // 005D LDCONST R7 K75 + 0x54220013, // 005E LDINT R8 20 + 0x7C140600, // 005F CALL R5 3 + 0x90029A05, // 0060 SETMBR R0 K77 R5 + 0x70020000, // 0061 JMP #0063 + 0xB0080000, // 0062 RAISE 2 R0 R0 + 0x8814014E, // 0063 GETMBR R5 R0 K78 + 0x8C140B4F, // 0064 GETMET R5 R5 K79 + 0xB81EA000, // 0065 GETNGBL R7 K80 + 0x8C1C0F51, // 0066 GETMET R7 R7 K81 + 0x54260009, // 0067 LDINT R9 10 + 0x7C1C0400, // 0068 CALL R7 2 + 0x7C140400, // 0069 CALL R5 2 + 0x8818014E, // 006A GETMBR R6 R0 K78 + 0x8C180D4F, // 006B GETMET R6 R6 K79 + 0xB822A000, // 006C GETNGBL R8 K80 + 0x8C201151, // 006D GETMET R8 R8 K81 + 0x542A000A, // 006E LDINT R10 11 + 0x7C200400, // 006F CALL R8 2 + 0x7C180400, // 0070 CALL R6 2 + 0x881C014E, // 0071 GETMBR R7 R0 K78 + 0x8C1C0F4F, // 0072 GETMET R7 R7 K79 + 0xB826A000, // 0073 GETNGBL R9 K80 + 0x8C241351, // 0074 GETMET R9 R9 K81 + 0x582C000C, // 0075 LDCONST R11 K12 + 0x7C240400, // 0076 CALL R9 2 + 0x7C1C0400, // 0077 CALL R7 2 + 0x8820014E, // 0078 GETMBR R8 R0 K78 + 0x8C20114F, // 0079 GETMET R8 R8 K79 + 0xB82AA000, // 007A GETNGBL R10 K80 + 0x8C281551, // 007B GETMET R10 R10 K81 + 0x54320008, // 007C LDINT R12 9 + 0x7C280400, // 007D CALL R10 2 + 0x7C200400, // 007E CALL R8 2 + 0x8824014E, // 007F GETMBR R9 R0 K78 + 0x8C24134F, // 0080 GETMET R9 R9 K79 + 0xB82EA000, // 0081 GETNGBL R11 K80 + 0x8C2C1751, // 0082 GETMET R11 R11 K81 + 0x5834000D, // 0083 LDCONST R13 K13 + 0x7C2C0400, // 0084 CALL R11 2 + 0x7C240400, // 0085 CALL R9 2 + 0x8828014E, // 0086 GETMBR R10 R0 K78 + 0x8C28154F, // 0087 GETMET R10 R10 K79 + 0xB832A000, // 0088 GETNGBL R12 K80 + 0x8C301951, // 0089 GETMET R12 R12 K81 + 0x5838000D, // 008A LDCONST R14 K13 + 0x7C300400, // 008B CALL R12 2 + 0x7C280400, // 008C CALL R10 2 + 0x882C014E, // 008D GETMBR R11 R0 K78 + 0x8C2C174F, // 008E GETMET R11 R11 K79 + 0xB836A000, // 008F GETNGBL R13 K80 + 0x8C341B51, // 0090 GETMET R13 R13 K81 + 0x543E000B, // 0091 LDINT R15 12 + 0x7C340400, // 0092 CALL R13 2 + 0x7C2C0400, // 0093 CALL R11 2 + 0x8830014E, // 0094 GETMBR R12 R0 K78 + 0x8C30194F, // 0095 GETMET R12 R12 K79 + 0xB83AA000, // 0096 GETNGBL R14 K80 + 0x8C381D51, // 0097 GETMET R14 R14 K81 + 0x5442000C, // 0098 LDINT R16 13 + 0x7C380400, // 0099 CALL R14 2 + 0x7C300400, // 009A CALL R12 2 + 0x8834014E, // 009B GETMBR R13 R0 K78 + 0x8C341B4F, // 009C GETMET R13 R13 K79 + 0xB83EA000, // 009D GETNGBL R15 K80 + 0x8C3C1F51, // 009E GETMET R15 R15 K81 + 0x5446000D, // 009F LDINT R17 14 + 0x7C3C0400, // 00A0 CALL R15 2 + 0x7C340400, // 00A1 CALL R13 2 + 0x8838014E, // 00A2 GETMBR R14 R0 K78 + 0x8C381D4F, // 00A3 GETMET R14 R14 K79 + 0xB842A000, // 00A4 GETNGBL R16 K80 + 0x8C402151, // 00A5 GETMET R16 R16 K81 + 0x544A000E, // 00A6 LDINT R18 15 + 0x7C400400, // 00A7 CALL R16 2 + 0x7C380400, // 00A8 CALL R14 2 + 0xB83E0800, // 00A9 GETNGBL R15 K4 + 0x8C3C1F52, // 00AA GETMET R15 R15 K82 + 0x60440012, // 00AB GETGBL R17 G18 + 0x7C440000, // 00AC CALL R17 0 + 0x40482205, // 00AD CONNECT R18 R17 R5 + 0x40482206, // 00AE CONNECT R18 R17 R6 + 0x40482207, // 00AF CONNECT R18 R17 R7 + 0x40482208, // 00B0 CONNECT R18 R17 R8 + 0x40482209, // 00B1 CONNECT R18 R17 R9 + 0x4048220A, // 00B2 CONNECT R18 R17 R10 + 0x4048220B, // 00B3 CONNECT R18 R17 R11 + 0x4048220C, // 00B4 CONNECT R18 R17 R12 + 0x4048220D, // 00B5 CONNECT R18 R17 R13 + 0x4048220E, // 00B6 CONNECT R18 R17 R14 + 0x7C3C0400, // 00B7 CALL R15 2 + 0xB8420800, // 00B8 GETNGBL R16 K4 + 0x8C402153, // 00B9 GETMET R16 R16 K83 + 0x58480007, // 00BA LDCONST R18 K7 + 0x5C4C1E00, // 00BB MOVE R19 R15 + 0x88500148, // 00BC GETMBR R20 R0 K72 + 0x8854014C, // 00BD GETMBR R21 R0 K76 + 0x8858014D, // 00BE GETMBR R22 R0 K77 + 0x7C400C00, // 00BF CALL R16 6 + 0x88440146, // 00C0 GETMBR R17 R0 K70 + 0x8C442354, // 00C1 GETMET R17 R17 K84 + 0x7C440200, // 00C2 CALL R17 1 + 0x8C442355, // 00C3 GETMET R17 R17 K85 + 0x5C4C2000, // 00C4 MOVE R19 R16 + 0x7C440400, // 00C5 CALL R17 2 + 0xB8460800, // 00C6 GETNGBL R17 K4 + 0x8C442356, // 00C7 GETMET R17 R17 K86 + 0xB84E0800, // 00C8 GETNGBL R19 K4 + 0x8C4C2757, // 00C9 GETMET R19 R19 K87 + 0x7C4C0200, // 00CA CALL R19 1 + 0x7C440400, // 00CB CALL R17 2 + 0xB8460800, // 00CC GETNGBL R17 K4 + 0x8C442357, // 00CD GETMET R17 R17 K87 + 0x7C440200, // 00CE CALL R17 1 + 0x8C442358, // 00CF GETMET R17 R17 K88 + 0x584C0007, // 00D0 LDCONST R19 K7 + 0x58500007, // 00D1 LDCONST R20 K7 + 0x7C440600, // 00D2 CALL R17 3 + 0x60440013, // 00D3 GETGBL R17 G19 + 0x7C440000, // 00D4 CALL R17 0 + 0x90022811, // 00D5 SETMBR R0 K20 R17 + 0x8C440159, // 00D6 GETMET R17 R0 K89 + 0x5C4C0600, // 00D7 MOVE R19 R3 + 0x7C440400, // 00D8 CALL R17 2 + 0x50440200, // 00D9 LDBOOL R17 1 0 + 0x90027211, // 00DA SETMBR R0 K57 R17 + 0x80000000, // 00DB RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: fix_lv_version +********************************************************************/ +be_local_closure(class_HASPmota_fix_lv_version, /* name */ + be_nested_proto( + 6, /* nstack */ + 0, /* argc */ + 12, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + &be_ktab_class_HASPmota, /* shared constants */ + be_str_weak(fix_lv_version), + &be_const_str_solidified, + ( &(const binstruction[15]) { /* code */ + 0x58000038, // 0000 LDCONST R0 K56 + 0xA4060000, // 0001 IMPORT R1 K0 + 0x8C080323, // 0002 GETMET R2 R1 K35 + 0xB8120800, // 0003 GETNGBL R4 K4 + 0x5814005A, // 0004 LDCONST R5 K90 + 0x7C080600, // 0005 CALL R2 3 + 0x600C0004, // 0006 GETGBL R3 G4 + 0x5C100400, // 0007 MOVE R4 R2 + 0x7C0C0200, // 0008 CALL R3 1 + 0x200C0711, // 0009 NE R3 R3 K17 + 0x780E0002, // 000A JMPF R3 #000E + 0xB80E0800, // 000B GETNGBL R3 K4 + 0x54120007, // 000C LDINT R4 8 + 0x900EB404, // 000D SETMBR R3 K90 R4 + 0x80000000, // 000E RET 0 + }) + ) +); +/*******************************************************************/ + + /******************************************************************** ** Solidified function: do_action ********************************************************************/ @@ -13087,13 +13107,13 @@ be_local_closure(class_HASPmota_do_action, /* name */ be_str_weak(do_action), &be_const_str_solidified, ( &(const binstruction[ 9]) { /* code */ - 0xB80EA600, // 0000 GETNGBL R3 K83 - 0x880C076D, // 0001 GETMBR R3 R3 K109 + 0xB80E0800, // 0000 GETNGBL R3 K4 + 0x880C075B, // 0001 GETMBR R3 R3 K91 0x200C0403, // 0002 NE R3 R2 R3 0x780E0000, // 0003 JMPF R3 #0005 0x80000600, // 0004 RET 0 - 0x8C0C0128, // 0005 GETMET R3 R0 K40 - 0x8814036E, // 0006 GETMBR R5 R1 K110 + 0x8C0C0134, // 0005 GETMET R3 R0 K52 + 0x8814035C, // 0006 GETMBR R5 R1 K92 0x7C0C0400, // 0007 CALL R3 2 0x80000000, // 0008 RET 0 }) @@ -13102,63 +13122,6 @@ be_local_closure(class_HASPmota_do_action, /* name */ /*******************************************************************/ -/******************************************************************** -** Solidified function: event_dispatch -********************************************************************/ -be_local_closure(class_HASPmota_event_dispatch, /* name */ - be_nested_proto( - 9, /* nstack */ - 2, /* argc */ - 10, /* varg */ - 0, /* has upvals */ - NULL, /* no upvals */ - 0, /* has sup protos */ - NULL, /* no sub protos */ - 1, /* has constants */ - &be_ktab_class_HASPmota, /* shared constants */ - be_str_weak(event_dispatch), - &be_const_str_solidified, - ( &(const binstruction[34]) { /* code */ - 0xA40A0200, // 0000 IMPORT R2 K1 - 0x8C0C056F, // 0001 GETMET R3 R2 K111 - 0x5C140200, // 0002 MOVE R5 R1 - 0x7C0C0400, // 0003 CALL R3 2 - 0x88100170, // 0004 GETMBR R4 R0 K112 - 0x78120002, // 0005 JMPF R4 #0009 - 0x88100170, // 0006 GETMBR R4 R0 K112 - 0x9012E203, // 0007 SETMBR R4 K113 R3 - 0x70020004, // 0008 JMP #000E - 0xB812A600, // 0009 GETNGBL R4 K83 - 0x8C100972, // 000A GETMET R4 R4 K114 - 0x5C180600, // 000B MOVE R6 R3 - 0x7C100400, // 000C CALL R4 2 - 0x9002E004, // 000D SETMBR R0 K112 R4 - 0x88100170, // 000E GETMBR R4 R0 K112 - 0x8C100973, // 000F GETMET R4 R4 K115 - 0x7C100200, // 0010 CALL R4 1 - 0x60140009, // 0011 GETGBL R5 G9 - 0x5C180800, // 0012 MOVE R6 R4 - 0x7C140200, // 0013 CALL R5 1 - 0x20140B06, // 0014 NE R5 R5 K6 - 0x7816000A, // 0015 JMPF R5 #0021 - 0x8C140574, // 0016 GETMET R5 R2 K116 - 0x5C1C0800, // 0017 MOVE R7 R4 - 0x7C140400, // 0018 CALL R5 2 - 0x60180004, // 0019 GETGBL R6 G4 - 0x5C1C0A00, // 001A MOVE R7 R5 - 0x7C180200, // 001B CALL R6 1 - 0x1C180D35, // 001C EQ R6 R6 K53 - 0x781A0002, // 001D JMPF R6 #0021 - 0x8C180B75, // 001E GETMET R6 R5 K117 - 0x88200170, // 001F GETMBR R8 R0 K112 - 0x7C180400, // 0020 CALL R6 2 - 0x80000000, // 0021 RET 0 - }) - ) -); -/*******************************************************************/ - - /******************************************************************** ** Solidified function: register_event ********************************************************************/ @@ -13201,21 +13164,21 @@ be_local_closure(class_HASPmota_register_event, /* name */ be_str_weak(register_event), &be_const_str_solidified, ( &(const binstruction[20]) { /* code */ - 0xA40EEC00, // 0000 IMPORT R3 K118 - 0xA4120200, // 0001 IMPORT R4 K1 - 0x88140175, // 0002 GETMBR R5 R0 K117 + 0xA40EBA00, // 0000 IMPORT R3 K93 + 0xA4120000, // 0001 IMPORT R4 K0 + 0x8814010A, // 0002 GETMBR R5 R0 K10 0x4C180000, // 0003 LDNIL R6 0x1C140A06, // 0004 EQ R5 R5 R6 0x78160003, // 0005 JMPF R5 #000A - 0x8C140777, // 0006 GETMET R5 R3 K119 + 0x8C14075E, // 0006 GETMET R5 R3 K94 0x841C0000, // 0007 CLOSURE R7 P0 0x7C140400, // 0008 CALL R5 2 - 0x9002EA05, // 0009 SETMBR R0 K117 R5 - 0x8814030A, // 000A GETMBR R5 R1 K10 - 0x8C180B78, // 000B GETMET R6 R5 K120 - 0x88200175, // 000C GETMBR R8 R0 K117 + 0x90021405, // 0009 SETMBR R0 K10 R5 + 0x88140321, // 000A GETMBR R5 R1 K33 + 0x8C180B5F, // 000B GETMET R6 R5 K95 + 0x8820010A, // 000C GETMBR R8 R0 K10 0x5C240400, // 000D MOVE R9 R2 - 0x8C28096F, // 000E GETMET R10 R4 K111 + 0x8C280901, // 000E GETMET R10 R4 K1 0x5C300200, // 000F MOVE R12 R1 0x7C280400, // 0010 CALL R10 2 0x7C180800, // 0011 CALL R6 4 @@ -13228,76 +13191,11 @@ be_local_closure(class_HASPmota_register_event, /* name */ /******************************************************************** -** Solidified function: fix_lv_version +** Solidified function: parse ********************************************************************/ -be_local_closure(class_HASPmota_fix_lv_version, /* name */ +be_local_closure(class_HASPmota_parse, /* name */ be_nested_proto( - 6, /* nstack */ - 0, /* argc */ - 12, /* varg */ - 0, /* has upvals */ - NULL, /* no upvals */ - 0, /* has sup protos */ - NULL, /* no sub protos */ - 1, /* has constants */ - &be_ktab_class_HASPmota, /* shared constants */ - be_str_weak(fix_lv_version), - &be_const_str_solidified, - ( &(const binstruction[15]) { /* code */ - 0x5800006C, // 0000 LDCONST R0 K108 - 0xA4060200, // 0001 IMPORT R1 K1 - 0x8C08030C, // 0002 GETMET R2 R1 K12 - 0xB812A600, // 0003 GETNGBL R4 K83 - 0x58140079, // 0004 LDCONST R5 K121 - 0x7C080600, // 0005 CALL R2 3 - 0x600C0004, // 0006 GETGBL R3 G4 - 0x5C100400, // 0007 MOVE R4 R2 - 0x7C0C0200, // 0008 CALL R3 1 - 0x200C074A, // 0009 NE R3 R3 K74 - 0x780E0002, // 000A JMPF R3 #000E - 0xB80EA600, // 000B GETNGBL R3 K83 - 0x54120007, // 000C LDINT R4 8 - 0x900EF204, // 000D SETMBR R3 K121 R4 - 0x80000000, // 000E RET 0 - }) - ) -); -/*******************************************************************/ - - -/******************************************************************** -** Solidified function: get_page_cur -********************************************************************/ -be_local_closure(class_HASPmota_get_page_cur, /* name */ - be_nested_proto( - 3, /* nstack */ - 1, /* argc */ - 10, /* varg */ - 0, /* has upvals */ - NULL, /* no upvals */ - 0, /* has sup protos */ - NULL, /* no sub protos */ - 1, /* has constants */ - &be_ktab_class_HASPmota, /* shared constants */ - be_str_weak(get_page_cur), - &be_const_str_solidified, - ( &(const binstruction[ 4]) { /* code */ - 0x88040126, // 0000 GETMBR R1 R0 K38 - 0x8808011E, // 0001 GETMBR R2 R0 K30 - 0x94040202, // 0002 GETIDX R1 R1 R2 - 0x80040200, // 0003 RET 1 R1 - }) - ) -); -/*******************************************************************/ - - -/******************************************************************** -** Solidified function: page_dir_to -********************************************************************/ -be_local_closure(class_HASPmota_page_dir_to, /* name */ - be_nested_proto( - 7, /* nstack */ + 9, /* nstack */ 2, /* argc */ 10, /* varg */ 0, /* has upvals */ @@ -13306,41 +13204,182 @@ be_local_closure(class_HASPmota_page_dir_to, /* name */ NULL, /* no sub protos */ 1, /* has constants */ &be_ktab_class_HASPmota, /* shared constants */ - be_str_weak(page_dir_to), + be_str_weak(parse), &be_const_str_solidified, - ( &(const binstruction[32]) { /* code */ - 0x8C08011D, // 0000 GETMET R2 R0 K29 - 0x58100006, // 0001 LDCONST R4 K6 - 0x7C080400, // 0002 CALL R2 2 - 0x4C0C0000, // 0003 LDNIL R3 - 0x1C0C0403, // 0004 EQ R3 R2 R3 - 0x780E0000, // 0005 JMPF R3 #0007 - 0x80060C00, // 0006 RET 1 K6 - 0x600C000C, // 0007 GETGBL R3 G12 - 0x5C100400, // 0008 MOVE R4 R2 - 0x7C0C0200, // 0009 CALL R3 1 - 0x1810071F, // 000A LE R4 R3 K31 - 0x78120000, // 000B JMPF R4 #000D - 0x80060C00, // 000C RET 1 K6 - 0x1C100742, // 000D EQ R4 R3 K66 - 0x78120000, // 000E JMPF R4 #0010 - 0x80063E00, // 000F RET 1 K31 - 0x8C100502, // 0010 GETMET R4 R2 K2 - 0x5C180200, // 0011 MOVE R6 R1 - 0x7C100400, // 0012 CALL R4 2 - 0x4C140000, // 0013 LDNIL R5 - 0x1C140805, // 0014 EQ R5 R4 R5 - 0x78160000, // 0015 JMPF R5 #0017 - 0x80060C00, // 0016 RET 1 K6 - 0x0014071F, // 0017 ADD R5 R3 K31 - 0x0C140B42, // 0018 DIV R5 R5 K66 - 0x18140805, // 0019 LE R5 R4 R5 - 0x78160001, // 001A JMPF R5 #001D - 0x80063E00, // 001B RET 1 K31 - 0x70020001, // 001C JMP #001F - 0x5415FFFE, // 001D LDINT R5 -1 - 0x80040A00, // 001E RET 1 R5 - 0x80000000, // 001F RET 0 + ( &(const binstruction[21]) { /* code */ + 0xA40AC000, // 0000 IMPORT R2 K96 + 0x8C0C0561, // 0001 GETMET R3 R2 K97 + 0x5C140200, // 0002 MOVE R5 R1 + 0x7C0C0400, // 0003 CALL R3 2 + 0x60100004, // 0004 GETGBL R4 G4 + 0x5C140600, // 0005 MOVE R5 R3 + 0x7C100200, // 0006 CALL R4 1 + 0x1C100909, // 0007 EQ R4 R4 K9 + 0x78120009, // 0008 JMPF R4 #0013 + 0x8C100162, // 0009 GETMET R4 R0 K98 + 0x5C180600, // 000A MOVE R6 R3 + 0x7C100400, // 000B CALL R4 2 + 0x8C100163, // 000C GETMET R4 R0 K99 + 0x5C180600, // 000D MOVE R6 R3 + 0x881C0114, // 000E GETMBR R7 R0 K20 + 0x88200113, // 000F GETMBR R8 R0 K19 + 0x941C0E08, // 0010 GETIDX R7 R7 R8 + 0x7C100600, // 0011 CALL R4 3 + 0x70020000, // 0012 JMP #0014 + 0xB006C965, // 0013 RAISE 1 K100 K101 + 0x80000000, // 0014 RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: _load +********************************************************************/ +be_local_closure(class_HASPmota__load, /* name */ + be_nested_proto( + 13, /* nstack */ + 2, /* argc */ + 10, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + &be_ktab_class_HASPmota, /* shared constants */ + be_str_weak(_load), + &be_const_str_solidified, + ( &(const binstruction[98]) { /* code */ + 0xA40A7400, // 0000 IMPORT R2 K58 + 0xA40EC000, // 0001 IMPORT R3 K96 + 0x60100011, // 0002 GETGBL R4 G17 + 0x5C140200, // 0003 MOVE R5 R1 + 0x7C100200, // 0004 CALL R4 1 + 0x8C140966, // 0005 GETMET R5 R4 K102 + 0x7C140200, // 0006 CALL R5 1 + 0x8C180967, // 0007 GETMET R6 R4 K103 + 0x7C180200, // 0008 CALL R6 1 + 0x14140A06, // 0009 LT R5 R5 R6 + 0x78160041, // 000A JMPF R5 #004D + 0x8C140968, // 000B GETMET R5 R4 K104 + 0x7C140200, // 000C CALL R5 1 + 0x6018000C, // 000D GETGBL R6 G12 + 0x5C1C0A00, // 000E MOVE R7 R5 + 0x7C180200, // 000F CALL R6 1 + 0x18180D0C, // 0010 LE R6 R6 K12 + 0x741A0002, // 0011 JMPT R6 #0015 + 0x94180B07, // 0012 GETIDX R6 R5 K7 + 0x1C180D69, // 0013 EQ R6 R6 K105 + 0x781A0000, // 0014 JMPF R6 #0016 + 0x7001FFEE, // 0015 JMP #0005 + 0x8C180761, // 0016 GETMET R6 R3 K97 + 0x5C200A00, // 0017 MOVE R8 R5 + 0x7C180400, // 0018 CALL R6 2 + 0x601C0004, // 0019 GETGBL R7 G4 + 0x5C200C00, // 001A MOVE R8 R6 + 0x7C1C0200, // 001B CALL R7 1 + 0x1C1C0F09, // 001C EQ R7 R7 K9 + 0x781E001B, // 001D JMPF R7 #003A + 0xB81EA000, // 001E GETNGBL R7 K80 + 0x8C1C0F6A, // 001F GETMET R7 R7 K106 + 0x54260003, // 0020 LDINT R9 4 + 0x7C1C0400, // 0021 CALL R7 2 + 0x781E0007, // 0022 JMPF R7 #002B + 0xB81EA000, // 0023 GETNGBL R7 K80 + 0x8C1C0F6B, // 0024 GETMET R7 R7 K107 + 0x60240018, // 0025 GETGBL R9 G24 + 0x5828006C, // 0026 LDCONST R10 K108 + 0x5C2C0A00, // 0027 MOVE R11 R5 + 0x7C240400, // 0028 CALL R9 2 + 0x542A0003, // 0029 LDINT R10 4 + 0x7C1C0600, // 002A CALL R7 3 + 0x8C1C0162, // 002B GETMET R7 R0 K98 + 0x5C240C00, // 002C MOVE R9 R6 + 0x7C1C0400, // 002D CALL R7 2 + 0x881C0114, // 002E GETMBR R7 R0 K20 + 0x4C200000, // 002F LDNIL R8 + 0x1C1C0E08, // 0030 EQ R7 R7 R8 + 0x781E0000, // 0031 JMPF R7 #0033 + 0xB006C96D, // 0032 RAISE 1 K100 K109 + 0x8C1C0163, // 0033 GETMET R7 R0 K99 + 0x5C240C00, // 0034 MOVE R9 R6 + 0x88280114, // 0035 GETMBR R10 R0 K20 + 0x882C0112, // 0036 GETMBR R11 R0 K18 + 0x9428140B, // 0037 GETIDX R10 R10 R11 + 0x7C1C0600, // 0038 CALL R7 3 + 0x70020010, // 0039 JMP #004B + 0x601C000C, // 003A GETGBL R7 G12 + 0x8C20056E, // 003B GETMET R8 R2 K110 + 0x5C280A00, // 003C MOVE R10 R5 + 0x582C006F, // 003D LDCONST R11 K111 + 0x58300070, // 003E LDCONST R12 K112 + 0x7C200800, // 003F CALL R8 4 + 0x7C1C0200, // 0040 CALL R7 1 + 0x241C0F07, // 0041 GT R7 R7 K7 + 0x781E0007, // 0042 JMPF R7 #004B + 0xB81EA000, // 0043 GETNGBL R7 K80 + 0x8C1C0F6B, // 0044 GETMET R7 R7 K107 + 0x60240018, // 0045 GETGBL R9 G24 + 0x58280071, // 0046 LDCONST R10 K113 + 0x5C2C0A00, // 0047 MOVE R11 R5 + 0x7C240400, // 0048 CALL R9 2 + 0x5828000D, // 0049 LDCONST R10 K13 + 0x7C1C0600, // 004A CALL R7 3 + 0x4C180000, // 004B LDNIL R6 + 0x7001FFB7, // 004C JMP #0005 + 0x8C140972, // 004D GETMET R5 R4 K114 + 0x7C140200, // 004E CALL R5 1 + 0x8C14010B, // 004F GETMET R5 R0 K11 + 0x4C1C0000, // 0050 LDNIL R7 + 0x7C140400, // 0051 CALL R5 2 + 0x6018000C, // 0052 GETGBL R6 G12 + 0x5C1C0A00, // 0053 MOVE R7 R5 + 0x7C180200, // 0054 CALL R6 1 + 0x1C180D07, // 0055 EQ R6 R6 K7 + 0x781A0000, // 0056 JMPF R6 #0058 + 0xB006C973, // 0057 RAISE 1 K100 K115 + 0x94180B07, // 0058 GETIDX R6 R5 K7 + 0x90022606, // 0059 SETMBR R0 K19 R6 + 0x88180114, // 005A GETMBR R6 R0 K20 + 0x881C0113, // 005B GETMBR R7 R0 K19 + 0x94180C07, // 005C GETIDX R6 R6 R7 + 0x8C180D74, // 005D GETMET R6 R6 K116 + 0x58200007, // 005E LDCONST R8 K7 + 0x58240007, // 005F LDCONST R9 K7 + 0x7C180600, // 0060 CALL R6 3 + 0x80000000, // 0061 RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: init +********************************************************************/ +be_local_closure(class_HASPmota_init, /* name */ + be_nested_proto( + 5, /* nstack */ + 1, /* argc */ + 10, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + &be_ktab_class_HASPmota, /* shared constants */ + be_str_weak(init), + &be_const_str_solidified, + ( &(const binstruction[ 8]) { /* code */ + 0x8C040175, // 0000 GETMET R1 R0 K117 + 0x7C040200, // 0001 CALL R1 1 + 0xA406EC00, // 0002 IMPORT R1 K118 + 0x8C080378, // 0003 GETMET R2 R1 K120 + 0x58100079, // 0004 LDCONST R4 K121 + 0x7C080400, // 0005 CALL R2 2 + 0x9002EE02, // 0006 SETMBR R0 K119 R2 + 0x80000000, // 0007 RET 0 }) ) ); @@ -13366,24 +13405,24 @@ be_local_closure(class_HASPmota_pages_list_sorted, /* name */ ( &(const binstruction[47]) { /* code */ 0x60080012, // 0000 GETGBL R2 G18 0x7C080000, // 0001 CALL R2 0 - 0x1C0C0306, // 0002 EQ R3 R1 K6 + 0x1C0C0307, // 0002 EQ R3 R1 K7 0x780E0000, // 0003 JMPF R3 #0005 - 0x8804011E, // 0004 GETMBR R1 R0 K30 + 0x88040113, // 0004 GETMBR R1 R0 K19 0x600C0010, // 0005 GETGBL R3 G16 - 0x88100126, // 0006 GETMBR R4 R0 K38 - 0x8C100914, // 0007 GETMET R4 R4 K20 + 0x88100114, // 0006 GETMBR R4 R0 K20 + 0x8C10092B, // 0007 GETMET R4 R4 K43 0x7C100200, // 0008 CALL R4 1 0x7C0C0200, // 0009 CALL R3 1 0xA8020007, // 000A EXBLK 0 #0013 0x5C100600, // 000B MOVE R4 R3 0x7C100000, // 000C CALL R4 0 - 0x20140906, // 000D NE R5 R4 K6 + 0x20140907, // 000D NE R5 R4 K7 0x78160002, // 000E JMPF R5 #0012 0x8C14057A, // 000F GETMET R5 R2 K122 0x5C1C0800, // 0010 MOVE R7 R4 0x7C140400, // 0011 CALL R5 2 0x7001FFF7, // 0012 JMP #000B - 0x580C0015, // 0013 LDCONST R3 K21 + 0x580C002C, // 0013 LDCONST R3 K44 0xAC0C0200, // 0014 CATCH R3 1 0 0xB0080000, // 0015 RAISE 2 R0 R0 0x8C0C017B, // 0016 GETMET R3 R0 K123 @@ -13398,7 +13437,7 @@ be_local_closure(class_HASPmota_pages_list_sorted, /* name */ 0x5C100400, // 001F MOVE R4 R2 0x7C0C0200, // 0020 CALL R3 1 0x00080402, // 0021 ADD R2 R2 R2 - 0x8C100502, // 0022 GETMET R4 R2 K2 + 0x8C10050E, // 0022 GETMET R4 R2 K14 0x5C180200, // 0023 MOVE R6 R1 0x7C100400, // 0024 CALL R4 2 0x4C140000, // 0025 LDNIL R5 @@ -13407,7 +13446,7 @@ be_local_closure(class_HASPmota_pages_list_sorted, /* name */ 0x4C140000, // 0028 LDNIL R5 0x80040A00, // 0029 RET 1 R5 0x00140803, // 002A ADD R5 R4 R3 - 0x04140B1F, // 002B SUB R5 R5 K31 + 0x04140B0C, // 002B SUB R5 R5 K12 0x40140805, // 002C CONNECT R5 R4 R5 0x94080405, // 002D GETIDX R2 R2 R5 0x80040400, // 002E RET 1 R2 @@ -13417,76 +13456,268 @@ be_local_closure(class_HASPmota_pages_list_sorted, /* name */ /*******************************************************************/ +/******************************************************************** +** Solidified function: get_page_cur_parsing +********************************************************************/ +be_local_closure(class_HASPmota_get_page_cur_parsing, /* name */ + be_nested_proto( + 3, /* nstack */ + 1, /* argc */ + 10, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + &be_ktab_class_HASPmota, /* shared constants */ + be_str_weak(get_page_cur_parsing), + &be_const_str_solidified, + ( &(const binstruction[ 4]) { /* code */ + 0x88040114, // 0000 GETMBR R1 R0 K20 + 0x88080112, // 0001 GETMBR R2 R0 K18 + 0x94040202, // 0002 GETIDX R1 R1 R2 + 0x80040200, // 0003 RET 1 R1 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: page_show +********************************************************************/ +be_local_closure(class_HASPmota_page_show, /* name */ + be_nested_proto( + 14, /* nstack */ + 4, /* argc */ + 10, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 1, /* has sup protos */ + ( &(const struct bproto*[ 1]) { + be_nested_proto( + 6, /* nstack */ + 3, /* argc */ + 0, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[ 1]) { /* constants */ + /* K0 */ be_nested_str_weak(find), + }), + be_str_weak(to_page_resolve), + &be_const_str_solidified, + ( &(const binstruction[13]) { /* code */ + 0x4C0C0000, // 0000 LDNIL R3 + 0x200C0003, // 0001 NE R3 R0 R3 + 0x780E0007, // 0002 JMPF R3 #000B + 0x8C0C0500, // 0003 GETMET R3 R2 K0 + 0x5C140000, // 0004 MOVE R5 R0 + 0x7C0C0400, // 0005 CALL R3 2 + 0x4C100000, // 0006 LDNIL R4 + 0x200C0604, // 0007 NE R3 R3 R4 + 0x780E0001, // 0008 JMPF R3 #000B + 0x80040000, // 0009 RET 1 R0 + 0x70020000, // 000A JMP #000C + 0x80040200, // 000B RET 1 R1 + 0x80000000, // 000C RET 0 + }) + ), + }), + 1, /* has constants */ + &be_ktab_class_HASPmota, /* shared constants */ + be_str_weak(page_show), + &be_const_str_solidified, + ( &(const binstruction[109]) { /* code */ + 0xA412EC00, // 0000 IMPORT R4 K118 + 0x84140000, // 0001 CLOSURE R5 P0 + 0x4C180000, // 0002 LDNIL R6 + 0x8C1C0133, // 0003 GETMET R7 R0 K51 + 0x7C1C0200, // 0004 CALL R7 1 + 0x8C20010B, // 0005 GETMET R8 R0 K11 + 0x88280113, // 0006 GETMBR R10 R0 K19 + 0x7C200400, // 0007 CALL R8 2 + 0x6024000C, // 0008 GETGBL R9 G12 + 0x5C281000, // 0009 MOVE R10 R8 + 0x7C240200, // 000A CALL R9 1 + 0x1824130C, // 000B LE R9 R9 K12 + 0x78260001, // 000C JMPF R9 #000F + 0x4C240000, // 000D LDNIL R9 + 0x80041200, // 000E RET 1 R9 + 0x1C240319, // 000F EQ R9 R1 K25 + 0x78260009, // 0010 JMPF R9 #001B + 0x5C240A00, // 0011 MOVE R9 R5 + 0x60280009, // 0012 GETGBL R10 G9 + 0x882C0F19, // 0013 GETMBR R11 R7 K25 + 0x7C280200, // 0014 CALL R10 1 + 0x542DFFFE, // 0015 LDINT R11 -1 + 0x942C100B, // 0016 GETIDX R11 R8 R11 + 0x5C301000, // 0017 MOVE R12 R8 + 0x7C240600, // 0018 CALL R9 3 + 0x5C181200, // 0019 MOVE R6 R9 + 0x70020041, // 001A JMP #005D + 0x1C24031A, // 001B EQ R9 R1 K26 + 0x78260008, // 001C JMPF R9 #0026 + 0x5C240A00, // 001D MOVE R9 R5 + 0x60280009, // 001E GETGBL R10 G9 + 0x882C0F1A, // 001F GETMBR R11 R7 K26 + 0x7C280200, // 0020 CALL R10 1 + 0x942C110C, // 0021 GETIDX R11 R8 K12 + 0x5C301000, // 0022 MOVE R12 R8 + 0x7C240600, // 0023 CALL R9 3 + 0x5C181200, // 0024 MOVE R6 R9 + 0x70020036, // 0025 JMP #005D + 0x1C24031B, // 0026 EQ R9 R1 K27 + 0x7826000B, // 0027 JMPF R9 #0034 + 0x5C240A00, // 0028 MOVE R9 R5 + 0x60280009, // 0029 GETGBL R10 G9 + 0x882C0F1B, // 002A GETMBR R11 R7 K27 + 0x7C280200, // 002B CALL R10 1 + 0x8C2C010B, // 002C GETMET R11 R0 K11 + 0x4C340000, // 002D LDNIL R13 + 0x7C2C0400, // 002E CALL R11 2 + 0x942C1707, // 002F GETIDX R11 R11 K7 + 0x5C301000, // 0030 MOVE R12 R8 + 0x7C240600, // 0031 CALL R9 3 + 0x5C181200, // 0032 MOVE R6 R9 + 0x70020028, // 0033 JMP #005D + 0x1C240335, // 0034 EQ R9 R1 K53 + 0x78260017, // 0035 JMPF R9 #004E + 0x5C240A00, // 0036 MOVE R9 R5 + 0x60280009, // 0037 GETGBL R10 G9 + 0x882C0F1B, // 0038 GETMBR R11 R7 K27 + 0x7C280200, // 0039 CALL R10 1 + 0x8C2C010B, // 003A GETMET R11 R0 K11 + 0x4C340000, // 003B LDNIL R13 + 0x7C2C0400, // 003C CALL R11 2 + 0x942C1707, // 003D GETIDX R11 R11 K7 + 0x5C301000, // 003E MOVE R12 R8 + 0x7C240600, // 003F CALL R9 3 + 0x5C181200, // 0040 MOVE R6 R9 + 0x8C240F17, // 0041 GETMET R9 R7 K23 + 0x7C240200, // 0042 CALL R9 1 + 0x1C240C09, // 0043 EQ R9 R6 R9 + 0x78260007, // 0044 JMPF R9 #004D + 0x5C240A00, // 0045 MOVE R9 R5 + 0x60280009, // 0046 GETGBL R10 G9 + 0x882C0F1A, // 0047 GETMBR R11 R7 K26 + 0x7C280200, // 0048 CALL R10 1 + 0x942C110C, // 0049 GETIDX R11 R8 K12 + 0x5C301000, // 004A MOVE R12 R8 + 0x7C240600, // 004B CALL R9 3 + 0x5C181200, // 004C MOVE R6 R9 + 0x7002000E, // 004D JMP #005D + 0x8C24097C, // 004E GETMET R9 R4 K124 + 0x882C0177, // 004F GETMBR R11 R0 K119 + 0x5C300200, // 0050 MOVE R12 R1 + 0x7C240600, // 0051 CALL R9 3 + 0x78260009, // 0052 JMPF R9 #005D + 0x5C240A00, // 0053 MOVE R9 R5 + 0x60280009, // 0054 GETGBL R10 G9 + 0x542DFFFE, // 0055 LDINT R11 -1 + 0x402E180B, // 0056 CONNECT R11 K12 R11 + 0x942C020B, // 0057 GETIDX R11 R1 R11 + 0x7C280200, // 0058 CALL R10 1 + 0x4C2C0000, // 0059 LDNIL R11 + 0x5C301000, // 005A MOVE R12 R8 + 0x7C240600, // 005B CALL R9 3 + 0x5C181200, // 005C MOVE R6 R9 + 0x4C240000, // 005D LDNIL R9 + 0x20240C09, // 005E NE R9 R6 R9 + 0x7826000B, // 005F JMPF R9 #006C + 0x24240D07, // 0060 GT R9 R6 K7 + 0x78260009, // 0061 JMPF R9 #006C + 0x88240114, // 0062 GETMBR R9 R0 K20 + 0x94241206, // 0063 GETIDX R9 R9 R6 + 0x4C280000, // 0064 LDNIL R10 + 0x2028120A, // 0065 NE R10 R9 R10 + 0x782A0003, // 0066 JMPF R10 #006B + 0x8C281374, // 0067 GETMET R10 R9 K116 + 0x5C300400, // 0068 MOVE R12 R2 + 0x5C340600, // 0069 MOVE R13 R3 + 0x7C280600, // 006A CALL R10 3 + 0x80041200, // 006B RET 1 R9 + 0x80000000, // 006C RET 0 + }) + ) +); +/*******************************************************************/ + + /******************************************************************** ** Solidified class: HASPmota ********************************************************************/ be_local_class(HASPmota, - 11, + 13, NULL, - be_nested_map(62, + be_nested_map(64, ( (struct bmapnode*) &(const bmapnode[]) { - { be_const_key_weak(parse_obj, 13), be_const_closure(class_HASPmota_parse_obj_closure) }, - { be_const_key_weak(lvh_pages, -1), be_const_var(5) }, - { be_const_key_weak(lvh_dropdown_list, 1), be_const_class(be_class_lvh_dropdown_list) }, - { be_const_key_weak(lvh_tab, 17), be_const_class(be_class_lvh_tab) }, - { be_const_key_weak(lvh_line, -1), be_const_class(be_class_lvh_line) }, - { be_const_key_weak(lvh_bar, -1), be_const_class(be_class_lvh_bar) }, - { be_const_key_weak(lvh_scale_section, -1), be_const_class(be_class_lvh_scale_section) }, - { be_const_key_weak(page_dir_to, -1), be_const_closure(class_HASPmota_page_dir_to_closure) }, - { be_const_key_weak(lvh_scr, -1), be_const_class(be_class_lvh_scr) }, - { be_const_key_weak(lvh_flex, -1), be_const_class(be_class_lvh_flex) }, - { be_const_key_weak(lvh_spangroup, -1), be_const_class(be_class_lvh_spangroup) }, - { be_const_key_weak(lvh_obj, -1), be_const_class(be_class_lvh_obj) }, - { be_const_key_weak(lvh_chart, 47), be_const_class(be_class_lvh_chart) }, - { be_const_key_weak(get_page_cur, -1), be_const_closure(class_HASPmota_get_page_cur_closure) }, - { be_const_key_weak(_remove_page, -1), be_const_closure(class_HASPmota__remove_page_closure) }, - { be_const_key_weak(event_cb, -1), be_const_var(10) }, - { be_const_key_weak(page_show, 51), be_const_closure(class_HASPmota_page_show_closure) }, - { be_const_key_weak(lvh_cpicker, -1), be_const_class(be_class_lvh_cpicker) }, - { be_const_key_weak(fix_lv_version, -1), be_const_static_closure(class_HASPmota_fix_lv_version_closure) }, - { be_const_key_weak(register_event, -1), be_const_closure(class_HASPmota_register_event_closure) }, - { be_const_key_weak(lvh_fixed, -1), be_const_class(be_class_lvh_fixed) }, - { be_const_key_weak(lvh_scale_line, -1), be_const_class(be_class_lvh_scale_line) }, - { be_const_key_weak(lvh_dropdown, -1), be_const_class(be_class_lvh_dropdown) }, - { be_const_key_weak(lvh_page_cur_idx_parsing, -1), be_const_var(7) }, - { be_const_key_weak(lvh_roller, 56), be_const_class(be_class_lvh_roller) }, - { be_const_key_weak(event_dispatch, -1), be_const_closure(class_HASPmota_event_dispatch_closure) }, - { be_const_key_weak(dark, 43), be_const_var(0) }, - { be_const_key_weak(lvh_label, -1), be_const_class(be_class_lvh_label) }, - { be_const_key_weak(r16, -1), be_const_var(4) }, - { be_const_key_weak(init, -1), be_const_closure(class_HASPmota_init_closure) }, - { be_const_key_weak(parse_page, -1), be_const_closure(class_HASPmota_parse_page_closure) }, - { be_const_key_weak(event, -1), be_const_var(9) }, - { be_const_key_weak(lvh_span, 44), be_const_class(be_class_lvh_span) }, - { be_const_key_weak(get_page_cur_parsing, 39), be_const_closure(class_HASPmota_get_page_cur_parsing_closure) }, - { be_const_key_weak(lvh_arc, -1), be_const_class(be_class_lvh_arc) }, - { be_const_key_weak(start, -1), be_const_closure(class_HASPmota_start_closure) }, - { be_const_key_weak(get_pages, -1), be_const_closure(class_HASPmota_get_pages_closure) }, - { be_const_key_weak(sort, -1), be_const_static_closure(class_HASPmota_sort_closure) }, - { be_const_key_weak(lvh_page_cur_idx, -1), be_const_var(6) }, - { be_const_key_weak(hres, 48), be_const_var(1) }, - { be_const_key_weak(lvh_root, 32), be_const_class(be_class_lvh_root) }, - { be_const_key_weak(vres, -1), be_const_var(2) }, - { be_const_key_weak(lvh_led, 22), be_const_class(be_class_lvh_led) }, - { be_const_key_weak(scr, -1), be_const_var(3) }, - { be_const_key_weak(re_page_target, -1), be_const_var(8) }, - { be_const_key_weak(lvh_btnmatrix, 42), be_const_class(be_class_lvh_btnmatrix) }, - { be_const_key_weak(lvh_scale, 27), be_const_class(be_class_lvh_scale) }, + { be_const_key_weak(lvh_dropdown_list, 27), be_const_class(be_class_lvh_dropdown_list) }, { be_const_key_weak(lvh_msgbox, -1), be_const_class(be_class_lvh_msgbox) }, - { be_const_key_weak(lvh_img, 23), be_const_class(be_class_lvh_img) }, - { be_const_key_weak(lvh_checkbox, 26), be_const_class(be_class_lvh_checkbox) }, - { be_const_key_weak(lvh_switch, 25), be_const_class(be_class_lvh_switch) }, - { be_const_key_weak(parse, 4), be_const_closure(class_HASPmota_parse_closure) }, - { be_const_key_weak(lvh_btn, -1), be_const_class(be_class_lvh_btn) }, - { be_const_key_weak(do_action, 19), be_const_closure(class_HASPmota_do_action_closure) }, - { be_const_key_weak(lvh_tabview, 18), be_const_class(be_class_lvh_tabview) }, + { be_const_key_weak(event_dispatch, -1), be_const_closure(class_HASPmota_event_dispatch_closure) }, + { be_const_key_weak(r24, -1), be_const_var(6) }, + { be_const_key_weak(lvh_scale, -1), be_const_class(be_class_lvh_scale) }, + { be_const_key_weak(lvh_cpicker, -1), be_const_class(be_class_lvh_cpicker) }, + { be_const_key_weak(parse_page, -1), be_const_closure(class_HASPmota_parse_page_closure) }, + { be_const_key_weak(lvh_label, -1), be_const_class(be_class_lvh_label) }, + { be_const_key_weak(lvh_switch, -1), be_const_class(be_class_lvh_switch) }, + { be_const_key_weak(_remove_page, 1), be_const_closure(class_HASPmota__remove_page_closure) }, + { be_const_key_weak(page_dir_to, 6), be_const_closure(class_HASPmota_page_dir_to_closure) }, { be_const_key_weak(lvh_slider, -1), be_const_class(be_class_lvh_slider) }, + { be_const_key_weak(lvh_line, 7), be_const_class(be_class_lvh_line) }, + { be_const_key_weak(r12, 61), be_const_var(4) }, + { be_const_key_weak(parse_obj, 8), be_const_closure(class_HASPmota_parse_obj_closure) }, + { be_const_key_weak(sort, -1), be_const_static_closure(class_HASPmota_sort_closure) }, + { be_const_key_weak(get_pages, -1), be_const_closure(class_HASPmota_get_pages_closure) }, + { be_const_key_weak(lvh_spangroup, 15), be_const_class(be_class_lvh_spangroup) }, + { be_const_key_weak(lvh_root, 32), be_const_class(be_class_lvh_root) }, + { be_const_key_weak(scr, -1), be_const_var(3) }, + { be_const_key_weak(lvh_qrcode, 21), be_const_class(be_class_lvh_qrcode) }, + { be_const_key_weak(fix_lv_version, 9), be_const_static_closure(class_HASPmota_fix_lv_version_closure) }, + { be_const_key_weak(get_page_cur, -1), be_const_closure(class_HASPmota_get_page_cur_closure) }, + { be_const_key_weak(lvh_bar, -1), be_const_class(be_class_lvh_bar) }, + { be_const_key_weak(lvh_span, -1), be_const_class(be_class_lvh_span) }, + { be_const_key_weak(lvh_tab, -1), be_const_class(be_class_lvh_tab) }, + { be_const_key_weak(lvh_chart, -1), be_const_class(be_class_lvh_chart) }, + { be_const_key_weak(lvh_fixed, 60), be_const_class(be_class_lvh_fixed) }, + { be_const_key_weak(init, 36), be_const_closure(class_HASPmota_init_closure) }, + { be_const_key_weak(lvh_roller, 43), be_const_class(be_class_lvh_roller) }, + { be_const_key_weak(started, 24), be_const_var(0) }, + { be_const_key_weak(start, 48), be_const_closure(class_HASPmota_start_closure) }, + { be_const_key_weak(lvh_btn, -1), be_const_class(be_class_lvh_btn) }, + { be_const_key_weak(event_cb, -1), be_const_var(12) }, + { be_const_key_weak(lvh_scr, 29), be_const_class(be_class_lvh_scr) }, + { be_const_key_weak(do_action, -1), be_const_closure(class_HASPmota_do_action_closure) }, + { be_const_key_weak(lvh_checkbox, 54), be_const_class(be_class_lvh_checkbox) }, + { be_const_key_weak(register_event, -1), be_const_closure(class_HASPmota_register_event_closure) }, + { be_const_key_weak(re_page_target, -1), be_const_var(10) }, + { be_const_key_weak(hres, 37), be_const_var(1) }, + { be_const_key_weak(lvh_tabview, -1), be_const_class(be_class_lvh_tabview) }, { be_const_key_weak(_load, -1), be_const_closure(class_HASPmota__load_closure) }, - { be_const_key_weak(def_templ_name, 10), be_nested_str_weak(pages_X2Ejsonl) }, - { be_const_key_weak(lvh_qrcode, 7), be_const_class(be_class_lvh_qrcode) }, - { be_const_key_weak(lvh_spinner, 5), be_const_class(be_class_lvh_spinner) }, - { be_const_key_weak(pages_list_sorted, -1), be_const_closure(class_HASPmota_pages_list_sorted_closure) }, { be_const_key_weak(lvh_page, -1), be_const_class(be_class_lvh_page) }, + { be_const_key_weak(lvh_arc, -1), be_const_class(be_class_lvh_arc) }, + { be_const_key_weak(parse, -1), be_const_closure(class_HASPmota_parse_closure) }, + { be_const_key_weak(vres, 42), be_const_var(2) }, + { be_const_key_weak(r16, 41), be_const_var(5) }, + { be_const_key_weak(lvh_spinner, -1), be_const_class(be_class_lvh_spinner) }, + { be_const_key_weak(event, 50), be_const_var(11) }, + { be_const_key_weak(lvh_flex, -1), be_const_class(be_class_lvh_flex) }, + { be_const_key_weak(lvh_led, 23), be_const_class(be_class_lvh_led) }, + { be_const_key_weak(lvh_obj, 28), be_const_class(be_class_lvh_obj) }, + { be_const_key_weak(lvh_page_cur_idx, -1), be_const_var(8) }, + { be_const_key_weak(lvh_img, 25), be_const_class(be_class_lvh_img) }, + { be_const_key_weak(lvh_page_cur_idx_parsing, -1), be_const_var(9) }, + { be_const_key_weak(lvh_dropdown, -1), be_const_class(be_class_lvh_dropdown) }, + { be_const_key_weak(pages_list_sorted, -1), be_const_closure(class_HASPmota_pages_list_sorted_closure) }, + { be_const_key_weak(get_page_cur_parsing, -1), be_const_closure(class_HASPmota_get_page_cur_parsing_closure) }, + { be_const_key_weak(lvh_pages, 13), be_const_var(7) }, + { be_const_key_weak(lvh_scale_line, -1), be_const_class(be_class_lvh_scale_line) }, + { be_const_key_weak(lvh_scale_section, -1), be_const_class(be_class_lvh_scale_section) }, + { be_const_key_weak(PAGES_JSONL, -1), be_nested_str_weak(pages_X2Ejsonl) }, + { be_const_key_weak(page_show, -1), be_const_closure(class_HASPmota_page_show_closure) }, + { be_const_key_weak(lvh_btnmatrix, -1), be_const_class(be_class_lvh_btnmatrix) }, })), be_str_weak(HASPmota) ); diff --git a/pio-tools/post_esp32.py b/pio-tools/post_esp32.py index e986a5021..28066bf95 100644 --- a/pio-tools/post_esp32.py +++ b/pio-tools/post_esp32.py @@ -26,7 +26,7 @@ platform = env.PioPlatform() from genericpath import exists import os import sys -from os.path import join +from os.path import join, getsize import csv import requests import shutil @@ -272,6 +272,13 @@ def esp32_create_combined_bin(source, target, env): "--flash_size", flash_size, ] + # platformio estimates the flash space used to store the firmware. + # the estimation is inaccurate. perform a final check on the firmware + # size by comparing it against the partition size. + max_size = env.BoardConfig().get("upload.maximum_size", 1) + fw_size = getsize(firmware_name) + if (fw_size > max_size): + raise Exception(Fore.RED + "firmware binary too large: %d > %d" % (fw_size, max_size)) print(" Offset | File") for section in sections: diff --git a/platformio_tasmota32.ini b/platformio_tasmota32.ini index 61a606b99..624310b66 100644 --- a/platformio_tasmota32.ini +++ b/platformio_tasmota32.ini @@ -81,7 +81,7 @@ lib_ignore = ${esp32_defaults.lib_ignore} ccronexpr [core32] -platform = https://github.com/tasmota/platform-espressif32/releases/download/2025.02.30/platform-espressif32.zip +platform = https://github.com/tasmota/platform-espressif32/releases/download/2025.04.30/platform-espressif32.zip platform_packages = build_unflags = ${esp32_defaults.build_unflags} build_flags = ${esp32_defaults.build_flags} diff --git a/platformio_tasmota_cenv_sample.ini b/platformio_tasmota_cenv_sample.ini index 9c0576147..b89852c45 100644 --- a/platformio_tasmota_cenv_sample.ini +++ b/platformio_tasmota_cenv_sample.ini @@ -67,6 +67,88 @@ build_flags = ${env:tasmota32_base.build_flags} -DUSE_LVGL_OPENHASP -DOTA_URL='""' +[env:tasmota32-WPA3_SAE] +; Arduino libs with WiFi Enterprise support +extends = env:tasmota32_base +build_flags = ${env:tasmota32_base.build_flags} + -DFIRMWARE_TASMOTA32 + -DOTA_URL='""' +lib_ignore = Micro-RTSP +custom_sdkconfig = CONFIG_ESP_WIFI_ENTERPRISE_SUPPORT=y + CONFIG_WIFI_AUTH_WPA2_ENTERPRISE=y + CONFIG_WIFI_AUTH_WPA3_ENTERPRISE=y + CONFIG_WIFI_AUTH_WPA2_WPA3_ENTERPRISE=y + CONFIG_ESP_WIFI_ENABLE_WPA3_SAE=y + CONFIG_ESP_WIFI_ENABLE_WPA3_OWE_STA=y + +[env:tasmota32s3-qio_opi_per] +; device needs >= 8MB Flash!! Hybrid compile for max. performance when using Displays +extends = env:tasmota32_base +board = esp32s3-qio_opi_120 +board_build.partitions = partitions/esp32_partition_app3904k_fs3392k.csv +board_upload.flash_size = 8MB +board_upload.maximum_size = 8388608 +build_unflags = ${env:tasmota32_base.build_unflags} + -Os + -ffunction-sections +build_flags = ${env:tasmota32_base.build_flags} + -Ofast + -mtext-section-literals + -DUSE_BERRY_ULP + -DFIRMWARE_LVGL + -DUSE_LVGL_OPENHASP + -DOTA_URL='""' +custom_sdkconfig = '# CONFIG_COMPILER_OPTIMIZATION_SIZE is not set' + CONFIG_COMPILER_OPTIMIZATION_PERF=y + '# CONFIG_ESP_DEBUG_INCLUDE_OCD_STUB_BINS is not set' + '# CONFIG_LWIP_PPP_SUPPORT is not set' + '# SPI_FLASH_ENABLE_ENCRYPTED_READ_WRITE is not set' + CONFIG_SPIRAM_MODE_OCT=y + CONFIG_SPIRAM_SPEED_120M=y + CONFIG_SPIRAM_IGNORE_NOTFOUND=y + '# CONFIG_SPIRAM_MEMTEST is not set' + CONFIG_LCD_RGB_ISR_IRAM_SAFE=y + CONFIG_GDMA_CTRL_FUNC_IN_IRAM=y + CONFIG_I2S_ISR_IRAM_SAFE=y + CONFIG_GDMA_ISR_IRAM_SAFE=y + CONFIG_SPIRAM_XIP_FROM_PSRAM=y + CONFIG_SPIRAM_FETCH_INSTRUCTIONS=y + CONFIG_SPIRAM_RODATA=y + CONFIG_ESP32S3_DEFAULT_CPU_FREQ_240=y + CONFIG_ESP32S3_DATA_CACHE_64KB=y + CONFIG_ESP32S3_DATA_CACHE_LINE_64B=y + +[env:tasmota32c2-no-NAPT] +; Hybrid compile: No IDF BT support, disabled PPP, Ethernet and NAPT +extends = env:tasmota32_base +board = esp32c2 +build_flags = ${env:tasmota32_base.build_flags} + -DFIRMWARE_TASMOTA32 + -DOTA_URL='"http://ota.tasmota.com/tasmota32/release/tasmota32c2.bin"' +lib_ignore = ${env:tasmota32_base.lib_ignore} + Micro-RTSP +custom_sdkconfig = + '# CONFIG_BT_ENABLED is not set' + '# CONFIG_BT_NIMBLE_ENABLED is not set' + '# CONFIG_BT_CONTROLLER_ENABLED is not set' + CONFIG_BT_CONTROLLER_DISABLED=y + '# CONFIG_LWIP_IP_FORWARD is not set' + '# CONFIG_LWIP_IPV4_NAPT is not set' + '# CONFIG_LWIP_IPV4_NAPT_PORTMAP is not set' + '# CONFIG_ETH_ENABLED is not set' + '# CONFIG_ETH_USE_SPI_ETHERNET is not set' + '# CONFIG_ETH_TRANSMIT_MUTEX is not set' + '# CONFIG_ETH_SPI_ETHERNET_DM9051 is not set' + '# CONFIG_ETH_SPI_ETHERNET_W5500 is not set' + '# CONFIG_ETH_SPI_ETHERNET_KSZ8851SNL is not set' + '# CONFIG_LWIP_PPP_SUPPORT is not set' +; disable not needed IDF managed components for Arduino libs compile +custom_component_remove = espressif/esp_hosted + espressif/esp_wifi_remote + espressif/esp_modem +; add IDF component from espressif registry for Arduino libs compile +custom_component_add = espressif/esp-dsp @ ^1.5.2 + [env:tasmota32s3-opi_opi] extends = env:tasmota32_base board = esp32s3-opi_opi diff --git a/tasmota/berry/drivers/AXP2102_M5Core2v1_1.be b/tasmota/berry/drivers/AXP2102_M5Core2v1_1.be new file mode 100644 index 000000000..2d8d14272 --- /dev/null +++ b/tasmota/berry/drivers/AXP2102_M5Core2v1_1.be @@ -0,0 +1,64 @@ +#------------------------------------------------------------- + - Specialized driver for AXP2102 of M5Core2v1_1 + -------------------------------------------------------------# +class AXP2102_M5Core2v1_1 : AXP2102 + def init() + super(self).init() + if self.wire + # From https://github.com/m5stack/M5Unified/blob/b8cfec7fed046242da7f7b8024a4e92004a51ff7/src/utility/Power_Class.cpp#L351-L360 + # for Core2 v1.1 + # static constexpr std::uint8_t reg_data_array[] = + # { 0x27, 0x00 // PowerKey Hold=1sec / PowerOff=4sec + # , 0x10, 0x30 // PMU common config (internal off-discharge enable) + # , 0x12, 0x00 // BATFET disable + # , 0x68, 0x01 // Battery detection enabled. + # , 0x69, 0x13 // CHGLED setting + # , 0x99, 0x00 // DLDO1 set 0.5v (vibration motor) + # , 0x30, 0x0F // ADC enabled (for voltage measurement) + # // , 0x18, 0x0E + # }; + self.write8(0x90, 0xBE) # LDOS ON/OFF control 0 + self.write8(0x92, 0x00) # ALDO1 off + self.write8(0x93, 33 -5) # ALDO2 on, set to 3.3v // AXP_ILI9342C_RTS + self.write8(0x94, 0x00) # ALDO3 on, set to 0.5V // AXP_SPK_EN off + self.write8(0x95, 33 -5) # ALDO4 on, set to 3.3v // AXP_ILI9342C_POWER + self.write8(0x96, 0x00) # BLDO1 on, set to 0.5V // AXP_ILI9342C_BL off + self.write8(0x99, 0x00) # DLDO1 on, set to 0.5V // AXP_VIB off + self.write8(0x27, 0x00) # PowerKey Hold=1sec // PowerOff=4sec + self.write8(0x22, 0x06) # PWROFF_EN behavior + self.write8(0x10, 0x30) # PMU common config + self.write8(0x12, 0x00) # BATFET disabled + self.write8(0x68, 0x01) # Battery detection enabled + self.write8(0x69, 0x13) # CHGLED setting + self.write8(0x30, 0x0F) # ADC enabled (for voltage measurement) + tasmota.add_driver(self) + end + end + + # set LCD backlight voltage on BLDO1 + def set_lcd_voltage(voltage) + if (voltage < 2500) voltage = 2500 end + if (voltage > 3300) voltage = 3300 end + self.set_ldo_voltage(4, voltage) # 4=BLD01 + end + + # Speaker enable + def set_speaker_enable(state) + self.set_ldo_voltage(2, state ? 3300 : 0) # 2 = ALDO3 + end + + # Dimmer in percentage + def set_displaydimmer(x) + var v = tasmota.scale_uint(x, 0, 100, 2500, 3300) + self.set_lcd_voltage(v) + end + + # respond to display events + def display(cmd, idx, payload, raw) + if cmd == "dim" || cmd == "power" + self.set_displaydimmer(idx) + end + end + +end +return AXP2102_M5Core2v1_1() diff --git a/tasmota/berry/include/be_gpio_defines.h b/tasmota/berry/include/be_gpio_defines.h index fc868e6d5..3c833acc1 100644 --- a/tasmota/berry/include/be_gpio_defines.h +++ b/tasmota/berry/include/be_gpio_defines.h @@ -333,6 +333,8 @@ const be_const_member_t lv_gpio_constants[] = { { "TUYA_TX", (int32_t) GPIO_TUYA_TX }, { "TX2X_TXD_BLACK", (int32_t) GPIO_TX2X_TXD_BLACK }, { "TXD", (int32_t) GPIO_TXD }, + { "V9240_RX", (int32_t) GPIO_V9240_RX }, + { "V9240_TX", (int32_t) GPIO_V9240_TX }, { "VINDRIKTNING_RX", (int32_t) GPIO_VINDRIKTNING_RX }, { "VL53LXX_XSHUT1", (int32_t) GPIO_VL53LXX_XSHUT1 }, { "WE517_RX", (int32_t) GPIO_WE517_RX }, diff --git a/tasmota/berry/leds_panel/leds_panel.be b/tasmota/berry/leds_panel/leds_panel.be index 81bf5ed03..45e4f29c3 100644 --- a/tasmota/berry/leds_panel/leds_panel.be +++ b/tasmota/berry/leds_panel/leds_panel.be @@ -707,6 +707,7 @@ class leds_panel static var SAMPLING = 100 static var PORT = 8886 # default port 8886 + static var HTML_WIDTH = 290 static var HTML_HEAD1 = "" static var HTML_URL_F = @@ -794,10 +795,10 @@ class leds_panel '' '' static var HTML_CONTENT = - '' + '
' '' '' '' '
' - '' + '' '
' @@ -837,7 +838,7 @@ class leds_panel self.p_leds = self.strip.pixels_buffer(self.p_leds) # update buffer self.h = tasmota.settings.light_pixels_height_1 + 1 self.w = self.strip.pixel_count() / (tasmota.settings.light_pixels_height_1 + 1) - self.cell_size = tasmota.int(330 / self.w, 4, 25) + self.cell_size = tasmota.int(self.HTML_WIDTH / self.w, 4, 25) self.cell_space = (self.cell_size <= 6) ? 1 : 2 end @@ -946,14 +947,46 @@ class leds_panel webserver.content_send( f'' '' - '
 Leds mirroring ' - '' - '
' - '' - '' - '
' + '' + '' + '
' + '' + '' + '' + '' + '
' + '' + '' + '' + '' + '' + ) + webserver.content_send( + '' ) end end diff --git a/tasmota/berry/leds_panel/leds_panel.bec b/tasmota/berry/leds_panel/leds_panel.bec index bc03ef151..8392ac0eb 100644 Binary files a/tasmota/berry/leds_panel/leds_panel.bec and b/tasmota/berry/leds_panel/leds_panel.bec differ diff --git a/tasmota/berry/lvgl_panel/lvgl_panel.be b/tasmota/berry/lvgl_panel/lvgl_panel.be new file mode 100644 index 000000000..3f2e93bf2 --- /dev/null +++ b/tasmota/berry/lvgl_panel/lvgl_panel.be @@ -0,0 +1,1065 @@ +# +# lvgl_panel.be - implements a real-time mirroring of LVGL display on the main page +# +# Copyright (C) 2025 Stephan Hadinger & Theo Arends +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . +# + +# make sure we use `webserver_async` if it's already solidified +if !global.contains("webserver_async") || type(global.webserver_async) != 'class' + class webserver_async + ############################################################# + # class webserver_async_cnx + # + # This instance represents an active connection between + # the server and a client (TCP connection) + ############################################################# + static class webserver_async_cnx + var server # link to server object + var cnx # holds the tcpclientasync instance + var close_after_send # if true, close after we finished sending the out_buffer + var fastloop_cb # cb for fastloop + var buf_in # incoming buffer + var buf_in_offset + var buf_out + var phase # parsing phase: 0/ status line, 1/ headers, 2/ payload + # request + var req_verb # verb for request (we support only GET) + var req_uri # URI for request + var req_version # HTTP version for request + var header_host # 'Host' header - useful for redirections + # response + var resp_headers # (string) aggregate headers + var chunked # if true enable chunked encoding (default true) + # conversion + static var CODE_TO_STRING = { + # 100: "Continue", + 200: "OK", + # 204: "No Content", + 301: "Moved Permanently", + # 400: "Bad Request", + # 401: "Unauthorized", + # 403: "Payment Required", # not sure it's useful in Tasmota context + 404: "Not Found", + 500: "Internal Server Error", + # 501: "Not Implemented" + } + + ############################################################# + # init + # + # Called when a new connection is received from a client + # Arg: + # - server : main instance of `webserver_async` server + # - cnx : instance of `tcpclientasync` + # + # By default: + # version is HTTP/1.1 + # response is chunked-encoded + def init(server, cnx) + self.server = server + self.cnx = cnx + self.buf_in = '' + self.buf_in_offset = 0 + self.buf_out = bytes() + self.phase = 0 # 0 = status line + # util + self.close_after_send = false + # response + self.resp_headers = '' + self.chunked = true + # register cb + self.fastloop_cb = def () self.loop() end # the closure needs to be kept, to allow removal of fast_loop later + tasmota.add_fast_loop(self.fastloop_cb) + end + + ############################################################# + # set_chunked: sets whether the response is chunked encoded + # true by default + # + def set_chunked(chunked) + self.chunked = bool(chunked) + end + + ############################################################# + # connected: returns `true` if the connection is still open + # + def connected() + return self.cnx ? self.cnx.connected() : false + end + + ############################################################# + # buf_out_empty: returns `true` if out buffer is empty, + # i.e. all content was sent to client + # + def buf_out_empty() + return size(self.buf_out) == 0 + end + + ############################################################# + # _write: (internal method) write bytes + # + # Arg: + # v must be bytes() + # + def _write(v) + var sz_v = size(v) + if (sz_v == 0) return end # do nothing if empty content + + var buf_out = self.buf_out # keep a copy of reference in local variable (avoids multiple dereferencing) + var buf_out_sz = size(buf_out) + buf_out.resize(buf_out_sz + sz_v) + buf_out.setbytes(buf_out_sz, v) + + self._send() # try sending `self.buf_out` now + end + + ############################################################# + # close: close the connection to client + # + # Can be called multiple times + # Does nothing if connection is already closed + # + def close() + # log(f"WEB: closing cnx", 3) + if (self.cnx != nil) self.cnx.close() end + self.cnx = nil + end + + ############################################################# + # loop: called by fastloop every 5 ms + # + def loop() + if self.cnx == nil # if connection is closed, this instance is marked for deletion + tasmota.remove_fast_loop(self.fastloop_cb) # remove from fast_loop + self.fastloop_cb = nil # fastloop_cb can be garbage collected + return + end + + self._send() # try sending any pending output data + + var cnx = self.cnx # keep copy + if (cnx == nil) return end # it's possible that it was closed after _send() + + # any new incoming data received? + if cnx.available() > 0 + var buf_in_new = cnx.read() # read bytes() object + if (!self.buf_in) # use the same instance if none present + self.buf_in = buf_in_new + else # or append to current incoming buffer + self.buf_in += buf_in_new + end + end + + # parse incoming data if any + if (self.buf_in) + self.parse() + end + end + + ############################################################# + # _send: (internal method) try sending pendin data out + # + # the content is in `self.buf_out` + # + def _send() + # any data waiting to go out? + var cnx = self.cnx + if (cnx == nil) return end # abort if connection is closed + + var buf_out = self.buf_out # keep reference in local variable + if size(buf_out) > 0 + if cnx.listening() # is the client ready to receive? + var sent = cnx.write(buf_out) # send the buffer, `sent` contains the number of bytes actually sent + if sent > 0 # did we succeed in sending anything? + # we did sent something + if sent >= size(buf_out) # the entire buffer was sent, clear it + # all sent + self.buf_out.clear() + else # buffer was sent partially, remove what was sent from `out_buf` + # remove the first bytes already sent + self.buf_out.setbytes(0, buf_out, sent) # copy to index 0 (start of buffer), content from the same buffer starting at offset 'sent' + self.buf_out.resize(size(buf_out) - sent) # shrink buffer + end + end + end + else + # empty buffer, do the cleaning + # self.buf_out.clear() # TODO not needed? + # self.buf_in_offset = 0 # TODO really useful? + + if self.close_after_send # close connection if we have sent everything + self.close() + end + end + end + + ############################################################# + # parse incoming + # + # pre: self.buf_in is not empty + # post: self.buf_in has made progress (smaller or '') + def parse() + # log(f"WEB: incoming {bytes().fromstring(self.buf_in).tohex()}", 3) + if self.phase == 0 + self.parse_http_req_line() + elif self.phase == 1 + self.parse_http_headers() + elif self.phase == 2 + self.parse_http_payload() + end + end + + ############################################################# + # parse incoming request + # + # pre: self.buf_in is not empty + # post: self.buf_in has made progress (smaller or '') + def parse_http_req_line() + var m = global._re_http_srv.match2(self.buf_in, self.buf_in_offset) + # Ex: "GET / HTTP/1.1\r\n" + if m + var offset = m[0] + self.req_verb = m[1] # GET/POST... + self.req_uri = m[2] # / + self.req_version = m[3] # "1.0" or "1.1" + self.phase = 1 # proceed to parsing headers + self.buf_in = self.buf_in[offset .. ] # remove what we parsed + if tasmota.loglevel(4) + log(f"WEB: HTTP verb: {self.req_verb} URI: '{self.req_uri}' Version:{self.req_version}", 4) + end + self.parse_http_headers() + elif size(self.buf_in) > 100 # if no match and we still have 100 bytes, then it fails + log("WEB: error invalid request", 4) + self.close() + self.buf_in = '' + end + end + + ############################################################# + # parse incoming headers + def parse_http_headers() + while true + # print("parse_http_headers", "self.buf_in_offset=", self.buf_in_offset) + var m = global._re_http_srv_header.match2(self.buf_in, self.buf_in_offset) + # print("m=", m) + # Ex: [32, 'Content-Type', 'application/json'] + if m + self.event_http_header(m[1], m[2]) + self.buf_in_offset += m[0] + else # no more headers + var m2 = global._re_http_srv_body.match2(self.buf_in, self.buf_in_offset) + if m2 + # end of headers + # we keep \r\n which is used by pattern + self.buf_in = self.buf_in[self.buf_in_offset + m2[0] .. ] # truncate + self.buf_in_offset = 0 + + # self.event_http_headers_end() # no more headers + self.phase = 2 + self.parse_http_payload() # continue to parsing payload + end + if size(self.buf_in) > 1024 # we don't accept a single header larger than 1KB + log("WEB: error header is bigger than 1KB", 4) + self.close() + self.buf_in = '' + end + return + end + end + + end + + ############################################################# + # event_http_header: method called for each header received + # + # Default implementation only stores "Host" header + # and ignores all other headers + # + # Args: + # header_key: string + # header_value: string + # + def event_http_header(header_key, header_value) + # log(f"WEB: header key '{header_key}' = '{header_value}'") + + if (header_key == "Host") + self.header_host = header_value + end + end + + ############################################################# + # event_http_headers_end: called afte all headers are received + # + # By default does nothing + # + # def event_http_headers_end() + # end + + ############################################################# + # parse incoming payload (if any) + # + # Calls the server's dispatcher with 'verb' and 'uri' + # + # Payload is in `self.buf_in` + # + def parse_http_payload() + # log(f"WEB: parsing payload '{bytes().fromstring(self.buf_in).tohex()}'") + # dispatch request before parsing payload + self.server.dispatch(self, self.req_uri, self.req_verb) + end + + + ############################################################# + # Responses + ############################################################# + # send_header: add header to the response + # + # Args: + # name: key of header + # value: value of header + # first: if 'true' prepend, or append if 'false' + def send_header(name, value, first) + if first + self.resp_headers = f"{name}: {value}\r\n{self.resp_headers}" + else + self.resp_headers = f"{self.resp_headers}{name}: {value}\r\n" + end + end + + ############################################################# + # send: send response to client + # + # Args + # code: (int) http code (ex: 200) + # content_type: (string, opt) MIME type, "text/html" if not specified + # content: (bytes or string, opt) first content to send to client (you can send more later) + # + def send(code, content_type, content) + var response = f"HTTP/1.1 {code} {self.CODE_TO_STRING.find(code, 'UNKNOWN')}\r\n" + self.send_header("Content-Type", content_type ? content_type : "text/html", true) + + self.send_header("Accept-Ranges", "none") + # chunked encoding? + if self.chunked + self.send_header("Transfer-Encoding", "chunked") + end + # cors? + if self.server.cors + self.send_header("Access-Control-Allow-Origin", "*") + self.send_header("Access-Control-Allow-Methods", "*") + self.send_header("Access-Control-Allow-Headers", "*") + end + # others + self.send_header("Connection", "close") + + response += self.resp_headers + response += "\r\n" + self.resp_headers = nil + + # send status-line and headers + self.write_raw(response) + + # send first part of content + if (content) self.write(content) end + end + + ############################################################# + # write: writes a bytes or string piece of content + # + # If chunked encoding is enabled, it is sent as a separate chunk + # + # If content is empty, it can be sent as an empty chunk + # which is an indicator of end-of-content + # + def write(v) + if type(v) == 'string' # if string, convert to bytes + v = bytes().fromstring(v) + end + + # use chunk encoding + if self.chunked + var p1 = self.server.p1 + p1.clear() + p1.append(f"{size(v):X}\r\n") + p1.append(v) + p1.append("\r\n") + + # log(f"WEB: sending chunk '{p1.tohex()}'") + self._write(p1) + else + self._write(v) + end + end + + ############################################################# + # write_raw: low-level write of string or bytes (without chunk encoding) + # + # If content is empty, nothing is sent + # + def write_raw(v) + if (size(v) == 0) return end + + if type(v) == 'string' # if string, convert to bytes + v = bytes().fromstring(v) + end + + self._write(v) + end + + ############################################################# + # content_stop: signal that the response is finished + # + def content_stop() + self.write('') # send 'end-of-content' for chunked encoding + self.close_after_send = true # close connection when everything was sent to client + end + end + + ####################################################################### + # class webserver_async_dispatcher + # + # Pre-register callbacks triggered when a certain URL is accessed + # + # You can register either a pure function or a method and an instance + # + # Pure function: + # webserver_async_dispatcher(uri_prefix, nil, func, verb) + # will call: + # func(cnx, uri, verb) + # + # Instance and method: + # webserver_async_dispatcher(uri_prefix, instance, method, verb) + # will call: + # insatnce.method(cnx, uri, verb) + # + # Args in: + # uri_prefix: prefix string for matchin URI, must start with '/' + # cb_obj: 'nil' for pure function or instance from which we call a method + # cb_mth: pure function or method to call + # verb: verb to match, only supported: 'GET' or 'nil' for any + # + # Args of callback: + # cnx: instance of 'webserver_async_cnx' for the current connection + # uri: full uri of request + # verb: verb received (currently only GET is supported) + ####################################################################### + static class webserver_async_dispatcher + var uri_prefix # prefix string, must start with '/' + var verb # verb to match, or nil for ANY + var cb_obj # callback object (sent as first argument if not 'nil') + var cb_mth # callback function + + def init(uri_prefix, cb_obj, cb_mth, verb) + self.uri_prefix = uri_prefix + self.cb_obj = cb_obj + self.cb_mth = cb_mth + self.verb = verb + end + + # return true if matched + def dispatch(cnx, uri, verb) + import string + if string.find(uri, self.uri_prefix) == 0 + var match = false + if (self.verb == nil) || (self.verb == verb) + # method is valid + var cb_obj = self.cb_obj + if (cb_obj != nil) + self.cb_mth(self.cb_obj, cnx, uri, verb) + else + self.cb_mth(cnx, uri, verb) + end + return true + end + end + return false + end + end + + ############################################################# + # class webserver_async + # + # This is the main class to call + ############################################################# + var local_port # listening port, 80 is already used by Tasmota + var server # instance of `tcpserver` + var fastloop_cb # closure used by fastloop + # var timeout # default timeout for tcp connection + var connections # list of active connections + # var auth # web authentication string (Basic Auth) or `nil`, in format `user:password` as bade64 + # var cmd # GET url command + var dispatchers + # copied in each connection + var chunked # if true enable chunked encoding (default true) + var cors # if true send CORS headers (default false) + # + var p1 # temporary object bytes() to avoid reallocation + + # static var TIMEOUT = 1000 # default timeout: 1000ms + # static var HTTP_REQ = "^(\\w+) (\\S+) HTTP\\/(\\d\\.\\d)\r\n" + # static var HTTP_HEADER_REGEX = "([A-Za-z0-9-]+): (.*?)\r\n" # extract a header with its 2 parts + # static var HTTP_BODY_REGEX = "\r\n" # end of headers + + ############################################################# + # init + def init(port, timeout) + # if (timeout == nil) timeout = self.TIMEOUT end + # if (timeout == nil) timeout = 1000 end + self.connections = [] + self.dispatchers = [] + self.server = tcpserver(port) # throws an exception if port is not available + self.chunked = true + self.cors = false + self.p1 = bytes(100) # reserve 100 bytes by default + # TODO what about max_clients ? + self.compile_re() + # register cb + tasmota.add_driver(self) + self.fastloop_cb = def () self.loop() end + tasmota.add_fast_loop(self.fastloop_cb) + end + + ############################################################# + # compile once for all the regex + def compile_re() + import re + if !global.contains("_re_http_srv") + # global._re_http_srv = re.compile(self.HTTP_REQ) + # global._re_http_srv_header = re.compile(self.HTTP_HEADER_REGEX) + # global._re_http_srv_body = re.compile(self.HTTP_BODY_REGEX) + global._re_http_srv = re.compile("^(\\w+) (\\S+) HTTP\\/(\\d\\.\\d)\r\n") + global._re_http_srv_header = re.compile("([A-Za-z0-9-]+): (.*?)\r\n") + global._re_http_srv_body = re.compile("\r\n") + end + end + + ############################################################# + # enable or disable chunked mode (enabled by default) + def set_chunked(chunked) + self.chunked = bool(chunked) + end + + ############################################################# + # enable or disable CORS mode (enabled by default) + def set_cors(cors) + self.cors = bool(cors) + end + + ############################################################# + # Helper function to encode integer as hex (uppercase) + static def bytes_format_hex(b, i, default) + b.clear() + if (i == nil) b .. default return end + # sanity check + if (i < 0) i = -i end + if (i < 0) return end # special case for MININT + if (i == 0) b.resize(1) b[0] = 0x30 return end # return bytes("30") + + b.resize(8) + var len = 0 + while i > 0 + var digit = i & 0x0F + if (digit < 10) + b[len] = 0x30 + digit + else + b[len] = 0x37 + digit # 0x37 = 0x41 ('A') - 10 + end + len += 1 + i = (i >> 4) + end + # reverse order + b.resize(len) + b.reverse() + end + + ############################################################# + # Helper function to encode integer as int + static def bytes_append_int(b, i, default) + var sz = size(b) + if (i == 0) # just append '0' + b.resize(sz + 1) + b[sz] = 0x30 + elif (i != nil) # we have a non-zero value + var negative = false + # sanity check + if (i < 0) i = -i negative = true end + if (i < 0) return b end # special case for MININT + + if negative + b.resize(sz + 1) + b[sz] = 0x2D + sz += 1 + end + + var start = sz + while i > 0 + var digit = i % 10 + b.resize(sz + 1) + b[sz] = 0x30 + digit + sz += 1 + i = (i / 10) + end + # reverse order starting where the integer is + b.reverse(start) + + else # i is `nil`, append default + b.append(default) + end + return b + end + + ############################################################# + # closing web server + def close() + tasmota.remove_driver(self) + tasmota.remove_fast_loop(self.fastloop_cb) + self.fastloop_cb = nil + self.server.close() + + # close all active connections + for cnx: self.connections + cnx.close() + end + self.connections = nil # and free memory + end + + ############################################################# + # clean connections + # + # Remove any connections that is closed or in error + def clean_connections() + var idx = 0 + while idx < size(self.connections) + var cnx = self.connections[idx] + # remove if not connected + if !cnx.connected() + # log("WEB: does not appear to be connected") + cnx.close() + self.connections.remove(idx) + else + idx += 1 + end + end + end + + ############################################################# + # called by fastloop + def loop() + self.clean_connections() + # check if any incoming connection + while self.server.hasclient() + # retrieve new client + var cnx = self.webserver_async_cnx(self, self.server.acceptasync()) + cnx.set_chunked(self.chunked) + self.connections.push(cnx) + end + end + + ############################################################# + # add to dispatcher + def on(prefix, obj, mth, verb) + var dispatcher = self.webserver_async_dispatcher(prefix, obj, mth, verb) + self.dispatchers.push(dispatcher) + end + + ############################################################# + # add to dispatcher + def dispatch(cnx, uri, verb) + var idx = 0 + while idx < size(self.dispatchers) + if (self.dispatchers[idx].dispatch(cnx, uri, verb)) + return + end + idx += 1 + end + # fallback unsupported request + cnx.send(500, "text/plain") + cnx.write("Unsupported") + cnx.content_stop() + end + + end + + # assign the class to a global + global.webserver_async = webserver_async +end + +class lvgl_panel + var port + var web + var p1 # bytes() object reused when generating payload + var feeders + + # static var SAMPLING = 100 + static var PORT = 8881 # default port 8881 + + static var HTML_HEAD1 = + "" + static var HTML_URL_F = + "" + static var HTML_HEAD2 = + '' + '' + '' + '' + static var HTML_CONTENT = + '' + '' + '' + '' + '
' + '' + '
' + static var HTML_END = + '' + '' + + def init(port) + if (port == nil) port = self.PORT end + self.port = port + self.web = global.webserver_async(port) + + self.p1 = bytes(100) + self.feeders = [] + + self.web.set_chunked(true) + self.web.set_cors(true) + self.web.on("/lvgl_feed", self, self.send_info_feed) # feed with lvgl pixels + self.web.on("/lvgl_touch", self, self.touch_received, "POST") # virtual touch screen + self.web.on("/lvgl", self, self.send_info_page) # display lvgl page + + import cb + var paint_cb = cb.gen_cb(def (x1,y1,x2,y2,pixels) self.paint_cb(x1,y1,x2,y2,pixels) end) + lv.set_paint_cb(paint_cb) + + tasmota.add_driver(self) + end + + def close() + tasmota.remove_driver(self) + self.web.close() + end + + def update() + end + + def touch_received(cnx, uri, verb) + # log(f">>>TS: touch_received {uri=} {verb=} {cnx.buf_in=}") + cnx.close() + # Example of events: + # {"x":376,"y":258} + import json + import display + var touch = json.load(cnx.buf_in) # POST payload + if (touch == nil) + log(f"LVG: received invalid touch event '{cnx.buf_in}'") + return + end + + if (tasmota.loglevel(4)) + log(f"LVG: received touch event '{touch}'") + end + + display.touch_update(1, touch.find('x', 0), touch.find('y', 0), 0) + end + + def paint_cb(x1,y1,x2,y2,pixels) + if (size(self.feeders) == 0) return end # nothing to do if no feeders + + import introspect + var pixels_count = (x2-x1+1) * (y2-y1+1) + var pixels_bytes = bytes(introspect.toptr(pixels), pixels_count * 2) + #log(f">>>>>: {x1=} {x2=} {y1=} {y2=} {pixels_count=} {size(pixels_bytes)=}") + + var bytes_per_line = (x2 - x1 + 1) * 2 + var lines_remaining = (y2 - y1 + 1) + var lines_per_msg = 2000 / bytes_per_line + var bytes_per_msg = lines_per_msg * bytes_per_line + var y = y1 + var offset_bytes = 0 + + #log(f">>>>>: {x1=} {x2=} {y1=} {y2=} {bytes_per_line=} {lines_per_msg=} {bytes_per_msg=}") + + while lines_remaining > 0 + # compute the workload + # var payload = pixels_bytes[offset_bytes .. offset_bytes + bytes_per_msg - 1].tob64() # string in base64 + + var idx = 0 + var lines_to_send = (lines_per_msg > lines_remaining) ? lines_remaining : lines_per_msg + var bytes_to_send = lines_to_send * bytes_per_line + while idx < size(self.feeders) + self.feeders[idx].send_feed(x1, y, x2, y + lines_to_send - 1, pixels_bytes, offset_bytes, bytes_to_send) + idx += 1 + end + + # move to next message + offset_bytes += bytes_to_send + y += lines_to_send + lines_remaining -= lines_to_send + end + + # log(f">>>: paint {x1=} {y1=} {x2=} {y2=} {pixels_count=}", 2) + end + + def add_feed(feed) + if self.feeders.find(feed) == nil # make sure it's not already in teh list + self.feeders.push(feed) + end + end + + def remove_feed(feed) + var idx = self.feeders.find(feed) + if idx != nil + self.feeders.remove(idx) + end + end + + def send_info_page(cnx, uri, verb) + import string + var height = lv.get_ver_res() + var width = lv.get_hor_res() + + var host = cnx.header_host + var host_split = string.split(host, ':') # need to make it stronger + var ip = host_split[0] + var port = 80 + if size(host_split) > 1 + port = int(host_split[1]) + end + + cnx.send(200, "text/html") + cnx.write(self.HTML_HEAD1) + cnx.write(format(self.HTML_URL_F, ip, port)) + cnx.write(self.HTML_HEAD2) + cnx.write(format(self.HTML_CONTENT, width, height)) + cnx.write(self.HTML_END) + + cnx.content_stop() + end + + static class feeder + var app # overarching app (debug_panel) + var cnx # connection object + var w, h + + def init(app, cnx) + self.app = app + self.cnx = cnx + self.w = lv.get_hor_res() + self.h = lv.get_ver_res() + #tasmota.add_driver(self) + end + + def close() + self.app.remove_feed(self) + end + + # payload is max 16KB + def send_feed(x1, y1, x2, y2, pixels, idx, len) + var cnx = self.cnx + if !cnx.connected() + self.close() + return nil + end + + var server = self.cnx.server + # if cnx.buf_out_empty() + # if out buffer is not empty, do not send any new information + var app = self.app + var p1 = app.p1 + + p1.clear() + p1.append("id:") + server.bytes_append_int(p1, tasmota.millis()) + p1.append("\r\nevent:lvgl\r\ndata:") + + p1.append('{"x1":') + server.bytes_append_int(p1, x1) + p1.append(',"x2":') + server.bytes_append_int(p1, x2) + p1.append(',"y1":') + server.bytes_append_int(p1, y1) + p1.append(',"y2":') + server.bytes_append_int(p1, y2) + p1.append(',"b64":"') + p1.appendb64(pixels, idx, len) + p1.append('"}\r\n\r\n') + cnx.write(p1) + # end + end + + end + + def send_info_feed(cnx, uri, verb) + cnx.set_chunked(false) # no chunking since we use EventSource + cnx.send(200, "text/event-stream") + # + var feed = feeder(self, cnx) + self.add_feed(feed) + lv.scr_act().invalidate() # force a screen redraw for any new connection + end + + def web_add_main_button() + self.send_iframe_code() + end + + def send_iframe_code() + import webserver + self.update() + var ip = tasmota.wifi().find('ip') + if (ip == nil) + ip = tasmota.eth().find('ip') + end + if (ip != nil) + var height = lv.get_ver_res() + 10 + var width = lv.get_hor_res() + 20 + if (width < 340) width = 340 end + webserver.content_send( + f'' + '' + '' + '' + '' + '' + '
' + '
' + '' + '' + '' + '' + '
' + '
' + '' + ) + webserver.content_send( + '' + ) + end + end + +end + +return lvgl_panel() diff --git a/tasmota/berry/lvgl_panel/lvgl_panel.bec b/tasmota/berry/lvgl_panel/lvgl_panel.bec new file mode 100644 index 000000000..a2b4b42e9 Binary files /dev/null and b/tasmota/berry/lvgl_panel/lvgl_panel.bec differ diff --git a/tasmota/berry/zigbee/cc2652_flasher.be b/tasmota/berry/zigbee/cc2652_flasher.be index e65ec030b..c1b4727fb 100644 --- a/tasmota/berry/zigbee/cc2652_flasher.be +++ b/tasmota/berry/zigbee/cc2652_flasher.be @@ -107,7 +107,6 @@ class cc2652_flasher # restart the MCU in BSL mode and establish communication def start(debug) - if debug == nil debug = false end self.debug = bool(debug) self.reset_bsl() # @@ -134,9 +133,9 @@ class cc2652_flasher self.ser.write(bytes("5555")) # trigger auto baudrate detector var ret = self.recv_raw(100) - if self.debug print("ret=", ret) end - if ret != bytes('CC') - raise "protocol_error" + if self.debug print(f"reset_bsl ret='{ret}'") end + if ret[-1] != 0xCC + raise "protocol_error", f"received '{ret}'" end end @@ -218,7 +217,7 @@ class cc2652_flasher if self.debug print("sending:", payload) end self.ser.write(payload) var ret = self.recv_raw(500) - if self.debug print("ret=", ret) end + if self.debug print(f"ret={ret}") end if no_response == true #ignore self.decode_ack(ret) diff --git a/tasmota/berry/zigbee/sonoff_zb_pro_flasher.be b/tasmota/berry/zigbee/sonoff_zb_pro_flasher.be index d05ed7429..65b3b0e24 100644 --- a/tasmota/berry/zigbee/sonoff_zb_pro_flasher.be +++ b/tasmota/berry/zigbee/sonoff_zb_pro_flasher.be @@ -70,7 +70,7 @@ class sonoff_zb_pro_flasher except .. as e, m self.file_checked = false self.file_validated = false - raise e, m + print(f"FLH: Exception raised '{e}' - '{m}'") end end diff --git a/tasmota/include/alpinejs.h b/tasmota/include/alpinejs.h new file mode 100644 index 000000000..76d98cf61 --- /dev/null +++ b/tasmota/include/alpinejs.h @@ -0,0 +1,725 @@ +/* + alpinejs.h - support for alpinejs 2.8.2 + + SPDX-FileCopyrightText: 2025 Stephan Hadinger + + SPDX-License-Identifier: GPL-3.0-only +*/ + +#ifdef USE_WEBSERVER +#ifdef USE_ALPINEJS + +// `xxd -i alpine.min.js.gz > tas_alpine.h` + +static const char PROGMEM alpine_min_js_gz[] = { + 0x1f, 0x8b, 0x08, 0x08, 0xe8, 0x91, 0xd9, 0x67, 0x02, 0x03, 0x61, 0x6c, + 0x70, 0x69, 0x6e, 0x65, 0x2e, 0x6d, 0x69, 0x6e, 0x2e, 0x6a, 0x73, 0x00, + 0xd5, 0x3d, 0x6b, 0x77, 0xdb, 0xb6, 0x92, 0xdf, 0xf7, 0x57, 0x48, 0x5c, + 0xaf, 0x0e, 0xd9, 0xc0, 0xb2, 0x9d, 0xdd, 0x7b, 0xce, 0x5e, 0xaa, 0x8c, + 0x6e, 0x9a, 0x47, 0xdb, 0xdb, 0x3c, 0xba, 0x4d, 0x7a, 0x7b, 0xb7, 0x8a, + 0x9a, 0xd0, 0x12, 0x64, 0xa3, 0xa1, 0x40, 0x5d, 0x12, 0x8c, 0xed, 0x4a, + 0xfc, 0xef, 0x3b, 0x33, 0x00, 0x08, 0x90, 0xa2, 0xec, 0x24, 0x9b, 0x7b, + 0xf6, 0xec, 0x97, 0x58, 0xc4, 0x73, 0x30, 0x98, 0x17, 0x66, 0x06, 0xc8, + 0x70, 0x55, 0xc9, 0x85, 0x12, 0xb9, 0x0c, 0x39, 0x53, 0xd1, 0x36, 0xc8, + 0xcf, 0x7f, 0xe7, 0x0b, 0x15, 0x24, 0x89, 0xba, 0xd9, 0xf0, 0x7c, 0x35, + 0xe0, 0xd7, 0x9b, 0xbc, 0x50, 0xe5, 0x68, 0x14, 0x54, 0x72, 0xc9, 0x57, + 0x42, 0xf2, 0x65, 0x30, 0xb4, 0x95, 0xeb, 0x7c, 0x59, 0x65, 0x7c, 0xaa, + 0xff, 0x8c, 0x4d, 0xd3, 0x44, 0x85, 0x51, 0x1c, 0xd8, 0x61, 0xdd, 0x48, + 0xba, 0xf7, 0x68, 0xa4, 0xff, 0x8e, 0xd3, 0xf5, 0x72, 0xaa, 0x7f, 0x86, + 0x2a, 0x8a, 0x43, 0x9e, 0xf0, 0xdd, 0xae, 0xe4, 0xd9, 0x2a, 0x1a, 0x3f, + 0xcc, 0x36, 0x50, 0x8a, 0xc3, 0xd4, 0xa1, 0xba, 0x14, 0x25, 0x0b, 0x1b, + 0x18, 0x01, 0xc0, 0xaa, 0xe4, 0x83, 0x52, 0x15, 0x02, 0x80, 0x9c, 0xd8, + 0xf2, 0x01, 0x47, 0xe8, 0x99, 0x8c, 0xb6, 0x05, 0x57, 0x55, 0x21, 0x07, + 0x6a, 0x20, 0xa0, 0x70, 0xfa, 0x92, 0x16, 0x33, 0xd6, 0xd3, 0xfc, 0x58, + 0xe4, 0x1b, 0x5e, 0xa8, 0x1b, 0x6a, 0xba, 0xfd, 0x90, 0x66, 0x15, 0x8f, + 0x25, 0xe3, 0xb2, 0x5a, 0xf3, 0x22, 0x3d, 0xcf, 0x78, 0x3c, 0x3c, 0x65, + 0x8b, 0x5c, 0xae, 0xc4, 0x45, 0xd5, 0x7c, 0x5f, 0x15, 0x42, 0x99, 0xdf, + 0x75, 0x14, 0xf3, 0x99, 0x9a, 0x27, 0xd0, 0xa5, 0x6e, 0xe6, 0x55, 0x1a, + 0x6b, 0x1f, 0xd2, 0x62, 0x20, 0x13, 0x33, 0xdb, 0x7b, 0x7e, 0x53, 0x86, + 0x3c, 0x9a, 0x88, 0x55, 0x68, 0x4a, 0x2e, 0xb8, 0x7a, 0x79, 0x25, 0xed, + 0xfc, 0xaf, 0x6e, 0xd6, 0xe7, 0x79, 0x56, 0xea, 0x5e, 0x22, 0xb9, 0xad, + 0x0d, 0x0e, 0xa3, 0x46, 0xa3, 0x50, 0x24, 0x62, 0xbc, 0x12, 0x99, 0xe2, + 0x45, 0xe8, 0x70, 0xa1, 0x9a, 0xd5, 0xf6, 0x0e, 0xf1, 0x98, 0x97, 0x8b, + 0x42, 0x6c, 0x54, 0x5e, 0x10, 0x8c, 0x63, 0xb7, 0xd0, 0x3a, 0x8a, 0x22, + 0x26, 0xc7, 0x9b, 0xaa, 0xbc, 0x1c, 0xa7, 0x9b, 0x4d, 0x76, 0x13, 0x4a, + 0x26, 0xa2, 0xda, 0x0c, 0x26, 0xdd, 0xea, 0x64, 0x08, 0x18, 0x5d, 0xc1, + 0x00, 0x1a, 0xd2, 0xb3, 0x89, 0xf8, 0x3a, 0x2d, 0x2e, 0x60, 0x18, 0xa9, + 0xca, 0x71, 0xc6, 0xe5, 0x85, 0xba, 0x9c, 0x88, 0x7b, 0xf7, 0xf4, 0x4a, + 0x8a, 0x44, 0x56, 0x59, 0x36, 0x4c, 0x9a, 0x16, 0x33, 0x31, 0x9f, 0xfa, + 0x1f, 0xf1, 0xb6, 0x9e, 0x88, 0x7f, 0xbb, 0x3f, 0x55, 0x06, 0x2d, 0x61, + 0x11, 0xb1, 0xe1, 0x69, 0x34, 0x86, 0x09, 0x9e, 0xa4, 0x8b, 0xcb, 0xf6, + 0xca, 0x38, 0xc0, 0xa4, 0x58, 0x01, 0x08, 0x8f, 0x00, 0xdc, 0xf8, 0x8e, + 0x15, 0x96, 0xbd, 0x3b, 0x2d, 0x78, 0x09, 0xa3, 0xdc, 0xd5, 0x15, 0xc0, + 0x88, 0x62, 0x0f, 0xa6, 0x3e, 0x80, 0x78, 0xb4, 0xed, 0x27, 0x25, 0x20, + 0x86, 0xbb, 0x26, 0x08, 0x0b, 0xc6, 0x23, 0x5c, 0x44, 0x0f, 0x82, 0x05, + 0x8e, 0x6c, 0x8a, 0x1f, 0x16, 0x45, 0x7a, 0x33, 0x5e, 0x15, 0xf9, 0x3a, + 0x94, 0xfc, 0x6a, 0xf0, 0x8a, 0x03, 0x6d, 0x41, 0xa7, 0xa6, 0x6d, 0x11, + 0x36, 0x4d, 0x65, 0xfa, 0x41, 0x5c, 0xa4, 0x30, 0xf6, 0x18, 0x98, 0xa1, + 0x78, 0x78, 0x01, 0x08, 0x1e, 0x0b, 0xb9, 0xc8, 0xaa, 0x25, 0xac, 0x38, + 0x78, 0x91, 0x2f, 0xf9, 0xf8, 0xf7, 0x32, 0x88, 0x76, 0xbb, 0xdb, 0x1b, + 0xfe, 0x5e, 0x2e, 0xf3, 0x75, 0xe0, 0x4d, 0x51, 0x6a, 0x6a, 0x36, 0xb3, + 0x70, 0xe0, 0x5c, 0x57, 0x97, 0x1b, 0xf9, 0xa0, 0xf8, 0x7a, 0x93, 0xa5, + 0x8a, 0x83, 0x10, 0x48, 0xf8, 0x58, 0xa5, 0x17, 0x2f, 0xd2, 0x35, 0xfc, + 0xcd, 0x9f, 0xe5, 0x57, 0xbc, 0x78, 0x94, 0x96, 0x3c, 0x8c, 0xa6, 0xc0, + 0x45, 0x65, 0x0e, 0x02, 0xe1, 0x2a, 0x2d, 0x64, 0xf8, 0x4e, 0xb3, 0x73, + 0x3c, 0x98, 0x1d, 0x6d, 0x55, 0x3d, 0x1f, 0x2c, 0x45, 0x01, 0xe8, 0x12, + 0x1f, 0x80, 0x8b, 0x2f, 0xf3, 0x2a, 0x5b, 0x0e, 0x72, 0x99, 0xdd, 0x0c, + 0xce, 0xf9, 0x20, 0x5d, 0x2e, 0xf9, 0x72, 0xa0, 0xf2, 0xc1, 0xd7, 0x76, + 0x8e, 0x07, 0x03, 0x18, 0xbf, 0x1c, 0x03, 0x2e, 0xf8, 0xe0, 0x52, 0xa9, + 0x4d, 0x19, 0x9f, 0x9c, 0x5c, 0x08, 0x75, 0x59, 0x9d, 0x8f, 0x17, 0xf9, + 0xfa, 0x24, 0xa5, 0x81, 0x7f, 0x2f, 0xcd, 0x8f, 0x7f, 0xc5, 0xf1, 0xdf, + 0x45, 0xf1, 0x19, 0x41, 0x06, 0x30, 0x28, 0x5c, 0xee, 0xe2, 0x52, 0x64, + 0xcb, 0x27, 0x19, 0x47, 0x2a, 0x7c, 0x94, 0x57, 0x12, 0xd8, 0xa9, 0x1f, + 0xbc, 0xf6, 0xac, 0x83, 0x2b, 0x98, 0xc7, 0x82, 0xcc, 0xe5, 0x02, 0x7b, + 0xf2, 0x02, 0xe0, 0xa3, 0xf2, 0x54, 0x0e, 0x2a, 0x09, 0xe2, 0x0e, 0x16, + 0x02, 0x45, 0xc0, 0x58, 0xe7, 0xbc, 0x18, 0x80, 0x88, 0x2b, 0xf2, 0x5c, + 0x0d, 0xb8, 0x9e, 0x0c, 0xe0, 0x7e, 0x9e, 0xbe, 0x87, 0x55, 0x56, 0x05, + 0xf7, 0x07, 0xbf, 0x4c, 0xcb, 0x41, 0x3a, 0x28, 0x85, 0xbc, 0xc8, 0x78, + 0xab, 0xc3, 0x78, 0xf0, 0xce, 0xdb, 0x8b, 0xd4, 0x23, 0x8d, 0x0e, 0x7e, + 0xc7, 0x05, 0x87, 0xb1, 0x16, 0x3c, 0x3c, 0x39, 0x0e, 0xdf, 0x5c, 0x45, + 0x27, 0x17, 0x2c, 0xa4, 0xcd, 0x49, 0x1e, 0x28, 0x68, 0xf8, 0xf3, 0x66, + 0x63, 0x1b, 0xfa, 0xe4, 0x93, 0xe9, 0xfd, 0x03, 0xa1, 0x34, 0x3c, 0x4b, + 0x60, 0x67, 0x91, 0xb8, 0xf4, 0xf0, 0x93, 0x8c, 0x2b, 0x90, 0x5e, 0x1c, + 0x24, 0x4c, 0x51, 0x2a, 0x8b, 0x2a, 0x44, 0xdb, 0x04, 0x79, 0x7f, 0x22, + 0x27, 0x51, 0x86, 0xdc, 0x08, 0x32, 0x23, 0x91, 0x63, 0x58, 0xb6, 0x6d, + 0xf3, 0x4a, 0x9c, 0x67, 0xb0, 0x0c, 0x37, 0xc7, 0xc2, 0x93, 0x86, 0x13, + 0x03, 0xbb, 0x27, 0xba, 0xb5, 0x14, 0x21, 0x89, 0x5e, 0x38, 0x31, 0x31, + 0x59, 0x64, 0x3c, 0x2d, 0x5e, 0x8b, 0x35, 0xcf, 0x2b, 0x05, 0x02, 0x07, + 0x66, 0x29, 0xb9, 0xb2, 0xdf, 0xbe, 0xe8, 0x97, 0x24, 0x61, 0x18, 0x37, + 0x42, 0x4b, 0xb0, 0x02, 0xd8, 0x0a, 0x26, 0xac, 0x6b, 0xdc, 0x51, 0x35, + 0xa8, 0x12, 0xa3, 0x05, 0x92, 0x07, 0xb8, 0xce, 0xbe, 0x6d, 0x1e, 0x3c, + 0x29, 0x8a, 0xbc, 0x88, 0x07, 0xc1, 0xd1, 0x56, 0xd6, 0xc1, 0x1b, 0xf9, + 0x46, 0x3e, 0xb9, 0xde, 0x14, 0xbc, 0x2c, 0x61, 0x06, 0x2a, 0x55, 0x58, + 0x6a, 0xd6, 0x17, 0xbf, 0x03, 0xce, 0x65, 0x43, 0x60, 0xbc, 0x48, 0x5d, + 0x16, 0xf9, 0x95, 0x95, 0xb3, 0x29, 0x34, 0xbf, 0x00, 0xd9, 0xc8, 0xb6, + 0x3c, 0x8b, 0x39, 0xe3, 0x6e, 0x04, 0x05, 0xf0, 0xc8, 0xda, 0xa9, 0xa5, + 0x25, 0x00, 0x84, 0x8d, 0x94, 0xdf, 0x48, 0xd6, 0xd1, 0x56, 0x15, 0x37, + 0x5b, 0x0d, 0xb4, 0x48, 0x60, 0xa3, 0x2c, 0xb2, 0x04, 0xa8, 0xad, 0x52, + 0xa5, 0x72, 0x81, 0xfa, 0x12, 0x44, 0xc9, 0x5a, 0x94, 0x7c, 0x2a, 0xc6, + 0x8b, 0x54, 0xa1, 0x38, 0xe2, 0xc9, 0x83, 0x2a, 0x84, 0xf5, 0xa1, 0x3c, + 0x89, 0x62, 0x51, 0xeb, 0x62, 0x20, 0x13, 0x5b, 0x5a, 0xbb, 0xad, 0x58, + 0x69, 0x54, 0x30, 0x91, 0x6c, 0xeb, 0x86, 0x8e, 0x96, 0x61, 0x18, 0x02, + 0x72, 0x7a, 0x74, 0xb3, 0x9a, 0x02, 0xa7, 0xa4, 0x19, 0xec, 0x73, 0x14, + 0xa3, 0xf4, 0x79, 0x6a, 0xb1, 0x3e, 0x0b, 0x8e, 0x96, 0xa9, 0x4a, 0x03, + 0x36, 0x1e, 0x8f, 0x7d, 0xfd, 0x26, 0xa2, 0x39, 0x7b, 0x87, 0x1b, 0xfa, + 0xf6, 0xad, 0xe6, 0xbe, 0xb7, 0xb0, 0xbc, 0x2a, 0x53, 0x13, 0x62, 0x90, + 0x90, 0x3a, 0x45, 0x83, 0x6d, 0xb7, 0x7a, 0x90, 0x0c, 0x10, 0xc7, 0x83, + 0x7a, 0x32, 0x30, 0x30, 0x75, 0x1a, 0xbc, 0x8b, 0x00, 0xaf, 0x6e, 0x2e, + 0xd2, 0xd2, 0x38, 0x1b, 0x68, 0xac, 0x3e, 0x6c, 0x9b, 0x9d, 0x5f, 0x27, + 0x27, 0xbf, 0x5d, 0x1f, 0x87, 0xb9, 0xdc, 0x9d, 0x0b, 0xb9, 0xdc, 0xe1, + 0xe4, 0x3b, 0x05, 0x84, 0xba, 0xbb, 0x54, 0xeb, 0x6c, 0x07, 0xe6, 0x09, + 0xcf, 0x76, 0x62, 0xb5, 0x03, 0x72, 0xde, 0x81, 0xd0, 0xb9, 0xda, 0x2d, + 0xb2, 0x3c, 0x7d, 0xbf, 0x53, 0x45, 0x2a, 0x4b, 0x81, 0xcb, 0xdc, 0x15, + 0x7c, 0xb5, 0x2b, 0x61, 0xe0, 0x74, 0x19, 0xbd, 0x39, 0x3f, 0x71, 0x1b, + 0xb8, 0x41, 0xf4, 0xea, 0x39, 0x54, 0x02, 0x96, 0xc3, 0x58, 0x82, 0xb4, + 0x6b, 0xb6, 0x6b, 0x3d, 0x56, 0xbc, 0x54, 0xa0, 0xae, 0x1c, 0xde, 0x2f, + 0xad, 0x21, 0x82, 0x4c, 0x25, 0x12, 0x4f, 0xa8, 0x03, 0xd9, 0x2a, 0x30, + 0x5b, 0xce, 0x2b, 0xe8, 0x13, 0x59, 0x6d, 0xbe, 0x89, 0xc6, 0xeb, 0x74, + 0x13, 0x7e, 0x88, 0x80, 0x23, 0x9c, 0x8a, 0x87, 0x8d, 0x0e, 0x34, 0x34, + 0xb0, 0x43, 0x28, 0x65, 0x61, 0x93, 0xa2, 0x68, 0x76, 0x3a, 0x47, 0x9b, + 0xa2, 0xd0, 0x63, 0xcb, 0x04, 0xb7, 0xb8, 0x18, 0x3b, 0x7c, 0x30, 0x35, + 0xd6, 0x68, 0x9f, 0xa0, 0xb9, 0x00, 0x40, 0x03, 0x7d, 0x58, 0x0b, 0x04, + 0xa8, 0xb9, 0x20, 0x75, 0xa8, 0xe7, 0x0b, 0xc3, 0x19, 0x80, 0x39, 0x07, + 0x5a, 0xf8, 0x10, 0x6e, 0x71, 0x49, 0x80, 0x58, 0x6d, 0x10, 0x29, 0x34, + 0x0e, 0x9c, 0xaa, 0x9a, 0xb6, 0x80, 0xd2, 0x90, 0x00, 0x48, 0x12, 0xe8, + 0xcf, 0x57, 0x8e, 0x08, 0x90, 0x4a, 0x66, 0x01, 0x62, 0x3f, 0x60, 0x01, + 0x21, 0x1c, 0xfe, 0x22, 0xae, 0xe1, 0x0f, 0xd1, 0xe9, 0x31, 0x50, 0x57, + 0x30, 0x9f, 0x34, 0x12, 0xad, 0x04, 0x53, 0x31, 0x44, 0xb9, 0x45, 0xec, + 0xaa, 0xb1, 0x75, 0x4c, 0x92, 0x09, 0x34, 0xd4, 0x92, 0x5f, 0xbf, 0x84, + 0xe5, 0xe9, 0x85, 0x4f, 0xbd, 0x01, 0x62, 0x5d, 0x06, 0xd8, 0xea, 0xb4, + 0x95, 0x3d, 0x6d, 0x75, 0x99, 0x9d, 0xd2, 0xb5, 0x15, 0xd1, 0xb1, 0xfb, + 0x28, 0x48, 0x35, 0x43, 0x99, 0xdb, 0xc3, 0x1e, 0x9c, 0x18, 0x1a, 0x90, + 0x48, 0x03, 0x11, 0x30, 0x95, 0x04, 0x34, 0x22, 0xf3, 0xad, 0x71, 0xe3, + 0xec, 0xc7, 0x49, 0x1c, 0xce, 0xd2, 0xe3, 0x3f, 0x1e, 0x1e, 0xff, 0x7a, + 0x7a, 0xfc, 0xe7, 0x37, 0xc7, 0xf1, 0xfc, 0x5e, 0x74, 0x12, 0xb1, 0xd2, + 0xd5, 0xbf, 0x19, 0xcf, 0x7e, 0x1b, 0xbf, 0x99, 0xcf, 0xef, 0x85, 0xd3, + 0x64, 0xf6, 0x1b, 0xfc, 0xf8, 0xea, 0x08, 0xa4, 0x37, 0xe8, 0xe9, 0x99, + 0x45, 0xcc, 0x16, 0x21, 0x8e, 0xc5, 0x54, 0xcc, 0xce, 0xe6, 0x31, 0x49, + 0x3b, 0x0d, 0x42, 0x31, 0x2d, 0x9a, 0x12, 0xc0, 0xae, 0x58, 0x09, 0x5e, + 0x94, 0x71, 0xa9, 0x37, 0x93, 0x76, 0xc6, 0xea, 0x84, 0x60, 0x0c, 0x18, + 0x0f, 0x90, 0x5f, 0x5a, 0x9c, 0xe2, 0x56, 0x77, 0xd3, 0x52, 0x2c, 0x20, + 0x6d, 0xc0, 0x64, 0xff, 0x05, 0x79, 0x36, 0xf8, 0x4b, 0x10, 0x4d, 0xbd, + 0x81, 0xfe, 0x02, 0x03, 0x5d, 0x1f, 0x43, 0xef, 0x00, 0x2c, 0xdf, 0x56, + 0xc3, 0xb8, 0xdd, 0x30, 0xa6, 0x86, 0xb8, 0xf7, 0xd4, 0xd4, 0x4d, 0x75, + 0x8e, 0xcc, 0x90, 0x7c, 0x93, 0x83, 0x14, 0x4e, 0xa5, 0x3f, 0xe9, 0x26, + 0x13, 0x2a, 0x0c, 0x06, 0x41, 0xc3, 0x07, 0xca, 0x72, 0xf2, 0x45, 0x12, + 0x08, 0x19, 0xb0, 0xeb, 0x24, 0x00, 0xe9, 0x1f, 0xb0, 0xb7, 0x09, 0x6c, + 0x28, 0x88, 0xc3, 0x2c, 0x83, 0x63, 0x87, 0x63, 0xcb, 0x2b, 0x2b, 0xdd, + 0x00, 0xfb, 0xc3, 0x33, 0xd2, 0x6a, 0x45, 0x64, 0xf7, 0x39, 0x24, 0xd3, + 0x9b, 0x8f, 0xdf, 0xbe, 0xbd, 0x7e, 0xeb, 0x58, 0x7c, 0x34, 0xea, 0x96, + 0x58, 0x62, 0xbe, 0xb0, 0x7a, 0x50, 0x43, 0x50, 0x26, 0xc8, 0xc3, 0x82, + 0x05, 0xae, 0x65, 0x10, 0xb1, 0xdc, 0x96, 0x12, 0x4d, 0x5b, 0x5e, 0xcc, + 0x47, 0xa3, 0x7c, 0xdc, 0xec, 0x87, 0x67, 0x5a, 0xf9, 0x7d, 0xad, 0x2c, + 0xf0, 0x5a, 0x62, 0x5f, 0xe1, 0x35, 0xc7, 0xb5, 0x46, 0xa3, 0xd1, 0xd0, + 0x2f, 0x13, 0xd8, 0xd5, 0x5b, 0x93, 0x86, 0x0e, 0xc5, 0x44, 0xbb, 0xcd, + 0x68, 0xb4, 0x37, 0x12, 0x08, 0x80, 0xc2, 0xe3, 0x5c, 0x6b, 0x1c, 0x7c, + 0x2d, 0x1a, 0xaa, 0xd7, 0xed, 0x50, 0x8b, 0x30, 0xff, 0xfc, 0x87, 0x28, + 0xb5, 0xb4, 0x5e, 0x24, 0xdb, 0x25, 0x1c, 0x84, 0xb0, 0x2a, 0x7e, 0x09, + 0x0a, 0x26, 0xb0, 0x5f, 0x01, 0x3b, 0xfb, 0xd3, 0x29, 0x60, 0xa4, 0x10, + 0x17, 0xc2, 0x54, 0xe9, 0xdf, 0xc8, 0xea, 0x1c, 0xcd, 0x24, 0xc0, 0x17, + 0xd9, 0x12, 0xf1, 0x36, 0xdf, 0xa4, 0x0b, 0xa1, 0x6e, 0xe2, 0x53, 0x56, + 0x82, 0x7a, 0xe1, 0xba, 0x35, 0xfd, 0x0c, 0xd8, 0x9f, 0xff, 0x14, 0xd5, + 0xac, 0xe4, 0x30, 0xdb, 0xd2, 0x35, 0x3c, 0x33, 0x0d, 0xcf, 0x4e, 0x4f, + 0xeb, 0x7a, 0xf2, 0xde, 0x00, 0x45, 0x6a, 0x0b, 0x14, 0x19, 0x6e, 0x38, + 0xbb, 0x00, 0x76, 0xc5, 0xad, 0x40, 0x31, 0x5b, 0xf3, 0x0c, 0x8f, 0x83, + 0x20, 0x4d, 0xd6, 0x9c, 0x18, 0x61, 0x16, 0x68, 0x08, 0x98, 0xfe, 0x7b, + 0x4c, 0x64, 0xdb, 0x7c, 0x71, 0x10, 0x4f, 0x73, 0x87, 0x2d, 0xae, 0xf5, + 0x0b, 0xe0, 0x61, 0xda, 0xc5, 0x02, 0xd8, 0x16, 0x5b, 0x4b, 0x0f, 0xe7, + 0xe1, 0xc3, 0x10, 0x04, 0x0c, 0x18, 0xfe, 0x4b, 0x2d, 0x9b, 0xf5, 0x14, + 0x24, 0x9a, 0xcd, 0x00, 0xbb, 0xdd, 0xd6, 0x63, 0xb7, 0x20, 0xa8, 0x23, + 0x5f, 0x30, 0x23, 0xfe, 0x91, 0x84, 0xfa, 0x07, 0x32, 0x30, 0x7e, 0xea, + 0x70, 0xe9, 0xa1, 0xe1, 0x70, 0x91, 0x9f, 0x38, 0xd8, 0xe4, 0x15, 0xac, + 0xbb, 0x64, 0x39, 0x4b, 0x61, 0xe5, 0x0d, 0xb2, 0x2f, 0xd0, 0xc0, 0x22, + 0x54, 0x97, 0x84, 0xec, 0x18, 0x4f, 0xe4, 0x0d, 0x0f, 0x3e, 0xf9, 0x92, + 0x3c, 0x78, 0xfd, 0x7f, 0xcf, 0x83, 0x9a, 0x97, 0x86, 0x7b, 0xcc, 0xf4, + 0x65, 0x79, 0xf0, 0xc1, 0x47, 0xf1, 0xa0, 0x4f, 0x7d, 0x72, 0xda, 0xc3, + 0x7d, 0x7d, 0x1c, 0x79, 0x72, 0x1f, 0x30, 0xe4, 0x78, 0xb6, 0xfc, 0x34, + 0x0e, 0xf5, 0x19, 0x6f, 0x8f, 0x2b, 0x0f, 0xb1, 0xaf, 0xe5, 0xd0, 0x16, + 0x7f, 0xe6, 0xec, 0xda, 0x90, 0x4d, 0x71, 0x88, 0x47, 0x41, 0x1f, 0x7c, + 0x80, 0x21, 0xf4, 0xdf, 0x86, 0x47, 0xf5, 0xd7, 0x17, 0xe2, 0x51, 0x3d, + 0xc5, 0x17, 0xe0, 0x51, 0x1f, 0xc6, 0x2f, 0xc0, 0xa3, 0x6e, 0x91, 0x9f, + 0xcf, 0xa3, 0x1e, 0xba, 0xaf, 0x6f, 0xe5, 0xd1, 0x97, 0xd6, 0x1a, 0x05, + 0x5a, 0x27, 0x83, 0x89, 0x37, 0xd4, 0xa7, 0x1a, 0xc2, 0xb6, 0x4c, 0x07, + 0x27, 0x91, 0x99, 0x5f, 0x7f, 0xef, 0x8c, 0xf8, 0x6b, 0x28, 0x5c, 0x43, + 0xf8, 0x34, 0xdb, 0x8f, 0xc6, 0x17, 0x70, 0xcb, 0x8f, 0x68, 0x9a, 0xb7, + 0xaa, 0x1b, 0x9a, 0xc4, 0x16, 0x9a, 0xed, 0x38, 0xf0, 0x8b, 0xb1, 0x80, + 0xc2, 0x19, 0x98, 0x46, 0x60, 0x17, 0xad, 0xcb, 0x13, 0x2d, 0x21, 0x6c, + 0x67, 0x0e, 0xe6, 0x8d, 0xb1, 0x3a, 0x2d, 0xad, 0xea, 0x29, 0x66, 0x81, + 0xca, 0x37, 0x40, 0x1c, 0x50, 0x76, 0xa9, 0x89, 0x64, 0xa5, 0x1c, 0x19, + 0xb3, 0xe0, 0x3c, 0x57, 0x2a, 0x5f, 0xb7, 0x28, 0xa6, 0xbd, 0x8a, 0xfb, + 0xf3, 0x68, 0x3a, 0x13, 0x6c, 0xaf, 0x74, 0x3e, 0xfe, 0x3d, 0x17, 0x92, + 0xac, 0x10, 0x38, 0x4b, 0x35, 0x28, 0x7b, 0xef, 0xa8, 0x0b, 0xb1, 0x1d, + 0x6d, 0x3f, 0x42, 0x88, 0x69, 0x13, 0xe5, 0x60, 0x45, 0x23, 0x38, 0xd2, + 0x04, 0xed, 0xa8, 0x1b, 0x38, 0x93, 0x1a, 0xc6, 0x62, 0x59, 0x53, 0x42, + 0xbd, 0xe0, 0x80, 0xb2, 0x66, 0x8b, 0xfd, 0xb2, 0x97, 0x84, 0x11, 0x56, + 0x25, 0x43, 0xdf, 0x7f, 0x63, 0x06, 0x21, 0xb1, 0xe5, 0x97, 0xeb, 0x1d, + 0x8a, 0xd8, 0x32, 0xa9, 0x76, 0xbb, 0xde, 0x0e, 0x6c, 0xd5, 0xad, 0xb2, + 0x7d, 0xd6, 0xc9, 0x96, 0x48, 0x1d, 0x8e, 0xdb, 0xcb, 0xd1, 0x28, 0xec, + 0xc0, 0x9b, 0x94, 0xda, 0x49, 0x60, 0xbf, 0x61, 0x20, 0xaf, 0x51, 0x03, + 0x6e, 0xf2, 0x8e, 0x86, 0x0b, 0x8f, 0xb6, 0xb6, 0x3d, 0x7d, 0x9f, 0xa0, + 0x6c, 0x89, 0xde, 0x81, 0xd6, 0x07, 0x22, 0x11, 0xf2, 0x02, 0xe6, 0xe8, + 0xed, 0xae, 0x57, 0x0b, 0x73, 0x69, 0x42, 0x00, 0x4b, 0xd6, 0x6f, 0x41, + 0x98, 0xb5, 0x6e, 0xb6, 0x64, 0xb6, 0x9c, 0x36, 0xcb, 0x02, 0xbe, 0x61, + 0xab, 0x69, 0xd0, 0x8c, 0x83, 0x05, 0xde, 0x2e, 0x43, 0x77, 0xb1, 0x0e, + 0xfb, 0x46, 0x7b, 0x6c, 0x68, 0x16, 0xa6, 0xb4, 0xe4, 0x7b, 0x72, 0xc6, + 0xff, 0xfd, 0x5e, 0x50, 0x06, 0x3d, 0xad, 0x5f, 0x8b, 0x35, 0x00, 0x6f, + 0x4f, 0xc8, 0x60, 0xa0, 0x56, 0xe7, 0x62, 0x71, 0x7c, 0xce, 0xff, 0x00, + 0xad, 0x12, 0x9e, 0x8e, 0xff, 0x83, 0x0d, 0x4e, 0xc7, 0xa7, 0xf8, 0xcf, + 0x7d, 0x36, 0x38, 0x8b, 0x02, 0x90, 0xa6, 0xa0, 0xae, 0xd0, 0x7d, 0x01, + 0x9c, 0xc9, 0x80, 0xf1, 0x0f, 0xa2, 0x56, 0x4b, 0xdd, 0x4f, 0xc0, 0xad, + 0xe9, 0xd0, 0x41, 0xee, 0xa5, 0x58, 0x72, 0x98, 0x43, 0xe0, 0x74, 0xe8, + 0x5b, 0x91, 0xd5, 0xe6, 0xc0, 0x94, 0xe9, 0xa1, 0x39, 0xb2, 0x03, 0x15, + 0x66, 0x67, 0x16, 0xb7, 0x6e, 0x89, 0x71, 0xd2, 0x1c, 0x44, 0xf2, 0x81, + 0xfa, 0x0e, 0x5a, 0xb1, 0x15, 0xe8, 0x97, 0x23, 0x60, 0xc7, 0x35, 0x08, + 0xbd, 0xc2, 0x1e, 0x10, 0x1e, 0x3a, 0x27, 0x4f, 0x8f, 0x1f, 0x83, 0x4f, + 0xe5, 0x98, 0xa3, 0x4c, 0x4d, 0x15, 0xff, 0x89, 0xa4, 0x89, 0xf3, 0xef, + 0x80, 0xee, 0xe2, 0x70, 0x3c, 0x71, 0xa7, 0x88, 0x57, 0x6d, 0x56, 0x67, + 0xe9, 0x17, 0x65, 0x76, 0x64, 0x6d, 0x6c, 0xa1, 0x89, 0x38, 0xcd, 0xde, + 0x2e, 0xb2, 0xb4, 0x2c, 0x79, 0x89, 0xa7, 0x3d, 0xe0, 0xf1, 0x86, 0xcd, + 0xf8, 0x98, 0x2a, 0x9e, 0x09, 0x60, 0x93, 0x74, 0xb9, 0x0c, 0xc7, 0xe3, + 0xb1, 0xf4, 0x59, 0xa4, 0xa7, 0x5e, 0x45, 0x0d, 0x51, 0x15, 0x8e, 0xa8, + 0xfc, 0x86, 0x05, 0x5f, 0xe7, 0x1f, 0x38, 0x8d, 0xe5, 0x1f, 0xe0, 0x87, + 0x99, 0x27, 0x26, 0x23, 0x3a, 0x24, 0xee, 0x8f, 0x2e, 0x1c, 0x0d, 0x95, + 0x6d, 0x1a, 0xea, 0x9f, 0x41, 0x7d, 0xfc, 0x0c, 0xae, 0x93, 0xb8, 0xb5, + 0x93, 0xd9, 0xf8, 0x05, 0x6d, 0x8a, 0x93, 0xcd, 0x47, 0xfb, 0x67, 0x94, + 0x47, 0xda, 0xa5, 0xb5, 0x55, 0x63, 0x0d, 0x32, 0x4c, 0x27, 0xca, 0x47, + 0xb9, 0x94, 0xe4, 0x9a, 0x1d, 0x8d, 0xd4, 0xb8, 0x01, 0x9f, 0x2d, 0x39, + 0x68, 0x23, 0x3e, 0xe8, 0x6e, 0x1c, 0x9c, 0xff, 0x27, 0xdd, 0xb2, 0x44, + 0x1f, 0xc4, 0x25, 0xd3, 0x9b, 0x1a, 0xdb, 0x69, 0x44, 0xf8, 0x16, 0x4e, + 0xfc, 0x21, 0xfa, 0x0c, 0xc0, 0x80, 0x92, 0xa2, 0xbc, 0x8c, 0x0b, 0x86, + 0x2e, 0xd1, 0xa7, 0x05, 0x7a, 0x0c, 0x88, 0x68, 0x99, 0x1a, 0x9b, 0xbd, + 0x85, 0x5f, 0x76, 0x1b, 0xd9, 0x1e, 0xb9, 0x34, 0xbd, 0x92, 0x82, 0xff, + 0xa3, 0xe2, 0xa5, 0x7a, 0x28, 0xc5, 0x9a, 0x38, 0x84, 0x4a, 0xcd, 0x84, + 0xda, 0xd5, 0x03, 0xc2, 0xe8, 0xab, 0x17, 0xe4, 0x65, 0x0e, 0x2f, 0xb8, + 0x7a, 0x94, 0xaf, 0x37, 0x15, 0xac, 0xee, 0x15, 0x72, 0x10, 0x20, 0xac, + 0x87, 0xc9, 0x9c, 0x8b, 0x98, 0x8d, 0xbf, 0x3a, 0x41, 0x87, 0x80, 0x3b, + 0xae, 0x97, 0xda, 0x41, 0x30, 0x39, 0x45, 0x47, 0x0e, 0x70, 0xf9, 0x9d, + 0xc3, 0xa7, 0x16, 0xb0, 0xbd, 0xd1, 0xed, 0x58, 0xb8, 0x52, 0x4d, 0x90, + 0x9f, 0xbb, 0x4e, 0x74, 0x51, 0x01, 0x11, 0x33, 0xcf, 0xf5, 0xbb, 0x37, + 0x92, 0x46, 0x38, 0x5a, 0x94, 0x3a, 0x9e, 0xd2, 0xd0, 0xc5, 0x8f, 0xce, + 0xa5, 0x31, 0xd4, 0x1e, 0x37, 0x51, 0xd2, 0x5f, 0x28, 0x47, 0x93, 0xbe, + 0x7c, 0x91, 0xbe, 0x80, 0x9f, 0xae, 0xc3, 0x23, 0xe7, 0xb4, 0x1a, 0x9e, + 0xf5, 0x78, 0xaa, 0xd5, 0x6e, 0x17, 0x42, 0xd5, 0x69, 0xe3, 0x6b, 0x26, + 0xa7, 0x75, 0xe3, 0xb2, 0x8e, 0x7c, 0x4f, 0xeb, 0xef, 0x44, 0x94, 0x24, + 0x43, 0xa2, 0x6d, 0x8e, 0x06, 0xf2, 0xf5, 0x31, 0xc8, 0x4a, 0x38, 0x01, + 0xe0, 0x04, 0x69, 0xf2, 0x38, 0xec, 0x91, 0x53, 0x62, 0xca, 0x6f, 0x93, + 0x53, 0x02, 0x4c, 0x92, 0x08, 0x8c, 0x83, 0xfd, 0xb3, 0x39, 0x8e, 0x59, + 0xc0, 0x39, 0x08, 0x64, 0x19, 0x0b, 0xc4, 0xaa, 0x39, 0x05, 0x15, 0xb0, + 0xce, 0x5b, 0x87, 0xf4, 0x3d, 0x85, 0xd6, 0x64, 0x9b, 0xcd, 0x09, 0xc6, + 0x32, 0xb9, 0xb5, 0xa7, 0x1c, 0x0b, 0xc5, 0xd7, 0x25, 0xcc, 0x3e, 0xf9, + 0x31, 0x2c, 0x01, 0xa1, 0xe5, 0x83, 0xe4, 0x14, 0xe8, 0xa6, 0xf4, 0xbd, + 0x9b, 0x1a, 0xdd, 0x65, 0xa4, 0xbd, 0xc3, 0x11, 0x23, 0xa7, 0xd4, 0xbd, + 0x33, 0x20, 0x0d, 0x8b, 0xde, 0xb2, 0xa6, 0x55, 0xa4, 0x80, 0x26, 0x10, + 0x7f, 0x6a, 0x92, 0xb9, 0x38, 0x5b, 0x28, 0xc0, 0xd0, 0x32, 0xc4, 0x5e, + 0xb5, 0x17, 0x6d, 0xf0, 0x8a, 0x35, 0x79, 0x52, 0x4e, 0x65, 0xb8, 0x05, + 0xd1, 0x17, 0x61, 0x28, 0x31, 0x47, 0x83, 0x0e, 0x00, 0x9b, 0x27, 0x8a, + 0x19, 0xd3, 0x0e, 0x80, 0xca, 0xad, 0x99, 0x37, 0x4f, 0x04, 0xb2, 0xf5, + 0x22, 0xcf, 0x32, 0xbe, 0xd0, 0xa2, 0x9c, 0x2a, 0x5d, 0xc1, 0x3c, 0x29, + 0x1a, 0xe0, 0xf2, 0x3a, 0xc4, 0xa3, 0x6f, 0xce, 0x32, 0x06, 0xd0, 0xa3, + 0xe9, 0x74, 0x07, 0xea, 0xc9, 0xd3, 0x19, 0xb5, 0x3c, 0xb6, 0xb0, 0xf2, + 0x96, 0x4d, 0x8f, 0x3b, 0x63, 0x86, 0x2f, 0xa6, 0x1f, 0xbd, 0x37, 0xda, + 0xb8, 0x07, 0xab, 0x3a, 0x96, 0x1a, 0x61, 0x39, 0xab, 0xd0, 0x5e, 0x6b, + 0x87, 0xe9, 0xd1, 0x2e, 0xb7, 0xb6, 0x33, 0x6e, 0xff, 0x87, 0x5c, 0x2c, + 0x07, 0xa7, 0x34, 0x3b, 0x32, 0x0d, 0x60, 0xf6, 0x2d, 0x80, 0xe3, 0x35, + 0x68, 0x95, 0x93, 0x69, 0x6e, 0x0d, 0x6f, 0x1b, 0xfe, 0x69, 0x82, 0x3d, + 0x38, 0xb8, 0x3c, 0xd4, 0x5c, 0x8e, 0x37, 0x69, 0x01, 0x3c, 0x60, 0x42, + 0x24, 0x80, 0xeb, 0x12, 0x94, 0xfe, 0x37, 0x1c, 0x9a, 0x62, 0xc8, 0x96, + 0x47, 0x13, 0x99, 0x0c, 0xc3, 0x61, 0x5f, 0x9c, 0x68, 0xb7, 0x6b, 0xa0, + 0xec, 0xab, 0x6e, 0x01, 0x3e, 0x1a, 0xf5, 0x46, 0x9a, 0xea, 0x70, 0xd1, + 0x53, 0xcc, 0x96, 0xd1, 0x64, 0x35, 0x0d, 0x8d, 0x78, 0x5f, 0xf9, 0x03, + 0xb1, 0xe6, 0x2b, 0xa9, 0x80, 0x4a, 0xaa, 0xcd, 0x12, 0x76, 0xc0, 0xf4, + 0x2e, 0xc3, 0x95, 0x46, 0x76, 0xd3, 0x06, 0x0f, 0xe3, 0x61, 0x17, 0xd5, + 0x1a, 0x3d, 0xcb, 0x7c, 0x51, 0xe9, 0x05, 0xaf, 0x31, 0xc9, 0x01, 0x63, + 0xac, 0x61, 0x13, 0x64, 0xc4, 0x30, 0xb6, 0x73, 0x33, 0xdf, 0x8a, 0x20, + 0xd5, 0x03, 0x7f, 0xd4, 0x5b, 0x5a, 0x03, 0x61, 0x80, 0xa1, 0x75, 0x65, + 0xa1, 0xc4, 0xf3, 0x5e, 0xf3, 0x83, 0x83, 0x41, 0xd4, 0x59, 0x1b, 0x08, + 0x47, 0x25, 0xd2, 0x4c, 0xfc, 0x71, 0xeb, 0xfa, 0x80, 0xf5, 0x56, 0x6c, + 0xd1, 0xda, 0xdd, 0x25, 0x29, 0xb3, 0xd6, 0x9a, 0x75, 0x3e, 0x03, 0xec, + 0x23, 0xbf, 0x7d, 0x1f, 0xf9, 0xdd, 0xfb, 0xd8, 0xd7, 0xc4, 0x91, 0x9a, + 0x3e, 0x1e, 0x4a, 0xf2, 0xa8, 0xf7, 0xb4, 0x7b, 0x12, 0x5a, 0xdf, 0x1f, + 0xb7, 0xb6, 0x43, 0xe4, 0xa3, 0x81, 0x62, 0x92, 0x00, 0xa6, 0xf0, 0x60, + 0x12, 0x1d, 0x00, 0x04, 0x52, 0x0d, 0xf3, 0xa5, 0xff, 0x63, 0x27, 0xfd, + 0x4f, 0x58, 0x38, 0xfb, 0x8d, 0xbd, 0xa9, 0xd1, 0x17, 0x1f, 0x85, 0xd3, + 0xd8, 0xff, 0x8c, 0xa6, 0x47, 0x27, 0x30, 0xfc, 0x2b, 0x45, 0x1a, 0x9c, + 0x47, 0xee, 0x0c, 0xfb, 0xa6, 0x7c, 0xf3, 0x6a, 0xfe, 0xd5, 0x34, 0x7a, + 0x53, 0xde, 0x83, 0x3e, 0x42, 0xee, 0xf2, 0x15, 0xfd, 0x36, 0x15, 0x91, + 0x3e, 0xdb, 0x0e, 0xa5, 0x1f, 0x60, 0xc5, 0x40, 0xdc, 0x44, 0x68, 0x51, + 0x9a, 0xc8, 0xd9, 0xfd, 0xb9, 0x39, 0x8e, 0x4c, 0xb4, 0x58, 0x91, 0x70, + 0xfe, 0x35, 0x25, 0x4e, 0x77, 0xff, 0xf6, 0x26, 0xdc, 0xbd, 0x89, 0x8e, + 0x4e, 0x2e, 0x50, 0xc9, 0xb2, 0x32, 0x29, 0x0c, 0x08, 0xca, 0x09, 0xd5, + 0x69, 0xa8, 0xc7, 0x84, 0x3a, 0xdb, 0x4d, 0x91, 0xba, 0x37, 0x87, 0x1d, + 0xe3, 0x6e, 0x4a, 0x4a, 0x37, 0x3e, 0x2b, 0x61, 0x76, 0x4c, 0x2a, 0xf1, + 0x64, 0x61, 0x52, 0x3a, 0x88, 0xd0, 0x23, 0x65, 0xc6, 0x64, 0xde, 0xc1, + 0xf8, 0xb5, 0x91, 0x84, 0x05, 0x49, 0xc9, 0x85, 0x26, 0x92, 0xea, 0x76, + 0xd5, 0x01, 0x6d, 0x09, 0x15, 0x01, 0x89, 0xc4, 0x80, 0x22, 0x47, 0x28, + 0x5e, 0x2e, 0x80, 0x5c, 0x2f, 0x24, 0x70, 0xc4, 0x53, 0x60, 0xab, 0x92, + 0x2f, 0x9f, 0xe6, 0xc5, 0xdf, 0xb0, 0xc5, 0x37, 0x00, 0x2c, 0x20, 0x7b, + 0x34, 0x6a, 0xd8, 0x2d, 0xa5, 0x54, 0x81, 0x86, 0x99, 0xca, 0x57, 0x60, + 0x32, 0x10, 0xf3, 0x35, 0xfe, 0x8b, 0x96, 0xf8, 0xab, 0x46, 0x23, 0xb3, + 0x5f, 0x45, 0xe4, 0xa2, 0x2e, 0x27, 0x40, 0x06, 0x61, 0x95, 0x20, 0x12, + 0x83, 0x22, 0x5d, 0x8a, 0x9c, 0x7c, 0x0b, 0x3a, 0x62, 0xd4, 0x74, 0x55, + 0x5e, 0x7c, 0x4e, 0x8b, 0xf0, 0xd1, 0x48, 0x8b, 0x79, 0xa8, 0xcc, 0xa6, + 0x26, 0x16, 0x99, 0x54, 0xb1, 0x2e, 0x1c, 0x42, 0x21, 0x8c, 0x8a, 0x09, + 0x06, 0x7c, 0xf1, 0x9e, 0x2f, 0x93, 0x32, 0x34, 0x4d, 0x40, 0x5e, 0x83, + 0xe6, 0x41, 0x9f, 0x17, 0xae, 0x9c, 0xaa, 0xcf, 0xf3, 0x6b, 0x6f, 0xca, + 0xe0, 0x5c, 0x47, 0x44, 0x9c, 0x39, 0x00, 0x87, 0xf1, 0x99, 0x8e, 0xf6, + 0x10, 0x34, 0x9e, 0x33, 0xa3, 0x8a, 0x76, 0x3b, 0x37, 0xe1, 0xb4, 0x35, + 0x77, 0xdb, 0xd4, 0xa9, 0xa2, 0xa9, 0x03, 0xa6, 0x72, 0xde, 0x36, 0x4a, + 0xea, 0x68, 0x9c, 0x68, 0xb1, 0x6b, 0x33, 0x1c, 0x56, 0xf8, 0xa9, 0x97, + 0x65, 0xb0, 0x56, 0x79, 0x90, 0xbf, 0x7a, 0xf2, 0xec, 0xc9, 0xa3, 0xd7, + 0x06, 0x6e, 0x9d, 0xe7, 0x11, 0x0d, 0xdb, 0x72, 0xc2, 0x46, 0xc5, 0x66, + 0x73, 0x1b, 0x6f, 0x54, 0x91, 0x8b, 0x49, 0xdd, 0x23, 0x33, 0xb3, 0x15, + 0x02, 0xcd, 0x37, 0xd8, 0xb9, 0xf4, 0x72, 0x6c, 0x38, 0x31, 0x77, 0xc9, + 0x33, 0x32, 0xd8, 0x41, 0x0c, 0x74, 0x3d, 0x7f, 0xbb, 0x1d, 0x9c, 0x12, + 0x41, 0x34, 0xe8, 0x38, 0x9d, 0x62, 0x06, 0x44, 0x24, 0x23, 0x0b, 0x3c, + 0xec, 0xbb, 0x25, 0x86, 0x66, 0x9b, 0xea, 0xda, 0x6d, 0x01, 0x9e, 0x3f, + 0x34, 0xf1, 0xc1, 0x67, 0x17, 0x6b, 0x76, 0x15, 0x1c, 0x96, 0x79, 0xe8, + 0xbc, 0x06, 0xc3, 0x82, 0x61, 0xfa, 0xd0, 0xd2, 0x87, 0x1d, 0x92, 0x09, + 0xad, 0x03, 0x70, 0xe1, 0x30, 0x90, 0x73, 0x35, 0x44, 0x6e, 0xf2, 0x6e, + 0x3e, 0x5d, 0xd5, 0xa4, 0x12, 0x91, 0xa5, 0x54, 0x45, 0x2e, 0x12, 0x8a, + 0x0e, 0xe2, 0x6a, 0xc6, 0xe7, 0xc7, 0x15, 0xa6, 0x3d, 0x75, 0x70, 0x84, + 0x15, 0xd3, 0x73, 0x14, 0x43, 0x7e, 0xb1, 0xea, 0x1c, 0xdf, 0x68, 0x8b, + 0x6f, 0x6d, 0x65, 0xc4, 0x28, 0x36, 0xac, 0x0d, 0x9c, 0x1f, 0x81, 0x00, + 0x90, 0x83, 0x15, 0xcc, 0x0e, 0x04, 0xf3, 0x51, 0xc8, 0x90, 0x3d, 0xc8, + 0x90, 0xc9, 0xc2, 0xf3, 0x37, 0x2d, 0x80, 0x9a, 0xb2, 0x20, 0x9a, 0xa6, + 0x94, 0x71, 0xc0, 0x7c, 0xea, 0x67, 0xc3, 0xb3, 0x16, 0x03, 0x4c, 0x2d, + 0xd0, 0x6e, 0x4a, 0xe8, 0x33, 0xf4, 0xe3, 0xcf, 0xc6, 0x9c, 0x0d, 0x96, + 0xa2, 0xc4, 0x04, 0x37, 0x8c, 0x41, 0x1b, 0x2a, 0x47, 0xcf, 0x21, 0x1c, + 0x3b, 0x44, 0x61, 0x7e, 0xa6, 0x4b, 0x4c, 0x37, 0x82, 0x9f, 0x70, 0x5c, + 0x5c, 0x72, 0x74, 0x88, 0xe7, 0x1b, 0xfa, 0x63, 0x29, 0x10, 0x7e, 0xa6, + 0x95, 0xca, 0x57, 0x28, 0x98, 0xe0, 0x37, 0xc9, 0xeb, 0x05, 0xb4, 0xc1, + 0xb0, 0x76, 0x95, 0x29, 0xb1, 0x41, 0xdf, 0x77, 0x20, 0x73, 0x20, 0x33, + 0x81, 0xc6, 0x04, 0xb6, 0xcf, 0xb2, 0xfc, 0x6a, 0x05, 0x0b, 0x28, 0x17, + 0x05, 0xa7, 0xc1, 0xa8, 0x64, 0x93, 0xde, 0xa0, 0xd0, 0x32, 0xa7, 0x1e, + 0x28, 0x45, 0x0f, 0x4a, 0xbb, 0x23, 0x4c, 0x04, 0x32, 0x1b, 0xc1, 0x41, + 0x4b, 0xa2, 0xc8, 0x33, 0x9c, 0x32, 0xcb, 0xc9, 0xe1, 0xb9, 0xae, 0x34, + 0x34, 0xd8, 0xa0, 0x14, 0x12, 0xf4, 0x21, 0x76, 0x59, 0xf2, 0x55, 0x0a, + 0x60, 0x20, 0x64, 0x25, 0x30, 0x1a, 0xad, 0xe9, 0x03, 0x2f, 0x4a, 0x0d, + 0x78, 0x79, 0x23, 0x17, 0xba, 0x11, 0xf9, 0x46, 0x65, 0xae, 0x33, 0x33, + 0x5b, 0xde, 0x51, 0x60, 0x22, 0x19, 0x4d, 0x9f, 0x51, 0xca, 0x08, 0xec, + 0xa7, 0xfe, 0x21, 0x3d, 0xf5, 0xf8, 0xcc, 0x3a, 0x8d, 0x39, 0xe6, 0xb4, + 0x39, 0xa4, 0xab, 0x68, 0x98, 0x90, 0x43, 0xa4, 0xb5, 0xfb, 0xaa, 0xd5, + 0xf7, 0x85, 0xef, 0x52, 0xa1, 0xd4, 0x13, 0x4d, 0x5b, 0x79, 0xb2, 0xdd, + 0x60, 0xda, 0xcc, 0x07, 0x1e, 0xfb, 0x91, 0x12, 0x53, 0x16, 0x44, 0x35, + 0xa9, 0xc1, 0x8c, 0x55, 0xdd, 0xa8, 0x8c, 0xa1, 0x13, 0x3a, 0xa6, 0x22, + 0xad, 0x68, 0x8d, 0x66, 0x6b, 0xd3, 0x2b, 0x40, 0x5e, 0x34, 0x05, 0xd9, + 0x6e, 0x15, 0x06, 0x1c, 0x9a, 0x52, 0x3a, 0x4e, 0x22, 0x42, 0x53, 0x30, + 0xbe, 0xc2, 0x14, 0x84, 0x57, 0x01, 0x0b, 0x89, 0xd0, 0xe1, 0x99, 0xaf, + 0x56, 0x00, 0xfd, 0x2f, 0x62, 0xa9, 0x2e, 0xbf, 0x3e, 0x43, 0xef, 0x80, + 0x2e, 0xf8, 0x8e, 0xa3, 0x77, 0xf9, 0xeb, 0x33, 0x38, 0xf6, 0xfd, 0x81, + 0x59, 0x15, 0xfa, 0x94, 0xd2, 0x8a, 0xe9, 0xc8, 0x05, 0x47, 0x30, 0x1a, + 0xc5, 0xa4, 0x49, 0xf2, 0xc9, 0x07, 0xf8, 0x8d, 0x7c, 0xc5, 0x25, 0x1c, + 0x03, 0x24, 0x28, 0xc6, 0x1c, 0xf9, 0x2a, 0x06, 0x88, 0xfc, 0xde, 0x57, + 0x20, 0xb5, 0x31, 0x64, 0x35, 0xd5, 0x3f, 0x5a, 0x38, 0xb0, 0x23, 0x42, + 0xad, 0xfd, 0x19, 0xdb, 0x65, 0x00, 0x32, 0x2a, 0x10, 0xf6, 0xba, 0xd7, + 0x68, 0x84, 0xbf, 0x6d, 0x9b, 0xdd, 0xae, 0x01, 0xe5, 0x3c, 0x5f, 0xde, + 0xb8, 0xf5, 0x82, 0x62, 0xa4, 0xe3, 0x41, 0xd8, 0xc7, 0x20, 0x20, 0x73, + 0x60, 0x24, 0x24, 0x51, 0xf8, 0x55, 0x6d, 0xf6, 0x09, 0x63, 0x34, 0xea, + 0xb3, 0x7e, 0xdb, 0x2e, 0x9e, 0x99, 0x5d, 0x0f, 0x73, 0xc0, 0x03, 0x9d, + 0x22, 0x21, 0xd2, 0xaf, 0x12, 0x3d, 0xf6, 0xf3, 0xb6, 0x4b, 0x67, 0x42, + 0x87, 0x0a, 0x6f, 0xd5, 0xfc, 0x3c, 0xaf, 0x08, 0xa7, 0x8d, 0x11, 0xe8, + 0x02, 0x63, 0xae, 0x72, 0x22, 0x29, 0x59, 0x60, 0x81, 0xf9, 0xbd, 0x3f, + 0x86, 0xa1, 0x9c, 0xc1, 0x99, 0x72, 0x0e, 0x1a, 0x51, 0x48, 0x62, 0xa3, + 0xe3, 0xab, 0x54, 0x00, 0xe2, 0x6c, 0x42, 0xc1, 0xba, 0xa4, 0xf3, 0x70, + 0x34, 0xbd, 0x1f, 0x9f, 0x45, 0x35, 0xcc, 0xa8, 0xcf, 0x1a, 0x3a, 0x53, + 0xd5, 0x68, 0x08, 0x38, 0xef, 0x43, 0xc5, 0x99, 0x57, 0x01, 0x67, 0x0d, + 0xe8, 0x04, 0x05, 0x3f, 0x81, 0x00, 0x43, 0x9b, 0xd1, 0xb5, 0xb4, 0x81, + 0x91, 0x59, 0xb0, 0x50, 0x85, 0xce, 0x68, 0x11, 0x14, 0x7e, 0x48, 0x89, + 0x05, 0xd7, 0x1c, 0x33, 0xa3, 0x82, 0xc5, 0x1a, 0x99, 0xaf, 0xac, 0x36, + 0xc0, 0x74, 0x73, 0x1f, 0x53, 0xb2, 0x07, 0x07, 0x49, 0xdb, 0x21, 0x27, + 0xda, 0x4d, 0x80, 0xe6, 0x34, 0x50, 0x0f, 0x4e, 0x69, 0x17, 0x9d, 0x9b, + 0x4c, 0x25, 0x0f, 0x42, 0x9a, 0x69, 0x48, 0x61, 0x11, 0x33, 0x1d, 0x7e, + 0x90, 0xaf, 0x42, 0xc3, 0x02, 0x07, 0x83, 0xd9, 0x3b, 0x4c, 0xb0, 0xfa, + 0x81, 0xdf, 0xbc, 0x03, 0x15, 0x12, 0x99, 0xd1, 0xc8, 0x2c, 0xbe, 0x6b, + 0xb5, 0x26, 0xfc, 0x32, 0x3c, 0xa5, 0xb3, 0x30, 0xb0, 0x4b, 0x8b, 0x11, + 0xed, 0xf6, 0x02, 0x85, 0xa4, 0x63, 0xf3, 0xf1, 0x58, 0x0b, 0xa3, 0xb0, + 0xcd, 0x2a, 0xb4, 0xfd, 0xd4, 0x0c, 0x7f, 0xa1, 0x5b, 0x38, 0xbd, 0x48, + 0xb5, 0x63, 0xa5, 0xdd, 0x8e, 0x67, 0x2b, 0xdd, 0x4e, 0x33, 0x28, 0xae, + 0x05, 0x40, 0xde, 0x3a, 0x0e, 0x1c, 0xab, 0x4b, 0x2e, 0xb5, 0xfa, 0xa3, + 0xa4, 0x45, 0x3e, 0xdd, 0x9f, 0x3a, 0xee, 0xe3, 0xd2, 0xea, 0x16, 0xf6, + 0x44, 0xad, 0xa7, 0x35, 0xd2, 0xed, 0xad, 0x5a, 0xb0, 0xee, 0x93, 0xab, + 0x98, 0x89, 0x3e, 0x82, 0xed, 0x21, 0x4f, 0xa6, 0x92, 0x1f, 0x43, 0xbe, + 0x47, 0xa3, 0xc6, 0xe1, 0xb6, 0x57, 0x11, 0xdf, 0xff, 0xd3, 0xe9, 0x24, + 0x4b, 0x16, 0x61, 0x86, 0xa9, 0x8d, 0x15, 0xaa, 0xf5, 0x5e, 0x00, 0x1b, + 0x99, 0xfb, 0x87, 0x75, 0x94, 0x78, 0x19, 0x36, 0xd6, 0x26, 0x7f, 0x94, + 0xaf, 0xd7, 0xa9, 0x5c, 0x7a, 0x46, 0xb9, 0x30, 0xd8, 0xb6, 0x51, 0x5b, + 0x19, 0x92, 0x4f, 0x05, 0x93, 0x1c, 0x19, 0xfc, 0xdd, 0x1e, 0x11, 0x7a, + 0x63, 0x51, 0xb7, 0xb2, 0x47, 0x7f, 0x42, 0x21, 0x52, 0x5e, 0x09, 0x93, + 0x70, 0xb8, 0x48, 0x4b, 0x1e, 0x9c, 0x04, 0xb1, 0x09, 0xd8, 0x95, 0x60, + 0x00, 0x5c, 0x06, 0x13, 0x2a, 0x1d, 0x04, 0x31, 0xfd, 0x7d, 0xb5, 0x81, + 0xb3, 0xc8, 0x79, 0x5a, 0xb8, 0x46, 0x58, 0x10, 0x4c, 0x8c, 0x02, 0x8b, + 0x2d, 0xa8, 0xa8, 0x50, 0x9a, 0x03, 0x0f, 0xe5, 0x4f, 0xcd, 0xa3, 0x70, + 0xf6, 0xf0, 0xf8, 0xd7, 0x39, 0x26, 0xb6, 0x06, 0x47, 0x67, 0xc7, 0x47, + 0xf7, 0x3d, 0xef, 0xe5, 0xc9, 0xec, 0xed, 0x9b, 0x72, 0x7e, 0xc2, 0x82, + 0x63, 0x3c, 0xe3, 0xf8, 0x59, 0xb1, 0x9e, 0x4b, 0xee, 0x69, 0xfb, 0x36, + 0x80, 0xb3, 0xf9, 0x75, 0xf6, 0x18, 0x45, 0x36, 0x2e, 0xd3, 0xd2, 0x33, + 0x61, 0x30, 0xdf, 0x0b, 0x13, 0xa6, 0x3b, 0xca, 0x4d, 0x97, 0x33, 0x54, + 0x3b, 0x94, 0x23, 0xaf, 0x45, 0xb2, 0xf4, 0xb3, 0x34, 0x1f, 0x55, 0x40, + 0xe5, 0x6b, 0xda, 0x21, 0x74, 0x5a, 0x2c, 0x81, 0x0d, 0x45, 0xe6, 0xbc, + 0x25, 0xfa, 0x7b, 0xd2, 0x3d, 0x09, 0x98, 0xd4, 0xb6, 0xed, 0x9e, 0x3d, + 0x2a, 0x5a, 0xf6, 0xa8, 0x23, 0x40, 0x9d, 0x63, 0x0c, 0x3a, 0xe2, 0x7b, + 0x4c, 0x75, 0xa3, 0x1d, 0x34, 0x36, 0x7d, 0xdc, 0xfe, 0x9e, 0x34, 0x53, + 0x9b, 0x52, 0x63, 0x08, 0x4d, 0x9b, 0x94, 0x40, 0x30, 0x24, 0x91, 0x6b, + 0x3c, 0xc1, 0x32, 0x2c, 0x29, 0x36, 0xe2, 0xe5, 0xfd, 0x75, 0x3a, 0xd7, + 0x14, 0xf8, 0x25, 0x0b, 0xc9, 0x40, 0xdf, 0x97, 0xf7, 0x8d, 0x5b, 0x69, + 0x6d, 0xa4, 0xc8, 0xcb, 0xba, 0xdb, 0x5b, 0x83, 0x9f, 0xea, 0x6e, 0x67, + 0xb2, 0xf6, 0xd7, 0x4b, 0x7b, 0x42, 0xb0, 0xc7, 0x88, 0xef, 0xf7, 0x0e, + 0x02, 0x60, 0xe2, 0x7e, 0xd2, 0x08, 0x7b, 0xfd, 0x27, 0x0d, 0x8a, 0xfb, + 0x71, 0x77, 0x00, 0xf1, 0x1c, 0x8f, 0x4b, 0x7e, 0x7e, 0x89, 0x58, 0x53, + 0x22, 0x9c, 0x3e, 0x36, 0xc7, 0xbc, 0xf6, 0x48, 0xf0, 0x7b, 0x3f, 0x71, + 0x94, 0x4f, 0x37, 0x29, 0x98, 0x68, 0x4f, 0xb3, 0x3c, 0xc5, 0xbc, 0x6b, + 0x0a, 0x13, 0xd8, 0xb9, 0x7e, 0x04, 0x85, 0x3d, 0x55, 0xd0, 0x99, 0x1a, + 0x6f, 0x0d, 0x1d, 0xc4, 0xcf, 0x6b, 0xed, 0x5d, 0x65, 0x5b, 0x80, 0x0e, + 0x64, 0xa8, 0xca, 0x91, 0x60, 0x5e, 0xae, 0xe2, 0x6f, 0x18, 0x18, 0x99, + 0xc0, 0xd9, 0xf1, 0x3f, 0x58, 0xfb, 0x2e, 0x42, 0xfc, 0x33, 0xeb, 0xde, + 0x7e, 0x88, 0x7f, 0x61, 0xa2, 0x7c, 0x72, 0x0d, 0x62, 0xa3, 0x14, 0x78, + 0x89, 0xe5, 0x07, 0x76, 0xe8, 0x92, 0x42, 0xfc, 0x6d, 0xa7, 0x0a, 0x77, + 0xb7, 0x8c, 0xbf, 0x63, 0xbd, 0xd7, 0x52, 0xe2, 0xbf, 0x31, 0x23, 0x86, + 0xcd, 0xe0, 0x00, 0x7a, 0xfc, 0x2b, 0x03, 0x96, 0xf2, 0xda, 0xc6, 0x7f, + 0xad, 0xcd, 0xdd, 0x16, 0xb6, 0xc5, 0xab, 0x26, 0xf1, 0x7f, 0x31, 0x4d, + 0x80, 0xf1, 0xdf, 0x19, 0xec, 0x4c, 0xfc, 0xdf, 0x66, 0x85, 0x20, 0xd1, + 0xcd, 0xea, 0xbc, 0xeb, 0x3c, 0xdc, 0x4b, 0x52, 0x74, 0xde, 0x26, 0xef, + 0xde, 0x8d, 0xd7, 0xa0, 0x2f, 0x0c, 0x68, 0x82, 0x85, 0x12, 0x76, 0x98, + 0x5f, 0x0d, 0x7e, 0xe1, 0xe9, 0xfb, 0xe7, 0xe9, 0xc6, 0x8d, 0x2f, 0xb8, + 0xb6, 0x6e, 0x24, 0xf1, 0x3b, 0xfd, 0x36, 0x3d, 0x0a, 0x9e, 0xa0, 0xe2, + 0x26, 0xd3, 0x17, 0xa6, 0x00, 0x9a, 0x71, 0xbd, 0x4a, 0xde, 0xbe, 0x1f, + 0xa1, 0x89, 0xe6, 0xfb, 0xf2, 0xe5, 0x79, 0xc9, 0x8b, 0x0f, 0x78, 0xf0, + 0xc0, 0xbd, 0xa4, 0xae, 0x80, 0x84, 0xeb, 0x1b, 0xbc, 0xd7, 0xe4, 0xdf, + 0xa0, 0x68, 0x2e, 0x29, 0xfd, 0x5d, 0xe7, 0x5a, 0x7f, 0x87, 0xd9, 0xee, + 0x7f, 0xa3, 0xc3, 0x52, 0x73, 0x5a, 0x13, 0xc6, 0x0d, 0x5e, 0x24, 0xdf, + 0x92, 0xc4, 0x99, 0x14, 0x63, 0xff, 0x4e, 0x12, 0x28, 0xe5, 0x22, 0xc1, + 0xe3, 0x1b, 0xda, 0xd7, 0xc0, 0xb1, 0xec, 0xe7, 0x50, 0x8b, 0x7e, 0xf4, + 0xe1, 0xfd, 0x4a, 0x69, 0x94, 0x78, 0x18, 0x1b, 0xa4, 0xe6, 0x50, 0x57, + 0x54, 0x0b, 0x7b, 0x01, 0x68, 0x8b, 0x31, 0x8c, 0xb1, 0x3d, 0xdc, 0xbd, + 0x26, 0xb2, 0x4f, 0x40, 0x0d, 0x60, 0xe9, 0x9a, 0xaf, 0xcf, 0x8b, 0x14, + 0xb0, 0xc5, 0xeb, 0x0b, 0x83, 0x0f, 0xdd, 0x7f, 0xdb, 0x6e, 0x0f, 0x27, + 0x35, 0xdb, 0x14, 0x34, 0x84, 0x4d, 0xe5, 0x97, 0x70, 0x5c, 0x35, 0x17, + 0xaa, 0x34, 0x2a, 0xf8, 0x32, 0x2e, 0xeb, 0x44, 0x34, 0x4e, 0x2a, 0x7d, + 0x7b, 0x40, 0x38, 0xc4, 0x00, 0xbc, 0x06, 0xef, 0x88, 0x8e, 0xde, 0x99, + 0x84, 0x9b, 0x49, 0x0f, 0xfd, 0xbc, 0x52, 0x40, 0xf6, 0xcb, 0xb8, 0xa8, + 0xf5, 0xc4, 0x4d, 0xce, 0x3c, 0xcc, 0x0e, 0xa6, 0x83, 0x9c, 0x86, 0x42, + 0x5f, 0xcf, 0x2a, 0x42, 0x81, 0xf9, 0x32, 0x71, 0xa0, 0x0d, 0x1e, 0x93, + 0x47, 0xf2, 0x1c, 0x44, 0xeb, 0x68, 0xa4, 0xeb, 0x18, 0xd8, 0x38, 0xda, + 0x5b, 0xec, 0xdf, 0x09, 0xbb, 0x7b, 0xc9, 0x6d, 0x40, 0x44, 0x07, 0x10, + 0xe3, 0x7f, 0x26, 0x6c, 0x08, 0xbd, 0x64, 0x98, 0x47, 0xc7, 0x8f, 0xcc, + 0x4a, 0xeb, 0x66, 0x53, 0x9a, 0x12, 0x60, 0x9a, 0x4f, 0x99, 0xbc, 0x41, + 0x70, 0x77, 0x76, 0x33, 0x23, 0x5d, 0x7c, 0x93, 0x35, 0xd8, 0xf8, 0x3f, + 0xe8, 0x6b, 0x68, 0xfd, 0xe3, 0xaa, 0x76, 0xe7, 0x86, 0x20, 0x15, 0x12, + 0x24, 0x20, 0xaf, 0xf6, 0xe5, 0x86, 0x2f, 0xca, 0x7e, 0x30, 0x37, 0xdb, + 0x86, 0x4d, 0x44, 0x40, 0x4d, 0x3e, 0x9e, 0x52, 0x7e, 0x00, 0x62, 0x6f, + 0x62, 0x22, 0xbb, 0x1d, 0x70, 0x84, 0x60, 0x98, 0x01, 0xce, 0x0a, 0xa4, + 0x07, 0x4f, 0xcc, 0x69, 0x94, 0xd4, 0x17, 0x9d, 0xc2, 0x8f, 0x5b, 0xcd, + 0x37, 0xc8, 0x07, 0xb7, 0x5e, 0x86, 0xfb, 0x68, 0xe2, 0xee, 0x20, 0xbd, + 0xd0, 0xc5, 0x0d, 0xbf, 0x4c, 0x0a, 0xc2, 0xba, 0x89, 0xa2, 0x7d, 0xab, + 0x3f, 0x30, 0xda, 0xc2, 0xc3, 0xb2, 0xc9, 0x8b, 0x2a, 0x27, 0xf6, 0x0c, + 0xfc, 0x2d, 0x4d, 0xde, 0xe4, 0xc0, 0xf3, 0x30, 0x87, 0xb3, 0x6b, 0x89, + 0xfc, 0x8c, 0xe9, 0x5b, 0xc0, 0xcf, 0xac, 0xec, 0x70, 0xfb, 0xcf, 0x44, + 0x27, 0x70, 0x16, 0x2d, 0xa3, 0x38, 0xaf, 0xf7, 0x84, 0xee, 0x61, 0x8c, + 0xb8, 0xa5, 0xc8, 0x36, 0x72, 0x72, 0x0a, 0xd3, 0x20, 0xa9, 0xa0, 0xb8, + 0xd0, 0x9c, 0xb0, 0x77, 0x3b, 0xf2, 0x23, 0x98, 0xb2, 0x68, 0x61, 0xc8, + 0xf2, 0x04, 0xb0, 0x7d, 0xc1, 0xb6, 0xad, 0x5b, 0x94, 0x79, 0x9d, 0x90, + 0x8f, 0xf6, 0xaf, 0xe6, 0x82, 0x09, 0x0b, 0xec, 0xa5, 0x4a, 0x4a, 0x5c, + 0x72, 0xc5, 0xda, 0x47, 0xec, 0xd9, 0x3f, 0xdf, 0x12, 0xb3, 0xc2, 0x11, + 0x50, 0xbb, 0xf4, 0x8c, 0xbc, 0xb5, 0x36, 0xca, 0xcf, 0x58, 0xcb, 0xf6, + 0x0f, 0xb9, 0x03, 0x33, 0x22, 0x6f, 0x46, 0x24, 0x7b, 0x4f, 0x8f, 0x51, + 0x70, 0x97, 0x50, 0xc8, 0x78, 0x4d, 0x0e, 0x05, 0x3a, 0x5a, 0xe4, 0xa3, + 0x91, 0xc6, 0x35, 0x6c, 0x46, 0xc1, 0xa4, 0x16, 0xae, 0x65, 0x23, 0x2d, + 0xbc, 0x7b, 0x54, 0x1f, 0xaf, 0x04, 0x7e, 0xe2, 0xe9, 0xf2, 0xa5, 0xcc, + 0x6e, 0x3c, 0x65, 0xa0, 0xa5, 0xf3, 0xe2, 0x4b, 0x49, 0x67, 0xb7, 0xc9, + 0xac, 0xbb, 0x53, 0x0d, 0xcf, 0x89, 0x7e, 0xe9, 0x2c, 0x9d, 0x74, 0xa6, + 0x45, 0xca, 0x7d, 0x88, 0xdb, 0x52, 0xba, 0x39, 0x26, 0xf6, 0x49, 0xce, + 0xa6, 0xf2, 0xff, 0xa9, 0xb8, 0x3b, 0x24, 0x7d, 0xfe, 0x29, 0x22, 0x44, + 0x7c, 0x51, 0xb1, 0x01, 0xb6, 0x36, 0x33, 0x24, 0x5f, 0xa2, 0x1b, 0x93, + 0x8e, 0xe8, 0x21, 0x26, 0x87, 0xa9, 0x44, 0x9b, 0x4e, 0x9f, 0x25, 0x56, + 0xbc, 0xed, 0xee, 0x13, 0x0f, 0x4d, 0xb5, 0xe3, 0x8c, 0x8a, 0x37, 0x71, + 0x35, 0x0b, 0xeb, 0x73, 0x28, 0x99, 0xaa, 0x64, 0x36, 0x8f, 0xf7, 0xef, + 0x95, 0x63, 0xf0, 0x24, 0xa1, 0x20, 0x9e, 0x31, 0xbd, 0x96, 0xdc, 0xde, + 0x85, 0xee, 0xb1, 0x08, 0x57, 0x34, 0x38, 0x1e, 0xbe, 0xc0, 0x76, 0x46, + 0x5b, 0xb0, 0xe5, 0xce, 0xb1, 0xa3, 0x37, 0x17, 0xd3, 0xdb, 0xd5, 0xcf, + 0xdd, 0x65, 0xc7, 0xe1, 0xe9, 0xc4, 0xaa, 0xb2, 0x6f, 0x42, 0x77, 0x93, + 0x4b, 0xc1, 0x90, 0x4b, 0x40, 0x8c, 0x19, 0x5d, 0x35, 0xbf, 0xbe, 0x71, + 0x57, 0x53, 0xd6, 0x3c, 0x31, 0x4e, 0x7a, 0x38, 0x27, 0x6f, 0xfc, 0x8f, + 0x4b, 0x32, 0x1a, 0x3d, 0x68, 0x3f, 0xf0, 0xb6, 0x18, 0x2d, 0x49, 0x76, + 0x22, 0x81, 0xa0, 0xd8, 0x9c, 0xb4, 0x05, 0x95, 0x6a, 0x04, 0x55, 0x13, + 0x64, 0x92, 0x5e, 0xcc, 0x26, 0x46, 0xb2, 0x28, 0xd0, 0x1d, 0x43, 0x77, + 0x8c, 0x13, 0x2f, 0x4d, 0xc5, 0x9e, 0xd6, 0xe8, 0x22, 0x18, 0x8d, 0x05, + 0xf2, 0x0d, 0x89, 0x8e, 0x9c, 0xfb, 0x0c, 0xfa, 0x09, 0xdd, 0xaf, 0xf4, + 0xfb, 0x61, 0xfa, 0x40, 0xbb, 0x35, 0x46, 0xc6, 0xe5, 0x55, 0x91, 0x6e, + 0xac, 0xa4, 0x22, 0x73, 0xd2, 0x4a, 0xab, 0x9b, 0x8e, 0xb4, 0xa2, 0x6d, + 0x20, 0xc1, 0x44, 0x00, 0x3e, 0x16, 0x70, 0x00, 0x2e, 0x28, 0x88, 0x78, + 0xc9, 0x99, 0x2b, 0x37, 0x2a, 0x21, 0xd9, 0xf8, 0x85, 0x96, 0x0d, 0x92, + 0xb5, 0x5f, 0xea, 0x4b, 0xcf, 0x64, 0x65, 0x6a, 0xf4, 0x96, 0x7e, 0x0b, + 0x50, 0x5d, 0xfa, 0x46, 0x3c, 0x1b, 0xd2, 0xe1, 0xc0, 0x62, 0xb6, 0x03, + 0x02, 0x28, 0xbe, 0x96, 0x3e, 0x92, 0xac, 0x23, 0x46, 0xd8, 0xde, 0x84, + 0xb8, 0x25, 0x7c, 0xd2, 0xbb, 0x1e, 0x72, 0x7a, 0xc3, 0xe1, 0xac, 0x77, + 0x5d, 0x14, 0x86, 0x98, 0xca, 0xb8, 0x7f, 0x7d, 0x0a, 0x71, 0x3f, 0x15, + 0xf1, 0xe1, 0x75, 0x2a, 0xdc, 0xd5, 0x69, 0x11, 0xaf, 0xe0, 0xdc, 0xd8, + 0x18, 0xc6, 0x9e, 0xa5, 0x85, 0xaa, 0x0a, 0xc3, 0xdb, 0x7d, 0x90, 0x85, + 0x5a, 0x5e, 0xf4, 0x8f, 0x8c, 0x4a, 0xad, 0xb9, 0x5c, 0x4a, 0x4d, 0xb4, + 0x64, 0xa7, 0x48, 0xea, 0x2b, 0x04, 0x9e, 0x9c, 0xf6, 0x8d, 0x24, 0x1d, + 0x17, 0x46, 0xea, 0x93, 0x87, 0x0d, 0x1d, 0xf4, 0x85, 0x69, 0xec, 0x6e, + 0xac, 0xef, 0xe9, 0x06, 0x00, 0x54, 0x6b, 0xd3, 0xa8, 0xe1, 0xa7, 0x5e, + 0x40, 0x3d, 0x16, 0xeb, 0x07, 0x16, 0x11, 0xdc, 0x0b, 0x23, 0x3d, 0x5a, + 0x60, 0x41, 0x03, 0x09, 0xee, 0x53, 0xa8, 0x53, 0xf6, 0x04, 0x42, 0xdd, + 0xdb, 0xd9, 0x4a, 0x68, 0x47, 0x47, 0x8d, 0x2d, 0xa4, 0x03, 0xf2, 0xa4, + 0xf2, 0x0c, 0x2a, 0x9b, 0x24, 0x77, 0xd1, 0x5c, 0xf2, 0x68, 0xa9, 0x9b, + 0x04, 0xcf, 0xe1, 0x03, 0x8b, 0x98, 0xd0, 0x85, 0x3e, 0x91, 0x34, 0x53, + 0xb4, 0x19, 0x14, 0xdd, 0x0b, 0x84, 0x2f, 0x0d, 0x62, 0x85, 0x4b, 0xf3, + 0xd1, 0x4c, 0xb6, 0x2e, 0x1d, 0xd8, 0x50, 0x2b, 0x04, 0x76, 0xa8, 0xc0, + 0x3e, 0x45, 0x21, 0xd0, 0xe5, 0x58, 0x33, 0x33, 0x0d, 0xad, 0xba, 0x33, + 0xcd, 0xe2, 0xf3, 0xa6, 0xa1, 0xa1, 0x3a, 0xd3, 0xd4, 0xa0, 0xef, 0x51, + 0xb7, 0x63, 0xaa, 0x19, 0x7e, 0x6a, 0x4e, 0x3f, 0xdf, 0xb3, 0x4b, 0x28, + 0x0d, 0xd7, 0x18, 0x27, 0x47, 0x3c, 0x03, 0x46, 0xb1, 0x00, 0xd9, 0xa2, + 0x76, 0x8c, 0x28, 0xb8, 0x3e, 0xa6, 0xeb, 0xc2, 0x08, 0x64, 0x40, 0x21, + 0xd7, 0x69, 0xb0, 0xad, 0x03, 0xe0, 0xc3, 0xe2, 0x70, 0x0f, 0xcc, 0x5c, + 0x09, 0xac, 0x36, 0xdc, 0x1e, 0xe1, 0x7d, 0x69, 0xd3, 0xb4, 0x66, 0x79, + 0x82, 0x57, 0x93, 0xfd, 0xb2, 0x49, 0xe7, 0x4a, 0xeb, 0x05, 0x1f, 0xaf, + 0xd3, 0x0b, 0xb1, 0x70, 0x6e, 0x0f, 0xef, 0x38, 0xdd, 0xdc, 0x73, 0x3d, + 0xf0, 0x7e, 0x43, 0xc9, 0xde, 0x1d, 0x1d, 0x6d, 0x79, 0xfd, 0x8e, 0xfc, + 0x2c, 0xf1, 0xbe, 0x6c, 0x55, 0xa0, 0x6c, 0xeb, 0x5a, 0xcb, 0x43, 0x04, + 0xa0, 0x92, 0xb9, 0x61, 0xf1, 0xc7, 0xb0, 0x4e, 0x02, 0x0e, 0x3a, 0xfe, + 0xdc, 0x2a, 0x0d, 0xa3, 0x78, 0xa5, 0xaf, 0x64, 0xd0, 0xa2, 0x9c, 0x95, + 0x96, 0x32, 0x44, 0x4e, 0x9c, 0x99, 0x53, 0x04, 0xd2, 0x33, 0xb6, 0xff, + 0x5e, 0xfa, 0xfc, 0xb0, 0x3f, 0x4b, 0x34, 0xc1, 0x54, 0x8b, 0x85, 0x96, + 0x51, 0x74, 0xc5, 0x37, 0xc9, 0x3a, 0x96, 0x61, 0xda, 0x07, 0x1d, 0xed, + 0x98, 0x45, 0x5b, 0x7f, 0x83, 0x82, 0xaf, 0x4a, 0x4f, 0x46, 0xac, 0x4a, + 0x4d, 0x55, 0x66, 0xb1, 0x98, 0x91, 0xf3, 0x5a, 0x2c, 0xde, 0x03, 0x4f, + 0x2d, 0xde, 0x83, 0x16, 0xef, 0x1f, 0xc3, 0xb6, 0x42, 0x1d, 0xb8, 0xdd, + 0xef, 0x47, 0xef, 0x8c, 0x20, 0x93, 0xea, 0xde, 0x57, 0x98, 0x94, 0xc1, + 0x0b, 0x0c, 0x0e, 0xf6, 0x0f, 0x47, 0x0d, 0x1a, 0xe5, 0xda, 0xea, 0x33, + 0xe3, 0x73, 0x54, 0x67, 0x9d, 0x22, 0x00, 0x2c, 0x62, 0xdd, 0x42, 0x3d, + 0x2b, 0x26, 0x4a, 0x7f, 0x49, 0x72, 0xe9, 0x01, 0xf8, 0x23, 0x08, 0x88, + 0xd9, 0x3d, 0x68, 0x51, 0x12, 0xe6, 0xcb, 0x3e, 0xb6, 0x6f, 0x61, 0xb4, + 0x31, 0xdc, 0xaa, 0x7a, 0x96, 0x36, 0x8f, 0x32, 0x30, 0xb0, 0x4b, 0x00, + 0xfe, 0x5c, 0xea, 0x74, 0x32, 0x4c, 0xd4, 0xcd, 0x25, 0x94, 0x7f, 0xdf, + 0xa4, 0x7e, 0x2d, 0xcb, 0x56, 0xe0, 0xbf, 0xb1, 0x06, 0x18, 0xe6, 0x87, + 0xe2, 0x4b, 0x32, 0x34, 0xfe, 0x26, 0xad, 0x4a, 0x6e, 0x04, 0x26, 0xde, + 0x03, 0xc0, 0x87, 0x6f, 0x34, 0x15, 0x1c, 0xce, 0xe5, 0xb1, 0x64, 0x54, + 0x18, 0xf0, 0xf7, 0xc6, 0x38, 0x33, 0x15, 0x3d, 0x79, 0x68, 0x4d, 0x67, + 0x3f, 0x71, 0x8b, 0x0a, 0x33, 0x0a, 0x6a, 0x3c, 0xcd, 0x8b, 0x17, 0xfc, + 0xca, 0x36, 0x7f, 0x9d, 0xbb, 0xf5, 0x00, 0x25, 0xf6, 0xb8, 0xf7, 0x16, + 0xa3, 0xd1, 0xc2, 0xd8, 0x4e, 0x0d, 0x4b, 0x44, 0x88, 0x1c, 0xff, 0xe1, + 0x08, 0x9a, 0x8a, 0xb0, 0xf5, 0x09, 0x78, 0x02, 0xd0, 0x4e, 0x49, 0x9d, + 0x74, 0x39, 0x7a, 0xdb, 0x4d, 0x12, 0xf6, 0xa2, 0xa3, 0x5d, 0xeb, 0x89, + 0x1e, 0x5d, 0x98, 0xb4, 0xdf, 0xe6, 0xa1, 0x64, 0x0f, 0xd9, 0xc9, 0xe9, + 0x98, 0x05, 0x47, 0x74, 0x4f, 0x9e, 0xd8, 0x10, 0xff, 0x5a, 0xc6, 0xc1, + 0xdf, 0x44, 0xcc, 0xed, 0x30, 0x2a, 0x86, 0xe4, 0x90, 0xe0, 0x25, 0xba, + 0xf0, 0x91, 0x90, 0x84, 0x7e, 0x20, 0xa9, 0x91, 0x03, 0xcc, 0xc3, 0x47, + 0xdd, 0x2b, 0x5e, 0xb8, 0xce, 0xdb, 0x52, 0x4e, 0x0f, 0xca, 0x64, 0xd1, + 0x7a, 0x65, 0x43, 0x75, 0xb3, 0x24, 0x95, 0x26, 0x5d, 0xc4, 0xcc, 0xe4, + 0x16, 0x2c, 0xa0, 0x4e, 0xba, 0xe1, 0x61, 0xcb, 0x1f, 0x40, 0xd7, 0xfb, + 0xb7, 0x8a, 0xfe, 0x00, 0xed, 0xdb, 0x4b, 0xee, 0x24, 0x05, 0xe5, 0xd8, + 0xb3, 0x7a, 0x7c, 0x77, 0x05, 0xa6, 0xbd, 0x62, 0x3a, 0x8c, 0xd0, 0x79, + 0xe1, 0x0d, 0x53, 0x8b, 0xf9, 0xb4, 0xf5, 0xe5, 0x70, 0xa9, 0x92, 0x07, + 0x30, 0x07, 0x14, 0xb9, 0xd0, 0x80, 0x4b, 0x00, 0x9f, 0xfa, 0x3b, 0xe0, + 0x06, 0xf0, 0xb6, 0x42, 0x36, 0x3e, 0x57, 0x69, 0x83, 0x71, 0x63, 0xd0, + 0x47, 0xd6, 0x7f, 0x38, 0x4c, 0x12, 0x31, 0x1a, 0x61, 0x7e, 0xdd, 0xb2, + 0x5a, 0x70, 0xca, 0x56, 0x2e, 0x00, 0x34, 0xfb, 0xb4, 0x82, 0xc0, 0x03, + 0xad, 0x98, 0x15, 0xf3, 0x08, 0xf3, 0x09, 0x1a, 0xf8, 0xe4, 0x1e, 0x7c, + 0x14, 0xde, 0xc5, 0x76, 0x98, 0xef, 0xd9, 0x91, 0xf0, 0xde, 0x1b, 0x47, + 0xfb, 0x70, 0xfa, 0x0f, 0x30, 0xb8, 0xf0, 0xc3, 0x18, 0xf3, 0xee, 0xef, + 0x5c, 0x84, 0x00, 0x1d, 0x5c, 0xcc, 0x0a, 0x13, 0xfc, 0x3d, 0x3e, 0x9b, + 0xb7, 0x56, 0x82, 0xb9, 0xd5, 0x9d, 0x95, 0x14, 0x77, 0x2d, 0x43, 0xa3, + 0x99, 0x15, 0xb3, 0xf2, 0xd0, 0x4a, 0x98, 0xea, 0x4a, 0x07, 0x38, 0x4e, + 0xd1, 0x9d, 0x89, 0xfa, 0x2a, 0xcd, 0xde, 0x3f, 0x94, 0xcb, 0x57, 0xef, + 0xc5, 0xe6, 0x05, 0x07, 0xd6, 0x5f, 0x36, 0xbc, 0x59, 0xea, 0x13, 0x53, + 0x62, 0x45, 0x04, 0x90, 0x15, 0xd2, 0x01, 0x2d, 0xba, 0x1d, 0xab, 0xb3, + 0x26, 0x06, 0x65, 0xbc, 0xfb, 0x19, 0x81, 0x56, 0xca, 0x4e, 0x75, 0xb6, + 0x33, 0x4e, 0x8a, 0xef, 0xb7, 0x9c, 0xe1, 0xa5, 0x48, 0x8a, 0x6e, 0xf5, + 0x88, 0x26, 0xb4, 0x71, 0x1a, 0xa9, 0x24, 0xe9, 0x22, 0xb3, 0x51, 0x25, + 0xb7, 0x01, 0x8a, 0x60, 0xf5, 0xa7, 0x5c, 0x83, 0x88, 0xed, 0x54, 0xe8, + 0x04, 0x60, 0xbe, 0x7c, 0xbb, 0x86, 0x23, 0x2f, 0xd5, 0xf5, 0x8b, 0x49, + 0x5a, 0xff, 0x50, 0x22, 0x6e, 0x49, 0x38, 0x48, 0xe0, 0x76, 0x1a, 0x81, + 0x38, 0xeb, 0x9c, 0x0e, 0x3d, 0x8d, 0xf2, 0xe0, 0xd7, 0x7c, 0x01, 0xc8, + 0x00, 0x08, 0x1f, 0xe1, 0xeb, 0x39, 0x3f, 0xf1, 0x75, 0x0a, 0x03, 0xca, + 0x8b, 0x57, 0x7b, 0x4a, 0x25, 0xec, 0xef, 0xf1, 0xc2, 0x57, 0xd1, 0xa8, + 0x9d, 0xfb, 0xe1, 0x01, 0x8c, 0x9c, 0x62, 0x22, 0x50, 0x7b, 0x07, 0x74, + 0xc2, 0x17, 0x6c, 0x00, 0xbd, 0x76, 0x82, 0x92, 0xb3, 0xc9, 0x5a, 0x20, + 0x5f, 0x5b, 0x5f, 0x16, 0x59, 0x72, 0x1e, 0x76, 0xf2, 0x89, 0xec, 0x30, + 0xf8, 0x18, 0x19, 0xd0, 0x1c, 0x02, 0x59, 0xf0, 0x0b, 0x54, 0x08, 0x85, + 0x8d, 0x75, 0x6b, 0x5f, 0x11, 0x33, 0x75, 0x65, 0x9e, 0x7d, 0xe0, 0xdf, + 0xe4, 0x95, 0x5c, 0x36, 0x83, 0x60, 0x03, 0xd0, 0x5e, 0x18, 0x28, 0x6f, + 0x0b, 0x2d, 0x7f, 0x5f, 0x3f, 0x7a, 0x4b, 0xb7, 0x4d, 0x2a, 0xe9, 0x70, + 0x6f, 0x5b, 0x0f, 0xd0, 0x9a, 0xf3, 0x33, 0x68, 0xdb, 0xc0, 0x87, 0x42, + 0xc7, 0x95, 0xcc, 0x76, 0x76, 0xb6, 0xf2, 0x9f, 0xb8, 0x93, 0x77, 0xd4, + 0x6f, 0x31, 0x5f, 0xd2, 0xc2, 0x6f, 0xf0, 0xde, 0x36, 0xd8, 0xdc, 0x5e, + 0xde, 0x76, 0x63, 0x87, 0x72, 0xb8, 0x6f, 0xe9, 0x3d, 0x89, 0x7a, 0x2a, + 0x29, 0x7f, 0x26, 0x8c, 0xb4, 0x30, 0xf8, 0x94, 0xa5, 0x6f, 0x0f, 0xd8, + 0x4c, 0x63, 0x93, 0xfe, 0x16, 0xba, 0x70, 0xaf, 0x39, 0x1c, 0xe1, 0xdb, + 0x49, 0x00, 0xaa, 0x79, 0x0f, 0xca, 0x24, 0xaa, 0xe1, 0xe5, 0x32, 0x27, + 0xfe, 0xb4, 0x8d, 0xc9, 0x4d, 0x9a, 0x49, 0xa8, 0x1f, 0xd0, 0x6a, 0x52, + 0x4e, 0x28, 0xd7, 0x9c, 0xae, 0xb0, 0x99, 0xd1, 0x2c, 0x09, 0x86, 0x0d, + 0x61, 0x45, 0xde, 0xd3, 0x4c, 0x48, 0x3c, 0x1c, 0xe8, 0xe6, 0xad, 0x79, + 0x2c, 0x8a, 0xff, 0x6f, 0x2c, 0x3d, 0xe3, 0xb9, 0xab, 0xf7, 0xe9, 0x69, + 0x7b, 0x07, 0x33, 0x9c, 0x21, 0xcd, 0xf5, 0xf3, 0xd1, 0xd6, 0xb1, 0xab, + 0xb3, 0x78, 0xcd, 0x8b, 0x33, 0xf6, 0x9d, 0x19, 0xff, 0x75, 0x19, 0xff, + 0x05, 0x99, 0xbc, 0xc6, 0x25, 0x9b, 0x0c, 0x10, 0x61, 0x32, 0x40, 0xc0, + 0x26, 0x8b, 0x5f, 0xe8, 0x83, 0x26, 0x37, 0x77, 0x28, 0xe1, 0x34, 0x7d, + 0x0e, 0x67, 0xce, 0xf7, 0x3a, 0x19, 0x44, 0x3f, 0x04, 0x14, 0x0f, 0xfb, + 0xae, 0xf4, 0xa0, 0x19, 0x92, 0x27, 0x5e, 0x56, 0x81, 0xea, 0xcf, 0x2a, + 0xd8, 0xed, 0x66, 0x2e, 0x75, 0xc2, 0xe6, 0x6f, 0x7b, 0x66, 0x91, 0x49, + 0xaa, 0xde, 0xed, 0xfc, 0x7c, 0x9d, 0x2c, 0xfd, 0x03, 0x13, 0x03, 0xa1, + 0x63, 0x2a, 0x2f, 0x78, 0x10, 0x07, 0x42, 0x6e, 0x2a, 0x15, 0x4c, 0x5e, + 0x98, 0x2b, 0x35, 0x02, 0xcc, 0xf6, 0x6d, 0x51, 0x0f, 0x92, 0x01, 0xdd, + 0x2b, 0x7f, 0x25, 0x96, 0xfc, 0xe5, 0xca, 0x33, 0x77, 0x75, 0x16, 0x0c, + 0x1b, 0x60, 0xa3, 0xe8, 0x5d, 0x2b, 0x53, 0xa6, 0xb4, 0x99, 0x32, 0xbd, + 0x3d, 0xe3, 0xa7, 0x2e, 0x20, 0x6b, 0x9f, 0xaf, 0xe4, 0x06, 0x33, 0xb5, + 0x7e, 0x04, 0xf0, 0xc0, 0xce, 0xe1, 0x55, 0x34, 0xf7, 0x70, 0x54, 0xb3, + 0x55, 0x13, 0xb1, 0xb7, 0x59, 0x85, 0xd9, 0xac, 0xd2, 0xdb, 0xac, 0xd4, + 0xdf, 0xac, 0xcc, 0xdf, 0xac, 0xc2, 0x6c, 0x96, 0xd9, 0x8b, 0xd7, 0x16, + 0x26, 0xe3, 0x74, 0x64, 0x19, 0xe5, 0xf4, 0xa7, 0xad, 0x7d, 0xa3, 0x2c, + 0xf3, 0x18, 0x1d, 0xab, 0xcd, 0x73, 0x7f, 0xb7, 0xa5, 0x7d, 0xd8, 0xab, + 0x4f, 0xa5, 0xcd, 0xc2, 0x7e, 0xed, 0x16, 0xde, 0x37, 0x3c, 0x66, 0x61, + 0x04, 0x31, 0x1d, 0x6a, 0xef, 0x38, 0x76, 0x70, 0xec, 0x1f, 0x4d, 0xda, + 0x04, 0x04, 0x48, 0x72, 0x59, 0xfb, 0x4d, 0xc2, 0xbf, 0xec, 0x26, 0xfc, + 0x2b, 0x4a, 0xf8, 0xd7, 0x39, 0x1f, 0x8f, 0xf4, 0x45, 0x9d, 0x44, 0xd5, + 0x74, 0xad, 0x34, 0x6b, 0x81, 0x83, 0x8f, 0x84, 0x75, 0x89, 0x94, 0x6e, + 0x7c, 0x61, 0xb6, 0x07, 0x70, 0xcf, 0x77, 0xaf, 0x9f, 0x3f, 0xbb, 0xe3, + 0x8a, 0x1c, 0xbe, 0x9f, 0x69, 0xd7, 0x4c, 0x10, 0x7b, 0xc3, 0xd3, 0x6b, + 0x25, 0xf1, 0xe7, 0xad, 0xb4, 0x79, 0x5d, 0xc5, 0xbe, 0x73, 0x61, 0x2e, + 0x4b, 0xea, 0xcb, 0xd3, 0x4b, 0x51, 0x62, 0x76, 0x70, 0x12, 0xc8, 0x1c, + 0x93, 0x83, 0x75, 0xfa, 0xb6, 0x28, 0xdf, 0xe2, 0x8c, 0x68, 0xcb, 0xa0, + 0xfb, 0x84, 0x3a, 0xe8, 0xb7, 0xb2, 0x74, 0x27, 0x9b, 0x06, 0xa8, 0x3b, + 0x79, 0x15, 0x66, 0xb4, 0x9e, 0x74, 0xeb, 0x80, 0x1a, 0x04, 0x98, 0xfe, + 0xa2, 0x9b, 0xea, 0x06, 0xcd, 0xb1, 0x38, 0x30, 0x5d, 0x83, 0x68, 0x0f, + 0x86, 0xd3, 0x9a, 0xa2, 0xc5, 0xb8, 0x55, 0xcd, 0xeb, 0x30, 0xb8, 0x79, + 0xa1, 0x9c, 0xe6, 0x61, 0x14, 0x23, 0x33, 0x35, 0x8f, 0x23, 0x18, 0xc3, + 0x7a, 0x2b, 0xa7, 0x61, 0x78, 0x08, 0x3a, 0x4c, 0xe2, 0x6d, 0x5f, 0x0b, + 0x85, 0xad, 0xbe, 0x0a, 0xed, 0x13, 0x24, 0x39, 0xdd, 0x0f, 0xc2, 0x17, + 0x37, 0x99, 0xf0, 0xc4, 0x74, 0xac, 0x87, 0x1b, 0xee, 0x2f, 0xf6, 0x49, + 0xd3, 0xd5, 0xb6, 0x2f, 0xb5, 0x72, 0xd2, 0xa3, 0xc4, 0xde, 0x28, 0x74, + 0x7d, 0xc7, 0x3d, 0xfb, 0xb2, 0x5e, 0xf3, 0xa5, 0x40, 0xce, 0xc0, 0x24, + 0x76, 0x7d, 0x88, 0x8c, 0xdc, 0xd5, 0x24, 0x74, 0xdb, 0x1f, 0x94, 0xee, + 0x64, 0x4d, 0x1c, 0xaa, 0xf4, 0x33, 0x79, 0x31, 0xa3, 0xea, 0x93, 0x0c, + 0x04, 0xde, 0xa7, 0x22, 0xc9, 0x15, 0x92, 0xee, 0x55, 0xfa, 0xea, 0x46, + 0x39, 0xf2, 0x5d, 0xb0, 0xb4, 0x23, 0xc5, 0xc5, 0x8a, 0x64, 0x81, 0x70, + 0x77, 0x4a, 0x30, 0x95, 0xdd, 0x7f, 0x9a, 0xae, 0x79, 0xbd, 0xe7, 0xb3, + 0x89, 0xbc, 0xb9, 0x3a, 0x8b, 0x77, 0x5a, 0x9b, 0x57, 0x80, 0xfa, 0xee, + 0xc5, 0x01, 0xf2, 0xf4, 0x75, 0x9d, 0x03, 0x57, 0xcf, 0x3c, 0x7b, 0x5b, + 0xdf, 0xc2, 0xda, 0xed, 0x4a, 0x7a, 0x20, 0xa3, 0x43, 0x36, 0x43, 0x30, + 0x3a, 0xa1, 0x02, 0x08, 0xa0, 0xef, 0x4a, 0xa1, 0xbd, 0x95, 0xdc, 0x33, + 0x49, 0xdf, 0x45, 0x34, 0x3c, 0xad, 0x4e, 0xbc, 0xbb, 0x14, 0xfd, 0x17, + 0x06, 0x55, 0xeb, 0xc2, 0xe0, 0x67, 0xdd, 0x14, 0xbc, 0xba, 0x0d, 0xdc, + 0x2e, 0x44, 0xfd, 0xb7, 0x02, 0x7b, 0x07, 0x28, 0xfa, 0x2f, 0x21, 0x76, + 0x31, 0x8a, 0x0c, 0xed, 0x51, 0x8a, 0xea, 0x88, 0x3a, 0x24, 0x8b, 0xf8, + 0x77, 0x27, 0x08, 0xbb, 0xf5, 0xf4, 0xee, 0x22, 0x3e, 0xe2, 0xb7, 0x27, + 0x61, 0xae, 0x8f, 0x75, 0x9d, 0x56, 0x92, 0xb7, 0x10, 0x10, 0x68, 0x57, + 0xcf, 0xb0, 0xb7, 0xfe, 0x08, 0xaa, 0x70, 0xce, 0x0f, 0x66, 0x74, 0xb5, + 0x68, 0xb2, 0x5a, 0x91, 0xdf, 0x51, 0x3b, 0xc4, 0xd6, 0xd9, 0xf9, 0xd8, + 0x14, 0x3c, 0x75, 0x09, 0x04, 0xfe, 0xcc, 0xfb, 0x89, 0xb3, 0x87, 0xa6, + 0xee, 0x90, 0x72, 0xcf, 0x7b, 0x9b, 0x68, 0x19, 0xf6, 0xbd, 0xb9, 0x69, + 0xe5, 0x61, 0xd7, 0xbc, 0xb4, 0x4f, 0x71, 0x32, 0x31, 0xd6, 0x76, 0x48, + 0xa4, 0x9d, 0xe3, 0x3c, 0xb1, 0xc0, 0x52, 0xb0, 0xd8, 0x7b, 0x39, 0xda, + 0x8f, 0x5d, 0x87, 0x74, 0x0b, 0xc4, 0xbf, 0xcd, 0x5e, 0xa3, 0x9d, 0xea, + 0xfc, 0xfa, 0xac, 0xe3, 0x92, 0x72, 0x96, 0x94, 0xcb, 0xc5, 0x6f, 0x3f, + 0x01, 0x8a, 0x28, 0x25, 0x0d, 0x0a, 0x6a, 0xbb, 0xf7, 0x21, 0x50, 0x7a, + 0xf3, 0xd3, 0x6b, 0x85, 0x2f, 0x7f, 0x9a, 0xc5, 0xe9, 0xe7, 0x3e, 0x0f, + 0x3e, 0xeb, 0x39, 0x39, 0x9c, 0xc3, 0x37, 0xed, 0xe2, 0x85, 0xef, 0xe3, + 0x25, 0xee, 0xb6, 0x69, 0x52, 0x58, 0xbb, 0x15, 0xb8, 0x24, 0xfe, 0xb9, + 0x6b, 0xb9, 0x63, 0x11, 0x28, 0x0a, 0x7a, 0x5f, 0x27, 0xfd, 0x62, 0x64, + 0xd9, 0x5f, 0x63, 0xe8, 0x0c, 0x0d, 0x10, 0x24, 0x3b, 0x3a, 0x65, 0xda, + 0x11, 0x29, 0x23, 0x99, 0x56, 0xed, 0x65, 0x28, 0x43, 0xcb, 0xad, 0xce, + 0x48, 0x8e, 0x25, 0x3b, 0xaf, 0xce, 0xcf, 0x33, 0x5e, 0xd2, 0xd3, 0xe6, + 0xc0, 0x76, 0x77, 0xbb, 0x62, 0x5d, 0x62, 0xb2, 0x0d, 0xc5, 0xe0, 0xf0, + 0xe4, 0xea, 0x03, 0x78, 0x4c, 0xe8, 0x53, 0x3b, 0xaa, 0xe8, 0x74, 0xa8, + 0xaf, 0xd8, 0x9e, 0x4e, 0xd4, 0xd7, 0xd6, 0xea, 0x98, 0x28, 0x7c, 0x2d, + 0xdc, 0x8a, 0x48, 0x7c, 0x4e, 0xbd, 0x49, 0x34, 0xce, 0xf2, 0x12, 0xdf, + 0x52, 0x0d, 0x66, 0xda, 0xbd, 0x33, 0x0f, 0xf4, 0x75, 0x09, 0xcc, 0xa9, + 0xee, 0x3d, 0x77, 0x13, 0x53, 0xb9, 0x1b, 0x9b, 0xa4, 0x8d, 0x68, 0x3c, + 0x4a, 0xf0, 0xb6, 0x4e, 0x22, 0x5b, 0xda, 0x34, 0xa4, 0x5b, 0x8c, 0xbd, + 0x10, 0xf4, 0xc7, 0xb1, 0x76, 0x3b, 0x8c, 0x5f, 0x01, 0x5b, 0xaf, 0x9c, + 0x17, 0x5b, 0xb2, 0x76, 0x90, 0x2a, 0x9a, 0xb4, 0x89, 0xa8, 0xed, 0xe4, + 0x75, 0xdb, 0x3f, 0xe3, 0x98, 0xa8, 0x88, 0x1e, 0x5c, 0xeb, 0x88, 0xb7, + 0xc5, 0x54, 0xa8, 0xe5, 0x0f, 0x41, 0x8b, 0x2f, 0x61, 0xe3, 0x7a, 0x4b, + 0xef, 0x2c, 0xde, 0xad, 0x69, 0x4d, 0xa2, 0xdf, 0xbc, 0x96, 0x50, 0xf1, + 0x1a, 0xd6, 0x8f, 0x99, 0xce, 0x1d, 0xc1, 0xbd, 0xdb, 0xe1, 0x65, 0x6e, + 0x32, 0x90, 0xd1, 0x7a, 0x71, 0x58, 0x36, 0x6d, 0xa7, 0x87, 0x7c, 0xf7, + 0xf8, 0x64, 0xce, 0xbe, 0x17, 0xaa, 0x46, 0x31, 0x3d, 0x36, 0x8e, 0x3f, + 0x7c, 0xe4, 0x98, 0x9e, 0xd9, 0xc6, 0xe3, 0x26, 0xbe, 0x9a, 0xef, 0xb6, + 0x05, 0xbf, 0xca, 0xea, 0x5c, 0x15, 0x5c, 0x3f, 0xa1, 0x5f, 0xb7, 0xc3, + 0x4c, 0x74, 0x08, 0xe4, 0xad, 0x48, 0xab, 0x0b, 0x6d, 0x22, 0x83, 0x50, + 0x80, 0xd6, 0xcb, 0xe4, 0x3f, 0x12, 0xa5, 0x7e, 0xc8, 0x99, 0x9a, 0x50, + 0x80, 0x91, 0xdc, 0x64, 0xb7, 0xfa, 0x76, 0x74, 0xe8, 0x41, 0x3b, 0x61, + 0xba, 0xae, 0xc4, 0x82, 0xd3, 0x1d, 0x14, 0xbe, 0xb7, 0xfd, 0x54, 0x61, + 0x5e, 0x48, 0x11, 0x89, 0x76, 0xd8, 0x08, 0x1d, 0x89, 0x13, 0x18, 0xc6, + 0xb1, 0xef, 0x95, 0xf2, 0x64, 0x8b, 0x0e, 0x08, 0x7a, 0xb6, 0xed, 0xfe, + 0xf8, 0x3f, 0xc7, 0xf7, 0x03, 0x46, 0xce, 0xcf, 0x2e, 0x5b, 0xc4, 0x70, + 0xba, 0xeb, 0x04, 0x9e, 0x62, 0x58, 0xe1, 0x81, 0xe8, 0x44, 0x3c, 0x9b, + 0xb3, 0x5b, 0xc3, 0x3c, 0xd8, 0xe0, 0xb6, 0x2b, 0xd4, 0x38, 0x1d, 0xbd, + 0x42, 0x13, 0xef, 0xa9, 0x83, 0x02, 0xcf, 0xd4, 0x29, 0x5e, 0x4d, 0x19, + 0xb4, 0x5c, 0x25, 0x88, 0xa0, 0x00, 0x94, 0x30, 0x76, 0x0f, 0xdc, 0x45, + 0x33, 0x8a, 0xc1, 0xdf, 0x50, 0x58, 0x7d, 0xea, 0xae, 0x65, 0x77, 0x2f, + 0xa5, 0x04, 0x8f, 0x5f, 0x3e, 0x37, 0x87, 0xac, 0x67, 0x30, 0x04, 0x5e, + 0x47, 0x44, 0xca, 0x09, 0x9d, 0xa3, 0x0b, 0x04, 0xd3, 0x02, 0x74, 0x7e, + 0xe1, 0xed, 0x8c, 0xe3, 0x0f, 0x47, 0x78, 0x4d, 0xb5, 0x71, 0x92, 0xdd, + 0x32, 0x25, 0x50, 0xc4, 0x79, 0x0e, 0x56, 0xca, 0xfb, 0x32, 0x46, 0xb0, + 0x03, 0x6b, 0xb4, 0xf9, 0xb3, 0xfd, 0x2c, 0xdd, 0xd0, 0xcb, 0x4f, 0x9b, + 0xba, 0x81, 0xdc, 0x97, 0x8c, 0x07, 0xc6, 0x7b, 0xa8, 0x7e, 0xaa, 0xf0, + 0x05, 0x2b, 0x5c, 0x30, 0xdb, 0x5f, 0x69, 0xeb, 0xb1, 0xe4, 0x66, 0x45, + 0xff, 0xa8, 0x78, 0x71, 0xf3, 0x8a, 0xfc, 0x1f, 0x79, 0xf1, 0x10, 0x34, + 0x9b, 0xc7, 0x96, 0x2d, 0xaf, 0x3b, 0x7a, 0xaf, 0x08, 0x22, 0x76, 0xc7, + 0xb2, 0x62, 0xdf, 0x1a, 0x31, 0xb1, 0x7b, 0x2b, 0xeb, 0x42, 0xef, 0xca, + 0x60, 0x74, 0xeb, 0xdc, 0xfe, 0x95, 0x6d, 0xd9, 0x8a, 0x3f, 0xb4, 0x5d, + 0xdb, 0xd1, 0x21, 0x28, 0x3f, 0x05, 0x61, 0x7e, 0xc8, 0xd4, 0xea, 0x97, + 0x7e, 0x0c, 0x85, 0x01, 0x5e, 0x74, 0xc4, 0x3b, 0x81, 0x07, 0xb5, 0x0e, + 0x25, 0x26, 0x37, 0xd1, 0xc9, 0x6e, 0x9b, 0xe8, 0x16, 0xa5, 0xf4, 0xb9, + 0x72, 0x37, 0xf1, 0xe5, 0x2e, 0x39, 0xbf, 0x5b, 0x46, 0x3d, 0x4a, 0x96, + 0xb6, 0x95, 0xdf, 0xa3, 0xe8, 0xe0, 0x4c, 0xfb, 0x65, 0x48, 0x96, 0x75, + 0x26, 0x8b, 0x0c, 0x19, 0x7f, 0x8e, 0xa0, 0x66, 0x3d, 0x93, 0xb4, 0xc8, + 0x98, 0x9e, 0xa0, 0x21, 0x32, 0xc0, 0xc7, 0xec, 0xbb, 0xee, 0xed, 0xe6, + 0x6d, 0xfa, 0xbd, 0x90, 0x6c, 0xe3, 0x1d, 0xc5, 0x48, 0x2b, 0xbe, 0x2e, + 0x06, 0x43, 0xc7, 0xed, 0x80, 0xa2, 0xd2, 0xe1, 0x9b, 0x50, 0xf9, 0x83, + 0xd2, 0x0d, 0xa5, 0x9a, 0xc1, 0x4e, 0x3c, 0xf7, 0xc4, 0xe8, 0x4d, 0xb7, + 0x2b, 0x85, 0x43, 0xdb, 0x72, 0x16, 0x15, 0xac, 0x3a, 0x24, 0x6a, 0x5b, + 0x6b, 0xd2, 0x89, 0x67, 0x07, 0x02, 0xc6, 0x4d, 0x1e, 0xc3, 0x6d, 0x82, + 0xb9, 0x6f, 0xb8, 0xdb, 0xa2, 0xf5, 0x76, 0xd0, 0x26, 0x5e, 0x4c, 0xd2, + 0x39, 0xd4, 0x17, 0x6c, 0xed, 0xff, 0x84, 0x73, 0xc1, 0x99, 0x29, 0xa0, + 0x9b, 0xdd, 0xcf, 0xb4, 0x8c, 0xd6, 0x95, 0xd3, 0x83, 0x35, 0xad, 0xa8, + 0x6e, 0x6b, 0x40, 0xfb, 0x3e, 0x19, 0xba, 0x29, 0x7a, 0x2b, 0x22, 0x76, + 0x81, 0xee, 0xeb, 0xc9, 0xbf, 0xfc, 0x0f, 0xc8, 0x72, 0xd8, 0x05, 0x1e, + 0x68, 0x00, 0x00 +}; +unsigned int alpine_min_js_gz_len = 8463; + +#endif // USE_ALPINEJS +#endif // USE_WEBSERVER \ No newline at end of file diff --git a/tasmota/include/i18n.h b/tasmota/include/i18n.h index bc1d8a058..4429f9532 100644 --- a/tasmota/include/i18n.h +++ b/tasmota/include/i18n.h @@ -858,18 +858,21 @@ // Log message prefix #define D_LOG_APPLICATION "APP: " // Application #define D_LOG_BRIDGE "BRG: " // Bridge +#define D_LOG_BERRY "BRY: " // Berry scripting language #define D_LOG_CONFIG "CFG: " // Settings #define D_LOG_COMMAND "CMD: " // Command #define D_LOG_DEBUG "DBG: " // Debug #define D_LOG_DHT "DHT: " // DHT sensor #define D_LOG_DOMOTICZ "DOM: " // Domoticz #define D_LOG_DSB "DSB: " // DS18xB20 sensor +#define D_LOG_ETH "ETH: " // Ethernet #define D_LOG_HTTP "HTP: " // HTTP webserver -#define D_LOG_HRE "HRE: " +#define D_LOG_HRE "HRE: " // Badger HR-E Water Meter #define D_LOG_I2C "I2C: " // I2C #define D_LOG_IRR "IRR: " // Infra Red Received -#define D_LOG_KNX "KNX: " +#define D_LOG_KNX "KNX: " // KNX server #define D_LOG_LOG "LOG: " // Logging +#define D_LOG_LVGL "LVG: " // LVGL graphics engine #define D_LOG_MODULE "MOD: " // Module #define D_LOG_MDNS "mDN: " // mDNS #define D_LOG_MQTT "MQT: " // MQTT @@ -877,18 +880,17 @@ #define D_LOG_RESULT "RSL: " // Result #define D_LOG_RFR "RFR: " // RF Received #define D_LOG_SERIAL "SER: " // Serial +#define D_LOG_SENSEAIR "SNA: " // Senseair driver +#define D_LOG_SENSOR "SNS: " // Sensor driver #define D_LOG_SHT1 "SHT: " // SHT1x sensor +#define D_LOG_TCP "TCP: " // TCP bridge +#define D_LOG_TELNET "TEL: " // Telnet server +#define D_LOG_THERMOSTAT "THE: " // Thermostat driver +#define D_LOG_UFS "UFS: " // File system #define D_LOG_UPLOAD "UPL: " // Upload #define D_LOG_UPNP "UPP: " // UPnP #define D_LOG_WIFI "WIF: " // Wifi -#define D_LOG_ETH "ETH: " // Ethernet #define D_LOG_ZIGBEE "ZIG: " // Zigbee -#define D_LOG_TCP "TCP: " // TCP bridge -#define D_LOG_BERRY "BRY: " // Berry scripting language -#define D_LOG_LVGL "LVG: " // LVGL graphics engine -#define D_LOG_THERMOSTAT "THE: " // Thermostat driver -#define D_LOG_SENSOR "SNS: " // Sensor driver -#define D_LOG_SENSEAIR "SNA: " // Senseair driver /********************************************************************************************/ diff --git a/tasmota/include/tasconsole.h b/tasmota/include/tasconsole.h index f3f975752..f42b588eb 100644 --- a/tasmota/include/tasconsole.h +++ b/tasmota/include/tasconsole.h @@ -20,6 +20,9 @@ class TASCONSOLE { virtual size_t printf(const char*, char *, const char*&, const char*&, const char*&) = 0; virtual size_t printf(char *) = 0; virtual size_t read() = 0; + virtual size_t write(uint8_t) = 0; + virtual size_t write(const uint8_t *buf, size_t size) = 0; + virtual size_t setRxBufferSize(size_t) = 0; // virtual size_t setTxBufferSize(size_t) = 0; }; @@ -62,6 +65,14 @@ public: return object->read(); } + size_t write(uint8_t data) { + return object->write(data); + } + + size_t write(const uint8_t *buf, size_t size) { + return object->write(buf, size); + } + size_t setRxBufferSize(size_t rx_queue_len) { return object->setRxBufferSize(rx_queue_len); } @@ -104,6 +115,14 @@ public: return object.read(); } + size_t write(uint8_t data) override { + return object.write(data); + } + + size_t write(const uint8_t *buf, size_t size) override { + return object.write(buf, size); + } + size_t setRxBufferSize(size_t size) override { return object.setRxBufferSize(size); } diff --git a/tasmota/include/tasmota.h b/tasmota/include/tasmota.h index 78286966a..5a73e1628 100644 --- a/tasmota/include/tasmota.h +++ b/tasmota/include/tasmota.h @@ -502,6 +502,8 @@ enum SettingsTextIndex { SET_OTAURL, enum SpiInterfaces { SPI_NONE, SPI_MOSI, SPI_MISO, SPI_MOSI_MISO }; +enum XYZModemProtocols { TXMP_NONE, TXMP_SERIAL, TXMP_TASCONSOLE, TXMP_TELNET }; + enum DevGroupMessageType { DGR_MSGTYP_FULL_STATUS, DGR_MSGTYP_PARTIAL_UPDATE, DGR_MSGTYP_UPDATE, DGR_MSGTYP_UPDATE_MORE_TO_COME, DGR_MSGTYP_UPDATE_DIRECT, DGR_MSGTYPE_UPDATE_COMMAND, DGR_MSGTYPFLAG_WITH_LOCAL = 128 }; enum DevGroupMessageFlag { DGR_FLAG_RESET = 1, DGR_FLAG_STATUS_REQUEST = 2, DGR_FLAG_FULL_STATUS = 4, DGR_FLAG_ACK = 8, DGR_FLAG_MORE_TO_COME = 16, DGR_FLAG_DIRECT = 32, DGR_FLAG_ANNOUNCEMENT = 64, DGR_FLAG_LOCAL = 128 }; @@ -529,10 +531,10 @@ enum DevGroupShareItem { DGR_SHARE_POWER = 1, DGR_SHARE_LIGHT_BRI = 2, DGR_SHARE enum CommandSource { SRC_IGNORE, SRC_MQTT, SRC_RESTART, SRC_BUTTON, SRC_SWITCH, SRC_BACKLOG, SRC_SERIAL, SRC_WEBGUI, SRC_WEBCOMMAND, SRC_WEBCONSOLE, SRC_PULSETIMER, SRC_TIMER, SRC_RULE, SRC_MAXPOWER, SRC_MAXENERGY, SRC_OVERTEMP, SRC_LIGHT, SRC_KNX, SRC_DISPLAY, SRC_WEMO, SRC_HUE, SRC_RETRY, SRC_REMOTE, SRC_SHUTTER, - SRC_THERMOSTAT, SRC_CHAT, SRC_TCL, SRC_BERRY, SRC_FILE, SRC_SSERIAL, SRC_USBCONSOLE, SRC_SO47, SRC_SENSOR, SRC_WEB, SRC_MAX }; + SRC_THERMOSTAT, SRC_CHAT, SRC_TCL, SRC_BERRY, SRC_FILE, SRC_SSERIAL, SRC_USBCONSOLE, SRC_SO47, SRC_SENSOR, SRC_WEB, SRC_TELNET, SRC_MAX }; const char kCommandSource[] PROGMEM = "I|MQTT|Restart|Button|Switch|Backlog|Serial|WebGui|WebCommand|WebConsole|PulseTimer|" "Timer|Rule|MaxPower|MaxEnergy|Overtemp|Light|Knx|Display|Wemo|Hue|Retry|Remote|Shutter|" - "Thermostat|Chat|TCL|Berry|File|SSerial|UsbConsole|SO47|Sensor|Web"; + "Thermostat|Chat|TCL|Berry|File|SSerial|UsbConsole|SO47|Sensor|Web|Telnet"; const uint8_t kDefaultRfCode[9] PROGMEM = { 0x21, 0x16, 0x01, 0x0E, 0x03, 0x48, 0x2E, 0x1A, 0x00 }; diff --git a/tasmota/include/tasmota_configurations.h b/tasmota/include/tasmota_configurations.h index 1260892a0..2a54c1609 100644 --- a/tasmota/include/tasmota_configurations.h +++ b/tasmota/include/tasmota_configurations.h @@ -1005,8 +1005,7 @@ #undef USE_PING #undef USE_AUTOCONF #undef USE_BERRY -//#undef USE_WEBCLIENT -//#undef USE_WEBCLIENT_HTTPS +#undef USE_WEBCLIENT_HTTPS #endif // FIRMWARE_MINICUSTOM @@ -1057,7 +1056,7 @@ #define USE_UFILESYS #define GUI_TRASH_FILE #define GUI_EDIT_FILE - #ifdef ESP8266_4M + #ifdef ESP8266 #ifndef USE_FTP #define USE_FTP #endif @@ -1067,7 +1066,7 @@ #ifndef PW_FTP #define PW_FTP "pass" #endif - #endif // ESP8266_4M + #endif // ESP8266 #define USE_SPI #define USE_SDCARD #define USE_PING diff --git a/tasmota/include/tasmota_configurations_ESP32.h b/tasmota/include/tasmota_configurations_ESP32.h index a9fa66f0a..024d388a2 100644 --- a/tasmota/include/tasmota_configurations_ESP32.h +++ b/tasmota/include/tasmota_configurations_ESP32.h @@ -183,8 +183,6 @@ #define USE_TLS #define USE_WEBSERVER -#define USE_WEBCLIENT -#define USE_WEBCLIENT_HTTPS #undef USE_ESP32_WDT // disable watchdog on SAFEBOOT until more testing is done @@ -211,7 +209,8 @@ #endif #define USE_WEBCAM -#define ENABLE_RTSPSERVER + #define USE_WEBCAM_V2 + #define ENABLE_RTSPSERVER #define USE_SPI #define USE_SDCARD @@ -301,8 +300,6 @@ #undef USE_HOME_ASSISTANT #define USE_TASMOTA_DISCOVERY // Enable Tasmota Discovery support (+2k code) -#define USE_WEBCLIENT_HTTPS - #define USE_I2S #define USE_SPI #define USE_LVGL @@ -508,8 +505,6 @@ #undef USE_HOME_ASSISTANT #define USE_TASMOTA_DISCOVERY // Enable Tasmota Discovery support (+2k code) -#define USE_WEBCLIENT_HTTPS - #define USE_ZIGBEE #define USE_TCP_BRIDGE diff --git a/tasmota/include/tasmota_globals.h b/tasmota/include/tasmota_globals.h index 7c02d9f7f..4d2603e66 100644 --- a/tasmota/include/tasmota_globals.h +++ b/tasmota/include/tasmota_globals.h @@ -47,8 +47,11 @@ extern "C" int startWaveformClockCycles(uint8_t pin, uint32_t highCcys, uint32_t uint32_t runTimeCcys, int8_t alignPhase, uint32_t phaseOffsetCcys, bool autoPwm); extern "C" void setTimer1Callback(uint32_t (*fn)()); #ifdef USE_SERIAL_BRIDGE -void SerialBridgePrintf(PGM_P formatP, ...); +void SerialBridgeWrite(char *line, uint32_t len); #endif +#ifdef USE_TELNET +void TelnetWrite(char *line, uint32_t len); +#endif // USE_TELNET #ifdef USE_INFLUXDB void InfluxDbProcess(bool use_copy = false); #endif diff --git a/tasmota/include/tasmota_template.h b/tasmota/include/tasmota_template.h index 6e49061b6..5bd6f9667 100644 --- a/tasmota/include/tasmota_template.h +++ b/tasmota/include/tasmota_template.h @@ -230,6 +230,8 @@ enum UserSelectablePins { GPIO_TM1640CLK, GPIO_TM1640DIN, // TM1640 (16 x seven-segment LED controler) GPIO_TWAI_TX, GPIO_TWAI_RX, GPIO_TWAI_BO, GPIO_TWAI_CLK, // ESP32 TWAI serial interface GPIO_C8_CO2_5K_TX, GPIO_C8_CO2_5K_RX, // C8-CO2-5K CO2 Sensor + GPIO_V9240_TX, GPIO_V9240_RX, // V9240 serial interface + GPIO_LD2402_TX, GPIO_LD2402_RX, // HLK-LD2402 GPIO_SENSOR_END }; // Error as warning to rethink GPIO usage with max 2045 @@ -506,7 +508,9 @@ const char kSensorNames[] PROGMEM = D_SENSOR_I2C_SER_TX "|" D_SENSOR_I2C_SER_RX "|" D_SENSOR_TM1640_CLK "|" D_SENSOR_TM1640_DIN "|" D_SENSOR_TWAI_TX "|" D_SENSOR_TWAI_RX "|" D_SENSOR_TWAI_BO "|" D_SENSOR_TWAI_CLK "|" - D_SENSOR_C8_CO2_5K_TX "|" D_SENSOR_C8_CO2_5K_RX + D_SENSOR_C8_CO2_5K_TX "|" D_SENSOR_C8_CO2_5K_RX "|" + D_SENSOR_V9240_TX "|" D_SENSOR_V9240_RX "|" + D_SENSOR_LD2402_TX "|" D_SENSOR_LD2402_RX ; const char kSensorNamesFixed[] PROGMEM = @@ -1007,6 +1011,10 @@ const uint16_t kGpioNiceList[] PROGMEM = { AGPIO(GPIO_BL6523_TX), // BL6523 based Watt meter Serial interface AGPIO(GPIO_BL6523_RX), // BL6523 based Watt meter Serial interface #endif +#ifdef USE_V9240 + AGPIO(GPIO_V9240_TX), // Serial V9240 interface + AGPIO(GPIO_V9240_RX), // Serial V9240 interface +#endif #endif // USE_ENERGY_SENSOR /*-------------------------------------------------------------------------------------------*\ @@ -1120,6 +1128,10 @@ const uint16_t kGpioNiceList[] PROGMEM = { AGPIO(GPIO_CM11_TXD), // CM110x Serial interface AGPIO(GPIO_CM11_RXD), // CM110x Serial interface #endif +#ifdef USE_LD2402 + AGPIO(GPIO_LD2402_TX), // HLK-LD2402 Serial interface + AGPIO(GPIO_LD2402_RX), // HLK-LD2402 Serial interface +#endif #ifdef USE_LD2410 AGPIO(GPIO_LD2410_TX), // HLK-LD2410 Serial interface AGPIO(GPIO_LD2410_RX), // HLK-LD2410 Serial interface diff --git a/tasmota/include/tasmota_version.h b/tasmota/include/tasmota_version.h index 94b5bd598..f2661dafd 100644 --- a/tasmota/include/tasmota_version.h +++ b/tasmota/include/tasmota_version.h @@ -22,6 +22,6 @@ #define TASMOTA_SHA_SHORT // Filled by Github sed -const uint32_t TASMOTA_VERSION = 0x0E050000; // 14.5.0.0 +const uint32_t TASMOTA_VERSION = 0x0E060000; // 14.6.0.0 #endif // _TASMOTA_VERSION_H_ diff --git a/tasmota/language/af_AF.h b/tasmota/language/af_AF.h index 98a31b0e3..b9ce56bb7 100644 --- a/tasmota/language/af_AF.h +++ b/tasmota/language/af_AF.h @@ -58,6 +58,7 @@ #define D_AS "as" #define D_AT "at" #define D_AUTO "AUTO" +#define D_AUTO_UPDATE "Auto Update" #define D_BATTERY "Battery" #define D_BATT "Batt" // Short for Battery #define D_BATTERY_CHARGE "Lading" // Battery charge in % @@ -88,6 +89,7 @@ #define D_DEBUG "Ontfout" #define D_DEWPOINT "Dou punt" #define D_DISABLED "Gedeaktiveer" +#define D_DISCONNECTED "Disconnected" #define D_DISTANCE "Afstand" #define D_DNS_SERVER "DNS" #define D_DO "Opgeloste suurstof" @@ -776,6 +778,8 @@ #define D_SENSOR_SDM630_RX "SDM630 Rx" #define D_SENSOR_WE517_TX "WE517 Tx" #define D_SENSOR_WE517_RX "WE517 Rx" +#define D_SENSOR_LD2402_TX "LD2402 Tx" +#define D_SENSOR_LD2402_RX "LD2402 Rx" #define D_SENSOR_LD2410_TX "LD2410 Tx" #define D_SENSOR_LD2410_RX "LD2410 Rx" #define D_SENSOR_LD2410S_TX "LD2410S Tx" @@ -1314,4 +1318,8 @@ #define D_CHARGING "Charging" #define D_CAPACITY "Capacity" +// xnrg_25_v9240.ino +#define D_SENSOR_V9240_TX "V9240 TX" +#define D_SENSOR_V9240_RX "V9240 RX" + #endif // _LANGUAGE_AF_AF_H_ diff --git a/tasmota/language/bg_BG.h b/tasmota/language/bg_BG.h index 51b4f4ac3..8bcf0ed11 100644 --- a/tasmota/language/bg_BG.h +++ b/tasmota/language/bg_BG.h @@ -58,6 +58,7 @@ #define D_AS "като" #define D_AT "at" #define D_AUTO "АВТОМАТИЧНО" +#define D_AUTO_UPDATE "Auto Update" #define D_BATTERY "Battery" #define D_BATT "Бат." // Short for Battery #define D_BATTERY_CHARGE "Charge" // Battery charge in % @@ -88,6 +89,7 @@ #define D_DEBUG "Премахване на дефекти" #define D_DEWPOINT "Температура на оросяване" #define D_DISABLED "Забранено" +#define D_DISCONNECTED "Disconnected" #define D_DISTANCE "Разстояние" #define D_DNS_SERVER "Сървър на DNS" #define D_DO "Разтворен кислород" @@ -776,6 +778,8 @@ #define D_SENSOR_SDM630_RX "SDM630 Rx" #define D_SENSOR_WE517_TX "WE517 Tx" #define D_SENSOR_WE517_RX "WE517 Rx" +#define D_SENSOR_LD2402_TX "LD2402 Tx" +#define D_SENSOR_LD2402_RX "LD2402 Rx" #define D_SENSOR_LD2410_TX "LD2410 Tx" #define D_SENSOR_LD2410_RX "LD2410 Rx" #define D_SENSOR_LD2410S_TX "LD2410S Tx" @@ -1314,4 +1318,10 @@ #define D_CHARGING "Charging" #define D_CAPACITY "Capacity" + +// xnrg_25_v9240.ino +#define D_SENSOR_V9240_TX "V9240 TX" +#define D_SENSOR_V9240_RX "V9240 RX" + + #endif // _LANGUAGE_BG_BG_H_ diff --git a/tasmota/language/ca_AD.h b/tasmota/language/ca_AD.h index 6e9f6f999..61501b131 100644 --- a/tasmota/language/ca_AD.h +++ b/tasmota/language/ca_AD.h @@ -58,6 +58,7 @@ #define D_AS "com" #define D_AT "at" #define D_AUTO "AUTO" +#define D_AUTO_UPDATE "Auto Update" #define D_BATTERY "Battery" #define D_BATT "Bat" // Short for Battery #define D_BATTERY_CHARGE "Charge" // Battery charge in % @@ -88,6 +89,7 @@ #define D_DEBUG "Depuració" #define D_DEWPOINT "Punt de rossada" #define D_DISABLED "Deshabilitat" +#define D_DISCONNECTED "Disconnected" #define D_DISTANCE "Distancia" #define D_DNS_SERVER "Servidor DNS" #define D_DO "Oxígen dissolt" @@ -776,6 +778,8 @@ #define D_SENSOR_SDM630_RX "SDM630 Rx" #define D_SENSOR_WE517_TX "WE517 Tx" #define D_SENSOR_WE517_RX "WE517 Rx" +#define D_SENSOR_LD2402_TX "LD2402 Tx" +#define D_SENSOR_LD2402_RX "LD2402 Rx" #define D_SENSOR_LD2410_TX "LD2410 Tx" #define D_SENSOR_LD2410_RX "LD2410 Rx" #define D_SENSOR_LD2410S_TX "LD2410S Tx" @@ -1314,4 +1318,8 @@ #define D_CHARGING "Charging" #define D_CAPACITY "Capacity" +// xnrg_25_v9240.ino +#define D_SENSOR_V9240_TX "V9240 TX" +#define D_SENSOR_V9240_RX "V9240 RX" + #endif // _LANGUAGE_CA_AD_H_ diff --git a/tasmota/language/cs_CZ.h b/tasmota/language/cs_CZ.h index ddfdbbf6e..ef7f3ef19 100644 --- a/tasmota/language/cs_CZ.h +++ b/tasmota/language/cs_CZ.h @@ -58,6 +58,7 @@ #define D_AS "jako" #define D_AT "at" #define D_AUTO "AUTO" +#define D_AUTO_UPDATE "Auto Update" #define D_BATTERY "Battery" #define D_BATT "Batt" // Short for Battery #define D_BATTERY_CHARGE "Charge" // Battery charge in % @@ -88,6 +89,7 @@ #define D_DEBUG "Debug" #define D_DEWPOINT "Dew point" #define D_DISABLED "Zablokováno" +#define D_DISCONNECTED "Disconnected" #define D_DISTANCE "Distance" #define D_DNS_SERVER "Server DNS" #define D_DO "Disolved Oxygen" @@ -776,6 +778,8 @@ #define D_SENSOR_SDM630_RX "SDM630 Rx" #define D_SENSOR_WE517_TX "WE517 Tx" #define D_SENSOR_WE517_RX "WE517 Rx" +#define D_SENSOR_LD2402_TX "LD2402 Tx" +#define D_SENSOR_LD2402_RX "LD2402 Rx" #define D_SENSOR_LD2410_TX "LD2410 Tx" #define D_SENSOR_LD2410_RX "LD2410 Rx" #define D_SENSOR_LD2410S_TX "LD2410S Tx" @@ -1314,4 +1318,8 @@ #define D_CHARGING "Charging" #define D_CAPACITY "Capacity" +// xnrg_25_v9240.ino +#define D_SENSOR_V9240_TX "V9240 TX" +#define D_SENSOR_V9240_RX "V9240 RX" + #endif // _LANGUAGE_CS_CZ_H_ diff --git a/tasmota/language/de_DE.h b/tasmota/language/de_DE.h index c1ea4dd30..f00f11fcf 100644 --- a/tasmota/language/de_DE.h +++ b/tasmota/language/de_DE.h @@ -58,6 +58,7 @@ #define D_AS "als" #define D_AT "an" #define D_AUTO "AUTO" +#define D_AUTO_UPDATE "Auto Update" #define D_BATTERY "Batterie" #define D_BATT "Batt" // Short for Battery #define D_BATTERY_CHARGE "Ladung" // Battery charge in % @@ -88,6 +89,7 @@ #define D_DEBUG "debug" #define D_DEWPOINT "Taupunkt" #define D_DISABLED "deaktiviert" +#define D_DISCONNECTED "Disconnected" #define D_DISTANCE "Abstand" #define D_DNS_SERVER "DNS-Server" #define D_DO "gelöster Sauerstoff" @@ -776,6 +778,8 @@ #define D_SENSOR_SDM630_RX "SDM630 Rx" #define D_SENSOR_WE517_TX "WE517 Tx" #define D_SENSOR_WE517_RX "WE517 Rx" +#define D_SENSOR_LD2402_TX "LD2402 Tx" +#define D_SENSOR_LD2402_RX "LD2402 Rx" #define D_SENSOR_LD2410_TX "LD2410 Tx" #define D_SENSOR_LD2410_RX "LD2410 Rx" #define D_SENSOR_LD2410S_TX "LD2410S Tx" @@ -1314,4 +1318,8 @@ #define D_CHARGING "Aufladen" #define D_CAPACITY "Kapazität" +// xnrg_25_v9240.ino +#define D_SENSOR_V9240_TX "V9240 TX" +#define D_SENSOR_V9240_RX "V9240 RX" + #endif // _LANGUAGE_DE_DE_H_ diff --git a/tasmota/language/el_GR.h b/tasmota/language/el_GR.h index 5eeecb716..0521ed281 100644 --- a/tasmota/language/el_GR.h +++ b/tasmota/language/el_GR.h @@ -58,6 +58,7 @@ #define D_AS "ως" #define D_AT "at" #define D_AUTO "ΑΥΤΟΜΑΤΟ" +#define D_AUTO_UPDATE "Auto Update" #define D_BATTERY "Battery" #define D_BATT "Batt" // Short for Battery #define D_BATTERY_CHARGE "Charge" // Battery charge in % @@ -88,6 +89,7 @@ #define D_DEBUG "Debug" #define D_DEWPOINT "Dew point" #define D_DISABLED "Ανενεργό" +#define D_DISCONNECTED "Disconnected" #define D_DISTANCE "Απόσταση" #define D_DNS_SERVER "Διακομιστής DNS" #define D_DO "Disolved Oxygen" @@ -776,6 +778,8 @@ #define D_SENSOR_SDM630_RX "SDM630 Rx" #define D_SENSOR_WE517_TX "WE517 Tx" #define D_SENSOR_WE517_RX "WE517 Rx" +#define D_SENSOR_LD2402_TX "LD2402 Tx" +#define D_SENSOR_LD2402_RX "LD2402 Rx" #define D_SENSOR_LD2410_TX "LD2410 Tx" #define D_SENSOR_LD2410_RX "LD2410 Rx" #define D_SENSOR_LD2410S_TX "LD2410S Tx" @@ -1314,4 +1318,8 @@ #define D_CHARGING "Charging" #define D_CAPACITY "Capacity" +// xnrg_25_v9240.ino +#define D_SENSOR_V9240_TX "V9240 TX" +#define D_SENSOR_V9240_RX "V9240 RX" + #endif // _LANGUAGE_EL_GR_H_ diff --git a/tasmota/language/en_GB.h b/tasmota/language/en_GB.h index 43fc302aa..ede817f25 100644 --- a/tasmota/language/en_GB.h +++ b/tasmota/language/en_GB.h @@ -58,6 +58,7 @@ #define D_AS "as" #define D_AT "at" #define D_AUTO "AUTO" +#define D_AUTO_UPDATE "Auto Update" #define D_BATTERY "Battery" #define D_BATT "Batt" // Short for Battery #define D_BATTERY_CHARGE "Charge" // Battery charge in % @@ -88,6 +89,7 @@ #define D_DEBUG "Debug" #define D_DEWPOINT "Dew point" #define D_DISABLED "Disabled" +#define D_DISCONNECTED "Disconnected" #define D_DISTANCE "Distance" #define D_DNS_SERVER "DNS Server" #define D_DO "Disolved Oxygen" @@ -776,6 +778,8 @@ #define D_SENSOR_SDM630_RX "SDM630 Rx" #define D_SENSOR_WE517_TX "WE517 Tx" #define D_SENSOR_WE517_RX "WE517 Rx" +#define D_SENSOR_LD2402_TX "LD2402 Tx" +#define D_SENSOR_LD2402_RX "LD2402 Rx" #define D_SENSOR_LD2410_TX "LD2410 Tx" #define D_SENSOR_LD2410_RX "LD2410 Rx" #define D_SENSOR_LD2410S_TX "LD2410S Tx" @@ -1315,4 +1319,8 @@ #define D_CHARGING "Charging" #define D_CAPACITY "Capacity" +// xnrg_25_v9240.ino +#define D_SENSOR_V9240_TX "V9240 TX" +#define D_SENSOR_V9240_RX "V9240 RX" + #endif // _LANGUAGE_EN_GB_H_ diff --git a/tasmota/language/es_ES.h b/tasmota/language/es_ES.h index 4c243c834..d59695f99 100644 --- a/tasmota/language/es_ES.h +++ b/tasmota/language/es_ES.h @@ -58,6 +58,7 @@ #define D_AS "como" #define D_AT "at" #define D_AUTO "AUTO" +#define D_AUTO_UPDATE "Auto Update" #define D_BATTERY "Battery" #define D_BATT "Bat" // Short for Battery #define D_BATTERY_CHARGE "Charge" // Battery charge in % @@ -88,6 +89,7 @@ #define D_DEBUG "Debug" #define D_DEWPOINT "Punto de Rocío" #define D_DISABLED "Deshabilitado" +#define D_DISCONNECTED "Disconnected" #define D_DISTANCE "Distancia" #define D_DNS_SERVER "Servidor DNS" #define D_DO "Oxígeno Disuelto" @@ -776,6 +778,8 @@ #define D_SENSOR_SDM630_RX "SDM630 Rx" #define D_SENSOR_WE517_TX "WE517 Tx" #define D_SENSOR_WE517_RX "WE517 Rx" +#define D_SENSOR_LD2402_TX "LD2402 Tx" +#define D_SENSOR_LD2402_RX "LD2402 Rx" #define D_SENSOR_LD2410_TX "LD2410 Tx" #define D_SENSOR_LD2410_RX "LD2410 Rx" #define D_SENSOR_LD2410S_TX "LD2410S Tx" @@ -1314,4 +1318,8 @@ #define D_CHARGING "Cargando" #define D_CAPACITY "Capacidad" +// xnrg_25_v9240.ino +#define D_SENSOR_V9240_TX "V9240 TX" +#define D_SENSOR_V9240_RX "V9240 RX" + #endif // _LANGUAGE_ES_ES_H_ diff --git a/tasmota/language/fr_FR.h b/tasmota/language/fr_FR.h index b89b5476d..51529ee98 100644 --- a/tasmota/language/fr_FR.h +++ b/tasmota/language/fr_FR.h @@ -58,6 +58,7 @@ #define D_AS "comme" #define D_AT "at" #define D_AUTO "AUTO" +#define D_AUTO_UPDATE "Auto Update" #define D_BATTERY "Battery" #define D_BATT "Batt" // Short for Battery #define D_BATTERY_CHARGE "Charge" // Battery charge in % @@ -88,6 +89,7 @@ #define D_DEBUG "Debug" #define D_DEWPOINT "Point de rosée" #define D_DISABLED "Désactivé" +#define D_DISCONNECTED "Disconnected" #define D_DISTANCE "Distance" #define D_DNS_SERVER "Serveur DNS" #define D_DO "Oxygène dissout" @@ -776,6 +778,8 @@ #define D_SENSOR_SDM630_RX "SDM630 Rx" #define D_SENSOR_WE517_TX "WE517 Tx" #define D_SENSOR_WE517_RX "WE517 Rx" +#define D_SENSOR_LD2402_TX "LD2402 Tx" +#define D_SENSOR_LD2402_RX "LD2402 Rx" #define D_SENSOR_LD2410_TX "LD2410 Tx" #define D_SENSOR_LD2410_RX "LD2410 Rx" #define D_SENSOR_LD2410S_TX "LD2410S Tx" @@ -1315,4 +1319,8 @@ #define D_CHARGING "En charge" #define D_CAPACITY "Capacité" +// xnrg_25_v9240.ino +#define D_SENSOR_V9240_TX "V9240 TX" +#define D_SENSOR_V9240_RX "V9240 RX" + #endif // _LANGUAGE_FR_FR_H_ diff --git a/tasmota/language/fy_NL.h b/tasmota/language/fy_NL.h index b3df21bbb..e381ce01f 100644 --- a/tasmota/language/fy_NL.h +++ b/tasmota/language/fy_NL.h @@ -58,6 +58,7 @@ #define D_AS "als" #define D_AT "at" #define D_AUTO "AUTO" +#define D_AUTO_UPDATE "Auto Update" #define D_BATTERY "Battery" #define D_BATT "Batt" // Short for Battery #define D_BATTERY_CHARGE "Lading" // Battery charge in % @@ -88,6 +89,7 @@ #define D_DEBUG "Debugearje" #define D_DEWPOINT "Dauwpunt" #define D_DISABLED "Útsetten" +#define D_DISCONNECTED "Disconnected" #define D_DISTANCE "Ôfstân" #define D_DNS_SERVER "DNS Server" #define D_DO "Oploste soerstof" @@ -776,6 +778,8 @@ #define D_SENSOR_SDM630_RX "SDM630 Rx" #define D_SENSOR_WE517_TX "WE517 Tx" #define D_SENSOR_WE517_RX "WE517 Rx" +#define D_SENSOR_LD2402_TX "LD2402 Tx" +#define D_SENSOR_LD2402_RX "LD2402 Rx" #define D_SENSOR_LD2410_TX "LD2410 Tx" #define D_SENSOR_LD2410_RX "LD2410 Rx" #define D_SENSOR_LD2410S_TX "LD2410S Tx" @@ -1314,4 +1318,8 @@ #define D_CHARGING "Charging" #define D_CAPACITY "Capacity" +// xnrg_25_v9240.ino +#define D_SENSOR_V9240_TX "V9240 TX" +#define D_SENSOR_V9240_RX "V9240 RX" + #endif // _LANGUAGE_FY_NL_H_ diff --git a/tasmota/language/he_HE.h b/tasmota/language/he_HE.h index 06923f13c..7fee7c024 100644 --- a/tasmota/language/he_HE.h +++ b/tasmota/language/he_HE.h @@ -58,6 +58,7 @@ #define D_AS "-כ" #define D_AT "at" #define D_AUTO "אוטומטי" +#define D_AUTO_UPDATE "Auto Update" #define D_BATTERY "Battery" #define D_BATT "Batt" // Short for Battery #define D_BATTERY_CHARGE "Charge" // Battery charge in % @@ -88,6 +89,7 @@ #define D_DEBUG "באגים" #define D_DEWPOINT "Dew point" #define D_DISABLED "מבוטל" +#define D_DISCONNECTED "Disconnected" #define D_DISTANCE "מרחק" #define D_DNS_SERVER "DNS שרת" #define D_DO "Disolved Oxygen" @@ -776,6 +778,8 @@ #define D_SENSOR_SDM630_RX "SDM630 Rx" #define D_SENSOR_WE517_TX "WE517 Tx" #define D_SENSOR_WE517_RX "WE517 Rx" +#define D_SENSOR_LD2402_TX "LD2402 Tx" +#define D_SENSOR_LD2402_RX "LD2402 Rx" #define D_SENSOR_LD2410_TX "LD2410 Tx" #define D_SENSOR_LD2410_RX "LD2410 Rx" #define D_SENSOR_LD2410S_TX "LD2410S Tx" @@ -1314,4 +1318,8 @@ #define D_CHARGING "Charging" #define D_CAPACITY "Capacity" +// xnrg_25_v9240.ino +#define D_SENSOR_V9240_TX "V9240 TX" +#define D_SENSOR_V9240_RX "V9240 RX" + #endif // _LANGUAGE_HE_HE_H_ diff --git a/tasmota/language/hu_HU.h b/tasmota/language/hu_HU.h index 69962aad5..6a27e71f6 100644 --- a/tasmota/language/hu_HU.h +++ b/tasmota/language/hu_HU.h @@ -58,6 +58,7 @@ #define D_AS "mint" #define D_AT "at" #define D_AUTO "AUTO" +#define D_AUTO_UPDATE "Auto Update" #define D_BATTERY "Battery" #define D_BATT "Batt" // Short for Battery #define D_BATTERY_CHARGE "Charge" // Battery charge in % @@ -88,6 +89,7 @@ #define D_DEBUG "Debug" #define D_DEWPOINT "Harmatpont" #define D_DISABLED "Letiltva" +#define D_DISCONNECTED "Disconnected" #define D_DISTANCE "Távolság" #define D_DNS_SERVER "DNS szerver" #define D_DO "Oldott oxygén" @@ -776,6 +778,8 @@ #define D_SENSOR_SDM630_RX "SDM630 Rx" #define D_SENSOR_WE517_TX "WE517 Tx" #define D_SENSOR_WE517_RX "WE517 Rx" +#define D_SENSOR_LD2402_TX "LD2402 Tx" +#define D_SENSOR_LD2402_RX "LD2402 Rx" #define D_SENSOR_LD2410_TX "LD2410 Tx" #define D_SENSOR_LD2410_RX "LD2410 Rx" #define D_SENSOR_LD2410S_TX "LD2410S Tx" @@ -1321,4 +1325,8 @@ #define D_CHARGING "Charging" #define D_CAPACITY "Capacity" +// xnrg_25_v9240.ino +#define D_SENSOR_V9240_TX "V9240 TX" +#define D_SENSOR_V9240_RX "V9240 RX" + #endif // _LANGUAGE_HU_HU_H_ diff --git a/tasmota/language/it_IT.h b/tasmota/language/it_IT.h index 849b43f37..c0de6a46c 100644 --- a/tasmota/language/it_IT.h +++ b/tasmota/language/it_IT.h @@ -28,7 +28,7 @@ * Use online command StateText to translate ON, OFF, HOLD and TOGGLE. * Use online command Prefix to translate cmnd, stat and tele. * - * Updated until v9.4.0.1 - Last update 31.01.2025 + * Updated until v9.4.0.1 - Last update 12.03.2025 \*********************************************************************/ #define LANGUAGE_MODULE_NAME // Enable to display "Module Generic" (ie Spanish), Disable to display "Generic Module" (ie English) @@ -58,6 +58,7 @@ #define D_AS "come" #define D_AT "in" #define D_AUTO "AUTO" +#define D_AUTO_UPDATE "Aggiornamento automatico" #define D_BATTERY "Batteria" #define D_BATT "Batt" // Short for Battery #define D_BATTERY_CHARGE "Carica" // Battery charge in % @@ -88,6 +89,7 @@ #define D_DEBUG "Debug" #define D_DEWPOINT "Punto rugiada" // #define D_DISABLED "Disabilitato/a" +#define D_DISCONNECTED "Disconnesso" #define D_DISTANCE "Distanza" #define D_DNS_SERVER "Server DNS" #define D_DO "Ossigeno dissolto" @@ -776,6 +778,8 @@ #define D_SENSOR_SDM630_RX "SDM630 - RX" #define D_SENSOR_WE517_TX "WE517 - TX" #define D_SENSOR_WE517_RX "WE517 - RX" +#define D_SENSOR_LD2402_TX "LD2402 - TX" +#define D_SENSOR_LD2402_RX "LD2402 - RX" #define D_SENSOR_LD2410_TX "LD2410 - TX" #define D_SENSOR_LD2410_RX "LD2410 - RX" #define D_SENSOR_LD2410S_TX "LD2410S - TX" @@ -1315,4 +1319,8 @@ #define D_CHARGING "In carica" #define D_CAPACITY "Capacità" +// xnrg_25_v9240.ino +#define D_SENSOR_V9240_TX "V9240 - TX" +#define D_SENSOR_V9240_RX "V9240 - RX" + #endif // _LANGUAGE_IT_IT_H_ diff --git a/tasmota/language/ko_KO.h b/tasmota/language/ko_KO.h index 96daa238c..27204a1d5 100644 --- a/tasmota/language/ko_KO.h +++ b/tasmota/language/ko_KO.h @@ -58,6 +58,7 @@ #define D_AS "as" #define D_AT "at" #define D_AUTO "자동" +#define D_AUTO_UPDATE "Auto Update" #define D_BATTERY "Battery" #define D_BATT "Batt" // Short for Battery #define D_BATTERY_CHARGE "Charge" // Battery charge in % @@ -88,6 +89,7 @@ #define D_DEBUG "디버그" #define D_DEWPOINT "Dew point" #define D_DISABLED "사용안함" +#define D_DISCONNECTED "Disconnected" #define D_DISTANCE "거리" #define D_DNS_SERVER "DNS 서버" #define D_DO "Disolved Oxygen" @@ -776,6 +778,8 @@ #define D_SENSOR_SDM630_RX "SDM630 Rx" #define D_SENSOR_WE517_TX "WE517 Tx" #define D_SENSOR_WE517_RX "WE517 Rx" +#define D_SENSOR_LD2402_TX "LD2402 Tx" +#define D_SENSOR_LD2402_RX "LD2402 Rx" #define D_SENSOR_LD2410_TX "LD2410 Tx" #define D_SENSOR_LD2410_RX "LD2410 Rx" #define D_SENSOR_LD2410S_TX "LD2410S Tx" @@ -1314,4 +1318,8 @@ #define D_CHARGING "Charging" #define D_CAPACITY "Capacity" +// xnrg_25_v9240.ino +#define D_SENSOR_V9240_TX "V9240 TX" +#define D_SENSOR_V9240_RX "V9240 RX" + #endif // _LANGUAGE_KO_KO_H_ diff --git a/tasmota/language/lt_LT.h b/tasmota/language/lt_LT.h index 776b5c140..ffb2488ff 100644 --- a/tasmota/language/lt_LT.h +++ b/tasmota/language/lt_LT.h @@ -44,7 +44,7 @@ #define D_HOUR_MINUTE_SEPARATOR ":" #define D_MINUTE_SECOND_SEPARATOR ":" -#define D_DAY3LIST "SekPirAntTreKetPenŠeŠe" +#define D_DAY3LIST "SekPirAntTreKetPenŠe" #define D_MONTH3LIST "SauVasKovBalGegBirLieRugRgsSpaLapGru" // Non JSON decimal separator @@ -58,6 +58,7 @@ #define D_AS "kaip" #define D_AT "prie" #define D_AUTO "AUTOMATINĖ" +#define D_AUTO_UPDATE "Auto Update" #define D_BATTERY "Baterija" #define D_BATT "Baterija" // Short for Battery #define D_BATTERY_CHARGE "Įkrova" // Battery charge in % @@ -88,6 +89,7 @@ #define D_DEBUG "Derinimas" #define D_DEWPOINT "Rasos taškas" #define D_DISABLED "Išjungta" +#define D_DISCONNECTED "Disconnected" #define D_DISTANCE "Atstumas" #define D_DNS_SERVER "DNS Serveris" #define D_DO "Ištirpęs deguonis" @@ -184,7 +186,7 @@ #define D_TEMPERATURE "Temperatūra" #define D_TO "į" #define D_TOGGLE "Perjungti" -#define D_TOPIC "Topic" +#define D_TOPIC "Tema" #define D_TOTAL_USAGE "Bendras naudojimas" #define D_TRANSMIT "Siųsti" #define D_TRUE "Įjungta" @@ -226,7 +228,7 @@ #define D_SYSLOG_LOGGING_REENABLED "„Syslog“ logging vėl įjungtas" #define D_SET_BAUDRATE_TO "Nustatyti duomenų perdavimo spartą į" -#define D_RECEIVED_TOPIC "Gauta topic" +#define D_RECEIVED_TOPIC "Gauta tema" #define D_DATA_SIZE "Duomenų dydis" #define D_ANALOG_INPUT "Analoginis" @@ -330,7 +332,7 @@ #define D_MQTT_PARAMETERS "MQTT parametrai" #define D_CLIENT "Klientas" -#define D_FULL_TOPIC "Full Topic" +#define D_FULL_TOPIC "Visa tema" #define D_LOGGING_PARAMETERS "Logging parametrai" #define D_SERIAL_LOG_LEVEL "Serijinio log lygis" @@ -376,9 +378,9 @@ #define D_MQTT_PORT "MQTT prievadas" #define D_MQTT_CLIENT "MQTT klientas" #define D_MQTT_USER "MQTT vartotojas" -#define D_MQTT_TOPIC "MQTT topic" -#define D_MQTT_GROUP_TOPIC "MQTT group topic" -#define D_MQTT_FULL_TOPIC "MQTT full topic" +#define D_MQTT_TOPIC "MQTT tema" +#define D_MQTT_GROUP_TOPIC "MQTT grupės tema" +#define D_MQTT_FULL_TOPIC "MQTT visa tema" #define D_MQTT_NO_RETAIN "MQTT No Retain" #define D_MDNS_DISCOVERY "mDNS Discovery" #define D_MDNS_ADVERTISE "mDNS Advertise" @@ -669,7 +671,7 @@ // xsns_86_tfminiplus.ino #define D_SIGNALSTRENGTH "Signalo stiprumas" -#define D_CHIPTEMPERATURE "Lusto Temperature" +#define D_CHIPTEMPERATURE "Lusto temperatūra" // xsns_60_GPS #define D_LATITUDE "Platuma" @@ -776,6 +778,8 @@ #define D_SENSOR_SDM630_RX "SDM630 Rx" #define D_SENSOR_WE517_TX "WE517 Tx" #define D_SENSOR_WE517_RX "WE517 Rx" +#define D_SENSOR_LD2402_TX "LD2402 Tx" +#define D_SENSOR_LD2402_RX "LD2402 Rx" #define D_SENSOR_LD2410_TX "LD2410 Tx" #define D_SENSOR_LD2410_RX "LD2410 Rx" #define D_SENSOR_LD2410S_TX "LD2410S Tx" @@ -1314,4 +1318,8 @@ #define D_CHARGING "Kraunasi" #define D_CAPACITY "Talpa" +// xnrg_34_v9240.ino +#define D_SENSOR_V9240_TX "V9240 TX" +#define D_SENSOR_V9240_RX "V9240 RX" + #endif // _LANGUAGE_LT_LT_H_ diff --git a/tasmota/language/nl_NL.h b/tasmota/language/nl_NL.h index d7b9bc0f0..6e3fcb7f9 100644 --- a/tasmota/language/nl_NL.h +++ b/tasmota/language/nl_NL.h @@ -58,6 +58,7 @@ #define D_AS "als" #define D_AT "at" #define D_AUTO "AUTO" +#define D_AUTO_UPDATE "Auto Update" #define D_BATTERY "Battery" #define D_BATT "Batt" // Short for Battery #define D_BATTERY_CHARGE "Lading" // Battery charge in % @@ -88,6 +89,7 @@ #define D_DEBUG "Debug" #define D_DEWPOINT "Dauwpunt" #define D_DISABLED "Uitgeschakeld" +#define D_DISCONNECTED "Disconnected" #define D_DISTANCE "Afstand" #define D_DNS_SERVER "DNS Server" #define D_DO "Opgelost zuurstof" @@ -776,6 +778,8 @@ #define D_SENSOR_SDM630_RX "SDM630 Rx" #define D_SENSOR_WE517_TX "WE517 Tx" #define D_SENSOR_WE517_RX "WE517 Rx" +#define D_SENSOR_LD2402_TX "LD2402 Tx" +#define D_SENSOR_LD2402_RX "LD2402 Rx" #define D_SENSOR_LD2410_TX "LD2410 Tx" #define D_SENSOR_LD2410_RX "LD2410 Rx" #define D_SENSOR_LD2410S_TX "LD2410S Tx" @@ -1314,4 +1318,8 @@ #define D_CHARGING "Charging" #define D_CAPACITY "Capacity" +// xnrg_25_v9240.ino +#define D_SENSOR_V9240_TX "V9240 TX" +#define D_SENSOR_V9240_RX "V9240 RX" + #endif // _LANGUAGE_NL_NL_H_ diff --git a/tasmota/language/pl_PL.h b/tasmota/language/pl_PL.h index b0e87e711..0bba643ab 100644 --- a/tasmota/language/pl_PL.h +++ b/tasmota/language/pl_PL.h @@ -58,6 +58,7 @@ #define D_AS "jak" #define D_AT "at" #define D_AUTO "AUTO" +#define D_AUTO_UPDATE "Auto Update" #define D_BATTERY "Bateria" #define D_BATT "Bat" // Short for Battery #define D_BATTERY_CHARGE "Ładowanie" // Battery charge in % @@ -88,6 +89,7 @@ #define D_DEBUG "Debug" #define D_DEWPOINT "Punkt rosy" #define D_DISABLED "Wyłączony" +#define D_DISCONNECTED "Disconnected" #define D_DISTANCE "Odległość" #define D_DNS_SERVER "Serwer DNS" #define D_DO "Rozpuszczalność tlenu" @@ -776,6 +778,8 @@ #define D_SENSOR_SDM630_RX "SDM630 Rx" #define D_SENSOR_WE517_TX "WE517 Tx" #define D_SENSOR_WE517_RX "WE517 Rx" +#define D_SENSOR_LD2402_TX "LD2402 Tx" +#define D_SENSOR_LD2402_RX "LD2402 Rx" #define D_SENSOR_LD2410_TX "LD2410 Tx" #define D_SENSOR_LD2410_RX "LD2410 Rx" #define D_SENSOR_LD2410S_TX "LD2410S Tx" @@ -1314,4 +1318,8 @@ #define D_CHARGING "Ładowanie" #define D_CAPACITY "Pojemność" +// xnrg_25_v9240.ino +#define D_SENSOR_V9240_TX "V9240 TX" +#define D_SENSOR_V9240_RX "V9240 RX" + #endif // _LANGUAGE_PL_PL_D_H_ diff --git a/tasmota/language/pt_BR.h b/tasmota/language/pt_BR.h index 8fdb5522a..68002b940 100644 --- a/tasmota/language/pt_BR.h +++ b/tasmota/language/pt_BR.h @@ -58,6 +58,7 @@ #define D_AS "como" #define D_AT "at" #define D_AUTO "Auto" +#define D_AUTO_UPDATE "Auto Update" #define D_BATTERY "Battery" #define D_BATT "Bat" // Short for Battery #define D_BATTERY_CHARGE "Charge" // Battery charge in % @@ -88,6 +89,7 @@ #define D_DEBUG "Depurar" #define D_DEWPOINT "Ponto de orvalho" #define D_DISABLED "Desabilitado" +#define D_DISCONNECTED "Disconnected" #define D_DISTANCE "Distância" #define D_DNS_SERVER "Servidor DNS" #define D_DO "Oxigênio dissolvido" @@ -776,6 +778,8 @@ #define D_SENSOR_SDM630_RX "SDM630 Rx" #define D_SENSOR_WE517_TX "WE517 Tx" #define D_SENSOR_WE517_RX "WE517 Rx" +#define D_SENSOR_LD2402_TX "LD2402 Tx" +#define D_SENSOR_LD2402_RX "LD2402 Rx" #define D_SENSOR_LD2410_TX "LD2410 Tx" #define D_SENSOR_LD2410_RX "LD2410 Rx" #define D_SENSOR_LD2410S_TX "LD2410S Tx" @@ -1314,4 +1318,8 @@ #define D_CHARGING "Charging" #define D_CAPACITY "Capacity" +// xnrg_25_v9240.ino +#define D_SENSOR_V9240_TX "V9240 TX" +#define D_SENSOR_V9240_RX "V9240 RX" + #endif // _LANGUAGE_PT_BR_H_ diff --git a/tasmota/language/pt_PT.h b/tasmota/language/pt_PT.h index 456a63ba3..9b0800b13 100644 --- a/tasmota/language/pt_PT.h +++ b/tasmota/language/pt_PT.h @@ -58,6 +58,7 @@ #define D_AS "como" #define D_AT "at" #define D_AUTO "AUTO" +#define D_AUTO_UPDATE "Auto Update" #define D_BATTERY "Battery" #define D_BATT "Batt" // Short for Battery #define D_BATTERY_CHARGE "Charge" // Battery charge in % @@ -88,6 +89,7 @@ #define D_DEBUG "Depurar" #define D_DEWPOINT "Ponto de Condensação" #define D_DISABLED "Disabilitado" +#define D_DISCONNECTED "Disconnected" #define D_DISTANCE "Distância" #define D_DNS_SERVER "Servidor DNS" #define D_DO "Oxigénio Dissolvido" @@ -776,6 +778,8 @@ #define D_SENSOR_SDM630_RX "SDM630 Rx" #define D_SENSOR_WE517_TX "WE517 Tx" #define D_SENSOR_WE517_RX "WE517 Rx" +#define D_SENSOR_LD2402_TX "LD2402 Tx" +#define D_SENSOR_LD2402_RX "LD2402 Rx" #define D_SENSOR_LD2410_TX "LD2410 Tx" #define D_SENSOR_LD2410_RX "LD2410 Rx" #define D_SENSOR_LD2410S_TX "LD2410S Tx" @@ -1314,4 +1318,8 @@ #define D_CHARGING "Charging" #define D_CAPACITY "Capacity" +// xnrg_25_v9240.ino +#define D_SENSOR_V9240_TX "V9240 TX" +#define D_SENSOR_V9240_RX "V9240 RX" + #endif // _LANGUAGE_PT_PT_H_ diff --git a/tasmota/language/ro_RO.h b/tasmota/language/ro_RO.h index 9a8d8847e..fcd19e50e 100644 --- a/tasmota/language/ro_RO.h +++ b/tasmota/language/ro_RO.h @@ -58,6 +58,7 @@ #define D_AS "as" #define D_AT "at" #define D_AUTO "AUTO" +#define D_AUTO_UPDATE "Auto Update" #define D_BATTERY "Battery" #define D_BATT "Batt" // Short for Battery #define D_BATTERY_CHARGE "Charge" // Battery charge in % @@ -88,6 +89,7 @@ #define D_DEBUG "Depanare" #define D_DEWPOINT "Punct de rouă" #define D_DISABLED "Dezactivat" +#define D_DISCONNECTED "Disconnected" #define D_DISTANCE "Distanță" #define D_DNS_SERVER "Server DNS" #define D_DO "Disolved Oxygen" @@ -776,6 +778,8 @@ #define D_SENSOR_SDM630_RX "SDM630 Rx" #define D_SENSOR_WE517_TX "WE517 Tx" #define D_SENSOR_WE517_RX "WE517 Rx" +#define D_SENSOR_LD2402_TX "LD2402 Tx" +#define D_SENSOR_LD2402_RX "LD2402 Rx" #define D_SENSOR_LD2410_TX "LD2410 Tx" #define D_SENSOR_LD2410_RX "LD2410 Rx" #define D_SENSOR_LD2410S_TX "LD2410S Tx" @@ -1314,4 +1318,8 @@ #define D_CHARGING "Charging" #define D_CAPACITY "Capacity" +// xnrg_25_v9240.ino +#define D_SENSOR_V9240_TX "V9240 TX" +#define D_SENSOR_V9240_RX "V9240 RX" + #endif // _LANGUAGE_RO_RO_H_ diff --git a/tasmota/language/ru_RU.h b/tasmota/language/ru_RU.h index 43cfba06a..df1fa52c8 100644 --- a/tasmota/language/ru_RU.h +++ b/tasmota/language/ru_RU.h @@ -59,6 +59,7 @@ #define D_AS "как" #define D_AT "at" #define D_AUTO "АВТО" +#define D_AUTO_UPDATE "Auto Update" #define D_BATTERY "Battery" #define D_BATT "Batt" // Short for Battery #define D_BATTERY_CHARGE "Charge" // Battery charge in % @@ -89,6 +90,7 @@ #define D_DEBUG "Отладка" #define D_DEWPOINT "Dew point" #define D_DISABLED "Блокирован" +#define D_DISCONNECTED "Disconnected" #define D_DISTANCE "Расстояние" #define D_DNS_SERVER "DNS Сервер" #define D_DO "Disolved Oxygen" @@ -777,6 +779,8 @@ #define D_SENSOR_SDM630_RX "SDM630 Rx" #define D_SENSOR_WE517_TX "WE517 Tx" #define D_SENSOR_WE517_RX "WE517 Rx" +#define D_SENSOR_LD2402_TX "LD2402 Tx" +#define D_SENSOR_LD2402_RX "LD2402 Rx" #define D_SENSOR_LD2410_TX "LD2410 Tx" #define D_SENSOR_LD2410_RX "LD2410 Rx" #define D_SENSOR_LD2410S_TX "LD2410S Tx" @@ -1315,4 +1319,8 @@ #define D_CHARGING "Charging" #define D_CAPACITY "Capacity" +// xnrg_25_v9240.ino +#define D_SENSOR_V9240_TX "V9240 TX" +#define D_SENSOR_V9240_RX "V9240 RX" + #endif // _LANGUAGE_RU_RU_H_ diff --git a/tasmota/language/sk_SK.h b/tasmota/language/sk_SK.h index 57998b8d9..3a62082de 100644 --- a/tasmota/language/sk_SK.h +++ b/tasmota/language/sk_SK.h @@ -58,6 +58,7 @@ #define D_AS "ako" #define D_AT "at" #define D_AUTO "AUTO" +#define D_AUTO_UPDATE "Auto Update" #define D_BATTERY "Battery" #define D_BATT "Batt" // Short for Battery #define D_BATTERY_CHARGE "Charge" // Battery charge in % @@ -90,6 +91,7 @@ #define D_DEBUG "Debug" #define D_DEWPOINT "Dew point" #define D_DISABLED "Zablokované" +#define D_DISCONNECTED "Disconnected" #define D_DISTANCE "Vzdialenosť" #define D_DNS_SERVER "Server DNS" #define D_DO "Disolved Oxygen" @@ -776,6 +778,8 @@ #define D_SENSOR_SDM630_RX "SDM630 Rx" #define D_SENSOR_WE517_TX "WE517 Tx" #define D_SENSOR_WE517_RX "WE517 Rx" +#define D_SENSOR_LD2402_TX "LD2402 Tx" +#define D_SENSOR_LD2402_RX "LD2402 Rx" #define D_SENSOR_LD2410_TX "LD2410 Tx" #define D_SENSOR_LD2410_RX "LD2410 Rx" #define D_SENSOR_LD2410S_TX "LD2410S Tx" @@ -1314,4 +1318,8 @@ #define D_CHARGING "Charging" #define D_CAPACITY "Capacity" +// xnrg_25_v9240.ino +#define D_SENSOR_V9240_TX "V9240 TX" +#define D_SENSOR_V9240_RX "V9240 RX" + #endif // _LANGUAGE_SK_SK_H_ diff --git a/tasmota/language/sv_SE.h b/tasmota/language/sv_SE.h index 338447aea..f21ed90d1 100644 --- a/tasmota/language/sv_SE.h +++ b/tasmota/language/sv_SE.h @@ -58,6 +58,7 @@ #define D_AS "som" #define D_AT "at" #define D_AUTO "AUTO" +#define D_AUTO_UPDATE "Auto Update" #define D_BATTERY "Battery" #define D_BATT "Batt" // Short for Battery #define D_BATTERY_CHARGE "Charge" // Battery charge in % @@ -88,6 +89,7 @@ #define D_DEBUG "Debug" #define D_DEWPOINT "Dew point" #define D_DISABLED "Inaktiverad" +#define D_DISCONNECTED "Disconnected" #define D_DISTANCE "Distans" #define D_DNS_SERVER "DNS-server" #define D_DO "Disolved Oxygen" @@ -776,6 +778,8 @@ #define D_SENSOR_SDM630_RX "SDM630 Rx" #define D_SENSOR_WE517_TX "WE517 Tx" #define D_SENSOR_WE517_RX "WE517 Rx" +#define D_SENSOR_LD2402_TX "LD2402 Tx" +#define D_SENSOR_LD2402_RX "LD2402 Rx" #define D_SENSOR_LD2410_TX "LD2410 Tx" #define D_SENSOR_LD2410_RX "LD2410 Rx" #define D_SENSOR_LD2410S_TX "LD2410S Tx" @@ -1314,4 +1318,8 @@ #define D_CHARGING "Charging" #define D_CAPACITY "Capacity" +// xnrg_25_v9240.ino +#define D_SENSOR_V9240_TX "V9240 TX" +#define D_SENSOR_V9240_RX "V9240 RX" + #endif // _LANGUAGE_SV_SE_H_ diff --git a/tasmota/language/tr_TR.h b/tasmota/language/tr_TR.h index 60ca0cbb0..6795e5e84 100644 --- a/tasmota/language/tr_TR.h +++ b/tasmota/language/tr_TR.h @@ -58,6 +58,7 @@ #define D_AS "as" #define D_AT "at" #define D_AUTO "OTOMATIK" +#define D_AUTO_UPDATE "Auto Update" #define D_BATTERY "Battery" #define D_BATT "Batt" // Short for Battery #define D_BATTERY_CHARGE "Charge" // Battery charge in % @@ -88,6 +89,7 @@ #define D_DEBUG "Hata Ayıklama" #define D_DEWPOINT "Dew point" #define D_DISABLED "Etkin Değil" +#define D_DISCONNECTED "Disconnected" #define D_DISTANCE "Mesage" #define D_DNS_SERVER "DNS Sunucu" #define D_DO "Disolved Oxygen" @@ -776,6 +778,8 @@ #define D_SENSOR_SDM630_RX "SDM630 Rx" #define D_SENSOR_WE517_TX "WE517 Tx" #define D_SENSOR_WE517_RX "WE517 Rx" +#define D_SENSOR_LD2402_TX "LD2402 Tx" +#define D_SENSOR_LD2402_RX "LD2402 Rx" #define D_SENSOR_LD2410_TX "LD2410 Tx" #define D_SENSOR_LD2410_RX "LD2410 Rx" #define D_SENSOR_LD2410S_TX "LD2410S Tx" @@ -1314,4 +1318,8 @@ #define D_CHARGING "Charging" #define D_CAPACITY "Capacity" +// xnrg_25_v9240.ino +#define D_SENSOR_V9240_TX "V9240 TX" +#define D_SENSOR_V9240_RX "V9240 RX" + #endif // _LANGUAGE_TR_TR_H_ diff --git a/tasmota/language/uk_UA.h b/tasmota/language/uk_UA.h index 3ec1df400..f1c49089d 100644 --- a/tasmota/language/uk_UA.h +++ b/tasmota/language/uk_UA.h @@ -58,6 +58,7 @@ #define D_AS "як" #define D_AT "at" #define D_AUTO "АВТО" +#define D_AUTO_UPDATE "Auto Update" #define D_BATTERY "Battery" #define D_BATT "Batt" // Short for Battery #define D_BATTERY_CHARGE "Charge" // Battery charge in % @@ -88,6 +89,7 @@ #define D_DEBUG "Налагодження" #define D_DEWPOINT "Tочка роси" #define D_DISABLED "Вимкнено" +#define D_DISCONNECTED "Disconnected" #define D_DISTANCE "Відстань" #define D_DNS_SERVER "Сервер DNS" #define D_DO "Disolved Oxygen" @@ -776,6 +778,8 @@ #define D_SENSOR_SDM630_RX "SDM630 Rx" #define D_SENSOR_WE517_TX "WE517 Tx" #define D_SENSOR_WE517_RX "WE517 Rx" +#define D_SENSOR_LD2402_TX "LD2402 Tx" +#define D_SENSOR_LD2402_RX "LD2402 Rx" #define D_SENSOR_LD2410_TX "LD2410 Tx" #define D_SENSOR_LD2410_RX "LD2410 Rx" #define D_SENSOR_LD2410S_TX "LD2410S Tx" @@ -1314,4 +1318,9 @@ #define D_CHARGING "Charging" #define D_CAPACITY "Capacity" + +// xnrg_25_v9240.ino +#define D_SENSOR_V9240_TX "V9240 TX" +#define D_SENSOR_V9240_RX "V9240 RX" + #endif // _LANGUAGE_UK_UA_H_ diff --git a/tasmota/language/vi_VN.h b/tasmota/language/vi_VN.h index 97297a248..968cb05b4 100644 --- a/tasmota/language/vi_VN.h +++ b/tasmota/language/vi_VN.h @@ -58,6 +58,7 @@ #define D_AS "với tên gọi" #define D_AT "at" #define D_AUTO "AUTO" +#define D_AUTO_UPDATE "Auto Update" #define D_BATTERY "Battery" #define D_BATT "Batt" // Short for Battery #define D_BATTERY_CHARGE "Charge" // Battery charge in % @@ -88,6 +89,7 @@ #define D_DEBUG "Tìm lỗi" #define D_DEWPOINT "Điểm sương" #define D_DISABLED "Vô hiệu hóa" +#define D_DISCONNECTED "Disconnected" #define D_DISTANCE "Khoảng cách" #define D_DNS_SERVER "Máy chủ DNS" #define D_DO "Disolved Oxygen" @@ -776,6 +778,8 @@ #define D_SENSOR_SDM630_RX "SDM630 Rx" #define D_SENSOR_WE517_TX "WE517 Tx" #define D_SENSOR_WE517_RX "WE517 Rx" +#define D_SENSOR_LD2402_TX "LD2402 Tx" +#define D_SENSOR_LD2402_RX "LD2402 Rx" #define D_SENSOR_LD2410_TX "LD2410 Tx" #define D_SENSOR_LD2410_RX "LD2410 Rx" #define D_SENSOR_LD2410S_TX "LD2410S Tx" @@ -1314,4 +1318,8 @@ #define D_CHARGING "Charging" #define D_CAPACITY "Capacity" +// xnrg_25_v9240.ino +#define D_SENSOR_V9240_TX "V9240 TX" +#define D_SENSOR_V9240_RX "V9240 RX" + #endif // _LANGUAGE_VI_VN_H_ diff --git a/tasmota/language/zh_CN.h b/tasmota/language/zh_CN.h index 065864175..20523c5d5 100644 --- a/tasmota/language/zh_CN.h +++ b/tasmota/language/zh_CN.h @@ -58,6 +58,7 @@ #define D_AS "名称:" #define D_AT "at" #define D_AUTO "自动" +#define D_AUTO_UPDATE "Auto Update" #define D_BATTERY "Battery" #define D_BATT "Batt" // Short for Battery #define D_BATTERY_CHARGE "Charge" // Battery charge in % @@ -88,6 +89,7 @@ #define D_DEBUG "调试" #define D_DEWPOINT "Dew point" #define D_DISABLED "禁用" +#define D_DISCONNECTED "Disconnected" #define D_DISTANCE "距离" #define D_DNS_SERVER "DNS服务器" #define D_DO "Disolved Oxygen" @@ -776,6 +778,8 @@ #define D_SENSOR_SDM630_RX "SDM630 Rx" #define D_SENSOR_WE517_TX "WE517 Tx" #define D_SENSOR_WE517_RX "WE517 Rx" +#define D_SENSOR_LD2402_TX "LD2402 Tx" +#define D_SENSOR_LD2402_RX "LD2402 Rx" #define D_SENSOR_LD2410_TX "LD2410 Tx" #define D_SENSOR_LD2410_RX "LD2410 Rx" #define D_SENSOR_LD2410S_TX "LD2410S Tx" @@ -1314,4 +1318,8 @@ #define D_CHARGING "Charging" #define D_CAPACITY "Capacity" +// xnrg_25_v9240.ino +#define D_SENSOR_V9240_TX "V9240 TX" +#define D_SENSOR_V9240_RX "V9240 RX" + #endif // _LANGUAGE_ZH_CN_H_ diff --git a/tasmota/language/zh_TW.h b/tasmota/language/zh_TW.h index 4bda42c0f..0d96ca41f 100644 --- a/tasmota/language/zh_TW.h +++ b/tasmota/language/zh_TW.h @@ -58,6 +58,7 @@ #define D_AS "名稱:" #define D_AT "at" #define D_AUTO "自動" +#define D_AUTO_UPDATE "Auto Update" #define D_BATTERY "Battery" #define D_BATT "電池" // Short for Battery #define D_BATTERY_CHARGE "Charge" // Battery charge in % @@ -88,6 +89,7 @@ #define D_DEBUG "偵錯" #define D_DEWPOINT "Dew point" #define D_DISABLED "已停用" +#define D_DISCONNECTED "Disconnected" #define D_DISTANCE "距離" #define D_DNS_SERVER "DNS伺服器" #define D_DO "Disolved Oxygen" @@ -776,6 +778,8 @@ #define D_SENSOR_SDM630_RX "SDM630 Rx" #define D_SENSOR_WE517_TX "WE517 Tx" #define D_SENSOR_WE517_RX "WE517 Rx" +#define D_SENSOR_LD2402_TX "LD2402 Tx" +#define D_SENSOR_LD2402_RX "LD2402 Rx" #define D_SENSOR_LD2410_TX "LD2410 Tx" #define D_SENSOR_LD2410_RX "LD2410 Rx" #define D_SENSOR_LD2410S_TX "LD2410S Tx" @@ -1314,4 +1318,8 @@ #define D_CHARGING "Charging" #define D_CAPACITY "Capacity" +// xnrg_25_v9240.ino +#define D_SENSOR_V9240_TX "V9240 TX" +#define D_SENSOR_V9240_RX "V9240 RX" + #endif // _LANGUAGE_ZH_TW_H_ diff --git a/tasmota/lvgl_berry/tasmota_lv_conf.h b/tasmota/lvgl_berry/tasmota_lv_conf.h index 5b80a8dc7..64170fe68 100644 --- a/tasmota/lvgl_berry/tasmota_lv_conf.h +++ b/tasmota/lvgl_berry/tasmota_lv_conf.h @@ -747,10 +747,10 @@ #if LV_USE_THEME_DEFAULT /*0: Light mode; 1: Dark mode*/ - #define LV_THEME_DEFAULT_DARK 0 + #define LV_THEME_DEFAULT_DARK 1 /*1: Enable grow on press*/ - #define LV_THEME_DEFAULT_GROW 1 + #define LV_THEME_DEFAULT_GROW 0 /*Default transition time in [ms]*/ #define LV_THEME_DEFAULT_TRANSITION_TIME 80 diff --git a/tasmota/my_user_config.h b/tasmota/my_user_config.h index 2b7855972..c822571be 100644 --- a/tasmota/my_user_config.h +++ b/tasmota/my_user_config.h @@ -463,9 +463,10 @@ //#define USE_MQTT_TLS // Use TLS for MQTT connection (+34.5k code, +7.0k mem and +4.8k additional during connection handshake) // #define USE_MQTT_TLS_CA_CERT // [DEPRECATED] Now TLS supports dual mode using SetOption132 - this flag is now ignored // #define USE_MQTT_AWS_IOT_LIGHT // Enable MQTT for AWS IoT in light mode, with user/password instead of private certificate -// #define USE_MQTT_AWS_IOT // [Deprecated] Enable MQTT for AWS IoT - requires a private key (+11.9k code, +0.4k mem) - // Note: you need to generate a private key + certificate per device and update 'tasmota/tasmota_aws_iot.cpp' - // Full documentation here: https://github.com/arendst/Tasmota/wiki/AWS-IoT +// #define USE_MQTT_CLIENT_CERT // Enable MQTT with custom client certificate - requires a private key (+11.9k code, +0.4k mem) +// #define USE_MQTT_AWS_IOT // [Deprecated] Enable MQTT for AWS IoT - it includes USE_MQTT_CLIENT_CERT but it forces no user account/password + // Note: you need to generate a private key + certificate per device and update 'tasmota/tasmota_aws_iot.cpp' + // Full documentation here: https://github.com/arendst/Tasmota/wiki/AWS-IoT // for USE_4K_RSA (support for 4096 bits certificates, instead of 2048), you need to uncommend `-DUSE_4K_RSA` in `build_flags` from `platform.ini` or `platform_override.ini` // -- MQTT - TLS - Azure IoT & IoT Central --------- @@ -484,12 +485,25 @@ //#define USE_KNX // Enable KNX IP Protocol Support (+9.4k code, +3k7 mem) #define USE_KNX_WEB_MENU // Enable KNX WEB MENU (+8.3k code, +144 mem) +// -- Telnet -------------------------------------- +//#define USE_TELNET // Add support for telnet (+2k code) +// #define TELNET_BUF_SIZE 256 // [TelnetBuffer] Size of input buffer (default 256) +// #define TELNET_START 1 // [Telnet] Start telnet on network connection (default 0 - No start) +// #define TELNET_PORT 23 // [Telnet] Telnet port (default 23) +// #define TELNET_COL_DISABLE 1 // [TelnetColor] Disable colors (default 0 - Enable colors) +// #define TELNET_COL_PROMPT 33 // [TelnetColor] ANSI color escape code (default 33 - Yellow) +// #define TELNET_COL_RESPONSE 32 // [TelnetColor] ANSI color escape code (default 32 - Green) +// #define TELNET_COL_LOGGING 36 // [TelnetColor] ANSI color escape code (default 36 - Cyan) + +//#define USE_XYZMODEM // Add support for XModem over serial and telnet (+5k code) + // -- HTTP ---------------------------------------- #define USE_WEBSERVER // Enable web server and Wi-Fi Manager (+66k code, +8k mem) #define WEB_PORT 80 // Web server Port for User and Admin mode #define WEB_USERNAME "admin" // Web server Admin mode user name // #define DISABLE_REFERER_CHK // [SetOption128] Disable HTTP API #define USE_ENHANCED_GUI_WIFI_SCAN // Enable Wi-Fi scan output with BSSID (+0k5 code) +// #define USE_ALPINEJS // Enable AlpineJS v2.8.2 (+8k8 code) // #define USE_WEBSEND_RESPONSE // Enable command WebSend response message (+1k code) // #define USE_WEBGETCONFIG // Enable restoring config from external webserver (+0k6) // #define USE_WEBRUN // Enable executing a tasmota command file from external web server (+0.4 code) @@ -899,6 +913,7 @@ //#define USE_VINDRIKTNING // Add support for IKEA VINDRIKTNING particle concentration sensor (+0k6 code) // #define VINDRIKTNING_SHOW_PM1 // Display undocumented/supposed PM1.0 values // #define VINDRIKTNING_SHOW_PM10 // Display undocumented/supposed PM10 values +//#define USE_LD2402 // Add support for HLK-LD2402 24GHz human presence sensor module (+10k9 code, 320 RAM) //#define USE_LD2410 // Add support for HLK-LD2410 24GHz smart wave motion sensor (+3k7 code, 88 RAM) //#define USE_LD2410S // Add support for HLK-LD2410S Ultra Low-power 24GHz smart wave motion sensor (+4k7 code, 144 RAM) //#define USE_LOX_O2 // Add support for LuminOx LOX O2 Sensor (+0k8 code) @@ -949,6 +964,7 @@ // #define IEM3000_IEM3155 // Compatibility fix for Iem3155 (changes Power and Energy total readout) //#define USE_WE517 // Add support for Orno WE517-Modbus energy monitor (+1k code) //#define USE_MODBUS_ENERGY // Add support for generic modbus energy monitor using a user file in rule space (+5k) +//#define USE_V9240 // Add support for Vango Technologies V924x ultralow power, single-phase, power measurement (+12k) // -- Low level interface devices ----------------- #define USE_DHT // Add support for DHT11, AM2301 (DHT21, DHT22, AM2302, AM2321) and SI7021 Temperature and Humidity sensor (1k6 code) @@ -1194,18 +1210,19 @@ #define USE_BERRY_PYTHON_COMPAT // Enable by default `import python_compat` #define USE_BERRY_TIMEOUT 4000 // Timeout in ms, will raise an exception if running time exceeds this timeout #define USE_BERRY_PSRAM // Allocate Berry memory in PSRAM if PSRAM is connected - this might be slightly slower but leaves main memory intact - #define USE_BERRY_IRAM // Allocate some data structures in IRAM (which is ususally unused) when possible and if no PSRAM is available + #define USE_BERRY_IRAM // Allocate some data structures in IRAM (which is usually unused) when possible and if no PSRAM is available #define USE_BERRY_FAST_LOOP_SLEEP_MS 5 // Minimum time in milliseconds to before calling again `tasmota.fast_loop()`, a smaller value will consume more CPU (min 1ms) // #define USE_BERRY_DEBUG // Compile Berry bytecode with line number information, makes exceptions easier to debug. Adds +8% of memory consumption for compiled code // #define UBE_BERRY_DEBUG_GC // Print low-level GC metrics // #define USE_BERRY_INT64 // Add 64 bits integer support (+1.7KB Flash) - #define USE_WEBCLIENT // Enable `webclient` to make HTTP/HTTPS requests. Can be disabled for security reasons. - // #define USE_WEBCLIENT_HTTPS // Enable HTTPS outgoing requests based on BearSSL (much ligher then mbedTLS, 42KB vs 150KB) in insecure mode (no verification of server's certificate) - // Note that only one cipher is enabled: ECDHE_RSA_WITH_AES_128_GCM_SHA256 which is very commonly used and highly secure + #define USE_WEBCLIENT_HTTPS // Enable HTTPS outgoing requests based on BearSSL (much ligher then mbedTLS, 42KB vs 150KB) in insecure mode (no verification of server's certificate) + // Note that only two ciphers are enabled: ECDHE_RSA_WITH_AES_128_GCM_SHA256, ECDHE_ECDSA_WITH_AES_128_GCM_SHA256 #define USE_BERRY_WEBCLIENT_USERAGENT "TasmotaClient" // default user-agent used, can be changed with `wc.set_useragent()` #define USE_BERRY_WEBCLIENT_TIMEOUT 2000 // Default timeout in milliseconds #define USE_BERRY_LEDS_PANEL // Add button to dynamically load the Leds Panel from a bec file online #define USE_BERRY_LEDS_PANEL_URL "http://ota.tasmota.com/tapp/leds_panel.bec" + #define USE_BERRY_LVGL_PANEL // Add button to dynamically load the LVGL Panel from a bec file online + #define USE_BERRY_LVGL_PANEL_URL "http://ota.tasmota.com/tapp/lvgl_panel.bec" //#define USE_BERRY_PARTITION_WIZARD // Add a button to dynamically load the Partion Wizard from a bec file online (+1.3KB Flash) #define USE_BERRY_PARTITION_WIZARD_URL "http://ota.tasmota.com/tapp/partition_wizard.bec" //#define USE_BERRY_GPIOVIEWER // Add a button to dynamocally load the GPIO Viewer from a bec file online @@ -1338,6 +1355,9 @@ #ifdef USE_CONFIG_OVERRIDE #include "user_config_override.h" // Configuration overrides for my_user_config.h #endif +#if defined(USE_MQTT_AWS_IOT) && !defined(USE_MQTT_CLIENT_CERT) + #define USE_MQTT_CLIENT_CERT // USE_MQTT_AWS_IOT requires USE_MQTT_CLIENT_CERT +#endif /*********************************************************************************************\ * Post-process obsoletes @@ -1351,8 +1371,8 @@ * Mutual exclude options \*********************************************************************************************/ -#if defined(ESP8266) && defined(USE_DISCOVERY) && (defined(USE_MQTT_AWS_IOT) || defined(USE_MQTT_AWS_IOT_LIGHT)) - #error "Select either USE_DISCOVERY or USE_MQTT_AWS_IOT, mDNS takes too much code space and is not needed for AWS IoT" +#if defined(ESP8266) && defined(USE_DISCOVERY) && (defined(USE_MQTT_CLIENT_CERT) || defined(USE_MQTT_AWS_IOT_LIGHT)) + #error "Select either USE_DISCOVERY or USE_MQTT_CLIENT_CERT/USE_MQTT_AWS_IOT, mDNS takes too much code space and is not needed for AWS IoT" #endif #if defined(USE_RULES) && defined(USE_SCRIPT) diff --git a/tasmota/tasmota_support/settings.ino b/tasmota/tasmota_support/settings.ino index ff1666bf3..e3d6f2d88 100644 --- a/tasmota/tasmota_support/settings.ino +++ b/tasmota/tasmota_support/settings.ino @@ -1557,7 +1557,7 @@ void SettingsDelta(void) { SettingsUpdateText(SET_STAPWD1, temp41); SettingsUpdateText(SET_STAPWD2, temp42); -#if defined(USE_MQTT_TLS) && defined(USE_MQTT_AWS_IOT) +#if defined(USE_MQTT_TLS) && defined(USE_MQTT_CLIENT_CERT) if (!strlen(Settings->ex_mqtt_user)) { SettingsUpdateText(SET_MQTT_HOST, temp7); SettingsUpdateText(SET_MQTT_USER, temp9); @@ -1567,10 +1567,10 @@ void SettingsDelta(void) { SettingsUpdateText(SET_MQTT_HOST, aws_mqtt_host); SettingsUpdateText(SET_MQTT_USER, ""); } -#else // No USE_MQTT_TLS and USE_MQTT_AWS_IOT +#else // No USE_MQTT_TLS and USE_MQTT_CLIENT_CERT SettingsUpdateText(SET_MQTT_HOST, temp7); SettingsUpdateText(SET_MQTT_USER, temp9); -#endif // USE_MQTT_TLS and USE_MQTT_AWS_IOT +#endif // USE_MQTT_TLS and USE_MQTT_CLIENT_CERT SettingsUpdateText(SET_MQTT_PWD, temp10); SettingsUpdateText(SET_MQTT_TOPIC, temp11); } diff --git a/tasmota/tasmota_support/support.ino b/tasmota/tasmota_support/support.ino index 659bf8b4d..d7cc80ac5 100755 --- a/tasmota/tasmota_support/support.ino +++ b/tasmota/tasmota_support/support.ino @@ -2398,6 +2398,10 @@ void SystemBusyDelayExecute(void) { * \*********************************************************************************************/ +void SetMinimumSeriallog(void) { + TasmotaGlobal.seriallog_level = (Settings->seriallog_level < LOG_LEVEL_INFO) ? (uint8_t)LOG_LEVEL_INFO : Settings->seriallog_level; +} + void SetTasConlog(uint32_t loglevel) { Settings->seriallog_level = loglevel; TasmotaGlobal.seriallog_level = loglevel; @@ -2607,6 +2611,23 @@ bool GetLog(uint32_t req_loglevel, uint32_t* index_p, char** entry_pp, size_t* l return false; } +uint32_t HighestLogLevel(void) { + uint32_t highest_loglevel = TasmotaGlobal.seriallog_level; + if (Settings->seriallog_level > highest_loglevel) { highest_loglevel = Settings->seriallog_level; } + if (Settings->mqttlog_level > highest_loglevel) { highest_loglevel = Settings->mqttlog_level; } +#ifdef USE_WEBSERVER + if (Settings->weblog_level > highest_loglevel) { highest_loglevel = Settings->weblog_level; } +#endif // USE_WEBSERVER +#ifdef USE_UFILESYS + uint32_t filelog_level = Settings->filelog_level % 10; + if (filelog_level > highest_loglevel) { highest_loglevel = filelog_level; } +#endif // USE_UFILESYS + if (TasmotaGlobal.syslog_level > highest_loglevel) { highest_loglevel = TasmotaGlobal.syslog_level; } + if (TasmotaGlobal.templog_level > highest_loglevel) { highest_loglevel = TasmotaGlobal.templog_level; } + if (TasmotaGlobal.uptime < 3) { highest_loglevel = LOG_LEVEL_DEBUG_MORE; } // Log all before setup correct log level + return highest_loglevel; +} + void AddLogData(uint32_t loglevel, const char* log_data, const char* log_data_payload = nullptr, const char* log_data_retained = nullptr) { // Ignore any logging when maxlog_level = 0 OR logging for levels equal or lower than maxlog_level if (!TasmotaGlobal.maxlog_level || (loglevel > TasmotaGlobal.maxlog_level)) { return; } @@ -2640,23 +2661,11 @@ void AddLogData(uint32_t loglevel, const char* log_data, const char* log_data_pa if ((loglevel <= TasmotaGlobal.seriallog_level) && (TasmotaGlobal.masterlog_level <= TasmotaGlobal.seriallog_level)) { TasConsole.printf("%s%s%s%s\r\n", mxtime, log_data, log_data_payload, log_data_retained); -#ifdef USE_SERIAL_BRIDGE - SerialBridgePrintf("%s%s%s%s\r\n", mxtime, log_data, log_data_payload, log_data_retained); -#endif // USE_SERIAL_BRIDGE } if (!TasmotaGlobal.log_buffer) { return; } // Leave now if there is no buffer available - uint32_t highest_loglevel = Settings->weblog_level; - if (Settings->mqttlog_level > highest_loglevel) { highest_loglevel = Settings->mqttlog_level; } -#ifdef USE_UFILESYS - uint32_t filelog_level = Settings->filelog_level % 10; - if (filelog_level > highest_loglevel) { highest_loglevel = filelog_level; } -#endif // USE_UFILESYS - if (TasmotaGlobal.syslog_level > highest_loglevel) { highest_loglevel = TasmotaGlobal.syslog_level; } - if (TasmotaGlobal.templog_level > highest_loglevel) { highest_loglevel = TasmotaGlobal.templog_level; } - if (TasmotaGlobal.uptime < 3) { highest_loglevel = LOG_LEVEL_DEBUG_MORE; } // Log all before setup correct log level - + uint32_t highest_loglevel = HighestLogLevel(); if ((loglevel <= highest_loglevel) && // Log only when needed (TasmotaGlobal.masterlog_level <= highest_loglevel)) { // Delimited, zero-terminated buffer of log lines. @@ -2673,41 +2682,45 @@ void AddLogData(uint32_t loglevel, const char* log_data, const char* log_data_pa log_data_payload = empty; log_data_retained = empty; } + log_data_len = strlen(mxtime) + strlen(log_data) + strlen(log_data_payload) + strlen(log_data_retained); TasmotaGlobal.log_buffer_pointer &= 0xFF; if (!TasmotaGlobal.log_buffer_pointer) { TasmotaGlobal.log_buffer_pointer++; // Index 0 is not allowed as it is the end of char string } while (TasmotaGlobal.log_buffer_pointer == TasmotaGlobal.log_buffer[0] || // If log already holds the next index, remove it - strlen(TasmotaGlobal.log_buffer) + strlen(log_data) + strlen(log_data_payload) + strlen(log_data_retained) + strlen(mxtime) + 4 > LOG_BUFFER_SIZE) // 4 = log_buffer_pointer + '\1' + '\0' - { + strlen(TasmotaGlobal.log_buffer) + log_data_len +4 > LOG_BUFFER_SIZE) { // 4 = log_buffer_pointer + '\1' + '\0' char* it = TasmotaGlobal.log_buffer; it++; // Skip log_buffer_pointer it += strchrspn(it, '\1'); // Skip log line it++; // Skip delimiting "\1" memmove(TasmotaGlobal.log_buffer, it, LOG_BUFFER_SIZE -(it-TasmotaGlobal.log_buffer)); // Move buffer forward to remove oldest log line } - snprintf_P(TasmotaGlobal.log_buffer, LOG_BUFFER_SIZE, PSTR("%s%c%c%s%s%s%s\1"), - TasmotaGlobal.log_buffer, TasmotaGlobal.log_buffer_pointer++, '0'+loglevel, mxtime, log_data, log_data_payload, log_data_retained); + char *log_line = TasmotaGlobal.log_buffer + strlen(TasmotaGlobal.log_buffer); // Ponter to next entry + snprintf_P(log_line, log_data_len +4, PSTR("%c%c%s%s%s%s\1"), + TasmotaGlobal.log_buffer_pointer++, '0'+loglevel, mxtime, log_data, log_data_payload, log_data_retained); if (too_long) { free(too_long); } TasmotaGlobal.log_buffer_pointer &= 0xFF; if (!TasmotaGlobal.log_buffer_pointer) { TasmotaGlobal.log_buffer_pointer++; // Index 0 is not allowed as it is the end of char string } - } -} -uint32_t HighestLogLevel() { - uint32_t highest_loglevel = TasmotaGlobal.seriallog_level; - if (Settings->weblog_level > highest_loglevel) { highest_loglevel = Settings->weblog_level; } - if (Settings->mqttlog_level > highest_loglevel) { highest_loglevel = Settings->mqttlog_level; } -#ifdef USE_UFILESYS - if (Settings->filelog_level > highest_loglevel) { highest_loglevel = Settings->filelog_level; } -#endif // USE_UFILESYS - if (TasmotaGlobal.syslog_level > highest_loglevel) { highest_loglevel = TasmotaGlobal.syslog_level; } - if (TasmotaGlobal.templog_level > highest_loglevel) { highest_loglevel = TasmotaGlobal.templog_level; } - if (TasmotaGlobal.uptime < 3) { highest_loglevel = LOG_LEVEL_DEBUG_MORE; } // Log all before setup correct log level - return highest_loglevel; + // These calls fail to show initial logging + log_line += 2; // Skip log_buffer_pointer and loglevel +#ifdef USE_SERIAL_BRIDGE + if (loglevel <= TasmotaGlobal.seriallog_level) { + SerialBridgeWrite(log_line, log_data_len); + } +#endif // USE_SERIAL_BRIDGE +#ifdef USE_TELNET +#ifdef ESP32 + if (loglevel <= TasmotaGlobal.seriallog_level) { + TelnetWrite(log_line, log_data_len); // This uses too much heap on ESP8266 + } +#endif // ESP32 +#endif // USE_TELNET + + } } void AddLog(uint32_t loglevel, PGM_P formatP, ...) { @@ -2721,7 +2734,6 @@ void AddLog(uint32_t loglevel, PGM_P formatP, ...) { } #endif uint32_t highest_loglevel = HighestLogLevel(); - // If no logging is requested then do not access heap to fight fragmentation if ((loglevel <= highest_loglevel) && (TasmotaGlobal.masterlog_level <= highest_loglevel)) { va_list arg; diff --git a/tasmota/tasmota_support/support_command.ino b/tasmota/tasmota_support/support_command.ino index cf6ba7c7b..1c28dc2f6 100644 --- a/tasmota/tasmota_support/support_command.ino +++ b/tasmota/tasmota_support/support_command.ino @@ -1823,48 +1823,88 @@ void CmndModules(void) ResponseJsonEndEnd(); } -void CmndGpio(void) -{ +bool GpioSensorType(uint32_t gpio, uint32_t sensor_type) { + myio template_gp; + TemplateGpios(&template_gp); + if (ValidGPIO(gpio, template_gp.io[gpio])) { + for (uint32_t i = 0; i < nitems(kGpioNiceList); i++) { + uint32_t midx = pgm_read_word(&kGpioNiceList[i]); + uint32_t max_midx = ((midx & 0x001F) > 0) ? midx : midx +1; + if ((sensor_type >= (midx & 0xFFE0)) && (sensor_type < max_midx)) { + for (uint32_t j = 0; j < nitems(Settings->my_gp.io); j++) { + if (ValidGPIO(j, template_gp.io[j]) && (Settings->my_gp.io[j] == XdrvMailbox.payload)) { + Settings->my_gp.io[j] = GPIO_NONE; + } + } + Settings->my_gp.io[gpio] = sensor_type; + return true; + } + } + } + return false; +} + +void CmndGpio(void) { + // Gpio - Show all GPIOs available in module like {"GPIO0":{"None":0},"GPIO1":{"None":0},"GPIO2":{"Relay1":224},... + // Gpio 1 - Show all GPIOs available in module like {"GPIO":[[0,0,"None"],[1,0,"None"],[2,224,"Relay1"],... + // Gpio 2 - Show all GPIOs available in module like {"GPIO":[[0,0],[1,0],[2,224],... + // Gpio 3 - Show all GPIOs available in module like {"GPIO":[0,0,224,... + // Gpio 10 - Show configured GPIOs in module like {"GPIO2":{"Relay1":224},... + // Gpio 11 - Show configured GPIOs in module like {"GPIO":[[2,224,"Relay1"],... + // Gpio 12 - Show configured GPIOs in module like {"GPIO":[[2,224],... + // Gpio 255 - Show all GPIOs available in template configuration + // Gpio2 224 - Set a single GPIO. GPIO2 as Relay1 + // Gpio {"GPIO":[32,0,448,0,224,225,0,0,0,1792,1824,0,0,0]} - Set all module GPIOs if (XdrvMailbox.index < nitems(Settings->my_gp.io)) { myio template_gp; TemplateGpios(&template_gp); - if (ValidGPIO(XdrvMailbox.index, template_gp.io[XdrvMailbox.index]) && (XdrvMailbox.payload >= 0) && (XdrvMailbox.payload < AGPIO(GPIO_SENSOR_END))) { - bool present = false; - for (uint32_t i = 0; i < nitems(kGpioNiceList); i++) { - uint32_t midx = pgm_read_word(&kGpioNiceList[i]); - uint32_t max_midx = ((midx & 0x001F) > 0) ? midx : midx +1; - if ((XdrvMailbox.payload >= (midx & 0xFFE0)) && (XdrvMailbox.payload < max_midx)) { - present = true; - break; - } - } - if (present) { - for (uint32_t i = 0; i < nitems(Settings->my_gp.io); i++) { - if (ValidGPIO(i, template_gp.io[i]) && (Settings->my_gp.io[i] == XdrvMailbox.payload)) { - Settings->my_gp.io[i] = GPIO_NONE; - } - } - Settings->my_gp.io[XdrvMailbox.index] = XdrvMailbox.payload; + if (strchr(XdrvMailbox.data, '{') == nullptr) { // If no JSON it must be parameter + // Gpio2 224 + if (XdrvMailbox.usridx && GpioSensorType(XdrvMailbox.index, XdrvMailbox.payload)) { TasmotaGlobal.restart_flag = 2; } + } else { + // Gpio {"GPIO":[32,0,448,0,224,225,0,0,0,1792,1824,0,0,0]} + uint32_t arr_index = 0; + JsonParser parser((char*) XdrvMailbox.data); + JsonParserObject root = parser.getRootObject(); + if (root) { + JsonParserArray arr = root[PSTR(D_JSON_GPIO)]; + if (arr) { + for (uint32_t gpio = 0; gpio < nitems(Settings->my_gp.io); gpio++) { + if (!ValidGPIO(gpio, template_gp.io[gpio])) { continue; } + JsonParserToken val = arr[arr_index++]; + if (!val) { break; } + uint16_t sensor_type = val.getUInt(); + if (GpioSensorType(gpio, sensor_type)) { + TasmotaGlobal.restart_flag = 2; + XdrvMailbox.payload = 3; // Show result as {"GPIO":[32,0,448,0,224,225,0,0,0,1792,1824,0,0,0]} + } + } + } + } } + bool jsflg = false; + bool jsflg1 = false; bool jsflg2 = false; + bool show_sensor_type_only = false; + if ((XdrvMailbox.payload >= 10) && (XdrvMailbox.payload <= 12)) { + XdrvMailbox.payload -= 10; + show_sensor_type_only = true; + } for (uint32_t i = 0; i < nitems(Settings->my_gp.io); i++) { if (ValidGPIO(i, template_gp.io[i]) || ((255 == XdrvMailbox.payload) && !FlashPin(i))) { - if (!jsflg) { - Response_P(PSTR("{")); - } else { - ResponseAppend_P(PSTR(",")); - } - jsflg = true; uint32_t sensor_type = Settings->my_gp.io[i]; if (!ValidGPIO(i, template_gp.io[i])) { sensor_type = template_gp.io[i]; - if (AGPIO(GPIO_USER) == sensor_type) { // A user GPIO equals a not connected (=GPIO_NONE) GPIO here + if (AGPIO(GPIO_USER) == sensor_type) { // A user GPIO equals a not connected (=GPIO_NONE) GPIO here sensor_type = GPIO_NONE; } } + if (show_sensor_type_only && (GPIO_NONE == sensor_type)) { + continue; + } char sindex[4] = { 0 }; uint32_t sensor_name_idx = BGPIO(sensor_type); uint32_t nice_list_search = sensor_type & 0xFFE0; @@ -1880,12 +1920,42 @@ void CmndGpio(void) sensor_name_idx = sensor_name_idx - GPIO_FIX_START -1; sensor_names = kSensorNamesFixed; } - char stemp1[TOPSZ]; - ResponseAppend_P(PSTR("\"" D_CMND_GPIO "%d\":{\"%d\":\"%s%s\"}"), i, sensor_type, GetTextIndexed(stemp1, sizeof(stemp1), sensor_name_idx, sensor_names), sindex); + if ((XdrvMailbox.payload >= 1) && (XdrvMailbox.payload <= 3)) { + if (!jsflg1) { + jsflg1 = true; + Response_P(PSTR("{\"" D_CMND_GPIO "\":[")); + } else { + ResponseAppend_P(PSTR(",")); + } + switch (XdrvMailbox.payload) { + case 1: + char stemp1[TOPSZ]; + ResponseAppend_P(PSTR("[%d,%d,\"%s%s\"]"), i, sensor_type, GetTextIndexed(stemp1, sizeof(stemp1), sensor_name_idx, sensor_names), sindex); + break; + case 2: + ResponseAppend_P(PSTR("[%d,%d]"), i, sensor_type); + break; + case 3: + ResponseAppend_P(PSTR("%d"), sensor_type); + break; + } + } else { + if (!jsflg) { + jsflg = true; + Response_P(PSTR("{")); + } else { + ResponseAppend_P(PSTR(",")); + } + char stemp1[TOPSZ]; + ResponseAppend_P(PSTR("\"" D_CMND_GPIO "%d\":{\"%s%s\":%d}"), i, GetTextIndexed(stemp1, sizeof(stemp1), sensor_name_idx, sensor_names), sindex, sensor_type); + } jsflg2 = true; } } - if (jsflg) { + if (jsflg1) { + ResponseAppend_P(PSTR("]}")); + } + else if (jsflg) { ResponseJsonEnd(); } else { if (!jsflg2) { @@ -1935,7 +2005,7 @@ void ShowGpios(const uint16_t *NiceList, uint32_t size, uint32_t offset, uint32_ } jsflg = true; char stemp1[TOPSZ]; - if ((ResponseAppend_P(PSTR("\"%d\":\"%s\""), ridx, GetTextIndexed(stemp1, sizeof(stemp1), midx, kSensorNames)) > (MAX_LOGSZ - TOPSZ)) || (i == size -1)) { + if ((ResponseAppend_P(PSTR("\"%s\":%d"), GetTextIndexed(stemp1, sizeof(stemp1), midx, kSensorNames), ridx) > (MAX_LOGSZ - TOPSZ)) || (i == size -1)) { ResponseJsonEndEnd(); MqttPublishPrefixTopicRulesProcess_P(RESULT_OR_STAT, XdrvMailbox.command); jsflg = false; @@ -1944,8 +2014,9 @@ void ShowGpios(const uint16_t *NiceList, uint32_t size, uint32_t offset, uint32_ } } -void CmndGpios(void) -{ +void CmndGpios(void) { + // Gpios - Show all compiled supported GPIOs + // Gpio 255 - Show all possible GPIOs uint32_t lines = 1; if (XdrvMailbox.payload == 255) { // DumpConvertTable(); diff --git a/tasmota/tasmota_support/support_features.ino b/tasmota/tasmota_support/support_features.ino index f08d13dea..b92e78451 100644 --- a/tasmota/tasmota_support/support_features.ino +++ b/tasmota/tasmota_support/support_features.ino @@ -943,9 +943,15 @@ constexpr uint32_t feature[] = { #ifdef USE_WIZMOTE 0x00002000 | // xdrv_77_wizmote.ino #endif -// 0x00004000 | // -// 0x00008000 | // -// 0x00010000 | // +#if defined(USE_ENERGY_SENSOR) && defined(USE_V9240) + 0x00004000 | // xnrg_25_v9240.ino +#endif +#ifdef USE_TELNET + 0x00008000 | // xdrv_80_telnet.ino +#endif +#ifdef USE_XYZMODEM + 0x00010000 | // xdrv_120_xyzmodem.ino +#endif // 0x00020000 | // // 0x00040000 | // // 0x00080000 | // diff --git a/tasmota/tasmota_support/support_network.ino b/tasmota/tasmota_support/support_network.ino index 67b218463..eb2739317 100644 --- a/tasmota/tasmota_support/support_network.ino +++ b/tasmota/tasmota_support/support_network.ino @@ -125,3 +125,11 @@ String NetworkUniqueId(void) { unique_id.replace(":", ""); // Full 12 chars MAC address as ID return unique_id; } + +void AddLogServerActive(const char *server) { + AddLog(LOG_LEVEL_INFO, PSTR("%s server active on %s%s with IP address %s"), + server, + NetworkHostname(), + (Mdns.begun) ? PSTR(".local") : "", + IPGetListeningAddressStr().c_str()); +} \ No newline at end of file diff --git a/tasmota/tasmota_support/support_tasmota.ino b/tasmota/tasmota_support/support_tasmota.ino index b42f79a8f..c810f2664 100644 --- a/tasmota/tasmota_support/support_tasmota.ino +++ b/tasmota/tasmota_support/support_tasmota.ino @@ -1774,8 +1774,11 @@ void ArduinoOtaLoop(void) /********************************************************************************************/ -void SerialInput(void) -{ +void SerialInput(void) { +#ifdef USE_XYZMODEM + if (XYZModemActive(TXMP_TASCONSOLE)) { return; } +#endif // USE_XYZMODEM + static uint32_t serial_polling_window = 0; static bool serial_buffer_overrun = false; @@ -1811,6 +1814,12 @@ void SerialInput(void) return; } +/*-------------------------------------------------------------------------------------------*/ + +#ifdef USE_XYZMODEM + if (XYZModemStart(TXMP_TASCONSOLE, TasmotaGlobal.serial_in_byte)) { return; } +#endif // USE_XYZMODEM + /*-------------------------------------------------------------------------------------------*/ if (TasmotaGlobal.serial_in_byte > 127 && !Settings->flag.mqtt_serial_raw) { // Discard binary data above 127 if no raw reception allowed - CMND_SERIALSEND3 @@ -1870,7 +1879,7 @@ void SerialInput(void) if (!Settings->flag.mqtt_serial && (TasmotaGlobal.serial_in_byte == '\n')) { // CMND_SERIALSEND and CMND_SERIALLOG TasmotaGlobal.serial_in_buffer[TasmotaGlobal.serial_in_byte_counter] = 0; // Serial data completed - TasmotaGlobal.seriallog_level = (Settings->seriallog_level < LOG_LEVEL_INFO) ? (uint8_t)LOG_LEVEL_INFO : Settings->seriallog_level; + SetMinimumSeriallog(); if (serial_buffer_overrun) { AddLog(LOG_LEVEL_INFO, PSTR(D_LOG_COMMAND "Serial buffer overrun")); } else { @@ -1923,12 +1932,20 @@ void SerialInput(void) String console_buffer = ""; void TasConsoleInput(void) { +#ifdef USE_XYZMODEM + if (XYZModemActive(TXMP_TASCONSOLE)) { return; } +#endif // USE_XYZMODEM + static bool console_buffer_overrun = false; while (TasConsole.available()) { delay(0); char console_in_byte = TasConsole.read(); +#ifdef USE_XYZMODEM + if (XYZModemStart(TXMP_TASCONSOLE, console_in_byte)) { return; } +#endif // USE_XYZMODEM + if (isprint(console_in_byte)) { // Any char between 32 and 127 if (console_buffer.length() < INPUT_BUFFER_SIZE) { // Add char to string if it still fits console_buffer += console_in_byte; @@ -1937,7 +1954,7 @@ void TasConsoleInput(void) { } } else if (console_in_byte == '\n') { - TasmotaGlobal.seriallog_level = (Settings->seriallog_level < LOG_LEVEL_INFO) ? (uint8_t)LOG_LEVEL_INFO : Settings->seriallog_level; + SetMinimumSeriallog(); if (console_buffer_overrun) { AddLog(LOG_LEVEL_INFO, PSTR(D_LOG_COMMAND "USB buffer overrun")); } else { diff --git a/tasmota/tasmota_support/support_wifi.ino b/tasmota/tasmota_support/support_wifi.ino index 35b07046e..0c0c6f692 100644 --- a/tasmota/tasmota_support/support_wifi.ino +++ b/tasmota/tasmota_support/support_wifi.ino @@ -185,9 +185,9 @@ void WiFiSetSleepMode(void) } */ bool wifi_no_sleep = Settings->flag5.wifi_no_sleep; -#ifdef CONFIG_IDF_TARGET_ESP32C3 - wifi_no_sleep = true; // Temporary patch for IDF4.4, wifi sleeping may cause wifi drops -#endif +//#ifdef CONFIG_IDF_TARGET_ESP32C3 +// wifi_no_sleep = true; // Temporary patch for IDF4.4, wifi sleeping may cause wifi drops +//#endif if (0 == TasmotaGlobal.sleep || wifi_no_sleep) { if (!TasmotaGlobal.wifi_stay_asleep) { WiFiHelper::setSleepMode(WIFI_NONE_SLEEP); // Disable sleep @@ -508,7 +508,7 @@ bool WifiGetIP(IPAddress *ip, bool exclude_ap = false); // Returns only IPv6 global address (no loopback and no link-local) bool WifiGetIPv4(IPAddress *ip) { - uint32_t wifi_uint = (uint32_t) WiFi.localIP(); + uint32_t wifi_uint = (WL_CONNECTED == WiFi.status()) ? (uint32_t)WiFi.localIP() : 0; // See issue #23115 if (ip != nullptr) { *ip = wifi_uint; } return wifi_uint != 0; } diff --git a/tasmota/tasmota_xdrv_driver/xdrv_01_9_webserver.ino b/tasmota/tasmota_xdrv_driver/xdrv_01_9_webserver.ino index 1e743efb5..49ca5cbd5 100644 --- a/tasmota/tasmota_xdrv_driver/xdrv_01_9_webserver.ino +++ b/tasmota/tasmota_xdrv_driver/xdrv_01_9_webserver.ino @@ -69,6 +69,10 @@ const uint16_t HTTP_OTA_RESTART_RECONNECT_TIME = 10000; // milliseconds - Allow #include "./html_uncompressed/HTTP_HEADER1_ES6.h" #endif +#ifdef USE_ALPINEJS +#include "include/alpinejs.h" +#endif // USE_ALPINEJS + const char HTTP_SCRIPT_COUNTER[] PROGMEM = "var cn=180;" // seconds "function u(){" @@ -664,6 +668,9 @@ void StartWebserver(int type) { // Webserver->on(F("/u2"), HTTP_POST, HandleUploadDone, HandleUploadLoop); // this call requires 2 functions so we keep a direct call Webserver->on("/u2", HTTP_POST, HandleUploadDone, HandleUploadLoop); // this call requires 2 functions so we keep a direct call #ifndef FIRMWARE_MINIMAL +#ifdef USE_ALPINEJS + Webserver->on("/alpinejs", HTTP_ANY, HandleAlpinejsRequest); +#endif // USE_ALPINEJS XdrvXsnsCall(FUNC_WEB_ADD_HANDLER); #endif // Not FIRMWARE_MINIMAL @@ -677,8 +684,7 @@ void StartWebserver(int type) { Webserver->begin(); // Web server start } if (Web.state != type) { - AddLog(LOG_LEVEL_INFO, PSTR(D_LOG_HTTP D_WEBSERVER_ACTIVE_ON " %s%s " D_WITH_IP_ADDRESS " %s"), - NetworkHostname(), (Mdns.begun) ? PSTR(".local") : "", IPGetListeningAddressStr().c_str()); + AddLogServerActive(PSTR(D_LOG_HTTP "Web")); TasmotaGlobal.rules_flag.http_init = 1; Web.state = type; } @@ -1933,6 +1939,25 @@ bool HandleRootStatusRefresh(void) { #ifndef FIRMWARE_MINIMAL +#ifdef USE_ALPINEJS +/*********************************************************************************************\ + * Serve AlpineJS 2.8.2 in gzip format + * Content-Encoding: gzip + * Content-Type: text/javascript +\*********************************************************************************************/ + +void HandleAlpinejsRequest(void) { + Webserver->client().flush(); + WSHeaderSend(); + Webserver->sendHeader(F("Content-Encoding"), F("gzip")); + Webserver->sendHeader(F("Vary"), F("Accept-Encoding")); + Webserver->setContentLength(sizeof(alpine_min_js_gz)); + Webserver->send(200, PSTR("text/javascript"), ""); + Webserver->sendContent_P(alpine_min_js_gz, sizeof(alpine_min_js_gz)); + Webserver->client().stop(); +} +#endif // USE_ALPINEJS + /*********************************************************************************************\ * HandleConfiguration \*********************************************************************************************/ diff --git a/tasmota/tasmota_xdrv_driver/xdrv_02_9_mqtt.ino b/tasmota/tasmota_xdrv_driver/xdrv_02_9_mqtt.ino index 97ec2a6ee..8bf74e581 100644 --- a/tasmota/tasmota_xdrv_driver/xdrv_02_9_mqtt.ino +++ b/tasmota/tasmota_xdrv_driver/xdrv_02_9_mqtt.ino @@ -57,7 +57,7 @@ const char kMqttCommands[] PROGMEM = "|" // No prefix D_CMND_MQTTFINGERPRINT "|" #endif D_CMND_MQTTUSER "|" D_CMND_MQTTPASSWORD "|" D_CMND_MQTTKEEPALIVE "|" D_CMND_MQTTTIMEOUT "|" D_CMND_MQTTWIFITIMEOUT "|" -#if defined(USE_MQTT_TLS) && defined(USE_MQTT_AWS_IOT) +#if defined(USE_MQTT_TLS) && defined(USE_MQTT_CLIENT_CERT) D_CMND_TLSKEY "|" #endif #ifdef USE_MQTT_FILE @@ -84,7 +84,7 @@ void (* const MqttCommand[])(void) PROGMEM = { &CmndMqttFingerprint, #endif &CmndMqttUser, &CmndMqttPassword, &CmndMqttKeepAlive, &CmndMqttTimeout, &CmndMqttWifiTimeout, -#if defined(USE_MQTT_TLS) && defined(USE_MQTT_AWS_IOT) +#if defined(USE_MQTT_TLS) && defined(USE_MQTT_CLIENT_CERT) &CmndTlsKey, #endif #ifdef USE_MQTT_FILE @@ -111,7 +111,7 @@ struct MQTT { #ifdef USE_MQTT_TLS // This part of code is necessary to store Private Key and Cert in Flash -#ifdef USE_MQTT_AWS_IOT +#if defined(USE_MQTT_CLIENT_CERT) #include const br_ec_private_key *AWS_IoT_Private_Key = nullptr; @@ -134,7 +134,7 @@ public: tls_dir_t tls_dir; // memory copy of tls_dir from flash -#endif // USE_MQTT_AWS_IOT +#endif // USE_MQTT_CLIENT_CERT // check whether the fingerprint is filled with a single value // Filled with 0x00 = accept any fingerprint and learn it for next time @@ -250,7 +250,7 @@ void MqttInit(void) { static const char * alpn_mqtt = "mqtt"; // needs to be static tlsClient->setALPN(&alpn_mqtt, 1); // need to set alpn to 'mqtt' for AWS IoT } -#ifdef USE_MQTT_AWS_IOT +#if defined(USE_MQTT_CLIENT_CERT) loadTlsDir(); // load key and certificate data from Flash if ((nullptr != AWS_IoT_Private_Key) && (nullptr != AWS_IoT_Client_Certificate)) { tlsClient->setClientECCert(AWS_IoT_Client_Certificate, @@ -818,7 +818,7 @@ void MqttPublishPayloadPrefixTopic_P(uint32_t prefix, const char* subtopic, cons free(romram); // Free 16k heap from 64 bytes MqttPublishPayload(stopic, payload, binary_length, retained); -#if defined(USE_MQTT_AWS_IOT) || defined(USE_MQTT_AWS_IOT_LIGHT) +#if defined(USE_MQTT_CLIENT_CERT) || defined(USE_MQTT_AWS_IOT_LIGHT) if ((prefix > 0) && (Settings->flag4.awsiot_shadow) && (Mqtt.connected)) { // placeholder for SetOptionXX // compute the target topic char *topic = SettingsText(SET_MQTT_TOPIC); @@ -844,7 +844,7 @@ void MqttPublishPayloadPrefixTopic_P(uint32_t prefix, const char* subtopic, cons AddLog(LOG_LEVEL_DEBUG, PSTR(D_LOG_MQTT "Updated shadow: %s"), romram); yield(); // #3313 } -#endif // USE_MQTT_AWS_IOT +#endif // USE_MQTT_CLIENT_CERT } void MqttPublishPayloadPrefixTopic_P(uint32_t prefix, const char* subtopic, const char* payload, uint32_t binary_length) { @@ -1193,19 +1193,21 @@ void MqttReconnect(void) { MqttClient.setClient(EspClient); MqttNonTLSWarning(); } -#ifdef USE_MQTT_AWS_IOT - // re-assign private keys in case it was updated in between +#if defined(USE_MQTT_CLIENT_CERT) + // re-assign private key in case it was updated in between if (Mqtt.mqtt_tls) { if ((nullptr != AWS_IoT_Private_Key) && (nullptr != AWS_IoT_Client_Certificate)) { - // if private key is there, we remove user/pwd - mqtt_user = nullptr; - mqtt_pwd = nullptr; + #ifdef USE_MQTT_AWS_IOT + // if private key is there, we remove user/pwd + mqtt_user = nullptr; + mqtt_pwd = nullptr; + #endif tlsClient->setClientECCert(AWS_IoT_Client_Certificate, AWS_IoT_Private_Key, 0xFFFF /* all usages, don't care */, 0); } } -#endif // USE_MQTT_AWS_IOT +#endif // USE_MQTT_CLIENT_CERT #ifdef USE_MQTT_AZURE_IOT String azureMqtt_password = SettingsText(SET_MQTT_PWD); if (azureMqtt_password.indexOf("SharedAccessSignature") == -1) { @@ -1805,7 +1807,7 @@ void CmndStatusRetain(void) { /*********************************************************************************************\ * TLS private key and certificate - store into Flash \*********************************************************************************************/ -#if defined(USE_MQTT_TLS) && defined(USE_MQTT_AWS_IOT) +#if defined(USE_MQTT_TLS) && defined(USE_MQTT_CLIENT_CERT) #ifdef ESP32 static uint8_t * tls_spi_start = nullptr; diff --git a/tasmota/tasmota_xdrv_driver/xdrv_03_energy.ino b/tasmota/tasmota_xdrv_driver/xdrv_03_energy.ino index aae18311e..b306a87cf 100644 --- a/tasmota/tasmota_xdrv_driver/xdrv_03_energy.ino +++ b/tasmota/tasmota_xdrv_driver/xdrv_03_energy.ino @@ -1537,12 +1537,6 @@ bool Xdrv03(uint32_t function) case FUNC_COMMAND: result = DecodeCommand(kEnergyCommands, EnergyCommand); break; - case FUNC_NETWORK_UP: - XnrgCall(FUNC_NETWORK_UP); - break; - case FUNC_NETWORK_DOWN: - XnrgCall(FUNC_NETWORK_DOWN); - break; case FUNC_ACTIVE: result = true; break; diff --git a/tasmota/tasmota_xdrv_driver/xdrv_03_esp32_energy.ino b/tasmota/tasmota_xdrv_driver/xdrv_03_esp32_energy.ino index 44d6515e3..2510390b0 100644 --- a/tasmota/tasmota_xdrv_driver/xdrv_03_esp32_energy.ino +++ b/tasmota/tasmota_xdrv_driver/xdrv_03_esp32_energy.ino @@ -1947,12 +1947,6 @@ bool Xdrv03(uint32_t function) case FUNC_COMMAND: result = DecodeCommand(kEnergyCommands, EnergyCommand); break; - case FUNC_NETWORK_UP: - XnrgCall(FUNC_NETWORK_UP); - break; - case FUNC_NETWORK_DOWN: - XnrgCall(FUNC_NETWORK_DOWN); - break; case FUNC_ACTIVE: result = true; break; diff --git a/tasmota/tasmota_xdrv_driver/xdrv_04_light.ino b/tasmota/tasmota_xdrv_driver/xdrv_04_light.ino index 203c927b4..0829cd4ee 100644 --- a/tasmota/tasmota_xdrv_driver/xdrv_04_light.ino +++ b/tasmota/tasmota_xdrv_driver/xdrv_04_light.ino @@ -2054,7 +2054,15 @@ uint16_t fadeGamma(uint32_t channel, uint16_t v) { } uint16_t fadeGammaReverse(uint32_t channel, uint16_t vg) { if (isChannelGammaCorrected(channel)) { - return leddGammaReverseFast(vg); + return ledGammaReverseFast(vg); + } else { + return vg; + } +} + +uint16_t fadeEndGammaReverse(uint32_t channel, uint16_t vg) { + if (isChannelGammaCorrected(channel)) { + return ledGammaReverse(vg); } else { return vg; } @@ -2064,7 +2072,7 @@ uint8_t LightGetCurFadeBri(void) { uint8_t max_bri = 0; uint8_t bri_i = 0; for (uint8_t i = 0; i < LST_MAX; i++) { - bri_i = changeUIntScale(fadeGammaReverse(i, Light.fade_cur_10[i]), 4, 1023, 1, 100); + bri_i = changeUIntScale(fadeEndGammaReverse(i, Light.fade_cur_10[i]), 4, 1023, 1, 100); if (bri_i > max_bri) max_bri = bri_i ; } return max_bri; @@ -2125,7 +2133,7 @@ bool LightApplyFade(void) { // did the value chanegd and needs to be applied //Serial.printf("Fade: %d / %d - ", fade_current, Light.fade_duration); for (uint32_t i = 0; i < Light.subtype; i++) { Light.fade_cur_10[i] = fadeGamma(i, - changeUIntScale(fadeGammaReverse(i, fade_current), + changeUIntScale(fade_current, 0, Light.fade_duration, fadeGammaReverse(i, Light.fade_start_10[i]), fadeGammaReverse(i, Light.fade_end_10[i]))); diff --git a/tasmota/tasmota_xdrv_driver/xdrv_04_light_utils.ino b/tasmota/tasmota_xdrv_driver/xdrv_04_light_utils.ino index 0e214b977..3c6fab013 100644 --- a/tasmota/tasmota_xdrv_driver/xdrv_04_light_utils.ino +++ b/tasmota/tasmota_xdrv_driver/xdrv_04_light_utils.ino @@ -59,9 +59,13 @@ const gamma_table_t gamma_table[] = { // don't put in PROGMEM for performance // simplified Gamma table for Fade, cheating a little at low brightness const gamma_table_t gamma_table_fast[] = { - { 384, 192 }, - { 768, 576 }, - { 1023, 1023 }, + { 1, 1 }, + { 312, 58 }, + { 457, 106 }, + { 626, 261 }, + { 762, 450 }, + { 895, 703 }, + { 1023, 1023 }, { 0xFFFF, 0xFFFF } // fail-safe if out of range }; @@ -361,6 +365,6 @@ uint16_t ledGammaFast(uint16_t v) { return ledGamma_internal(v, gamma_table_fast); } -uint16_t leddGammaReverseFast(uint16_t vg) { +uint16_t ledGammaReverseFast(uint16_t vg) { return ledGammaReverse_internal(vg, gamma_table_fast); } diff --git a/tasmota/tasmota_xdrv_driver/xdrv_08_serial_bridge.ino b/tasmota/tasmota_xdrv_driver/xdrv_08_serial_bridge.ino index 0e6bbf279..c3d1842a5 100644 --- a/tasmota/tasmota_xdrv_driver/xdrv_08_serial_bridge.ino +++ b/tasmota/tasmota_xdrv_driver/xdrv_08_serial_bridge.ino @@ -80,6 +80,7 @@ struct { uint32_t polling_window; int in_byte_counter = 0; float temperature; + uint8_t log_index; bool raw = false; } SBridge; @@ -99,31 +100,51 @@ void SetSSerialConfig(uint32_t serial_config) { } } -void SerialBridgePrintf(PGM_P formatP, ...) { +void SerialBridgeWrite(char *line, uint32_t len) { #ifdef USE_SERIAL_BRIDGE_TEE if ((SB_TEE == Settings->sserial_mode) && serial_bridge_buffer) { - va_list arg; - va_start(arg, formatP); - char* data = ext_vsnprintf_malloc_P(formatP, arg); - va_end(arg); - if (data == nullptr) { return; } - -// SerialBridgeSerial->printf(data); // This resolves "MqttClientMask":"DVES_%06X" into "DVES_000002" - SerialBridgeSerial->print(data); // This does not resolve "DVES_%06X" - free(data); + if (0 == SBridge.log_index) { +// SerialBridgeSerial->write("\r\n"); + SerialBridgeGetLog(); + } else { + SerialBridgeSerial->write(line, len); // This does not resolve "DVES_%06X" + SerialBridgeSerial->write("\r\n"); + } } #endif // USE_SERIAL_BRIDGE_TEE } +#ifdef USE_SERIAL_BRIDGE_TEE +bool SerialBridgeGetLog(void) { + bool any_line = false; + if (SB_TEE == Settings->sserial_mode) { + uint32_t index = SBridge.log_index; // Dump log buffer + char* line; + size_t len; + while (GetLog(TasmotaGlobal.seriallog_level, &index, &line, &len)) { + any_line = true; + SBridge.log_index = index; + SerialBridgeWrite(line, len -1); // This does not resolve "DVES_%06X" + } + } + return any_line; +} +#endif // USE_SERIAL_BRIDGE_TEE + /********************************************************************************************/ -void SerialBridgeInput(void) { +void SerialBridgeLoop(void) { +/* +#ifdef USE_SERIAL_BRIDGE_TEE + if (SerialBridgeGetLog()) { return; } +#endif // USE_SERIAL_BRIDGE_TEE +*/ while (SerialBridgeSerial->available()) { yield(); uint8_t serial_in_byte = SerialBridgeSerial->read(); #ifdef USE_SERIAL_BRIDGE_TEE - if (SB_TEE == Settings->sserial_mode) { // CMND_SSERIALSEND9 - Enable logging tee to serialbridge + if (SB_TEE == Settings->sserial_mode) { // CMND_SSERIALSEND9 - Enable logging tee to serialbridge static bool serial_bridge_overrun = false; if (isprint(serial_in_byte)) { // Any char between 32 and 127 @@ -135,7 +156,7 @@ void SerialBridgeInput(void) { } else if (serial_in_byte == '\n') { serial_bridge_buffer[SBridge.in_byte_counter] = 0; // Serial data completed - TasmotaGlobal.seriallog_level = (Settings->seriallog_level < LOG_LEVEL_INFO) ? (uint8_t)LOG_LEVEL_INFO : Settings->seriallog_level; + SetMinimumSeriallog(); if (serial_bridge_overrun) { AddLog(LOG_LEVEL_INFO, PSTR(D_LOG_COMMAND "SSerial buffer overrun")); } else { @@ -274,7 +295,7 @@ void SerialBridgeInit(void) { AddLog(LOG_LEVEL_DEBUG, PSTR("SBR: Serial UART%d"), SerialBridgeSerial->getUart()); #endif SerialBridgeSerial->flush(); - SerialBridgePrintf("\r\n"); +// SerialBridgeWrite((char*)"", 0); } } } @@ -456,7 +477,7 @@ bool Xdrv08(uint32_t function) { switch (function) { case FUNC_LOOP: case FUNC_SLEEP_LOOP: - SerialBridgeInput(); + SerialBridgeLoop(); break; case FUNC_JSON_APPEND: SerialBridgeShow(1); diff --git a/tasmota/tasmota_xdrv_driver/xdrv_10_scripter.ino b/tasmota/tasmota_xdrv_driver/xdrv_10_scripter.ino index 636c163df..6008ec3a5 100755 --- a/tasmota/tasmota_xdrv_driver/xdrv_10_scripter.ino +++ b/tasmota/tasmota_xdrv_driver/xdrv_10_scripter.ino @@ -49,7 +49,7 @@ keywords if then else endif, or, and are better readable for beginners (others m // float = 4, double = 8 bytes -const uint8_t SCRIPT_VERS[2] = {5, 3}; +const uint8_t SCRIPT_VERS[2] = {5, 4}; #define SCRIPT_DEBUG 0 @@ -99,6 +99,9 @@ const uint8_t SCRIPT_VERS[2] = {5, 3}; #define SPI_FLASH_2SEC_SIZE SPI_FLASH_SEC_SIZE*2 +#define UNIX_TS_OFFSET 0 +//1740389573 + #define SCRIPT_EOL '\n' #define SCRIPT_FLOAT_PRECISION 2 #define PMEM_SIZE sizeof(Settings->script_pram) @@ -248,6 +251,10 @@ char *Get_esc_char(char *cp, char *esc_chr); #endif +#ifndef NO_SCRIPT_FATFS_EXT +#undef USE_SCRIPT_FATFS_EXT +#define USE_SCRIPT_FATFS_EXT +#endif #ifdef USE_SCRIPT_TIMER #include @@ -351,7 +358,7 @@ void alt_eeprom_readBytes(uint32_t adr, uint32_t len, uint8_t *buf) { #include -#ifdef TESLA_POWERWALL +#if defined(ESP32) && defined(TESLA_POWERWALL) #include "SSLClient/ESP_SSLClient.h" #include "include/powerwall.h" #endif @@ -949,6 +956,35 @@ uint32_t Script_Find_Vars(char *sp) { return (svars << 16) | numvars; } +// get integer with math +int32_t get_math_intval(char *cp) { + int32_t result = strtol(cp, &cp, 10); + while (*cp) { + while (*cp == ' ') cp++; + if (*cp == SCRIPT_EOL) { break; } + switch (*cp) { + case '+': + cp++; + result += strtol(cp, &cp, 10); + break; + case '-': + cp++; + result -= strtol(cp, &cp, 10); + break; + case '*': + cp++; + result *= strtol(cp, &cp, 10); + break; + case '/': + cp++; + result /= strtol(cp, &cp, 10); + break; + } + } + return result; + //return atoi(cp); +} + // allocates all variables and presets them int16_t Init_Scripter(void) { @@ -1043,6 +1079,8 @@ char *script; glob_script_mem.scriptptr = 0; char init = 0; + uint8_t pflg = 0; + uint16_t pmem = 0; while (1) { // check line // skip leading spaces @@ -1065,10 +1103,12 @@ char *script; lp += 2; if (numperm < SCRIPT_MAXPERM) { vtypes[vars].bits.is_permanent = 1; + pflg = 1; numperm++; } } else { vtypes[vars].bits.is_permanent = 0; + pflg = 0; } if (*lp == 't' && *(lp + 1) == ':') { lp += 2; @@ -1169,9 +1209,11 @@ char *script; op++; } while (*op == ' ') op++; + uint16_t flen = 1; if (isdigit(*op)) { // lenght define follows - uint16_t flen = atoi(op); + //flen = atoi(op); + flen = get_math_intval(op); if (flen > MAX_ARRAY_SIZE) { // limit array size flen = MAX_ARRAY_SIZE; @@ -1179,10 +1221,23 @@ char *script; mfilt[numflt - 1].numvals &= OR_FILT_MASK; mfilt[numflt - 1].numvals |= flen & AND_FILT_MASK; } + if (pflg) { + pmem += sizeof(TS_FLOAT) * flen; + pflg = 0; + } + } else { + if (pflg) { + pmem += sizeof(TS_FLOAT); + pflg = 0; + } } } else { // string vars + if (pflg) { + pmem += glob_script_mem.max_ssize; + pflg = 0; + } op++; *snp_p ++= strings_p; while (*op != '\"') { @@ -1233,6 +1288,10 @@ char *script; fsize += sizeof(struct M_FILT) + ((mfilt[count].numvals & AND_FILT_MASK) - 1) * sizeof(TS_FLOAT); } + if (pmem >= glob_script_mem.script_pram_size) { + return -6; + } + // now copy vars to memory uint32_t script_mem_size = // number and number shadow vars @@ -1346,7 +1405,7 @@ char *script; // variables usage info uint32_t tot_mem = sizeof(glob_script_mem) + glob_script_mem.script_mem_size + glob_script_mem.script_size + index; - AddLog(LOG_LEVEL_INFO, PSTR("SCR: nv=%d, tv=%d, vns=%d, vmem=%d, smem=%d, gmem=%d, tmem=%d "), nvars, svars, index, glob_script_mem.script_mem_size, glob_script_mem.script_size, sizeof(glob_script_mem), tot_mem); + AddLog(LOG_LEVEL_INFO, PSTR("SCR: nv=%d, tv=%d, vns=%d, vmem=%d, smem=%d, gmem=%d, pmem=%d, tmem=%d"), nvars, svars, index, glob_script_mem.script_mem_size, glob_script_mem.script_size, sizeof(glob_script_mem), pmem, tot_mem); // copy string variables char *cp1 = glob_script_mem.glob_snp; @@ -4316,7 +4375,7 @@ extern void W8960_SetGain(uint8_t sel, uint16_t value); } #endif //SCRIPT_GET_HTTPS_JP -#ifdef TESLA_POWERWALL +#if defined(ESP32) && defined(TESLA_POWERWALL) if (!strncmp_XP(lp, XPSTR("gpwl("), 5)) { char *path; //lp = GetStringArgument(lp + 5, OPER_EQU, path, 0); @@ -4952,6 +5011,8 @@ extern void W8960_SetGain(uint8_t sel, uint16_t value); break; #endif // USE_SCRIPT_ONEWIRE +int32_t I2SPlayFile(const char *path, uint32_t decoder_type); + case 'p': if (!strncmp_XP(lp, XPSTR("pin["), 4)) { // raw pin level @@ -4975,7 +5036,8 @@ extern void W8960_SetGain(uint8_t sel, uint16_t value); #if !defined(ESP_IDF_VERSION) || (ESP_IDF_VERSION < ESP_IDF_VERSION_VAL(5,0,0)) Play_mp3(path); #else - I2SPlayMp3(path); + //I2SPlayMp3(path); + I2SPlayFile(path, 1); #endif len++; len = 0; @@ -5782,13 +5844,15 @@ extern void W8960_SetGain(uint8_t sel, uint16_t value); mbp++; crc = 0; } - crc = MBUS_calculateCRC(mbp, mbp[2] + 3, crc); + uint8_t pos = 6; // mbp[2] + 3 + crc = MBUS_calculateCRC(mbp, pos, crc); + //AddLog(LOG_LEVEL_INFO,PSTR("SCR: >> %04x"), crc); if (opts == 1) { - if ((mbp[mbp[2] + 3] != highByte(crc)) || (mbp[mbp[2] + 4] != lowByte(crc))) { + if ((mbp[pos] != highByte(crc)) || (mbp[pos + 1] != lowByte(crc))) { fvar = -2; } } else { - if ((mbp[mbp[2] + 3] != lowByte(crc)) || (mbp[mbp[2] + 4] != highByte(crc))) { + if ((mbp[pos] != lowByte(crc)) || (mbp[pos + 1] != highByte(crc))) { fvar = -2; } } @@ -5823,13 +5887,15 @@ extern void W8960_SetGain(uint8_t sel, uint16_t value); if (nvals > alend) { nvals = alend; } - + TS_FLOAT code = 4; + if (*lp != ')') { + lp = GetNumericArgument(lp, OPER_EQU, &code, 0); + } uint8_t modbus_response[128]; - uint8_t mb_index = 0; modbus_response[mb_index] = addr; mb_index++; - modbus_response[mb_index] = 4; + modbus_response[mb_index] = code; mb_index++; if (mode == 0) { @@ -6031,13 +6097,24 @@ extern void W8960_SetGain(uint8_t sel, uint16_t value); len = 0; goto strexit; } + + #ifdef USE_FEXTRACT if (!strncmp_XP(lp, XPSTR("s2t("), 4)) { lp = GetNumericArgument(lp + 4, OPER_EQU, &fvar, 0); char str[SCRIPT_MAX_SBSIZE]; - s2tstamp(str, SCRIPT_MAX_SBSIZE, fvar, 0); + while (*lp == ' ') lp++; + if (*lp == 'i') { + uint32_t secs = *(uint32_t*)&fvar; + s2tstamp(str, SCRIPT_MAX_SBSIZE, secs, 0); + lp++; + } else { + uint32_t secs = (uint32_t)fvar + (uint32_t)glob_script_mem.epoch_offset; + s2tstamp(str, SCRIPT_MAX_SBSIZE, secs, 0); + } if (sp) strlcpy(sp, str, glob_script_mem.max_ssize); len = 0; + lp++; goto strexit; } #endif // USE_FEXTRACT @@ -6206,7 +6283,14 @@ void tmod_directModeOutput(uint32_t pin); if (!strncmp_XP(lp, XPSTR("tsn("), 4)) { char str[SCRIPT_MAX_SBSIZE]; lp = GetStringArgument(lp + 4, OPER_EQU, str, 0); - fvar = tstamp2l(str); + while (*lp == ' ') lp++; + if (*lp == 'i') { + lp++; + uint32_t result = tstamp2l(str); + fvar = *(float*)&result; + } else { + fvar = tstamp2l(str) - (uint32_t)glob_script_mem.epoch_offset; + } goto nfuncexit; } #endif @@ -6303,7 +6387,11 @@ void tmod_directModeOutput(uint32_t pin); case 6: { TS_FLOAT fvar2; lp = GetNumericArgument(lp, OPER_EQU, &fvar2, gv); +#ifdef USE_WEBCAM_V2 + fvar = 0; +#else fvar = WcSetMotionDetect(fvar2); +#endif } break; /* @@ -7342,7 +7430,7 @@ void Replace_Cmd_Vars(char *srcbuf, uint32_t srcsize, char *dstbuf, uint32_t dst if (*(cp + 1) == '.' || *(cp + 1) == ',') { dsep = *(cp + 1); lzero = *cp & 0xf; - cp+=2; + cp += 2; } dprec = *cp & 0xf; cp++; @@ -7351,7 +7439,7 @@ void Replace_Cmd_Vars(char *srcbuf, uint32_t srcsize, char *dstbuf, uint32_t dst lzero = glob_script_mem.script_lzero; dsep = glob_script_mem.script_sepc; } - if (*cp=='(') { + if (*cp == '(') { // math expression cp++; glob_script_mem.glob_error = 0; @@ -7395,7 +7483,7 @@ void Replace_Cmd_Vars(char *srcbuf, uint32_t srcsize, char *dstbuf, uint32_t dst count += 2; while (*cp != '%') { if (*cp == 0 || *cp == SCRIPT_EOL) { - dstbuf[count+1] = 0; + dstbuf[count + 1] = 0; return; } cp++; @@ -7405,15 +7493,15 @@ void Replace_Cmd_Vars(char *srcbuf, uint32_t srcsize, char *dstbuf, uint32_t dst } } } else { - if (*cp=='\\') { + if (*cp == '\\') { cp++; - if (*cp=='n') { + if (*cp == 'n') { dstbuf[count] = '\n'; - } else if (*cp=='r') { + } else if (*cp == 'r') { dstbuf[count] = '\r'; - } else if (*cp=='\\') { + } else if (*cp == '\\') { dstbuf[count] = '\\'; - } else if (*cp=='#') { + } else if (*cp == '#') { dstbuf[count] = '#'; } else { dstbuf[count] = *cp; @@ -7421,7 +7509,7 @@ void Replace_Cmd_Vars(char *srcbuf, uint32_t srcsize, char *dstbuf, uint32_t dst } else { dstbuf[count] = *cp; } - if (*cp==0) { + if (*cp == 0) { break; } cp++; @@ -10442,7 +10530,11 @@ bool ScriptCommand(void) { *SSIZE_PSTORE = XdrvMailbox.payload; TasmotaGlobal.restart_flag = 2; } - Response_P(PSTR("{\"script buffer\":%d}"), *SSIZE_PSTORE); + uint16_t ssize = *SSIZE_PSTORE; + if (!ssize) { + ssize = UFSYS_SIZE; + } + Response_P(PSTR("{\"script buffer\":%d}"), ssize); serviced = true; #endif #endif @@ -10731,7 +10823,7 @@ void ScriptServeFile82(void) { if (ufsp->exists(cp)) { #endif if (glob_script_mem.download82_busy == true) { - AddLog(LOG_LEVEL_INFO, PSTR("UFS: 82 Download is busy")); + AddLog(LOG_LEVEL_INFO, PSTR(D_LOG_UFS "82 Download is busy")); return; } glob_script_mem.download82_busy = true; @@ -10835,7 +10927,7 @@ int32_t SendFile(char *fname) { #ifdef ESP32 #ifdef USE_DLTASK if (glob_script_mem.script_download_busy == true) { - AddLog(LOG_LEVEL_INFO, PSTR("UFS: Download is busy")); + AddLog(LOG_LEVEL_INFO, PSTR(D_LOG_UFS "Download is busy")); return -1; } glob_script_mem.script_download_busy = true; @@ -11705,6 +11797,7 @@ int32_t web_send_file(char mc, char *fname) { char *web_send_line(char mc, char *lp1) { //char tmp[256]; + char *tmp = (char*)malloc(SCRIPT_WS_LINE_SIZE); if (!tmp) { return 0; @@ -13024,7 +13117,7 @@ int32_t http_req(char *host, char *header, char *request) { #ifdef SCRIPT_GET_HTTPS_JP -#ifdef TESLA_POWERWALL +#if defined(ESP32) && defined(TESLA_POWERWALL) Powerwall powerwall = Powerwall(); int32_t call2pwl(const char *url) { @@ -13682,7 +13775,6 @@ bool Xdrv10(uint32_t function) { //case FUNC_PRE_INIT: //case FUNC_INIT: case FUNC_SETUP_RING1: // We need to setup SCRIPT before call to ScriptLoadSection() - //bitWrite(Settings->rule_enabled, 0, 0); // >>>>>>>>>>> #ifndef NO_SCRIPT_STOP_ON_ERROR bitWrite(Settings->rule_stop, 0, 1); @@ -14022,9 +14114,6 @@ bool Xdrv10(uint32_t function) { WebServer82Loop(); #endif break; - - case FUNC_NETWORK_UP: - break; case FUNC_ACTIVE: result = true; diff --git a/tasmota/tasmota_xdrv_driver/xdrv_120_xyzmodem.ino b/tasmota/tasmota_xdrv_driver/xdrv_120_xyzmodem.ino new file mode 100644 index 000000000..33a636721 --- /dev/null +++ b/tasmota/tasmota_xdrv_driver/xdrv_120_xyzmodem.ino @@ -0,0 +1,1051 @@ +/* + xdrv_120_xyzmodem.ino - XModem support for Tasmota + + SPDX-FileCopyrightText: 2025 Theo Arends + + SPDX-License-Identifier: GPL-3.0-only +*/ + +#ifdef USE_XYZMODEM +/*********************************************************************************************\ + * XModem, XModem/CRC, Xmodem-1k file transfer protocol + * + * Usage: + * Use a tool able supporting XModem file transfer and to connect either using serial or telnet with Tasmota. + * TeraTerm + * SyncTerm + * To start XModem file transfer first execute Tasmota command XSend or XReceive, + * then start tool XModem receive or send. + * + * Commands: + * TeraTerm - Show current selection + * TeraTerm 0 - Disable adding zero after carriage return (0x0D) + * TeraTerm 1 - Enable adding zero after carriage return (0x0D) + * XSend - Send filename + * XSend Settings - Send active settings + * XSend autoexec.bat - Send file autoexec.bat + * XReceive[] [,] - Receive filename with checksum (default CRC) and trim CP/M SUB from end of file (default trim) + * XReceive Settings - Receive and activate settings using CRC (No need for trim1a as it's size is on 128/1024 bytes boundary) + * XReceive autoexec.bat - Receive file autoexec.bat using CRC and trim CP/M SUB from end of file + * XReceive autoexec.bat,0 - Receive file autoexec.bat using CRC and do not trim CP/M SUB from end of file + * XReceive autoexec.bat,1 - Receive file autoexec.bat using CRC and trim CP/M SUB from end of file (default) + * XReceive autoexec.bat,2 - Receive file autoexec.bat using CRC and auto trim CP/M SUB from end of text file + * XReceive2 autoexec.bat - Receive file autoexec.bat using checksum (less secure) + * + * Resource: https://gallium.inria.fr/~doligez/zmodem/ymodem.txt +\*********************************************************************************************/ + +#define XDRV_120 120 + +#define XYZM_SOH 0x01 // Start of 128 byte data +#define XYZM_STX 0x02 // Start of 1024 byte data +#define XYZM_EOT 0x04 +#define XYZM_ACK 0x06 +#define XYZM_BS 0x08 +#define XYZM_LF 0x0a +#define XYZM_CR 0x0d +#define XYZM_NAK 0x15 +#define XYZM_CAN 0x18 +#define XYZM_SUB 0x1a + +// Number of seconds until giving up hope of receiving sync packets from host. +const uint8_t XYZMODEM_SYNC_TIMEOUT = 30; +const uint8_t XYZMODEM_RECV_TIMEOUT_SHORT = 1; // Protocol = 10 seconds +const uint8_t XYZMODEM_RECV_TIMEOUT_LONG = 20; // Protocol = 60 seconds + +// Number of times we try to send a packet to the host until we give up sending.. +const uint8_t XYZMODEM_MAX_RETRY = 4; // Protocol = 10 for total packets to be send. Here retry per packet +// Packet size +const uint8_t XYZMODEM_SOH_PACKET_SIZE = 128; +const uint16_t XYZMODEM_STX_PACKET_SIZE = 1024; +const uint16_t XYZMODEM_FILE_SECTOR_SIZE = 2048; + +enum XTrim1aModes { XYZT_NONE, XYZT_TRIM, XYZT_AUTO }; + +enum XReceiveModes { XYZD_NONE, XYZD_SOH, XYZD_BLK1, XYZD_BLK2, XYZD_DATA }; + +enum XYZFileSteps { XYZM_IDLE, + XYZM_SEND, XYZM_SEOT, XYZM_ACKT, XYZM_COMPLETE, XYZM_ERROR, XYZM_DONE, + XYZM_RECEIVE, XYZM_RCV_START, XYZM_RCV_EOT }; + +enum XReceiveStates { XYZS_OK, XYZS_TIMEOUT, XYZS_EOT, XYZS_CAN, XYZS_OTHER, XYZS_CHECKSUM, XYZS_PACKET, XYZS_FILE }; + +#include + +struct { + TasmotaSerial *serial; + WiFiClient *client; + uint32_t timeout; + uint32_t filepos; + uint32_t packet_no; + uint16_t packet_size; + uint16_t crcBuf; + uint8_t receive_timeout; + uint8_t can_count; + uint8_t nak_count; + uint8_t checksumBuf; + uint8_t protocol; + uint8_t enabled; + uint8_t mode; + uint8_t retry; + bool oldChecksum; + bool teraterm; +} XYZModem; + +struct { + uint32_t size; + int32_t sector_counter; + uint32_t byte_counter; + uint8_t *buffer; + char file_name[48]; + uint8_t step; + uint8_t state; + uint8_t trim1a; + bool file; +} XYZFile; + +/*********************************************************************************************\ + * Low level read and write +\*********************************************************************************************/ + +int XYZModemAvailable(void) { + switch (XYZModem.protocol) { + case TXMP_SERIAL: + return XYZModem.serial->available(); // TasmotaSerial + case TXMP_TASCONSOLE: + return TasConsole.available(); // Serial or TASCONSOLE + case TXMP_TELNET: + return XYZModem.client->available(); // WiFiClient + } + return -1; +} + +int XYZModemRead(void) { + switch (XYZModem.protocol) { + case TXMP_SERIAL: + return XYZModem.serial->read(); + case TXMP_TASCONSOLE: + return TasConsole.read(); + case TXMP_TELNET: + return XYZModem.client->read(); + } + return -1; +} + +size_t XYZModemWrite(uint8_t data) { + switch (XYZModem.protocol) { + case TXMP_SERIAL: + return XYZModem.serial->write(data); + case TXMP_TASCONSOLE: + return TasConsole.write(data); + case TXMP_TELNET: + return XYZModem.client->write(data); + } + return 0; +} + +size_t XYZModemWriteBuf(const uint8_t *buf, size_t size) { + switch (XYZModem.protocol) { + case TXMP_SERIAL: + return XYZModem.serial->write(buf, size); + case TXMP_TASCONSOLE: + return TasConsole.write(buf, size); + case TXMP_TELNET: + return XYZModem.client->write(buf, size); + } + return 0; +} + +/*********************************************************************************************\ + * File or Settings read and write +\*********************************************************************************************/ + +bool XYZModemBufferAlloc(void) { + if (nullptr == XYZFile.buffer) { + // Tradeoff between memory usage and speed (file access is slow) + if (!(XYZFile.buffer = (uint8_t *)malloc(XYZMODEM_FILE_SECTOR_SIZE))) { + return false; // Not enough (memory) space + } + } + return true; +} + +void XYZModemBufferFree(void) { + if (XYZFile.buffer) { + free(XYZFile.buffer); + XYZFile.buffer = nullptr; + } +} + +uint32_t XYZModemFileAvailable(void) { + int available = XYZFile.size - XYZFile.byte_counter; + if (available < 0) { available = 0; } + return available; +} + +int XYZModemFileRead(void) { + // When the source device reaches the last XModem data block, it should be padded to 128 bytes + // of data using SUB (ASCII 0x1A) characters. + int data = XYZM_SUB; + + if (XYZModemFileAvailable()) { + if (XYZFile.file) { +#ifdef USE_UFILESYS + if (!XYZModemBufferAlloc()) { + return -1; // Not enough (memory) space + } + + uint32_t index = XYZFile.byte_counter % XYZMODEM_FILE_SECTOR_SIZE; + int32_t sector = XYZFile.byte_counter / XYZMODEM_FILE_SECTOR_SIZE; + if (sector != XYZFile.sector_counter) { + XYZFile.sector_counter = sector; + File file = ffsp->open(XYZFile.file_name, "r"); + if (file && file.seek(XYZFile.byte_counter)) { + file.read(XYZFile.buffer, XYZMODEM_FILE_SECTOR_SIZE); + file.close(); + } + } + if (XYZFile.byte_counter <= XYZFile.size) { + data = XYZFile.buffer[index]; + } + if (XYZFile.byte_counter == XYZFile.size) { + XYZModemBufferFree(); + } +#endif // USE_UFILESYS + } else { + if (0 == XYZFile.byte_counter) { + XYZFile.size = SettingsConfigBackup(); + if (0 == XYZFile.size) { + return -1; // Not enough (memory) space + } + } + if (XYZFile.byte_counter <= XYZFile.size) { + data = settings_buffer[XYZFile.byte_counter]; + } + if (XYZFile.byte_counter == XYZFile.size) { + SettingsBufferFree(); + } + } + } + XYZFile.byte_counter++; + return data; +} + +/*********************************************************************************************/ + +bool XYZModemFileWrite(const uint8_t *buffer) { + if (XYZFile.file) { // File +#ifdef USE_UFILESYS + if (!XYZModemBufferAlloc()) { + return false; // Not enough (memory) space + } + + // Keep space for mixed 128 and 1k packages + uint32_t max_size = XYZMODEM_FILE_SECTOR_SIZE - XYZMODEM_STX_PACKET_SIZE; + if (nullptr == buffer) { // At EOT + if (XYZFile.trim1a) { + uint32_t eot = XYZFile.sector_counter; // (Auto) trim SUB from text files + while ((eot > 0) && (XYZM_SUB == XYZFile.buffer[--eot])) {} + if (XYZT_AUTO == XYZFile.trim1a) { + if ((XYZM_LF == XYZFile.buffer[eot]) || (XYZM_CR == XYZFile.buffer[eot])) { + eot++; + } + } else { + eot++; + } + XYZFile.byte_counter -= (XYZFile.sector_counter - eot); // Final file size + XYZFile.sector_counter = eot; + } + max_size = 0; // Force flush + } + + if (XYZFile.sector_counter > max_size) { +// AddLog(LOG_LEVEL_DEBUG, PSTR("XMD: Save file size %d,%d"), XYZFile.sector_counter, max_size); + + File file; + if ((XYZFile.byte_counter - XYZFile.sector_counter) <= XYZFile.sector_counter) { + ffsp->remove(XYZFile.file_name); + file = ffsp->open(XYZFile.file_name, "w"); + } else { + file = ffsp->open(XYZFile.file_name, "a"); + } + if (file) { + size_t size = 0; + if (UfsFree() > 7) { // Fix ESP32 file.write() not detecting filesystem full + size = file.write(XYZFile.buffer, XYZFile.sector_counter); + } + file.close(); + if (size != XYZFile.sector_counter) { + return false; // File write error - disk full + } + } else { + return false; // Unable to open file + } + XYZFile.sector_counter = 0; + } + + if (buffer) { // Add receive buffer to file save buffer + memcpy(XYZFile.buffer + XYZFile.sector_counter, buffer, XYZModem.packet_size); + XYZFile.sector_counter += XYZModem.packet_size; + } +#endif // USE_UFILESYS + } else { // Settings + uint32_t index = XYZFile.byte_counter - XYZModem.packet_size; + if (0 == index) { // First package + uint32_t set_size = sizeof(TSettings); +#ifdef USE_UFILESYS + if (('s' == buffer[2]) && ('e' == buffer[3])) { // /.settings + set_size = buffer[14] + (buffer[15] << 8); + } +#endif // USE_UFILESYS + if (!SettingsBufferAlloc(set_size)) { + return false; // Not enough (memory) space + } + } + + if (nullptr == buffer) { // Flush receive buffer + return true; // Already flushed + } + + uint32_t package_size = XYZModem.packet_size; + if (XYZFile.byte_counter > settings_size) { + package_size -= (XYZFile.byte_counter - settings_size); + } + memcpy(settings_buffer + index, buffer, package_size); + } + return true; +} + +void XYZModemFileWriteEot(bool state) { + if (XYZFile.file) { +#ifdef USE_UFILESYS + XYZModemBufferFree(); // Release buffer + if (0 == state) { + ffsp->remove(XYZFile.file_name); // Remove corrupted file + } +#endif // USE_UFILESYS + } else { + if (1 == state) { + if (SettingsConfigRestore()) { // Process new settings and release buffer + TasmotaGlobal.restart_flag = 2; // Restart on valid settings + } + } else { + SettingsBufferFree(); // Release buffer + } + } +} + +/*********************************************************************************************\ + * Xmodem read +\*********************************************************************************************/ + +bool XYZModemReadAvailable(uint32_t timeout) { + int i = 0; + while (!XYZModemAvailable()) { + delayMicroseconds(100); + i++; + if (i > timeout * 10000) { // 10000 * 100 uS = 1 Sec (Protocol Initial 40 Sec, then 20 Sec) + return false; + } + } + return true; +} + +int XYZModemReadByte(void) { + if (!XYZModemReadAvailable(XYZModem.receive_timeout)) { + return -1; + } + int in_char = XYZModemRead(); + if (in_char >= 0) { + if (TXMP_TELNET == XYZModem.protocol) { + if (0xFF == in_char) { // Fix XModem over Telnet escape + XYZModemRead(); + } + if (XYZModem.teraterm && (0x0D == in_char)) { // Fix TeraTerm + XYZModemRead(); + } + } + } +// AddLog(LOG_LEVEL_DEBUG, PSTR("XMD: Rcvd %d"), in_char); + + return in_char; +} + +/*********************************************************************************************\ + * Xmodem Send +\*********************************************************************************************/ + +// Wait for the remote to acknowledge or cancel. +// Returns the received char if no timeout occured or a CAN was received. In this cases, it returns -1. +int XYZModemWaitACK(void) { + int in_char; + do { + in_char = XYZModemReadByte(); + if (in_char < 0) { return -1; } // Timeout + if (XYZM_CAN == in_char) { return XYZM_CAN; } // Cancel + } while ((in_char != XYZM_NAK) && (in_char != XYZM_ACK) && (in_char != 'C')); + return in_char; +} + +// Calculate checksum +void XYZModemChecksum(uint8_t out_char) { + XYZModem.checksumBuf += out_char; + + XYZModem.crcBuf = XYZModem.crcBuf ^ (uint16_t)out_char << 8; + for (uint32_t i = 0; i < 8; i++) { + if (XYZModem.crcBuf & 0x8000) { + XYZModem.crcBuf = XYZModem.crcBuf << 1 ^ 0x1021; + } else { + XYZModem.crcBuf = XYZModem.crcBuf << 1; + } + } +} + +void XYZModemSendEscaped(uint8_t *xmodem_buffer, uint32_t *xmodem_buffer_ptr, uint8_t in_char) { + uint32_t buffer_ptr = *xmodem_buffer_ptr; + xmodem_buffer[buffer_ptr++] = in_char; + if (TXMP_TELNET == XYZModem.protocol) { + if (0xFF == in_char) { // Fix XModem over Telnet escape + xmodem_buffer[buffer_ptr++] = in_char; + } + if (XYZModem.teraterm && (0x0D == in_char)) { // Fix TeraTerm + xmodem_buffer[buffer_ptr++] = 0x00; + } + } + *xmodem_buffer_ptr = buffer_ptr; +} + +bool XYZModemSend(uint32_t packet_no) { + XYZModem.filepos = XYZFile.byte_counter; + + // Try to send packet, so header first. Use a buffer to reduce TCP/IP header overhead + uint8_t xmodem_buffer[2 * (3 + XYZMODEM_SOH_PACKET_SIZE + 2)]; // Need double packet size to fix Telnet escape + + // Sending a packet will be retried + uint32_t retries = 0; + int in_char; + do { + // Seek to start of current data block, + // will advance through the file as block will be acked.. + XYZFile.byte_counter = XYZModem.filepos; + + // Reset checksum stuff + XYZModem.checksumBuf = 0x00; + XYZModem.crcBuf = 0x00; + + uint8_t packet_num = packet_no; + +// AddLog(LOG_LEVEL_DEBUG, PSTR("XMD: Packet %d, retries %d, counter %d"), packet_no, retries, XYZFile.byte_counter); + + uint32_t xmodem_buffer_ptr = 0; + XYZModemSendEscaped(xmodem_buffer, &xmodem_buffer_ptr, XYZM_SOH); + XYZModemSendEscaped(xmodem_buffer, &xmodem_buffer_ptr, packet_num); + XYZModemSendEscaped(xmodem_buffer, &xmodem_buffer_ptr, ~packet_num); + for (uint32_t i = 0; i < XYZMODEM_SOH_PACKET_SIZE; i++) { + in_char = XYZModemFileRead(); + if (in_char < 0) { + return false; // No input + } + XYZModemChecksum(in_char); + XYZModemSendEscaped(xmodem_buffer, &xmodem_buffer_ptr, in_char); + } + // Send out checksum, either CRC-16 CCITT or classical inverse of sum of bytes. + // Depending on how the receiver introduced itself + if (XYZModem.oldChecksum) { + XYZModemSendEscaped(xmodem_buffer, &xmodem_buffer_ptr, XYZModem.checksumBuf); + } else { + XYZModemSendEscaped(xmodem_buffer, &xmodem_buffer_ptr, XYZModem.crcBuf >> 8); + XYZModemSendEscaped(xmodem_buffer, &xmodem_buffer_ptr, XYZModem.crcBuf & 0xFF); + } + XYZModemWriteBuf(xmodem_buffer, xmodem_buffer_ptr); + + in_char = XYZModemWaitACK(); + +// AddLog(LOG_LEVEL_DEBUG, PSTR("XMD: Ack %02X, Send %*_H"), in_char, xmodem_buffer_ptr, xmodem_buffer); +// if (in_char != XYZM_ACK) { +// AddLog(LOG_LEVEL_DEBUG_MORE, PSTR("XMD: Send packet %d, Size %d, Ack %d"), packet_no, xmodem_buffer_ptr, in_char); +// } + + if (XYZM_CAN == in_char) { + return false; // CAN + } + retries++; + XYZModem.teraterm = 1; // Fix teraterm TELNET issue + if (retries > XYZMODEM_MAX_RETRY) { + return false; // Max retries + } + } while (in_char != XYZM_ACK); + return true; +} + +/*********************************************************************************************\ + * Xmodem Receive +\*********************************************************************************************/ + +void XYZModemCancel(void) { + // Five cancels & five backspaces per spec + const uint8_t cancel[] = { XYZM_CAN, XYZM_CAN, XYZM_CAN, XYZM_CAN, XYZM_CAN, XYZM_BS, XYZM_BS, XYZM_BS, XYZM_BS, XYZM_BS }; + XYZModemWriteBuf(cancel, sizeof(cancel)); +} + +void XYZModemSendNakOrC(void) { + while (XYZModemAvailable()) { XYZModemRead(); } // Flush input + + char out_char = 'C'; + if (XYZModem.oldChecksum) { + out_char = XYZM_NAK; + } + XYZModemWrite(out_char); +} + +void XYZModemSendNak(void) { + // When the receiver wishes to , it should call a "PURGE" subroutine, to wait + // for the line to clear. Recall the sender tosses any characters in its buffer + // immediately upon completing sending a block, to ensure no glitches were mis-interpreted. + // The most common technique is for "PURGE" to call the character receive subroutine, + // specifying a 1-second timeout,[1] and looping back to PURGE until a timeout occurs. + // The is then sent, ensuring the other end will see it. + uint32_t timeout = 1 * XYZMODEM_RECV_TIMEOUT_SHORT; + while (timeout--) { + while (XYZModemAvailable()) { XYZModemRead(); } // Flush input + delay(1); + } + + if (XYZModem.nak_count) { + XYZModem.nak_count--; + if (0 == XYZModem.nak_count) { + XYZModemCancel(); // Cancel xfer + return; + } + } + + XYZModemWrite(XYZM_NAK); + + XYZModem.mode = XYZD_SOH; +} + +bool XYZModemCheckPacket(uint8_t *buffer) { + XYZModem.checksumBuf = 0x00; + XYZModem.crcBuf = 0x00; + + for (uint32_t i = 0; i < XYZModem.packet_size; i++) { + XYZModemChecksum(buffer[i + 3]); + } + +// AddLog(LOG_LEVEL_DEBUG, PSTR("XMD: CheckPacket %d, checksum %d,%d, crc %04X,%04X"), +// XYZModem.oldChecksum, buffer[3 + XYZModem.packet_size], XYZModem.checksumBuf, +// buffer[3 + XYZModem.packet_size] << 8 | buffer[3 + XYZModem.packet_size +1], XYZModem.crcBuf); + + if (XYZModem.oldChecksum) { + return (buffer[3 + XYZModem.packet_size] == XYZModem.checksumBuf); + } else { + return ((buffer[3 + XYZModem.packet_size] == (XYZModem.crcBuf >> 8)) && + (buffer[3 + XYZModem.packet_size +1] == (XYZModem.crcBuf & 0xFF))); + } +} + +int XYZModemReceive(uint32_t packet_no) { + // Try to send packet, so header first. Use a buffer to reduce TCP/IP header overhead + uint8_t xmodem_buffer[3 + XYZMODEM_STX_PACKET_SIZE + 2]; + uint32_t xmodem_buffer_ptr = 0; + uint32_t packet_size; + + XYZModem.mode = XYZD_SOH; + + // The character-receive subroutine should be called with a parameter specifying the + // number of seconds to wait. The receiver should first call it with a time of 10, + // then and try again, 10 times. + XYZModem.receive_timeout = XYZMODEM_RECV_TIMEOUT_LONG; + + int in_char; + bool packet_ready = false; + do { + in_char = XYZModemReadByte(); + if (in_char < 0) { + return XYZS_TIMEOUT; // No receive after timeout + } + switch (XYZModem.mode) { + case XYZD_SOH: { +// AddLog(LOG_LEVEL_DEBUG, PSTR("XMD: XYZD_SOH")); + + switch (in_char) { + case XYZM_SOH: { // Start XModem 128 byte data transfer +// AddLog(LOG_LEVEL_DEBUG, PSTR("XMD: SOH")); + + xmodem_buffer[0] = in_char; + // After receiving the , the receiver should call the character + // receive subroutine with a 1-second timeout, for the remainder of the + // message and the . Since they are sent as a continuous stream, + // timing out of this implies a serious like glitch that caused, say, + // 127 characters to be seen instead of 128. + XYZModem.receive_timeout = XYZMODEM_RECV_TIMEOUT_SHORT; + XYZModem.packet_size = XYZMODEM_SOH_PACKET_SIZE; + XYZModem.mode = XYZD_BLK1; + break; + } + case XYZM_STX: { // Start XModem 1024 byte data transfer +// AddLog(LOG_LEVEL_DEBUG, PSTR("XMD: STX")); + + xmodem_buffer[0] = in_char; + // After receiving the , the receiver should call the character + // receive subroutine with a 1-second timeout, for the remainder of the + // message and the . Since they are sent as a continuous stream, + // timing out of this implies a serious like glitch that caused, say, + // 1023 characters to be seen instead of 1024. + XYZModem.receive_timeout = XYZMODEM_RECV_TIMEOUT_SHORT; + XYZModem.packet_size = XYZMODEM_STX_PACKET_SIZE; + XYZModem.mode = XYZD_BLK1; + break; + } + case XYZM_EOT: { +// AddLog(LOG_LEVEL_DEBUG, PSTR("XMD: EOT")); + + if (packet_no) { + XYZModemFileWrite(nullptr); + } else { + // Handle YModem filename package + } + XYZModemWrite(XYZM_ACK); + return XYZS_EOT; // Success as EOT received + break; + } + case XYZM_CAN: { +// AddLog(LOG_LEVEL_DEBUG, PSTR("XMD: CAN")); + + XYZModem.can_count++; + if (5 == XYZModem.can_count) { + return XYZS_CAN; // Cancelled by sender + } + break; + } + default: { +// AddLog(LOG_LEVEL_DEBUG, PSTR("XMD: Default")); + + XYZModemCancel(); + return XYZS_OTHER; // Unknown error + } + } + break; + } + case XYZD_BLK1: { +// AddLog(LOG_LEVEL_DEBUG, PSTR("XMD: XYZD_BLK1")); + + xmodem_buffer[1] = in_char; + XYZModem.mode = XYZD_BLK2; + break; + } + case XYZD_BLK2: { +// AddLog(LOG_LEVEL_DEBUG, PSTR("XMD: XYZD_BLK2 %02X, exor %02X"), in_char, (in_char ^ xmodem_buffer[1])); + + xmodem_buffer[2] = in_char; + if (0xFF == (in_char ^ xmodem_buffer[1])) { + xmodem_buffer_ptr = 3; + packet_size = 3 + XYZModem.packet_size + ((XYZModem.oldChecksum) ? 1 : 2); + XYZModem.mode = XYZD_DATA; + } else { + XYZModemSendNak(); + } + break; + } + case XYZD_DATA: { // Read data and checksum/crc +// AddLog(LOG_LEVEL_DEBUG, PSTR("XMD: XYZD_DATA %d of %d"), xmodem_buffer_ptr, packet_size); + + xmodem_buffer[xmodem_buffer_ptr++] = in_char; + if (xmodem_buffer_ptr >= packet_size) { +// XYZFile.byte_counter += XYZModem.packet_size; + XYZFile.byte_counter = packet_no * XYZModem.packet_size; + XYZModem.mode = XYZD_SOH; + packet_ready = true; + } else { + + } + break; + } + } + } while (!packet_ready); +// AddLog(LOG_LEVEL_DEBUG, PSTR("XMD: Packet ready")); + + if (!XYZModemCheckPacket(xmodem_buffer)) { +// AddLog(LOG_LEVEL_DEBUG, PSTR("XMD: Checksum failure")); + + XYZFile.byte_counter -= XYZModem.packet_size; // Restore for retry + XYZModemSendNak(); + return XYZS_CHECKSUM; // Checksum failure + } + + uint8_t packet = xmodem_buffer[1] - packet_no; + +// AddLog(LOG_LEVEL_DEBUG, PSTR("XMD: Packet %d,%d,%d"), packet, xmodem_buffer[1], packet_no); + + if (packet > 1) { +// AddLog(LOG_LEVEL_DEBUG, PSTR("XMD: Bad packet number")); + + XYZModemCancel(); + return XYZS_PACKET; // Bad packet number + } + + XYZModemWrite(XYZM_ACK); + XYZModem.nak_count = 10; + +// if (0 == packet) { +// return true; +// } + + if (!XYZModemFileWrite(xmodem_buffer +3)) { + return XYZS_FILE; // Unable to claim file buffer + } + + return XYZS_OK; +} + +/********************************************************************************************/ + +void XModemSendStart(void) { + // *** Handle file send using XModem - sync + // Wait for either C or NACK as a sync packet. Determines protocol details, checksum algorithm. + XYZModem.enabled = XYZM_SEND; + XYZModem.timeout = millis() + (XYZMODEM_SYNC_TIMEOUT * 1000); + XYZModem.packet_no = 1; + XYZFile.byte_counter = 0; + XYZFile.sector_counter = -1; + if (XYZFile.size) { + XYZFile.step = XYZM_SEND; + AddLog(LOG_LEVEL_DEBUG, PSTR("XMD: Send started")); + } else { + XYZFile.step = XYZM_SEOT; + AddLog(LOG_LEVEL_DEBUG, PSTR("XMD: Send aborted")); + } +} + +void XModemReceiveStart(void) { + // *** Handle receive file using XModem - sync + XYZModem.enabled = XYZM_RECEIVE; + XYZModem.timeout = millis() + 1000; + XYZModem.nak_count = 30; // Allow 30 * 2 seconds for Xmodem Send to start + XYZModem.can_count = 0; + XYZModem.packet_no = 1; + XYZModem.retry = 4; + XYZFile.byte_counter = 0; + XYZFile.sector_counter = 0; + XYZFile.step = XYZM_RECEIVE; +} + +bool XYZModemLoop(void) { + switch (XYZFile.step) { + case XYZM_IDLE: { // *** Send/Receive disabled + return false; + } + // *** Send + case XYZM_SEND: { // *** Handle file send using XModem - upload + if (XYZModemFileAvailable()) { + if (XYZFile.byte_counter && !(XYZFile.byte_counter % 10240)) { // Show progress every 10kB + AddLog(LOG_LEVEL_DEBUG, PSTR("XMD: Progress %d kB"), XYZFile.byte_counter / 1024); + } + if (!XYZModemSend(XYZModem.packet_no)) { + AddLog(LOG_LEVEL_DEBUG, PSTR("XMD: Packet %d send failed"), XYZModem.packet_no); + XYZFile.step = XYZM_ERROR; + return true; + } + XYZModem.packet_no++; + } else { + XYZFile.step = XYZM_SEOT; + AddLog(LOG_LEVEL_DEBUG, PSTR("XMD: Send %d bytes"), XYZFile.size); + } + break; + } + case XYZM_SEOT: { // *** Send EOT and wait for ACK + // Once the last block is ACKed by the target, the transfer should be finalized by an + // EOT (ASCII 0x04) packet from the source. This packet is confirmed via XModem ACK + // from the target. + XYZModemWrite(XYZM_EOT); + XYZModem.timeout = millis() + (30 * 1000); // Allow 30 seconds to receive EOT ACK + XYZFile.step = XYZM_ACKT; + break; + } + case XYZM_ACKT: { // *** Send EOT and wait for ACK + // The ACK for the last XModem data packet may take much longer (1-3 seconds) than prior + // data packets to be received. + if (millis() > XYZModem.timeout) { + AddLog(LOG_LEVEL_DEBUG, PSTR("XMD: EOT ACK timeout")); + XYZFile.step = XYZM_ERROR; + return true; + } + if (XYZModemAvailable()) { + int xmodem_ack = XYZModemWaitACK(); + if (XYZM_CAN == xmodem_ack) { + AddLog(LOG_LEVEL_DEBUG, PSTR("XMD: Transfer invalid")); + XYZFile.step = XYZM_ERROR; + return true; + } + else if (XYZM_ACK == xmodem_ack) { + AddLog(LOG_LEVEL_DEBUG, PSTR("XMD: Successful")); + XYZModem.timeout = millis() + (30 * 1000); // Allow 30 seconds + XYZFile.byte_counter = 0; + XYZFile.step = XYZM_DONE; + } + } + break; + } + // *** Receive + case XYZM_RECEIVE: { // *** Handle receive file using XModem - download + if (millis() > XYZModem.timeout) { + XYZModem.timeout = millis() + (2 * 1000); // Protocol 10 second receive timeout - here 2 seconds + XYZModemSendNakOrC(); + if (XYZModemReadAvailable(1)) { // Timeout after 1 second + XYZModem.nak_count = (XYZModem.oldChecksum) ? 10 : 3; + AddLog(LOG_LEVEL_DEBUG, PSTR("XMD: Receive started")); + XYZFile.step = XYZM_RCV_START; + return true; + } + else if (0 == XYZModem.nak_count) { // Timeout after 30 * 2 seconds + AddLog(LOG_LEVEL_DEBUG, PSTR("XMD: Receive timeout")); + XYZFile.step = XYZM_ERROR; + return true; + } + } + break; + } + case XYZM_RCV_START: { + if (XYZFile.byte_counter && !(XYZFile.byte_counter % 10240)) { // Show progress every 10kB + AddLog(LOG_LEVEL_DEBUG, PSTR("XMD: Progress %d kB"), XYZFile.byte_counter / 1024); + } + int result = XYZModemReceive(XYZModem.packet_no); + if (result) { + switch (result) { + case XYZS_EOT: { + AddLog(LOG_LEVEL_DEBUG, PSTR("XMD: Received %d bytes"), XYZFile.byte_counter); + AddLog(LOG_LEVEL_DEBUG, PSTR("XMD: Successful")); + XYZModemFileWriteEot(1); + XYZFile.step = XYZM_DONE; + break; + } + case XYZS_CHECKSUM: { + // Checksum error or teraterm special ops on 0x0D disabled - will retry + AddLog(LOG_LEVEL_DEBUG, PSTR("XMD: Checksum failure - retry")); + XYZModem.teraterm = 1; // Fix teraterm TELNET issue + XYZModem.retry--; + break; + } + case XYZS_TIMEOUT: { + // Receive character timeout - will retry + AddLog(LOG_LEVEL_DEBUG, PSTR("XMD: Timeout - retry")); + XYZModem.retry--; + break; + } + case XYZS_OTHER: { + // Received unknown command + AddLog(LOG_LEVEL_DEBUG, PSTR("XMD: Unknown error")); + XYZModem.retry = 0; + break; + } + case XYZS_CAN: { + // Receive cancelled by user + AddLog(LOG_LEVEL_DEBUG, PSTR("XMD: Cancelled")); + XYZModem.retry = 0; + break; + } + case XYZS_PACKET: { + // Packet number mismatch + AddLog(LOG_LEVEL_DEBUG, PSTR("XMD: Packet number error")); + XYZModem.retry = 0; + break; + } + case XYZS_FILE: { + // Unable to allocate memory, file write error or filesystem full + AddLog(LOG_LEVEL_DEBUG, PSTR("XMD: File write error")); + XYZModem.retry = 0; + break; + } + default: + AddLog(LOG_LEVEL_DEBUG, PSTR("XMD: Receive error %d"), result); + XYZModem.retry = 0; + } + + if (0 == XYZModem.retry) { + AddLog(LOG_LEVEL_DEBUG, PSTR("XMD: Packet %d receive failed"), XYZModem.packet_no); + XYZModemFileWriteEot(0); + XYZModemCancel(); + XYZFile.step = XYZM_ERROR; + return true; + } + } else { + XYZModem.packet_no++; + } + break; + } + // *** Finish + case XYZM_COMPLETE: { // *** Wait for send complete + if (millis() > XYZModem.timeout) { + AddLog(LOG_LEVEL_DEBUG, PSTR("XMD: Timeout")); + XYZFile.step = XYZM_ERROR; + return true; + } else { + XYZFile.state = XYZM_COMPLETE; + XYZFile.step = XYZM_DONE; + } + break; + } + case XYZM_ERROR: + XYZFile.state = XYZM_ERROR; + AddLog(LOG_LEVEL_DEBUG, PSTR("XMD: Failed")); + case XYZM_DONE: { // *** Clean up + XYZModemBufferFree(); + XYZModemInit(); + break; + } + } + return true; +} + +void XYZModemInit(void) { + XYZModem.receive_timeout = XYZMODEM_RECV_TIMEOUT_SHORT; + XYZModem.enabled = XYZM_IDLE; + XYZModem.protocol = TXMP_NONE; + XYZFile.size = 0; + XYZFile.step = XYZM_IDLE; +} + +/*********************************************************************************************\ + * Commands +\*********************************************************************************************/ + +const char kXYZmodemCommands[] PROGMEM = "|" // No prefix + "TeraTerm|XSend|XReceive"; + +void (* const XYZmodemCommands[])(void) PROGMEM = { + &CmndTeraTerm, &CmndXSend, &CmndXReceive }; + +void CmndTeraTerm(void) { + // TeraTerm - Show current selection + // TeraTerm 0 - Disable adding zero after carriage return (0x0D) + // TeraTerm 1 - Enable adding zero after carriage return (0x0D) + if ((XdrvMailbox.payload >= 0) && (XdrvMailbox.payload <= 1)) { + XYZModem.teraterm = XdrvMailbox.payload; + } + ResponseCmndStateText(XYZModem.teraterm); +} + +void CmndXSend(void) { + // XSend + // XSend Settings - Send active settings + // XSend autoexec.bat - Send file autoexec.bat + if (XdrvMailbox.data_len > 0) { + if (!strcasecmp_P(XdrvMailbox.data, PSTR("Settings"))) { + XYZFile.size = sizeof(TSettings); + XYZFile.file = false; +// XYZModem.enabled = XYZM_SEND; + ResponseCmndChar("Ready to start receive Settings"); +#ifdef USE_UFILESYS + } else { + UfsFilename(XYZFile.file_name, XdrvMailbox.data); + if (TfsFileExists(XYZFile.file_name)) { + XYZFile.size = TfsFileSize(XYZFile.file_name); + if (XYZFile.size) { + XYZFile.file = true; +// XYZModem.enabled = XYZM_SEND; + ResponseCmndChar("Ready to start receive file"); + } else { + ResponseCmndChar("File is empty"); + } + } else { + ResponseCmndChar("File not found"); + } +#endif // USE_UFILESYS + } + } +} + +void CmndXReceive(void) { + // XReceive[] [,] - Receive filename with optional crc (default CRC) and trim CP/M SUB from end of file (default trim) + // XReceive Settings - Receive and activate settings using CRC (No need for trim1a as it's size is on 128/1024 bytes boundary) + // XReceive autoexec.bat - Receive file autoexec.bat using CRC leaving CP/M SUB at end of file + // XReceive autoexec.bat,0 - Receive file autoexec.bat using CRC and do not trim CP/M SUB from end of file + // XReceive autoexec.bat,1 - Receive file autoexec.bat using CRC and trim CP/M SUB from end of file (default) + // XReceive autoexec.bat,2 - Receive file autoexec.bat using CRC and auto trim CP/M SUB from end of file + // XReceive2 autoexec.bat - Receive file autoexec.bat using checksum (less secure) + if (XdrvMailbox.data_len > 0) { + XYZModem.oldChecksum = 0; // CRC (Start with C) - Default + if (2 == XdrvMailbox.index) { + XYZModem.oldChecksum = 1; // Checksum (Start with NAK) + } + XYZFile.trim1a = XYZT_TRIM; // Trim CP/M SUB from end of file - Default + size_t option = strchrspn(XdrvMailbox.data, ','); + if (option) { + char option_crc[XdrvMailbox.data_len]; + ArgV(option_crc, 2); + XYZFile.trim1a = atoi(option_crc) &0x03; + XdrvMailbox.data[option] = '\0'; // Force input end of string + } + if (!strcasecmp_P(XdrvMailbox.data, PSTR("Settings"))) { + XYZFile.file = false; + XModemReceiveStart(); + ResponseCmndChar("Ready to start sending Settings"); +#ifdef USE_UFILESYS + } else { + UfsFilename(XYZFile.file_name, XdrvMailbox.data); + XYZFile.file = true; + XModemReceiveStart(); + ResponseCmndChar("Ready to start sending file"); +#endif // USE_UFILESYS + } + } +} + +/*********************************************************************************************\ + * External access +\*********************************************************************************************/ + +bool XYZModemStart(uint32_t protocol, uint8_t in_byte) { + XYZModem.protocol = protocol; + +// AddLog(LOG_LEVEL_DEBUG, PSTR("XMD: Protocol %d, Received %02X(%d)"), protocol, in_byte, in_byte); + + if (XYZFile.size) { + if ((in_byte == XYZM_NAK) || // Xmodem NAK - Checksum + (in_byte == 'C')) { // Xmodem NAK - CRC + // Determine which checksum algorithm to use + XYZModem.oldChecksum = (in_byte == XYZM_NAK); + XModemSendStart(); + return true; + } + } + return false; +} + +bool XYZModemWifiClientStart(WiFiClient *client, uint8_t in_byte) { + XYZModem.client = client; + return XYZModemStart(TXMP_TELNET, in_byte); +} + +bool XYZModemActive(uint32_t protocol) { + return (XYZModem.enabled && (XYZModem.protocol == protocol)); +} + +/*********************************************************************************************\ + * Interface +\*********************************************************************************************/ + +bool Xdrv120(uint32_t function) { + bool result = false; + + switch (function) { + case FUNC_SLEEP_LOOP: + case FUNC_LOOP: + if (XYZModem.enabled) { + XYZModemLoop(); + } + break; + case FUNC_INIT: + XYZModemInit(); + break; + case FUNC_COMMAND: + result = DecodeCommand(kXYZmodemCommands, XYZmodemCommands); + break; + case FUNC_ACTIVE: + result = true; + break; + } + return result; +} + +#endif // USE_XYZMODEM diff --git a/tasmota/tasmota_xdrv_driver/xdrv_121_gpioviewer.ino b/tasmota/tasmota_xdrv_driver/xdrv_121_gpioviewer.ino index 6a6bba922..c5e61f5ee 100644 --- a/tasmota/tasmota_xdrv_driver/xdrv_121_gpioviewer.ino +++ b/tasmota/tasmota_xdrv_driver/xdrv_121_gpioviewer.ino @@ -30,6 +30,9 @@ * GvUrl 1 - Select default url (GV_BASE_URL) * GvUrl https://thelastoutpostworkshop.github.io/microcontroller_devkit/gpio_viewer_1_5/ * + * Note 20250223 + * - GVRelease 1.6.2 (No code change) + * * Note 20250126 * - GVRelease 1.6.1 (No code change) * @@ -86,7 +89,7 @@ #define GV_KEEP_ALIVE 1000 // milliseconds - If no activity after this do a heap size event anyway -const char *GVRelease = "1.6.1"; +const char *GVRelease = "1.6.2"; /*********************************************************************************************/ diff --git a/tasmota/tasmota_xdrv_driver/xdrv_17_rcswitch.ino b/tasmota/tasmota_xdrv_driver/xdrv_17_rcswitch.ino index 008bfb5b1..ed1025591 100644 --- a/tasmota/tasmota_xdrv_driver/xdrv_17_rcswitch.ino +++ b/tasmota/tasmota_xdrv_driver/xdrv_17_rcswitch.ino @@ -56,7 +56,7 @@ void RfReceiveCheck(void) { int protocol = mySwitch.getReceivedProtocol(); int delay = mySwitch.getReceivedDelay(); - AddLog(LOG_LEVEL_DEBUG, PSTR("RFR: Data 0x%_X (%_U), Bits %d, Protocol %d, Delay %d"), &data, &data, bits, protocol, delay); + AddLog(LOG_LEVEL_DEBUG, PSTR("RFR: Data 0x%0_X (%_U), Bits %d, Protocol %d, Delay %d"), &data, &data, bits, protocol, delay); uint32_t now = millis(); if ((now - rf_lasttime > Settings->rf_duplicate_time) && (data > 0)) { @@ -66,7 +66,7 @@ void RfReceiveCheck(void) { if (Settings->flag.rf_receive_decimal) { // SetOption28 - RF receive data format (0 = hexadecimal, 1 = decimal) ext_snprintf_P(stemp, sizeof(stemp), PSTR("%_U"), &data); } else { - ext_snprintf_P(stemp, sizeof(stemp), PSTR("\"0x%_X\""), &data); + ext_snprintf_P(stemp, sizeof(stemp), PSTR("\"0x%0_X\""), &data); } ResponseTime_P(PSTR(",\"" D_JSON_RFRECEIVED "\":{\"" D_JSON_RF_DATA "\":%s,\"" D_JSON_RF_BITS "\":%d,\"" D_JSON_RF_PROTOCOL "\":%d,\"" D_JSON_RF_PULSE "\":%d}}"), stemp, bits, protocol, delay); diff --git a/tasmota/tasmota_xdrv_driver/xdrv_23_zigbee_6_0_commands.ino b/tasmota/tasmota_xdrv_driver/xdrv_23_zigbee_6_0_commands.ino index 53ca8f223..d9270b0d3 100644 --- a/tasmota/tasmota_xdrv_driver/xdrv_23_zigbee_6_0_commands.ino +++ b/tasmota/tasmota_xdrv_driver/xdrv_23_zigbee_6_0_commands.ino @@ -602,19 +602,38 @@ static void replyTuyaTime( uint16_t cluster, uint16_t shortaddr, uint8_t dstendp bool convertTuyaSpecificCluster(class Z_attribute_list &attr_list, uint16_t cluster, uint8_t cmd, bool direction, uint16_t shortaddr, uint8_t srcendpoint, const SBuffer &buf) { if ((1 == cmd) || (2 == cmd)) { // attribute report or attribute response - // uint16_t seq_number = buf.get16BigEndian(0) - uint8_t dpid = buf.get8(2); // dpid from Tuya documentation - uint8_t attr_type = buf.get8(3); // data type from Tuya documentation - uint16_t len = buf.get16BigEndian(4); - // create a synthetic attribute with id 'dpid' - Z_attribute & attr = attr_list.addAttribute(cluster, (attr_type << 8) | dpid); - parseSingleTuyaAttribute(attr, buf, 6, len, attr_type); - return true; // true = remove the original Tuya attribute + uint16_t read_index = 0; // position in the buffer + // uint16_t seq_number = buf.get16BigEndian(read_index); // seq + read_index += 2; + + // continue while we can read at least 4 bytes: the dpid (u8), the type (u8), and the length (u16) + while ((read_index + 4) <= buf.len()) { + uint8_t dpid = buf.get8(read_index); // dpid + read_index++; + uint8_t attr_type = buf.get8(read_index); // data type + read_index++; + uint16_t len = buf.get16BigEndian(read_index); + read_index += 2; + + // ensures we may read at least `len` bytes, if not, the payload is malformed. + if ((read_index + len) > buf.len()) { + break; + } + + // create a synthetic attribute with id 'dpid' + Z_attribute & attr = attr_list.addAttribute(cluster, (attr_type << 8) | dpid); + parseSingleTuyaAttribute(attr, buf, read_index, len, attr_type); + read_index += len; + } + + return true; // true = remove the original Tuya attribute } + if (0x24 == cmd) { replyTuyaTime(cluster, shortaddr, srcendpoint); return true; } + return false; } diff --git a/tasmota/tasmota_xdrv_driver/xdrv_23_zigbee_9a_upload.ino b/tasmota/tasmota_xdrv_driver/xdrv_23_zigbee_9a_upload.ino index 07add3891..522e19cd3 100644 --- a/tasmota/tasmota_xdrv_driver/xdrv_23_zigbee_9a_upload.ino +++ b/tasmota/tasmota_xdrv_driver/xdrv_23_zigbee_9a_upload.ino @@ -144,7 +144,7 @@ char XModemWaitACK(void) { char in_char; do { - uint8_t i = 0; + int i = 0; while (!ZigbeeSerial->available()) { delayMicroseconds(100); i++; diff --git a/tasmota/tasmota_xdrv_driver/xdrv_44_miel_hvac.ino b/tasmota/tasmota_xdrv_driver/xdrv_44_miel_hvac.ino index 17de2e460..c79fcf091 100644 --- a/tasmota/tasmota_xdrv_driver/xdrv_44_miel_hvac.ino +++ b/tasmota/tasmota_xdrv_driver/xdrv_44_miel_hvac.ino @@ -875,12 +875,11 @@ miel_hvac_cmnd_settemp(void) { struct miel_hvac_softc *sc = miel_hvac_sc; struct miel_hvac_msg_update_settings *update = &sc->sc_settings_update; - float degc; if (XdrvMailbox.data_len == 0) return; - degc = strtof(XdrvMailbox.data, nullptr); + float degc = CharToFloat(XdrvMailbox.data); if (degc < MIEL_HVAC_SETTINGS_TEMP_MIN || degc > MIEL_HVAC_SETTINGS_TEMP_MAX) { miel_hvac_respond_unsupported(); @@ -899,7 +898,7 @@ miel_hvac_cmnd_settemp(void) update->temp05 = miel_hvac_deg2temp(degc); } - ResponseCmndNumber(degc); + ResponseCmndFloat(degc, Settings->flag2.temperature_resolution); } static void diff --git a/tasmota/tasmota_xdrv_driver/xdrv_50_filesystem.ino b/tasmota/tasmota_xdrv_driver/xdrv_50_filesystem.ino index 6b482e7c4..c144f22c1 100644 --- a/tasmota/tasmota_xdrv_driver/xdrv_50_filesystem.ino +++ b/tasmota/tasmota_xdrv_driver/xdrv_50_filesystem.ino @@ -154,7 +154,7 @@ void UfsInit(void) { UfsData.run_file_pos = -1; UfsInitOnce(); if (ufs_type) { - AddLog(LOG_LEVEL_INFO, PSTR("UFS: FlashFS mounted with %d kB free"), UfsInfo(1, 0)); + AddLog(LOG_LEVEL_INFO, PSTR(D_LOG_UFS "FlashFS mounted with %d kB free"), UfsInfo(1, 0)); } } @@ -217,10 +217,10 @@ void UfsCheckSDCardInit(void) { // make sd card the global filesystem #ifdef ESP8266 // on esp8266 sdcard info takes several seconds !!!, so we ommit it here - AddLog(LOG_LEVEL_INFO, PSTR("UFS: SDCard mounted")); + AddLog(LOG_LEVEL_INFO, PSTR(D_LOG_UFS "SDCard mounted")); #endif // ESP8266 #ifdef ESP32 - AddLog(LOG_LEVEL_INFO, PSTR("UFS: SDCard mounted (SPI mode) with %d kB free"), UfsInfo(1, 0)); + AddLog(LOG_LEVEL_INFO, PSTR(D_LOG_UFS "SDCard mounted (SPI mode) with %d kB free"), UfsInfo(1, 0)); #endif // ESP32 } } @@ -249,7 +249,7 @@ void UfsCheckSDCardInit(void) { dfsp = ufsp; if (ffsp) {ufs_dir = 1;} // make sd card the global filesystem - AddLog(LOG_LEVEL_INFO, PSTR("UFS: SDCard mounted (SDIO %i-bit) with %d kB free"), bit_4_mode ? 4 : 1, UfsInfo(1, 0)); + AddLog(LOG_LEVEL_INFO, PSTR(D_LOG_UFS "SDCard mounted (SDIO %i-bit) with %d kB free"), bit_4_mode ? 4 : 1, UfsInfo(1, 0)); } } #endif @@ -1049,7 +1049,7 @@ public: //log_v("StaticRequestHandler::handle: request=%s _uri=%s\r\n", requestUri.c_str(), _uri.c_str()); #ifdef SERVING_DEBUG - AddLog(LOG_LEVEL_DEBUG, PSTR("UFS: ::handle: request=%s _uri=%s"), requestUri.c_str(), _uri.c_str()); + AddLog(LOG_LEVEL_DEBUG, PSTR(D_LOG_UFS "::handle: request=%s _uri=%s"), requestUri.c_str(), _uri.c_str()); #endif String path(_path); @@ -1063,7 +1063,7 @@ public: path += requestUri.substring(_baseUriLength); } #ifdef SERVING_DEBUG - AddLog(LOG_LEVEL_DEBUG, PSTR("UFS: ::handle: path=%s, isFile=%d"), path.c_str(), _isFile); + AddLog(LOG_LEVEL_DEBUG, PSTR(D_LOG_UFS "::handle: path=%s, isFile=%d"), path.c_str(), _isFile); #endif String contentType = getContentType(path); @@ -1077,15 +1077,15 @@ public: File f = _fs.open(path, "r"); if (!f || !f.available()){ - AddLog(LOG_LEVEL_DEBUG, PSTR("UFS: ::handler missing file?")); + AddLog(LOG_LEVEL_DEBUG, PSTR(D_LOG_UFS "::handler missing file?")); return false; } #ifdef SERVING_DEBUG - AddLog(LOG_LEVEL_DEBUG, PSTR("UFS: ::handler file open %d"), f.available()); + AddLog(LOG_LEVEL_DEBUG, PSTR(D_LOG_UFS "::handler file open %d"), f.available()); #endif if (_requireAuth && !WebAuthenticate()) { #ifdef SERVING_DEBUG - AddLog(LOG_LEVEL_ERROR, PSTR("UFS: serv of %s denied"), requestUri.c_str()); + AddLog(LOG_LEVEL_ERROR, PSTR(D_LOG_UFS "serv of %s denied"), requestUri.c_str()); #endif server.requestAuthentication(); return true; @@ -1095,7 +1095,7 @@ public: server.sendHeader("Cache-Control", _cache_header); #ifdef SERVING_DEBUG - AddLog(LOG_LEVEL_DEBUG, PSTR("UFS: ::handler sending")); + AddLog(LOG_LEVEL_DEBUG, PSTR(D_LOG_UFS "::handler sending")); #endif uint8_t buff[512]; uint32_t bread; @@ -1110,18 +1110,18 @@ public: bread = f.read(buff, sizeof(buff)); cnt += bread; #ifdef SERVING_DEBUG - //AddLog(LOG_LEVEL_DEBUG, PSTR("UFS: ::handler sending %d/%d"), cnt, flen); + //AddLog(LOG_LEVEL_DEBUG, PSTR(D_LOG_UFS "::handler sending %d/%d"), cnt, flen); #endif uint32_t bw = download_Client.write((const char*)buff, bread); if (!bw) { break; } yield(); } #ifdef SERVING_DEBUG - AddLog(LOG_LEVEL_DEBUG, PSTR("UFS: ::handler sent %d/%d"), cnt, flen); + AddLog(LOG_LEVEL_DEBUG, PSTR(D_LOG_UFS "::handler sent %d/%d"), cnt, flen); #endif if (cnt != flen){ - AddLog(LOG_LEVEL_ERROR, PSTR("UFS: ::handler incomplete file send: sent %d/%d"), cnt, flen); + AddLog(LOG_LEVEL_ERROR, PSTR(D_LOG_UFS "::handler incomplete file send: sent %d/%d"), cnt, flen); } // It does seem that on lesser ESP32, this causes a problem? A lockup... @@ -1131,7 +1131,7 @@ public: download_Client.stop(); #ifdef SERVING_DEBUG - AddLog(LOG_LEVEL_DEBUG, PSTR("UFS: ::handler done")); + AddLog(LOG_LEVEL_DEBUG, PSTR(D_LOG_UFS "::handler done")); #endif return true; } @@ -1524,21 +1524,21 @@ void UfsListDir(char *path, uint8_t depth) { uint8_t UfsDownloadFile(char *file) { File download_file; - AddLog(LOG_LEVEL_INFO, PSTR("UFS: File '%s' download"), file); + AddLog(LOG_LEVEL_INFO, PSTR(D_LOG_UFS "File '%s' download"), file); if (!dfsp->exists(file)) { - AddLog(LOG_LEVEL_INFO, PSTR("UFS: File '%s' not found"), file); + AddLog(LOG_LEVEL_INFO, PSTR(D_LOG_UFS "File '%s' not found"), file); return 0; } download_file = dfsp->open(file, UFS_FILE_READ); if (!download_file) { - AddLog(LOG_LEVEL_INFO, PSTR("UFS: Could not open file '%s'"), file); + AddLog(LOG_LEVEL_INFO, PSTR(D_LOG_UFS "Could not open file '%s'"), file); return 0; } if (download_file.isDirectory()) { - AddLog(LOG_LEVEL_DEBUG, PSTR("UFS: File '%s' to download is directory"), file); + AddLog(LOG_LEVEL_DEBUG, PSTR(D_LOG_UFS "File '%s' to download is directory"), file); download_file.close(); return 1; } @@ -1588,7 +1588,7 @@ uint8_t UfsDownloadFile(char *file) { download_file.close(); if (UfsData.download_busy == true) { - AddLog(LOG_LEVEL_INFO, PSTR("UFS: Download is busy")); + AddLog(LOG_LEVEL_INFO, PSTR(D_LOG_UFS "Download is busy")); return 0; } @@ -1597,7 +1597,7 @@ uint8_t UfsDownloadFile(char *file) { strcpy(path,file); BaseType_t ret = xTaskCreatePinnedToCore(download_task, "DT", 6000, (void*)path, 3, nullptr, 1); if (ret != pdPASS) - AddLog(LOG_LEVEL_INFO, PSTR("UFS: Download task failed with %d"), ret); + AddLog(LOG_LEVEL_INFO, PSTR(D_LOG_UFS "Download task failed with %d"), ret); yield(); #endif // ESP32_DOWNLOAD_TASK @@ -1614,12 +1614,12 @@ void download_task(void *path) { WiFiClient download_Client; char *file = (char*) path; - AddLog(LOG_LEVEL_DEBUG, PSTR("UFS: ESP32 File '%s' to download"), file); + AddLog(LOG_LEVEL_DEBUG, PSTR(D_LOG_UFS "ESP32 File '%s' to download"), file); download_file = dfsp->open(file, UFS_FILE_READ); uint32_t flen = download_file.size(); - AddLog(LOG_LEVEL_DEBUG, PSTR("UFS: len %d to download"), flen); + AddLog(LOG_LEVEL_DEBUG, PSTR(D_LOG_UFS "len %d to download"), flen); download_Client = Webserver->client(); Webserver->setContentLength(flen); @@ -1647,7 +1647,7 @@ void download_task(void *path) { UfsData.download_busy = false; vTaskDelete( NULL ); free(path); - AddLog(LOG_LEVEL_DEBUG, PSTR("UFS: esp32 sent file")); + AddLog(LOG_LEVEL_DEBUG, PSTR(D_LOG_UFS "esp32 sent file")); } #endif // ESP32_DOWNLOAD_TASK @@ -1682,7 +1682,7 @@ void UfsUploadFileClose(void) { void UfsEditor(void) { if (!HttpCheckPriviledgedAccess()) { return; } - AddLog(LOG_LEVEL_DEBUG, PSTR("UFS: UfsEditor GET")); + AddLog(LOG_LEVEL_DEBUG, PSTR(D_LOG_UFS "UfsEditor GET")); char fname_input[UFS_FILENAME_SIZE]; if (Webserver->hasArg(F("file"))) { @@ -1693,7 +1693,7 @@ void UfsEditor(void) { char fname[UFS_FILENAME_SIZE]; UfsFilename(fname, fname_input); // Trim spaces and add slash - AddLog(LOG_LEVEL_DEBUG, PSTR("UFS: UfsEditor: file=%s, ffs_type=%d, TfsFileExist=%d"), fname, ffs_type, dfsp->exists(fname)); + AddLog(LOG_LEVEL_DEBUG, PSTR(D_LOG_UFS "UfsEditor: file=%s, ffs_type=%d, TfsFileExist=%d"), fname, ffs_type, dfsp->exists(fname)); WSContentStart_P(PSTR(D_EDIT_FILE)); WSContentSendStyle(); @@ -1703,15 +1703,15 @@ void UfsEditor(void) { if (ffs_type && dfsp->exists(fname)) { File fp = dfsp->open(fname, "r"); if (!fp) { - AddLog(LOG_LEVEL_DEBUG, PSTR("UFS: UfsEditor: file open failed")); + AddLog(LOG_LEVEL_DEBUG, PSTR(D_LOG_UFS "UfsEditor: file open failed")); WSContentSend_P(D_NEW_FILE); } else { uint8_t *buf = (uint8_t*)malloc(FILE_BUFFER_SIZE+1); size_t filelen = fp.size(); - AddLog(LOG_LEVEL_DEBUG, PSTR("UFS: UfsEditor: file len=%d"), filelen); + AddLog(LOG_LEVEL_DEBUG, PSTR(D_LOG_UFS "UfsEditor: file len=%d"), filelen); while (filelen > 0) { size_t l = fp.read(buf, FILE_BUFFER_SIZE); - AddLog(LOG_LEVEL_DEBUG_MORE, PSTR("UFS: UfsEditor: read=%d"), l); + AddLog(LOG_LEVEL_DEBUG_MORE, PSTR(D_LOG_UFS "UfsEditor: read=%d"), l); if (l < 0) { break; } buf[l] = '\0'; WSContentSend_P(PSTR("%s"), HtmlEscape((char*)buf).c_str()); @@ -1719,7 +1719,7 @@ void UfsEditor(void) { } fp.close(); free(buf); - AddLog(LOG_LEVEL_DEBUG, PSTR("UFS: UfsEditor: read done")); + AddLog(LOG_LEVEL_DEBUG, PSTR(D_LOG_UFS "UfsEditor: read done")); } } else { WSContentSend_P(D_NEW_FILE); @@ -1732,12 +1732,12 @@ void UfsEditor(void) { } void UfsEditorUpload(void) { - AddLog(LOG_LEVEL_DEBUG, PSTR("UFS: UfsEditor: file upload")); + AddLog(LOG_LEVEL_DEBUG, PSTR(D_LOG_UFS "UfsEditor: file upload")); if (!HttpCheckPriviledgedAccess()) { return; } if (!Webserver->hasArg("name")) { - AddLog(LOG_LEVEL_ERROR, PSTR("UFS: UfsEditor: file upload - no filename")); + AddLog(LOG_LEVEL_ERROR, PSTR(D_LOG_UFS "UfsEditor: file upload - no filename")); WSSend(400, CT_PLAIN, F("400: Bad request - no filename")); return; } @@ -1746,10 +1746,10 @@ void UfsEditorUpload(void) { WebGetArg(PSTR("name"), fname_input, sizeof(fname_input)); char fname[UFS_FILENAME_SIZE]; UfsFilename(fname, fname_input); // Trim spaces and add slash - AddLog(LOG_LEVEL_DEBUG, PSTR("UFS: UfsEditor: file '%s'"), fname); + AddLog(LOG_LEVEL_DEBUG, PSTR(D_LOG_UFS "UfsEditor: file '%s'"), fname); if (!Webserver->hasArg("content")) { - AddLog(LOG_LEVEL_ERROR, PSTR("UFS: UfsEditor: file upload - no content")); + AddLog(LOG_LEVEL_ERROR, PSTR(D_LOG_UFS "UfsEditor: file upload - no content")); WSSend(400, CT_PLAIN, F("400: Bad request - no content")); return; } @@ -1757,7 +1757,7 @@ void UfsEditorUpload(void) { if (!dfsp) { Web.upload_error = 1; - AddLog(LOG_LEVEL_ERROR, PSTR("UFS: UfsEditor: 507: no storage available")); + AddLog(LOG_LEVEL_ERROR, PSTR(D_LOG_UFS "UfsEditor: 507: no storage available")); WSSend(507, CT_PLAIN, F("507: no storage available")); return; } @@ -1782,7 +1782,7 @@ void UfsEditorUpload(void) { File fp = dfsp->open(fname, "w"); if (!fp) { Web.upload_error = 1; - AddLog(LOG_LEVEL_ERROR, PSTR("UFS: UfsEditor: 400: invalid file name '%s'"), fname); + AddLog(LOG_LEVEL_ERROR, PSTR(D_LOG_UFS "UfsEditor: 400: invalid file name '%s'"), fname); WSSend(400, CT_PLAIN, F("400: bad request - invalid filename")); return; } @@ -1793,7 +1793,7 @@ void UfsEditorUpload(void) { } if (!fp.print(content)) { - AddLog(LOG_LEVEL_ERROR, PSTR("UFS: UfsEditor: write error on '%s'"), fname); + AddLog(LOG_LEVEL_ERROR, PSTR(D_LOG_UFS "UfsEditor: write error on '%s'"), fname); } fp.close(); @@ -1826,7 +1826,7 @@ void FTP_Server(uint32_t mode) { } else { ftpSrv->begin(USER_FTP,PW_FTP, ffsp); } - AddLog(LOG_LEVEL_INFO, PSTR("UFS: FTP Server started in mode: '%d'"), mode); + AddLog(LOG_LEVEL_INFO, PSTR(D_LOG_UFS "FTP Server started in mode: '%d'"), mode); } else { if (ftpSrv) { delete ftpSrv; diff --git a/tasmota/tasmota_xdrv_driver/xdrv_52_0_berry_struct.ino b/tasmota/tasmota_xdrv_driver/xdrv_52_0_berry_struct.ino index ad1fd1f8f..a56df0832 100644 --- a/tasmota/tasmota_xdrv_driver/xdrv_52_0_berry_struct.ino +++ b/tasmota/tasmota_xdrv_driver/xdrv_52_0_berry_struct.ino @@ -94,8 +94,11 @@ public: bool rules_busy = false; // are we already processing rules, avoid infinite loop bool web_add_handler_done = false; // did we already sent `web_add_handler` event #ifdef USE_BERRY_LEDS_PANEL - bool leds_panel_loaded = false; // did we already load Parition_Wizard + bool leds_panel_loaded = false; // did we already load Leds Panel #endif // USE_BERRY_LEDS_PANEL +#ifdef USE_BERRY_LVGL_PANEL + bool lvgl_panel_loaded = true; // did we already load LVGL Panel, default true, changed to false when LVGL starts +#endif // USE_BERRY_LVGL_PANEL #ifdef USE_BERRY_PARTITION_WIZARD bool partition_wizard_loaded = false; // did we already load Parition_Wizard #endif // USE_BERRY_PARTITION_WIZARD @@ -137,6 +140,16 @@ const BeBECCode_t BECCode[] = { }, #endif // USE_BERRY_LEDS_PANEL +#if defined(USE_BERRY_LVGL_PANEL) && defined(USE_LVGL) + { + "LVGL Mirroring", + "lvgl_panel", + USE_BERRY_LVGL_PANEL_URL, + "/?", + &berry.lvgl_panel_loaded + }, +#endif // USE_BERRY_LEDS_PANEL + #ifdef USE_BERRY_PARTITION_WIZARD { "Partition Wizard", diff --git a/tasmota/tasmota_xdrv_driver/xdrv_52_3_berry_tasmota.ino b/tasmota/tasmota_xdrv_driver/xdrv_52_3_berry_tasmota.ino index 9a642cea9..0cd9c964c 100644 --- a/tasmota/tasmota_xdrv_driver/xdrv_52_3_berry_tasmota.ino +++ b/tasmota/tasmota_xdrv_driver/xdrv_52_3_berry_tasmota.ino @@ -982,7 +982,7 @@ extern "C" { be_return(vm); } - // Berry: `arvh() -> string` + // Berry: `arch() -> string` // ESP object int32_t l_arch(bvm *vm); int32_t l_arch(bvm *vm) { @@ -1089,8 +1089,11 @@ extern "C" { if (len+3 > LOGSZ) { strcat(log_data, "..."); } // Actual data is more TasConsole.printf(log_data); #ifdef USE_SERIAL_BRIDGE - SerialBridgePrintf(log_data); + SerialBridgeWrite(log_data, strlen(log_data)); #endif // USE_SERIAL_BRIDGE +#ifdef USE_TELNET + TelnetWrite(log_data, strlen(log_data)); +#endif // USE_TELNET } void berry_log_C(const char * berry_buf, ...) { diff --git a/tasmota/tasmota_xdrv_driver/xdrv_52_3_berry_tcpclientasync.ino b/tasmota/tasmota_xdrv_driver/xdrv_52_3_berry_tcpclientasync.ino index 69341f1d3..22aedd520 100644 --- a/tasmota/tasmota_xdrv_driver/xdrv_52_3_berry_tcpclientasync.ino +++ b/tasmota/tasmota_xdrv_driver/xdrv_52_3_berry_tcpclientasync.ino @@ -21,8 +21,6 @@ #ifdef USE_BERRY -#ifdef USE_WEBCLIENT - #include // #include "be_sys.h" #include @@ -580,5 +578,4 @@ extern "C" { } -#endif // USE_WEBCLIENT #endif // USE_BERRY diff --git a/tasmota/tasmota_xdrv_driver/xdrv_52_3_berry_udp.ino b/tasmota/tasmota_xdrv_driver/xdrv_52_3_berry_udp.ino index 0bdba475d..a263cb8d2 100644 --- a/tasmota/tasmota_xdrv_driver/xdrv_52_3_berry_udp.ino +++ b/tasmota/tasmota_xdrv_driver/xdrv_52_3_berry_udp.ino @@ -21,14 +21,6 @@ #ifdef USE_BERRY - -#ifdef USE_WEBCLIENT - -// extern int be_udp_init(bvm *vm); -// extern int be_udp_deinit(bvm *vm); -// extern int be_udp_begin(bvm *vm); -// extern int be_udp_begin_mcast(bvm *vm); - #include #include #include "be_mapping.h" @@ -151,5 +143,4 @@ extern "C" { } } -#endif // USE_WEBCLIENT #endif // USE_BERRY diff --git a/tasmota/tasmota_xdrv_driver/xdrv_52_3_berry_webclient.ino b/tasmota/tasmota_xdrv_driver/xdrv_52_3_berry_webclient.ino index eb5b7feb4..c1be9bb33 100644 --- a/tasmota/tasmota_xdrv_driver/xdrv_52_3_berry_webclient.ino +++ b/tasmota/tasmota_xdrv_driver/xdrv_52_3_berry_webclient.ino @@ -21,8 +21,6 @@ #ifdef USE_BERRY -#ifdef USE_WEBCLIENT - #include #include "HttpClientLight.h" #include "be_sys.h" @@ -750,5 +748,4 @@ extern "C" { } } -#endif // USE_WEBCLIENT #endif // USE_BERRY diff --git a/tasmota/tasmota_xdrv_driver/xdrv_52_7_berry_embedded.ino b/tasmota/tasmota_xdrv_driver/xdrv_52_7_berry_embedded.ino index d7dfdfda8..e46f79f32 100644 --- a/tasmota/tasmota_xdrv_driver/xdrv_52_7_berry_embedded.ino +++ b/tasmota/tasmota_xdrv_driver/xdrv_52_7_berry_embedded.ino @@ -23,9 +23,11 @@ /*********************************************************************************************\ * Handlers for Berry calls and async * + * This is called right after Berry is initialized + * and before the main loop is started. \*********************************************************************************************/ -const char berry_prog[] = +const char be_berry_init_code[] = "import global " #ifdef USE_BERRY_PYTHON_COMPAT @@ -97,6 +99,26 @@ const char berry_prog[] = "import matter " "global.matter_device = matter.Device() " #endif - ; +; + + +/*********************************************************************************************\ + * This is called after `autoexec.be` is executed +\*********************************************************************************************/ +const char be_post_autoxec_code[] = + "" // fallback to empty string +#if defined(USE_LVGL) && defined(USE_LVGL_HASPMOTA) + // HASPmota init + "do " + "import path " + "import display " + "if display.started() && path.exists('/pages.jsonl') " + "import haspmota " + "global.haspmota = haspmota " // make sure the global is also defined + "haspmota.start() " + "end " + "end " +#endif // USE_LVGL_HASPMOTA +; #endif // USE_BERRY diff --git a/tasmota/tasmota_xdrv_driver/xdrv_52_9_berry.ino b/tasmota/tasmota_xdrv_driver/xdrv_52_9_berry.ino index 63c69cdcc..b79acfe4c 100644 --- a/tasmota/tasmota_xdrv_driver/xdrv_52_9_berry.ino +++ b/tasmota/tasmota_xdrv_driver/xdrv_52_9_berry.ino @@ -176,6 +176,29 @@ int32_t callBerryEventDispatcher(const char *type, const char *cmd, int32_t idx, return ret; } +// execute an arbitrary string containing Berry code +int32_t callBerryString(bvm *vm, const char *code_source); +int32_t callBerryString(bvm *vm, const char *code_source) { + // do nothing if NULL or empty string + if (code_source == nullptr || code_source[0] == '\0') { return 0; } + + int32_t ret_code; + ret_code = be_loadstring(vm, code_source); + if (ret_code == 0) { + ret_code = be_pcall(berry.vm, 0); + if (ret_code == 0) { + if (be_top(vm) > 1) { + be_error_pop_all(berry.vm); // clear Berry stack + } else { + be_pop(berry.vm, 1); + } + return 0; // no error + } + } + be_error_pop_all(vm); // clear Berry stack + return ret_code; +} + // simple wrapper to call `tasmota.()` static void callBerryTasmotaFunc(const char * method_name) { bvm *vm = berry.vm; @@ -364,7 +387,7 @@ void BerryInit(void) { be_set_obs_micros(berry.vm, (bmicrosfnct)µs); comp_set_named_gbl(berry.vm); /* Enable named globals in Berry compiler */ comp_set_strict(berry.vm); /* Enable strict mode in Berry compiler, equivalent of `import strict` */ - be_set_ctype_func_hanlder(berry.vm, be_call_ctype_func); + be_set_ctype_func_handler(berry.vm, be_call_ctype_func); if (UsePSRAM()) { // if PSRAM is available, raise the max size to 512kb berry.vm->bytesmaxsize = 512 * 1024; @@ -375,23 +398,9 @@ void BerryInit(void) { // Set the GC threshold to 3584 bytes to avoid the first useless GC berry.vm->gc.threshold = 3584; - ret_code1 = be_loadstring(berry.vm, berry_prog); - if (ret_code1 != 0) { - be_error_pop_all(berry.vm); // clear Berry stack + if (callBerryString(berry.vm, be_berry_init_code) != 0) { break; } - // AddLog(LOG_LEVEL_DEBUG, PSTR(D_LOG_BERRY "Berry code loaded, RAM used=%u"), be_gc_memcount(berry.vm)); - ret_code2 = be_pcall(berry.vm, 0); - if (ret_code1 != 0) { - be_error_pop_all(berry.vm); // clear Berry stack - break; - } - // AddLog(LOG_LEVEL_DEBUG, PSTR(D_LOG_BERRY "Berry code ran, RAM used=%u"), be_gc_memcount(berry.vm)); - if (be_top(berry.vm) > 1) { - be_error_pop_all(berry.vm); // clear Berry stack - } else { - be_pop(berry.vm, 1); - } AddLog(LOG_LEVEL_INFO, PSTR(D_LOG_BERRY "Berry initialized, RAM used %u bytes"), callBerryGC()); berry_init_ok = true; @@ -402,7 +411,7 @@ void BerryInit(void) { berry.leds_panel_loaded = !PinUsed(GPIO_WS2812); #endif // USE_BERRY_LEDS_PANEL - // we generate a synthetic event `autoexec` + // we generate a synthetic event `preinit` callBerryEventDispatcher(PSTR("preinit"), nullptr, 0, nullptr); // Run pre-init @@ -889,6 +898,13 @@ extern "C" bbool BerryBECLoader(const char * url) { return true; } +#else // No USE_WEBSERVER + +extern "C" bbool BerryBECLoader(const char * url) { + AddLog(LOG_LEVEL_INFO, "BRY: web server disabled"); + return false; +} + #endif // USE_WEBSERVER /*********************************************************************************************\ @@ -897,6 +913,7 @@ extern "C" bbool BerryBECLoader(const char * url) { bool Xdrv52(uint32_t function) { bool result = false; + if (berry.vm == NULL) { return result; } switch (function) { case FUNC_SLEEP_LOOP: @@ -913,6 +930,7 @@ bool Xdrv52(uint32_t function) callBerryEventDispatcher(PSTR("autoexec"), nullptr, 0, nullptr); BrLoad("autoexec.be"); // run autoexec.be at first tick, so we know all modules are initialized + callBerryString(berry.vm, be_post_autoxec_code); berry.autoexec_done = true; #ifdef USE_WEBSERVER @@ -1019,7 +1037,7 @@ bool Xdrv52(uint32_t function) case FUNC_WEB_ADD_CONSOLE_BUTTON: if (XdrvMailbox.index) { XdrvMailbox.index++; - } else if (berry.vm != NULL) { + } else { WSContentSend_P(HTTP_BTN_BERRY_CONSOLE); HandleBerryBECLoaderButton(); // display buttons to load BEC files callBerryEventDispatcher(PSTR("web_add_button"), nullptr, 0, nullptr); diff --git a/tasmota/tasmota_xdrv_driver/xdrv_54_lvgl.ino b/tasmota/tasmota_xdrv_driver/xdrv_54_lvgl.ino index bd2aa1295..abcaee71d 100644 --- a/tasmota/tasmota_xdrv_driver/xdrv_54_lvgl.ino +++ b/tasmota/tasmota_xdrv_driver/xdrv_54_lvgl.ino @@ -459,6 +459,7 @@ void start_lvgl(const char * uconfig) { // Initialize LvGL display driver lvgl_glue->lv_display = lv_display_create(renderer->width(), renderer->height()); + lv_display_set_dpi(lvgl_glue->lv_display, 160); // set display to 160 DPI instead of default 130 DPI to avoid some rounding in styles lv_display_set_flush_cb(lvgl_glue->lv_display, lv_flush_callback); lv_display_set_buffers(lvgl_glue->lv_display, lvgl_glue->lv_pixel_buf, lvgl_glue->lv_pixel_buf2, lvgl_buffer_size * (LV_COLOR_DEPTH / 8), LV_DISPLAY_RENDER_MODE_PARTIAL); @@ -483,6 +484,10 @@ void start_lvgl(const char * uconfig) { lv_obj_set_style_bg_color(lv_screen_active(), lv_color_hex(USE_LVGL_BG_DEFAULT), static_cast(LV_PART_MAIN) | static_cast(LV_STATE_DEFAULT)); lv_obj_set_style_bg_opa(lv_screen_active(), LV_OPA_COVER, static_cast(LV_PART_MAIN) | static_cast(LV_STATE_DEFAULT)); +#ifdef USE_BERRY_LVGL_PANEL + berry.lvgl_panel_loaded = false; // we can load the panel +#endif // USE_BERRY_LVGL_PANEL + #if LV_USE_LOG lv_log_register_print_cb(lvbe_debug); #endif // LV_USE_LOG diff --git a/tasmota/tasmota_xdrv_driver/xdrv_77_wizmote.ino b/tasmota/tasmota_xdrv_driver/xdrv_77_wizmote.ino index 13194e7ae..76e52822e 100644 --- a/tasmota/tasmota_xdrv_driver/xdrv_77_wizmote.ino +++ b/tasmota/tasmota_xdrv_driver/xdrv_77_wizmote.ino @@ -10,28 +10,57 @@ /*********************************************************************************************\ * WiZ WiFi ESP-NOW Smart Remote decoder * - * Example rule + * Enable with command `SetOption164 1` + * + * If USE_WIZMOTE_COMMISSION is enabled you have a WIZMOTE_COMMISSION_WINDOW after restart or + * after command `SetOption164 1` to register a persistent WiZMote id by pressing the ON button + * three times. This supports multi-press power control. If a light is configured it supports + * dimming control too. In that case no rule is needed. + * Pressing the OFF button three times will de-register the WizMote id. + * + * Example rule for color led * on wizmote#action do var1 %value% endon - Store current button - * on wizmote#id=12318994 do event action=%var1% endon - Test for correct Id and execute event + * on wizmote#id=12318994 do event action=%var1% endon - Test for correct Id (12318994) and execute event * on event#action=on do power 1 endon - On button ON do power 1 * on event#action=off do power 0 endon - On button OFF do power 0 * on event#action=bd do dimmer - endon - On button Brihtness - do dimmer - (10% decrease) * on event#action=bu do dimmer + endon - On button Brightness + do dimmer + (10% increase) * on event#action=bn do dimmer 20 endon - On button Moon do dimmer 20 + * on event#action=b1 do scheme 0 endon - On button 1 do scheme 0 (fixed color) + * on event#action=b2 do scheme 3 endon - On button 2 do scheme 3 (rotating colors) + * on event#action=b3 do speed - endon - On button 3 do rotating speed decrease + * on event#action=b4 do speed + endon - On button 4 do rotating speed increase \*********************************************************************************************/ -#define XDRV_77 77 +#define XDRV_77 77 #ifndef WIZMOTE_CHANNEL -#define WIZMOTE_CHANNEL 1 // WiZ Smart Remote ESP-NOW channel if WiFi is disabled +#define WIZMOTE_CHANNEL 1 // WiZ Smart Remote ESP-NOW channel if WiFi is disabled +#endif + +//#define USE_WIZMOTE_COMMISSION // Enable commission support for control without rules (+0.5k code) +#ifndef WIZMOTE_COMMISSION_WINDOW +#define WIZMOTE_COMMISSION_WINDOW 10 // (seconds) Commission window +#endif +#ifndef WIZMOTE_MULTI_PRESS_WINDOW +#define WIZMOTE_MULTI_PRESS_WINDOW 500 // (milliseconds) Multi-press detection window #endif #include struct WizMote { + int rssi; uint32_t last_seq; uint32_t id; - int rssi; + +#ifdef USE_WIZMOTE_COMMISSION + uint32_t comm_id; + uint32_t comm_window; + uint32_t last_press; + uint8_t count; + uint8_t delayed_index; +#endif // USE_WIZMOTE_COMMISSION + uint8_t index; uint8_t battery_level; uint8_t active; @@ -121,11 +150,89 @@ void WizMoteHandleRemoteData(uint8_t *mac, uint8_t *incoming_data, size_t len, s WizMote.last_seq = incoming->sequence; } +#ifdef USE_WIZMOTE_COMMISSION +void WizMoteCommissionInit(void) { + WizMote.count = 0; + WizMote.comm_window = TasmotaGlobal.uptime + WIZMOTE_COMMISSION_WINDOW; + if (!PinUsed(GPIO_CC1101_GDO0)) { + WizMote.comm_id = Settings->keeloq_serial; + } +} +#endif // USE_WIZMOTE_COMMISSION + void WizMoteResponse(void) { - // This needs to be executed here as it will panic if placed within the above Callback + // This needs to be executed here as it will panic if placed within the WizMoteHandleRemoteData Callback + +#ifdef USE_WIZMOTE_COMMISSION + uint32_t now; + if (WizMote.comm_id == WizMote.id) { // Commissioned id + now = millis(); + if (WizMote.delayed_index && WizMote.count && (WizMote.last_press < now)) { + ExecuteCommandPower(WizMote.count, WizMote.delayed_index -1, SRC_REMOTE); + WizMote.delayed_index = 0; + } + } +#endif // USE_WIZMOTE_COMMISSION + + if (0 == WizMote.index) { return; } // No key pressed so exit + +#ifdef USE_WIZMOTE_COMMISSION + if (WizMote.comm_window > TasmotaGlobal.uptime) { // Max WIZMOTE_COMMISSION_WINDOW seconds after restart or enabling SO164 + if (((0 == WizMote.comm_id) && (2 == WizMote.index)) || // ON button commissioning + ((WizMote.id == WizMote.comm_id) && (1 == WizMote.index))) { // OFF button de-commissioning + WizMote.count++; + if (3 == WizMote.count) { + WizMote.comm_id = (2 == WizMote.index) ? WizMote.id : 0; + if (!PinUsed(GPIO_CC1101_GDO0)) { + Settings->keeloq_serial = WizMote.comm_id; + } + WizMote.comm_window = TasmotaGlobal.uptime; + AddLog(LOG_LEVEL_DEBUG, PSTR("WIZ: %sommissioned"), (WizMote.comm_id) ? "C" : "Dec"); + ExecuteCommandPower(1, 2, SRC_REMOTE); // Toggle light as feedback of (de)commission + delay(500); + ExecuteCommandPower(1, 2, SRC_REMOTE); + } + } + WizMote.index = 0; + return; + } + + if (WizMote.comm_id == WizMote.id) { // Commissioned id + switch(WizMote.index) { + case 1: // OFF + case 2: // ON + if (WizMote.last_press < now) { + WizMote.count = 1; + } else { + WizMote.count++; + } + WizMote.last_press = now + WIZMOTE_MULTI_PRESS_WINDOW; + WizMote.delayed_index = WizMote.index; + WizMote.index = 0; + break; +#ifdef USE_LIGHT + case 3: // Moon + case 8: // Bright up + case 9: // Bright down + if (TasmotaGlobal.light_type) { // Any light + char scmnd[16]; + snprintf_P(scmnd, sizeof(scmnd), PSTR(D_CMND_DIMMER " %s"), + (3 == WizMote.index) ? "20" : (8 == WizMote.index) ? "+" : "-"); + ExecuteCommand(scmnd, SRC_REMOTE); + WizMote.index = 0; + } + break; +#endif // USE_LIGHT + default: + WizMote.delayed_index = 0; + } + if (!WizMote.index) { return; } + } +#endif // USE_WIZMOTE_COMMISSION + char text[5]; - Response_P(PSTR("{\"WiZMote\":{\"Id\":%d,\"Action\":\"%s\",\"RSSI\":%d,\"Battery\":%d}}"), - WizMote.id, GetTextIndexed(text, sizeof(text), WizMote.index, kWMButtons), WizMote.rssi, WizMote.battery_level); + Response_P(PSTR("{\"WiZMote\":{\"Id\":%d,\"Seq\":%d,\"Action\":\"%s\",\"RSSI\":%d,\"Batt\":%d}}"), + WizMote.id, WizMote.last_seq, GetTextIndexed(text, sizeof(text), WizMote.index, kWMButtons), WizMote.rssi, WizMote.battery_level); if (Settings->flag6.mqtt_disable_publish ) { // SetOption147 - If it is activated, Tasmota will not publish MQTT message, but it will proccess event trigger rules XdrvRulesProcess(0); } else { @@ -177,6 +284,11 @@ void EspNowInit(void) { quickEspNow.onDataRcvd(EspNowDataReceived); Settings->flag.global_state = 1; // SetOption31 - (Wifi, MQTT) Control link led blinking (1) AddLog(LOG_LEVEL_INFO, PSTR("NOW: Started on channel " STR(WIZMOTE_CHANNEL))); + +#ifdef USE_WIZMOTE_COMMISSION + WizMoteCommissionInit(); +#endif // USE_WIZMOTE_COMMISSION + WizMote.active = 2; } } @@ -189,6 +301,11 @@ void EspNowInit(void) { if (quickEspNow.begin()) { quickEspNow.onDataRcvd(EspNowDataReceived); AddLog(LOG_LEVEL_INFO, PSTR("NOW: Started")); + +#ifdef USE_WIZMOTE_COMMISSION + WizMoteCommissionInit(); +#endif // USE_WIZMOTE_COMMISSION + WizMote.active = 1; } } @@ -217,9 +334,8 @@ bool Xdrv77(uint32_t function) { else if (WizMote.active) { switch (function) { case FUNC_LOOP: - if (WizMote.index > 0) { - WizMoteResponse(); - } + case FUNC_SLEEP_LOOP: + WizMoteResponse(); break; case FUNC_ACTIVE: result = true; diff --git a/tasmota/tasmota_xdrv_driver/xdrv_78_telnet.ino b/tasmota/tasmota_xdrv_driver/xdrv_78_telnet.ino new file mode 100644 index 000000000..0c7cfb508 --- /dev/null +++ b/tasmota/tasmota_xdrv_driver/xdrv_78_telnet.ino @@ -0,0 +1,403 @@ +/* + xdrv_78_telnet.ino - Telnet console support for Tasmota + + SPDX-FileCopyrightText: 2025 Theo Arends + + SPDX-License-Identifier: GPL-3.0-only +*/ + +#ifdef USE_TELNET +/*********************************************************************************************\ + * Telnet console support for a single connection + * + * Supported commands: + * Telnet - Show telnet server state + * Telnet 0 - Disable telnet server + * Telnet 1 - Enable telnet server on port TELNET_PORT + * Telnet 23 - Enable telnet server on port 23 + * Telnet 1, 192.168.2.1 - Enable telnet server and only allow connection from 192.168.2.1 + * TelnetBuffer - Show current input buffer size (default 256) + * TelnetBuffer 300 - Change input buffer size to 300 characters + * TelnetColor - Show prompt, response and log colors + * TelnetColor 0 - Disable color codes from output + * TelnetColor 1 - Set colors to defined colors + * TelnetColor 2 - Enable last set colors + * TelnetColor 33,32,37 - Set prompt (yellow), response (green) and log (white) colors + * + * To start telnet at restart: + * Add one of below rules like + * on system#boot do backlog telnetcolor 33,32,36; telnet 1 endon + * on system#boot do backlog telnetcolor 0; telnet 1 endon + * Enable compile option TELNET_START + * + * Supported ANSI Escape Color codes: + * Normal Bright + * Black 30 90 + * Red 31 91 + * Green 32 92 + * Yellow 33 93 + * Blue 34 94 + * Magenta 35 95 + * Cyan 36 96 + * White 37 97 + * Default 39 + * + * Terminate telnet session with command exit or quit +\*********************************************************************************************/ + +#define XDRV_78 78 + +#ifndef TELNET_BUF_SIZE +#define TELNET_BUF_SIZE 256 // [TelnetBuffer] Size of input buffer (default 256) +#endif + +#ifndef TELNET_START +#define TELNET_START 0 // [Telnet] Start telnet on network connection (default 0 - No start) +#endif +#ifndef TELNET_PORT +#define TELNET_PORT 23 // [Telnet] Telnet port (default 23) +#endif + +#ifndef TELNET_COL_DISABLE +#define TELNET_COL_DISABLE 0 // [TelnetColor] Disable colors (default 0 - Enable colors) +#endif +#ifndef TELNET_COL_PROMPT +#define TELNET_COL_PROMPT 33 // [TelnetColor] ANSI color escape code (default 33 - Yellow) +#endif +#ifndef TELNET_COL_RESPONSE +#define TELNET_COL_RESPONSE 32 // [TelnetColor] ANSI color escape code (default 32 - Green) +#endif +#ifndef TELNET_COL_LOGGING +#define TELNET_COL_LOGGING 36 // [TelnetColor] ANSI color escape code (default 36 - Cyan) +#endif + +const char kTelnetExits[] PROGMEM = "exit|quit"; + +struct { + WiFiServer *server = nullptr; + WiFiClient client; + IPAddress ip_filter; + char *buffer = nullptr; + uint16_t port; + uint16_t buffer_size; + uint16_t in_byte_counter; + uint8_t log_index; + uint8_t prompt; + uint8_t color[3]; + bool ip_filter_enabled; + bool color_disable; + bool overrun; +} Telnet; + +/********************************************************************************************/ + +void TelnetWriteColor(uint32_t color) { + if (!Telnet.color_disable) { + Telnet.client.printf("\x1b[%dm", color); + } +} + +void TelnetWrite(char *line, uint32_t len) { + if (Telnet.client) { + if (3 == Telnet.prompt) { // Print linefeed for non-requested data + Telnet.prompt = 2; // Do not print linefeed for any data and use log color + Telnet.client.println(); + } + // line = 14:49:36.123-017 MQTT: stat/wemos5/RESULT = {"POWER":"OFF"} + uint32_t textcolor = Telnet.color[Telnet.prompt]; + uint32_t diffcolor = textcolor; + if ((textcolor >= 30) && (textcolor <= 37)) { + diffcolor += 60; // Highlight color + } + else if ((textcolor >= 90) && (textcolor <= 97)) { + diffcolor -= 60; // Lowlight color + } + char* time_end = (char*)memchr(line, ' ', len); // Find first word (usually 14:49:36.123-017) + uint32_t time_len = time_end - line; + TelnetWriteColor(diffcolor); + Telnet.client.write(line, time_len); + TelnetWriteColor(textcolor); + Telnet.client.write(time_end, len - time_len); + TelnetWriteColor(0); + Telnet.client.println(); + } +} + +void TelnetGetLog(void) { + uint32_t index = Telnet.log_index; // Dump log buffer + char* line; + size_t len; + while (GetLog(TasmotaGlobal.seriallog_level, &index, &line, &len)) { + TelnetWrite(line, len -1); + } + Telnet.log_index = index; +} + +/********************************************************************************************/ + +void TelnetLoop(void) { +#ifdef USE_XYZMODEM + if (XYZModemActive(TXMP_TELNET)) { return; } +#endif // USE_XYZMODEM + + // check for a new client connection + if ((Telnet.server) && (Telnet.server->hasClient())) { + WiFiClient new_client = Telnet.server->available(); + + AddLog(LOG_LEVEL_INFO, PSTR(D_LOG_TELNET "Connection from %s"), new_client.remoteIP().toString().c_str()); + + if (Telnet.ip_filter_enabled) { // Check for IP filtering if it's enabled + if (Telnet.ip_filter != new_client.remoteIP()) { + AddLog(LOG_LEVEL_INFO, PSTR(D_LOG_TELNET "Rejected due to filtering")); + new_client.stop(); + } + } + + if (Telnet.client) { + Telnet.client.stop(); + } + Telnet.client = new_client; + if (Telnet.client) { + SetMinimumSeriallog(); + Telnet.client.printf("Tasmota %s %s (%s) %s\r\n", NetworkHostname(), TasmotaGlobal.version, GetBuildDateAndTime().c_str(), GetDeviceHardware().c_str()); + Telnet.prompt = 3; // Print linefeed for non-requested data and use log color + Telnet.log_index = 1; // Dump start of log buffer for restart messages + TelnetGetLog(); + Telnet.prompt = 1; // Print prompt after requested data and use response color + } + } + + if (Telnet.client) { + // Output latest data +#ifdef ESP8266 + TelnetGetLog(); // As heap is low on ESP8266 it uses log output +#endif + if (1 == Telnet.prompt) { + TelnetWriteColor(Telnet.color[0]); + Telnet.client.printf("%s:# ", NetworkHostname()); + TelnetWriteColor(0); + Telnet.prompt = 3; // Print linefeed for non-requested data and use log color + while (Telnet.client.available()) { Telnet.client.read(); } // Flush input + return; + } + + // Input keyboard data + while (Telnet.client.available()) { + yield(); + uint8_t in_byte = Telnet.client.read(); + +#ifdef USE_XYZMODEM + if (XYZModemWifiClientStart(&Telnet.client, in_byte)) { return; } +#endif // USE_XYZMODEM + + if (isprint(in_byte)) { // Any char between 32 and 127 + if (Telnet.in_byte_counter < Telnet.buffer_size -1) { // Add char to string if it still fits + Telnet.buffer[Telnet.in_byte_counter++] = in_byte; + } else { + Telnet.overrun = true; + } + } + else if (in_byte == '\n') { + Telnet.client.write("\r"); // Move cursor to begin of line (needed for non-buffered input) + Telnet.buffer[Telnet.in_byte_counter] = 0; // Telnet data completed + Telnet.prompt = 1; // Print prompt after requested data and use response color + SetMinimumSeriallog(); + if (Telnet.overrun) { + AddLog(LOG_LEVEL_INFO, PSTR(D_LOG_TELNET "Buffer overrun")); + } else { + char command[CMDSZ]; + if (GetCommandCode(command, sizeof(command), Telnet.buffer, kTelnetExits) >= 0) { + AddLog(LOG_LEVEL_INFO, PSTR(D_LOG_TELNET "Connection closed")); + Telnet.client.stop(); + } else { + AddLog(LOG_LEVEL_INFO, PSTR(D_LOG_TELNET "%s"), Telnet.buffer); + ExecuteCommand(Telnet.buffer, SRC_TELNET); + } + } + Telnet.in_byte_counter = 0; + Telnet.overrun = false; + return; + } + } + } +} + +/********************************************************************************************/ + +void TelnetStop(void) { + if (Telnet.client) { + Telnet.client.stop(); + } + if (Telnet.server) { + Telnet.server->stop(); + delete Telnet.server; + Telnet.server = nullptr; + } + free(Telnet.buffer); + Telnet.buffer = nullptr; +} + +void TelnetStart(void) { + if (Telnet.server) { + TelnetStop(); + } + if (Telnet.port > 0) { + if (!Telnet.buffer) { + Telnet.buffer = (char*)malloc(Telnet.buffer_size); + } + if (Telnet.buffer) { + if (1 == Telnet.port) { Telnet.port = TELNET_PORT; } + Telnet.server = new WiFiServer(Telnet.port); + Telnet.server->begin(); // Start Telnet server + Telnet.server->setNoDelay(true); + AddLogServerActive(PSTR(D_LOG_TELNET "Telnet")); + return; + } + } + AddLog(LOG_LEVEL_INFO, PSTR(D_LOG_TELNET "Stopped")); +} + +void TelnetInit(void) { + Telnet.buffer_size = TELNET_BUF_SIZE; + Telnet.color_disable = TELNET_COL_DISABLE; + Telnet.color[0] = TELNET_COL_PROMPT; + Telnet.color[1] = TELNET_COL_RESPONSE; + Telnet.color[2] = TELNET_COL_LOGGING; + Telnet.port = (TELNET_START) ? TELNET_PORT : 0; +} + +/*********************************************************************************************\ + * Commands +\*********************************************************************************************/ + +const char kTelnetCommands[] PROGMEM = "Telnet|" // Prefix + "|Buffer|Color"; + +void (* const TelnetCommand[])(void) PROGMEM = { + &CmndTelnet, &CmndTelnetBuffer, &CmndTelnetColor }; + +void CmndTelnet(void) { + // Telnet - Show telnet server state + // Telnet 0 - Disable telnet server + // Telnet 1 - Enable telnet server on port TELNET_PORT + // Telnet 23 - Enable telnet server on port 23 + // Telnet 1, 192.168.2.1 - Enable telnet server and only allow connection from 192.168.2.1 + if (!TasmotaGlobal.global_state.network_down) { + if (XdrvMailbox.data_len) { + Telnet.port = XdrvMailbox.payload; + + if (ArgC() == 2) { + char sub_string[XdrvMailbox.data_len]; + Telnet.ip_filter.fromString(ArgV(sub_string, 2)); + Telnet.ip_filter_enabled = true; + } else { + Telnet.ip_filter_enabled = false; // Disable whitelist if previously set + } + + TelnetStart(); + } + if (Telnet.server) { + ResponseCmndChar_P(PSTR("Started")); + } else { + ResponseCmndChar_P(PSTR("Stopped")); + } + } +} + +void CmndTelnetBuffer(void) { + // TelnetBuffer - Show current input buffer size (default 256) + // TelnetBuffer 300 - Change input buffer size to 300 characters + if (XdrvMailbox.data_len > 0) { + uint16_t bsize = Telnet.buffer_size; + Telnet.buffer_size = XdrvMailbox.payload; + if (XdrvMailbox.payload < MIN_INPUT_BUFFER_SIZE) { + Telnet.buffer_size = MIN_INPUT_BUFFER_SIZE; // 256 / 256 + } + else if (XdrvMailbox.payload > INPUT_BUFFER_SIZE) { + Telnet.buffer_size = INPUT_BUFFER_SIZE; // 800 + } + + if (Telnet.buffer && (bsize != Telnet.buffer_size)) { + Telnet.buffer = (char*)realloc(Telnet.buffer, Telnet.buffer_size); + if (!Telnet.buffer) { + TelnetStop(); + ResponseCmndChar_P(PSTR("Stopped")); + return; + } + } + } + ResponseCmndNumber(Telnet.buffer_size); +} + +void CmndTelnetColor(void) { + // TelnetColor - Show prompt, response and log colors + // TelnetColor 0 - Disable color codes from output + // TelnetColor 1 - Set colors to defined colors + // TelnetColor 2 - Enable last set colors + // TelnetColor 33,32,37 - Set prompt (yellow), response (green) and log (white) colors + if (XdrvMailbox.data_len > 0) { + uint32_t colors[sizeof(Telnet.color)]; + uint32_t count = ParseParameters(sizeof(Telnet.color), colors); + Telnet.color_disable = false; + if (1 == count) { + if (0 == colors[0]) { // TelnetColor 0 + Telnet.color_disable = true; + } + else if (1 == colors[0]) { // TelnetColor 1 + Telnet.color[0] = TELNET_COL_PROMPT; + Telnet.color[1] = TELNET_COL_RESPONSE; + Telnet.color[2] = TELNET_COL_LOGGING; + } + } + if (sizeof(Telnet.color) == count) { + for (uint32_t i = 0; i < sizeof(Telnet.color); i++) { + Telnet.color[i] = colors[i]; + } + } + } + if (Telnet.color_disable) { + ResponseCmndStateText(!Telnet.color_disable); + } else { + Response_P(PSTR("{\"%s\":[%d,%d,%d]}"), + XdrvMailbox.command, Telnet.color[0], Telnet.color[1], Telnet.color[2]); + } +} + +/*********************************************************************************************\ + * Interface +\*********************************************************************************************/ + +bool Xdrv78(uint32_t function) { + bool result = false; + + switch (function) { + case FUNC_INIT: + TelnetInit(); + break; + case FUNC_NETWORK_UP: + if (!Telnet.server && (Telnet.port > 0) && !TasmotaGlobal.restart_flag) { + TelnetStart(); + } + break; + case FUNC_COMMAND: + result = DecodeCommand(kTelnetCommands, TelnetCommand); + break; + } + if (Telnet.buffer) { + switch (function) { + case FUNC_LOOP: + TelnetLoop(); + break; + case FUNC_NETWORK_DOWN: + case FUNC_SAVE_BEFORE_RESTART: + TelnetStop(); + break; + case FUNC_ACTIVE: + result = true; + break; + } + } + return result; +} + +#endif // USE_TELNET diff --git a/tasmota/tasmota_xdrv_driver/xdrv_79_esp32_ble.ino b/tasmota/tasmota_xdrv_driver/xdrv_79_esp32_ble.ino index 81a6f779a..517ad9ce0 100644 --- a/tasmota/tasmota_xdrv_driver/xdrv_79_esp32_ble.ino +++ b/tasmota/tasmota_xdrv_driver/xdrv_79_esp32_ble.ino @@ -2711,10 +2711,10 @@ void CmndBLEAddrFilter(void){ ////////////////////////////////////////////////////////////// // Scan options -// BLEScan0 -> do a scan now if BLEMode == BLEModeScanByCommand -// BLEScan0 -> do a scan now if BLEMode == BLEModeScanByCommand for timesec seconds -// BLEScan1 0 -> Scans are passive -// BLEScan1 1 -> Scans are active +// BLEScan0 0 -> Scans are passive +// BLEScan0 1 -> Scans are active +// BLEScan1 -> do a scan now if BLEMode == BLEModeScanByCommand +// BLEScan1 -> do a scan now if BLEMode == BLEModeScanByCommand for timesec seconds // more options could be added... void CmndBLEScan(void){ switch(XdrvMailbox.index){ diff --git a/tasmota/tasmota_xdrv_driver/xdrv_81_esp32_webcam.ino b/tasmota/tasmota_xdrv_driver/xdrv_81_esp32_webcam.ino index 951f95e94..aaf9f1e26 100644 --- a/tasmota/tasmota_xdrv_driver/xdrv_81_esp32_webcam.ino +++ b/tasmota/tasmota_xdrv_driver/xdrv_81_esp32_webcam.ino @@ -1575,8 +1575,10 @@ bool Xdrv81(uint32_t function) { break; case FUNC_EVERY_SECOND: WcUpdateStats(); + break; case FUNC_JSON_APPEND: WcSensorStats(); + break; case FUNC_WEB_SENSOR: WcStatsShow(); break; diff --git a/tasmota/tasmota_xdrv_driver/xdrv_81_esp32_webcam_task.ino b/tasmota/tasmota_xdrv_driver/xdrv_81_esp32_webcam_task.ino index 1a019d7c4..21bd83751 100644 --- a/tasmota/tasmota_xdrv_driver/xdrv_81_esp32_webcam_task.ino +++ b/tasmota/tasmota_xdrv_driver/xdrv_81_esp32_webcam_task.ino @@ -1739,7 +1739,7 @@ static void WCOperationTask(void *pvParameters){ // every 100 frames or 5s if (!(loopcount % 100) || (statdur > 5000)){ float framespersec = ((float)framecount)/(((float)(thismillis - laststatmillis))/1000.0); - AddLog(LOG_LEVEL_DEBUG,PSTR("CAM: avFPS %f %s FS:%d(%d) f:%u s:%u"), + AddLog(LOG_LEVEL_DEBUG_MORE, PSTR("CAM: avFPS %f %s FS:%d(%d) f:%u s:%u"), framespersec, jpeg_converted?"raw":"jpg", wc_fb->len, diff --git a/tasmota/tasmota_xnrg_energy/xnrg_25_v9240.ino b/tasmota/tasmota_xnrg_energy/xnrg_25_v9240.ino new file mode 100644 index 000000000..56c60cfac --- /dev/null +++ b/tasmota/tasmota_xnrg_energy/xnrg_25_v9240.ino @@ -0,0 +1,732 @@ +/* + xnrg_25_v9240.ino - v9240 energy sensor support for Tasmota + + SPDX-FileCopyrightText: 2025 Ivan Chopa (@aquaforum) + + SPDX-License-Identifier: GPL-3.0-only +*/ + +#ifdef USE_ENERGY_SENSOR +#ifdef USE_V9240 +/*********************************************************************************************\ + * Support the Vango Technologies V924x ULTRALOW POWER, UART, SINGLE-PHASE, POWER MEASUREMENT IC +\*********************************************************************************************/ + +#define XNRG_25 25 + +#include + +#define V9240_SERIAL_BAUDRATE 19200 + + +namespace Address +{ + static const uint16_t SysCtrl = 0x0180; + static const uint16_t AnaCtrl0 = 0x0182; + static const uint16_t AnaCtrl1 = 0x0183; + + + static const uint16_t PAC = 0x00F6; + static const uint16_t PHC = 0x00F7; + static const uint16_t PADCC = 0x00F8; + static const uint16_t QAC = 0x00F9; + static const uint16_t QADCC = 0x00FB; + static const uint16_t IAC = 0x00FD; + static const uint16_t IADCC = 0x00FE; + static const uint16_t UC = 0x00FF; + static const uint16_t IAADCC = 0x0104; + static const uint16_t UADCC = 0x0106; + static const uint16_t BPFPARA = 0x0107; + static const uint16_t UDCC = 0x0108; + static const uint16_t CKSUM = 0x0109; + + static const uint16_t RW_START = PAC; + + static const uint16_t SysStsClr = 0x019D; + static const uint16_t SFTRST = 0x01BF; + + static const uint16_t SysSts = 0x00CA; + static const uint16_t FREQINST = 0x00CB; + static const uint16_t PAINST = 0x00CC; + static const uint16_t QINST = 0x00CD; + static const uint16_t IAINST = 0x00CE; + static const uint16_t UINST = 0x00CF; + static const uint16_t PAAVG = 0x00D0; + static const uint16_t QAVG = 0x00D1; + static const uint16_t FREQAVG = 0x00D2; + static const uint16_t IAAVG = 0x00D3; + static const uint16_t UAVG = 0x00D4; + static const uint16_t UDCINST = 0x00D9; + static const uint16_t IADCINST = 0x00DA; + static const uint16_t ZXDATREG = 0x00DC; + static const uint16_t ZXDAT = 0x00DD; + static const uint16_t PHDAT = 0x00DE; + + static const uint16_t T8BAUD = 0x00E0; + + static const uint16_t RO_START = SysSts; +} ; + + +// register structures + +union SysSts // 0x0CA +{ + int32_t reg; + struct __attribute__ ((packed)) + { + uint32_t ref:1; // 0 + uint32_t phsdone:1; // 1 + uint32_t chkerr:1; // 2 + uint32_t rstsrc:3; // 3:5 + uint32_t pdn_r:1; // 6 + uint32_t pdn:1; // 7 + uint32_t bisterr:1; // 8 + uint32_t phsdone_r:1; // 9 + uint32_t Resered1:1; // 10 + uint32_t usign:1; // 11 + }; +} ; + +union SysCtrl // 0x0180 +{ + int32_t reg; + struct __attribute__ ((packed)) + { + uint32_t Reserved0:1; // 0 + uint32_t pgau:1; // 1 + uint32_t bphpf:1; // 2 + uint32_t iesul:1; // 3 + uint32_t iepdn:1; // 4 + uint32_t iehse:1; // 5 + uint32_t rcx12:1; // 6 + uint32_t rctrim:5; // 7:11 + uint32_t shorti:1; // 12 + uint32_t shortu:1; // 13 + uint32_t restl:2; // 14:15 + uint32_t rest:3; // 16:18 + uint32_t meaclksel:1; // 19 + uint32_t adcclksel:2; // 20:21 + uint32_t gai:2; // 22:23 + uint32_t Reserved1:2; // 24:25 + uint32_t gu:1; // 26 + uint32_t adciapdn:1; // 27 + uint32_t Reserved2:1; // 28 + uint32_t adcupdn:1; // 29 + uint32_t Reserved3:2; // 30:31 + }; +}; + + +union AnaCtrl0 // 0x0182 +{ + int32_t reg; + struct __attribute__ ((packed)) + { + uint32_t Reserved1:8; // 0:7 + uint32_t IT:2; // 8:9 + uint32_t Reserved2:22; // 10:31 + }; +}; + +union AnaCtrl1 // 0x0183 +{ + int32_t reg; + struct __attribute__ ((packed)) + { + uint32_t Reserved1:28; // 0:27 + uint32_t CSEL:2; // 28:29 + uint32_t Reserved2:2; // 30:31 + }; +}; + +union SysStsClr // 0x019D +{ + int32_t reg; + struct __attribute__ ((packed)) + { + uint32_t Reserved1:6; // 0:5 + uint32_t pdn_clr:1; // 6 + uint32_t Reserved2:2; // 7:8 + uint32_t phsdone_clr:1;// 9 + uint32_t Reserved3:22; // 10:31 + }; +}; + +// communication structures +union packet +{ + struct __attribute__ ((packed)) { + uint8_t header; + uint16_t ctrl:4; + uint16_t addr_h:4; + uint16_t addr_l:8; + uint32_t data; + uint8_t check; + } ; + char buff[8]; +} ; + + + + +class V9240 +{ +private: + static constexpr size_t rw_len = 23; + static constexpr size_t ro_len = 22; + static constexpr size_t buffer_size = 128; // max response + max query + + static constexpr int32_t header = 0x7d; + static constexpr int32_t ctrl_read = 0x1; + static constexpr int32_t ctrl_write = 0x2; + + explicit V9240(); + ~V9240(); + +public: + enum parameter{ + Voltage = 0, + Amperage, + Frequency, + Power, + Reactive + }; + + static V9240& instance(); + + bool open(char const*); + void close(); + void start(); + bool reset(); + inline void v9240_loop() {read_data_from_port();}; + + + bool process_command(); + + float value(const parameter p) const; + inline float operator [] (const parameter p) const {return value(p);}; +private: + bool read(int32_t *ptr,uint16_t address, size_t n); + bool write(int16_t address, int32_t data); + void set_checksum(); + inline char calc_check(char *buff,size_t len); + +private : + void read_data_from_port(); + void send_next(); + +private: + TasmotaSerial *port; + + size_t step = 0; + + size_t next_read_len = 0; + char serial_buff[buffer_size]; + int32_t *ptr_read = nullptr; + uint32_t start_pause_timer = 0; + uint32_t timeout = 0 ; + + // chip memory + int32_t rw_mem[rw_len]; + int32_t ro_mem[ro_len]; + + // RW Control & Calibration registers + volatile SysCtrl &SYSCTRL; // rw_mem[0]; + volatile AnaCtrl0 &ANACTRL0; + volatile AnaCtrl1 &ANACTRL1; + + volatile int32_t &UADCC; + volatile int32_t &IAADCC ; + volatile int32_t &PAC ; // = 1; + volatile int32_t &PADCC; // = 0; + volatile int32_t &PHC; // = 0; + volatile int32_t &QAC; // = 1; + volatile int32_t &QADCC; // = 0; + volatile int32_t &IAC; // = 0; + volatile int32_t &IADCC; // = 0; + volatile int32_t &UC; // = -1103500000; + volatile int32_t &UDCC; // = 1196289; + volatile int32_t &BPFPARA; // = 0x806764B6; + volatile int32_t &CKSUM; // = 0; + + // RO Meterin control register + volatile const SysSts &SYSSTS; + volatile const int32_t &FREQINST; + volatile const int32_t &PAINST; + volatile const int32_t &QINST; + volatile const int32_t &IAINST; + volatile const int32_t &UINST; + volatile const int32_t &PAAVG; + volatile const int32_t &QAVG; + volatile const int32_t &FREQAVG; + volatile const int32_t &IAAVG; + volatile const int32_t &UAVG; + volatile const int32_t &UDCINST; + volatile const int32_t &IADCINST; + volatile const int32_t &ZXDATREG; + volatile const int32_t &ZXDAT; + volatile const int32_t &PHDAT; + volatile const int32_t &T8BAUD; + +}; + +V9240& V9240::instance() +{ + static V9240 chip; + return chip; +} + + +V9240::V9240() : port(nullptr) +// mapping registers to arrays + , SYSCTRL (*reinterpret_cast(rw_mem + 0)) + , ANACTRL0(*reinterpret_cast(rw_mem + 1)) + , ANACTRL1(*reinterpret_cast(rw_mem + 2)) + , UADCC (*(rw_mem+3+ (Address::UADCC - Address::RW_START ))) + , IAADCC (*(rw_mem+3+ (Address::IAADCC - Address::RW_START ))) + , PAC (*(rw_mem+3+ (Address::PAC - Address::RW_START ))) + , PADCC (*(rw_mem+3+ (Address::PADCC - Address::RW_START ))) + , PHC (*(rw_mem+3+ (Address::PHC - Address::RW_START ))) + , QAC (*(rw_mem+3+ (Address::QAC - Address::RW_START ))) + , QADCC (*(rw_mem+3+ (Address::QADCC - Address::RW_START ))) + , IAC (*(rw_mem+3+ (Address::IAC - Address::RW_START ))) + , IADCC (*(rw_mem+3+ (Address::IADCC - Address::RW_START ))) + , UC (*(rw_mem+3+ (Address::UC - Address::RW_START ))) + , UDCC (*(rw_mem+3+ (Address::UDCC - Address::RW_START ))) + , BPFPARA(*(rw_mem+3+ (Address::BPFPARA - Address::RW_START ))) + , CKSUM (*(rw_mem+3+ (Address::CKSUM - Address::RW_START ))) + + , SYSSTS (*reinterpret_cast(ro_mem + (Address::SysSts - Address::RO_START))) + , FREQINST(*(ro_mem + (Address::FREQINST - Address::RO_START ))) + , PAINST (*(ro_mem + (Address::PAINST - Address::RO_START ))) + , QINST (*(ro_mem + (Address::QINST - Address::RO_START ))) + , IAINST (*(ro_mem + (Address::IAINST - Address::RO_START ))) + , UINST (*(ro_mem + (Address::UINST - Address::RO_START ))) + , PAAVG (*(ro_mem + (Address::PAAVG - Address::RO_START ))) + , QAVG (*(ro_mem + (Address::QAVG - Address::RO_START ))) + , FREQAVG (*(ro_mem + (Address::FREQAVG - Address::RO_START ))) + , IAAVG (*(ro_mem + (Address::IAAVG - Address::RO_START ))) + , UAVG (*(ro_mem + (Address::UAVG - Address::RO_START ))) + , UDCINST (*(ro_mem + (Address::UDCINST - Address::RO_START ))) + , IADCINST(*(ro_mem + (Address::IADCINST - Address::RO_START ))) + , ZXDATREG(*(ro_mem + (Address::ZXDATREG - Address::RO_START ))) + , ZXDAT (*(ro_mem + (Address::ZXDAT - Address::RO_START ))) + , PHDAT (*(ro_mem + (Address::PHDAT - Address::RO_START ))) + , T8BAUD (*(ro_mem + (Address::T8BAUD - Address::RO_START - 1 ))) +{ + memset(rw_mem,0,sizeof (rw_mem)); + memset(ro_mem,0,sizeof (ro_mem)); + + // its calibration coeficients for my chip + + PAC = EnergyGetCalibration(ENERGY_POWER_CALIBRATION, 0); + PADCC = 0; + PHC = EnergyGetCalibration(ENERGY_FREQUENCY_CALIBRATION, 0); + QAC = -1; + QADCC = 0; + IAC = EnergyGetCalibration(ENERGY_CURRENT_CALIBRATION, 0); + IADCC = 75969; // 16758789; + + UC = EnergyGetCalibration(ENERGY_VOLTAGE_CALIBRATION); + UDCC = 3596949; // 1196289; + + BPFPARA = 0x806764B6; + +} + +V9240::~V9240() +{ + close(); +} + +void V9240::start() +{ + if(port != nullptr) + { + step = 0; + port->flush(); + read(ro_mem,Address::SysSts,1); + timeout = millis(); + } +} + +float V9240::value(const V9240::parameter p) const +{ + float v = 0; + switch (p) { + case Voltage: + v = float(UAVG)*1e-6; + break; + case Amperage: + v = float(IAAVG)*1e-6; + break; + case Frequency: + v = 0.00390625*V9240_SERIAL_BAUDRATE*T8BAUD/float(FREQAVG); + break; + case Power: + v = float(PAAVG)*1e-3; + break; + case Reactive: + v = float(QAVG)*1e-3; + break; + default: + break; + } + return v; +} + + +void V9240::set_checksum() +{ +// CKSUM = UINT32_MAX - std::accumulate(rw_mem,rw_mem+rw_len-1 ,0); + int init = 0; + for (uint32_t i = 0; i < rw_len-1; i++) { + init += rw_mem[i]; + } + CKSUM = UINT32_MAX - init; + write(Address::CKSUM,CKSUM); +} + +char V9240::calc_check(char *buff, size_t len) +{ +// return ~std::accumulate(buff,buff+len,0)+0x33; + char init = 0; + for (uint32_t i = 0; i < len; i++) { + init += buff[i]; + } + return ~init + 0x33; +} + + +void V9240::send_next() +{ + port->flush(); + + switch (step++) { + case 0: + read(rw_mem,Address::SysCtrl,1); + break; + case 1: + write(Address::AnaCtrl0,ANACTRL0.reg); + break; + case 2: + // Configure CSEL ( + ANACTRL1.CSEL = 1; + write(Address::AnaCtrl1,ANACTRL1.reg); + break; + case 3: + // Disable internal PGA + SYSCTRL.gu = 1; + SYSCTRL.gai = 3; + // Enable ADC + SYSCTRL.adcupdn = 1; + SYSCTRL.adciapdn = 1; + write(Address::SysCtrl,SYSCTRL.reg); + break; + case 4: + // DC calibratio. Paragraph 7.4 page 33 + SYSCTRL.shortu = 1 ; + SYSCTRL.shorti = 1 ; + write(Address::SysCtrl,SYSCTRL.reg); + break; + case 5: + read(ro_mem, Address::RO_START,ro_len); + break; + case 6: + UADCC = UDCINST; + IAADCC = IADCINST; + + SYSCTRL.shortu = 0 ; + SYSCTRL.shorti = 0 ; + write(Address::SysCtrl,SYSCTRL.reg); + break; + case 7: + // Write calibration parameter + write(Address::UADCC ,UADCC); + break; + case 8: + write(Address::IAADCC ,IAADCC); + break; + case 9: + write(Address::PAC ,PAC); + break; + case 10: + write(Address::PADCC ,PADCC); + break; + case 11: + write(Address::QAC ,QAC); + break; + case 12: + write(Address::QADCC ,QADCC); + break; + case 13: + write(Address::PHC ,PHC); + break; + case 14: + write(Address::IAC ,IAC); + break; + case 15: + write(Address::IADCC ,IADCC); + break; + case 16: + write(Address::UC ,UC); + break; + case 17: + write(Address::UDCC ,UDCC); + break; + case 18: + write(Address::BPFPARA ,BPFPARA); + break; + case 19: + set_checksum(); + AddLog(LOG_LEVEL_INFO, PSTR(D_LOG_DEBUG "*** V9240 started")); + break; + case 20: + read(&ro_mem[ro_len-1],Address::T8BAUD,1); + break; + default: + read(ro_mem,Address::RO_START,ro_len-1); + step = 20; + } + + timeout = millis(); +} + +// next methods is platfrm-specific (serial port & Qt signals) +void V9240::read_data_from_port() +{ + if(next_read_len != 0 ) + { + auto bytes = port->available(); + + if(bytes >= next_read_len) + { + port->read(serial_buff,next_read_len); + + char checksum = calc_check(serial_buff+sizeof(packet),next_read_len-sizeof(packet)-1); + if(checksum == serial_buff[next_read_len-1]) + { + packet &recv = *reinterpret_cast( serial_buff + sizeof (packet) ); + if(recv.ctrl == ctrl_read) + { + int32_t *data = (int32_t*)(serial_buff + sizeof (packet) + 3); + memcpy(ptr_read,data,sizeof (int32_t) * (recv.addr_l==0 ? 1 : recv.addr_l)); + } + } + else { + AddLog(LOG_LEVEL_INFO, PSTR(D_LOG_DEBUG "*** V9240 checksum error in: %d calc: %d") + ,uint32_t(serial_buff[next_read_len-1]),uint32_t(checksum)); + } + next_read_len = 0; + ptr_read = nullptr; + + start_pause_timer = millis(); + timeout = 0; + } + else if(timeout > 0 && millis() - timeout > 1000) + { + AddLog(LOG_LEVEL_INFO, PSTR(D_LOG_DEBUG "*** V9240 timeout")); + start_pause_timer = 0; + start(); + } + } + else { + if(start_pause_timer != 0 && millis()-start_pause_timer > 10) + { + send_next(); + start_pause_timer = 0; + } + } +} + + +bool V9240::open(char const *portName) +{ + if(port != nullptr) + return false; + + port = new TasmotaSerial(Pin(GPIO_V9240_RX),Pin(GPIO_V9240_TX),1,0,256,false); + if (port->hardwareSerial()) { + ClaimSerial(); + port->begin(V9240_SERIAL_BAUDRATE,SERIAL_8O1); + } + return true; +} + +void V9240::close() +{ + if(port != nullptr) + { + port->end(); + delete port; + port = nullptr; + } +} + +bool V9240::reset() +{ + if(port != nullptr) + { + port->begin(100,SERIAL_8O1); + port->write(uint8_t(0)); + char zero; + port->read(&zero,1); + port->begin(V9240_SERIAL_BAUDRATE,SERIAL_8O1); + } + return true; +} + + +bool V9240::read(int32_t *ptr, uint16_t address, size_t n) +{ + packet p; + p.header = header; + p.ctrl = ctrl_read; + p.addr_h = (address&0x0F00)>>8; + p.addr_l = address&0x00FF; + p.data = n; + p.check = calc_check(p.buff,sizeof(p)-1); + + next_read_len = sizeof (p) + 4 + sizeof (int32_t)*n; + ptr_read = ptr; + + port->write(p.buff,sizeof (p)); + + return true; +} + +bool V9240::write(int16_t address, int32_t data) +{ + packet p; + p.header = header; + p.ctrl = ctrl_write; + p.addr_h = (address&0x0F00)>>8; + p.addr_l = address&0x00FF; + p.data = data; + p.check = calc_check(p.buff,sizeof(p)-1); + + next_read_len = sizeof (p) + 4; + + port->write(p.buff,sizeof (p)); + + return true; +} + +bool V9240::process_command() +{ + float value = atof(XdrvMailbox.data); + XdrvMailbox.payload = 0; + + auto calc_cor = [] (float new_value,float old_value,int32_t k) -> int32_t + { return int32_t( (float(INT_MAX) *( new_value - old_value ) + float(k) * new_value ) / old_value ); }; + + switch (Energy->command_code) { + case CMND_POWERCAL: +// PADCC = calc_cor (value,(*this)[Power],P); + break; + case CMND_VOLTAGECAL: +// UDCC = float(INT_MAX)*value; + break; + case CMND_CURRENTCAL: +// IADCC = float(INT_MAX)*value; + break; + case CMND_FREQUENCYCAL: + PHC = value ; + EnergySetCalibration(ENERGY_FREQUENCY_CALIBRATION, PHC, 0); + break; + case CMND_POWERSET: + PAC = calc_cor (value,(*this)[Power],PAC); + EnergySetCalibration(ENERGY_POWER_CALIBRATION, PAC, 0); + break; + case CMND_VOLTAGESET: + UC = calc_cor (value,(*this)[Voltage],UC); + EnergySetCalibration(ENERGY_VOLTAGE_CALIBRATION, UC, 0); + break; + case CMND_CURRENTSET: + IAC = calc_cor (value,(*this)[Amperage],IAC); + EnergySetCalibration(ENERGY_CURRENT_CALIBRATION, IAC, 0); + break; + case CMND_FREQUENCYSET: + break; + case CMND_MODULEADDRESS: + break; + case CMND_ENERGYCONFIG: + break; + default: + break; + } + + step = 0; + + return true; +} + +void Xnrg34Init() +{ + Energy->phase_count = 1; + Energy->voltage_common = true; // Phase voltage = false, Common voltage = true + Energy->frequency_common = true; // Phase frequency = false, Common frequency = true + Energy->type_dc = false; // AC = false, DC = true; + Energy->use_overtemp = true; // Use global temperature for overtemp detection + V9240::instance().start(); +} + +void Xnrg34Second() +{ + static int32_t last_power = 0; + + if (Energy->power_on) { + Energy->data_valid[0] = 0; + Energy->frequency[0] = V9240::instance()[V9240::Frequency]; + Energy->voltage[0] = V9240::instance()[V9240::Voltage]; + Energy->current[0] = V9240::instance()[V9240::Amperage]; + Energy->active_power[0] = V9240::instance()[V9240::Power]; +// Energy->reactive_power[0] = V9240::instance()[V9240::Reactive]; + + Energy->kWhtoday_delta[0] += (Energy->active_power[0]+last_power) * 500.0 / 36.0; // trapezoid integration + last_power = Energy->active_power[0]; + EnergyUpdateTotal(); + } +} + +void Xnrg34PreInit() +{ + if (PinUsed(GPIO_V9240_RX) && PinUsed(GPIO_V9240_TX)) + { + TasmotaGlobal.energy_driver = XNRG_25; + V9240::instance().open(""); + V9240::instance().reset(); + } + +} + + + +bool Xnrg25(uint32_t function) { + bool result = false; + + switch (function) { + case FUNC_LOOP: + V9240::instance().v9240_loop(); + break; + case FUNC_ENERGY_EVERY_SECOND: + Xnrg34Second(); + break; + case FUNC_EVERY_250_MSECOND: + break; + case FUNC_COMMAND: + result = V9240::instance().process_command(); + break; + case FUNC_INIT: + Xnrg34Init(); + break; + case FUNC_PRE_INIT: + Xnrg34PreInit(); + break; + } + return result; +} + +#endif // USE_ENERGY_V9240 +#endif // USE_ENERGY_SENSOR diff --git a/tasmota/tasmota_xsns_sensor/xsns_102_ld2402.ino b/tasmota/tasmota_xsns_sensor/xsns_102_ld2402.ino new file mode 100644 index 000000000..f074de137 --- /dev/null +++ b/tasmota/tasmota_xsns_sensor/xsns_102_ld2402.ino @@ -0,0 +1,923 @@ +/* + xsns_102_ld2402.ino - HLK-LD2402 24GHz smart wave motion sensor support for Tasmota + + Copyright (C) 2025 Anthony Sepa + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + + Based in part on xsns_102_ld2410s.ino by: + SPDX-FileCopyrightText: 2022 Theo Arends, 2024 md5sum-as (https://github.com/md5sum-as) + + SPDX-License-Identifier: GPL-3.0-only +*/ + +#ifdef USE_LD2402 +/*********************************************************************************************\ + * HLK-LD2402 24GHz smart wave motion sensor + * + * Attention! + * This module works with HLK-LD2402 devices. + * + * Available commands: + * LD2402_Status 0|1|2 - showing parameters|sensor readings|firmware info + * LD2402_ReRead - reread common, motion and micro threshold parameters from device + * LD2402_SetCommon 7-100,0-65535 - set common: maximum distance, disappearance delay + * LD2402_SetMotion n,n1..n16 - set motion threshold values (16) + * LD2402_SetMicro n,n1..n16 - set micro threshold values (16) + * LD2402_Mode 0/1 - set device output mode 0-normal, 1-engineering + * LD2402_Save - save the internal device motion/micro thresholds (fw 3.3.2+) + * LD2402_AutoUpdate 3.0,2.0,3.0 - start autoupdate trigger,keep,micro magnification factor + * LD2402_AutoGain - start autogain process (fw 3.3.5+) + * LD2402_Follow 0/n - reports every n seconds + * +\*********************************************************************************************/ + +#define XSNS_102 102 + +#define LD2402_NUM_GATES 0x10 +#define LD2402_ENG_LINE_LENGTH 0x83 +// Max line length is in engineering mode at 141 characters +#define LD2402_BUFFER_SIZE LD2402_ENG_LINE_LENGTH + 10 + +// step values which are a combination of the number of bytes for the command arg +// the command and the delay amount +1 before sending the command +// for example: 0x6121, 0x6 byte argument, 0x12 command change mode, 0 ticks delay) +enum LD2402_Steps { + LD2402_CMND_READ_VERSION=0x0001, // get version, no arg, no delay + LD2402_CMND_AUTO_PROGRESS=0x00A9, // get auto progress, no arg, 8 ticks delay (2 seconds) + LD2402_CMND_READ_SERIAL=0x0111, // get serial, no arg, no delay + LD2402_CMND_AUTO_INTERFERENCE=0x0141, // get auto interference, no arg, no delay + LD2402_CMND_AUTO_GAIN=0x0EE1, // run auto gain, no arg, no delay + LD2402_CMND_AUTO_GAIN_COMPLETE=0x0F01, // notify auto gain complete, no arg, no delay (special processing required) + LD2402_CMND_SAVE_PARAM=0x0FD1, // save parameters, no arg, no delay (fw 3.3.2+) + LD2402_CMND_END_CONFIGURATION=0x0FE1, // end configuration mode, no arg, no delay + LD2402_CMND_READ_PARAM=0x2081, // get a parameter, 2-byte arg, no delay + LD2402_CMND_START_CONFIGURATION=0x2FF1, // start configuration mode, 2-byte arg, no delay + LD2402_CMND_WRITE_PARAM=0x6071, // set a parameter, 6-byte arg, no delay + LD2402_CMND_AUTO_THRESHOLD=0x6091, // run auto threshold, 6-byte arg, no delay + LD2402_CMND_MODE=0x6121, // set normal/engineering mode, 6-byte arg, no delay + LD2402_CMND_Wait_Timeout=0xFFF9 // special timeout counter, never sent, 8 ticks delay (2 seconds) +}; + +// parameter types +enum LD2402_Parameters { + LD2402_MAX_DISTANCE=0x01, + LD2402_DISP_DELAY=0x04, + LD2402_PWR_INTERFER=0x05, + LD2402_MOTION_START=0x10, + LD2402_MOTION_END=LD2402_MOTION_START+LD2402_NUM_GATES-1, + LD2402_MICRO_START=0x30, + LD2402_MICRO_END=LD2402_MICRO_START+LD2402_NUM_GATES-1, + LD2402_DONE +}; + +// engineering types +enum LD2402_EngTypes { + LD2402_NO_PERSON, + LD2402_PERSON_MOVING, + LD2402_PERSON_STILL, + LD2402_PERSON_UNKNOWN +}; + +// quick lookup stubs +enum LD2402_Stubs { + LD2402_target_Error=0x4572726f, // Erro + LD2402_target_OFF=0x4F46460D, // OFF + LD2402_target_distance=0x64697374, // dist + LD2402_engineering_footer=0xF8F7F6F5, + LD2402_engineering_header=0xF4F3F2F1, + LD2402_config_footer=0x04030201, + LD2402_config_header=0xFDFCFBFA +}; + +// read buffer state +enum LD2402_State { + LD2402_DISCONNECTED, // no response in timeout period, disconnected + LD2402_ERROR, // buffer not used, just received an error message + LD2402_NORMAL, // buffer not used, just received a distance/off message + LD2402_UNKNOWN, // for when we are unsure what is in the buffer + LD2402_CONFIGURATION, // buffer holds configuration data + LD2402_AUTOUPDATE, // buffer holds configuration data, running autoupdate + LD2402_ENGINEERING // buffer holds engineering data +}; + +#define LD2402_config_send_stub {(LD2402_config_header>>24), (LD2402_config_header>>16)&0xFF, (LD2402_config_header>>8)&0xFF, LD2402_config_header&0xFF, 0x00, 0x00, 0x00, 0x00} +#define LD2402_config_footer_a {(LD2402_config_footer>>24), (LD2402_config_footer>>16)&0xFF, (LD2402_config_footer>>8)&0xFF, LD2402_config_footer&0xFF} + +#include +TasmotaSerial *LD2402Serial = nullptr; + +#define LD2402_MOTION_ENERGY LD2402.buffer+3 +#define LD2402_MICRO_ENERGY LD2402_MOTION_ENERGY+64 + +struct { + uint8_t *buffer; + uint8_t cmnd_param[6] = {}; // global cmnd args + uint16_t sent_cmnd; // this is the step with the delay part shifted off (2 bytes) + uint32_t step; // this is a combination of arg bytes, command and delay (4 bytes) + uint32_t saved_step; // saved step to enable configuration mode (4 bytes) +// Static params + char *version; // version and serial number are pulled at start to ensure connection + char *serial_number; +// Detection Parameters + uint8_t pwr_interf; // detail power interference information + uint8_t max_distance; // maximum detection distanmce + uint16_t disp_delay; // delay before an empty area is empty + uint8_t *motion_threshold; // allocated on first use, to save memory if not needed + char *gates; // power interference gate information +// Report values + enum LD2402_EngTypes person; // engineering line type (0 - no one, 1 - someone, 2 - someone still) + uint16_t detect_distance; +// autoupdate + uint8_t auto_upd_progress; +// endianess + uint8_t endian_offset; +// program flow +#ifdef LD2402_INCLUDE_FOLLOW + uint32_t follow; + uint32_t timer; +#endif // LD2402_INCLUDE_FOLLOW + enum LD2402_State state; +} LD2402; + +#define D_LD2402 "LD2402" +#define D_LD2402_LOG_PREFIX "LD2: " +#define D_BUSY_MSG "{\"" D_LD2402 "\":\"Busy, wait till finished current command.\"}" +#define D_DISCONNECTED_MSG "{\"" D_LD2402 "\":\"Disconnected, reconnect device.\"}" +#define D_COMMAND_PREFIX_JSON "{\"" D_LD2402 "_%s\":" +#define D_COMMAND_HELP_MSG D_COMMAND_PREFIX_JSON "\"%s\"}" +/********************************************************************************************/ + +void Ld2402ToBinary(char *buffer, uint32_t byte_h, uint32_t byte_l) { + uint32_t mask_01 = 0x01, mask_10 = 0x10; + for (uint32_t i = 4; i; i--) { + buffer[i-1] = '0' + (byte_h & mask_10); + buffer[i+4] = '0' + (byte_h & mask_01); + buffer[i+9] = '0' + (byte_l & mask_10); + buffer[i+14] = '0' + (byte_l & mask_01); + mask_10<<=1; + mask_01<<=1; + } + buffer[4] = buffer[9] = buffer[14] = ' '; + buffer[19] = 0x0; +} + +// arguments: results buffer, current LD2402_Parameters +// updates internal detection parameter +// sets LD2402.step to: +// READ_PARAM, AUTO_INTERFERENCE, END_CONFIGURATION +// returns next LD2402_Parameters +uint8_t Ld2402ProcessParameter(uint8_t *buffer, uint8_t parameter) { + LD2402.step = LD2402_CMND_READ_PARAM; // default is read next parameter + if (LD2402_MAX_DISTANCE == parameter) { + LD2402.max_distance = buffer[0]; + return LD2402_DISP_DELAY; + } else if (LD2402_DISP_DELAY == parameter) { + LD2402.disp_delay = buffer[1] << 8 | buffer[0]; + return LD2402_PWR_INTERFER; + } else if (LD2402_PWR_INTERFER == parameter) { + LD2402.pwr_interf = buffer[0]; + if (2 == LD2402.pwr_interf) { + LD2402.step = LD2402_CMND_AUTO_INTERFERENCE; // sidetrack through interference details + } + return LD2402_MOTION_START; + } else { + if (LD2402_MOTION_END >= parameter) { + memcpy(LD2402.motion_threshold + (parameter & 0x0F) * 4, buffer, 4); + if (LD2402_MOTION_END == parameter) { + return LD2402_MICRO_START; + } + } else if (LD2402_MICRO_END >= parameter) { + memcpy(LD2402.motion_threshold + (parameter & 0x1F) * 4, buffer, 4); + if (LD2402_MICRO_END == parameter) { + LD2402.step = LD2402_CMND_END_CONFIGURATION; // end configuration + } + } + } + return parameter + 1; +} + +void Ld2402HandleConfigData(void) { + uint32_t rcvd_cmnd = LD2402.buffer[0]; + if (rcvd_cmnd != (LD2402.sent_cmnd&0x0FF)) { + DEBUG_SENSOR_LOG(PSTR(D_LD2402_LOG_PREFIX "Command mismatch sent 0x%03X"), LD2402.sent_cmnd); + return; + } + + if ((1 == LD2402.buffer[1]) && // is this a response + (LD2402.buffer[2] || LD2402.buffer[3])) { // did the command fail? + DEBUG_SENSOR_LOG(PSTR(D_LD2402_LOG_PREFIX "Command 0x%03X received ACK: 0x%02X%02X"), LD2402.sent_cmnd, LD2402.buffer[3], LD2402.buffer[2]); + if (LD2402_CMND_END_CONFIGURATION>>4 != LD2402.sent_cmnd) { // for non end configuration errors try to end configuration + LD2402.step = LD2402_CMND_END_CONFIGURATION; + } else { // we are still receiving messages, might be in bootloader mode + LD2402.state = LD2402_UNKNOWN; + } + return; + } + + LD2402.step = LD2402_CMND_END_CONFIGURATION; // default is end configuration + switch (LD2402.sent_cmnd) { + case LD2402_CMND_START_CONFIGURATION>>4: // run before configuration commands + LD2402.state = LD2402_CONFIGURATION; + LD2402.step = LD2402.saved_step+1; // restore saved step to run + break; + + case LD2402_CMND_END_CONFIGURATION>>4: // run after configuration commands + LD2402.state = LD2402_UNKNOWN; + LD2402.step = 0; + return; + + case LD2402_CMND_READ_VERSION>>4: { // run on initialization and reconnect + uint32_t length = LD2402.buffer[4]; + LD2402.version = LD2402.version ? LD2402.version : (char*)malloc(length+1); + memcpy(LD2402.version, LD2402.buffer + 6, length); + LD2402.version[length] = 0; + DEBUG_SENSOR_LOG(PSTR(D_LD2402_LOG_PREFIX "Rcvd %s"), LD2402.version); + LD2402.step = LD2402_CMND_READ_SERIAL; // process read serial + }break; + + case LD2402_CMND_READ_SERIAL>>4: { // run after read version + uint32_t length = LD2402.buffer[4]; + LD2402.serial_number = LD2402.serial_number ? LD2402.serial_number : (char*)malloc(length+1); + memcpy(LD2402.serial_number, LD2402.buffer + 6, length); + LD2402.serial_number[length] = 0; + DEBUG_SENSOR_LOG(PSTR(D_LD2402_LOG_PREFIX "Rcvd %s"), LD2402.serial_number); + }break; + + // here I am processing the last thing + case LD2402_CMND_READ_PARAM>>4: // run from terminal command + LD2402.cmnd_param[0] = Ld2402ProcessParameter(LD2402.buffer + 4, LD2402.cmnd_param[0]); + break; + + case LD2402_CMND_AUTO_INTERFERENCE>>4: // sidetracked here through read param go back to it + free(LD2402.gates); + LD2402.gates = (char*)malloc(LD2402_NUM_GATES+3+1); // number of gates, three spaces, ending /0 + Ld2402ToBinary(LD2402.gates, LD2402.buffer[5], LD2402.buffer[4]); + LD2402.step = LD2402_CMND_READ_PARAM; // process next read parameter + break; + + case LD2402_CMND_AUTO_THRESHOLD>>4: // run from terminal command + LD2402.state = LD2402_AUTOUPDATE; + LD2402.step = LD2402_CMND_AUTO_PROGRESS; // start auto progress reading + return; // no point running command right away + + case LD2402_CMND_AUTO_PROGRESS>>4: // run after auto threshold + LD2402.state = LD2402_AUTOUPDATE; + LD2402.auto_upd_progress = LD2402.buffer[4]; + if (100 > LD2402.auto_upd_progress) { + LD2402.step = LD2402_CMND_AUTO_PROGRESS; + return; // no point running command right away + } + LD2402.state = LD2402_CONFIGURATION; + break; + + case LD2402_CMND_AUTO_GAIN>>4: // run from terminal command + LD2402.sent_cmnd = LD2402_CMND_AUTO_GAIN_COMPLETE>>4; // auto gain complete is just received no command is sent + LD2402.step = LD2402_CMND_Wait_Timeout; // pretend as if we sent a command and wait for it + break; + + // here I am setting up to do the next thing + case LD2402_CMND_WRITE_PARAM>>4: // run from terminal command + if (((LD2402.cmnd_param[0]&0xF0 == LD2402_MICRO_START) || (LD2402.cmnd_param[0]&0xF0 == LD2402_MOTION_START)) && // motion/micro threshold + (LD2402.cmnd_param[0]&0x0F != (LD2402_NUM_GATES-1))) { // but not the last one + Ld2402LoadLastParam(LD2402.cmnd_param[0]+1); + LD2402.step = LD2402_CMND_WRITE_PARAM; // process next write parameter + } else if (LD2402_MAX_DISTANCE == LD2402.cmnd_param[0]) { + Ld2402LoadLastParam(LD2402_DISP_DELAY); + LD2402.step = LD2402_CMND_WRITE_PARAM; // process next write parameter + } + break; + } + Ld2402Every250MSecond(); // immediately send the next command queued +} + +// prcess uart messages from the module +// first section finds the start of a line, for simple text lines they are processed immediately +// second section processes command responses and engineering data +void Ld2402Input(void) { + typedef union { // put in function so it doesn't interfere with anything else + uint8_t buffer[4]; + uint32_t buffer_32; + } uint32_u; + static uint32_t need_counter = 5; + static uint32_u stub; + uint32_t avail = LD2402Serial->available(); + // quickly exit if we don't have what we need + if (avail < need_counter) { return; } + + // load stub only when we are start finding a new line + if (5 == need_counter) { + for (uint32_t i = 4; i; i--) { + stub.buffer_32<<=8; + stub.buffer[LD2402.endian_offset] = LD2402Serial->read(); + avail--; + } + need_counter = 1; + } + + // first section + uint32_t test_m = millis(); + while (1 == need_counter) { // header processing is done when we no longer need just one byte + yield(); // WDT needs to be yielded to + switch (stub.buffer_32) { + default: // if there are no matches power through the available bytes + DEBUG_SENSOR_LOG(PSTR(D_LD2402_LOG_PREFIX "Available: %d, Header: %*_H, Yield: %d"), avail, 4, stub.buffer, millis() - test_m); + if (!avail--) { + return; + } + stub.buffer_32<<=8; + stub.buffer[LD2402.endian_offset] = LD2402Serial->read(); + continue; + + case LD2402_engineering_footer: + case LD2402_config_footer: + goto finished_line; + + case LD2402_target_OFF: + LD2402.detect_distance = 0; + LD2402.person = LD2402_NO_PERSON; + LD2402Serial->read(); + DEBUG_SENSOR_LOG(PSTR(D_LD2402_LOG_PREFIX "OFF")); + LD2402.state = LD2402_NORMAL; + goto finished_line; + + case LD2402_target_Error: + need_counter = LD2402Serial->readBytesUntil(0x0A, LD2402.buffer, LD2402_BUFFER_SIZE); + LD2402.buffer[need_counter] = 0; + DEBUG_SENSOR_LOG(PSTR(D_LD2402_LOG_PREFIX "Erro%s"), LD2402.buffer); + LD2402.state = LD2402_ERROR; + goto finished_line; + + case LD2402_target_distance: + need_counter = LD2402Serial->readBytesUntil(0x0A, LD2402.buffer, LD2402_BUFFER_SIZE); + LD2402.buffer[need_counter] = 0; + DEBUG_SENSOR_LOG(PSTR(D_LD2402_LOG_PREFIX "Dist%s"), LD2402.buffer); + // ance:105\r\n + LD2402.detect_distance = atoi((char*) LD2402.buffer + 5); + LD2402.person = LD2402_PERSON_STILL; + LD2402.state = LD2402_NORMAL; + goto finished_line; + + case LD2402_engineering_header: + case LD2402_config_header: + need_counter = 5 + LD2402Serial->read(); // unused length byte + length + footer + if (need_counter > LD2402_ENG_LINE_LENGTH+5) { + DEBUG_SENSOR_LOG(PSTR(D_LD2402_LOG_PREFIX "Line length %d too long for buffer"), need_counter - 5); + goto finished_line; + } + break; + } + } + + // make sure we have everything we need waiting for us + // becuase the need counter will always be greater than + // 5 bytes we can return from here and will come back + // when we have all that we need + if (LD2402Serial->available() < need_counter) { return; } + need_counter -= 5; + + // second section + LD2402Serial->read(); // second byte of length, unused + LD2402Serial->readBytes(LD2402.buffer, need_counter); // main information + LD2402Serial->readBytes(stub.buffer, 4); // footer validation + LD2402.state = LD2402_UNKNOWN; // buffer used for motion energies has been overwritten + if (LD2402_ENG_LINE_LENGTH == need_counter) { // only engineering lines are this long + DEBUG_SENSOR_LOG(PSTR(D_LD2402_LOG_PREFIX "Eng %*_H"), need_counter, LD2402.buffer); + // reverse order, last digit is most likely to be "bad" + if (((uint8_t)(LD2402_engineering_footer&0xFF) == stub.buffer[3]) && ((uint8_t)(LD2402_engineering_footer>>8&0xFF) == stub.buffer[2]) && + ((uint8_t)(LD2402_engineering_footer>>16&0xFF) == stub.buffer[1]) && ((uint8_t)(LD2402_engineering_footer>>24&0xFF) == stub.buffer[0])) { + LD2402.state = LD2402_ENGINEERING; + LD2402.detect_distance = LD2402.buffer[2] << 8 | LD2402.buffer[1]; + LD2402.person = (enum LD2402_EngTypes)LD2402.buffer[0]; + } else { + DEBUG_SENSOR_LOG(PSTR(D_LD2402_LOG_PREFIX "avail: %d, length %d"), avail, need_counter); + DEBUG_SENSOR_LOG(PSTR(D_LD2402_LOG_PREFIX "Foot %*_H, 0x%08X"), 4, stub.buffer, stub.buffer_32); + } + } else { + DEBUG_SENSOR_LOG(PSTR(D_LD2402_LOG_PREFIX "Ret %*_H"), need_counter, LD2402.buffer); + // reverse order, last digit is most likely to be "bad" + if (((uint8_t)(LD2402_config_footer&0xFF) == stub.buffer[3]) && ((uint8_t)(LD2402_config_footer>>8&0xFF) == stub.buffer[2]) && + ((uint8_t)(LD2402_config_footer>>16&0xFF) == stub.buffer[1]) && ((uint8_t)(LD2402_config_footer>>24&0xFF) == stub.buffer[0])) { + LD2402.state = LD2402_CONFIGURATION; + Ld2402HandleConfigData(); + } else { + DEBUG_SENSOR_LOG(PSTR(D_LD2402_LOG_PREFIX "avail: %d, length %d"), avail, need_counter); + DEBUG_SENSOR_LOG(PSTR(D_LD2402_LOG_PREFIX "Foot %*_H, 0x%08X"), 4, stub.buffer, stub.buffer_32); + } + } +// finished processing current line +finished_line: + need_counter = 5; +} + +void Ld2402LoadLastParam(uint32_t curr_param) { + memset(LD2402.cmnd_param + 2, 0x00, 4); + LD2402.cmnd_param[0] = curr_param; + if (LD2402_MAX_DISTANCE == curr_param) { + LD2402.cmnd_param[2] = LD2402.max_distance; + } else if (LD2402_DISP_DELAY == curr_param) { + LD2402.cmnd_param[2] = LD2402.disp_delay & 0x00FF; + LD2402.cmnd_param[3] = LD2402.disp_delay >> 8; + } else if (LD2402_MOTION_END >= curr_param) { + memcpy(LD2402.cmnd_param + 2, LD2402.motion_threshold + (curr_param & 0x0F) * 4, 4); + } else if (LD2402_MICRO_END >= curr_param) { + memcpy(LD2402.cmnd_param + 2, LD2402.motion_threshold + (curr_param & 0x1F) * 4, 4); + } +} + +void Ld2402ResponseAppendGates(uint8_t *energies) { + if (!energies) { return; } + uint32_t i = 0; + float val; + while (i < LD2402_NUM_GATES * 4) { + val = energies[i++] | energies[i++] << 8 | energies[i++] << 16 | energies[i++] << 24; + val = (val ? 10.0f / 2.302585f * logf(val) : 0); // 10.0f / logf(10) * logf(val) + if (4 != i) { ResponseAppend_P(PSTR(",")); } + ResponseAppend_P(PSTR("%2_f"), &val); + } +} + +void Ld2402ResponseAppendReport() { + if (LD2402_AUTOUPDATE == LD2402.state) { + ResponseAppend_P(PSTR("\"AutoUpdate\":\"%1d%%\""), LD2402.auto_upd_progress); + } else if (LD2402_DISCONNECTED == LD2402.state) { + ResponseAppend_P(PSTR("\"Error\":\"Disconnected\"")); + } else { + ResponseAppend_P(PSTR("\"" D_JSON_DISTANCE "\":%d"), LD2402.detect_distance); + if (LD2402_ENGINEERING == LD2402.state) { + if (LD2402.gates) { ResponseAppend_P(PSTR(",\"InterferenceGates\":\"%s\""), LD2402.gates); } + ResponseAppend_P(PSTR(",\"Motion\":%s,\"Occupancy\":%s,\"PowerInterference\":%d,\"MotionEnergies\":["), (LD2402_PERSON_MOVING == LD2402.person ? "true" : "false"), (LD2402.person ? "true" : "false"), LD2402.pwr_interf); + Ld2402ResponseAppendGates(LD2402_MOTION_ENERGY); + ResponseAppend_P(PSTR("],\"MicroEnergies\":[")); + Ld2402ResponseAppendGates(LD2402_MICRO_ENERGY); + ResponseAppend_P(PSTR("]")); + } + } +} + +/********************************************************************************************/ + +// this gets run from the scheduler and from the command processing after the uart +// processing main loop, in either case returning from here will release back to the main +// scheduler +void Ld2402Every250MSecond(void) { + if (LD2402.step) { + LD2402.step--; + if ((LD2402_CMND_Wait_Timeout&0xFFF0) == LD2402.step) { // Timeout countdown reaches zero + DEBUG_SENSOR_LOG(PSTR(D_LD2402_LOG_PREFIX "Device disconnected")); + LD2402.state = LD2402_DISCONNECTED; + } else if (!(LD2402.step&0x00F)) { // Command reaches zero + // preprocess - ensure module is in configuration mode except for end configuration + if ((LD2402_CMND_END_CONFIGURATION&0x00F != LD2402.step) && (LD2402_CONFIGURATION != LD2402.state)) { + LD2402.saved_step = LD2402.step; + LD2402.sent_cmnd = LD2402_CMND_START_CONFIGURATION>>4; + } else { + LD2402.sent_cmnd = LD2402.step>>4; + } + + // send configuration command + uint32_t val_len = LD2402.sent_cmnd>>8; + uint8_t stub[8] = LD2402_config_send_stub; + stub[4] = val_len + 2; + stub[6] = LD2402.sent_cmnd&0x0FF; + LD2402Serial->flush(); + LD2402Serial->write(stub, 8); + if ((LD2402_CMND_START_CONFIGURATION>>4) == LD2402.sent_cmnd) { // special override if we are setting configuration mode + stub[4] = 0x01; // reuse already sent stub buffer + LD2402Serial->write(stub+4, 2); + DEBUG_SENSOR_LOG(PSTR(D_LD2402_LOG_PREFIX "Send 0x%03X, 0100"), LD2402.sent_cmnd); + } else if (val_len) { // send configuration command argument + LD2402Serial->write(LD2402.cmnd_param, val_len); + DEBUG_SENSOR_LOG(PSTR(D_LD2402_LOG_PREFIX "Send 0x%03X, %*_H"), LD2402.sent_cmnd, val_len, LD2402.cmnd_param); + } else { + DEBUG_SENSOR_LOG(PSTR(D_LD2402_LOG_PREFIX "Send 0x%03X"), LD2402.sent_cmnd); + } + const uint8_t footer[4] = LD2402_config_footer_a; + LD2402Serial->write(footer, sizeof(footer)); + + LD2402.step = LD2402_CMND_Wait_Timeout; + } + } +} + +void Ld2402EverySecond(void) { + static enum LD2402_EngTypes person = LD2402_PERSON_UNKNOWN; + if (!LD2402.state || !LD2402.version || !LD2402.serial_number) { + DEBUG_SENSOR_LOG(PSTR(D_LD2402_LOG_PREFIX "Trying to connect.")); + LD2402.step = LD2402_CMND_READ_VERSION; + return; + } + +#ifdef LD2402_INCLUDE_FOLLOW + // if person has not changed and timer is not set, return + if (!LD2402.timer && (LD2402.person == person)) { return; } + // if timer is set, reduce timer + if (LD2402.timer) { --LD2402.timer; } + // if person has not changed and timer is still set, return + if (LD2402.timer && (LD2402.person == person)) { return; } + // if person has changed, save new person + if (LD2402.person != person) { person = LD2402.person; } + // if timer is not set, set to follow + if (!LD2402.timer) { LD2402.timer = LD2402.follow; } +#else + // if person has not changed, return + if (LD2402.person == person) { return; } + person = LD2402.person; +#endif // LD2402_INCLUDE_FOLLOW + + MqttPublishSensor(); +} + +void Ld2402Detect(void) { + if (PinUsed(GPIO_LD2402_RX) && PinUsed(GPIO_LD2402_TX)) { + LD2402.buffer = (uint8_t*)malloc(LD2402_ENG_LINE_LENGTH); + DEBUG_SENSOR_LOG(PSTR(D_LD2402_LOG_PREFIX "Buff size %d"), LD2402_BUFFER_SIZE); + if (!LD2402.buffer) { DEBUG_SENSOR_LOG(PSTR(D_LD2402_LOG_PREFIX "No buff")); return; } + LD2402Serial = new TasmotaSerial(Pin(GPIO_LD2402_RX), Pin(GPIO_LD2402_TX), 2, 0, LD2402_BUFFER_SIZE); + if (LD2402Serial->begin(115200)) { + if (LD2402Serial->hardwareSerial()) { ClaimSerial(); } + LD2402Serial->setTimeout(200); +#ifdef ESP32 + DEBUG_SENSOR_LOG(PSTR(D_LD2402_LOG_PREFIX "Serial UART%d"), LD2402Serial->getUart()); +#endif + volatile uint32_t i=0x01234567; + LD2402.endian_offset = ((*((uint8_t*)(&i))) != 0x67)*3; + } + } +} + +/*********************************************************************************************\ + * Commands +\*********************************************************************************************/ + +#define D_CMD_HELP "Help" +#define D_CMD_FOLLOW "Follow" +#define D_CMD_MODE "Mode" +#define D_CMD_AUTOUPDATE "AutoUpdate" +#define D_CMD_AUTOGAIN "AutoGain" +#define D_CMD_STATUS "Status" +#define D_CMD_SETCOMMON "SetCommon" +#define D_CMD_SETMOTION "SetMotion" +#define D_CMD_SETMICRO "SetMicro" +#define D_CMD_SAVE "Save" +#define D_CMD_REREAD "ReRead" + +const char kLd2402Commands[] PROGMEM = D_LD2402 "_|" // Prefix +#ifdef LD2402_INCLUDE_HELP + D_CMD_HELP "|" +#endif // LD2402_INCLUDE_HELP +#ifdef LD2402_INCLUDE_FOLLOW + D_CMD_FOLLOW "|" +#endif // LD2402_INCLUDE_FOLLOW + D_CMD_MODE "|" D_CMD_AUTOUPDATE "|" D_CMD_AUTOGAIN "|" D_CMD_STATUS "|" D_CMD_SETCOMMON "|" + D_CMD_SETMOTION "|" D_CMD_SETMICRO "|" D_CMD_SAVE "|" D_CMD_REREAD; + +void (* const Ld2402Command[])(void) PROGMEM = { +#ifdef LD2402_INCLUDE_HELP + &CmndLd2402Help, +#endif // LD2402_INCLUDE_HELP +#ifdef LD2402_INCLUDE_FOLLOW + , &CmndLd2402Follow +#endif // LD2402_INCLUDE_FOLLOW + &CmndLd2402Mode, &CmndLd2402AutoUpdate, &CmndLd2402AutoGain, &CmndLd2402Status, &CmndLd2402Common, + &CmndLd2402Motion, &CmndLd2402Micro, &CmndLd2402Save, &CmndLd2402ReRead }; + +#ifdef LD2402_INCLUDE_HELP +void CmndLd2402Help(void) { + Response_P(PSTR(D_COMMAND_PREFIX_JSON"\"%s"), D_CMD_HELP, "Available commands: "); + ResponseAppend_P(PSTR(D_LD2402 "_" D_CMD_MODE", ")); + ResponseAppend_P(PSTR(D_LD2402 "_" D_CMD_AUTOUPDATE", ")); + ResponseAppend_P(PSTR(D_LD2402 "_" D_CMD_AUTOGAIN" (fw 3.3.5+), ")); + ResponseAppend_P(PSTR(D_LD2402 "_" D_CMD_STATUS", ")); + ResponseAppend_P(PSTR(D_LD2402 "_" D_CMD_SETCOMMON", ")); + ResponseAppend_P(PSTR(D_LD2402 "_" D_CMD_SETMOTION", ")); + ResponseAppend_P(PSTR(D_LD2402 "_" D_CMD_SETMICRO", ")); + ResponseAppend_P(PSTR(D_LD2402 "_" D_CMD_SAVE" (fw 3.3.2+), ")); + ResponseAppend_P(PSTR(D_LD2402 "_" D_CMD_HELP", ")); + ResponseAppend_P(PSTR(D_LD2402 "_" D_CMD_REREAD", ")); + ResponseAppend_P(PSTR(D_LD2402 "_" D_CMD_FOLLOW"\"}")); +} +#endif // LD2402_INCLUDE_HELP + +#ifdef LD2402_INCLUDE_FOLLOW +void CmndLd2402Follow(void) { + if (ArgC() != 1) { +#ifdef LD2402_INCLUDE_HELP + Response_P(PSTR(D_COMMAND_HELP_MSG), D_CMD_FOLLOW, "Args: 0|n (MQTT update normal|MQTT update every n second(s))"); +#endif // LD2402_INCLUDE_HELP + return; + } + char Argument[XdrvMailbox.data_len]; + ArgV(Argument,1); + LD2402.timer = atoi(Argument); + LD2402.follow = LD2402.timer; + Response_P(PSTR(D_COMMAND_PREFIX_JSON"%d}"), D_CMD_FOLLOW, LD2402.follow); +} +#endif // LD2402_INCLUDE_FOLLOW + +void CmndLd2402Status(void) { + if (LD2402_DISCONNECTED == LD2402.state) { +#ifdef LD2402_INCLUDE_HELP + Response_P(PSTR(D_DISCONNECTED_MSG)); +#endif // LD2402_INCLUDE_HELP + return; + } + if (ArgC() != 1) { +#ifdef LD2402_INCLUDE_HELP + Response_P(PSTR(D_COMMAND_HELP_MSG), D_CMD_STATUS, "Args: 0|1|2 (parameters|sensor|firmware)"); +#endif // LD2402_INCLUDE_HELP + return; + } + uint32_t status_type = 0; + if (ArgC() == 1) { + char Argument[XdrvMailbox.data_len]; + ArgV(Argument,1); + status_type = atoi(Argument); + } + + Response_P(PSTR("{\"" D_LD2402)); + if (1 == status_type) { + ResponseAppend_P(PSTR("SNS\":{")); + Ld2402ResponseAppendReport(); + ResponseJsonEnd(); + } else if (2 == status_type) { + if (LD2402.version && LD2402.serial_number) { + ResponseAppend_P(PSTR("FWR\":{\"Version\":\"%s\",\"SerialNumber\":\"%s\"}"), LD2402.version, LD2402.serial_number); + } + } else { + ResponseAppend_P(PSTR("\":{\"MaximumDistance\":%d,\"DisappearenceDelay\":%d,\"MotionThresholds\":["), LD2402.max_distance, LD2402.disp_delay); + Ld2402ResponseAppendGates(LD2402.motion_threshold); + ResponseAppend_P(PSTR("],\"MicroThresholds\":[")); + Ld2402ResponseAppendGates(LD2402.motion_threshold ? LD2402.motion_threshold + LD2402_NUM_GATES * 4 : LD2402.motion_threshold); + ResponseAppend_P(PSTR("]}")); + } + ResponseJsonEnd(); +} + +void CmndLd2402AutoGain(void) { + if (LD2402.step) { +#ifdef LD2402_INCLUDE_HELP + Response_P(PSTR(D_BUSY_MSG)); +#endif // LD2402_INCLUDE_HELP + return; + } + if (ArgC()) { +#ifdef LD2402_INCLUDE_HELP + Response_P(PSTR(D_COMMAND_HELP_MSG), D_CMD_AUTOGAIN, "No Args: Starts the modules's automatic gain adjustment"); +#endif // LD2402_INCLUDE_HELP + return; + } + LD2402.step = LD2402_CMND_AUTO_GAIN; + Response_P(PSTR(D_COMMAND_HELP_MSG), D_CMD_AUTOGAIN, "Automatic gain ..."); +} + +void CmndLd2402Common(void) { + if (LD2402.step) { +#ifdef LD2402_INCLUDE_HELP + Response_P(PSTR(D_BUSY_MSG)); +#endif // LD2402_INCLUDE_HELP + return; + } + if (ArgC() != 2) { +#ifdef LD2402_INCLUDE_HELP + Response_P(PSTR(D_COMMAND_HELP_MSG), D_CMD_SETCOMMON, "Args: MaximumDistance,DisappearanceDelay (decimeter,seconds)"); +#endif // LD2402_INCLUDE_HELP + return; + } + uint32_t param[2] = { 0 }; + ParseParameters(2, param); + if (param[0]>100) {param[0] = 100;} + if (param[0]<7) {param[0] = 7;} + if (param[1]<0) {param[1] = 0;} + if (param[1]>65535) {param[1] = 65535;} + LD2402.max_distance = param[0]; + LD2402.disp_delay = param[1]; + Ld2402LoadLastParam(LD2402_MAX_DISTANCE); + LD2402.step = LD2402_CMND_WRITE_PARAM; + CmndLd2402Status(); +} + +void CmndLd2402Mode(void) { + if (LD2402.step) { +#ifdef LD2402_INCLUDE_HELP + Response_P(PSTR(D_BUSY_MSG)); +#endif // LD2402_INCLUDE_HELP + return; + } + if (ArgC() != 1) { +#ifdef LD2402_INCLUDE_HELP + Response_P(PSTR(D_COMMAND_HELP_MSG), D_CMD_MODE, "Args: 0|1 (normal|engineering)"); +#endif // LD2402_INCLUDE_HELP + return; + } + char Argument[XdrvMailbox.data_len]; + ArgV(Argument,1); + memset(LD2402.cmnd_param, 0x00, 6); + LD2402.cmnd_param[2] = atoi(Argument) ? 0x04 : 0x64; + Response_P(PSTR(D_COMMAND_PREFIX_JSON "\"%s\"}"), D_CMD_MODE, (0x04 == LD2402.cmnd_param[2] ? "Engineering" : "Normal")); + LD2402.step = LD2402_CMND_MODE; +} + +void CmndLd2402AutoUpdate(void) { + if (LD2402.step) { +#ifdef LD2402_INCLUDE_HELP + Response_P(PSTR(D_BUSY_MSG)); +#endif // LD2402_INCLUDE_HELP + return; + } + if (ArgC() != 3) { +#ifdef LD2402_INCLUDE_HELP + Response_P(PSTR(D_COMMAND_HELP_MSG), D_CMD_AUTOUPDATE, "Args: trigger,keep,micro (magnification factor, 1.0 to 20.0)"); +#endif // LD2402_INCLUDE_HELP + return; + } + + char strbuf[24]; + for (uint32_t i = 3; i; i--) { + ArgV(strbuf, i); + float param = CharToFloat(strbuf); + LD2402.cmnd_param[(i-1)*2] = (param < 1.0f) ? 10.0f : (param > 20.0f ? 200.0f : param * 10.0f); + } + LD2402.cmnd_param[3] = LD2402.cmnd_param[5] = 0x00; + + LD2402.step = LD2402_CMND_AUTO_THRESHOLD; + Response_P(PSTR(D_COMMAND_HELP_MSG), D_CMD_AUTOUPDATE, "Updating ..."); +} + +void CmndLd2402Save(void) { + if (LD2402.step) { +#ifdef LD2402_INCLUDE_HELP + Response_P(PSTR(D_BUSY_MSG)); +#endif // LD2402_INCLUDE_HELP + return; + } + if (ArgC()) { +#ifdef LD2402_INCLUDE_HELP + Response_P(PSTR(D_COMMAND_HELP_MSG), D_CMD_SAVE, "No Args: Saves configuration parameters in case of power failure (v3.3.2 and above)"); +#endif // LD2402_INCLUDE_HELP + return; + } + LD2402.step = LD2402_CMND_SAVE_PARAM; + Response_P(PSTR(D_COMMAND_HELP_MSG), D_CMD_SAVE, "Saving ..."); +} + +uint32_t Ld2402AllocThresholds(void) { + LD2402.motion_threshold = LD2402.motion_threshold ? LD2402.motion_threshold : (uint8_t*)malloc(2*LD2402_NUM_GATES*4); + if (!LD2402.motion_threshold) { +#ifdef LD2402_INCLUDE_HELP + Response_P(PSTR(D_COMMAND_HELP_MSG), D_CMD_SETMOTION "/" D_CMD_SETMICRO, "No buffer: Can't allocate threshold buffers"); +#endif // LD2402_INCLUDE_HELP + return 0; + } + return 1; +} + +void CmndLd2402ReRead(void) { + if (LD2402.step) { +#ifdef LD2402_INCLUDE_HELP + Response_P(PSTR(D_BUSY_MSG)); +#endif // LD2402_INCLUDE_HELP + return; + } + if (ArgC()) { +#ifdef LD2402_INCLUDE_HELP + Response_P(PSTR(D_COMMAND_HELP_MSG), D_CMD_REREAD, "No Args: Retrieves common and threshold data from device"); +#endif // LD2402_INCLUDE_HELP + return; + } + if (!Ld2402AllocThresholds()) { return; } + LD2402.cmnd_param[0] = LD2402_MAX_DISTANCE; + LD2402.step = LD2402_CMND_READ_PARAM; + Response_P(PSTR(D_COMMAND_HELP_MSG), D_CMD_REREAD, "Retrieving ... wait one second for it to complete"); +} + +void Ld2402WriteThresholds(uint8_t *thresholds, uint32_t cmnd_param) { + if (LD2402.step) { +#ifdef LD2402_INCLUDE_HELP + Response_P(PSTR("\" D_BUSY_MSG \"}")); +#endif // LD2402_INCLUDE_HELP + return; + } + if (ArgC() != 16) { +#ifdef LD2402_INCLUDE_HELP + Response_P(PSTR(D_COMMAND_HELP_MSG), D_CMD_SETMOTION "/" D_CMD_SETMICRO, "No Args: Saves configuration parameters in case of power failure (v3.3.2 and above)"); +#endif // LD2402_INCLUDE_HELP + return; + } + if (!Ld2402AllocThresholds()) { return; } + char strbuf[24]; + float param; + uint32_t i = 0, val; + for (uint32_t j = 0; j < LD2402_NUM_GATES; j++) { + ArgV(strbuf, j+1); + param = CharToFloat(strbuf) / 10.00f; + val = exp10(param > 9.500f ? 9.500f : param); + thresholds[i++] = val & 0x000000FF; + thresholds[i++] = val >> 8 & 0x000000FF; + thresholds[i++] = val >> 16 & 0x000000FF; + thresholds[i++] = val >> 24; + } + Ld2402LoadLastParam(cmnd_param); + LD2402.step = LD2402_CMND_WRITE_PARAM; + Response_P(PSTR(D_COMMAND_HELP_MSG), D_CMD_SETMOTION "/" D_CMD_SETMICRO, "Saving ..."); +} + +void CmndLd2402Motion(void) { + Ld2402WriteThresholds(LD2402.motion_threshold, LD2402_MOTION_START); +} + +void CmndLd2402Micro(void) { + Ld2402WriteThresholds(LD2402.motion_threshold + LD2402_NUM_GATES * 4, LD2402_MICRO_START); +} + +/*********************************************************************************************\ + * Presentation +\*********************************************************************************************/ + +#ifdef USE_WEBSERVER +const char HTTP_SNS_LD2402_DIS[] PROGMEM = + "{s}" D_LD2402 " " D_DISCONNECTED "{e}"; +const char HTTP_SNS_LD2402_ERR[] PROGMEM = + "{s}" D_LD2402 " " D_ERROR "{e}"; +const char HTTP_SNS_LD2402_INI[] PROGMEM = + "{s}" D_LD2402 " " D_INITIALIZED "{e}"; +const char HTTP_SNS_LD2402_CM[] PROGMEM = + "{s}" D_LD2402 " " D_DISTANCE "{m}%d " D_UNIT_CENTIMETER "{e}"; +const char HTTP_SNS_LD2402_MV[] PROGMEM = + "{s}" D_LD2402 " " D_DISTANCE " (!){m}%d " D_UNIT_CENTIMETER "{e}"; +const char HTTP_SNS_LD2402_UPD[] PROGMEM = + "{s}" D_LD2402 " " D_AUTO_UPDATE "{m}%d " D_UNIT_PERCENT "{e}"; + +void Ld2402Web(void) { + if (LD2402_AUTOUPDATE == LD2402.state) { + WSContentSend_PD(HTTP_SNS_LD2402_UPD, LD2402.auto_upd_progress); + } else if (LD2402_NORMAL == LD2402.state) { + WSContentSend_PD(HTTP_SNS_LD2402_CM, LD2402.detect_distance); + } else if (LD2402_ENGINEERING == LD2402.state) { + WSContentSend_PD((LD2402_PERSON_MOVING == LD2402.person ? HTTP_SNS_LD2402_MV : HTTP_SNS_LD2402_CM), LD2402.detect_distance); + } else if (LD2402_ERROR == LD2402.state) { + WSContentSend_PD(HTTP_SNS_LD2402_ERR); + } else if (LD2402_DISCONNECTED == LD2402.state) { + WSContentSend_PD(HTTP_SNS_LD2402_DIS); + } else { + WSContentSend_PD(HTTP_SNS_LD2402_INI); + } +} +#endif + +void Ld2402Show(void) { + ResponseAppend_P(PSTR(",\"" D_LD2402 "\":{")); + Ld2402ResponseAppendReport(); + ResponseJsonEnd(); +} + +/*********************************************************************************************\ + * Interface +\*********************************************************************************************/ + +bool Xsns102(uint32_t function) { + bool result = false; + + if (FUNC_INIT == function) { + Ld2402Detect(); + } + else if (LD2402Serial) { + switch (function) { + case FUNC_LOOP: + case FUNC_SLEEP_LOOP: + Ld2402Input(); + break; + case FUNC_EVERY_250_MSECOND: + Ld2402Every250MSecond(); + break; + case FUNC_EVERY_SECOND: + Ld2402EverySecond(); + break; + case FUNC_JSON_APPEND: + Ld2402Show(); + break; +#ifdef USE_WEBSERVER + case FUNC_WEB_SENSOR: + Ld2402Web(); + break; +#endif // USE_WEBSERVER + case FUNC_COMMAND: + result = DecodeCommand(kLd2402Commands, Ld2402Command); + break; + } + } + return result; +} + +#endif // USE_LD2402 diff --git a/tasmota/tasmota_xsns_sensor/xsns_53_sml.ino b/tasmota/tasmota_xsns_sensor/xsns_53_sml.ino index f010803c1..9e677380f 100755 --- a/tasmota/tasmota_xsns_sensor/xsns_53_sml.ino +++ b/tasmota/tasmota_xsns_sensor/xsns_53_sml.ino @@ -113,11 +113,24 @@ #define USE_SML_MEDIAN_FILTER #endif +// on ESP32 binary SML CRC check compile enabled by default +// adds 17936 bytes due to large crc tables +#ifdef ESP32 +#ifndef NO_USE_SML_CRC +#undef USE_SML_CRC +#define USE_SML_CRC +#endif +#endif + #ifdef USE_SML_DECRYPT #include "han_Parser.h" #endif +#ifdef USE_SML_CRC +#include "FastCRC.h" +FastCRC16 FastCRC; +#endif #ifndef SML_TRX_BUFF_SIZE #define SML_TRX_BUFF_SIZE 1024 @@ -194,6 +207,11 @@ on esp8266 6 filters A: decryption flags (8 bits) +C: +crc buffers and algorithm (available when compiled with USE_SML_CRC) +a. crc buffer size (bytes), must hold one full file +b. crc-algorithm: 0=x25, 1=ccitt, 15=autodetect +e.g. 1,=soC,1024,15 */ //#define MODBUS_DEBUG @@ -239,8 +257,8 @@ private: HardwareSerial *hws; }; - -void IRAM_ATTR sml_callRxRead(void *self) { ((SML_ESP32_SERIAL*)self)->rxRead(); }; +void IRAM_ATTR sml_callRxRead(void *self); +void sml_callRxRead(void *self) { ((SML_ESP32_SERIAL*)self)->rxRead(); }; SML_ESP32_SERIAL::SML_ESP32_SERIAL(uint32_t index) { uart_index = index; @@ -364,7 +382,7 @@ void SML_ESP32_SERIAL::updateBaudRate(uint32_t baud) { } // no wait mode only 8N1 (or 7X1, obis only, ignoring parity) -void IRAM_ATTR SML_ESP32_SERIAL::rxRead(void) { +void SML_ESP32_SERIAL::rxRead(void) { uint32_t diff; uint32_t level; @@ -467,6 +485,20 @@ typedef union { #define SML_PREFIX_SIZE 8 #endif +#ifdef USE_SML_CRC +struct SML_CRC_DATA { + uint8_t crcmode; //currently used mode + uint8_t crcdetectstate; //current auto-detection state + uint8_t *crcbuff; //buffer, only allocated on meter that have crc enabled + uint16_t crcbuff_pos; //current buffer wiring position + uint32_t crcfailcnt; //cnt bad-crc telegrams + uint32_t crcfinecnt; //cnt good-crc telegrams + uint32_t overflowcnt; //cnt good-crc telegrams + sint8_t telestartpos; //-1=still searching, 0=found + sint16_t teleendpos; //end of the telegram in the buffer or -1 when waiting for it +}; +#endif // USE_SML_CRC + struct METER_DESC { int8_t srcpin; uint8_t type; @@ -490,6 +522,10 @@ struct METER_DESC { uint16_t tout_ms; SO_FLAGS so_flags; char meter_id[METER_ID_SIZE]; +#ifdef USE_SML_CRC + uint16_t so_sml_crc = 0; + struct SML_CRC_DATA* sml_crc_data; +#endif #ifdef USE_SML_SPECOPT uint32_t so_obis1; uint32_t so_obis2; @@ -498,7 +534,6 @@ struct METER_DESC { uint8_t so_fcode2; uint8_t so_bpos2; #endif // USE_SML_SPECOPT - #ifdef ESP32 #ifndef USE_ESP32_SW_SERIAL HardwareSerial *meter_ss; @@ -557,6 +592,7 @@ struct METER_DESC { + #define TCP_MODE_FLG 0x7f // Meter flags @@ -1413,6 +1449,36 @@ uint8_t ebus_CalculateCRC( uint8_t *Data, uint16_t DataLen ) { return Crc; } +#ifdef USE_SML_CRC +uint16_t calculateSMLbinCRC(const uint8_t *data, uint16_t length, uint8_t crcmode) { + uint16_t res=0; + switch (crcmode % 6) { + case 0: + res = FastCRC.x25(data, length); + break; + case 1: + res = FastCRC.ccitt(data, length); + break; + case 2: + res = FastCRC.kermit(data, length); + break; + case 3: + res = FastCRC.modbus(data, length); + break; + case 4: + res = FastCRC.xmodem(data, length); + break; + case 5: + res = FastCRC.mcrf4xx(data, length); + break; + } + if (crcmode>5) { + res = (res >> 8) | (res << 8); // swap bytes + } + return res; +} +#endif + void sml_empty_receiver(uint32_t meters) { while (meter_desc[meters].meter_ss->available()) { meter_desc[meters].meter_ss->read(); @@ -1426,6 +1492,108 @@ void sml_shift_in(uint32_t meters, uint32_t shard) { if (!mp->sbuff) return; + #ifdef USE_SML_CRC + if ((mp->type=='s') && (mp->sml_crc_data) && (mp->so_sml_crc & 0x0fff)) { + // New handling with CRC validation + // Read data into the temporary buffer + struct SML_CRC_DATA *cp = mp->sml_crc_data; + if (cp->crcbuff_pos < (mp->so_sml_crc & 0x0fff)) { + cp->crcbuff[cp->crcbuff_pos++] = mp->meter_ss->read(); + } else { + // Buffer overflow, reset and log an error + cp->overflowcnt++; + AddLog(LOG_LEVEL_INFO, PSTR("SML: CRC buffer overflow, increase crc buffer size in your script modifying the line '1,soC=,'. Error occured %d times."),cp->overflowcnt); + //Hexdump(&cp->crcbuff[0], cp->crcbuff_pos); + if (cp->teleendpos==-1) { + if (cp->telestartpos==-1) { + AddLog(LOG_LEVEL_DEBUG, "SML: No start sequence was found."); + } else { + AddLog(LOG_LEVEL_DEBUG, "SML: Start sequence was found, but no stop sequence was found."); + } + } + cp->telestartpos=-1; + cp->teleendpos=-1; + cp->crcbuff_pos = 0; + } + + // Check for start of message until it is found + if (cp->telestartpos==-1) { + //check start of buffer for start sequence + if(cp->crcbuff_pos>=8) { + if (memcmp(&cp->crcbuff[0], "\x1B\x1B\x1B\x1B\x01\x01\x01\x01", 8) == 0 ) { + //found start sequence + cp->telestartpos=0; + } else { + memmove(&cp->crcbuff[0], &cp->crcbuff[1], cp->crcbuff_pos-1); + cp->crcbuff_pos--; + } + + } + } else { + if (cp->teleendpos==-1) { + if(cp->crcbuff_pos>=16 && memcmp(&cp->crcbuff[cp->crcbuff_pos-8], "\x1B\x1B\x1B\x1B\x1A", 5) == 0 ) + { + //found end sequence + cp->teleendpos=cp->crcbuff_pos-1; + //AddLog(LOG_LEVEL_INFO, PSTR("SML: Found stop sequence at %d length %d"),mp->teleendpos,len); + //Validate CRC + uint16_t extracted_crc = (cp->crcbuff[cp->crcbuff_pos - 1] << 8) | cp->crcbuff[cp->crcbuff_pos - 2]; + // Calculate the CRC for the data portion (excluding start, stop sequences, and CRC bytes) + uint16_t len=cp->teleendpos + 1; + //testing: fake some error for testing + //if (random(0, 50) < 30) {cp->crcbuff[12]=99;} + uint16_t calculated_crc = calculateSMLbinCRC(&cp->crcbuff[0], len-2, cp->crcmode); + if (calculated_crc == extracted_crc) { + cp->crcfinecnt++; + //AddLog(LOG_LEVEL_INFO, PSTR("SML: CRC ok")); + if (len > mp->sbsiz) { + len = mp->sbsiz; + } + for (uint16_t i=8; i<=cp->teleendpos - 8 - mp->sbsiz; i++) { + if (cp->crcbuff[i] == SML_SYNC || ((mp->flag & NO_SYNC_FLG) != 0)) { + if (i+len > cp->teleendpos) len--; + memcpy(mp->sbuff, &cp->crcbuff[i],len); + SML_Decode(meters); + } + } + } else { + cp->crcfailcnt++; + // CRC is invalid, log an error + AddLog(LOG_LEVEL_INFO, PSTR("SML: CRC error: len: %d file-crc: %04x calc-crc: %04x failcnt: %d okcnt: %d mode: %d state: %d"), cp->teleendpos, extracted_crc, calculated_crc, cp->crcfailcnt, cp->crcfinecnt, cp->crcmode, cp->crcdetectstate); + //Hexdump(&cp->crcbuff[0], cp->crcbuff_pos); + } + //auto-detect crc-mode from fine/fail-cnt if autodetect is running + if (cp->crcdetectstate>0){ //state=0 autodetect running + AddLog(LOG_LEVEL_DEBUG, PSTR("SML: CRC autodetection in progress. state: %d. probing mode: %d failcnt: %d okcnt: %d"), cp->crcdetectstate, cp->crcmode, cp->crcfailcnt, cp->crcfinecnt ); + //check how far we have come an decide how to go on + if (cp->crcfailcnt>3) { //seems bad choice + if (cp->crcdetectstate>25) { + AddLog(LOG_LEVEL_INFO, "SML: CRC autodetection failed, you can turn of CRC checks of via removing '1,soC=,' from your meter definition."); + } else { + cp->crcdetectstate++; + } + cp->crcmode++; + if(cp->crcmode>11) cp->crcmode=0; //mode 0-11 supported (6-11 are 1-5 with reversed byte order) + //reset counters and start over + cp->crcfailcnt=0; + cp->crcfinecnt=0; + AddLog(LOG_LEVEL_INFO, PSTR("SML: CRC mode auto-changed to: %d"), cp->crcmode); + } + if (cp->crcfinecnt>3) { + //fine, stop detecting now + AddLog(LOG_LEVEL_DEBUG, PSTR("SML: CRC autodetection ok after probe #%d selected mode: %d"), cp->crcdetectstate, cp->crcmode); + cp->crcdetectstate=0; + } + } + cp->teleendpos=-1; + cp->telestartpos=-1; + cp->crcbuff_pos = 0; + } + } + } + return; + } +#endif #ifdef USE_SML_DECRYPT if (mp->use_crypt) { if (mp->hp) { @@ -1433,7 +1601,7 @@ void sml_shift_in(uint32_t meters, uint32_t shard) { if (timediff > mp->tout_ms) { mp->hp->len = 0; mp->spos = 0; - AddLog(LOG_LEVEL_DEBUG, PSTR("SML: sync")); + AddLog(LOG_LEVEL_DEBUG, "SML: sync"); } mp->lastms = millis(); uint16_t len; @@ -1563,6 +1731,10 @@ void sml_shift_in(uint32_t meters, uint32_t shard) { if (mp->spos == 6 + tlen) { mp->spos = 0; memmove(&mp->sbuff[0], &mp->sbuff[6], mp->sbsiz - 6); +#ifdef MODBUS_DEBUG + AddLog(LOG_LEVEL_INFO, PSTR("meter %d, receive index >> %d"), meters, mp->index); + Hexdump(mp->sbuff, 10); +#endif SML_Decode(meters); if (mp->client) { mp->client->flush(); @@ -1578,7 +1750,7 @@ void sml_shift_in(uint32_t meters, uint32_t shard) { if (mlen > mp->sbsiz) mlen = mp->sbsiz; if (mp->spos >= mlen) { #ifdef MODBUS_DEBUG - AddLog(LOG_LEVEL_INFO, PSTR("receive index >> %d"), mp->index); + AddLog(LOG_LEVEL_INFO, PSTR("meter %d, receive index >> %d"), meters, mp->index); Hexdump(mp->sbuff, 10); #endif SML_Decode(meters); @@ -1758,11 +1930,11 @@ double sml_get_obis_value(uint8_t *data) { break; } case CosemTypeLong64Signed: { - out = ntohll(item->l64s.data); + out = ntohll_ams(item->l64s.data); break; } case CosemTypeLong64Unsigned: { - out = ntohll(item->l64u.data); + out = ntohll_ams(item->l64u.data); break; } } @@ -2158,6 +2330,13 @@ void SML_Decode(uint8_t index) { mbus_dval = *fp; mp += 8; cp += 4; + } else if (!strncmp_P(mp, PSTR("FFFFFFFF"), 8)) { + uint32_t val = (cp[0]<<0) | (cp[1]<<0) | (cp[2]<<16) | (cp[3]<<24); + float *fp = (float*)&val; + ebus_dval = *fp; + mbus_dval = *fp; + mp += 8; + cp += 4; } else if (!strncmp_P(mp, PSTR("FFffFFff"), 8)) { // reverse word float uint32_t val = (cp[1]<<0) | (cp[0]<<8) | (cp[3]<<16) | (cp[2]<<24); @@ -2916,7 +3095,18 @@ struct METER_DESC *mp = &meter_desc[mnum]; mp->crypflags = strtol(cp, &cp, 10); break; #endif // USE_SML_DECRYPT - case '6': +#ifdef USE_SML_CRC + case 'C': //1,=soC,, example: 1,=soC,1024,0 (mode=x25,1=ccitt,15=autodetect) + cp += 2; + mp->so_sml_crc = strtol(cp, &cp, 10)&0x0fff; + if (*cp == ',') { + cp++; + mp->so_sml_crc |= strtol(cp, &cp, 10)<<12; + } + AddLog(LOG_LEVEL_INFO, PSTR("SML: CRC specialoptions (=soC) so_sml_crc='%x'"),mp->so_sml_crc); + break; +#endif // USE_SML_CRC +case '6': cp += 2; mp->tout_ms = strtol(cp, &cp, 10); break; @@ -3008,6 +3198,17 @@ void reset_sml_vars(uint16_t maxmeters) { mp->so_obis1 = 0; mp->so_obis2 = 0; #endif +#ifdef USE_SML_CRC + AddLog(LOG_LEVEL_INFO, "SML: CRC reset"); + struct SML_CRC_DATA* cp = mp->sml_crc_data; + if (cp && (mp->so_sml_crc & 0x0fff)) { + AddLog(LOG_LEVEL_INFO, "SML: CRC free buffer"); + free(mp->sml_crc_data->crcbuff); + free(mp->sml_crc_data); + mp->sml_crc_data=0; + } + mp->so_sml_crc=0; +#endif // USE_SML_CRC mp->so_flags.data = 0; // addresses a bug in meter DWS74 #ifdef DWS74_BUG @@ -3056,6 +3257,9 @@ void reset_sml_vars(uint16_t maxmeters) { memset(mp->auth, 0, SML_CRYPT_SIZE); #endif #endif // USE_SML_DECRYPT + + + } } @@ -3369,7 +3573,39 @@ dddef_exit: // 1,=h————————————— if (!strncmp_P(lp1 + 1, PSTR(",=h"), 3) || !strncmp_P(lp1 + 1, PSTR(",=so"), 4)) { if (!strncmp_P(lp1 + 1, PSTR(",=so"), 4)) { - SpecOptions(lp1 + 5, mnum - 1); + SpecOptions(lp1 + 5, mnum - 1); + +#ifdef USE_SML_CRC + if (mmp->so_sml_crc & 0x0fff) { + AddLog(LOG_LEVEL_INFO, "SML: CRC active -> init"); + if (mmp->sml_crc_data) { + AddLog(LOG_LEVEL_INFO, PSTR("SML: CRC config change - reinit. Buffersize: %d mode: %d"), mmp->so_sml_crc & 0x0fff, (mmp->so_sml_crc & 0xf000)>>12); + free(mmp->sml_crc_data->crcbuff); + free(mmp->sml_crc_data); + } + struct SML_CRC_DATA* cp = (struct SML_CRC_DATA*)calloc(sizeof(struct SML_CRC_DATA), 1); + cp->telestartpos=-1; + cp->teleendpos=-1; + memory += sizeof(struct SML_CRC_DATA); + cp->crcbuff = (uint8_t*)calloc(mmp->so_sml_crc & 0x0fff, 1); + memory += (mmp->so_sml_crc & 0x0fff); + cp->crcmode=(mmp->so_sml_crc & 0xf000)>>12; + if (cp->crcmode == 15) { + //start autodetection probe mode 0 first + cp->crcmode=0; + cp->crcdetectstate=1; + AddLog(LOG_LEVEL_INFO, "SML: CRC mode autodetect"); + } else { + //keep mode as given, turn off autodetect + if (cp->crcmode > 11) cp->crcmode=0; + cp->crcdetectstate=0; + AddLog(LOG_LEVEL_INFO, PSTR("SML: CRC mode %d"),cp->crcmode); + } + mmp->sml_crc_data=cp; + } +#endif // USE_SML_CRC + + } } else { sml_globs.maxvars++; @@ -3399,7 +3635,7 @@ next_line: *tp = 0; sml_globs.meter_p = sml_globs.script_meter; - // set serial buffers + // set serial and crc buffers for (uint32_t meters = 0; meters < sml_globs.meters_used; meters++ ) { struct METER_DESC *mp = &meter_desc[meters]; if (mp->sbsiz) { @@ -3407,7 +3643,6 @@ next_line: memory += mp->sbsiz; } } - // initialize hardware typedef void (*function)(); uint8_t cindex = 0; @@ -4447,7 +4682,7 @@ void SML_Send_Seq(uint32_t meter, char *seq) { #ifdef MODBUS_DEBUG uint8_t type = mp->type; if (!sml_globs.dump2log && (type == 'm' || type == 'M' || type == 'k')) { - AddLog(LOG_LEVEL_INFO, PSTR("transmit index >> %d"),sml_globs.mp[meter].index); + AddLog(LOG_LEVEL_INFO, PSTR("meter %d, transmit index >> %d"), meter, sml_globs.mp[meter].index); Hexdump(sbuff, slen); } #endif diff --git a/tasmota/tasmota_xsns_sensor/xsns_54_ina226.ino b/tasmota/tasmota_xsns_sensor/xsns_54_ina226.ino index 9df7e9b15..a41e72b5e 100644 --- a/tasmota/tasmota_xsns_sensor/xsns_54_ina226.ino +++ b/tasmota/tasmota_xsns_sensor/xsns_54_ina226.ino @@ -78,7 +78,11 @@ #define INA226_REG_CONFIG (0x00) // Config register #define INA226_RES_CONFIG (0x4127) // Config register at reset -#define INA226_DEF_CONFIG (0x42FF) // Our default configuration +// 0x4B27 = 0100 101 (256 - averages) 100 (1.1 ms - vbusct) 100 (1.1 ms - vshct) 111 (continuous - mode) +// driver will sample 256 * (1.1 ms + 1.1 ms) = 563.2 ms of data per second +#ifndef INA226_DEF_CONFIG +#define INA226_DEF_CONFIG (0x4B27) // Our default configuration +#endif #define INA226_CONFIG_RESET (0x8000) // Config register reset bit #define INA226_REG_SHUNTVOLTAGE (0x01) @@ -460,7 +464,7 @@ bool Ina226CommandSensor() // Full scale vbus is volatile (saved in RAM) dtostrfd((Ina226Info[device].vbus_lsb*32768.0), 2, fs_vbus_str); // Send json response - Response_P(PSTR("{\"Sensor54-device-settings-%d\":{\"SHUNT_R\":%s,\"FS_I\":%s\"FS_V\":%s}}"), + Response_P(PSTR("{\"Sensor54-device-settings-%d\":{\"SHUNT_R\":%s,\"FS_I\":%s,\"FS_V\":%s}}"), device + 1, shunt_r_str, fs_i_str, fs_vbus_str); } diff --git a/tasmota/tasmota_xsns_sensor/xsns_62_esp32_mi_ble.ino b/tasmota/tasmota_xsns_sensor/xsns_62_esp32_mi_ble.ino index 752e2fdd1..d307d255e 100644 --- a/tasmota/tasmota_xsns_sensor/xsns_62_esp32_mi_ble.ino +++ b/tasmota/tasmota_xsns_sensor/xsns_62_esp32_mi_ble.ino @@ -20,11 +20,13 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ -#define MI32_VERSION "V0.9.2.4" +#define MI32_VERSION "V0.9.2.5" /* -------------------------------------------------------------------------------------------- Version yyyymmdd Action Description -------------------------------------------------------------------------------------------- + 0.9.2.5 20250319 changed - added support for MI LYWSD02MMC with different device ID + 0.9.2.4 20240111 changed - Enhancement of debug log output ------- 0.9.2.3 20240101 changed - added initial support for MI LYWSD02MMC @@ -492,8 +494,9 @@ void (*const MI32_Commands[])(void) PROGMEM = { #define AT_BTN 18 #define MI_SJWS01LM 19 #define MI_LYWSD02MMC 20 +#define MI_LYWSD02MMC2 21 -#define MI_MI32_TYPES 20 //count this manually +#define MI_MI32_TYPES 21 //count this manually const uint16_t kMI32DeviceID[MI_MI32_TYPES]={ 0x0000, // Unkown @@ -515,7 +518,8 @@ const uint16_t kMI32DeviceID[MI_MI32_TYPES]={ 0x066f, // CGDK2 0x004e, // Avago Tech Bluetooth Buttons (Company Id) 0x0863, // SJWS01LM - 0x2542 // LYWSD02MMC + 0x2542, // LYWSD02MMC + 0x16e4 // LYWSD02MMC F3_A1 hardware revision, 2.0.1_0060 firmware revision }; const char kMI32DeviceType0[] PROGMEM = "Unknown"; @@ -538,10 +542,11 @@ const char kMI32DeviceType16[] PROGMEM ="CGDK2"; const char kMI32DeviceType17[] PROGMEM ="ATBTN"; const char kMI32DeviceType18[] PROGMEM = "SJWS01LM"; const char kMI32DeviceType19[] PROGMEM = "LYWSD02MMC"; +const char kMI32DeviceType20[] PROGMEM = "LYWSD02MMC"; const char * kMI32DeviceType[] PROGMEM = {kMI32DeviceType0, kMI32DeviceType1, kMI32DeviceType2, kMI32DeviceType3, kMI32DeviceType4, kMI32DeviceType5, kMI32DeviceType6, kMI32DeviceType7, kMI32DeviceType8, kMI32DeviceType9, kMI32DeviceType10, kMI32DeviceType11, kMI32DeviceType12, kMI32DeviceType13, kMI32DeviceType14, kMI32DeviceType15, - kMI32DeviceType16, kMI32DeviceType17, kMI32DeviceType18, kMI32DeviceType19}; + kMI32DeviceType16, kMI32DeviceType17, kMI32DeviceType18, kMI32DeviceType19, kMI32DeviceType20}; typedef int BATREAD_FUNCTION(int slot); typedef int UNITWRITE_FUNCTION(int slot, int unit); @@ -796,6 +801,7 @@ int genericSensorReadFn(int slot, int force){ res = MI32Operation(slot, OP_READ_HT_LY, LYWSD03_Svc, nullptr, LYWSD03_BattNotifyChar); break; case MI_LYWSD02MMC: + case MI_LYWSD02MMC2: res = MI32Operation(slot, OP_READ_HT_LY, LYWSD03_Svc, nullptr, LYWSD03_BattNotifyChar); break; case MI_MHOC401: @@ -944,6 +950,7 @@ int genericTimeWriteFn(int slot){ int res = 0; switch (MIBLEsensors[slot].type){ case MI_LYWSD02MMC: + case MI_LYWSD02MMC2: case MI_LYWSD02: { union { uint8_t buf[5]; @@ -2129,6 +2136,21 @@ int MI32parseMiPayload(int _slot, struct mi_beacon_data_t *parsed){ MIBLEsensors[_slot].shallSendMQTT = 1; MIBLEsensors[_slot].feature.Btn = 1; } break; + case 0x4c01:{ // 'temperature' + const uint32_t payload32 = uint32_t(parsed->payload.data[0]) | (uint32_t(parsed->payload.data[1]) << 8) | (uint32_t(parsed->payload.data[2]) << 16) | (uint32_t(parsed->payload.data[3]) << 24); + float _tempFloat; + memcpy(&_tempFloat, &payload32, sizeof(_tempFloat)); + MIBLEsensors[_slot].temp = _tempFloat; + MIBLEsensors[_slot].feature.temp = 1; + MIBLEsensors[_slot].eventType.temp = 1; + } break; + case 0x4c02:{ // 'humidity' + const uint8_t payload8 = parsed->payload.data[0]; + float _tempFloat = (float)payload8 / 1.0f; + MIBLEsensors[_slot].hum = _tempFloat; + MIBLEsensors[_slot].feature.hum = 1; + MIBLEsensors[_slot].eventType.hum = 1; + } break; //Weight attributes 0x101A 600 0 //No one moves over time 0x101B 1 1 @@ -2279,7 +2301,7 @@ void MI32notifyHT_LY(int _slot, char *_buf, int len){ if (BLE_ESP32::BLEDebugMode) AddLog(LOG_LEVEL_DEBUG_MORE, PSTR("M32: %s: LYWSD0x Hum updated %1_f"), MIaddrStr(MIBLEsensors[_slot].MAC), &MIBLEsensors[_slot].hum); } MIBLEsensors[_slot].eventType.tempHum = 1; - if (MIBLEsensors[_slot].type == MI_LYWSD02MMC || MIBLEsensors[_slot].type == MI_LYWSD03MMC || MIBLEsensors[_slot].type == MI_MHOC401){ + if (MIBLEsensors[_slot].type == MI_LYWSD02MMC || MIBLEsensors[_slot].type == MI_LYWSD02MMC2 || MIBLEsensors[_slot].type == MI_LYWSD03MMC || MIBLEsensors[_slot].type == MI_MHOC401){ // ok, so CR2032 is 3.0v, but drops immediately to ~2.9. // so we'll go with the 2.1 min, 2.95 max. float minVolts = 2100.0; diff --git a/tasmota/tasmota_xsns_sensor/xsns_87_mcp2515.ino b/tasmota/tasmota_xsns_sensor/xsns_87_mcp2515.ino index 188fd74c8..842e44f47 100644 --- a/tasmota/tasmota_xsns_sensor/xsns_87_mcp2515.ino +++ b/tasmota/tasmota_xsns_sensor/xsns_87_mcp2515.ino @@ -92,11 +92,16 @@ #define BMS_SERIAL 0x4000 #define BMS_MODULES_OK 0x8000 #define BMS_CELL_VOLT_TEMP 0x10000 + #define BMS_VOLT_LOW_ID 0x20000 + #define BMS_VOLT_HIGH_ID 0x40000 + #define BMS_TEMP_LOW_ID 0x80000 + #define BMS_TEMP_HIGH_ID 0x100000 struct BMS_Struct { uint32_t setFields; // Bitwise fields set list char name[17]; uint16_t stateOfCharge; + uint16_t stateOfChargeHighRes; uint16_t stateOfHealth; uint16_t chargeVoltLimit; // Div 10 uint16_t dischargeVolt; // Div 10 @@ -118,6 +123,10 @@ struct BMS_Struct { uint16_t maxCellVolt; uint16_t cellTempLow; uint16_t cellTempHigh; + char minCellId[9]; + char maxCellId[9]; + char tempLowCellId[9]; + char tempHighCellId[9]; } bms; #endif @@ -207,6 +216,7 @@ void MCP2515_Read() { if (6 >= canFrame.can_dlc) { bms.stateOfCharge = (canFrame.data[1] << 8) | canFrame.data[0]; bms.stateOfHealth = (canFrame.data[3] << 8) | canFrame.data[2]; + bms.stateOfChargeHighRes = (canFrame.data[5] << 8) | canFrame.data[4]; bms.setFields |= BMS_SOC | BMS_SOH; } else { MCP2515_FrameSizeError(canFrame.can_dlc, canFrame.can_id); @@ -228,7 +238,7 @@ void MCP2515_Read() { break; // Manufacturer name case 0x35E: - for (int i = 0; i < canFrame.can_dlc; i++) { + for (int i = 0; i < canFrame.can_dlc && i < 9; i++) { bms.manuf[i] = canFrame.data[i]; } bms.setFields |= BMS_MANUFACTURER; @@ -236,7 +246,7 @@ void MCP2515_Read() { break; // Battery Model / Firmware version case 0x35F: - if (4 == canFrame.can_dlc) { + if (4 >= canFrame.can_dlc) { bms.model = (canFrame.data[1] << 8) | canFrame.data[0]; bms.firmwareVer = (canFrame.data[3] << 8) | canFrame.data[2]; bms.setFields |= BMS_MODEL | BMS_FIRMWARE_VER; @@ -247,7 +257,7 @@ void MCP2515_Read() { // Battery / BMS name case 0x370: case 0x371: - for (int i = 0; i < canFrame.can_dlc; i++) { + for (int i = 0; i < canFrame.can_dlc && i < 9; i++) { uint8_t nameStrPos = i + ((canFrame.can_id & 0x1) * 8); // If can_id is 0x371 then fill from byte 8 onwards bms.name[nameStrPos] = canFrame.data[i]; } @@ -258,7 +268,7 @@ void MCP2515_Read() { break; // Modules status case 0x372: - if (4 == canFrame.can_dlc) { + if (8 >= canFrame.can_dlc) { bms.nrModulesOk = (canFrame.data[1] << 8) | canFrame.data[0]; bms.nrModulesBlockingCharge = (canFrame.data[3] << 8) | canFrame.data[2]; bms.nrModulesBlocking = (canFrame.data[5] << 8) | canFrame.data[4]; @@ -270,7 +280,7 @@ void MCP2515_Read() { break; // Min/Max cell voltage/temperature case 0x373: - if (4 == canFrame.can_dlc) { + if (8 >= canFrame.can_dlc) { bms.minCellVolt = (canFrame.data[1] << 8) | canFrame.data[0]; bms.maxCellVolt = (canFrame.data[3] << 8) | canFrame.data[2]; bms.cellTempLow = (canFrame.data[5] << 8) | canFrame.data[4]; @@ -282,12 +292,35 @@ void MCP2515_Read() { break; // Min. cell voltage id string case 0x374: + for (int i = 0; i < canFrame.can_dlc && i < 9; i++) { + bms.minCellId[i] = canFrame.data[i]; + } + bms.setFields |= BMS_VOLT_LOW_ID; + bms.minCellId[8] = 0; // Ensure that the string is null terminated + break; // Max. cell voltage id string case 0x375: + for (int i = 0; i < canFrame.can_dlc && i < 9; i++) { + bms.maxCellId[i] = canFrame.data[i]; + } + bms.setFields |= BMS_VOLT_HIGH_ID; + bms.maxCellId[8] = 0; // Ensure that the string is null terminated + break; // Min. cell temperature id string case 0x376: + for (int i = 0; i < canFrame.can_dlc && i < 9; i++) { + bms.tempLowCellId[i] = canFrame.data[i]; + } + bms.setFields |= BMS_TEMP_LOW_ID; + bms.tempLowCellId[8] = 0; // Ensure that the string is null terminated + break; // Max. cell temperature id string case 0x377: + for (int i = 0; i < canFrame.can_dlc && i < 9; i++) { + bms.tempHighCellId[i] = canFrame.data[i]; + } + bms.setFields |= BMS_TEMP_HIGH_ID; + bms.tempHighCellId[8] = 0; // Ensure that the string is null terminated break; // Installed capacity case 0x379: @@ -301,7 +334,7 @@ void MCP2515_Read() { // Serial number case 0x380: case 0x381: - for (int i = 0; i < canFrame.can_dlc; i++) { + for (int i = 0; i < canFrame.can_dlc && i < 9; i++) { uint8_t serialNrStrPos = i + ((canFrame.can_id & 0x1) * 8); // If can_id is 0x381 then fill from byte 8 onwards bms.serialNr[serialNrStrPos] = canFrame.data[i]; } @@ -360,7 +393,7 @@ void MCP2515_Show(bool Json) { jsonFirstField = false; } if (bms.setFields & BMS_VOLT) { - ResponseAppend_P(PSTR("%s\"BattVolt\":%d.%d"), jsonFirstField ? PSTR("") : PSTR(","), bms.battVoltage / 100, bms.battVoltage % 100); + ResponseAppend_P(PSTR("%s\"BattVolt\":%d.%02d"), jsonFirstField ? PSTR("") : PSTR(","), bms.battVoltage / 100, bms.battVoltage % 100); jsonFirstField = false; } if (bms.setFields & BMS_AMP) { @@ -391,6 +424,20 @@ void MCP2515_Show(bool Json) { ResponseAppend_P(PSTR("%s\"MaxDischargeAmp\":%d.%d"), jsonFirstField ? PSTR("") : PSTR(","), bms.maxDischargeCurrent / 10, bms.maxDischargeCurrent % 10); jsonFirstField = false; } + if (bms.setFields & BMS_MODULES_OK) { + ResponseAppend_P(PSTR("%s\"ModulesOk\":%d"), jsonFirstField ? PSTR("") : PSTR(","), bms.nrModulesOk); + ResponseAppend_P(PSTR("%s\"ModulesBlockingCharge\":%d"), PSTR(","), bms.nrModulesBlockingCharge); + ResponseAppend_P(PSTR("%s\"ModulesBlocking\":%d"), PSTR(","), bms.nrModulesBlocking); + ResponseAppend_P(PSTR("%s\"ModulesOffline\":%d"), PSTR(","), bms.nrModulesOffline); + jsonFirstField = false; + } + if (bms.setFields & BMS_CELL_VOLT_TEMP) { + ResponseAppend_P(PSTR("%s\"CellVoltMin\":%d"), jsonFirstField ? PSTR("") : PSTR(","), bms.minCellVolt); + ResponseAppend_P(PSTR("%s\"CellVoltMax\":%d"), PSTR(","), bms.maxCellVolt); + ResponseAppend_P(PSTR("%s\"CellTempLow\":%d"), PSTR(","), bms.cellTempLow); + ResponseAppend_P(PSTR("%s\"CellTempHigh\":%d"), PSTR(","), bms.cellTempHigh); + jsonFirstField = false; + } ResponseAppend_P(PSTR("}")); } @@ -402,8 +449,16 @@ void MCP2515_Show(bool Json) { } else { #ifdef MCP2515_BMS_CLIENT if (bms.setFields & BMS_MANUFACTURER) { + if (bms.setFields & BMS_SERIAL) { + WSContentSend_PD(PSTR("{s}%s Serial number{m}%s {e}"), bms.manuf, bms.serialNr); + } + if (bms.setFields & BMS_CAPACITY) { + WSContentSend_PD(PSTR("{s}%s Installed Capacity{m}%d Ah{e}"), bms.manuf, bms.capacityAh); + } if (bms.setFields & BMS_SOC) { - WSContentSend_PD(HTTP_SNS_SOC, bms.manuf, bms.stateOfCharge); + char socStr[6]; + dtostrf((float(bms.stateOfChargeHighRes) / 10), 5, 1, socStr); + WSContentSend_PD(PSTR("{s}%s State of Charge{m}%s%%{e}"), bms.manuf, socStr); } if (bms.setFields & BMS_SOH) { WSContentSend_PD(HTTP_SNS_SOH, bms.manuf, bms.stateOfHealth); @@ -447,10 +502,18 @@ void MCP2515_Show(bool Json) { } if (bms.setFields & BMS_CELL_VOLT_TEMP) { WSContentSend_PD(PSTR("{s}%s Cell Voltage Min{m}%d " D_UNIT_MILLIVOLT "{e}"), bms.manuf, bms.minCellVolt); - WSContentSend_PD(PSTR("{s}%s Cell Voltage Max{m}%d " D_UNIT_MILLIVOLT "{e}"), bms.manuf, bms.maxCellVolt ); + WSContentSend_PD(PSTR("{s}%s Cell Voltage Max{m}%d " D_UNIT_MILLIVOLT "{e}"), bms.manuf, bms.maxCellVolt); WSContentSend_PD(PSTR("{s}%s Cell Temp Low{m}%d " D_UNIT_KELVIN "{e}"), bms.manuf, bms.cellTempLow); WSContentSend_PD(PSTR("{s}%s Cell Temp High{m}%d " D_UNIT_KELVIN "{e}"), bms.manuf, bms.cellTempHigh); } + if ((bms.setFields & BMS_VOLT_LOW_ID) && (bms.setFields & BMS_VOLT_HIGH_ID)) { + WSContentSend_PD(PSTR("{s}%s Cell Low Volt ID{m}%d {e}"), bms.manuf, bms.maxCellId); + WSContentSend_PD(PSTR("{s}%s Cell High Volt ID{m}%d {e}"), bms.manuf, bms.minCellId); + } + if ((bms.setFields & BMS_TEMP_LOW_ID) && (bms.setFields & BMS_TEMP_HIGH_ID)) { + WSContentSend_PD(PSTR("{s}%s Cell Low Temp ID{m}%d {e}"), bms.manuf, bms.tempLowCellId); + WSContentSend_PD(PSTR("{s}%s Cell High Temp ID{m}%d {e}"), bms.manuf, bms.tempHighCellId); + } } else { WSContentSend_PD(PSTR("{s}MCP2515 {m} Waiting for data{e}")); diff --git a/tools/decode-status.py b/tools/decode-status.py index fc1e750be..acd9ba636 100755 --- a/tools/decode-status.py +++ b/tools/decode-status.py @@ -311,8 +311,8 @@ a_features = [[ "USE_MAGIC_SWITCH","USE_PIPSOLAR","USE_GPIO_VIEWER","USE_AMSX915", "USE_SPI_LORA","USE_SPL06_007","USE_QMP6988","USE_WOOLIIS", "USE_HX711_M5SCALES","USE_RX8010","USE_PCF85063","USE_ESP32_TWAI", - "USE_C8_CO2_5K","","","", - "","","","", + "USE_C8_CO2_5K","USE_WIZMOTE","USE_V9240","USE_TELNET", + "USE_XYZMODEM","","","", "","","","", "","","","", "","","","" @@ -343,7 +343,7 @@ else: obj = json.load(fp) def StartDecode(): - print ("\n*** decode-status.py v14.4.1.4 by Theo Arends and Jacek Ziolkowski ***") + print ("\n*** decode-status.py v14.5.0.3 by Theo Arends and Jacek Ziolkowski ***") # print("Decoding\n{}".format(obj))