mirror of
https://github.com/arendst/Tasmota.git
synced 2025-04-25 07:17:16 +00:00
Merge branch 'development' into thermostat_webui
This commit is contained in:
commit
be6fbefb46
2
.github/PULL_REQUEST_TEMPLATE.md
vendored
2
.github/PULL_REQUEST_TEMPLATE.md
vendored
@ -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.4.9
|
||||
- [ ] The code change is tested and works with Tasmota core ESP32 V.1.0.7.5
|
||||
- [ ] The code change is tested and works with Tasmota core ESP32 V.2.0.1
|
||||
- [ ] 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**_
|
||||
|
12
CHANGELOG.md
12
CHANGELOG.md
@ -3,21 +3,31 @@ All notable changes to this project will be documented in this file.
|
||||
|
||||
## [Unreleased] - Development
|
||||
|
||||
## [10.0.0.2]
|
||||
### Added
|
||||
- Support for HDC2010 temperature/humidity sensor by Luc Boudreau (#13633)
|
||||
|
||||
### Changed
|
||||
- ESP32 core library from v1.0.7.5 to v2.0.1
|
||||
|
||||
## [10.0.0.1]
|
||||
### Added
|
||||
- Berry add module ``python_compat`` to be closer to Python syntax (#13428)
|
||||
- 1 second heartbeat GPIO
|
||||
- Command ``TcpConfig`` for TCPBridge protocol configuration (#13565)
|
||||
|
||||
### Changed
|
||||
- File editor no-wrap (#13427)
|
||||
- ESP32 core library from v1.0.7.4 to v1.0.7.5
|
||||
- ESP32C3 core library from v2.0.0-post to v2.0.1-rc1
|
||||
- ESP32-C3 core library from v2.0.0-post to v2.0.1-rc1
|
||||
|
||||
### Fixed
|
||||
- Initial reset RTC memory based variables like EnergyToday and EnergyTotal
|
||||
- ESP32 Telegram compile error (#13435)
|
||||
- SML compile error (#13441)
|
||||
- GUI checkbox MQTT TLS not saved regression from v9.2.0.3 (#13442)
|
||||
- Discovery of shutters (#13572)
|
||||
- ESP32-C3 OneWire as used by DS18x20 (#13583)
|
||||
|
||||
## [Released]
|
||||
|
||||
|
@ -97,3 +97,4 @@ Index | Define | Driver | Device | Address(es) | Description
|
||||
61 | USE_T67XX | xsns_89 | T67XX | 0x15 | CO2 sensor
|
||||
62 | USE_SCD40 | xsns_92 | SCD40 | 0x62 | CO2 sensor Sensirion SCD40/SCD41
|
||||
63 | USE_HM330X | xsns_93 | HM330X | 0x40 | Particule sensor
|
||||
64 | USE_HDC2010 | xsns_94 | HDC2010 | 0x40 | Temperature and Humidity sensor
|
||||
|
@ -100,20 +100,25 @@ The latter links can be used for OTA upgrades too like ``OtaUrl http://ota.tasmo
|
||||
|
||||
[Complete list](BUILDS.md) of available feature and sensors.
|
||||
|
||||
## Changelog v10.0.0.1
|
||||
## Changelog v10.0.0.2
|
||||
### Added
|
||||
- 1 second heartbeat GPIO
|
||||
- ESP32 Berry add module ``python_compat`` to be closer to Python syntax [#13428](https://github.com/arendst/Tasmota/issues/13428)
|
||||
- Command ``TcpConfig`` for TCPBridge protocol configuration [#13565](https://github.com/arendst/Tasmota/issues/13565)
|
||||
- Support for HDC2010 temperature/humidity sensor by Luc Boudreau [#13633](https://github.com/arendst/Tasmota/issues/13633)
|
||||
|
||||
### Breaking Changed
|
||||
|
||||
### Changed
|
||||
- File editor no-wrap [#13427](https://github.com/arendst/Tasmota/issues/13427)
|
||||
- ESP32 core library from v1.0.7.4 to v1.0.7.5
|
||||
- ESP32C3 core library from v2.0.0-post to v2.0.1-rc1
|
||||
- ESP32 core library from v1.0.7.4 to v2.0.1
|
||||
- ESP32-C3 core library from v2.0.0-post to v2.0.1-rc1
|
||||
|
||||
### Fixed
|
||||
- Initial reset RTC memory based variables like EnergyToday and EnergyTotal
|
||||
- ESP32 Telegram compile error [#13435](https://github.com/arendst/Tasmota/issues/13435)
|
||||
- SML compile error [#13441](https://github.com/arendst/Tasmota/issues/13441)
|
||||
- GUI checkbox MQTT TLS not saved regression from v9.2.0.3 [#13442](https://github.com/arendst/Tasmota/issues/13442)
|
||||
- Discovery of shutters [#13572](https://github.com/arendst/Tasmota/issues/13572)
|
||||
- ESP32-C3 OneWire as used by DS18x20 [#13583](https://github.com/arendst/Tasmota/issues/13583)
|
||||
|
||||
|
14
lib/default/TasmotaLList/library.json
Normal file
14
lib/default/TasmotaLList/library.json
Normal file
@ -0,0 +1,14 @@
|
||||
{
|
||||
"name": "TasmotaLList",
|
||||
"version": "1.0",
|
||||
"description": "Simple yet powerful linked-list",
|
||||
"license": "MIT",
|
||||
"homepage": "https://github.com/arendst/Tasmota",
|
||||
"frameworks": "*",
|
||||
"platforms": "*",
|
||||
"authors":
|
||||
{
|
||||
"name": "Stephan Hadinger",
|
||||
"maintainer": true
|
||||
}
|
||||
}
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
support_light_list.ino - Lightweight Linked List for simple objects - optimized for low code size and low memory
|
||||
LList.h - Lightweight Linked List for simple objects - optimized for low code size and low memory
|
||||
|
||||
Copyright (C) 2021 Theo Arends and Stephan Hadinger
|
||||
|
||||
@ -17,6 +17,11 @@
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef __LLIST__
|
||||
#define __LLIST__
|
||||
|
||||
#include <cstddef>
|
||||
|
||||
/*********************************************************************************************\
|
||||
*
|
||||
* private class for Linked List element
|
||||
@ -206,3 +211,5 @@ T & LList<T>::addToLast(LList_elt<T> * elt) {
|
||||
elt->_next = nullptr;
|
||||
return elt->_val;
|
||||
}
|
||||
|
||||
#endif // __LLIST__
|
@ -197,6 +197,9 @@ void directWriteHigh(IO_REG_TYPE pin)
|
||||
static inline __attribute__((always_inline))
|
||||
void directModeInput(IO_REG_TYPE pin)
|
||||
{
|
||||
#if CONFIG_IDF_TARGET_ESP32C3
|
||||
GPIO.enable_w1tc.val = ((uint32_t)1 << (pin));
|
||||
#else
|
||||
if ( digitalPinIsValid(pin) )
|
||||
{
|
||||
#if ESP_IDF_VERSION_MAJOR < 4 // IDF 3.x ESP32/PICO-D4
|
||||
@ -208,9 +211,6 @@ void directModeInput(IO_REG_TYPE pin)
|
||||
ESP_REG(rtc_reg) = ESP_REG(rtc_reg) & ~(rtc_gpio_desc[pin].pullup | rtc_gpio_desc[pin].pulldown);
|
||||
}
|
||||
#elif ESP_IDF_VERSION_MAJOR > 3 // ESP32-S2 needs IDF 4.2 or later
|
||||
#if CONFIG_IDF_TARGET_ESP32C3
|
||||
// Esp32c3 has no full RTC IO subsystem, so GPIO is 100% "independent" of RTC
|
||||
#else // plain ESP32
|
||||
uint32_t rtc_reg(rtc_io_desc[pin].reg);
|
||||
|
||||
if ( rtc_reg ) // RTC pins PULL settings
|
||||
@ -219,16 +219,11 @@ void directModeInput(IO_REG_TYPE pin)
|
||||
ESP_REG(rtc_reg) = ESP_REG(rtc_reg) & ~(rtc_io_desc[pin].pullup | rtc_io_desc[pin].pulldown);
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if CONFIG_IDF_TARGET_ESP32C3
|
||||
GPIO.enable_w1tc.val = ((uint32_t)1 << (pin - 32));
|
||||
#else // plain ESP32
|
||||
if ( pin < 32 )
|
||||
GPIO.enable_w1tc = ((uint32_t)1 << pin);
|
||||
else
|
||||
GPIO.enable1_w1tc.val = ((uint32_t)1 << (pin - 32));
|
||||
#endif
|
||||
|
||||
uint32_t pinFunction((uint32_t)2 << FUN_DRV_S); // what are the drivers?
|
||||
pinFunction |= FUN_IE; // input enable but required for output as well?
|
||||
@ -238,11 +233,15 @@ void directModeInput(IO_REG_TYPE pin)
|
||||
|
||||
GPIO.pin[pin].val = 0;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
static inline __attribute__((always_inline))
|
||||
void directModeOutput(IO_REG_TYPE pin)
|
||||
{
|
||||
#if CONFIG_IDF_TARGET_ESP32C3
|
||||
GPIO.enable_w1ts.val = ((uint32_t)1 << (pin));
|
||||
#else
|
||||
if ( digitalPinIsValid(pin) && pin <= 33 ) // pins above 33 can be only inputs
|
||||
{
|
||||
#if ESP_IDF_VERSION_MAJOR < 4 // IDF 3.x ESP32/PICO-D4
|
||||
@ -254,9 +253,6 @@ void directModeOutput(IO_REG_TYPE pin)
|
||||
ESP_REG(rtc_reg) = ESP_REG(rtc_reg) & ~(rtc_gpio_desc[pin].pullup | rtc_gpio_desc[pin].pulldown);
|
||||
}
|
||||
#elif ESP_IDF_VERSION_MAJOR > 3 // ESP32-S2 needs IDF 4.2 or later
|
||||
#if CONFIG_IDF_TARGET_ESP32C3
|
||||
// Esp32c3 has no full RTC IO subsystem, so GPIO is 100% "independent" of RTC
|
||||
#else // plain ESP32
|
||||
uint32_t rtc_reg(rtc_io_desc[pin].reg);
|
||||
|
||||
if ( rtc_reg ) // RTC pins PULL settings
|
||||
@ -265,16 +261,11 @@ void directModeOutput(IO_REG_TYPE pin)
|
||||
ESP_REG(rtc_reg) = ESP_REG(rtc_reg) & ~(rtc_io_desc[pin].pullup | rtc_io_desc[pin].pulldown);
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if CONFIG_IDF_TARGET_ESP32C3
|
||||
GPIO.enable_w1ts.val = ((uint32_t)1 << (pin - 32));
|
||||
#else // plain ESP32
|
||||
if ( pin < 32 )
|
||||
GPIO.enable_w1ts = ((uint32_t)1 << pin);
|
||||
else // already validated to pins <= 33
|
||||
GPIO.enable1_w1ts.val = ((uint32_t)1 << (pin - 32));
|
||||
#endif
|
||||
|
||||
uint32_t pinFunction((uint32_t)2 << FUN_DRV_S); // what are the drivers?
|
||||
pinFunction |= FUN_IE; // input enable but required for output as well?
|
||||
@ -284,6 +275,7 @@ void directModeOutput(IO_REG_TYPE pin)
|
||||
|
||||
GPIO.pin[pin].val = 0;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
#define DIRECT_READ(base, pin) directRead(pin)
|
||||
|
@ -204,6 +204,8 @@ void WiFiClientSecure_light::_clear() {
|
||||
_ta_P = nullptr;
|
||||
_ta_size = 0;
|
||||
_max_thunkstack_use = 0;
|
||||
_alpn_names = nullptr;
|
||||
_alpn_num = 0;
|
||||
}
|
||||
|
||||
// Constructor
|
||||
@ -949,8 +951,6 @@ extern "C" {
|
||||
// we support only P256 EC curve for AWS IoT, no EC curve for Letsencrypt unless forced
|
||||
br_ssl_engine_set_ec(&cc->eng, &br_ec_p256_m15); // TODO
|
||||
#endif
|
||||
static const char * alpn_mqtt = "mqtt";
|
||||
br_ssl_engine_set_protocol_names(&cc->eng, &alpn_mqtt, 1);
|
||||
}
|
||||
}
|
||||
|
||||
@ -983,6 +983,9 @@ bool WiFiClientSecure_light::_connectSSL(const char* hostName) {
|
||||
_eng = &_sc->eng; // Allocation/deallocation taken care of by the _sc shared_ptr
|
||||
|
||||
br_ssl_client_base_init(_sc.get());
|
||||
if (_alpn_names && _alpn_num > 0) {
|
||||
br_ssl_engine_set_protocol_names(_eng, _alpn_names, _alpn_num);
|
||||
}
|
||||
|
||||
// ============================================================
|
||||
// Allocatte and initialize Decoder Context
|
||||
|
@ -93,6 +93,12 @@ class WiFiClientSecure_light : public WiFiClient {
|
||||
|
||||
void setTrustAnchor(const br_x509_trust_anchor *ta, size_t ta_size);
|
||||
|
||||
void setALPN(const char **names, size_t num) {
|
||||
// set ALPN extensions, used mostly by AWS IoT on port 443. Need to be static pointers
|
||||
_alpn_names = names;
|
||||
_alpn_num = num;
|
||||
}
|
||||
|
||||
// Sets the requested buffer size for transmit and receive
|
||||
void setBufferSizes(int recv, int xmit);
|
||||
|
||||
@ -165,6 +171,10 @@ class WiFiClientSecure_light : public WiFiClient {
|
||||
// record the maximum use of ThunkStack for monitoring
|
||||
size_t _max_thunkstack_use;
|
||||
|
||||
// ALPN
|
||||
const char ** _alpn_names;
|
||||
size_t _alpn_num;
|
||||
|
||||
};
|
||||
|
||||
#define ERR_OOM -1000
|
||||
@ -237,6 +247,44 @@ class WiFiClientSecure_light : public WiFiClient {
|
||||
// #define BR_ERR_X509_WEAK_PUBLIC_KEY 60
|
||||
// #define BR_ERR_X509_NOT_TRUSTED 62
|
||||
|
||||
// Alert types for TLSContentType.ALERT messages
|
||||
// See RFC 8466, section B.2
|
||||
|
||||
// CLOSE_NOTIFY = 0
|
||||
// UNEXPECTED_MESSAGE = 10
|
||||
// BAD_RECORD_MAC = 20
|
||||
// DECRYPTION_FAILED = 21
|
||||
// RECORD_OVERFLOW = 22
|
||||
// DECOMPRESSION_FAILURE = 30
|
||||
// HANDSHAKE_FAILURE = 40
|
||||
// NO_CERTIFICATE = 41
|
||||
// BAD_CERTIFICATE = 42
|
||||
// UNSUPPORTED_CERTIFICATE = 43
|
||||
// CERTIFICATE_REVOKED = 44
|
||||
// CERTIFICATE_EXPIRED = 45
|
||||
// CERTIFICATE_UNKNOWN = 46
|
||||
// ILLEGAL_PARAMETER = 47
|
||||
// UNKNOWN_CA = 48
|
||||
// ACCESS_DENIED = 49
|
||||
// DECODE_ERROR = 50
|
||||
// DECRYPT_ERROR = 51
|
||||
// EXPORT_RESTRICTION = 60
|
||||
// PROTOCOL_VERSION = 70
|
||||
// INSUFFICIENT_SECURITY = 71
|
||||
// INTERNAL_ERROR = 80
|
||||
// INAPPROPRIATE_FALLBACK = 86
|
||||
// USER_CANCELED = 90
|
||||
// NO_RENEGOTIATION = 100
|
||||
// MISSING_EXTENSION = 109
|
||||
// UNSUPPORTED_EXTENSION = 110
|
||||
// CERTIFICATE_UNOBTAINABLE = 111
|
||||
// UNRECOGNIZED_NAME = 112
|
||||
// BAD_CERTIFICATE_STATUS_RESPONSE = 113
|
||||
// BAD_CERTIFICATE_HASH_VALUE = 114
|
||||
// UNKNOWN_PSK_IDENTITY = 115
|
||||
// CERTIFICATE_REQUIRED = 116
|
||||
// NO_APPLICATION_PROTOCOL = 120
|
||||
|
||||
};
|
||||
|
||||
#endif // USE_TLS
|
||||
|
@ -20,8 +20,8 @@ be_local_closure(init, /* name */
|
||||
NULL, /* no sub protos */
|
||||
0, /* has constants */
|
||||
NULL, /* no const */
|
||||
(be_nested_const_str("init", 380752755, 4)),
|
||||
(be_nested_const_str("input", -103256197, 5)),
|
||||
((bstring*) &be_const_str_init),
|
||||
((bstring*) &be_const_str_input),
|
||||
( &(const binstruction[ 1]) { /* code */
|
||||
0x80000000, // 0000 RET 0
|
||||
})
|
||||
@ -47,7 +47,7 @@ be_local_closure(get_tasmota, /* name */
|
||||
/* K0 */ be_nested_string("tasmota", 424643812, 7),
|
||||
}),
|
||||
(be_nested_const_str("get_tasmota", 334356779, 11)),
|
||||
(be_nested_const_str("input", -103256197, 5)),
|
||||
((bstring*) &be_const_str_input),
|
||||
( &(const binstruction[ 2]) { /* code */
|
||||
0xB8060000, // 0000 GETNGBL R1 K0
|
||||
0x80040200, // 0001 RET 1 R1
|
||||
@ -83,7 +83,7 @@ be_local_closure(add_cmd, /* name */
|
||||
0, /* has constants */
|
||||
NULL, /* no const */
|
||||
(be_nested_const_str("<lambda>", 607256038, 8)),
|
||||
(be_nested_const_str("input", -103256197, 5)),
|
||||
((bstring*) &be_const_str_input),
|
||||
( &(const binstruction[ 8]) { /* code */
|
||||
0x68100000, // 0000 GETUPV R4 U0
|
||||
0x68140001, // 0001 GETUPV R5 U1
|
||||
@ -102,7 +102,7 @@ be_local_closure(add_cmd, /* name */
|
||||
/* K1 */ be_nested_string("add_cmd", -933336417, 7),
|
||||
}),
|
||||
(be_nested_const_str("add_cmd", -933336417, 7)),
|
||||
(be_nested_const_str("input", -103256197, 5)),
|
||||
((bstring*) &be_const_str_input),
|
||||
( &(const binstruction[ 7]) { /* code */
|
||||
0xB80E0000, // 0000 GETNGBL R3 K0
|
||||
0x8C0C0701, // 0001 GETMET R3 R3 K1
|
||||
|
@ -53,8 +53,8 @@ be_local_closure(init, /* name */
|
||||
/* K2 */ be_nested_string("energy_struct", 1655792843, 13),
|
||||
/* K3 */ be_nested_string("_ptr", 306235816, 4),
|
||||
}),
|
||||
(be_nested_const_str("init", 380752755, 4)),
|
||||
(be_nested_const_str("input", -103256197, 5)),
|
||||
((bstring*) &be_const_str_init),
|
||||
((bstring*) &be_const_str_input),
|
||||
( &(const binstruction[ 6]) { /* code */
|
||||
0xA4060000, // 0000 IMPORT R1 K0
|
||||
0xB80A0400, // 0001 GETNGBL R2 K2
|
||||
@ -86,7 +86,7 @@ be_local_closure(read, /* name */
|
||||
/* K1 */ be_nested_string("tomap", 612167626, 5),
|
||||
}),
|
||||
(be_nested_const_str("<anonymous>", 1160973142, 11)),
|
||||
(be_nested_const_str("input", -103256197, 5)),
|
||||
((bstring*) &be_const_str_input),
|
||||
( &(const binstruction[ 4]) { /* code */
|
||||
0xB8020000, // 0000 GETNGBL R0 K0
|
||||
0x8C000101, // 0001 GETMET R0 R0 K1
|
||||
@ -114,7 +114,7 @@ be_local_closure(member, /* name */
|
||||
/* K0 */ be_nested_string("_energy", 535372070, 7),
|
||||
}),
|
||||
(be_nested_const_str("member", 719708611, 6)),
|
||||
(be_nested_const_str("input", -103256197, 5)),
|
||||
((bstring*) &be_const_str_input),
|
||||
( &(const binstruction[ 3]) { /* code */
|
||||
0xB8060000, // 0000 GETNGBL R1 K0
|
||||
0x88040200, // 0001 GETMBR R1 R1 R0
|
||||
@ -142,7 +142,7 @@ be_local_closure(setmember, /* name */
|
||||
/* K0 */ be_nested_string("_energy", 535372070, 7),
|
||||
}),
|
||||
(be_nested_const_str("setmember", 1432909441, 9)),
|
||||
(be_nested_const_str("input", -103256197, 5)),
|
||||
((bstring*) &be_const_str_input),
|
||||
( &(const binstruction[ 3]) { /* code */
|
||||
0xB80A0000, // 0000 GETNGBL R2 K0
|
||||
0x90080001, // 0001 SETMBR R2 R0 R1
|
||||
|
@ -9,6 +9,7 @@
|
||||
|
||||
// Tasmota specific
|
||||
|
||||
extern int gp_member(bvm *vm);
|
||||
extern int gp_pin_mode(bvm *vm);
|
||||
extern int gp_digital_write(bvm *vm);
|
||||
extern int gp_digital_read(bvm *vm);
|
||||
@ -19,275 +20,7 @@ extern int gp_pin(bvm *vm);
|
||||
|
||||
/* @const_object_info_begin
|
||||
module gpio (scope: global) {
|
||||
LOW, int(0)
|
||||
HIGH, int(1)
|
||||
|
||||
INPUT, int(1)
|
||||
OUTPUT, int(2)
|
||||
PULLUP, int(4)
|
||||
INPUT_PULLUP, int(5)
|
||||
PULLDOWN, int(8)
|
||||
INPUT_PULLDOWN, int(9)
|
||||
OPEN_DRAIN, int(16)
|
||||
OUTPUT_OPEN_DRAIN, int(18)
|
||||
DAC, int(-1)
|
||||
|
||||
RISING, int(1)
|
||||
FALLING, int(2)
|
||||
CHANGE, int(4)
|
||||
|
||||
NONE, int(0)
|
||||
KEY1, int(1)
|
||||
KEY1_NP, int(2)
|
||||
KEY1_INV, int(3)
|
||||
KEY1_INV_NP, int(4)
|
||||
SWT1, int(5)
|
||||
SWT1_NP, int(6)
|
||||
REL1, int(7)
|
||||
REL1_INV, int(8)
|
||||
LED1, int(9)
|
||||
LED1_INV, int(10)
|
||||
CNTR1, int(11)
|
||||
CNTR1_NP, int(12)
|
||||
PWM1, int(13)
|
||||
PWM1_INV, int(14)
|
||||
BUZZER, int(15)
|
||||
BUZZER_INV, int(16)
|
||||
LEDLNK, int(17)
|
||||
LEDLNK_INV, int(18)
|
||||
I2C_SCL, int(19)
|
||||
I2C_SDA, int(20)
|
||||
SPI_MISO, int(21)
|
||||
SPI_MOSI, int(22)
|
||||
SPI_CLK, int(23)
|
||||
SPI_CS, int(24)
|
||||
SPI_DC, int(25)
|
||||
SSPI_MISO, int(26)
|
||||
SSPI_MOSI, int(27)
|
||||
SSPI_SCLK, int(28)
|
||||
SSPI_CS, int(29)
|
||||
SSPI_DC, int(30)
|
||||
BACKLIGHT, int(31)
|
||||
OLED_RESET, int(32)
|
||||
IRSEND, int(33)
|
||||
IRRECV, int(34)
|
||||
RFSEND, int(35)
|
||||
RFRECV, int(36)
|
||||
DHT11, int(37)
|
||||
DHT22, int(38)
|
||||
SI7021, int(39)
|
||||
DHT11_OUT, int(40)
|
||||
DSB, int(41)
|
||||
DSB_OUT, int(42)
|
||||
WS2812, int(43)
|
||||
MHZ_TXD, int(44)
|
||||
MHZ_RXD, int(45)
|
||||
PZEM0XX_TX, int(46)
|
||||
PZEM004_RX, int(47)
|
||||
PZEM016_RX, int(48)
|
||||
PZEM017_RX, int(49)
|
||||
SAIR_TX, int(50)
|
||||
SAIR_RX, int(51)
|
||||
PMS5003_TX, int(52)
|
||||
PMS5003_RX, int(53)
|
||||
SDS0X1_TX, int(54)
|
||||
SDS0X1_RX, int(55)
|
||||
SBR_TX, int(56)
|
||||
SBR_RX, int(57)
|
||||
SR04_TRIG, int(58)
|
||||
SR04_ECHO, int(59)
|
||||
SDM120_TX, int(60)
|
||||
SDM120_RX, int(61)
|
||||
SDM630_TX, int(62)
|
||||
SDM630_RX, int(63)
|
||||
TM1638CLK, int(64)
|
||||
TM1638DIO, int(65)
|
||||
TM1638STB, int(66)
|
||||
MP3_DFR562, int(67)
|
||||
HX711_SCK, int(68)
|
||||
HX711_DAT, int(69)
|
||||
TX2X_TXD_BLACK, int(70)
|
||||
TUYA_TX, int(71)
|
||||
TUYA_RX, int(72)
|
||||
MGC3130_XFER, int(73)
|
||||
MGC3130_RESET, int(74)
|
||||
RF_SENSOR, int(75)
|
||||
AZ_TXD, int(76)
|
||||
AZ_RXD, int(77)
|
||||
MAX31855CS, int(78)
|
||||
MAX31855CLK, int(79)
|
||||
MAX31855DO, int(80)
|
||||
NRG_SEL, int(81)
|
||||
NRG_SEL_INV, int(82)
|
||||
NRG_CF1, int(83)
|
||||
HLW_CF, int(84)
|
||||
HJL_CF, int(85)
|
||||
MCP39F5_TX, int(86)
|
||||
MCP39F5_RX, int(87)
|
||||
MCP39F5_RST, int(88)
|
||||
PN532_TXD, int(89)
|
||||
PN532_RXD, int(90)
|
||||
SM16716_CLK, int(91)
|
||||
SM16716_DAT, int(92)
|
||||
SM16716_SEL, int(93)
|
||||
DI, int(94)
|
||||
DCKI, int(95)
|
||||
CSE7766_TX, int(96)
|
||||
CSE7766_RX, int(97)
|
||||
ARIRFRCV, int(98)
|
||||
ARIRFSEL, int(99)
|
||||
TXD, int(100)
|
||||
RXD, int(101)
|
||||
ROT1A, int(102)
|
||||
ROT1B, int(103)
|
||||
ADC_JOY, int(104)
|
||||
SSPI_MAX31865_CS1, int(105)
|
||||
HRE_CLOCK, int(106)
|
||||
HRE_DATA, int(107)
|
||||
ADE7953_IRQ, int(108)
|
||||
SOLAXX1_TX, int(109)
|
||||
SOLAXX1_RX, int(110)
|
||||
ZIGBEE_TX, int(111)
|
||||
ZIGBEE_RX, int(112)
|
||||
RDM6300_RX, int(113)
|
||||
IBEACON_TX, int(114)
|
||||
IBEACON_RX, int(115)
|
||||
A4988_DIR, int(116)
|
||||
A4988_STP, int(117)
|
||||
A4988_ENA, int(118)
|
||||
A4988_MS1, int(119)
|
||||
OUTPUT_HI, int(120)
|
||||
OUTPUT_LO, int(121)
|
||||
DDS2382_TX, int(122)
|
||||
DDS2382_RX, int(123)
|
||||
DDSU666_TX, int(124)
|
||||
DDSU666_RX, int(125)
|
||||
SM2135_CLK, int(126)
|
||||
SM2135_DAT, int(127)
|
||||
DEEPSLEEP, int(128)
|
||||
EXS_ENABLE, int(129)
|
||||
TASMOTACLIENT_TXD, int(130)
|
||||
TASMOTACLIENT_RXD, int(131)
|
||||
TASMOTACLIENT_RST, int(132)
|
||||
TASMOTACLIENT_RST_INV, int(133)
|
||||
HPMA_RX, int(134)
|
||||
HPMA_TX, int(135)
|
||||
GPS_RX, int(136)
|
||||
GPS_TX, int(137)
|
||||
HM10_RX, int(138)
|
||||
HM10_TX, int(139)
|
||||
LE01MR_RX, int(140)
|
||||
LE01MR_TX, int(141)
|
||||
CC1101_GDO0, int(142)
|
||||
CC1101_GDO2, int(143)
|
||||
HRXL_RX, int(144)
|
||||
ELECTRIQ_MOODL_TX, int(145)
|
||||
AS3935, int(146)
|
||||
ADC_INPUT, int(147)
|
||||
ADC_TEMP, int(148)
|
||||
ADC_LIGHT, int(149)
|
||||
ADC_BUTTON, int(150)
|
||||
ADC_BUTTON_INV, int(151)
|
||||
ADC_RANGE, int(152)
|
||||
ADC_CT_POWER, int(153)
|
||||
WEBCAM_PWDN, int(154)
|
||||
WEBCAM_RESET, int(155)
|
||||
WEBCAM_XCLK, int(156)
|
||||
WEBCAM_SIOD, int(157)
|
||||
WEBCAM_SIOC, int(158)
|
||||
WEBCAM_DATA, int(159)
|
||||
WEBCAM_VSYNC, int(160)
|
||||
WEBCAM_HREF, int(161)
|
||||
WEBCAM_PCLK, int(162)
|
||||
WEBCAM_PSCLK, int(163)
|
||||
WEBCAM_HSD, int(164)
|
||||
WEBCAM_PSRCS, int(165)
|
||||
BOILER_OT_RX, int(166)
|
||||
BOILER_OT_TX, int(167)
|
||||
WINDMETER_SPEED, int(168)
|
||||
KEY1_TC, int(169)
|
||||
BL0940_RX, int(170)
|
||||
TCP_TX, int(171)
|
||||
TCP_RX, int(172)
|
||||
ETH_PHY_POWER, int(173)
|
||||
ETH_PHY_MDC, int(174)
|
||||
ETH_PHY_MDIO, int(175)
|
||||
TELEINFO_RX, int(176)
|
||||
TELEINFO_ENABLE, int(177)
|
||||
LMT01, int(178)
|
||||
IEM3000_TX, int(179)
|
||||
IEM3000_RX, int(180)
|
||||
ZIGBEE_RST, int(181)
|
||||
DYP_RX, int(182)
|
||||
MIEL_HVAC_TX, int(183)
|
||||
MIEL_HVAC_RX, int(184)
|
||||
WE517_TX, int(185)
|
||||
WE517_RX, int(186)
|
||||
AS608_TX, int(187)
|
||||
AS608_RX, int(188)
|
||||
SHELLY_DIMMER_BOOT0, int(189)
|
||||
SHELLY_DIMMER_RST_INV, int(190)
|
||||
RC522_RST, int(191)
|
||||
P9813_CLK, int(192)
|
||||
P9813_DAT, int(193)
|
||||
OPTION_A, int(194)
|
||||
FTC532, int(195)
|
||||
RC522_CS, int(196)
|
||||
NRF24_CS, int(197)
|
||||
NRF24_DC, int(198)
|
||||
ILI9341_CS, int(199)
|
||||
ILI9341_DC, int(200)
|
||||
ILI9488_CS, int(201)
|
||||
EPAPER29_CS, int(202)
|
||||
EPAPER42_CS, int(203)
|
||||
SSD1351_CS, int(204)
|
||||
RA8876_CS, int(205)
|
||||
ST7789_CS, int(206)
|
||||
ST7789_DC, int(207)
|
||||
SSD1331_CS, int(208)
|
||||
SSD1331_DC, int(209)
|
||||
SDCARD_CS, int(210)
|
||||
ROT1A_NP, int(211)
|
||||
ROT1B_NP, int(212)
|
||||
ADC_PH, int(213)
|
||||
BS814_CLK, int(214)
|
||||
BS814_DAT, int(215)
|
||||
WIEGAND_D0, int(216)
|
||||
WIEGAND_D1, int(217)
|
||||
NEOPOOL_TX, int(218)
|
||||
NEOPOOL_RX, int(219)
|
||||
SDM72_TX, int(220)
|
||||
SDM72_RX, int(221)
|
||||
TM1637CLK, int(222)
|
||||
TM1637DIO, int(223)
|
||||
PROJECTOR_CTRL_TX, int(224)
|
||||
PROJECTOR_CTRL_RX, int(225)
|
||||
SSD1351_DC, int(226)
|
||||
XPT2046_CS, int(227)
|
||||
CSE7761_TX, int(228)
|
||||
CSE7761_RX, int(229)
|
||||
VL53L0X_XSHUT1, int(230)
|
||||
MAX7219CLK, int(231)
|
||||
MAX7219DIN, int(232)
|
||||
MAX7219CS, int(233)
|
||||
TFMINIPLUS_TX, int(234)
|
||||
TFMINIPLUS_RX, int(235)
|
||||
ZEROCROSS, int(236)
|
||||
HALLEFFECT, int(237)
|
||||
EPD_DATA, int(238)
|
||||
INPUT, int(239)
|
||||
KEY1_PD, int(240)
|
||||
KEY1_INV_PD, int(241)
|
||||
SWT1_PD, int(242)
|
||||
I2S_OUT_DATA, int(243)
|
||||
I2S_OUT_CLK, int(244)
|
||||
I2S_OUT_SLCT, int(245)
|
||||
I2S_IN_DATA, int(246)
|
||||
I2S_IN_CLK, int(247)
|
||||
I2S_IN_SLCT, int(248)
|
||||
INTERRUPT, int(249)
|
||||
|
||||
SENSOR_END, int(250)
|
||||
member, func(gp_member)
|
||||
|
||||
pin_mode, func(gp_pin_mode)
|
||||
digital_write, func(gp_digital_write)
|
||||
|
@ -21,7 +21,7 @@ be_local_closure(get_warning_level, /* name */
|
||||
/* K1 */ be_const_int(1),
|
||||
}),
|
||||
(be_nested_const_str("get_warning_level", 1737834441, 17)),
|
||||
(be_nested_const_str("input", -103256197, 5)),
|
||||
((bstring*) &be_const_str_input),
|
||||
( &(const binstruction[ 5]) { /* code */
|
||||
0x8C040100, // 0000 GETMET R1 R0 K0
|
||||
0x540E0046, // 0001 LDINT R3 71
|
||||
@ -52,7 +52,7 @@ be_local_closure(get_vbus_current, /* name */
|
||||
/* K1 */ be_const_real_hex(0x3EC00000),
|
||||
}),
|
||||
(be_nested_const_str("get_vbus_current", 1205347942, 16)),
|
||||
(be_nested_const_str("input", -103256197, 5)),
|
||||
((bstring*) &be_const_str_input),
|
||||
( &(const binstruction[ 5]) { /* code */
|
||||
0x8C040100, // 0000 GETMET R1 R0 K0
|
||||
0x540E005B, // 0001 LDINT R3 92
|
||||
@ -83,7 +83,7 @@ be_local_closure(set_chg_current, /* name */
|
||||
/* K1 */ be_nested_string("read8", -1492179129, 5),
|
||||
}),
|
||||
(be_nested_const_str("set_chg_current", 336304386, 15)),
|
||||
(be_nested_const_str("input", -103256197, 5)),
|
||||
((bstring*) &be_const_str_input),
|
||||
( &(const binstruction[12]) { /* code */
|
||||
0x8C080100, // 0000 GETMET R2 R0 K0
|
||||
0x54120032, // 0001 LDINT R4 51
|
||||
@ -121,7 +121,7 @@ be_local_closure(get_bat_current, /* name */
|
||||
/* K1 */ be_const_real_hex(0x3F000000),
|
||||
}),
|
||||
(be_nested_const_str("get_bat_current", 1912106073, 15)),
|
||||
(be_nested_const_str("input", -103256197, 5)),
|
||||
((bstring*) &be_const_str_input),
|
||||
( &(const binstruction[ 9]) { /* code */
|
||||
0x8C040100, // 0000 GETMET R1 R0 K0
|
||||
0x540E0079, // 0001 LDINT R3 122
|
||||
@ -156,7 +156,7 @@ be_local_closure(get_bat_power, /* name */
|
||||
/* K1 */ be_const_real_hex(0x3A102DE1),
|
||||
}),
|
||||
(be_nested_const_str("get_bat_power", -1227592443, 13)),
|
||||
(be_nested_const_str("input", -103256197, 5)),
|
||||
((bstring*) &be_const_str_input),
|
||||
( &(const binstruction[ 5]) { /* code */
|
||||
0x8C040100, // 0000 GETMET R1 R0 K0
|
||||
0x540E006F, // 0001 LDINT R3 112
|
||||
@ -186,7 +186,7 @@ be_local_closure(json_append, /* name */
|
||||
/* K0 */ be_nested_string("wire", -212213352, 4),
|
||||
}),
|
||||
(be_nested_const_str("json_append", -1292948012, 11)),
|
||||
(be_nested_const_str("input", -103256197, 5)),
|
||||
((bstring*) &be_const_str_input),
|
||||
( &(const binstruction[ 5]) { /* code */
|
||||
0x88040100, // 0000 GETMBR R1 R0 K0
|
||||
0x74060001, // 0001 JMPT R1 #0004
|
||||
@ -217,7 +217,7 @@ be_local_closure(get_vbus_voltage, /* name */
|
||||
/* K1 */ be_const_real_hex(0x3ADED28A),
|
||||
}),
|
||||
(be_nested_const_str("get_vbus_voltage", -1896756895, 16)),
|
||||
(be_nested_const_str("input", -103256197, 5)),
|
||||
((bstring*) &be_const_str_input),
|
||||
( &(const binstruction[ 5]) { /* code */
|
||||
0x8C040100, // 0000 GETMET R1 R0 K0
|
||||
0x540E0059, // 0001 LDINT R3 90
|
||||
@ -249,7 +249,7 @@ be_local_closure(get_temp, /* name */
|
||||
/* K2 */ be_const_real_hex(0x4310B333),
|
||||
}),
|
||||
(be_nested_const_str("get_temp", -924047810, 8)),
|
||||
(be_nested_const_str("input", -103256197, 5)),
|
||||
((bstring*) &be_const_str_input),
|
||||
( &(const binstruction[ 6]) { /* code */
|
||||
0x8C040100, // 0000 GETMET R1 R0 K0
|
||||
0x540E005D, // 0001 LDINT R3 94
|
||||
@ -283,7 +283,7 @@ be_local_closure(battery_present, /* name */
|
||||
/* K3 */ be_const_int(1),
|
||||
}),
|
||||
(be_nested_const_str("battery_present", -706570238, 15)),
|
||||
(be_nested_const_str("input", -103256197, 5)),
|
||||
((bstring*) &be_const_str_input),
|
||||
( &(const binstruction[15]) { /* code */
|
||||
0x88040100, // 0000 GETMBR R1 R0 K0
|
||||
0x8C040301, // 0001 GETMET R1 R1 K1
|
||||
@ -324,7 +324,7 @@ be_local_closure(get_aps_voltage, /* name */
|
||||
/* K1 */ be_const_real_hex(0x3AB78035),
|
||||
}),
|
||||
(be_nested_const_str("get_aps_voltage", -2001930861, 15)),
|
||||
(be_nested_const_str("input", -103256197, 5)),
|
||||
((bstring*) &be_const_str_input),
|
||||
( &(const binstruction[ 5]) { /* code */
|
||||
0x8C040100, // 0000 GETMET R1 R0 K0
|
||||
0x540E007D, // 0001 LDINT R3 126
|
||||
@ -358,7 +358,7 @@ be_local_closure(set_dcdc_enable, /* name */
|
||||
/* K4 */ be_const_int(3),
|
||||
}),
|
||||
(be_nested_const_str("set_dcdc_enable", 1594690786, 15)),
|
||||
(be_nested_const_str("input", -103256197, 5)),
|
||||
((bstring*) &be_const_str_input),
|
||||
( &(const binstruction[22]) { /* code */
|
||||
0x1C0C0300, // 0000 EQ R3 R1 K0
|
||||
0x780E0004, // 0001 JMPF R3 #0007
|
||||
@ -408,7 +408,7 @@ be_local_closure(set_ldo_voltage, /* name */
|
||||
/* K3 */ be_const_int(3),
|
||||
}),
|
||||
(be_nested_const_str("set_ldo_voltage", -204466136, 15)),
|
||||
(be_nested_const_str("input", -103256197, 5)),
|
||||
((bstring*) &be_const_str_input),
|
||||
( &(const binstruction[39]) { /* code */
|
||||
0x540E0CE3, // 0000 LDINT R3 3300
|
||||
0x240C0403, // 0001 GT R3 R2 R3
|
||||
@ -473,8 +473,8 @@ be_local_closure(init, /* name */
|
||||
/* K1 */ be_nested_string("init", 380752755, 4),
|
||||
/* K2 */ be_nested_string("AXP192", 757230128, 6),
|
||||
}),
|
||||
(be_nested_const_str("init", 380752755, 4)),
|
||||
(be_nested_const_str("input", -103256197, 5)),
|
||||
((bstring*) &be_const_str_init),
|
||||
((bstring*) &be_const_str_input),
|
||||
( &(const binstruction[ 9]) { /* code */
|
||||
0x60040003, // 0000 GETGBL R1 G3
|
||||
0x5C080000, // 0001 MOVE R2 R0
|
||||
@ -509,7 +509,7 @@ be_local_closure(get_bat_voltage, /* name */
|
||||
/* K1 */ be_const_real_hex(0x3A902DE0),
|
||||
}),
|
||||
(be_nested_const_str("get_bat_voltage", 706676538, 15)),
|
||||
(be_nested_const_str("input", -103256197, 5)),
|
||||
((bstring*) &be_const_str_input),
|
||||
( &(const binstruction[ 5]) { /* code */
|
||||
0x8C040100, // 0000 GETMET R1 R0 K0
|
||||
0x540E0077, // 0001 LDINT R3 120
|
||||
@ -541,7 +541,7 @@ be_local_closure(set_ldo_enable, /* name */
|
||||
/* K2 */ be_const_int(3),
|
||||
}),
|
||||
(be_nested_const_str("set_ldo_enable", -1378465255, 14)),
|
||||
(be_nested_const_str("input", -103256197, 5)),
|
||||
((bstring*) &be_const_str_input),
|
||||
( &(const binstruction[15]) { /* code */
|
||||
0x1C0C0300, // 0000 EQ R3 R1 K0
|
||||
0x780E0004, // 0001 JMPF R3 #0007
|
||||
@ -586,7 +586,7 @@ be_local_closure(set_dc_voltage, /* name */
|
||||
/* K5 */ be_nested_string("read8", -1492179129, 5),
|
||||
}),
|
||||
(be_nested_const_str("set_dc_voltage", -2112985360, 14)),
|
||||
(be_nested_const_str("input", -103256197, 5)),
|
||||
((bstring*) &be_const_str_input),
|
||||
( &(const binstruction[48]) { /* code */
|
||||
0x140C0300, // 0000 LT R3 R1 K0
|
||||
0x740E0001, // 0001 JMPT R3 #0004
|
||||
@ -662,7 +662,7 @@ be_local_closure(write_gpio, /* name */
|
||||
/* K3 */ be_const_int(3),
|
||||
}),
|
||||
(be_nested_const_str("write_gpio", -2027026962, 10)),
|
||||
(be_nested_const_str("input", -103256197, 5)),
|
||||
((bstring*) &be_const_str_input),
|
||||
( &(const binstruction[21]) { /* code */
|
||||
0x280C0300, // 0000 GE R3 R1 K0
|
||||
0x780E0007, // 0001 JMPF R3 #000A
|
||||
@ -721,7 +721,7 @@ be_local_closure(web_sensor, /* name */
|
||||
/* K13 */ be_nested_string("web_send_decimal", 1407210204, 16),
|
||||
}),
|
||||
(be_nested_const_str("web_sensor", -1394870324, 10)),
|
||||
(be_nested_const_str("input", -103256197, 5)),
|
||||
((bstring*) &be_const_str_input),
|
||||
( &(const binstruction[26]) { /* code */
|
||||
0x88040100, // 0000 GETMBR R1 R0 K0
|
||||
0x74060001, // 0001 JMPT R1 #0004
|
||||
@ -773,7 +773,7 @@ be_local_closure(get_bat_charge_current, /* name */
|
||||
/* K1 */ be_const_real_hex(0x3F000000),
|
||||
}),
|
||||
(be_nested_const_str("get_bat_charge_current", 1385293050, 22)),
|
||||
(be_nested_const_str("input", -103256197, 5)),
|
||||
((bstring*) &be_const_str_input),
|
||||
( &(const binstruction[ 5]) { /* code */
|
||||
0x8C040100, // 0000 GETMET R1 R0 K0
|
||||
0x540E0079, // 0001 LDINT R3 122
|
||||
@ -806,7 +806,7 @@ be_local_closure(get_battery_chargin_status, /* name */
|
||||
/* K3 */ be_const_int(1),
|
||||
}),
|
||||
(be_nested_const_str("get_battery_chargin_status", -2061725725, 26)),
|
||||
(be_nested_const_str("input", -103256197, 5)),
|
||||
((bstring*) &be_const_str_input),
|
||||
( &(const binstruction[ 7]) { /* code */
|
||||
0x88040100, // 0000 GETMBR R1 R0 K0
|
||||
0x8C040301, // 0001 GETMET R1 R1 K1
|
||||
@ -842,7 +842,7 @@ be_local_closure(get_input_power_status, /* name */
|
||||
/* K4 */ be_const_int(1),
|
||||
}),
|
||||
(be_nested_const_str("get_input_power_status", -192138119, 22)),
|
||||
(be_nested_const_str("input", -103256197, 5)),
|
||||
((bstring*) &be_const_str_input),
|
||||
( &(const binstruction[ 7]) { /* code */
|
||||
0x88040100, // 0000 GETMBR R1 R0 K0
|
||||
0x8C040301, // 0001 GETMET R1 R1 K1
|
||||
|
@ -34,7 +34,7 @@ be_local_closure(read32, /* name */
|
||||
/* K6 */ be_const_int(3),
|
||||
}),
|
||||
(be_nested_const_str("read32", 1741276240, 6)),
|
||||
(be_nested_const_str("input", -103256197, 5)),
|
||||
((bstring*) &be_const_str_input),
|
||||
( &(const binstruction[20]) { /* code */
|
||||
0x88080100, // 0000 GETMBR R2 R0 K0
|
||||
0x8C080501, // 0001 GETMET R2 R2 K1
|
||||
@ -82,7 +82,7 @@ be_local_closure(write8, /* name */
|
||||
/* K3 */ be_const_int(1),
|
||||
}),
|
||||
(be_nested_const_str("write8", -1160975764, 6)),
|
||||
(be_nested_const_str("input", -103256197, 5)),
|
||||
((bstring*) &be_const_str_input),
|
||||
( &(const binstruction[ 8]) { /* code */
|
||||
0x880C0100, // 0000 GETMBR R3 R0 K0
|
||||
0x8C0C0701, // 0001 GETMET R3 R3 K1
|
||||
@ -120,7 +120,7 @@ be_local_closure(read12, /* name */
|
||||
/* K5 */ be_const_int(1),
|
||||
}),
|
||||
(be_nested_const_str("read12", -3890326, 6)),
|
||||
(be_nested_const_str("input", -103256197, 5)),
|
||||
((bstring*) &be_const_str_input),
|
||||
( &(const binstruction[12]) { /* code */
|
||||
0x88080100, // 0000 GETMBR R2 R0 K0
|
||||
0x8C080501, // 0001 GETMET R2 R2 K1
|
||||
@ -160,7 +160,7 @@ be_local_closure(write_bit, /* name */
|
||||
/* K3 */ be_nested_string("read8", -1492179129, 5),
|
||||
}),
|
||||
(be_nested_const_str("write_bit", -1633976860, 9)),
|
||||
(be_nested_const_str("input", -103256197, 5)),
|
||||
((bstring*) &be_const_str_input),
|
||||
( &(const binstruction[26]) { /* code */
|
||||
0x14100500, // 0000 LT R4 R2 K0
|
||||
0x74120002, // 0001 JMPT R4 #0005
|
||||
@ -217,7 +217,7 @@ be_local_closure(read24, /* name */
|
||||
/* K6 */ be_const_int(2),
|
||||
}),
|
||||
(be_nested_const_str("read24", 1808533811, 6)),
|
||||
(be_nested_const_str("input", -103256197, 5)),
|
||||
((bstring*) &be_const_str_input),
|
||||
( &(const binstruction[16]) { /* code */
|
||||
0x88080100, // 0000 GETMBR R2 R0 K0
|
||||
0x8C080501, // 0001 GETMET R2 R2 K1
|
||||
@ -261,7 +261,7 @@ be_local_closure(read8, /* name */
|
||||
/* K3 */ be_const_int(1),
|
||||
}),
|
||||
(be_nested_const_str("read8", -1492179129, 5)),
|
||||
(be_nested_const_str("input", -103256197, 5)),
|
||||
((bstring*) &be_const_str_input),
|
||||
( &(const binstruction[ 7]) { /* code */
|
||||
0x88080100, // 0000 GETMBR R2 R0 K0
|
||||
0x8C080501, // 0001 GETMET R2 R2 K1
|
||||
@ -301,8 +301,8 @@ be_local_closure(init, /* name */
|
||||
/* K8 */ be_nested_string("detected on bus", 1432002650, 15),
|
||||
/* K9 */ be_nested_string("bus", 1607822841, 3),
|
||||
}),
|
||||
(be_nested_const_str("init", 380752755, 4)),
|
||||
(be_nested_const_str("input", -103256197, 5)),
|
||||
((bstring*) &be_const_str_init),
|
||||
((bstring*) &be_const_str_input),
|
||||
( &(const binstruction[44]) { /* code */
|
||||
0x8C100100, // 0000 GETMET R4 R0 K0
|
||||
0x7C100200, // 0001 CALL R4 1
|
||||
@ -376,7 +376,7 @@ be_local_closure(read13, /* name */
|
||||
/* K5 */ be_const_int(1),
|
||||
}),
|
||||
(be_nested_const_str("read13", 12887293, 6)),
|
||||
(be_nested_const_str("input", -103256197, 5)),
|
||||
((bstring*) &be_const_str_input),
|
||||
( &(const binstruction[12]) { /* code */
|
||||
0x88080100, // 0000 GETMBR R2 R0 K0
|
||||
0x8C080501, // 0001 GETMET R2 R2 K1
|
||||
|
@ -33,7 +33,7 @@ be_local_closure(set_time, /* name */
|
||||
/* K9 */ be_nested_string("set_text", 1849641155, 8),
|
||||
}),
|
||||
(be_nested_const_str("set_time", 900236405, 8)),
|
||||
(be_nested_const_str("input", -103256197, 5)),
|
||||
((bstring*) &be_const_str_input),
|
||||
( &(const binstruction[27]) { /* code */
|
||||
0xA4120000, // 0000 IMPORT R4 K0
|
||||
0x88140101, // 0001 GETMBR R5 R0 K1
|
||||
@ -93,7 +93,7 @@ be_local_closure(every_second, /* name */
|
||||
/* K8 */ be_nested_string("sec", -1155074638, 3),
|
||||
}),
|
||||
(be_nested_const_str("every_second", 2075451465, 12)),
|
||||
(be_nested_const_str("input", -103256197, 5)),
|
||||
((bstring*) &be_const_str_input),
|
||||
( &(const binstruction[17]) { /* code */
|
||||
0xB8060000, // 0000 GETNGBL R1 K0
|
||||
0x8C040301, // 0001 GETMET R1 R1 K1
|
||||
@ -155,8 +155,8 @@ be_local_closure(init, /* name */
|
||||
/* K20 */ be_nested_string("tasmota", 424643812, 7),
|
||||
/* K21 */ be_nested_string("add_driver", 1654458371, 10),
|
||||
}),
|
||||
(be_nested_const_str("init", 380752755, 4)),
|
||||
(be_nested_const_str("input", -103256197, 5)),
|
||||
((bstring*) &be_const_str_init),
|
||||
((bstring*) &be_const_str_input),
|
||||
( &(const binstruction[82]) { /* code */
|
||||
0x60080003, // 0000 GETGBL R2 G3
|
||||
0x5C0C0000, // 0001 MOVE R3 R0
|
||||
@ -265,7 +265,7 @@ be_local_closure(del, /* name */
|
||||
/* K2 */ be_nested_string("remove_driver", 1030243768, 13),
|
||||
}),
|
||||
(be_nested_const_str("del", -816214454, 3)),
|
||||
(be_nested_const_str("input", -103256197, 5)),
|
||||
((bstring*) &be_const_str_input),
|
||||
( &(const binstruction[10]) { /* code */
|
||||
0x60040003, // 0000 GETGBL R1 G3
|
||||
0x5C080000, // 0001 MOVE R2 R0
|
||||
|
@ -25,7 +25,7 @@ be_local_closure(get_object_from_ptr, /* name */
|
||||
/* K1 */ be_nested_string("find", -1108310694, 4),
|
||||
}),
|
||||
(be_nested_const_str("get_object_from_ptr", -1949948095, 19)),
|
||||
(be_nested_const_str("input", -103256197, 5)),
|
||||
((bstring*) &be_const_str_input),
|
||||
( &(const binstruction[10]) { /* code */
|
||||
0x88080100, // 0000 GETMBR R2 R0 K0
|
||||
0x4C0C0000, // 0001 LDNIL R3
|
||||
@ -68,7 +68,7 @@ be_local_closure(widget_event_impl, /* name */
|
||||
/* K8 */ be_nested_string("widget_event", 1951408186, 12),
|
||||
}),
|
||||
(be_nested_const_str("widget_event_impl", -2116536735, 17)),
|
||||
(be_nested_const_str("input", -103256197, 5)),
|
||||
((bstring*) &be_const_str_input),
|
||||
( &(const binstruction[30]) { /* code */
|
||||
0xA40E0000, // 0000 IMPORT R3 K0
|
||||
0xB8120200, // 0001 GETNGBL R4 K1
|
||||
@ -129,7 +129,7 @@ be_local_closure(lvgl_event_dispatch, /* name */
|
||||
/* K6 */ be_nested_string("get_object_from_ptr", -1949948095, 19),
|
||||
}),
|
||||
(be_nested_const_str("lvgl_event_dispatch", 2104396622, 19)),
|
||||
(be_nested_const_str("input", -103256197, 5)),
|
||||
((bstring*) &be_const_str_input),
|
||||
( &(const binstruction[20]) { /* code */
|
||||
0xA40A0000, // 0000 IMPORT R2 K0
|
||||
0xB80E0200, // 0001 GETNGBL R3 K1
|
||||
@ -180,7 +180,7 @@ be_local_closure(widget_dtor_impl, /* name */
|
||||
/* K6 */ be_nested_string("widget_destructor", -87578951, 17),
|
||||
}),
|
||||
(be_nested_const_str("widget_dtor_impl", 520430610, 16)),
|
||||
(be_nested_const_str("input", -103256197, 5)),
|
||||
((bstring*) &be_const_str_input),
|
||||
( &(const binstruction[22]) { /* code */
|
||||
0xA40E0000, // 0000 IMPORT R3 K0
|
||||
0xB8120200, // 0001 GETNGBL R4 K1
|
||||
@ -228,7 +228,7 @@ be_local_closure(register_obj, /* name */
|
||||
/* K1 */ be_nested_string("_p", 1594591802, 2),
|
||||
}),
|
||||
(be_nested_const_str("register_obj", -312352526, 12)),
|
||||
(be_nested_const_str("input", -103256197, 5)),
|
||||
((bstring*) &be_const_str_input),
|
||||
( &(const binstruction[13]) { /* code */
|
||||
0x88080100, // 0000 GETMBR R2 R0 K0
|
||||
0x4C0C0000, // 0001 LDNIL R3
|
||||
@ -276,7 +276,7 @@ be_local_closure(gen_cb, /* name */
|
||||
/* K0 */ be_nested_string("lvgl_event_dispatch", 2104396622, 19),
|
||||
}),
|
||||
(be_nested_const_str("<lambda>", 607256038, 8)),
|
||||
(be_nested_const_str("input", -103256197, 5)),
|
||||
((bstring*) &be_const_str_input),
|
||||
( &(const binstruction[ 5]) { /* code */
|
||||
0x68040000, // 0000 GETUPV R1 U0
|
||||
0x8C040300, // 0001 GETMET R1 R1 K0
|
||||
@ -298,7 +298,7 @@ be_local_closure(gen_cb, /* name */
|
||||
/* K7 */ be_nested_string("cb_do_nothing", 1488730702, 13),
|
||||
}),
|
||||
(be_nested_const_str("gen_cb", -1049739745, 6)),
|
||||
(be_nested_const_str("input", -103256197, 5)),
|
||||
((bstring*) &be_const_str_input),
|
||||
( &(const binstruction[41]) { /* code */
|
||||
0x1C140300, // 0000 EQ R5 R1 K0
|
||||
0x78160018, // 0001 JMPF R5 #001B
|
||||
@ -366,7 +366,7 @@ be_local_closure(deregister_obj, /* name */
|
||||
/* K2 */ be_nested_string("cb_event_closure", -466699971, 16),
|
||||
}),
|
||||
(be_nested_const_str("deregister_obj", -385000303, 14)),
|
||||
(be_nested_const_str("input", -103256197, 5)),
|
||||
((bstring*) &be_const_str_input),
|
||||
( &(const binstruction[17]) { /* code */
|
||||
0x88080100, // 0000 GETMBR R2 R0 K0
|
||||
0x4C0C0000, // 0001 LDNIL R3
|
||||
@ -418,7 +418,7 @@ be_local_closure(widget_cb, /* name */
|
||||
/* K0 */ be_nested_string("widget_ctor_impl", 194252479, 16),
|
||||
}),
|
||||
(be_nested_const_str("<lambda>", 607256038, 8)),
|
||||
(be_nested_const_str("input", -103256197, 5)),
|
||||
((bstring*) &be_const_str_input),
|
||||
( &(const binstruction[ 6]) { /* code */
|
||||
0x68080000, // 0000 GETUPV R2 U0
|
||||
0x8C080500, // 0001 GETMET R2 R2 K0
|
||||
@ -443,7 +443,7 @@ be_local_closure(widget_cb, /* name */
|
||||
/* K0 */ be_nested_string("widget_dtor_impl", 520430610, 16),
|
||||
}),
|
||||
(be_nested_const_str("<lambda>", 607256038, 8)),
|
||||
(be_nested_const_str("input", -103256197, 5)),
|
||||
((bstring*) &be_const_str_input),
|
||||
( &(const binstruction[ 6]) { /* code */
|
||||
0x68080000, // 0000 GETUPV R2 U0
|
||||
0x8C080500, // 0001 GETMET R2 R2 K0
|
||||
@ -468,7 +468,7 @@ be_local_closure(widget_cb, /* name */
|
||||
/* K0 */ be_nested_string("widget_event_impl", -2116536735, 17),
|
||||
}),
|
||||
(be_nested_const_str("<lambda>", 607256038, 8)),
|
||||
(be_nested_const_str("input", -103256197, 5)),
|
||||
((bstring*) &be_const_str_input),
|
||||
( &(const binstruction[ 6]) { /* code */
|
||||
0x68080000, // 0000 GETUPV R2 U0
|
||||
0x8C080500, // 0001 GETMET R2 R2 K0
|
||||
@ -498,7 +498,7 @@ be_local_closure(widget_cb, /* name */
|
||||
/* K14 */ be_nested_string("event_cb", -1166269279, 8),
|
||||
}),
|
||||
(be_nested_const_str("widget_cb", -1531384241, 9)),
|
||||
(be_nested_const_str("input", -103256197, 5)),
|
||||
((bstring*) &be_const_str_input),
|
||||
( &(const binstruction[56]) { /* code */
|
||||
0x88040100, // 0000 GETMBR R1 R0 K0
|
||||
0x4C080000, // 0001 LDNIL R2
|
||||
@ -579,7 +579,7 @@ be_local_closure(_anonymous_, /* name */
|
||||
/* K0 */ be_nested_string("LVG: call to unsupported callback", 504176819, 33),
|
||||
}),
|
||||
(be_nested_const_str("_anonymous_", 1957281476, 11)),
|
||||
(be_nested_const_str("input", -103256197, 5)),
|
||||
((bstring*) &be_const_str_input),
|
||||
( &(const binstruction[ 4]) { /* code */
|
||||
0x60000001, // 0000 GETGBL R0 G1
|
||||
0x58040000, // 0001 LDCONST R1 K0
|
||||
@ -634,7 +634,7 @@ be_local_closure(create_custom_widget, /* name */
|
||||
/* K26 */ be_nested_string("class_init_obj", 178410604, 14),
|
||||
}),
|
||||
(be_nested_const_str("create_custom_widget", 1140594778, 20)),
|
||||
(be_nested_const_str("input", -103256197, 5)),
|
||||
((bstring*) &be_const_str_input),
|
||||
( &(const binstruction[86]) { /* code */
|
||||
0xA40E0000, // 0000 IMPORT R3 K0
|
||||
0x6010000F, // 0001 GETGBL R4 G15
|
||||
@ -753,7 +753,7 @@ be_local_closure(widget_ctor_impl, /* name */
|
||||
/* K8 */ be_nested_string("widget_constructor", -1751181362, 18),
|
||||
}),
|
||||
(be_nested_const_str("widget_ctor_impl", 194252479, 16)),
|
||||
(be_nested_const_str("input", -103256197, 5)),
|
||||
((bstring*) &be_const_str_input),
|
||||
( &(const binstruction[29]) { /* code */
|
||||
0xA40E0000, // 0000 IMPORT R3 K0
|
||||
0xB8120200, // 0001 GETNGBL R4 K1
|
||||
|
@ -26,7 +26,7 @@ be_local_closure(set_percentage, /* name */
|
||||
/* K2 */ be_nested_string("invalidate", -1645232368, 10),
|
||||
}),
|
||||
(be_nested_const_str("set_percentage", -1342944572, 14)),
|
||||
(be_nested_const_str("input", -103256197, 5)),
|
||||
((bstring*) &be_const_str_input),
|
||||
( &(const binstruction[18]) { /* code */
|
||||
0x88080100, // 0000 GETMBR R2 R0 K0
|
||||
0x540E0018, // 0001 LDINT R3 25
|
||||
@ -77,8 +77,8 @@ be_local_closure(init, /* name */
|
||||
/* K8 */ be_nested_string("line_dsc", -200476318, 8),
|
||||
/* K9 */ be_nested_string("draw_line_dsc", -74291093, 13),
|
||||
}),
|
||||
(be_nested_const_str("init", 380752755, 4)),
|
||||
(be_nested_const_str("input", -103256197, 5)),
|
||||
((bstring*) &be_const_str_init),
|
||||
((bstring*) &be_const_str_input),
|
||||
( &(const binstruction[24]) { /* code */
|
||||
0xB80A0000, // 0000 GETNGBL R2 K0
|
||||
0x8C080501, // 0001 GETMET R2 R2 K1
|
||||
@ -135,7 +135,7 @@ be_local_closure(widget_event, /* name */
|
||||
/* K0 */ be_const_int(1),
|
||||
}),
|
||||
(be_nested_const_str("atleast1", 1956331672, 8)),
|
||||
(be_nested_const_str("input", -103256197, 5)),
|
||||
((bstring*) &be_const_str_input),
|
||||
( &(const binstruction[ 6]) { /* code */
|
||||
0x28040100, // 0000 GE R1 R0 K0
|
||||
0x78060001, // 0001 JMPF R1 #0004
|
||||
@ -185,7 +185,7 @@ be_local_closure(widget_event, /* name */
|
||||
/* K34 */ be_const_int(0),
|
||||
}),
|
||||
(be_nested_const_str("widget_event", 1951408186, 12)),
|
||||
(be_nested_const_str("input", -103256197, 5)),
|
||||
((bstring*) &be_const_str_input),
|
||||
( &(const binstruction[182]) { /* code */
|
||||
0xB80E0000, // 0000 GETNGBL R3 K0
|
||||
0x8C0C0701, // 0001 GETMET R3 R3 K1
|
||||
@ -392,7 +392,7 @@ be_local_closure(get_percentage, /* name */
|
||||
/* K0 */ be_nested_string("percentage", -1756136011, 10),
|
||||
}),
|
||||
(be_nested_const_str("get_percentage", -1414483304, 14)),
|
||||
(be_nested_const_str("input", -103256197, 5)),
|
||||
((bstring*) &be_const_str_input),
|
||||
( &(const binstruction[ 2]) { /* code */
|
||||
0x88040100, // 0000 GETMBR R1 R0 K0
|
||||
0x80040200, // 0001 RET 1 R1
|
||||
|
@ -26,7 +26,7 @@ be_local_closure(set_percentage, /* name */
|
||||
/* K2 */ be_nested_string("invalidate", -1645232368, 10),
|
||||
}),
|
||||
(be_nested_const_str("set_percentage", -1342944572, 14)),
|
||||
(be_nested_const_str("input", -103256197, 5)),
|
||||
((bstring*) &be_const_str_input),
|
||||
( &(const binstruction[18]) { /* code */
|
||||
0x88080100, // 0000 GETMBR R2 R0 K0
|
||||
0x540E0013, // 0001 LDINT R3 20
|
||||
@ -77,8 +77,8 @@ be_local_closure(init, /* name */
|
||||
/* K8 */ be_nested_string("line_dsc", -200476318, 8),
|
||||
/* K9 */ be_nested_string("draw_line_dsc", -74291093, 13),
|
||||
}),
|
||||
(be_nested_const_str("init", 380752755, 4)),
|
||||
(be_nested_const_str("input", -103256197, 5)),
|
||||
((bstring*) &be_const_str_init),
|
||||
((bstring*) &be_const_str_input),
|
||||
( &(const binstruction[24]) { /* code */
|
||||
0xB80A0000, // 0000 GETNGBL R2 K0
|
||||
0x8C080501, // 0001 GETMET R2 R2 K1
|
||||
@ -135,7 +135,7 @@ be_local_closure(widget_event, /* name */
|
||||
/* K0 */ be_const_int(1),
|
||||
}),
|
||||
(be_nested_const_str("atleast1", 1956331672, 8)),
|
||||
(be_nested_const_str("input", -103256197, 5)),
|
||||
((bstring*) &be_const_str_input),
|
||||
( &(const binstruction[ 6]) { /* code */
|
||||
0x28040100, // 0000 GE R1 R0 K0
|
||||
0x78060001, // 0001 JMPF R1 #0004
|
||||
@ -187,7 +187,7 @@ be_local_closure(widget_event, /* name */
|
||||
/* K36 */ be_nested_string("EVENT_DRAW_PART_END", -993342004, 19),
|
||||
}),
|
||||
(be_nested_const_str("widget_event", 1951408186, 12)),
|
||||
(be_nested_const_str("input", -103256197, 5)),
|
||||
((bstring*) &be_const_str_input),
|
||||
( &(const binstruction[138]) { /* code */
|
||||
0xB80E0000, // 0000 GETNGBL R3 K0
|
||||
0x8C0C0701, // 0001 GETMET R3 R3 K1
|
||||
@ -350,7 +350,7 @@ be_local_closure(get_percentage, /* name */
|
||||
/* K0 */ be_nested_string("percentage", -1756136011, 10),
|
||||
}),
|
||||
(be_nested_const_str("get_percentage", -1414483304, 14)),
|
||||
(be_nested_const_str("input", -103256197, 5)),
|
||||
((bstring*) &be_const_str_input),
|
||||
( &(const binstruction[ 2]) { /* code */
|
||||
0x88040100, // 0000 GETMBR R1 R0 K0
|
||||
0x80040200, // 0001 RET 1 R1
|
||||
|
@ -40,8 +40,8 @@ be_local_closure(init, /* name */
|
||||
/* K16 */ be_nested_string("set_style_pad_right", -980898242, 19),
|
||||
/* K17 */ be_const_int(1),
|
||||
}),
|
||||
(be_nested_const_str("init", 380752755, 4)),
|
||||
(be_nested_const_str("input", -103256197, 5)),
|
||||
((bstring*) &be_const_str_init),
|
||||
((bstring*) &be_const_str_input),
|
||||
( &(const binstruction[67]) { /* code */
|
||||
0x60080003, // 0000 GETGBL R2 G3
|
||||
0x5C0C0000, // 0001 MOVE R3 R0
|
||||
|
@ -30,7 +30,7 @@ be_local_closure(every_second, /* name */
|
||||
/* K6 */ be_const_int(0),
|
||||
}),
|
||||
(be_nested_const_str("every_second", 2075451465, 12)),
|
||||
(be_nested_const_str("input", -103256197, 5)),
|
||||
((bstring*) &be_const_str_input),
|
||||
( &(const binstruction[23]) { /* code */
|
||||
0xB8060000, // 0000 GETNGBL R1 K0
|
||||
0x8C040301, // 0001 GETMET R1 R1 K1
|
||||
@ -81,8 +81,8 @@ be_local_closure(init, /* name */
|
||||
/* K3 */ be_nested_string("set_percentage", -1342944572, 14),
|
||||
/* K4 */ be_const_int(0),
|
||||
}),
|
||||
(be_nested_const_str("init", 380752755, 4)),
|
||||
(be_nested_const_str("input", -103256197, 5)),
|
||||
((bstring*) &be_const_str_init),
|
||||
((bstring*) &be_const_str_input),
|
||||
( &(const binstruction[14]) { /* code */
|
||||
0x60080003, // 0000 GETGBL R2 G3
|
||||
0x5C0C0000, // 0001 MOVE R3 R0
|
||||
@ -123,7 +123,7 @@ be_local_closure(del, /* name */
|
||||
/* K2 */ be_nested_string("remove_driver", 1030243768, 13),
|
||||
}),
|
||||
(be_nested_const_str("del", -816214454, 3)),
|
||||
(be_nested_const_str("input", -103256197, 5)),
|
||||
((bstring*) &be_const_str_input),
|
||||
( &(const binstruction[10]) { /* code */
|
||||
0x60040003, // 0000 GETGBL R1 G3
|
||||
0x5C080000, // 0001 MOVE R2 R0
|
||||
|
@ -39,8 +39,8 @@ be_local_closure(init, /* name */
|
||||
/* K15 */ be_nested_string("set_style_pad_right", -980898242, 19),
|
||||
/* K16 */ be_const_int(1),
|
||||
}),
|
||||
(be_nested_const_str("init", 380752755, 4)),
|
||||
(be_nested_const_str("input", -103256197, 5)),
|
||||
((bstring*) &be_const_str_init),
|
||||
((bstring*) &be_const_str_input),
|
||||
( &(const binstruction[64]) { /* code */
|
||||
0x60080003, // 0000 GETGBL R2 G3
|
||||
0x5C0C0000, // 0001 MOVE R3 R0
|
||||
|
@ -30,7 +30,7 @@ be_local_closure(every_second, /* name */
|
||||
/* K6 */ be_const_int(0),
|
||||
}),
|
||||
(be_nested_const_str("every_second", 2075451465, 12)),
|
||||
(be_nested_const_str("input", -103256197, 5)),
|
||||
((bstring*) &be_const_str_input),
|
||||
( &(const binstruction[23]) { /* code */
|
||||
0xB8060000, // 0000 GETNGBL R1 K0
|
||||
0x8C040301, // 0001 GETMET R1 R1 K1
|
||||
@ -81,8 +81,8 @@ be_local_closure(init, /* name */
|
||||
/* K3 */ be_nested_string("set_percentage", -1342944572, 14),
|
||||
/* K4 */ be_const_int(0),
|
||||
}),
|
||||
(be_nested_const_str("init", 380752755, 4)),
|
||||
(be_nested_const_str("input", -103256197, 5)),
|
||||
((bstring*) &be_const_str_init),
|
||||
((bstring*) &be_const_str_input),
|
||||
( &(const binstruction[14]) { /* code */
|
||||
0x60080003, // 0000 GETGBL R2 G3
|
||||
0x5C0C0000, // 0001 MOVE R3 R0
|
||||
@ -123,7 +123,7 @@ be_local_closure(del, /* name */
|
||||
/* K2 */ be_nested_string("remove_driver", 1030243768, 13),
|
||||
}),
|
||||
(be_nested_const_str("del", -816214454, 3)),
|
||||
(be_nested_const_str("input", -103256197, 5)),
|
||||
((bstring*) &be_const_str_input),
|
||||
( &(const binstruction[10]) { /* code */
|
||||
0x60040003, // 0000 GETGBL R1 G3
|
||||
0x5C080000, // 0001 MOVE R2 R0
|
||||
|
@ -18,13 +18,17 @@
|
||||
#include "be_sys.h"
|
||||
#include <time.h>
|
||||
|
||||
extern int m_path_listdir(bvm *vm);
|
||||
|
||||
static int m_path_exists(bvm *vm)
|
||||
{
|
||||
const char *path = NULL;
|
||||
if (be_top(vm) >= 1 && be_isstring(vm, 1)) {
|
||||
path = be_tostring(vm, 1);
|
||||
be_pushbool(vm, be_isexist(path));
|
||||
} else {
|
||||
be_pushbool(vm, bfalse);
|
||||
}
|
||||
be_pushbool(vm, be_isexist(path));
|
||||
be_return(vm);
|
||||
}
|
||||
extern time_t be_last_modified(void *hfile);
|
||||
@ -43,10 +47,24 @@ static int m_path_last_modified(bvm *vm)
|
||||
be_return_nil(vm);
|
||||
}
|
||||
|
||||
static int m_path_remove(bvm *vm)
|
||||
{
|
||||
const char *path = NULL;
|
||||
if (be_top(vm) >= 1 && be_isstring(vm, 1)) {
|
||||
path = be_tostring(vm, 1);
|
||||
be_pushbool(vm, be_unlink(path));
|
||||
} else {
|
||||
be_pushbool(vm, bfalse);
|
||||
}
|
||||
be_return(vm);
|
||||
}
|
||||
|
||||
/* @const_object_info_begin
|
||||
module path (scope: global, file: tasmota_path) {
|
||||
exists, func(m_path_exists)
|
||||
last_modified, func(m_path_last_modified)
|
||||
listdir, func(m_path_listdir)
|
||||
remove, func(m_path_remove)
|
||||
}
|
||||
@const_object_info_end */
|
||||
#include "../generate/be_fixed_tasmota_path.h"
|
||||
|
@ -8,61 +8,74 @@
|
||||
#include "be_constobj.h"
|
||||
|
||||
/********************************************************************
|
||||
** Solidified function: save
|
||||
** Solidified function: json_fdump_map
|
||||
********************************************************************/
|
||||
be_local_closure(save, /* name */
|
||||
be_local_closure(json_fdump_map, /* name */
|
||||
be_nested_proto(
|
||||
8, /* nstack */
|
||||
1, /* argc */
|
||||
13, /* nstack */
|
||||
3, /* argc */
|
||||
0, /* varg */
|
||||
0, /* has upvals */
|
||||
NULL, /* no upvals */
|
||||
0, /* has sup protos */
|
||||
NULL, /* no sub protos */
|
||||
1, /* has constants */
|
||||
( &(const bvalue[ 8]) { /* constants */
|
||||
( &(const bvalue[10]) { /* constants */
|
||||
/* K0 */ be_nested_string("json", 916562499, 4),
|
||||
/* K1 */ be_nested_string("_filename", 1430813195, 9),
|
||||
/* K2 */ be_nested_string("w", -234078410, 1),
|
||||
/* K3 */ be_nested_string("write", -1104765092, 5),
|
||||
/* K1 */ be_nested_string("write", -1104765092, 5),
|
||||
/* K2 */ be_nested_string("{", -32746982, 1),
|
||||
/* K3 */ be_nested_string("keys", -112588595, 4),
|
||||
/* K4 */ be_nested_string("dump", -631966073, 4),
|
||||
/* K5 */ be_nested_string("_p", 1594591802, 2),
|
||||
/* K6 */ be_nested_string("close", 667630371, 5),
|
||||
/* K7 */ be_nested_string("_dirty", 283846766, 6),
|
||||
/* K5 */ be_nested_string(":", 1057798253, 1),
|
||||
/* K6 */ be_nested_string("json_fdump_any", -946337911, 14),
|
||||
/* K7 */ be_nested_string(",", 688690635, 1),
|
||||
/* K8 */ be_nested_string("stop_iteration", -121173395, 14),
|
||||
/* K9 */ be_nested_string("}", -133412696, 1),
|
||||
}),
|
||||
(be_nested_const_str("save", -855671224, 4)),
|
||||
(be_nested_const_str("input", -103256197, 5)),
|
||||
( &(const binstruction[30]) { /* code */
|
||||
0xA4060000, // 0000 IMPORT R1 K0
|
||||
0x4C080000, // 0001 LDNIL R2
|
||||
0xA802000D, // 0002 EXBLK 0 #0011
|
||||
0x600C0011, // 0003 GETGBL R3 G17
|
||||
0x88100101, // 0004 GETMBR R4 R0 K1
|
||||
0x58140002, // 0005 LDCONST R5 K2
|
||||
0x7C0C0400, // 0006 CALL R3 2
|
||||
0x5C080600, // 0007 MOVE R2 R3
|
||||
0x8C0C0503, // 0008 GETMET R3 R2 K3
|
||||
0x8C140304, // 0009 GETMET R5 R1 K4
|
||||
0x881C0105, // 000A GETMBR R7 R0 K5
|
||||
0x7C140400, // 000B CALL R5 2
|
||||
0x7C0C0400, // 000C CALL R3 2
|
||||
0x8C0C0506, // 000D GETMET R3 R2 K6
|
||||
0x7C0C0200, // 000E CALL R3 1
|
||||
0xA8040001, // 000F EXBLK 1 1
|
||||
0x70020009, // 0010 JMP #001B
|
||||
0xAC0C0002, // 0011 CATCH R3 0 2
|
||||
0x70020006, // 0012 JMP #001A
|
||||
0x4C140000, // 0013 LDNIL R5
|
||||
0x20140405, // 0014 NE R5 R2 R5
|
||||
0x78160001, // 0015 JMPF R5 #0018
|
||||
0x8C140506, // 0016 GETMET R5 R2 K6
|
||||
0x7C140200, // 0017 CALL R5 1
|
||||
0xB0040604, // 0018 RAISE 1 R3 R4
|
||||
0x70020000, // 0019 JMP #001B
|
||||
0xB0080000, // 001A RAISE 2 R0 R0
|
||||
0x500C0000, // 001B LDBOOL R3 0 0
|
||||
0x90020E03, // 001C SETMBR R0 K7 R3
|
||||
0x80000000, // 001D RET 0
|
||||
(be_nested_const_str("json_fdump_map", -203012643, 14)),
|
||||
((bstring*) &be_const_str_input),
|
||||
( &(const binstruction[41]) { /* code */
|
||||
0xA40E0000, // 0000 IMPORT R3 K0
|
||||
0x8C100301, // 0001 GETMET R4 R1 K1
|
||||
0x58180002, // 0002 LDCONST R6 K2
|
||||
0x7C100400, // 0003 CALL R4 2
|
||||
0x4C100000, // 0004 LDNIL R4
|
||||
0x60140010, // 0005 GETGBL R5 G16
|
||||
0x8C180503, // 0006 GETMET R6 R2 K3
|
||||
0x7C180200, // 0007 CALL R6 1
|
||||
0x7C140200, // 0008 CALL R5 1
|
||||
0xA8020017, // 0009 EXBLK 0 #0022
|
||||
0x5C180A00, // 000A MOVE R6 R5
|
||||
0x7C180000, // 000B CALL R6 0
|
||||
0x4C1C0000, // 000C LDNIL R7
|
||||
0x201C0807, // 000D NE R7 R4 R7
|
||||
0x781E0002, // 000E JMPF R7 #0012
|
||||
0x8C1C0301, // 000F GETMET R7 R1 K1
|
||||
0x5C240800, // 0010 MOVE R9 R4
|
||||
0x7C1C0400, // 0011 CALL R7 2
|
||||
0x8C1C0301, // 0012 GETMET R7 R1 K1
|
||||
0x8C240704, // 0013 GETMET R9 R3 K4
|
||||
0x602C0008, // 0014 GETGBL R11 G8
|
||||
0x5C300C00, // 0015 MOVE R12 R6
|
||||
0x7C2C0200, // 0016 CALL R11 1
|
||||
0x7C240400, // 0017 CALL R9 2
|
||||
0x7C1C0400, // 0018 CALL R7 2
|
||||
0x8C1C0301, // 0019 GETMET R7 R1 K1
|
||||
0x58240005, // 001A LDCONST R9 K5
|
||||
0x7C1C0400, // 001B CALL R7 2
|
||||
0x8C1C0106, // 001C GETMET R7 R0 K6
|
||||
0x5C240200, // 001D MOVE R9 R1
|
||||
0x94280406, // 001E GETIDX R10 R2 R6
|
||||
0x7C1C0600, // 001F CALL R7 3
|
||||
0x58100007, // 0020 LDCONST R4 K7
|
||||
0x7001FFE7, // 0021 JMP #000A
|
||||
0x58140008, // 0022 LDCONST R5 K8
|
||||
0xAC140200, // 0023 CATCH R5 1 0
|
||||
0xB0080000, // 0024 RAISE 2 R0 R0
|
||||
0x8C140301, // 0025 GETMET R5 R1 K1
|
||||
0x581C0009, // 0026 LDCONST R7 K9
|
||||
0x7C140400, // 0027 CALL R5 2
|
||||
0x80000000, // 0028 RET 0
|
||||
})
|
||||
)
|
||||
);
|
||||
@ -87,7 +100,7 @@ be_local_closure(setmember, /* name */
|
||||
/* K1 */ be_nested_string("_dirty", 283846766, 6),
|
||||
}),
|
||||
(be_nested_const_str("setmember", 1432909441, 9)),
|
||||
(be_nested_const_str("input", -103256197, 5)),
|
||||
((bstring*) &be_const_str_input),
|
||||
( &(const binstruction[ 5]) { /* code */
|
||||
0x880C0100, // 0000 GETMBR R3 R0 K0
|
||||
0x980C0202, // 0001 SETIDX R3 R1 R2
|
||||
@ -100,158 +113,6 @@ be_local_closure(setmember, /* name */
|
||||
/*******************************************************************/
|
||||
|
||||
|
||||
/********************************************************************
|
||||
** Solidified function: init
|
||||
********************************************************************/
|
||||
be_local_closure(init, /* name */
|
||||
be_nested_proto(
|
||||
6, /* nstack */
|
||||
2, /* argc */
|
||||
0, /* 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_string("_filename", 1430813195, 9),
|
||||
/* K1 */ be_nested_string("_persist.json", 2008425138, 13),
|
||||
/* K2 */ be_nested_string("_p", 1594591802, 2),
|
||||
/* K3 */ be_nested_string("copy", -446502332, 4),
|
||||
/* K4 */ be_nested_string("load", -435725847, 4),
|
||||
/* K5 */ be_nested_string("_dirty", 283846766, 6),
|
||||
}),
|
||||
(be_nested_const_str("init", 380752755, 4)),
|
||||
(be_nested_const_str("input", -103256197, 5)),
|
||||
( &(const binstruction[20]) { /* code */
|
||||
0x90020101, // 0000 SETMBR R0 K0 K1
|
||||
0x6008000F, // 0001 GETGBL R2 G15
|
||||
0x5C0C0200, // 0002 MOVE R3 R1
|
||||
0x60100013, // 0003 GETGBL R4 G19
|
||||
0x7C080400, // 0004 CALL R2 2
|
||||
0x780A0003, // 0005 JMPF R2 #000A
|
||||
0x8C080303, // 0006 GETMET R2 R1 K3
|
||||
0x7C080200, // 0007 CALL R2 1
|
||||
0x90020402, // 0008 SETMBR R0 K2 R2
|
||||
0x70020002, // 0009 JMP #000D
|
||||
0x60080013, // 000A GETGBL R2 G19
|
||||
0x7C080000, // 000B CALL R2 0
|
||||
0x90020402, // 000C SETMBR R0 K2 R2
|
||||
0x8C080104, // 000D GETMET R2 R0 K4
|
||||
0x88100102, // 000E GETMBR R4 R0 K2
|
||||
0x88140100, // 000F GETMBR R5 R0 K0
|
||||
0x7C080600, // 0010 CALL R2 3
|
||||
0x50080000, // 0011 LDBOOL R2 0 0
|
||||
0x90020A02, // 0012 SETMBR R0 K5 R2
|
||||
0x80000000, // 0013 RET 0
|
||||
})
|
||||
)
|
||||
);
|
||||
/*******************************************************************/
|
||||
|
||||
|
||||
/********************************************************************
|
||||
** Solidified function: load
|
||||
********************************************************************/
|
||||
be_local_closure(load, /* name */
|
||||
be_nested_proto(
|
||||
9, /* nstack */
|
||||
1, /* argc */
|
||||
0, /* varg */
|
||||
0, /* has upvals */
|
||||
NULL, /* no upvals */
|
||||
0, /* has sup protos */
|
||||
NULL, /* no sub protos */
|
||||
1, /* has constants */
|
||||
( &(const bvalue[10]) { /* constants */
|
||||
/* K0 */ be_nested_string("json", 916562499, 4),
|
||||
/* K1 */ be_nested_string("path", -2071507658, 4),
|
||||
/* K2 */ be_nested_string("exists", 1002329533, 6),
|
||||
/* K3 */ be_nested_string("_filename", 1430813195, 9),
|
||||
/* K4 */ be_nested_string("r", -150190315, 1),
|
||||
/* K5 */ be_nested_string("load", -435725847, 4),
|
||||
/* K6 */ be_nested_string("read", -824204347, 4),
|
||||
/* K7 */ be_nested_string("close", 667630371, 5),
|
||||
/* K8 */ be_nested_string("_p", 1594591802, 2),
|
||||
/* K9 */ be_nested_string("_dirty", 283846766, 6),
|
||||
}),
|
||||
(be_nested_const_str("load", -435725847, 4)),
|
||||
(be_nested_const_str("input", -103256197, 5)),
|
||||
( &(const binstruction[37]) { /* code */
|
||||
0xA4060000, // 0000 IMPORT R1 K0
|
||||
0xA40A0200, // 0001 IMPORT R2 K1
|
||||
0x4C0C0000, // 0002 LDNIL R3
|
||||
0x4C100000, // 0003 LDNIL R4
|
||||
0x8C140502, // 0004 GETMET R5 R2 K2
|
||||
0x881C0103, // 0005 GETMBR R7 R0 K3
|
||||
0x7C140400, // 0006 CALL R5 2
|
||||
0x7816001B, // 0007 JMPF R5 #0024
|
||||
0xA802000D, // 0008 EXBLK 0 #0017
|
||||
0x60140011, // 0009 GETGBL R5 G17
|
||||
0x88180103, // 000A GETMBR R6 R0 K3
|
||||
0x581C0004, // 000B LDCONST R7 K4
|
||||
0x7C140400, // 000C CALL R5 2
|
||||
0x5C0C0A00, // 000D MOVE R3 R5
|
||||
0x8C140305, // 000E GETMET R5 R1 K5
|
||||
0x8C1C0706, // 000F GETMET R7 R3 K6
|
||||
0x7C1C0200, // 0010 CALL R7 1
|
||||
0x7C140400, // 0011 CALL R5 2
|
||||
0x5C100A00, // 0012 MOVE R4 R5
|
||||
0x8C140707, // 0013 GETMET R5 R3 K7
|
||||
0x7C140200, // 0014 CALL R5 1
|
||||
0xA8040001, // 0015 EXBLK 1 1
|
||||
0x70020009, // 0016 JMP #0021
|
||||
0xAC140002, // 0017 CATCH R5 0 2
|
||||
0x70020006, // 0018 JMP #0020
|
||||
0x4C1C0000, // 0019 LDNIL R7
|
||||
0x201C0607, // 001A NE R7 R3 R7
|
||||
0x781E0001, // 001B JMPF R7 #001E
|
||||
0x8C1C0707, // 001C GETMET R7 R3 K7
|
||||
0x7C1C0200, // 001D CALL R7 1
|
||||
0xB0040A06, // 001E RAISE 1 R5 R6
|
||||
0x70020000, // 001F JMP #0021
|
||||
0xB0080000, // 0020 RAISE 2 R0 R0
|
||||
0x90021004, // 0021 SETMBR R0 K8 R4
|
||||
0x50140000, // 0022 LDBOOL R5 0 0
|
||||
0x90021205, // 0023 SETMBR R0 K9 R5
|
||||
0x80000000, // 0024 RET 0
|
||||
})
|
||||
)
|
||||
);
|
||||
/*******************************************************************/
|
||||
|
||||
|
||||
/********************************************************************
|
||||
** Solidified function: has
|
||||
********************************************************************/
|
||||
be_local_closure(has, /* name */
|
||||
be_nested_proto(
|
||||
5, /* nstack */
|
||||
2, /* argc */
|
||||
0, /* varg */
|
||||
0, /* has upvals */
|
||||
NULL, /* no upvals */
|
||||
0, /* has sup protos */
|
||||
NULL, /* no sub protos */
|
||||
1, /* has constants */
|
||||
( &(const bvalue[ 2]) { /* constants */
|
||||
/* K0 */ be_nested_string("_p", 1594591802, 2),
|
||||
/* K1 */ be_nested_string("has", -306245661, 3),
|
||||
}),
|
||||
(be_nested_const_str("has", -306245661, 3)),
|
||||
(be_nested_const_str("input", -103256197, 5)),
|
||||
( &(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: zero
|
||||
********************************************************************/
|
||||
@ -270,7 +131,7 @@ be_local_closure(zero, /* name */
|
||||
/* K1 */ be_nested_string("_dirty", 283846766, 6),
|
||||
}),
|
||||
(be_nested_const_str("zero", -1955600541, 4)),
|
||||
(be_nested_const_str("input", -103256197, 5)),
|
||||
((bstring*) &be_const_str_input),
|
||||
( &(const binstruction[ 6]) { /* code */
|
||||
0x60040013, // 0000 GETGBL R1 G19
|
||||
0x7C040000, // 0001 CALL R1 0
|
||||
@ -302,7 +163,7 @@ be_local_closure(member, /* name */
|
||||
/* K1 */ be_nested_string("find", -1108310694, 4),
|
||||
}),
|
||||
(be_nested_const_str("member", 719708611, 6)),
|
||||
(be_nested_const_str("input", -103256197, 5)),
|
||||
((bstring*) &be_const_str_input),
|
||||
( &(const binstruction[ 5]) { /* code */
|
||||
0x88080100, // 0000 GETMBR R2 R0 K0
|
||||
0x8C080501, // 0001 GETMET R2 R2 K1
|
||||
@ -315,6 +176,48 @@ be_local_closure(member, /* name */
|
||||
/*******************************************************************/
|
||||
|
||||
|
||||
/********************************************************************
|
||||
** Solidified function: json_fdump
|
||||
********************************************************************/
|
||||
be_local_closure(json_fdump, /* name */
|
||||
be_nested_proto(
|
||||
7, /* nstack */
|
||||
2, /* argc */
|
||||
0, /* varg */
|
||||
0, /* has upvals */
|
||||
NULL, /* no upvals */
|
||||
0, /* has sup protos */
|
||||
NULL, /* no sub protos */
|
||||
1, /* has constants */
|
||||
( &(const bvalue[ 5]) { /* constants */
|
||||
/* K0 */ be_nested_string("json", 916562499, 4),
|
||||
/* K1 */ be_nested_string("_p", 1594591802, 2),
|
||||
/* K2 */ be_nested_string("json_fdump_map", -203012643, 14),
|
||||
/* K3 */ be_nested_string("internal_error", -1775809127, 14),
|
||||
/* K4 */ be_nested_string("persist._p is not a map", 1176528732, 23),
|
||||
}),
|
||||
(be_nested_const_str("json_fdump", 1694216580, 10)),
|
||||
((bstring*) &be_const_str_input),
|
||||
( &(const binstruction[13]) { /* code */
|
||||
0xA40A0000, // 0000 IMPORT R2 K0
|
||||
0x600C000F, // 0001 GETGBL R3 G15
|
||||
0x88100101, // 0002 GETMBR R4 R0 K1
|
||||
0x60140013, // 0003 GETGBL R5 G19
|
||||
0x7C0C0400, // 0004 CALL R3 2
|
||||
0x780E0004, // 0005 JMPF R3 #000B
|
||||
0x8C0C0102, // 0006 GETMET R3 R0 K2
|
||||
0x5C140200, // 0007 MOVE R5 R1
|
||||
0x88180101, // 0008 GETMBR R6 R0 K1
|
||||
0x7C0C0600, // 0009 CALL R3 3
|
||||
0x70020000, // 000A JMP #000C
|
||||
0xB0060704, // 000B RAISE 1 K3 K4
|
||||
0x80000000, // 000C RET 0
|
||||
})
|
||||
)
|
||||
);
|
||||
/*******************************************************************/
|
||||
|
||||
|
||||
/********************************************************************
|
||||
** Solidified function: remove
|
||||
********************************************************************/
|
||||
@ -334,7 +237,7 @@ be_local_closure(remove, /* name */
|
||||
/* K2 */ be_nested_string("_dirty", 283846766, 6),
|
||||
}),
|
||||
(be_nested_const_str("remove", -611183107, 6)),
|
||||
(be_nested_const_str("input", -103256197, 5)),
|
||||
((bstring*) &be_const_str_input),
|
||||
( &(const binstruction[ 7]) { /* code */
|
||||
0x88080100, // 0000 GETMBR R2 R0 K0
|
||||
0x8C080501, // 0001 GETMET R2 R2 K1
|
||||
@ -349,6 +252,211 @@ be_local_closure(remove, /* name */
|
||||
/*******************************************************************/
|
||||
|
||||
|
||||
/********************************************************************
|
||||
** Solidified function: json_fdump_any
|
||||
********************************************************************/
|
||||
be_local_closure(json_fdump_any, /* name */
|
||||
be_nested_proto(
|
||||
9, /* nstack */
|
||||
3, /* argc */
|
||||
0, /* varg */
|
||||
0, /* has upvals */
|
||||
NULL, /* no upvals */
|
||||
0, /* has sup protos */
|
||||
NULL, /* no sub protos */
|
||||
1, /* has constants */
|
||||
( &(const bvalue[ 5]) { /* constants */
|
||||
/* K0 */ be_nested_string("json", 916562499, 4),
|
||||
/* K1 */ be_nested_string("json_fdump_map", -203012643, 14),
|
||||
/* K2 */ be_nested_string("json_fdump_list", -391087443, 15),
|
||||
/* K3 */ be_nested_string("write", -1104765092, 5),
|
||||
/* K4 */ be_nested_string("dump", -631966073, 4),
|
||||
}),
|
||||
(be_nested_const_str("json_fdump_any", -946337911, 14)),
|
||||
((bstring*) &be_const_str_input),
|
||||
( &(const binstruction[27]) { /* code */
|
||||
0xA40E0000, // 0000 IMPORT R3 K0
|
||||
0x6010000F, // 0001 GETGBL R4 G15
|
||||
0x5C140400, // 0002 MOVE R5 R2
|
||||
0x60180013, // 0003 GETGBL R6 G19
|
||||
0x7C100400, // 0004 CALL R4 2
|
||||
0x78120004, // 0005 JMPF R4 #000B
|
||||
0x8C100101, // 0006 GETMET R4 R0 K1
|
||||
0x5C180200, // 0007 MOVE R6 R1
|
||||
0x5C1C0400, // 0008 MOVE R7 R2
|
||||
0x7C100600, // 0009 CALL R4 3
|
||||
0x7002000E, // 000A JMP #001A
|
||||
0x6010000F, // 000B GETGBL R4 G15
|
||||
0x5C140400, // 000C MOVE R5 R2
|
||||
0x60180012, // 000D GETGBL R6 G18
|
||||
0x7C100400, // 000E CALL R4 2
|
||||
0x78120004, // 000F JMPF R4 #0015
|
||||
0x8C100102, // 0010 GETMET R4 R0 K2
|
||||
0x5C180200, // 0011 MOVE R6 R1
|
||||
0x5C1C0400, // 0012 MOVE R7 R2
|
||||
0x7C100600, // 0013 CALL R4 3
|
||||
0x70020004, // 0014 JMP #001A
|
||||
0x8C100303, // 0015 GETMET R4 R1 K3
|
||||
0x8C180704, // 0016 GETMET R6 R3 K4
|
||||
0x5C200400, // 0017 MOVE R8 R2
|
||||
0x7C180400, // 0018 CALL R6 2
|
||||
0x7C100400, // 0019 CALL R4 2
|
||||
0x80000000, // 001A RET 0
|
||||
})
|
||||
)
|
||||
);
|
||||
/*******************************************************************/
|
||||
|
||||
|
||||
/********************************************************************
|
||||
** Solidified function: save
|
||||
********************************************************************/
|
||||
be_local_closure(save, /* name */
|
||||
be_nested_proto(
|
||||
7, /* nstack */
|
||||
1, /* argc */
|
||||
0, /* varg */
|
||||
0, /* has upvals */
|
||||
NULL, /* no upvals */
|
||||
0, /* has sup protos */
|
||||
NULL, /* no sub protos */
|
||||
1, /* has constants */
|
||||
( &(const bvalue[ 7]) { /* constants */
|
||||
/* K0 */ be_nested_string("_filename", 1430813195, 9),
|
||||
/* K1 */ be_nested_string("w", -234078410, 1),
|
||||
/* K2 */ be_nested_string("json_fdump", 1694216580, 10),
|
||||
/* K3 */ be_nested_string("close", 667630371, 5),
|
||||
/* K4 */ be_nested_string("write", -1104765092, 5),
|
||||
/* K5 */ be_nested_string("{}", 1415952421, 2),
|
||||
/* K6 */ be_nested_string("_dirty", 283846766, 6),
|
||||
}),
|
||||
(be_nested_const_str("save", -855671224, 4)),
|
||||
((bstring*) &be_const_str_input),
|
||||
( &(const binstruction[37]) { /* code */
|
||||
0x4C040000, // 0000 LDNIL R1
|
||||
0xA802000B, // 0001 EXBLK 0 #000E
|
||||
0x60080011, // 0002 GETGBL R2 G17
|
||||
0x880C0100, // 0003 GETMBR R3 R0 K0
|
||||
0x58100001, // 0004 LDCONST R4 K1
|
||||
0x7C080400, // 0005 CALL R2 2
|
||||
0x5C040400, // 0006 MOVE R1 R2
|
||||
0x8C080102, // 0007 GETMET R2 R0 K2
|
||||
0x5C100200, // 0008 MOVE R4 R1
|
||||
0x7C080400, // 0009 CALL R2 2
|
||||
0x8C080303, // 000A GETMET R2 R1 K3
|
||||
0x7C080200, // 000B CALL R2 1
|
||||
0xA8040001, // 000C EXBLK 1 1
|
||||
0x70020013, // 000D JMP #0022
|
||||
0xAC080002, // 000E CATCH R2 0 2
|
||||
0x70020010, // 000F JMP #0021
|
||||
0x4C100000, // 0010 LDNIL R4
|
||||
0x20100204, // 0011 NE R4 R1 R4
|
||||
0x78120001, // 0012 JMPF R4 #0015
|
||||
0x8C100303, // 0013 GETMET R4 R1 K3
|
||||
0x7C100200, // 0014 CALL R4 1
|
||||
0x60100011, // 0015 GETGBL R4 G17
|
||||
0x88140100, // 0016 GETMBR R5 R0 K0
|
||||
0x58180001, // 0017 LDCONST R6 K1
|
||||
0x7C100400, // 0018 CALL R4 2
|
||||
0x5C040800, // 0019 MOVE R1 R4
|
||||
0x8C100304, // 001A GETMET R4 R1 K4
|
||||
0x58180005, // 001B LDCONST R6 K5
|
||||
0x7C100400, // 001C CALL R4 2
|
||||
0x8C100303, // 001D GETMET R4 R1 K3
|
||||
0x7C100200, // 001E CALL R4 1
|
||||
0xB0040403, // 001F RAISE 1 R2 R3
|
||||
0x70020000, // 0020 JMP #0022
|
||||
0xB0080000, // 0021 RAISE 2 R0 R0
|
||||
0x50080000, // 0022 LDBOOL R2 0 0
|
||||
0x90020C02, // 0023 SETMBR R0 K6 R2
|
||||
0x80000000, // 0024 RET 0
|
||||
})
|
||||
)
|
||||
);
|
||||
/*******************************************************************/
|
||||
|
||||
|
||||
/********************************************************************
|
||||
** Solidified function: load
|
||||
********************************************************************/
|
||||
be_local_closure(load, /* name */
|
||||
be_nested_proto(
|
||||
9, /* nstack */
|
||||
1, /* argc */
|
||||
0, /* varg */
|
||||
0, /* has upvals */
|
||||
NULL, /* no upvals */
|
||||
0, /* has sup protos */
|
||||
NULL, /* no sub protos */
|
||||
1, /* has constants */
|
||||
( &(const bvalue[11]) { /* constants */
|
||||
/* K0 */ be_nested_string("json", 916562499, 4),
|
||||
/* K1 */ be_nested_string("path", -2071507658, 4),
|
||||
/* K2 */ be_nested_string("exists", 1002329533, 6),
|
||||
/* K3 */ be_nested_string("_filename", 1430813195, 9),
|
||||
/* K4 */ be_nested_string("r", -150190315, 1),
|
||||
/* K5 */ be_nested_string("load", -435725847, 4),
|
||||
/* K6 */ be_nested_string("read", -824204347, 4),
|
||||
/* K7 */ be_nested_string("close", 667630371, 5),
|
||||
/* K8 */ be_nested_string("_p", 1594591802, 2),
|
||||
/* K9 */ be_nested_string("BRY: failed to load _persist.json", -1303053851, 33),
|
||||
/* K10 */ be_nested_string("_dirty", 283846766, 6),
|
||||
}),
|
||||
(be_nested_const_str("load", -435725847, 4)),
|
||||
((bstring*) &be_const_str_input),
|
||||
( &(const binstruction[46]) { /* code */
|
||||
0xA4060000, // 0000 IMPORT R1 K0
|
||||
0xA40A0200, // 0001 IMPORT R2 K1
|
||||
0x4C0C0000, // 0002 LDNIL R3
|
||||
0x4C100000, // 0003 LDNIL R4
|
||||
0x8C140502, // 0004 GETMET R5 R2 K2
|
||||
0x881C0103, // 0005 GETMBR R7 R0 K3
|
||||
0x7C140400, // 0006 CALL R5 2
|
||||
0x78160024, // 0007 JMPF R5 #002D
|
||||
0xA802000D, // 0008 EXBLK 0 #0017
|
||||
0x60140011, // 0009 GETGBL R5 G17
|
||||
0x88180103, // 000A GETMBR R6 R0 K3
|
||||
0x581C0004, // 000B LDCONST R7 K4
|
||||
0x7C140400, // 000C CALL R5 2
|
||||
0x5C0C0A00, // 000D MOVE R3 R5
|
||||
0x8C140305, // 000E GETMET R5 R1 K5
|
||||
0x8C1C0706, // 000F GETMET R7 R3 K6
|
||||
0x7C1C0200, // 0010 CALL R7 1
|
||||
0x7C140400, // 0011 CALL R5 2
|
||||
0x5C100A00, // 0012 MOVE R4 R5
|
||||
0x8C140707, // 0013 GETMET R5 R3 K7
|
||||
0x7C140200, // 0014 CALL R5 1
|
||||
0xA8040001, // 0015 EXBLK 1 1
|
||||
0x70020009, // 0016 JMP #0021
|
||||
0xAC140002, // 0017 CATCH R5 0 2
|
||||
0x70020006, // 0018 JMP #0020
|
||||
0x4C1C0000, // 0019 LDNIL R7
|
||||
0x201C0607, // 001A NE R7 R3 R7
|
||||
0x781E0001, // 001B JMPF R7 #001E
|
||||
0x8C1C0707, // 001C GETMET R7 R3 K7
|
||||
0x7C1C0200, // 001D CALL R7 1
|
||||
0xB0040A06, // 001E RAISE 1 R5 R6
|
||||
0x70020000, // 001F JMP #0021
|
||||
0xB0080000, // 0020 RAISE 2 R0 R0
|
||||
0x6014000F, // 0021 GETGBL R5 G15
|
||||
0x5C180800, // 0022 MOVE R6 R4
|
||||
0x601C0013, // 0023 GETGBL R7 G19
|
||||
0x7C140400, // 0024 CALL R5 2
|
||||
0x78160001, // 0025 JMPF R5 #0028
|
||||
0x90021004, // 0026 SETMBR R0 K8 R4
|
||||
0x70020002, // 0027 JMP #002B
|
||||
0x60140001, // 0028 GETGBL R5 G1
|
||||
0x58180009, // 0029 LDCONST R6 K9
|
||||
0x7C140200, // 002A CALL R5 1
|
||||
0x50140000, // 002B LDBOOL R5 0 0
|
||||
0x90021405, // 002C SETMBR R0 K10 R5
|
||||
0x80000000, // 002D RET 0
|
||||
})
|
||||
)
|
||||
);
|
||||
/*******************************************************************/
|
||||
|
||||
|
||||
/********************************************************************
|
||||
** Solidified function: find
|
||||
********************************************************************/
|
||||
@ -367,7 +475,7 @@ be_local_closure(find, /* name */
|
||||
/* K1 */ be_nested_string("find", -1108310694, 4),
|
||||
}),
|
||||
(be_nested_const_str("find", -1108310694, 4)),
|
||||
(be_nested_const_str("input", -103256197, 5)),
|
||||
((bstring*) &be_const_str_input),
|
||||
( &(const binstruction[ 6]) { /* code */
|
||||
0x880C0100, // 0000 GETMBR R3 R0 K0
|
||||
0x8C0C0701, // 0001 GETMET R3 R3 K1
|
||||
@ -381,26 +489,168 @@ be_local_closure(find, /* name */
|
||||
/*******************************************************************/
|
||||
|
||||
|
||||
/********************************************************************
|
||||
** Solidified function: init
|
||||
********************************************************************/
|
||||
be_local_closure(init, /* name */
|
||||
be_nested_proto(
|
||||
6, /* nstack */
|
||||
2, /* argc */
|
||||
0, /* 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_string("_filename", 1430813195, 9),
|
||||
/* K1 */ be_nested_string("_persist.json", 2008425138, 13),
|
||||
/* K2 */ be_nested_string("_p", 1594591802, 2),
|
||||
/* K3 */ be_nested_string("copy", -446502332, 4),
|
||||
/* K4 */ be_nested_string("load", -435725847, 4),
|
||||
/* K5 */ be_nested_string("_dirty", 283846766, 6),
|
||||
}),
|
||||
(be_nested_const_str("init", 380752755, 4)),
|
||||
((bstring*) &be_const_str_input),
|
||||
( &(const binstruction[20]) { /* code */
|
||||
0x90020101, // 0000 SETMBR R0 K0 K1
|
||||
0x6008000F, // 0001 GETGBL R2 G15
|
||||
0x5C0C0200, // 0002 MOVE R3 R1
|
||||
0x60100013, // 0003 GETGBL R4 G19
|
||||
0x7C080400, // 0004 CALL R2 2
|
||||
0x780A0003, // 0005 JMPF R2 #000A
|
||||
0x8C080303, // 0006 GETMET R2 R1 K3
|
||||
0x7C080200, // 0007 CALL R2 1
|
||||
0x90020402, // 0008 SETMBR R0 K2 R2
|
||||
0x70020002, // 0009 JMP #000D
|
||||
0x60080013, // 000A GETGBL R2 G19
|
||||
0x7C080000, // 000B CALL R2 0
|
||||
0x90020402, // 000C SETMBR R0 K2 R2
|
||||
0x8C080104, // 000D GETMET R2 R0 K4
|
||||
0x88100102, // 000E GETMBR R4 R0 K2
|
||||
0x88140100, // 000F GETMBR R5 R0 K0
|
||||
0x7C080600, // 0010 CALL R2 3
|
||||
0x50080000, // 0011 LDBOOL R2 0 0
|
||||
0x90020A02, // 0012 SETMBR R0 K5 R2
|
||||
0x80000000, // 0013 RET 0
|
||||
})
|
||||
)
|
||||
);
|
||||
/*******************************************************************/
|
||||
|
||||
|
||||
/********************************************************************
|
||||
** Solidified function: json_fdump_list
|
||||
********************************************************************/
|
||||
be_local_closure(json_fdump_list, /* name */
|
||||
be_nested_proto(
|
||||
9, /* nstack */
|
||||
3, /* argc */
|
||||
0, /* varg */
|
||||
0, /* has upvals */
|
||||
NULL, /* no upvals */
|
||||
0, /* has sup protos */
|
||||
NULL, /* no sub protos */
|
||||
1, /* has constants */
|
||||
( &(const bvalue[ 8]) { /* constants */
|
||||
/* K0 */ be_nested_string("json", 916562499, 4),
|
||||
/* K1 */ be_nested_string("write", -1104765092, 5),
|
||||
/* K2 */ be_nested_string("[", -569630790, 1),
|
||||
/* K3 */ be_const_int(0),
|
||||
/* K4 */ be_nested_string(",", 688690635, 1),
|
||||
/* K5 */ be_nested_string("json_fdump_any", -946337911, 14),
|
||||
/* K6 */ be_const_int(1),
|
||||
/* K7 */ be_nested_string("]", -670296504, 1),
|
||||
}),
|
||||
(be_nested_const_str("json_fdump_list", -391087443, 15)),
|
||||
((bstring*) &be_const_str_input),
|
||||
( &(const binstruction[25]) { /* code */
|
||||
0xA40E0000, // 0000 IMPORT R3 K0
|
||||
0x8C100301, // 0001 GETMET R4 R1 K1
|
||||
0x58180002, // 0002 LDCONST R6 K2
|
||||
0x7C100400, // 0003 CALL R4 2
|
||||
0x58100003, // 0004 LDCONST R4 K3
|
||||
0x6014000C, // 0005 GETGBL R5 G12
|
||||
0x5C180400, // 0006 MOVE R6 R2
|
||||
0x7C140200, // 0007 CALL R5 1
|
||||
0x14140805, // 0008 LT R5 R4 R5
|
||||
0x7816000A, // 0009 JMPF R5 #0015
|
||||
0x24140903, // 000A GT R5 R4 K3
|
||||
0x78160002, // 000B JMPF R5 #000F
|
||||
0x8C140301, // 000C GETMET R5 R1 K1
|
||||
0x581C0004, // 000D LDCONST R7 K4
|
||||
0x7C140400, // 000E CALL R5 2
|
||||
0x8C140105, // 000F GETMET R5 R0 K5
|
||||
0x5C1C0200, // 0010 MOVE R7 R1
|
||||
0x94200404, // 0011 GETIDX R8 R2 R4
|
||||
0x7C140600, // 0012 CALL R5 3
|
||||
0x00100906, // 0013 ADD R4 R4 K6
|
||||
0x7001FFEF, // 0014 JMP #0005
|
||||
0x8C140301, // 0015 GETMET R5 R1 K1
|
||||
0x581C0007, // 0016 LDCONST R7 K7
|
||||
0x7C140400, // 0017 CALL R5 2
|
||||
0x80000000, // 0018 RET 0
|
||||
})
|
||||
)
|
||||
);
|
||||
/*******************************************************************/
|
||||
|
||||
|
||||
/********************************************************************
|
||||
** Solidified function: has
|
||||
********************************************************************/
|
||||
be_local_closure(has, /* name */
|
||||
be_nested_proto(
|
||||
5, /* nstack */
|
||||
2, /* argc */
|
||||
0, /* varg */
|
||||
0, /* has upvals */
|
||||
NULL, /* no upvals */
|
||||
0, /* has sup protos */
|
||||
NULL, /* no sub protos */
|
||||
1, /* has constants */
|
||||
( &(const bvalue[ 2]) { /* constants */
|
||||
/* K0 */ be_nested_string("_p", 1594591802, 2),
|
||||
/* K1 */ be_nested_string("has", -306245661, 3),
|
||||
}),
|
||||
(be_nested_const_str("has", -306245661, 3)),
|
||||
((bstring*) &be_const_str_input),
|
||||
( &(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 class: Persist
|
||||
********************************************************************/
|
||||
be_local_class(Persist,
|
||||
3,
|
||||
NULL,
|
||||
be_nested_map(12,
|
||||
be_nested_map(16,
|
||||
( (struct bmapnode*) &(const bmapnode[]) {
|
||||
{ be_nested_key("json_fdump_map", -203012643, 14, 5), be_const_closure(json_fdump_map_closure) },
|
||||
{ be_nested_key("setmember", 1432909441, 9, -1), be_const_closure(setmember_closure) },
|
||||
{ be_nested_key("zero", -1955600541, 4, 15), be_const_closure(zero_closure) },
|
||||
{ be_nested_key("member", 719708611, 6, 12), be_const_closure(member_closure) },
|
||||
{ be_nested_key("json_fdump", 1694216580, 10, -1), be_const_closure(json_fdump_closure) },
|
||||
{ be_nested_key("remove", -611183107, 6, -1), be_const_closure(remove_closure) },
|
||||
{ be_nested_key("json_fdump_any", -946337911, 14, -1), be_const_closure(json_fdump_any_closure) },
|
||||
{ be_nested_key("_p", 1594591802, 2, -1), be_const_var(1) },
|
||||
{ be_nested_key("save", -855671224, 4, -1), be_const_closure(save_closure) },
|
||||
{ be_nested_key("setmember", 1432909441, 9, 4), be_const_closure(setmember_closure) },
|
||||
{ be_nested_key("_p", 1594591802, 2, 5), be_const_var(1) },
|
||||
{ be_nested_key("init", 380752755, 4, -1), be_const_closure(init_closure) },
|
||||
{ be_nested_key("load", -435725847, 4, -1), be_const_closure(load_closure) },
|
||||
{ be_nested_key("load", -435725847, 4, 6), be_const_closure(load_closure) },
|
||||
{ be_nested_key("find", -1108310694, 4, 7), be_const_closure(find_closure) },
|
||||
{ be_nested_key("_filename", 1430813195, 9, -1), be_const_var(0) },
|
||||
{ be_nested_key("init", 380752755, 4, 2), be_const_closure(init_closure) },
|
||||
{ be_nested_key("json_fdump_list", -391087443, 15, 0), be_const_closure(json_fdump_list_closure) },
|
||||
{ be_nested_key("_dirty", 283846766, 6, -1), be_const_var(2) },
|
||||
{ be_nested_key("has", -306245661, 3, -1), be_const_closure(has_closure) },
|
||||
{ be_nested_key("zero", -1955600541, 4, 8), be_const_closure(zero_closure) },
|
||||
{ be_nested_key("member", 719708611, 6, 6), be_const_closure(member_closure) },
|
||||
{ be_nested_key("remove", -611183107, 6, -1), be_const_closure(remove_closure) },
|
||||
{ be_nested_key("find", -1108310694, 4, -1), be_const_closure(find_closure) },
|
||||
{ be_nested_key("_filename", 1430813195, 9, -1), be_const_var(0) },
|
||||
})),
|
||||
(be_nested_const_str("Persist", 1456346147, 7))
|
||||
);
|
||||
@ -422,7 +672,7 @@ be_local_closure(_anonymous_, /* name */
|
||||
/* K0 */ be_const_class(be_class_Persist),
|
||||
}),
|
||||
(be_nested_const_str("_anonymous_", 1957281476, 11)),
|
||||
(be_nested_const_str("input", -103256197, 5)),
|
||||
((bstring*) &be_const_str_input),
|
||||
( &(const binstruction[ 5]) { /* code */
|
||||
0x58040000, // 0000 LDCONST R1 K0
|
||||
0xB4000000, // 0001 CLASS K0
|
||||
@ -434,9 +684,16 @@ be_local_closure(_anonymous_, /* name */
|
||||
);
|
||||
/*******************************************************************/
|
||||
|
||||
/* @const_object_info_begin
|
||||
module persist (scope: global) {
|
||||
init, closure(_anonymous__closure)
|
||||
}
|
||||
@const_object_info_end */
|
||||
#include "../generate/be_fixed_persist.h"
|
||||
|
||||
/********************************************************************
|
||||
** Solidified module: persist
|
||||
********************************************************************/
|
||||
be_local_module(persist,
|
||||
"persist",
|
||||
be_nested_map(1,
|
||||
( (struct bmapnode*) &(const bmapnode[]) {
|
||||
{ be_nested_key("init", 380752755, 4, -1), be_const_closure(_anonymous__closure) },
|
||||
}))
|
||||
);
|
||||
BE_EXPORT_VARIABLE be_define_const_native_module(persist);
|
||||
/********************************************************************/
|
||||
|
@ -18,7 +18,9 @@
|
||||
// Local pointer for file managment
|
||||
#ifdef USE_UFILESYS
|
||||
#include <FS.h>
|
||||
#include "ZipReadFS.h"
|
||||
extern FS *ufsp;
|
||||
FS zip_ufsp(ZipReadFSImplPtr(new ZipReadFSImpl(&ufsp)));
|
||||
#endif // USE_UFILESYS
|
||||
|
||||
/* this file contains configuration for the file system. */
|
||||
@ -95,10 +97,42 @@ BERRY_API void be_writebuffer(const char *buffer, size_t length)
|
||||
// be_fwrite(stdout, buffer, length);
|
||||
}
|
||||
|
||||
|
||||
extern "C" {
|
||||
int m_path_listdir(bvm *vm)
|
||||
{
|
||||
if (be_top(vm) >= 1 && be_isstring(vm, 1)) {
|
||||
const char *path = be_tostring(vm, 1);
|
||||
be_newobject(vm, "list");
|
||||
|
||||
File dir = ufsp->open(path, "r");
|
||||
if (dir) {
|
||||
dir.rewindDirectory();
|
||||
while (1) {
|
||||
File entry = dir.openNextFile();
|
||||
if (!entry) {
|
||||
break;
|
||||
}
|
||||
const char * fn = entry.name();
|
||||
if (strcmp(fn, ".") && strcmp(fn, "..")) {
|
||||
be_pushstring(vm, fn);
|
||||
be_data_push(vm, -2);
|
||||
be_pop(vm, 1);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
be_pop(vm, 1);
|
||||
be_return(vm);
|
||||
|
||||
}
|
||||
be_return_nil(vm);
|
||||
}
|
||||
}
|
||||
|
||||
BERRY_API char* be_readstring(char *buffer, size_t size)
|
||||
{
|
||||
return 0;
|
||||
// return be_fgets(stdin, buffer, (int)size);
|
||||
return be_fgets(stdin, buffer, (int)size);
|
||||
}
|
||||
|
||||
/* use the standard library implementation file API. */
|
||||
@ -106,7 +140,7 @@ BERRY_API char* be_readstring(char *buffer, size_t size)
|
||||
void* be_fopen(const char *filename, const char *modes)
|
||||
{
|
||||
#ifdef USE_UFILESYS
|
||||
if (ufsp != nullptr && filename != nullptr && modes != nullptr) {
|
||||
if (filename != nullptr && modes != nullptr) {
|
||||
char fname2[strlen(filename) + 2];
|
||||
if (filename[0] == '/') {
|
||||
strcpy(fname2, filename); // copy unchanged
|
||||
@ -115,7 +149,7 @@ void* be_fopen(const char *filename, const char *modes)
|
||||
strcpy(fname2 + 1, filename); // prepend with '/'
|
||||
}
|
||||
// Serial.printf("be_fopen filename=%s, modes=%s\n", filename, modes);
|
||||
File f = ufsp->open(fname2, modes); // returns an object, not a pointer
|
||||
File f = zip_ufsp.open(fname2, modes); // returns an object, not a pointer
|
||||
if (f) {
|
||||
File * f_ptr = new File(f); // copy to dynamic object
|
||||
*f_ptr = f; // TODO is this necessary?
|
||||
@ -127,11 +161,24 @@ void* be_fopen(const char *filename, const char *modes)
|
||||
// return fopen(filename, modes);
|
||||
}
|
||||
|
||||
// Tasmota specific, get the underlying Arduino File
|
||||
File * be_get_arduino_file(void *hfile)
|
||||
{
|
||||
#ifdef USE_UFILESYS
|
||||
if (hfile != nullptr) {
|
||||
File * f_ptr = (File*) hfile;
|
||||
return f_ptr;
|
||||
}
|
||||
#endif // USE_UFILESYS
|
||||
return nullptr;
|
||||
// return fopen(filename, modes);
|
||||
}
|
||||
|
||||
int be_fclose(void *hfile)
|
||||
{
|
||||
#ifdef USE_UFILESYS
|
||||
// Serial.printf("be_fclose\n");
|
||||
if (ufsp != nullptr && hfile != nullptr) {
|
||||
if (hfile != nullptr) {
|
||||
File * f_ptr = (File*) hfile;
|
||||
f_ptr->close();
|
||||
delete f_ptr;
|
||||
@ -146,7 +193,7 @@ size_t be_fwrite(void *hfile, const void *buffer, size_t length)
|
||||
{
|
||||
#ifdef USE_UFILESYS
|
||||
// Serial.printf("be_fwrite %d\n", length);
|
||||
if (ufsp != nullptr && hfile != nullptr && buffer != nullptr) {
|
||||
if (hfile != nullptr && buffer != nullptr) {
|
||||
File * f_ptr = (File*) hfile;
|
||||
return f_ptr->write((const uint8_t*) buffer, length);
|
||||
}
|
||||
@ -159,7 +206,7 @@ size_t be_fread(void *hfile, void *buffer, size_t length)
|
||||
{
|
||||
#ifdef USE_UFILESYS
|
||||
// Serial.printf("be_fread %d\n", length);
|
||||
if (ufsp != nullptr && hfile != nullptr && buffer != nullptr) {
|
||||
if (hfile != nullptr && buffer != nullptr) {
|
||||
File * f_ptr = (File*) hfile;
|
||||
int32_t ret = f_ptr->read((uint8_t*) buffer, length);
|
||||
if (ret >= 0) {
|
||||
@ -175,13 +222,19 @@ size_t be_fread(void *hfile, void *buffer, size_t length)
|
||||
char* be_fgets(void *hfile, void *buffer, int size)
|
||||
{
|
||||
#ifdef USE_UFILESYS
|
||||
// Serial.printf("be_fgets %d\n", size);
|
||||
if (size <= 2) { return nullptr; } // can't work if size is 2 or less
|
||||
// Serial.printf("be_fgets size=%d hfile=%p buf=%p\n", size, hfile, buffer);
|
||||
uint8_t * buf = (uint8_t*) buffer;
|
||||
if (ufsp != nullptr && hfile != nullptr && buffer != nullptr && size > 0) {
|
||||
if (hfile != nullptr && buffer != nullptr && size > 0) {
|
||||
File * f_ptr = (File*) hfile;
|
||||
int ret = f_ptr->readBytesUntil('\n', buf, size - 1);
|
||||
int ret = f_ptr->readBytesUntil('\n', buf, size - 2);
|
||||
// Serial.printf("be_fgets ret=%d\n", ret);
|
||||
if (ret >= 0) {
|
||||
buf[ret] = 0; // add string terminator
|
||||
if (ret > 0 && ret < size - 2) {
|
||||
buf[ret] = '\n';
|
||||
buf[ret+1] = 0;
|
||||
}
|
||||
return (char*) buffer;
|
||||
}
|
||||
}
|
||||
@ -194,7 +247,7 @@ int be_fseek(void *hfile, long offset)
|
||||
{
|
||||
#ifdef USE_UFILESYS
|
||||
// Serial.printf("be_fseek %d\n", offset);
|
||||
if (ufsp != nullptr && hfile != nullptr) {
|
||||
if (hfile != nullptr) {
|
||||
File * f_ptr = (File*) hfile;
|
||||
if (f_ptr->seek(offset)) {
|
||||
return 0; // success
|
||||
@ -209,7 +262,7 @@ long int be_ftell(void *hfile)
|
||||
{
|
||||
#ifdef USE_UFILESYS
|
||||
// Serial.printf("be_ftell\n");
|
||||
if (ufsp != nullptr && hfile != nullptr) {
|
||||
if (hfile != nullptr) {
|
||||
File * f_ptr = (File*) hfile;
|
||||
return f_ptr->position();
|
||||
}
|
||||
@ -222,7 +275,7 @@ long int be_fflush(void *hfile)
|
||||
{
|
||||
#ifdef USE_UFILESYS
|
||||
// Serial.printf("be_fflush\n");
|
||||
if (ufsp != nullptr && hfile != nullptr) {
|
||||
if (hfile != nullptr) {
|
||||
File * f_ptr = (File*) hfile;
|
||||
f_ptr->flush();
|
||||
}
|
||||
@ -235,7 +288,7 @@ size_t be_fsize(void *hfile)
|
||||
{
|
||||
#ifdef USE_UFILESYS
|
||||
// Serial.printf("be_fsize\n");
|
||||
if (ufsp != nullptr && hfile != nullptr) {
|
||||
if (hfile != nullptr) {
|
||||
File * f_ptr = (File*) hfile;
|
||||
return f_ptr->size();
|
||||
}
|
||||
@ -251,7 +304,7 @@ size_t be_fsize(void *hfile)
|
||||
extern "C" time_t be_last_modified(void *hfile)
|
||||
{
|
||||
#ifdef USE_UFILESYS
|
||||
if (ufsp != nullptr && hfile != nullptr) {
|
||||
if (hfile != nullptr) {
|
||||
File * f_ptr = (File*) hfile;
|
||||
return f_ptr->getLastWrite();
|
||||
}
|
||||
@ -262,16 +315,29 @@ extern "C" time_t be_last_modified(void *hfile)
|
||||
int be_isexist(const char *filename)
|
||||
{
|
||||
#ifdef USE_UFILESYS
|
||||
if (ufsp != nullptr) {
|
||||
char fname2[strlen(filename) + 2];
|
||||
if (filename[0] == '/') {
|
||||
strcpy(fname2, filename); // copy unchanged
|
||||
} else {
|
||||
fname2[0] = '/';
|
||||
strcpy(fname2 + 1, filename); // prepend with '/'
|
||||
}
|
||||
return ufsp->exists(fname2);
|
||||
char fname2[strlen(filename) + 2];
|
||||
if (filename[0] == '/') {
|
||||
strcpy(fname2, filename); // copy unchanged
|
||||
} else {
|
||||
fname2[0] = '/';
|
||||
strcpy(fname2 + 1, filename); // prepend with '/'
|
||||
}
|
||||
return zip_ufsp.exists(fname2);
|
||||
#endif // USE_UFILESYS
|
||||
return 0;
|
||||
}
|
||||
|
||||
int be_unlink(const char *filename)
|
||||
{
|
||||
#ifdef USE_UFILESYS
|
||||
char fname2[strlen(filename) + 2];
|
||||
if (filename[0] == '/') {
|
||||
strcpy(fname2, filename); // copy unchanged
|
||||
} else {
|
||||
fname2[0] = '/';
|
||||
strcpy(fname2 + 1, filename); // prepend with '/'
|
||||
}
|
||||
return zip_ufsp.remove(fname2);
|
||||
#endif // USE_UFILESYS
|
||||
return 0;
|
||||
}
|
||||
|
@ -12,6 +12,7 @@ extern struct dummy_struct be_tasmota_global_struct;
|
||||
extern struct dummy_struct be_tasmota_settings_struct;
|
||||
|
||||
extern int l_getFreeHeap(bvm *vm);
|
||||
extern int l_arch(bvm *vm);
|
||||
extern int l_publish(bvm *vm);
|
||||
extern int l_publish_result(bvm *vm);
|
||||
extern int l_cmd(bvm *vm);
|
||||
@ -68,8 +69,8 @@ be_local_closure(kv_init, /* name */
|
||||
/* K0 */ be_nested_string("k", -301188886, 1),
|
||||
/* K1 */ be_nested_string("v", -217300791, 1),
|
||||
}),
|
||||
(be_nested_const_str("init", 380752755, 4)),
|
||||
(be_nested_const_str("input", -103256197, 5)),
|
||||
((bstring*) &be_const_str_init),
|
||||
((bstring*) &be_const_str_input),
|
||||
( &(const binstruction[ 3]) { /* code */
|
||||
0x90020001, // 0000 SETMBR R0 K0 R1
|
||||
0x90020202, // 0001 SETMBR R0 K1 R2
|
||||
@ -112,7 +113,7 @@ be_local_closure(kv, /* name */
|
||||
/* K0 */ be_const_class(be_class_KV),
|
||||
}),
|
||||
(be_nested_const_str("kv", 1497177492, 2)),
|
||||
(be_nested_const_str("input", -103256197, 5)),
|
||||
((bstring*) &be_const_str_input),
|
||||
( &(const binstruction[ 7]) { /* code */
|
||||
0x580C0000, // 0000 LDCONST R3 K0
|
||||
0xB4000000, // 0001 CLASS K0
|
||||
@ -153,7 +154,7 @@ be_local_closure(init, /* name */
|
||||
/* K9 */ be_nested_string("toptr", -915119842, 5),
|
||||
/* K10 */ be_nested_string("_settings_def", -519406989, 13),
|
||||
}),
|
||||
(be_nested_const_str("init", 380752755, 4)),
|
||||
((bstring*) &be_const_str_init),
|
||||
(be_nested_const_str("tasmota.be", 1128870755, 10)),
|
||||
( &(const binstruction[23]) { /* code */
|
||||
0xB8060200, // 0000 GETNGBL R1 K1
|
||||
@ -202,7 +203,7 @@ be_local_closure(add_driver, /* name */
|
||||
/* K1 */ be_nested_string("push", -2022703139, 4),
|
||||
}),
|
||||
(be_nested_const_str("add_driver", 1654458371, 10)),
|
||||
(be_nested_const_str("Tasmota.be", 825809411, 10)),
|
||||
((bstring*) &be_const_str_input),
|
||||
( &(const binstruction[12]) { /* code */
|
||||
0x88080100, // 0000 GETMBR R2 R0 K0
|
||||
0x780A0004, // 0001 JMPF R2 #0007
|
||||
@ -245,7 +246,7 @@ be_local_closure(gen_cb, /* name */
|
||||
/* K6 */ be_nested_string("No callback available", 633786138, 21),
|
||||
}),
|
||||
(be_nested_const_str("gen_cb", -1049739745, 6)),
|
||||
(be_nested_const_str("Tasmota.be", 825809411, 10)),
|
||||
((bstring*) &be_const_str_input),
|
||||
( &(const binstruction[34]) { /* code */
|
||||
0x88080100, // 0000 GETMBR R2 R0 K0
|
||||
0x4C0C0000, // 0001 LDNIL R3
|
||||
@ -306,7 +307,7 @@ be_local_closure(set_light, /* name */
|
||||
/* K2 */ be_nested_string("set", -970520829, 3),
|
||||
}),
|
||||
(be_nested_const_str("set_light", -1118891144, 9)),
|
||||
(be_nested_const_str("Tasmota.be", 825809411, 10)),
|
||||
((bstring*) &be_const_str_input),
|
||||
( &(const binstruction[18]) { /* code */
|
||||
0x600C0001, // 0000 GETGBL R3 G1
|
||||
0x58100000, // 0001 LDCONST R4 K0
|
||||
@ -353,7 +354,7 @@ be_local_closure(remove_rule, /* name */
|
||||
/* K4 */ be_const_int(1),
|
||||
}),
|
||||
(be_nested_const_str("remove_rule", -838755968, 11)),
|
||||
(be_nested_const_str("input", -103256197, 5)),
|
||||
((bstring*) &be_const_str_input),
|
||||
( &(const binstruction[21]) { /* code */
|
||||
0x88080100, // 0000 GETMBR R2 R0 K0
|
||||
0x780A0011, // 0001 JMPF R2 #0014
|
||||
@ -402,7 +403,7 @@ be_local_closure(add_cmd, /* name */
|
||||
/* K3 */ be_nested_string("the second argument is not a function", -340392827, 37),
|
||||
}),
|
||||
(be_nested_const_str("add_cmd", -933336417, 7)),
|
||||
(be_nested_const_str("Tasmota.be", 825809411, 10)),
|
||||
((bstring*) &be_const_str_input),
|
||||
( &(const binstruction[15]) { /* code */
|
||||
0x880C0100, // 0000 GETMBR R3 R0 K0
|
||||
0x740E0002, // 0001 JMPT R3 #0005
|
||||
@ -446,7 +447,7 @@ be_local_closure(wire_scan, /* name */
|
||||
/* K4 */ be_nested_string("wire2", -1065468258, 5),
|
||||
}),
|
||||
(be_nested_const_str("wire_scan", -1623691416, 9)),
|
||||
(be_nested_const_str("input", -103256197, 5)),
|
||||
((bstring*) &be_const_str_input),
|
||||
( &(const binstruction[33]) { /* code */
|
||||
0x4C0C0000, // 0000 LDNIL R3
|
||||
0x200C0403, // 0001 NE R3 R2 R3
|
||||
@ -508,7 +509,7 @@ be_local_closure(find_key_i, /* name */
|
||||
/* K4 */ be_nested_string("stop_iteration", -121173395, 14),
|
||||
}),
|
||||
(be_nested_const_str("find_key_i", 850136726, 10)),
|
||||
(be_nested_const_str("input", -103256197, 5)),
|
||||
((bstring*) &be_const_str_input),
|
||||
( &(const binstruction[30]) { /* code */
|
||||
0xA40E0000, // 0000 IMPORT R3 K0
|
||||
0x8C100701, // 0001 GETMET R4 R3 K1
|
||||
@ -564,7 +565,7 @@ be_local_closure(chars_in_string, /* name */
|
||||
/* K1 */ be_const_int(1),
|
||||
}),
|
||||
(be_nested_const_str("chars_in_string", -1146182164, 15)),
|
||||
(be_nested_const_str("input", -103256197, 5)),
|
||||
((bstring*) &be_const_str_input),
|
||||
( &(const binstruction[31]) { /* code */
|
||||
0x780E0001, // 0000 JMPF R3 #0003
|
||||
0x50100200, // 0001 LDBOOL R4 1 0
|
||||
@ -623,7 +624,7 @@ be_local_closure(set_timer, /* name */
|
||||
/* K3 */ be_nested_string("millis", 1214679063, 6),
|
||||
}),
|
||||
(be_nested_const_str("set_timer", 2135414533, 9)),
|
||||
(be_nested_const_str("Tasmota.be", 825809411, 10)),
|
||||
((bstring*) &be_const_str_input),
|
||||
( &(const binstruction[16]) { /* code */
|
||||
0x88100100, // 0000 GETMBR R4 R0 K0
|
||||
0x74120002, // 0001 JMPT R4 #0005
|
||||
@ -669,7 +670,7 @@ be_local_closure(add_rule, /* name */
|
||||
/* K5 */ be_nested_string("the second argument is not a function", -340392827, 37),
|
||||
}),
|
||||
(be_nested_const_str("add_rule", 596540743, 8)),
|
||||
(be_nested_const_str("input", -103256197, 5)),
|
||||
((bstring*) &be_const_str_input),
|
||||
( &(const binstruction[20]) { /* code */
|
||||
0x880C0100, // 0000 GETMBR R3 R0 K0
|
||||
0x740E0002, // 0001 JMPT R3 #0005
|
||||
@ -721,7 +722,7 @@ be_local_closure(run_deferred, /* name */
|
||||
/* K7 */ be_const_int(1),
|
||||
}),
|
||||
(be_nested_const_str("run_deferred", 371594696, 12)),
|
||||
(be_nested_const_str("Tasmota.be", 825809411, 10)),
|
||||
((bstring*) &be_const_str_input),
|
||||
( &(const binstruction[27]) { /* code */
|
||||
0x88040100, // 0000 GETMBR R1 R0 K0
|
||||
0x78060017, // 0001 JMPF R1 #001A
|
||||
@ -822,7 +823,7 @@ be_local_closure(time_str, /* name */
|
||||
/* K9 */ be_nested_string("sec", -1155074638, 3),
|
||||
}),
|
||||
(be_nested_const_str("time_str", -1681139684, 8)),
|
||||
(be_nested_const_str("Tasmota.be", 825809411, 10)),
|
||||
((bstring*) &be_const_str_input),
|
||||
( &(const binstruction[14]) { /* code */
|
||||
0xA40A0000, // 0000 IMPORT R2 K0
|
||||
0x8C0C0101, // 0001 GETMET R3 R0 K1
|
||||
@ -878,7 +879,7 @@ be_local_closure(load, /* name */
|
||||
/* K17 */ be_nested_string("BRY: could not save compiled file %s (%s)", 736659787, 41),
|
||||
}),
|
||||
(be_nested_const_str("load", -435725847, 4)),
|
||||
(be_nested_const_str("input", -103256197, 5)),
|
||||
((bstring*) &be_const_str_input),
|
||||
( &(const binstruction[87]) { /* code */
|
||||
0xA40A0000, // 0000 IMPORT R2 K0
|
||||
0xA40E0200, // 0001 IMPORT R3 K1
|
||||
@ -995,7 +996,7 @@ be_local_closure(find_op, /* name */
|
||||
/* K5 */ be_const_int(1),
|
||||
}),
|
||||
(be_nested_const_str("find_op", -528253920, 7)),
|
||||
(be_nested_const_str("Tasmota.be", 825809411, 10)),
|
||||
((bstring*) &be_const_str_input),
|
||||
( &(const binstruction[42]) { /* code */
|
||||
0xA40A0000, // 0000 IMPORT R2 K0
|
||||
0x580C0001, // 0001 LDCONST R3 K1
|
||||
@ -1068,7 +1069,7 @@ be_local_closure(remove_timer, /* name */
|
||||
/* K6 */ be_const_int(1),
|
||||
}),
|
||||
(be_nested_const_str("remove_timer", -153495081, 12)),
|
||||
(be_nested_const_str("Tasmota.be", 825809411, 10)),
|
||||
((bstring*) &be_const_str_input),
|
||||
( &(const binstruction[23]) { /* code */
|
||||
0xB80A0000, // 0000 GETNGBL R2 K0
|
||||
0x88080501, // 0001 GETMBR R2 R2 K1
|
||||
@ -1118,7 +1119,7 @@ be_local_closure(get_light, /* name */
|
||||
/* K2 */ be_nested_string("get", 1410115415, 3),
|
||||
}),
|
||||
(be_nested_const_str("get_light", 381930476, 9)),
|
||||
(be_nested_const_str("Tasmota.be", 825809411, 10)),
|
||||
((bstring*) &be_const_str_input),
|
||||
( &(const binstruction[16]) { /* code */
|
||||
0x60080001, // 0000 GETGBL R2 G1
|
||||
0x580C0000, // 0001 LDCONST R3 K0
|
||||
@ -1170,7 +1171,7 @@ be_local_closure(exec_rules, /* name */
|
||||
/* K11 */ be_const_int(1),
|
||||
}),
|
||||
(be_nested_const_str("exec_rules", 1445221092, 10)),
|
||||
(be_nested_const_str("input", -103256197, 5)),
|
||||
((bstring*) &be_const_str_input),
|
||||
( &(const binstruction[48]) { /* code */
|
||||
0x88080100, // 0000 GETMBR R2 R0 K0
|
||||
0x740A0003, // 0001 JMPT R2 #0006
|
||||
@ -1254,7 +1255,7 @@ be_local_closure(exec_tele, /* name */
|
||||
/* K11 */ be_const_int(1),
|
||||
}),
|
||||
(be_nested_const_str("exec_tele", 1020751601, 9)),
|
||||
(be_nested_const_str("input", -103256197, 5)),
|
||||
((bstring*) &be_const_str_input),
|
||||
( &(const binstruction[41]) { /* code */
|
||||
0x88080100, // 0000 GETMBR R2 R0 K0
|
||||
0x780A0024, // 0001 JMPF R2 #0027
|
||||
@ -1322,7 +1323,7 @@ be_local_closure(remove_driver, /* name */
|
||||
/* K2 */ be_nested_string("pop", 1362321360, 3),
|
||||
}),
|
||||
(be_nested_const_str("remove_driver", 1030243768, 13)),
|
||||
(be_nested_const_str("Tasmota.be", 825809411, 10)),
|
||||
((bstring*) &be_const_str_input),
|
||||
( &(const binstruction[14]) { /* code */
|
||||
0x88080100, // 0000 GETMBR R2 R0 K0
|
||||
0x780A000A, // 0001 JMPF R2 #000D
|
||||
@ -1376,7 +1377,7 @@ be_local_closure(try_rule, /* name */
|
||||
/* K15 */ be_nested_string("<=", -1795743310, 2),
|
||||
}),
|
||||
(be_nested_const_str("try_rule", 1986449405, 8)),
|
||||
(be_nested_const_str("input", -103256197, 5)),
|
||||
((bstring*) &be_const_str_input),
|
||||
( &(const binstruction[141]) { /* code */
|
||||
0xA4120000, // 0000 IMPORT R4 K0
|
||||
0x8C140101, // 0001 GETMET R5 R0 K1
|
||||
@ -1544,7 +1545,7 @@ be_local_closure(cb_dispatch, /* name */
|
||||
/* K2 */ be_nested_string("find", -1108310694, 4),
|
||||
}),
|
||||
(be_nested_const_str("cb_dispatch", 1741510499, 11)),
|
||||
(be_nested_const_str("Tasmota.be", 825809411, 10)),
|
||||
((bstring*) &be_const_str_input),
|
||||
( &(const binstruction[20]) { /* code */
|
||||
0x88180100, // 0000 GETMBR R6 R0 K0
|
||||
0x4C1C0000, // 0001 LDNIL R7
|
||||
@ -1591,7 +1592,7 @@ be_local_closure(gc, /* name */
|
||||
/* K2 */ be_nested_string("allocated", 429986098, 9),
|
||||
}),
|
||||
(be_nested_const_str("gc", 1042313471, 2)),
|
||||
(be_nested_const_str("Tasmota.be", 825809411, 10)),
|
||||
((bstring*) &be_const_str_input),
|
||||
( &(const binstruction[ 6]) { /* code */
|
||||
0xA4060000, // 0000 IMPORT R1 K0
|
||||
0x8C080301, // 0001 GETMET R2 R1 K1
|
||||
@ -1761,7 +1762,7 @@ be_local_closure(remove_cmd, /* name */
|
||||
/* K1 */ be_nested_string("remove", -611183107, 6),
|
||||
}),
|
||||
(be_nested_const_str("remove_cmd", -462651594, 10)),
|
||||
(be_nested_const_str("Tasmota.be", 825809411, 10)),
|
||||
((bstring*) &be_const_str_input),
|
||||
( &(const binstruction[ 7]) { /* code */
|
||||
0x88080100, // 0000 GETMBR R2 R0 K0
|
||||
0x780A0003, // 0001 JMPF R2 #0006
|
||||
@ -1797,7 +1798,7 @@ be_local_closure(exec_cmd, /* name */
|
||||
/* K4 */ be_nested_string("resolvecmnd", 993361485, 11),
|
||||
}),
|
||||
(be_nested_const_str("exec_cmd", 493567399, 8)),
|
||||
(be_nested_const_str("Tasmota.be", 825809411, 10)),
|
||||
((bstring*) &be_const_str_input),
|
||||
( &(const binstruction[27]) { /* code */
|
||||
0x88100100, // 0000 GETMBR R4 R0 K0
|
||||
0x78120016, // 0001 JMPF R4 #0019
|
||||
@ -1865,6 +1866,7 @@ class be_class_tasmota (scope: global, name: Tasmota) {
|
||||
kv, closure(kv_closure)
|
||||
|
||||
get_free_heap, func(l_getFreeHeap)
|
||||
arch, func(l_arch)
|
||||
publish, func(l_publish)
|
||||
publish_result, func(l_publish_result)
|
||||
_cmd, func(l_cmd)
|
||||
|
@ -27,7 +27,7 @@ be_local_closure(tostring, /* name */
|
||||
/* K5 */ be_nested_string("id", 926444256, 2),
|
||||
}),
|
||||
(be_nested_const_str("tostring", -1995258651, 8)),
|
||||
(be_nested_const_str("Tasmota.be", 825809411, 10)),
|
||||
((bstring*) &be_const_str_input),
|
||||
( &(const binstruction[19]) { /* code */
|
||||
0xA4060000, // 0000 IMPORT R1 K0
|
||||
0x8C080301, // 0001 GETMET R2 R1 K1
|
||||
@ -72,8 +72,8 @@ be_local_closure(init, /* name */
|
||||
/* K1 */ be_nested_string("f", -485742695, 1),
|
||||
/* K2 */ be_nested_string("id", 926444256, 2),
|
||||
}),
|
||||
(be_nested_const_str("init", 380752755, 4)),
|
||||
(be_nested_const_str("Tasmota.be", 825809411, 10)),
|
||||
((bstring*) &be_const_str_init),
|
||||
((bstring*) &be_const_str_input),
|
||||
( &(const binstruction[ 4]) { /* code */
|
||||
0x90020001, // 0000 SETMBR R0 K0 R1
|
||||
0x90020202, // 0001 SETMBR R0 K1 R2
|
||||
|
@ -21,6 +21,7 @@ extern int wc_addheader(bvm *vm);
|
||||
extern int wc_GET(bvm *vm);
|
||||
extern int wc_POST(bvm *vm);
|
||||
extern int wc_getstring(bvm *vm);
|
||||
extern int wc_writefile(bvm *vm);
|
||||
extern int wc_getsize(bvm *vm);
|
||||
|
||||
#include "../generate/be_fixed_be_class_webclient.h"
|
||||
@ -48,6 +49,7 @@ class be_class_webclient (scope: global, name: webclient) {
|
||||
GET, func(wc_GET)
|
||||
POST, func(wc_POST)
|
||||
get_string, func(wc_getstring)
|
||||
write_file, func(wc_writefile)
|
||||
get_size, func(wc_getsize)
|
||||
}
|
||||
@const_object_info_end */
|
||||
|
@ -44,7 +44,7 @@ be_local_closure(write_bytes, /* name */
|
||||
/* K2 */ be_nested_string("_end_transmission", -1057486896, 17),
|
||||
}),
|
||||
(be_nested_const_str("write_bytes", 1227543792, 11)),
|
||||
(be_nested_const_str("input", -103256197, 5)),
|
||||
((bstring*) &be_const_str_input),
|
||||
( &(const binstruction[12]) { /* code */
|
||||
0x8C100100, // 0000 GETMET R4 R0 K0
|
||||
0x5C180200, // 0001 MOVE R6 R1
|
||||
@ -86,7 +86,7 @@ be_local_closure(read_bytes, /* name */
|
||||
/* K5 */ be_nested_string("_read", 346717030, 5),
|
||||
}),
|
||||
(be_nested_const_str("read_bytes", -718234123, 10)),
|
||||
(be_nested_const_str("input", -103256197, 5)),
|
||||
((bstring*) &be_const_str_input),
|
||||
( &(const binstruction[24]) { /* code */
|
||||
0x8C100100, // 0000 GETMET R4 R0 K0
|
||||
0x5C180200, // 0001 MOVE R6 R1
|
||||
|
@ -75,7 +75,11 @@ persist_module.init = def (m)
|
||||
if f != nil f.close() end
|
||||
raise e, m
|
||||
end
|
||||
self._p = val
|
||||
if isinstance(val, map)
|
||||
self._p = val # sucess
|
||||
else
|
||||
print("BRY: failed to load _persist.json")
|
||||
end
|
||||
self._dirty = false
|
||||
end
|
||||
|
||||
@ -83,22 +87,72 @@ persist_module.init = def (m)
|
||||
end
|
||||
|
||||
def save()
|
||||
import json
|
||||
|
||||
var f # file object
|
||||
try
|
||||
f = open(self._filename, "w")
|
||||
f.write(json.dump(self._p))
|
||||
self.json_fdump(f)
|
||||
f.close()
|
||||
except .. as e, m
|
||||
if f != nil f.close() end
|
||||
f = open(self._filename, "w")
|
||||
f.write('{}') # fallback write empty map
|
||||
f.close()
|
||||
raise e, m
|
||||
end
|
||||
self._dirty = false
|
||||
# print("Saving")
|
||||
end
|
||||
|
||||
def json_fdump_any(f, v)
|
||||
import json
|
||||
if isinstance(v, map)
|
||||
self.json_fdump_map(f, v)
|
||||
elif isinstance(v, list)v
|
||||
self.json_fdump_list(f, v)
|
||||
else
|
||||
f.write(json.dump(v))
|
||||
end
|
||||
end
|
||||
|
||||
def json_fdump_map(f, v)
|
||||
import json
|
||||
f.write('{')
|
||||
var sep = nil
|
||||
for k:v.keys()
|
||||
if sep != nil f.write(sep) end
|
||||
|
||||
f.write(json.dump(str(k)))
|
||||
f.write(':')
|
||||
self.json_fdump_any(f, v[k])
|
||||
|
||||
sep = ","
|
||||
end
|
||||
f.write('}')
|
||||
end
|
||||
|
||||
def json_fdump_list(f, v)
|
||||
import json
|
||||
f.write('[')
|
||||
var i = 0
|
||||
while i < size(v)
|
||||
if i > 0 f.write(',') end
|
||||
self.json_fdump_any(f, v[i])
|
||||
i += 1
|
||||
end
|
||||
f.write(']')
|
||||
end
|
||||
|
||||
def json_fdump(f)
|
||||
import json
|
||||
if isinstance(self._p, map)
|
||||
self.json_fdump_map(f, self._p)
|
||||
else
|
||||
raise "internal_error", "persist._p is not a map"
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
return Persist() # return an instance of this class
|
||||
end
|
||||
|
||||
|
@ -1,239 +0,0 @@
|
||||
GPIO_NONE 0
|
||||
GPIO_KEY1 1
|
||||
GPIO_KEY1_NP 2
|
||||
GPIO_KEY1_INV 3
|
||||
GPIO_KEY1_INV_NP 4
|
||||
GPIO_SWT1 5
|
||||
GPIO_SWT1_NP 6
|
||||
GPIO_REL1 7
|
||||
GPIO_REL1_INV 8
|
||||
GPIO_LED1 9
|
||||
GPIO_LED1_INV 10
|
||||
GPIO_CNTR1 11
|
||||
GPIO_CNTR1_NP 12
|
||||
GPIO_PWM1 13
|
||||
GPIO_PWM1_INV 14
|
||||
GPIO_BUZZER 15
|
||||
GPIO_BUZZER_INV 16
|
||||
GPIO_LEDLNK 17
|
||||
GPIO_LEDLNK_INV 18
|
||||
GPIO_I2C_SCL 19
|
||||
GPIO_I2C_SDA 20
|
||||
GPIO_SPI_MISO 21
|
||||
GPIO_SPI_MOSI 22
|
||||
GPIO_SPI_CLK 23
|
||||
GPIO_SPI_CS 24
|
||||
GPIO_SPI_DC 25
|
||||
GPIO_SSPI_MISO 26
|
||||
GPIO_SSPI_MOSI 27
|
||||
GPIO_SSPI_SCLK 28
|
||||
GPIO_SSPI_CS 29
|
||||
GPIO_SSPI_DC 30
|
||||
GPIO_BACKLIGHT 31
|
||||
GPIO_OLED_RESET 32
|
||||
GPIO_IRSEND 33
|
||||
GPIO_IRRECV 34
|
||||
GPIO_RFSEND 35
|
||||
GPIO_RFRECV 36
|
||||
GPIO_DHT11 37
|
||||
GPIO_DHT22 38
|
||||
GPIO_SI7021 39
|
||||
GPIO_DHT11_OUT 40
|
||||
GPIO_DSB 41
|
||||
GPIO_DSB_OUT 42
|
||||
GPIO_WS2812 43
|
||||
GPIO_MHZ_TXD 44
|
||||
GPIO_MHZ_RXD 45
|
||||
GPIO_PZEM0XX_TX 46
|
||||
GPIO_PZEM004_RX 47
|
||||
GPIO_PZEM016_RX 48
|
||||
GPIO_PZEM017_RX 49
|
||||
GPIO_SAIR_TX 50
|
||||
GPIO_SAIR_RX 51
|
||||
GPIO_PMS5003_TX 52
|
||||
GPIO_PMS5003_RX 53
|
||||
GPIO_SDS0X1_TX 54
|
||||
GPIO_SDS0X1_RX 55
|
||||
GPIO_SBR_TX 56
|
||||
GPIO_SBR_RX 57
|
||||
GPIO_SR04_TRIG 58
|
||||
GPIO_SR04_ECHO 59
|
||||
GPIO_SDM120_TX 60
|
||||
GPIO_SDM120_RX 61
|
||||
GPIO_SDM630_TX 62
|
||||
GPIO_SDM630_RX 63
|
||||
GPIO_TM1638CLK 64
|
||||
GPIO_TM1638DIO 65
|
||||
GPIO_TM1638STB 66
|
||||
GPIO_MP3_DFR562 67
|
||||
GPIO_HX711_SCK 68
|
||||
GPIO_HX711_DAT 69
|
||||
GPIO_TX2X_TXD_BLACK 70
|
||||
GPIO_TUYA_TX 71
|
||||
GPIO_TUYA_RX 72
|
||||
GPIO_MGC3130_XFER 73
|
||||
GPIO_MGC3130_RESET 74
|
||||
GPIO_RF_SENSOR 75
|
||||
GPIO_AZ_TXD 76
|
||||
GPIO_AZ_RXD 77
|
||||
GPIO_MAX31855CS 78
|
||||
GPIO_MAX31855CLK 79
|
||||
GPIO_MAX31855DO 80
|
||||
GPIO_NRG_SEL 81
|
||||
GPIO_NRG_SEL_INV 82
|
||||
GPIO_NRG_CF1 83
|
||||
GPIO_HLW_CF 84
|
||||
GPIO_HJL_CF 85
|
||||
GPIO_MCP39F5_TX 86
|
||||
GPIO_MCP39F5_RX 87
|
||||
GPIO_MCP39F5_RST 88
|
||||
GPIO_PN532_TXD 89
|
||||
GPIO_PN532_RXD 90
|
||||
GPIO_SM16716_CLK 91
|
||||
GPIO_SM16716_DAT 92
|
||||
GPIO_SM16716_SEL 93
|
||||
GPIO_DI 94
|
||||
GPIO_DCKI 95
|
||||
GPIO_CSE7766_TX 96
|
||||
GPIO_CSE7766_RX 97
|
||||
GPIO_ARIRFRCV 98
|
||||
GPIO_ARIRFSEL 99
|
||||
GPIO_TXD 100
|
||||
GPIO_RXD 101
|
||||
GPIO_ROT1A 102
|
||||
GPIO_ROT1B 103
|
||||
GPIO_ADC_JOY 104
|
||||
GPIO_SSPI_MAX31865_CS1 105
|
||||
GPIO_HRE_CLOCK 106
|
||||
GPIO_HRE_DATA 107
|
||||
GPIO_ADE7953_IRQ 108
|
||||
GPIO_SOLAXX1_TX 109
|
||||
GPIO_SOLAXX1_RX 110
|
||||
GPIO_ZIGBEE_TX 111
|
||||
GPIO_ZIGBEE_RX 112
|
||||
GPIO_RDM6300_RX 113
|
||||
GPIO_IBEACON_TX 114
|
||||
GPIO_IBEACON_RX 115
|
||||
GPIO_A4988_DIR 116
|
||||
GPIO_A4988_STP 117
|
||||
GPIO_A4988_ENA 118
|
||||
GPIO_A4988_MS1 119
|
||||
GPIO_OUTPUT_HI 120
|
||||
GPIO_OUTPUT_LO 121
|
||||
GPIO_DDS2382_TX 122
|
||||
GPIO_DDS2382_RX 123
|
||||
GPIO_DDSU666_TX 124
|
||||
GPIO_DDSU666_RX 125
|
||||
GPIO_SM2135_CLK 126
|
||||
GPIO_SM2135_DAT 127
|
||||
GPIO_DEEPSLEEP 128
|
||||
GPIO_EXS_ENABLE 129
|
||||
GPIO_TASMOTACLIENT_TXD 130
|
||||
GPIO_TASMOTACLIENT_RXD 131
|
||||
GPIO_TASMOTACLIENT_RST 132
|
||||
GPIO_TASMOTACLIENT_RST_INV 133
|
||||
GPIO_HPMA_RX 134
|
||||
GPIO_HPMA_TX 135
|
||||
GPIO_GPS_RX 136
|
||||
GPIO_GPS_TX 137
|
||||
GPIO_HM10_RX 138
|
||||
GPIO_HM10_TX 139
|
||||
GPIO_LE01MR_RX 140
|
||||
GPIO_LE01MR_TX 141
|
||||
GPIO_CC1101_GDO0 142
|
||||
GPIO_CC1101_GDO2 143
|
||||
GPIO_HRXL_RX 144
|
||||
GPIO_ELECTRIQ_MOODL_TX 145
|
||||
GPIO_AS3935 146
|
||||
GPIO_ADC_INPUT 147
|
||||
GPIO_ADC_TEMP 148
|
||||
GPIO_ADC_LIGHT 149
|
||||
GPIO_ADC_BUTTON 150
|
||||
GPIO_ADC_BUTTON_INV 151
|
||||
GPIO_ADC_RANGE 152
|
||||
GPIO_ADC_CT_POWER 153
|
||||
GPIO_WEBCAM_PWDN 154
|
||||
GPIO_WEBCAM_RESET 155
|
||||
GPIO_WEBCAM_XCLK 156
|
||||
GPIO_WEBCAM_SIOD 157
|
||||
GPIO_WEBCAM_SIOC 158
|
||||
GPIO_WEBCAM_DATA 159
|
||||
GPIO_WEBCAM_VSYNC 160
|
||||
GPIO_WEBCAM_HREF 161
|
||||
GPIO_WEBCAM_PCLK 162
|
||||
GPIO_WEBCAM_PSCLK 163
|
||||
GPIO_WEBCAM_HSD 164
|
||||
GPIO_WEBCAM_PSRCS 165
|
||||
GPIO_BOILER_OT_RX 166
|
||||
GPIO_BOILER_OT_TX 167
|
||||
GPIO_WINDMETER_SPEED 168
|
||||
GPIO_KEY1_TC 169
|
||||
GPIO_BL0940_RX 170
|
||||
GPIO_TCP_TX 171
|
||||
GPIO_TCP_RX 172
|
||||
GPIO_ETH_PHY_POWER 173
|
||||
GPIO_ETH_PHY_MDC 174
|
||||
GPIO_ETH_PHY_MDIO 175
|
||||
GPIO_TELEINFO_RX 176
|
||||
GPIO_TELEINFO_ENABLE 177
|
||||
GPIO_LMT01 178
|
||||
GPIO_IEM3000_TX 179
|
||||
GPIO_IEM3000_RX 180
|
||||
GPIO_ZIGBEE_RST 181
|
||||
GPIO_DYP_RX 182
|
||||
GPIO_MIEL_HVAC_TX 183
|
||||
GPIO_MIEL_HVAC_RX 184
|
||||
GPIO_WE517_TX 185
|
||||
GPIO_WE517_RX 186
|
||||
GPIO_AS608_TX 187
|
||||
GPIO_AS608_RX 188
|
||||
GPIO_SHELLY_DIMMER_BOOT0 189
|
||||
GPIO_SHELLY_DIMMER_RST_INV 190
|
||||
GPIO_RC522_RST 191
|
||||
GPIO_P9813_CLK 192
|
||||
GPIO_P9813_DAT 193
|
||||
GPIO_OPTION_A 194
|
||||
GPIO_FTC532 195
|
||||
GPIO_RC522_CS 196
|
||||
GPIO_NRF24_CS 197
|
||||
GPIO_NRF24_DC 198
|
||||
GPIO_ILI9341_CS 199
|
||||
GPIO_ILI9341_DC 200
|
||||
GPIO_ILI9488_CS 201
|
||||
GPIO_EPAPER29_CS 202
|
||||
GPIO_EPAPER42_CS 203
|
||||
GPIO_SSD1351_CS 204
|
||||
GPIO_RA8876_CS 205
|
||||
GPIO_ST7789_CS 206
|
||||
GPIO_ST7789_DC 207
|
||||
GPIO_SSD1331_CS 208
|
||||
GPIO_SSD1331_DC 209
|
||||
GPIO_SDCARD_CS 210
|
||||
GPIO_ROT1A_NP 211
|
||||
GPIO_ROT1B_NP 212
|
||||
GPIO_ADC_PH 213
|
||||
GPIO_BS814_CLK 214
|
||||
GPIO_BS814_DAT 215
|
||||
GPIO_WIEGAND_D0 216
|
||||
GPIO_WIEGAND_D1 217
|
||||
GPIO_NEOPOOL_TX 218
|
||||
GPIO_NEOPOOL_RX 219
|
||||
GPIO_SDM72_TX 220
|
||||
GPIO_SDM72_RX 221
|
||||
GPIO_TM1637CLK 222
|
||||
GPIO_TM1637DIO 223
|
||||
GPIO_PROJECTOR_CTRL_TX 224
|
||||
GPIO_PROJECTOR_CTRL_RX 225
|
||||
GPIO_SSD1351_DC 226
|
||||
GPIO_XPT2046_CS 227
|
||||
GPIO_CSE7761_TX 228
|
||||
GPIO_CSE7761_RX 229
|
||||
GPIO_VL53L0X_XSHUT1 230
|
||||
GPIO_MAX7219CLK 231
|
||||
GPIO_MAX7219DIN 232
|
||||
GPIO_MAX7219CS 233
|
||||
GPIO_TFMINIPLUS_TX 234
|
||||
GPIO_TFMINIPLUS_RX 235
|
||||
GPIO_ZEROCROSS 236
|
||||
GPIO_HALLEFFECT 237
|
||||
GPIO_SENSOR_END 238
|
@ -1,604 +1,343 @@
|
||||
extern const bcstring be_const_str_memory;
|
||||
extern const bcstring be_const_str_resp_cmnd;
|
||||
extern const bcstring be_const_str_LE01MR_TX;
|
||||
extern const bcstring be_const_str_RA8876_CS;
|
||||
extern const bcstring be_const_str_HX711_DAT;
|
||||
extern const bcstring be_const_str_OUTPUT_HI;
|
||||
extern const bcstring be_const_str_FALLING;
|
||||
extern const bcstring be_const_str_content_send;
|
||||
extern const bcstring be_const_str_while;
|
||||
extern const bcstring be_const_str_AudioFileSourceFS;
|
||||
extern const bcstring be_const_str_clear;
|
||||
extern const bcstring be_const_str_pin;
|
||||
extern const bcstring be_const_str_response_append;
|
||||
extern const bcstring be_const_str_write_bit;
|
||||
extern const bcstring be_const_str_try;
|
||||
extern const bcstring be_const_str_get_free_heap;
|
||||
extern const bcstring be_const_str_pow;
|
||||
extern const bcstring be_const_str_set_light;
|
||||
extern const bcstring be_const_str_OUTPUT_OPEN_DRAIN;
|
||||
extern const bcstring be_const_str_ILI9488_CS;
|
||||
extern const bcstring be_const_str_WIEGAND_D1;
|
||||
extern const bcstring be_const_str__available;
|
||||
extern const bcstring be_const_str__settings_def;
|
||||
extern const bcstring be_const_str_find_key_i;
|
||||
extern const bcstring be_const_str_event;
|
||||
extern const bcstring be_const_str_SERIAL_6O1;
|
||||
extern const bcstring be_const_str_ST7789_DC;
|
||||
extern const bcstring be_const_str_WE517_TX;
|
||||
extern const bcstring be_const_str_byte;
|
||||
extern const bcstring be_const_str_set_useragent;
|
||||
extern const bcstring be_const_str_SERIAL_7E2;
|
||||
extern const bcstring be_const_str_TASMOTACLIENT_TXD;
|
||||
extern const bcstring be_const_str_WEBCAM_PCLK;
|
||||
extern const bcstring be_const_str_toptr;
|
||||
extern const bcstring be_const_str_Tasmota;
|
||||
extern const bcstring be_const_str__def;
|
||||
extern const bcstring be_const_str_KEY1_INV_NP;
|
||||
extern const bcstring be_const_str_dump;
|
||||
extern const bcstring be_const_str_MAX31855DO;
|
||||
extern const bcstring be_const_str_ZIGBEE_RX;
|
||||
extern const bcstring be_const_str_opt_call;
|
||||
extern const bcstring be_const_str_HPMA_RX;
|
||||
extern const bcstring be_const_str_I2S_IN_DATA;
|
||||
extern const bcstring be_const_str_AudioOutputI2S;
|
||||
extern const bcstring be_const_str_WEBCAM_SIOC;
|
||||
extern const bcstring be_const_str_bytes;
|
||||
extern const bcstring be_const_str_getbits;
|
||||
extern const bcstring be_const_str_setrange;
|
||||
extern const bcstring be_const_str_RC522_CS;
|
||||
extern const bcstring be_const_str_WIEGAND_D0;
|
||||
extern const bcstring be_const_str_char;
|
||||
extern const bcstring be_const_str_SHELLY_DIMMER_RST_INV;
|
||||
extern const bcstring be_const_str_available;
|
||||
extern const bcstring be_const_str_FTC532;
|
||||
extern const bcstring be_const_str_MCP39F5_RST;
|
||||
extern const bcstring be_const_str_MP3_DFR562;
|
||||
extern const bcstring be_const_str_cmd;
|
||||
extern const bcstring be_const_str_ST7789_CS;
|
||||
extern const bcstring be_const_str_load;
|
||||
extern const bcstring be_const_str_ADC_INPUT;
|
||||
extern const bcstring be_const_str_Wire;
|
||||
extern const bcstring be_const_str_floor;
|
||||
extern const bcstring be_const_str_MAX7219CLK;
|
||||
extern const bcstring be_const_str_ZIGBEE_RST;
|
||||
extern const bcstring be_const_str__cmd;
|
||||
extern const bcstring be_const_str_tolower;
|
||||
extern const bcstring be_const_str_webclient;
|
||||
extern const bcstring be_const_str_true;
|
||||
extern const bcstring be_const_str_SDCARD_CS;
|
||||
extern const bcstring be_const_str_ADC_CT_POWER;
|
||||
extern const bcstring be_const_str_BL0940_RX;
|
||||
extern const bcstring be_const_str_OPEN_DRAIN;
|
||||
extern const bcstring be_const_str_dot_len;
|
||||
extern const bcstring be_const_str_dot_size;
|
||||
extern const bcstring be_const_str_return;
|
||||
extern const bcstring be_const_str_SERIAL_7O1;
|
||||
extern const bcstring be_const_str_module;
|
||||
extern const bcstring be_const_str_shared_key;
|
||||
extern const bcstring be_const_str_DCKI;
|
||||
extern const bcstring be_const_str_add_cmd;
|
||||
extern const bcstring be_const_str_iter;
|
||||
extern const bcstring be_const_str_read32;
|
||||
extern const bcstring be_const_str_PN532_RXD;
|
||||
extern const bcstring be_const_str_SM2135_DAT;
|
||||
extern const bcstring be_const_str_var;
|
||||
extern const bcstring be_const_str_WINDMETER_SPEED;
|
||||
extern const bcstring be_const_str_raise;
|
||||
extern const bcstring be_const_str_CSE7761_RX;
|
||||
extern const bcstring be_const_str_SAIR_RX;
|
||||
extern const bcstring be_const_str_cb_dispatch;
|
||||
extern const bcstring be_const_str_MIEL_HVAC_RX;
|
||||
extern const bcstring be_const_str_count;
|
||||
extern const bcstring be_const_str_REL1;
|
||||
extern const bcstring be_const_str_SWT1;
|
||||
extern const bcstring be_const_str_WS2812;
|
||||
extern const bcstring be_const_str_rand;
|
||||
extern const bcstring be_const_str_break;
|
||||
extern const bcstring be_const_str_MAX7219CS;
|
||||
extern const bcstring be_const_str_tag;
|
||||
extern const bcstring be_const_str_write;
|
||||
extern const bcstring be_const_str_WEBCAM_HSD;
|
||||
extern const bcstring be_const_str_compile;
|
||||
extern const bcstring be_const_str_type;
|
||||
extern const bcstring be_const_str_TASMOTACLIENT_RST_INV;
|
||||
extern const bcstring be_const_str_contains;
|
||||
extern const bcstring be_const_str_rad;
|
||||
extern const bcstring be_const_str_HALLEFFECT;
|
||||
extern const bcstring be_const_str_PZEM017_RX;
|
||||
extern const bcstring be_const_str_SSD1331_DC;
|
||||
extern const bcstring be_const_str_PULLDOWN;
|
||||
extern const bcstring be_const_str_get_power;
|
||||
extern const bcstring be_const_str_isnan;
|
||||
extern const bcstring be_const_str_add_rule;
|
||||
extern const bcstring be_const_str_finish;
|
||||
extern const bcstring be_const_str_NRF24_DC;
|
||||
extern const bcstring be_const_str_SERIAL_7O2;
|
||||
extern const bcstring be_const_str_remove;
|
||||
extern const bcstring be_const_str_ADC_JOY;
|
||||
extern const bcstring be_const_str_SERIAL_6O2;
|
||||
extern const bcstring be_const_str_WEBCAM_XCLK;
|
||||
extern const bcstring be_const_str__end_transmission;
|
||||
extern const bcstring be_const_str_has;
|
||||
extern const bcstring be_const_str_wire_scan;
|
||||
extern const bcstring be_const_str_MHZ_TXD;
|
||||
extern const bcstring be_const_str_SERIAL_7E1;
|
||||
extern const bcstring be_const_str_range;
|
||||
extern const bcstring be_const_str_time_reached;
|
||||
extern const bcstring be_const_str_KEY1_PD;
|
||||
extern const bcstring be_const_str_MAX31855CS;
|
||||
extern const bcstring be_const_str_SSPI_CS;
|
||||
extern const bcstring be_const_str_content_flush;
|
||||
extern const bcstring be_const_str_PROJECTOR_CTRL_RX;
|
||||
extern const bcstring be_const_str__settings_ptr;
|
||||
extern const bcstring be_const_str_ILI9341_CS;
|
||||
extern const bcstring be_const_str_WE517_RX;
|
||||
extern const bcstring be_const_str_setitem;
|
||||
extern const bcstring be_const_str_DDSU666_TX;
|
||||
extern const bcstring be_const_str_TUYA_RX;
|
||||
extern const bcstring be_const_str_scan;
|
||||
extern const bcstring be_const_str_;
|
||||
extern const bcstring be_const_str__request_from;
|
||||
extern const bcstring be_const_str_find_op;
|
||||
extern const bcstring be_const_str_has_arg;
|
||||
extern const bcstring be_const_str_dot_w;
|
||||
extern const bcstring be_const_str_PMS5003_TX;
|
||||
extern const bcstring be_const_str_read13;
|
||||
extern const bcstring be_const_str_EC_C25519;
|
||||
extern const bcstring be_const_str_SBR_RX;
|
||||
extern const bcstring be_const_str_ZEROCROSS;
|
||||
extern const bcstring be_const_str_calldepth;
|
||||
extern const bcstring be_const_str_codedump;
|
||||
extern const bcstring be_const_str_gc;
|
||||
extern const bcstring be_const_str_SERIAL_6N2;
|
||||
extern const bcstring be_const_str_reset;
|
||||
extern const bcstring be_const_str_deinit;
|
||||
extern const bcstring be_const_str_ARIRFSEL;
|
||||
extern const bcstring be_const_str_IEM3000_RX;
|
||||
extern const bcstring be_const_str_tob64;
|
||||
extern const bcstring be_const_str_PZEM016_RX;
|
||||
extern const bcstring be_const_str_SERIAL_8E1;
|
||||
extern const bcstring be_const_str_fromb64;
|
||||
extern const bcstring be_const_str_members;
|
||||
extern const bcstring be_const_str_reduce;
|
||||
extern const bcstring be_const_str_wifi;
|
||||
extern const bcstring be_const_str_KEY1_NP;
|
||||
extern const bcstring be_const_str_content_send_style;
|
||||
extern const bcstring be_const_str_GET;
|
||||
extern const bcstring be_const_str_GPS_RX;
|
||||
extern const bcstring be_const_str_dac_voltage;
|
||||
extern const bcstring be_const_str_sinh;
|
||||
extern const bcstring be_const_str_else;
|
||||
extern const bcstring be_const_str_set_timer;
|
||||
extern const bcstring be_const_str_update;
|
||||
extern const bcstring be_const_str_HRE_DATA;
|
||||
extern const bcstring be_const_str_I2C_Driver;
|
||||
extern const bcstring be_const_str_RDM6300_RX;
|
||||
extern const bcstring be_const_str_MCP39F5_TX;
|
||||
extern const bcstring be_const_str_enabled;
|
||||
extern const bcstring be_const_str_lower;
|
||||
extern const bcstring be_const_str_remove_timer;
|
||||
extern const bcstring be_const_str_wire;
|
||||
extern const bcstring be_const_str_digital_read;
|
||||
extern const bcstring be_const_str_get_switch;
|
||||
extern const bcstring be_const_str_SDM120_RX;
|
||||
extern const bcstring be_const_str_acos;
|
||||
extern const bcstring be_const_str_read_bytes;
|
||||
extern const bcstring be_const_str_BACKLIGHT;
|
||||
extern const bcstring be_const_str_KEY1_INV_PD;
|
||||
extern const bcstring be_const_str_NRG_SEL_INV;
|
||||
extern const bcstring be_const_str_on;
|
||||
extern const bcstring be_const_str_BS814_DAT;
|
||||
extern const bcstring be_const_str_CC1101_GDO0;
|
||||
extern const bcstring be_const_str_HRE_CLOCK;
|
||||
extern const bcstring be_const_str_delay;
|
||||
extern const bcstring be_const_str_log;
|
||||
extern const bcstring be_const_str_ROT1A;
|
||||
extern const bcstring be_const_str_XPT2046_CS;
|
||||
extern const bcstring be_const_str_exp;
|
||||
extern const bcstring be_const_str_SERIAL_5O2;
|
||||
extern const bcstring be_const_str__write;
|
||||
extern const bcstring be_const_str_add;
|
||||
extern const bcstring be_const_str_imax;
|
||||
extern const bcstring be_const_str_DDS2382_RX;
|
||||
extern const bcstring be_const_str_ADC_BUTTON;
|
||||
extern const bcstring be_const_str_NRG_SEL;
|
||||
extern const bcstring be_const_str_SENSOR_END;
|
||||
extern const bcstring be_const_str_set_timeouts;
|
||||
extern const bcstring be_const_str_SDS0X1_TX;
|
||||
extern const bcstring be_const_str_SOLAXX1_RX;
|
||||
extern const bcstring be_const_str_WEBCAM_SIOD;
|
||||
extern const bcstring be_const_str___upper__;
|
||||
extern const bcstring be_const_str_BOILER_OT_TX;
|
||||
extern const bcstring be_const_str__global_def;
|
||||
extern const bcstring be_const_str_ADE7953_IRQ;
|
||||
extern const bcstring be_const_str_if;
|
||||
extern const bcstring be_const_str_static;
|
||||
extern const bcstring be_const_str_WEBCAM_RESET;
|
||||
extern const bcstring be_const_str_publish;
|
||||
extern const bcstring be_const_str_RC522_RST;
|
||||
extern const bcstring be_const_str_pin_used;
|
||||
extern const bcstring be_const_str_MGC3130_XFER;
|
||||
extern const bcstring be_const_str_SM16716_SEL;
|
||||
extern const bcstring be_const_str_TELEINFO_RX;
|
||||
extern const bcstring be_const_str_asin;
|
||||
extern const bcstring be_const_str_get_option;
|
||||
extern const bcstring be_const_str_resolvecmnd;
|
||||
extern const bcstring be_const_str_write8;
|
||||
extern const bcstring be_const_str_CSE7766_TX;
|
||||
extern const bcstring be_const_str_GPS_TX;
|
||||
extern const bcstring be_const_str_search;
|
||||
extern const bcstring be_const_str_TFMINIPLUS_RX;
|
||||
extern const bcstring be_const_str_PROJECTOR_CTRL_TX;
|
||||
extern const bcstring be_const_str_collect;
|
||||
extern const bcstring be_const_str_NONE;
|
||||
extern const bcstring be_const_str_WEBCAM_PSRCS;
|
||||
extern const bcstring be_const_str_attrdump;
|
||||
extern const bcstring be_const_str_continue;
|
||||
extern const bcstring be_const_str_ADC_PH;
|
||||
extern const bcstring be_const_str_RISING;
|
||||
extern const bcstring be_const_str_SERIAL_6N1;
|
||||
extern const bcstring be_const_str_arg_size;
|
||||
extern const bcstring be_const_str_cos;
|
||||
extern const bcstring be_const_str_loop;
|
||||
extern const bcstring be_const_str_exists;
|
||||
extern const bcstring be_const_str_SPI_CS;
|
||||
extern const bcstring be_const_str_srand;
|
||||
extern const bcstring be_const_str_SERIAL_8E2;
|
||||
extern const bcstring be_const_str_A4988_STP;
|
||||
extern const bcstring be_const_str_CC1101_GDO2;
|
||||
extern const bcstring be_const_str_LE01MR_RX;
|
||||
extern const bcstring be_const_str_keys;
|
||||
extern const bcstring be_const_str_BUZZER_INV;
|
||||
extern const bcstring be_const_str_bus;
|
||||
extern const bcstring be_const_str_SM2135_CLK;
|
||||
extern const bcstring be_const_str_sqrt;
|
||||
extern const bcstring be_const_str_DHT11_OUT;
|
||||
extern const bcstring be_const_str_DSB_OUT;
|
||||
extern const bcstring be_const_str_INPUT_PULLUP;
|
||||
extern const bcstring be_const_str_MHZ_RXD;
|
||||
extern const bcstring be_const_str_SDM630_RX;
|
||||
extern const bcstring be_const_str_skip;
|
||||
extern const bcstring be_const_str_ctypes_bytes_dyn;
|
||||
extern const bcstring be_const_str_AudioGenerator;
|
||||
extern const bcstring be_const_str_NEOPOOL_TX;
|
||||
extern const bcstring be_const_str_IBEACON_RX;
|
||||
extern const bcstring be_const_str_RFRECV;
|
||||
extern const bcstring be_const_str_setmember;
|
||||
extern const bcstring be_const_str_NRG_CF1;
|
||||
extern const bcstring be_const_str_pin_mode;
|
||||
extern const bcstring be_const_str_list;
|
||||
extern const bcstring be_const_str_get;
|
||||
extern const bcstring be_const_str_LEDLNK_INV;
|
||||
extern const bcstring be_const_str_close;
|
||||
extern const bcstring be_const_str_read;
|
||||
extern const bcstring be_const_str_ROT1B;
|
||||
extern const bcstring be_const_str_SDM120_TX;
|
||||
extern const bcstring be_const_str_false;
|
||||
extern const bcstring be_const_str_PMS5003_RX;
|
||||
extern const bcstring be_const_str_SERIAL_5O1;
|
||||
extern const bcstring be_const_str_WEBCAM_HREF;
|
||||
extern const bcstring be_const_str__read;
|
||||
extern const bcstring be_const_str_allocated;
|
||||
extern const bcstring be_const_str_read8;
|
||||
extern const bcstring be_const_str_LEDLNK;
|
||||
extern const bcstring be_const_str_exec_tele;
|
||||
extern const bcstring be_const_str_SDM72_TX;
|
||||
extern const bcstring be_const_str_chars_in_string;
|
||||
extern const bcstring be_const_str_ZIGBEE_TX;
|
||||
extern const bcstring be_const_str_member;
|
||||
extern const bcstring be_const_str_settings;
|
||||
extern const bcstring be_const_str_time_dump;
|
||||
extern const bcstring be_const_str_time_str;
|
||||
extern const bcstring be_const_str_CSE7761_TX;
|
||||
extern const bcstring be_const_str___iterator__;
|
||||
extern const bcstring be_const_str_concat;
|
||||
extern const bcstring be_const_str_split;
|
||||
extern const bcstring be_const_str_upper;
|
||||
extern const bcstring be_const_str_TCP_TX;
|
||||
extern const bcstring be_const_str__buffer;
|
||||
extern const bcstring be_const_str_addr;
|
||||
extern const bcstring be_const_str_detect;
|
||||
extern const bcstring be_const_str_TM1638CLK;
|
||||
extern const bcstring be_const_str_import;
|
||||
extern const bcstring be_const_str_DSB;
|
||||
extern const bcstring be_const_str_DYP_RX;
|
||||
extern const bcstring be_const_str_SSPI_SCLK;
|
||||
extern const bcstring be_const_str_atan;
|
||||
extern const bcstring be_const_str_input;
|
||||
extern const bcstring be_const_str_EPAPER29_CS;
|
||||
extern const bcstring be_const_str_HX711_SCK;
|
||||
extern const bcstring be_const_str_nan;
|
||||
extern const bcstring be_const_str_opt_connect;
|
||||
extern const bcstring be_const_str_exec_rules;
|
||||
extern const bcstring be_const_str_tan;
|
||||
extern const bcstring be_const_str_copy;
|
||||
extern const bcstring be_const_str_P9813_DAT;
|
||||
extern const bcstring be_const_str_cmd_res;
|
||||
extern const bcstring be_const_str_AudioGeneratorWAV;
|
||||
extern const bcstring be_const_str_content_button;
|
||||
extern const bcstring be_const_str_name;
|
||||
extern const bcstring be_const_str_SM16716_CLK;
|
||||
extern const bcstring be_const_str_ADC_TEMP;
|
||||
extern const bcstring be_const_str_AS3935;
|
||||
extern const bcstring be_const_str_BS814_CLK;
|
||||
extern const bcstring be_const_str_TXD;
|
||||
extern const bcstring be_const_str_TX2X_TXD_BLACK;
|
||||
extern const bcstring be_const_str_MIEL_HVAC_TX;
|
||||
extern const bcstring be_const_str_TASMOTACLIENT_RST;
|
||||
extern const bcstring be_const_str_I2C_SDA;
|
||||
extern const bcstring be_const_str_SM16716_DAT;
|
||||
extern const bcstring be_const_str_get_string;
|
||||
extern const bcstring be_const_str_elif;
|
||||
extern const bcstring be_const_str_KEY1_INV;
|
||||
extern const bcstring be_const_str_write_bytes;
|
||||
extern const bcstring be_const_str_HJL_CF;
|
||||
extern const bcstring be_const_str_SSD1331_CS;
|
||||
extern const bcstring be_const_str_MAX31855CLK;
|
||||
extern const bcstring be_const_str_DHT11;
|
||||
extern const bcstring be_const_str_HM10_TX;
|
||||
extern const bcstring be_const_str_global;
|
||||
extern const bcstring be_const_str_hex;
|
||||
extern const bcstring be_const_str_yield;
|
||||
extern const bcstring be_const_str_url_encode;
|
||||
extern const bcstring be_const_str_OUTPUT_LO;
|
||||
extern const bcstring be_const_str_erase;
|
||||
extern const bcstring be_const_str_setbits;
|
||||
extern const bcstring be_const_str_EPAPER42_CS;
|
||||
extern const bcstring be_const_str_NEOPOOL_RX;
|
||||
extern const bcstring be_const_str_i2c_enabled;
|
||||
extern const bcstring be_const_str_SSPI_DC;
|
||||
extern const bcstring be_const_str_isinstance;
|
||||
extern const bcstring be_const_str_end;
|
||||
extern const bcstring be_const_str_INTERRUPT;
|
||||
extern const bcstring be_const_str___lower__;
|
||||
extern const bcstring be_const_str_insert;
|
||||
extern const bcstring be_const_str_TELEINFO_ENABLE;
|
||||
extern const bcstring be_const_str_MCP39F5_RX;
|
||||
extern const bcstring be_const_str_SERIAL_5N1;
|
||||
extern const bcstring be_const_str_TASMOTACLIENT_RXD;
|
||||
extern const bcstring be_const_str_remove_driver;
|
||||
extern const bcstring be_const_str_HRXL_RX;
|
||||
extern const bcstring be_const_str_AZ_TXD;
|
||||
extern const bcstring be_const_str_asstring;
|
||||
extern const bcstring be_const_str_BUZZER;
|
||||
extern const bcstring be_const_str_WEBCAM_VSYNC;
|
||||
extern const bcstring be_const_str_DDSU666_RX;
|
||||
extern const bcstring be_const_str_TUYA_TX;
|
||||
extern const bcstring be_const_str_AS608_TX;
|
||||
extern const bcstring be_const_str_SERIAL_5E1;
|
||||
extern const bcstring be_const_str_SSD1351_DC;
|
||||
extern const bcstring be_const_str_HLW_CF;
|
||||
extern const bcstring be_const_str_REL1_INV;
|
||||
extern const bcstring be_const_str_RXD;
|
||||
extern const bcstring be_const_str_SERIAL_6E2;
|
||||
extern const bcstring be_const_str_ctypes_bytes;
|
||||
extern const bcstring be_const_str_try_rule;
|
||||
extern const bcstring be_const_str_PN532_TXD;
|
||||
extern const bcstring be_const_str_PWM1;
|
||||
extern const bcstring be_const_str_TM1637DIO;
|
||||
extern const bcstring be_const_str_eth;
|
||||
extern const bcstring be_const_str_ADC_BUTTON_INV;
|
||||
extern const bcstring be_const_str_arg;
|
||||
extern const bcstring be_const_str_rtc;
|
||||
extern const bcstring be_const_str_TCP_RX;
|
||||
extern const bcstring be_const_str_ceil;
|
||||
extern const bcstring be_const_str_isrunning;
|
||||
extern const bcstring be_const_str_def;
|
||||
extern const bcstring be_const_str_ETH_PHY_MDIO;
|
||||
extern const bcstring be_const_str_fromptr;
|
||||
extern const bcstring be_const_str_DHT22;
|
||||
extern const bcstring be_const_str_IRSEND;
|
||||
extern const bcstring be_const_str_VL53L0X_XSHUT1;
|
||||
extern const bcstring be_const_str_depower;
|
||||
extern const bcstring be_const_str_SERIAL_5E2;
|
||||
extern const bcstring be_const_str_WEBCAM_PWDN;
|
||||
extern const bcstring be_const_str_LMT01;
|
||||
extern const bcstring be_const_str_ROT1A_NP;
|
||||
extern const bcstring be_const_str_SERIAL_6E1;
|
||||
extern const bcstring be_const_str_SPI_CLK;
|
||||
extern const bcstring be_const_str_SSD1351_CS;
|
||||
extern const bcstring be_const_str_set;
|
||||
extern const bcstring be_const_str_MGC3130_RESET;
|
||||
extern const bcstring be_const_str_ETH_PHY_MDC;
|
||||
extern const bcstring be_const_str_HIGH;
|
||||
extern const bcstring be_const_str__drivers;
|
||||
extern const bcstring be_const_str_AudioOutput;
|
||||
extern const bcstring be_const_str_reverse_gamma10;
|
||||
extern const bcstring be_const_str_reverse;
|
||||
extern const bcstring be_const_str_EPD_DATA;
|
||||
extern const bcstring be_const_str_SAIR_TX;
|
||||
extern const bcstring be_const_str_deg;
|
||||
extern const bcstring be_const_str_INPUT_PULLDOWN;
|
||||
extern const bcstring be_const_str_state;
|
||||
extern const bcstring be_const_str_strftime;
|
||||
extern const bcstring be_const_str_opt_neq;
|
||||
extern const bcstring be_const_str_CNTR1_NP;
|
||||
extern const bcstring be_const_str__timers;
|
||||
extern const bcstring be_const_str_classname;
|
||||
extern const bcstring be_const_str_DEEPSLEEP;
|
||||
extern const bcstring be_const_str_pop;
|
||||
extern const bcstring be_const_str_seti;
|
||||
extern const bcstring be_const_str_AudioGeneratorMP3;
|
||||
extern const bcstring be_const_str_NRF24_CS;
|
||||
extern const bcstring be_const_str_last_modified;
|
||||
extern const bcstring be_const_str_DAC;
|
||||
extern const bcstring be_const_str_MD5;
|
||||
extern const bcstring be_const_str_begin;
|
||||
extern const bcstring be_const_str_gen_cb;
|
||||
extern const bcstring be_const_str_init;
|
||||
extern const bcstring be_const_str_ADC_LIGHT;
|
||||
extern const bcstring be_const_str_HM10_RX;
|
||||
extern const bcstring be_const_str_SOLAXX1_TX;
|
||||
extern const bcstring be_const_str_SSPI_MOSI;
|
||||
extern const bcstring be_const_str_run_deferred;
|
||||
extern const bcstring be_const_str_BOILER_OT_RX;
|
||||
extern const bcstring be_const_str_SR04_TRIG;
|
||||
extern const bcstring be_const_str_TM1637CLK;
|
||||
extern const bcstring be_const_str_map;
|
||||
extern const bcstring be_const_str_opt_add;
|
||||
extern const bcstring be_const_str_CNTR1;
|
||||
extern const bcstring be_const_str_SERIAL_5N2;
|
||||
extern const bcstring be_const_str_arg_name;
|
||||
extern const bcstring be_const_str_check_privileged_access;
|
||||
extern const bcstring be_const_str_as;
|
||||
extern const bcstring be_const_str_PWM1_INV;
|
||||
extern const bcstring be_const_str_classof;
|
||||
extern const bcstring be_const_str_WEBCAM_DATA;
|
||||
extern const bcstring be_const_str_content_stop;
|
||||
extern const bcstring be_const_str_str;
|
||||
extern const bcstring be_const_str_resp_cmnd_failed;
|
||||
extern const bcstring be_const_str_for;
|
||||
extern const bcstring be_const_str_SHELLY_DIMMER_BOOT0;
|
||||
extern const bcstring be_const_str__ptr;
|
||||
extern const bcstring be_const_str_resp_cmnd_error;
|
||||
extern const bcstring be_const_str_OneWire;
|
||||
extern const bcstring be_const_str_HPMA_TX;
|
||||
extern const bcstring be_const_str_P9813_CLK;
|
||||
extern const bcstring be_const_str_open;
|
||||
extern const bcstring be_const_str_remove_cmd;
|
||||
extern const bcstring be_const_str_target_search;
|
||||
extern const bcstring be_const_str_SERIAL_7N2;
|
||||
extern const bcstring be_const_str_stop;
|
||||
extern const bcstring be_const_str_redirect;
|
||||
extern const bcstring be_const_str_resp_cmnd_done;
|
||||
extern const bcstring be_const_str_nil;
|
||||
extern const bcstring be_const_str_AudioFileSource;
|
||||
extern const bcstring be_const_str_toupper;
|
||||
extern const bcstring be_const_str_dot_p2;
|
||||
extern const bcstring be_const_str_DDS2382_TX;
|
||||
extern const bcstring be_const_str_AS608_RX;
|
||||
extern const bcstring be_const_str_cosh;
|
||||
extern const bcstring be_const_str_wire1;
|
||||
extern const bcstring be_const_str_OPTION_A;
|
||||
extern const bcstring be_const_str_SDM630_TX;
|
||||
extern const bcstring be_const_str_set_auth;
|
||||
extern const bcstring be_const_str_ADC_RANGE;
|
||||
extern const bcstring be_const_str_SDS0X1_RX;
|
||||
extern const bcstring be_const_str_ILI9341_DC;
|
||||
extern const bcstring be_const_str_RF_SENSOR;
|
||||
extern const bcstring be_const_str_SWT1_PD;
|
||||
extern const bcstring be_const_str_A4988_MS1;
|
||||
extern const bcstring be_const_str_DI;
|
||||
extern const bcstring be_const_str_CHANGE;
|
||||
extern const bcstring be_const_str_I2S_OUT_DATA;
|
||||
extern const bcstring be_const_str_AZ_RXD;
|
||||
extern const bcstring be_const_str_except;
|
||||
extern const bcstring be_const_str_SERIAL_7N1;
|
||||
extern const bcstring be_const_str_tomap;
|
||||
extern const bcstring be_const_str_digital_write;
|
||||
extern const bcstring be_const_str_public_key;
|
||||
extern const bcstring be_const_str_read24;
|
||||
extern const bcstring be_const_str_atan2;
|
||||
extern const bcstring be_const_str_publish_result;
|
||||
extern const bcstring be_const_str_A4988_DIR;
|
||||
extern const bcstring be_const_str_POST;
|
||||
extern const bcstring be_const_str_SI7021;
|
||||
extern const bcstring be_const_str_TFMINIPLUS_TX;
|
||||
extern const bcstring be_const_str_real;
|
||||
extern const bcstring be_const_str_select;
|
||||
extern const bcstring be_const_str_traceback;
|
||||
extern const bcstring be_const_str_gamma10;
|
||||
extern const bcstring be_const_str_int;
|
||||
extern const bcstring be_const_str_dot_p1;
|
||||
extern const bcstring be_const_str_SWT1_NP;
|
||||
extern const bcstring be_const_str_kv;
|
||||
extern const bcstring be_const_str_sin;
|
||||
extern const bcstring be_const_str_super;
|
||||
extern const bcstring be_const_str_wire2;
|
||||
extern const bcstring be_const_str_SBR_TX;
|
||||
extern const bcstring be_const_str_SDM72_RX;
|
||||
extern const bcstring be_const_str__ccmd;
|
||||
extern const bcstring be_const_str_encrypt;
|
||||
extern const bcstring be_const_str_number;
|
||||
extern const bcstring be_const_str_save;
|
||||
extern const bcstring be_const_str_tanh;
|
||||
extern const bcstring be_const_str_A4988_ENA;
|
||||
extern const bcstring be_const_str_add_header;
|
||||
extern const bcstring be_const_str_item;
|
||||
extern const bcstring be_const_str_tostring;
|
||||
extern const bcstring be_const_str_IEM3000_TX;
|
||||
extern const bcstring be_const_str_gamma8;
|
||||
extern const bcstring be_const_str_millis;
|
||||
extern const bcstring be_const_str_resp_cmnd_str;
|
||||
extern const bcstring be_const_str_top;
|
||||
extern const bcstring be_const_str_counters;
|
||||
extern const bcstring be_const_str_get_light;
|
||||
extern const bcstring be_const_str_I2S_IN_SLCT;
|
||||
extern const bcstring be_const_str_remove_rule;
|
||||
extern const bcstring be_const_str_imin;
|
||||
extern const bcstring be_const_str_issubclass;
|
||||
extern const bcstring be_const_str_set_power;
|
||||
extern const bcstring be_const_str__rules;
|
||||
extern const bcstring be_const_str_web_send;
|
||||
extern const bcstring be_const_str_OUTPUT;
|
||||
extern const bcstring be_const_str_TM1638STB;
|
||||
extern const bcstring be_const_str_content_start;
|
||||
extern const bcstring be_const_str_EXS_ENABLE;
|
||||
extern const bcstring be_const_str_geti;
|
||||
extern const bcstring be_const_str_log10;
|
||||
extern const bcstring be_const_str_RFSEND;
|
||||
extern const bcstring be_const_str_WEBCAM_PSCLK;
|
||||
extern const bcstring be_const_str_CSE7766_RX;
|
||||
extern const bcstring be_const_str_SERIAL_8O2;
|
||||
extern const bcstring be_const_str_format;
|
||||
extern const bcstring be_const_str_push;
|
||||
extern const bcstring be_const_str_IBEACON_TX;
|
||||
extern const bcstring be_const_str_SERIAL_8N1;
|
||||
extern const bcstring be_const_str_web_send_decimal;
|
||||
extern const bcstring be_const_str_ARIRFRCV;
|
||||
extern const bcstring be_const_str_IRRECV;
|
||||
extern const bcstring be_const_str_ROT1B_NP;
|
||||
extern const bcstring be_const_str__global_addr;
|
||||
extern const bcstring be_const_str_exec_cmd;
|
||||
extern const bcstring be_const_str_opt_eq;
|
||||
extern const bcstring be_const_str_PZEM0XX_TX;
|
||||
extern const bcstring be_const_str_abs;
|
||||
extern const bcstring be_const_str_resize;
|
||||
extern const bcstring be_const_str_fromstring;
|
||||
extern const bcstring be_const_str_get_size;
|
||||
extern const bcstring be_const_str_pi;
|
||||
extern const bcstring be_const_str_MAX7219DIN;
|
||||
extern const bcstring be_const_str_TM1638DIO;
|
||||
extern const bcstring be_const_str_I2C_SCL;
|
||||
extern const bcstring be_const_str_OLED_RESET;
|
||||
extern const bcstring be_const_str_PZEM004_RX;
|
||||
extern const bcstring be_const_str_SR04_ECHO;
|
||||
extern const bcstring be_const_str_LED1_INV;
|
||||
extern const bcstring be_const_str_I2S_IN_CLK;
|
||||
extern const bcstring be_const_str_SSPI_MISO;
|
||||
extern const bcstring be_const_str_PULLUP;
|
||||
extern const bcstring be_const_str_SERIAL_8O1;
|
||||
extern const bcstring be_const_str_call;
|
||||
extern const bcstring be_const_str_INPUT;
|
||||
extern const bcstring be_const_str_SERIAL_8N2;
|
||||
extern const bcstring be_const_str_SPI_DC;
|
||||
extern const bcstring be_const_str_SSPI_MAX31865_CS1;
|
||||
extern const bcstring be_const_str_ETH_PHY_POWER;
|
||||
extern const bcstring be_const_str_SPI_MISO;
|
||||
extern const bcstring be_const_str_KEY1;
|
||||
extern const bcstring be_const_str_add_driver;
|
||||
extern const bcstring be_const_str_do;
|
||||
extern const bcstring be_const_str_LOW;
|
||||
extern const bcstring be_const_str_setmember;
|
||||
extern const bcstring be_const_str_OneWire;
|
||||
extern const bcstring be_const_str__get_cb;
|
||||
extern const bcstring be_const_str_assert;
|
||||
extern const bcstring be_const_str_class;
|
||||
extern const bcstring be_const_str_LED1;
|
||||
extern const bcstring be_const_str_scale_uint;
|
||||
extern const bcstring be_const_str_classof;
|
||||
extern const bcstring be_const_str_SERIAL_8O2;
|
||||
extern const bcstring be_const_str___upper__;
|
||||
extern const bcstring be_const_str_gamma10;
|
||||
extern const bcstring be_const_str_copy;
|
||||
extern const bcstring be_const_str_tostring;
|
||||
extern const bcstring be_const_str_dot_p1;
|
||||
extern const bcstring be_const_str_item;
|
||||
extern const bcstring be_const_str_read8;
|
||||
extern const bcstring be_const_str_setbits;
|
||||
extern const bcstring be_const_str_upper;
|
||||
extern const bcstring be_const_str_rad;
|
||||
extern const bcstring be_const_str_web_send;
|
||||
extern const bcstring be_const_str_load;
|
||||
extern const bcstring be_const_str_opt_add;
|
||||
extern const bcstring be_const_str_hex;
|
||||
extern const bcstring be_const_str_read12;
|
||||
extern const bcstring be_const_str_size;
|
||||
extern const bcstring be_const_str_find;
|
||||
extern const bcstring be_const_str__begin_transmission;
|
||||
extern const bcstring be_const_str_decrypt;
|
||||
extern const bcstring be_const_str_KEY1_TC;
|
||||
extern const bcstring be_const_str__cb;
|
||||
extern const bcstring be_const_str_serial;
|
||||
extern const bcstring be_const_str_end;
|
||||
extern const bcstring be_const_str_chars_in_string;
|
||||
extern const bcstring be_const_str_write8;
|
||||
extern const bcstring be_const_str_def;
|
||||
extern const bcstring be_const_str_select;
|
||||
extern const bcstring be_const_str_type;
|
||||
extern const bcstring be_const_str_global;
|
||||
extern const bcstring be_const_str_yield;
|
||||
extern const bcstring be_const_str_opt_eq;
|
||||
extern const bcstring be_const_str_SERIAL_8E1;
|
||||
extern const bcstring be_const_str_rtc;
|
||||
extern const bcstring be_const_str_else;
|
||||
extern const bcstring be_const_str_get_power;
|
||||
extern const bcstring be_const_str_addr;
|
||||
extern const bcstring be_const_str_allocated;
|
||||
extern const bcstring be_const_str_finish;
|
||||
extern const bcstring be_const_str_dot_p;
|
||||
extern const bcstring be_const_str_I2S_OUT_SLCT;
|
||||
extern const bcstring be_const_str_flush;
|
||||
extern const bcstring be_const_str_getbits;
|
||||
extern const bcstring be_const_str_tag;
|
||||
extern const bcstring be_const_str_add;
|
||||
extern const bcstring be_const_str_pin;
|
||||
extern const bcstring be_const_str_set_timeouts;
|
||||
extern const bcstring be_const_str_import;
|
||||
extern const bcstring be_const_str_SERIAL_6N1;
|
||||
extern const bcstring be_const_str_SERIAL_8O1;
|
||||
extern const bcstring be_const_str__settings_ptr;
|
||||
extern const bcstring be_const_str_remove_cmd;
|
||||
extern const bcstring be_const_str___iterator__;
|
||||
extern const bcstring be_const_str_atan2;
|
||||
extern const bcstring be_const_str_ctypes_bytes;
|
||||
extern const bcstring be_const_str_millis;
|
||||
extern const bcstring be_const_str_available;
|
||||
extern const bcstring be_const_str_delay;
|
||||
extern const bcstring be_const_str_imin;
|
||||
extern const bcstring be_const_str_shared_key;
|
||||
extern const bcstring be_const_str_wire;
|
||||
extern const bcstring be_const_str__drivers;
|
||||
extern const bcstring be_const_str_last_modified;
|
||||
extern const bcstring be_const_str_serial;
|
||||
extern const bcstring be_const_str_opt_call;
|
||||
extern const bcstring be_const_str_webclient;
|
||||
extern const bcstring be_const_str_SERIAL_6E2;
|
||||
extern const bcstring be_const_str_ctypes_bytes_dyn;
|
||||
extern const bcstring be_const_str_time_dump;
|
||||
extern const bcstring be_const_str_static;
|
||||
extern const bcstring be_const_str_classname;
|
||||
extern const bcstring be_const_str_isrunning;
|
||||
extern const bcstring be_const_str_top;
|
||||
extern const bcstring be_const_str_remove;
|
||||
extern const bcstring be_const_str_begin;
|
||||
extern const bcstring be_const_str_content_stop;
|
||||
extern const bcstring be_const_str_deg;
|
||||
extern const bcstring be_const_str_gc;
|
||||
extern const bcstring be_const_str_gen_cb;
|
||||
extern const bcstring be_const_str_reset;
|
||||
extern const bcstring be_const_str_clear;
|
||||
extern const bcstring be_const_str_skip;
|
||||
extern const bcstring be_const_str_SERIAL_5E1;
|
||||
extern const bcstring be_const_str_has;
|
||||
extern const bcstring be_const_str_raise;
|
||||
extern const bcstring be_const_str_setitem;
|
||||
extern const bcstring be_const_str_write_bit;
|
||||
extern const bcstring be_const_str_stop;
|
||||
extern const bcstring be_const_str_AES_GCM;
|
||||
extern const bcstring be_const_str_ELECTRIQ_MOODL_TX;
|
||||
extern const bcstring be_const_str_SPI_MOSI;
|
||||
extern const bcstring be_const_str_exec_cmd;
|
||||
extern const bcstring be_const_str_iter;
|
||||
extern const bcstring be_const_str_ceil;
|
||||
extern const bcstring be_const_str_exp;
|
||||
extern const bcstring be_const_str_tob64;
|
||||
extern const bcstring be_const_str_wire_scan;
|
||||
extern const bcstring be_const_str_call;
|
||||
extern const bcstring be_const_str_cmd_res;
|
||||
extern const bcstring be_const_str_opt_connect;
|
||||
extern const bcstring be_const_str_resolvecmnd;
|
||||
extern const bcstring be_const_str_SERIAL_6E1;
|
||||
extern const bcstring be_const_str_try;
|
||||
extern const bcstring be_const_str__cb;
|
||||
extern const bcstring be_const_str_AudioOutput;
|
||||
extern const bcstring be_const_str_check_privileged_access;
|
||||
extern const bcstring be_const_str_SERIAL_6O2;
|
||||
extern const bcstring be_const_str_content_send;
|
||||
extern const bcstring be_const_str_tolower;
|
||||
extern const bcstring be_const_str_detect;
|
||||
extern const bcstring be_const_str_imax;
|
||||
extern const bcstring be_const_str_set_auth;
|
||||
extern const bcstring be_const_str_depower;
|
||||
extern const bcstring be_const_str_read24;
|
||||
extern const bcstring be_const_str_add_header;
|
||||
extern const bcstring be_const_str_kv;
|
||||
extern const bcstring be_const_str_pin_used;
|
||||
extern const bcstring be_const_str_publish_result;
|
||||
extern const bcstring be_const_str_do;
|
||||
extern const bcstring be_const_str_pow;
|
||||
extern const bcstring be_const_str_read_bytes;
|
||||
extern const bcstring be_const_str_SERIAL_5E2;
|
||||
extern const bcstring be_const_str_scale_uint;
|
||||
extern const bcstring be_const_str_get;
|
||||
extern const bcstring be_const_str_remove_timer;
|
||||
extern const bcstring be_const_str_dot_len;
|
||||
extern const bcstring be_const_str_Wire;
|
||||
extern const bcstring be_const_str__begin_transmission;
|
||||
extern const bcstring be_const_str_toupper;
|
||||
extern const bcstring be_const_str_SERIAL_5N2;
|
||||
extern const bcstring be_const_str_arg_size;
|
||||
extern const bcstring be_const_str_AudioFileSource;
|
||||
extern const bcstring be_const_str_I2C_Driver;
|
||||
extern const bcstring be_const_str_decrypt;
|
||||
extern const bcstring be_const_str_digital_write;
|
||||
extern const bcstring be_const_str_input;
|
||||
extern const bcstring be_const_str_char;
|
||||
extern const bcstring be_const_str_floor;
|
||||
extern const bcstring be_const_str_real;
|
||||
extern const bcstring be_const_str_AudioGenerator;
|
||||
extern const bcstring be_const_str__cmd;
|
||||
extern const bcstring be_const_str_enabled;
|
||||
extern const bcstring be_const_str_int;
|
||||
extern const bcstring be_const_str_byte;
|
||||
extern const bcstring be_const_str_resp_cmnd_error;
|
||||
extern const bcstring be_const_str_dot_size;
|
||||
extern const bcstring be_const_str_list;
|
||||
extern const bcstring be_const_str_reset_search;
|
||||
extern const bcstring be_const_str_SERIAL_7N2;
|
||||
extern const bcstring be_const_str_set;
|
||||
extern const bcstring be_const_str_elif;
|
||||
extern const bcstring be_const_str_Tasmota;
|
||||
extern const bcstring be_const_str_get_switch;
|
||||
extern const bcstring be_const_str_read;
|
||||
extern const bcstring be_const_str___lower__;
|
||||
extern const bcstring be_const_str__read;
|
||||
extern const bcstring be_const_str_asin;
|
||||
extern const bcstring be_const_str_POST;
|
||||
extern const bcstring be_const_str_arg;
|
||||
extern const bcstring be_const_str_reduce;
|
||||
extern const bcstring be_const_str_deinit;
|
||||
extern const bcstring be_const_str_save;
|
||||
extern const bcstring be_const_str_SERIAL_8E2;
|
||||
extern const bcstring be_const_str_get_size;
|
||||
extern const bcstring be_const_str_search;
|
||||
extern const bcstring be_const_str_srand;
|
||||
extern const bcstring be_const_str_isnan;
|
||||
extern const bcstring be_const_str_arg_name;
|
||||
extern const bcstring be_const_str_content_flush;
|
||||
extern const bcstring be_const_str_get_light;
|
||||
extern const bcstring be_const_str_sqrt;
|
||||
extern const bcstring be_const_str__end_transmission;
|
||||
extern const bcstring be_const_str_listdir;
|
||||
extern const bcstring be_const_str_log10;
|
||||
extern const bcstring be_const_str_pop;
|
||||
extern const bcstring be_const_str_read32;
|
||||
extern const bcstring be_const_str_for;
|
||||
extern const bcstring be_const_str_exec_tele;
|
||||
extern const bcstring be_const_str_log;
|
||||
extern const bcstring be_const_str_map;
|
||||
extern const bcstring be_const_str_redirect;
|
||||
extern const bcstring be_const_str_format;
|
||||
extern const bcstring be_const_str_pi;
|
||||
extern const bcstring be_const_str_range;
|
||||
extern const bcstring be_const_str_SERIAL_7E2;
|
||||
extern const bcstring be_const_str_count;
|
||||
extern const bcstring be_const_str_update;
|
||||
extern const bcstring be_const_str_SERIAL_7N1;
|
||||
extern const bcstring be_const_str_find_key_i;
|
||||
extern const bcstring be_const_str_content_button;
|
||||
extern const bcstring be_const_str_AudioGeneratorMP3;
|
||||
extern const bcstring be_const_str_AudioGeneratorWAV;
|
||||
extern const bcstring be_const_str__buffer;
|
||||
extern const bcstring be_const_str_remove_driver;
|
||||
extern const bcstring be_const_str_false;
|
||||
extern const bcstring be_const_str_fromptr;
|
||||
extern const bcstring be_const_str_geti;
|
||||
extern const bcstring be_const_str_lower;
|
||||
extern const bcstring be_const_str_nan;
|
||||
extern const bcstring be_const_str_assert;
|
||||
extern const bcstring be_const_str_time_str;
|
||||
extern const bcstring be_const_str_exists;
|
||||
extern const bcstring be_const_str_read13;
|
||||
extern const bcstring be_const_str_set_power;
|
||||
extern const bcstring be_const_str_seti;
|
||||
extern const bcstring be_const_str_toptr;
|
||||
extern const bcstring be_const_str_acos;
|
||||
extern const bcstring be_const_str_find_op;
|
||||
extern const bcstring be_const_str_isinstance;
|
||||
extern const bcstring be_const_str_cb_dispatch;
|
||||
extern const bcstring be_const_str_SERIAL_5O2;
|
||||
extern const bcstring be_const_str_bytes;
|
||||
extern const bcstring be_const_str_public_key;
|
||||
extern const bcstring be_const_str_continue;
|
||||
extern const bcstring be_const_str_;
|
||||
extern const bcstring be_const_str__available;
|
||||
extern const bcstring be_const_str__def;
|
||||
extern const bcstring be_const_str_i2c_enabled;
|
||||
extern const bcstring be_const_str_reverse;
|
||||
extern const bcstring be_const_str_true;
|
||||
extern const bcstring be_const_str_dac_voltage;
|
||||
extern const bcstring be_const_str_name;
|
||||
extern const bcstring be_const_str_reverse_gamma10;
|
||||
extern const bcstring be_const_str_add_rule;
|
||||
extern const bcstring be_const_str_dump;
|
||||
extern const bcstring be_const_str_AudioOutputI2S;
|
||||
extern const bcstring be_const_str_attrdump;
|
||||
extern const bcstring be_const_str_fromstring;
|
||||
extern const bcstring be_const_str_publish;
|
||||
extern const bcstring be_const_str_wifi;
|
||||
extern const bcstring be_const_str__write;
|
||||
extern const bcstring be_const_str_resp_cmnd;
|
||||
extern const bcstring be_const_str_tomap;
|
||||
extern const bcstring be_const_str_content_start;
|
||||
extern const bcstring be_const_str_traceback;
|
||||
extern const bcstring be_const_str_as;
|
||||
extern const bcstring be_const_str_memory;
|
||||
extern const bcstring be_const_str_pin_mode;
|
||||
extern const bcstring be_const_str_EC_C25519;
|
||||
extern const bcstring be_const_str_str;
|
||||
extern const bcstring be_const_str_tanh;
|
||||
extern const bcstring be_const_str_write_bytes;
|
||||
extern const bcstring be_const_str_except;
|
||||
extern const bcstring be_const_str_get_option;
|
||||
extern const bcstring be_const_str_dot_w;
|
||||
extern const bcstring be_const_str_SERIAL_7O1;
|
||||
extern const bcstring be_const_str_SERIAL_8N1;
|
||||
extern const bcstring be_const_str_init;
|
||||
extern const bcstring be_const_str__timers;
|
||||
extern const bcstring be_const_str_super;
|
||||
extern const bcstring be_const_str_GET;
|
||||
extern const bcstring be_const_str_fromb64;
|
||||
extern const bcstring be_const_str_break;
|
||||
extern const bcstring be_const_str__global_def;
|
||||
extern const bcstring be_const_str_bus;
|
||||
extern const bcstring be_const_str_find;
|
||||
extern const bcstring be_const_str_resp_cmnd_failed;
|
||||
extern const bcstring be_const_str_SERIAL_6N2;
|
||||
extern const bcstring be_const_str__request_from;
|
||||
extern const bcstring be_const_str_cos;
|
||||
extern const bcstring be_const_str_cosh;
|
||||
extern const bcstring be_const_str_set_useragent;
|
||||
extern const bcstring be_const_str_size;
|
||||
extern const bcstring be_const_str_web_send_decimal;
|
||||
extern const bcstring be_const_str_write;
|
||||
extern const bcstring be_const_str_module;
|
||||
extern const bcstring be_const_str_try_rule;
|
||||
extern const bcstring be_const_str_var;
|
||||
extern const bcstring be_const_str_content_send_style;
|
||||
extern const bcstring be_const_str_sinh;
|
||||
extern const bcstring be_const_str_return;
|
||||
extern const bcstring be_const_str_asstring;
|
||||
extern const bcstring be_const_str_digital_read;
|
||||
extern const bcstring be_const_str_has_arg;
|
||||
extern const bcstring be_const_str_number;
|
||||
extern const bcstring be_const_str_remove_rule;
|
||||
extern const bcstring be_const_str_get_string;
|
||||
extern const bcstring be_const_str_resize;
|
||||
extern const bcstring be_const_str_encrypt;
|
||||
extern const bcstring be_const_str_opt_neq;
|
||||
extern const bcstring be_const_str_add_driver;
|
||||
extern const bcstring be_const_str_close;
|
||||
extern const bcstring be_const_str_member;
|
||||
extern const bcstring be_const_str_response_append;
|
||||
extern const bcstring be_const_str_split;
|
||||
extern const bcstring be_const_str_strftime;
|
||||
extern const bcstring be_const_str_exec_rules;
|
||||
extern const bcstring be_const_str_AudioFileSourceFS;
|
||||
extern const bcstring be_const_str__ccmd;
|
||||
extern const bcstring be_const_str_set_timer;
|
||||
extern const bcstring be_const_str_time_reached;
|
||||
extern const bcstring be_const_str_SERIAL_7O2;
|
||||
extern const bcstring be_const_str_SERIAL_8N2;
|
||||
extern const bcstring be_const_str_if;
|
||||
extern const bcstring be_const_str__ptr;
|
||||
extern const bcstring be_const_str_insert;
|
||||
extern const bcstring be_const_str_print;
|
||||
extern const bcstring be_const_str_I2S_OUT_CLK;
|
||||
extern const bcstring be_const_str_run_deferred;
|
||||
extern const bcstring be_const_str_scan;
|
||||
extern const bcstring be_const_str_settings;
|
||||
extern const bcstring be_const_str_arch;
|
||||
extern const bcstring be_const_str_open;
|
||||
extern const bcstring be_const_str_cmd;
|
||||
extern const bcstring be_const_str_loop;
|
||||
extern const bcstring be_const_str_wire1;
|
||||
extern const bcstring be_const_str_nil;
|
||||
extern const bcstring be_const_str_SERIAL_7E1;
|
||||
extern const bcstring be_const_str_keys;
|
||||
extern const bcstring be_const_str_sin;
|
||||
extern const bcstring be_const_str_calldepth;
|
||||
extern const bcstring be_const_str_while;
|
||||
extern const bcstring be_const_str_counters;
|
||||
extern const bcstring be_const_str_members;
|
||||
extern const bcstring be_const_str_on;
|
||||
extern const bcstring be_const_str__rules;
|
||||
extern const bcstring be_const_str_collect;
|
||||
extern const bcstring be_const_str_url_encode;
|
||||
extern const bcstring be_const_str_codedump;
|
||||
extern const bcstring be_const_str_dot_p2;
|
||||
extern const bcstring be_const_str_MD5;
|
||||
extern const bcstring be_const_str__settings_def;
|
||||
extern const bcstring be_const_str_erase;
|
||||
extern const bcstring be_const_str_gamma8;
|
||||
extern const bcstring be_const_str_rand;
|
||||
extern const bcstring be_const_str_resp_cmnd_str;
|
||||
extern const bcstring be_const_str_state;
|
||||
extern const bcstring be_const_str_SERIAL_6O1;
|
||||
extern const bcstring be_const_str_contains;
|
||||
extern const bcstring be_const_str_set_light;
|
||||
extern const bcstring be_const_str_setrange;
|
||||
extern const bcstring be_const_str_tan;
|
||||
extern const bcstring be_const_str_target_search;
|
||||
extern const bcstring be_const_str_abs;
|
||||
extern const bcstring be_const_str_resp_cmnd_done;
|
||||
extern const bcstring be_const_str_eth;
|
||||
extern const bcstring be_const_str_SERIAL_5O1;
|
||||
extern const bcstring be_const_str_concat;
|
||||
extern const bcstring be_const_str_flush;
|
||||
extern const bcstring be_const_str_get_free_heap;
|
||||
extern const bcstring be_const_str_push;
|
||||
extern const bcstring be_const_str_compile;
|
||||
extern const bcstring be_const_str_wire2;
|
||||
extern const bcstring be_const_str_add_cmd;
|
||||
extern const bcstring be_const_str_atan;
|
||||
extern const bcstring be_const_str_event;
|
||||
extern const bcstring be_const_str_issubclass;
|
||||
extern const bcstring be_const_str_write_file;
|
||||
extern const bcstring be_const_str_class;
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -1,85 +1,86 @@
|
||||
#include "be_constobj.h"
|
||||
|
||||
static be_define_const_map_slots(be_class_tasmota_map) {
|
||||
{ be_const_key(set_light, -1), be_const_closure(set_light_closure) },
|
||||
{ be_const_key(gc, -1), be_const_closure(gc_closure) },
|
||||
{ be_const_key(remove_cmd, -1), be_const_closure(remove_cmd_closure) },
|
||||
{ be_const_key(set_timer, 42), be_const_closure(set_timer_closure) },
|
||||
{ be_const_key(_settings_ptr, -1), be_const_comptr(&Settings) },
|
||||
{ be_const_key(set_power, -1), be_const_func(l_setpower) },
|
||||
{ be_const_key(remove_driver, -1), be_const_closure(remove_driver_closure) },
|
||||
{ be_const_key(try_rule, -1), be_const_closure(try_rule_closure) },
|
||||
{ be_const_key(find_op, 58), be_const_closure(find_op_closure) },
|
||||
{ be_const_key(resp_cmnd_str, -1), be_const_func(l_respCmndStr) },
|
||||
{ be_const_key(find_key_i, -1), be_const_closure(find_key_i_closure) },
|
||||
{ be_const_key(_cb, 3), be_const_var(0) },
|
||||
{ be_const_key(web_send, -1), be_const_func(l_webSend) },
|
||||
{ be_const_key(log, 1), be_const_func(l_logInfo) },
|
||||
{ be_const_key(get_switch, 50), be_const_func(l_getswitch) },
|
||||
{ be_const_key(_ccmd, 19), be_const_var(1) },
|
||||
{ be_const_key(eth, -1), be_const_func(l_eth) },
|
||||
{ be_const_key(_settings_def, -1), be_const_comptr(&be_tasmota_settings_struct) },
|
||||
{ be_const_key(init, 39), be_const_closure(init_closure) },
|
||||
{ be_const_key(strftime, -1), be_const_func(l_strftime) },
|
||||
{ be_const_key(kv, -1), be_const_closure(kv_closure) },
|
||||
{ be_const_key(resp_cmnd_done, -1), be_const_func(l_respCmndDone) },
|
||||
{ be_const_key(cmd_res, 67), be_const_var(2) },
|
||||
{ be_const_key(wire1, 43), be_const_var(3) },
|
||||
{ be_const_key(get_light, -1), be_const_closure(get_light_closure) },
|
||||
{ be_const_key(resp_cmnd_error, 62), be_const_func(l_respCmndError) },
|
||||
{ be_const_key(publish_result, 9), be_const_func(l_publish_result) },
|
||||
{ be_const_key(gen_cb, -1), be_const_closure(gen_cb_closure) },
|
||||
{ be_const_key(yield, -1), be_const_func(l_yield) },
|
||||
{ be_const_key(add_rule, -1), be_const_closure(add_rule_closure) },
|
||||
{ be_const_key(settings, -1), be_const_var(4) },
|
||||
{ be_const_key(chars_in_string, -1), be_const_closure(chars_in_string_closure) },
|
||||
{ be_const_key(resp_cmnd, 31), be_const_func(l_respCmnd) },
|
||||
{ be_const_key(exec_tele, 68), be_const_closure(exec_tele_closure) },
|
||||
{ be_const_key(exec_rules, 51), be_const_closure(exec_rules_closure) },
|
||||
{ be_const_key(load, -1), be_const_closure(load_closure) },
|
||||
{ be_const_key(remove_rule, 22), be_const_closure(remove_rule_closure) },
|
||||
{ be_const_key(_rules, 18), be_const_var(5) },
|
||||
{ be_const_key(publish, -1), be_const_func(l_publish) },
|
||||
{ be_const_key(get_option, 15), be_const_func(l_getoption) },
|
||||
{ be_const_key(global, -1), be_const_var(6) },
|
||||
{ be_const_key(add_driver, 33), be_const_closure(add_driver_closure) },
|
||||
{ be_const_key(cmd, -1), be_const_closure(cmd_closure) },
|
||||
{ be_const_key(settings, 70), be_const_var(0) },
|
||||
{ be_const_key(set_light, -1), be_const_closure(set_light_closure) },
|
||||
{ be_const_key(gc, 35), be_const_closure(gc_closure) },
|
||||
{ be_const_key(add_cmd, -1), be_const_closure(add_cmd_closure) },
|
||||
{ be_const_key(run_deferred, -1), be_const_closure(run_deferred_closure) },
|
||||
{ be_const_key(get_free_heap, -1), be_const_func(l_getFreeHeap) },
|
||||
{ be_const_key(wifi, -1), be_const_func(l_wifi) },
|
||||
{ be_const_key(time_dump, -1), be_const_func(l_time_dump) },
|
||||
{ be_const_key(rtc, 24), be_const_func(l_rtc) },
|
||||
{ be_const_key(cb_dispatch, -1), be_const_closure(cb_dispatch_closure) },
|
||||
{ be_const_key(_get_cb, -1), be_const_func(l_get_cb) },
|
||||
{ be_const_key(resp_cmnd_failed, 72), be_const_func(l_respCmndFailed) },
|
||||
{ be_const_key(wire_scan, -1), be_const_closure(wire_scan_closure) },
|
||||
{ be_const_key(exec_cmd, -1), be_const_closure(exec_cmd_closure) },
|
||||
{ be_const_key(_cmd, 46), be_const_func(l_cmd) },
|
||||
{ be_const_key(remove_timer, -1), be_const_closure(remove_timer_closure) },
|
||||
{ be_const_key(time_str, 34), be_const_closure(time_str_closure) },
|
||||
{ be_const_key(response_append, -1), be_const_func(l_respAppend) },
|
||||
{ be_const_key(web_send_decimal, 60), be_const_func(l_webSendDecimal) },
|
||||
{ be_const_key(_drivers, 71), be_const_var(7) },
|
||||
{ be_const_key(try_rule, -1), be_const_closure(try_rule_closure) },
|
||||
{ be_const_key(publish, 20), be_const_func(l_publish) },
|
||||
{ be_const_key(_settings_ptr, 28), be_const_comptr(&Settings) },
|
||||
{ be_const_key(exec_tele, 36), be_const_closure(exec_tele_closure) },
|
||||
{ be_const_key(delay, -1), be_const_func(l_delay) },
|
||||
{ be_const_key(_drivers, -1), be_const_var(1) },
|
||||
{ be_const_key(find_key_i, -1), be_const_closure(find_key_i_closure) },
|
||||
{ be_const_key(resp_cmnd_failed, -1), be_const_func(l_respCmndFailed) },
|
||||
{ be_const_key(wire2, 64), be_const_var(2) },
|
||||
{ be_const_key(gen_cb, 56), be_const_closure(gen_cb_closure) },
|
||||
{ be_const_key(resp_cmnd_str, -1), be_const_func(l_respCmndStr) },
|
||||
{ be_const_key(_timers, 25), be_const_var(3) },
|
||||
{ be_const_key(kv, -1), be_const_closure(kv_closure) },
|
||||
{ be_const_key(set_power, -1), be_const_func(l_setpower) },
|
||||
{ be_const_key(cmd, 38), be_const_closure(cmd_closure) },
|
||||
{ be_const_key(global, -1), be_const_var(4) },
|
||||
{ be_const_key(response_append, -1), be_const_func(l_respAppend) },
|
||||
{ be_const_key(_get_cb, -1), be_const_func(l_get_cb) },
|
||||
{ be_const_key(time_reached, -1), be_const_func(l_timereached) },
|
||||
{ be_const_key(wifi, 19), be_const_func(l_wifi) },
|
||||
{ be_const_key(rtc, -1), be_const_func(l_rtc) },
|
||||
{ be_const_key(i2c_enabled, 8), be_const_func(l_i2cenabled) },
|
||||
{ be_const_key(publish_result, 34), be_const_func(l_publish_result) },
|
||||
{ be_const_key(_settings_def, -1), be_const_comptr(&be_tasmota_settings_struct) },
|
||||
{ be_const_key(yield, 6), be_const_func(l_yield) },
|
||||
{ be_const_key(init, -1), be_const_closure(init_closure) },
|
||||
{ be_const_key(eth, -1), be_const_func(l_eth) },
|
||||
{ be_const_key(get_free_heap, -1), be_const_func(l_getFreeHeap) },
|
||||
{ be_const_key(get_option, -1), be_const_func(l_getoption) },
|
||||
{ be_const_key(get_power, -1), be_const_func(l_getpower) },
|
||||
{ be_const_key(run_deferred, -1), be_const_closure(run_deferred_closure) },
|
||||
{ be_const_key(get_light, 11), be_const_closure(get_light_closure) },
|
||||
{ be_const_key(cmd_res, -1), be_const_var(5) },
|
||||
{ be_const_key(event, -1), be_const_closure(event_closure) },
|
||||
{ be_const_key(load, -1), be_const_closure(load_closure) },
|
||||
{ be_const_key(remove_timer, -1), be_const_closure(remove_timer_closure) },
|
||||
{ be_const_key(wire_scan, -1), be_const_closure(wire_scan_closure) },
|
||||
{ be_const_key(_cb, 50), be_const_var(6) },
|
||||
{ be_const_key(remove_driver, 67), be_const_closure(remove_driver_closure) },
|
||||
{ be_const_key(wire1, 61), be_const_var(7) },
|
||||
{ be_const_key(memory, -1), be_const_func(l_memory) },
|
||||
{ be_const_key(_global_addr, -1), be_const_comptr(&TasmotaGlobal) },
|
||||
{ be_const_key(time_dump, -1), be_const_func(l_time_dump) },
|
||||
{ be_const_key(_ccmd, -1), be_const_var(8) },
|
||||
{ be_const_key(exec_cmd, 39), be_const_closure(exec_cmd_closure) },
|
||||
{ be_const_key(exec_rules, 68), be_const_closure(exec_rules_closure) },
|
||||
{ be_const_key(resp_cmnd, 14), be_const_func(l_respCmnd) },
|
||||
{ be_const_key(remove_cmd, -1), be_const_closure(remove_cmd_closure) },
|
||||
{ be_const_key(remove_rule, 69), be_const_closure(remove_rule_closure) },
|
||||
{ be_const_key(web_send_decimal, -1), be_const_func(l_webSendDecimal) },
|
||||
{ be_const_key(_rules, 41), be_const_var(9) },
|
||||
{ be_const_key(strftime, 59), be_const_func(l_strftime) },
|
||||
{ be_const_key(chars_in_string, -1), be_const_closure(chars_in_string_closure) },
|
||||
{ be_const_key(set_timer, -1), be_const_closure(set_timer_closure) },
|
||||
{ be_const_key(_global_def, -1), be_const_comptr(&be_tasmota_global_struct) },
|
||||
{ be_const_key(resolvecmnd, -1), be_const_func(l_resolveCmnd) },
|
||||
{ be_const_key(_timers, -1), be_const_var(8) },
|
||||
{ be_const_key(event, 7), be_const_closure(event_closure) },
|
||||
{ be_const_key(wire2, -1), be_const_var(9) },
|
||||
{ be_const_key(scale_uint, -1), be_const_func(l_scaleuint) },
|
||||
{ be_const_key(get_power, 73), be_const_func(l_getpower) },
|
||||
{ be_const_key(millis, -1), be_const_func(l_millis) },
|
||||
{ be_const_key(save, 44), be_const_func(l_save) },
|
||||
{ be_const_key(_global_addr, -1), be_const_comptr(&TasmotaGlobal) },
|
||||
{ be_const_key(memory, -1), be_const_func(l_memory) },
|
||||
{ be_const_key(i2c_enabled, -1), be_const_func(l_i2cenabled) },
|
||||
{ be_const_key(time_str, -1), be_const_closure(time_str_closure) },
|
||||
{ be_const_key(millis, 48), be_const_func(l_millis) },
|
||||
{ be_const_key(resp_cmnd_error, -1), be_const_func(l_respCmndError) },
|
||||
{ be_const_key(arch, -1), be_const_func(l_arch) },
|
||||
{ be_const_key(log, -1), be_const_func(l_logInfo) },
|
||||
{ be_const_key(add_rule, -1), be_const_closure(add_rule_closure) },
|
||||
{ be_const_key(_cmd, 17), be_const_func(l_cmd) },
|
||||
{ be_const_key(get_switch, -1), be_const_func(l_getswitch) },
|
||||
{ be_const_key(find_op, -1), be_const_closure(find_op_closure) },
|
||||
{ be_const_key(add_driver, 3), be_const_closure(add_driver_closure) },
|
||||
{ be_const_key(save, 65), be_const_func(l_save) },
|
||||
{ be_const_key(web_send, -1), be_const_func(l_webSend) },
|
||||
{ be_const_key(cb_dispatch, -1), be_const_closure(cb_dispatch_closure) },
|
||||
};
|
||||
|
||||
static be_define_const_map(
|
||||
be_class_tasmota_map,
|
||||
74
|
||||
75
|
||||
);
|
||||
|
||||
BE_EXPORT_VARIABLE be_define_const_class(
|
||||
|
@ -1,26 +1,27 @@
|
||||
#include "be_constobj.h"
|
||||
|
||||
static be_define_const_map_slots(be_class_webclient_map) {
|
||||
{ be_const_key(url_encode, 3), be_const_func(wc_urlencode) },
|
||||
{ be_const_key(POST, -1), be_const_func(wc_POST) },
|
||||
{ be_const_key(dot_p, -1), be_const_var(0) },
|
||||
{ be_const_key(begin, 5), be_const_func(wc_begin) },
|
||||
{ be_const_key(set_useragent, 2), be_const_func(wc_set_useragent) },
|
||||
{ be_const_key(set_auth, 12), be_const_func(wc_set_auth) },
|
||||
{ be_const_key(close, -1), be_const_func(wc_close) },
|
||||
{ be_const_key(add_header, 9), be_const_func(wc_addheader) },
|
||||
{ be_const_key(get_size, -1), be_const_func(wc_getsize) },
|
||||
{ be_const_key(get_string, 5), be_const_func(wc_getstring) },
|
||||
{ be_const_key(dot_w, 11), be_const_var(0) },
|
||||
{ be_const_key(dot_p, 13), be_const_var(1) },
|
||||
{ be_const_key(add_header, 10), be_const_func(wc_addheader) },
|
||||
{ be_const_key(url_encode, -1), be_const_func(wc_urlencode) },
|
||||
{ be_const_key(POST, -1), be_const_func(wc_POST) },
|
||||
{ be_const_key(GET, 6), be_const_func(wc_GET) },
|
||||
{ be_const_key(deinit, -1), be_const_func(wc_deinit) },
|
||||
{ be_const_key(get_size, -1), be_const_func(wc_getsize) },
|
||||
{ be_const_key(set_timeouts, -1), be_const_func(wc_set_timeouts) },
|
||||
{ be_const_key(GET, 13), be_const_func(wc_GET) },
|
||||
{ be_const_key(init, -1), be_const_func(wc_init) },
|
||||
{ be_const_key(dot_w, -1), be_const_var(1) },
|
||||
{ be_const_key(get_string, 11), be_const_func(wc_getstring) },
|
||||
{ be_const_key(set_auth, -1), be_const_func(wc_set_auth) },
|
||||
{ be_const_key(set_useragent, -1), be_const_func(wc_set_useragent) },
|
||||
{ be_const_key(init, 0), be_const_func(wc_init) },
|
||||
{ be_const_key(begin, -1), be_const_func(wc_begin) },
|
||||
{ be_const_key(write_file, -1), be_const_func(wc_writefile) },
|
||||
};
|
||||
|
||||
static be_define_const_map(
|
||||
be_class_webclient_map,
|
||||
15
|
||||
16
|
||||
);
|
||||
|
||||
BE_EXPORT_VARIABLE be_define_const_class(
|
||||
|
@ -1,281 +1,18 @@
|
||||
#include "be_constobj.h"
|
||||
|
||||
static be_define_const_map_slots(m_libgpio_map) {
|
||||
{ be_const_key(SENSOR_END, 167), be_const_int(250) },
|
||||
{ be_const_key(DHT11_OUT, -1), be_const_int(40) },
|
||||
{ be_const_key(HM10_TX, 199), be_const_int(139) },
|
||||
{ be_const_key(DHT22, 6), be_const_int(38) },
|
||||
{ be_const_key(ARIRFRCV, 226), be_const_int(98) },
|
||||
{ be_const_key(WEBCAM_HREF, 183), be_const_int(161) },
|
||||
{ be_const_key(SM16716_CLK, 168), be_const_int(91) },
|
||||
{ be_const_key(ZIGBEE_RST, 264), be_const_int(181) },
|
||||
{ be_const_key(KEY1_INV_NP, 223), be_const_int(4) },
|
||||
{ be_const_key(KEY1_TC, 81), be_const_int(169) },
|
||||
{ be_const_key(PROJECTOR_CTRL_RX, -1), be_const_int(225) },
|
||||
{ be_const_key(TFMINIPLUS_RX, -1), be_const_int(235) },
|
||||
{ be_const_key(SSD1331_CS, -1), be_const_int(208) },
|
||||
{ be_const_key(MP3_DFR562, 162), be_const_int(67) },
|
||||
{ be_const_key(WEBCAM_VSYNC, 140), be_const_int(160) },
|
||||
{ be_const_key(CNTR1, 246), be_const_int(11) },
|
||||
{ be_const_key(ROT1B_NP, -1), be_const_int(212) },
|
||||
{ be_const_key(ELECTRIQ_MOODL_TX, -1), be_const_int(145) },
|
||||
{ be_const_key(TASMOTACLIENT_RXD, -1), be_const_int(131) },
|
||||
{ be_const_key(NONE, -1), be_const_int(0) },
|
||||
{ be_const_key(RF_SENSOR, -1), be_const_int(75) },
|
||||
{ be_const_key(MAX31855CS, -1), be_const_int(78) },
|
||||
{ be_const_key(SPI_MOSI, 233), be_const_int(22) },
|
||||
{ be_const_key(I2S_OUT_DATA, -1), be_const_int(243) },
|
||||
{ be_const_key(HPMA_TX, 108), be_const_int(135) },
|
||||
{ be_const_key(TASMOTACLIENT_RST_INV, 156), be_const_int(133) },
|
||||
{ be_const_key(IEM3000_RX, -1), be_const_int(180) },
|
||||
{ be_const_key(BS814_DAT, 196), be_const_int(215) },
|
||||
{ be_const_key(OUTPUT_LO, -1), be_const_int(121) },
|
||||
{ be_const_key(SSD1351_CS, 236), be_const_int(204) },
|
||||
{ be_const_key(TM1637DIO, -1), be_const_int(223) },
|
||||
{ be_const_key(INTERRUPT, 240), be_const_int(249) },
|
||||
{ be_const_key(PN532_RXD, 195), be_const_int(90) },
|
||||
{ be_const_key(SM2135_CLK, -1), be_const_int(126) },
|
||||
{ be_const_key(DI, -1), be_const_int(94) },
|
||||
{ be_const_key(TM1638CLK, 87), be_const_int(64) },
|
||||
{ be_const_key(DSB_OUT, 65), be_const_int(42) },
|
||||
{ be_const_key(I2S_OUT_SLCT, -1), be_const_int(245) },
|
||||
{ be_const_key(RDM6300_RX, -1), be_const_int(113) },
|
||||
{ be_const_key(TUYA_RX, 59), be_const_int(72) },
|
||||
{ be_const_key(WIEGAND_D1, -1), be_const_int(217) },
|
||||
{ be_const_key(EPAPER42_CS, 133), be_const_int(203) },
|
||||
{ be_const_key(INPUT_PULLDOWN, -1), be_const_int(9) },
|
||||
{ be_const_key(A4988_DIR, 75), be_const_int(116) },
|
||||
{ be_const_key(NEOPOOL_RX, -1), be_const_int(219) },
|
||||
{ be_const_key(PZEM016_RX, 36), be_const_int(48) },
|
||||
{ be_const_key(digital_write, 225), be_const_func(gp_digital_write) },
|
||||
{ be_const_key(NRG_CF1, -1), be_const_int(83) },
|
||||
{ be_const_key(FTC532, -1), be_const_int(195) },
|
||||
{ be_const_key(DDS2382_TX, -1), be_const_int(122) },
|
||||
{ be_const_key(WEBCAM_RESET, 230), be_const_int(155) },
|
||||
{ be_const_key(TELEINFO_ENABLE, 42), be_const_int(177) },
|
||||
{ be_const_key(IRRECV, 89), be_const_int(34) },
|
||||
{ be_const_key(SDM120_RX, 148), be_const_int(61) },
|
||||
{ be_const_key(PMS5003_TX, -1), be_const_int(52) },
|
||||
{ be_const_key(CC1101_GDO2, -1), be_const_int(143) },
|
||||
{ be_const_key(HPMA_RX, 238), be_const_int(134) },
|
||||
{ be_const_key(MAX7219CS, -1), be_const_int(233) },
|
||||
{ be_const_key(CSE7766_RX, 46), be_const_int(97) },
|
||||
{ be_const_key(RISING, 103), be_const_int(1) },
|
||||
{ be_const_key(SPI_MISO, -1), be_const_int(21) },
|
||||
{ be_const_key(RFRECV, -1), be_const_int(36) },
|
||||
{ be_const_key(SHELLY_DIMMER_RST_INV, 228), be_const_int(190) },
|
||||
{ be_const_key(TASMOTACLIENT_RST, -1), be_const_int(132) },
|
||||
{ be_const_key(PULLDOWN, 189), be_const_int(8) },
|
||||
{ be_const_key(SSPI_CS, -1), be_const_int(29) },
|
||||
{ be_const_key(TUYA_TX, -1), be_const_int(71) },
|
||||
{ be_const_key(LED1_INV, 0), be_const_int(10) },
|
||||
{ be_const_key(digital_read, -1), be_const_func(gp_digital_read) },
|
||||
{ be_const_key(CSE7766_TX, 215), be_const_int(96) },
|
||||
{ be_const_key(DCKI, -1), be_const_int(95) },
|
||||
{ be_const_key(ILI9341_CS, -1), be_const_int(199) },
|
||||
{ be_const_key(pin_used, -1), be_const_func(gp_pin_used) },
|
||||
{ be_const_key(ADC_RANGE, 237), be_const_int(152) },
|
||||
{ be_const_key(PZEM0XX_TX, 31), be_const_int(46) },
|
||||
{ be_const_key(ROT1A_NP, -1), be_const_int(211) },
|
||||
{ be_const_key(ROT1A, 202), be_const_int(102) },
|
||||
{ be_const_key(HALLEFFECT, -1), be_const_int(237) },
|
||||
{ be_const_key(OPEN_DRAIN, -1), be_const_int(16) },
|
||||
{ be_const_key(TM1638DIO, 220), be_const_int(65) },
|
||||
{ be_const_key(IEM3000_TX, -1), be_const_int(179) },
|
||||
{ be_const_key(MAX7219DIN, 118), be_const_int(232) },
|
||||
{ be_const_key(A4988_ENA, -1), be_const_int(118) },
|
||||
{ be_const_key(MHZ_TXD, 23), be_const_int(44) },
|
||||
{ be_const_key(WEBCAM_PWDN, -1), be_const_int(154) },
|
||||
{ be_const_key(SDS0X1_RX, -1), be_const_int(55) },
|
||||
{ be_const_key(SPI_CS, -1), be_const_int(24) },
|
||||
{ be_const_key(BS814_CLK, -1), be_const_int(214) },
|
||||
{ be_const_key(CSE7761_RX, -1), be_const_int(229) },
|
||||
{ be_const_key(ADC_JOY, -1), be_const_int(104) },
|
||||
{ be_const_key(OPTION_A, 171), be_const_int(194) },
|
||||
{ be_const_key(RFSEND, -1), be_const_int(35) },
|
||||
{ be_const_key(HRE_DATA, 135), be_const_int(107) },
|
||||
{ be_const_key(BOILER_OT_TX, 221), be_const_int(167) },
|
||||
{ be_const_key(ETH_PHY_MDC, 30), be_const_int(174) },
|
||||
{ be_const_key(LED1, 11), be_const_int(9) },
|
||||
{ be_const_key(DDSU666_RX, 64), be_const_int(125) },
|
||||
{ be_const_key(MAX31855CLK, -1), be_const_int(79) },
|
||||
{ be_const_key(RA8876_CS, -1), be_const_int(205) },
|
||||
{ be_const_key(AZ_TXD, -1), be_const_int(76) },
|
||||
{ be_const_key(SBR_TX, -1), be_const_int(56) },
|
||||
{ be_const_key(REL1_INV, 212), be_const_int(8) },
|
||||
{ be_const_key(CC1101_GDO0, -1), be_const_int(142) },
|
||||
{ be_const_key(AZ_RXD, 149), be_const_int(77) },
|
||||
{ be_const_key(EPAPER29_CS, 229), be_const_int(202) },
|
||||
{ be_const_key(P9813_DAT, 177), be_const_int(193) },
|
||||
{ be_const_key(PWM1, -1), be_const_int(13) },
|
||||
{ be_const_key(INPUT, -1), be_const_int(239) },
|
||||
{ be_const_key(PN532_TXD, -1), be_const_int(89) },
|
||||
{ be_const_key(I2S_IN_DATA, -1), be_const_int(246) },
|
||||
{ be_const_key(SOLAXX1_TX, -1), be_const_int(109) },
|
||||
{ be_const_key(LEDLNK_INV, 208), be_const_int(18) },
|
||||
{ be_const_key(ADC_LIGHT, -1), be_const_int(149) },
|
||||
{ be_const_key(SDS0X1_TX, 92), be_const_int(54) },
|
||||
{ be_const_key(ADC_PH, 1), be_const_int(213) },
|
||||
{ be_const_key(WEBCAM_XCLK, 267), be_const_int(156) },
|
||||
{ be_const_key(ADC_BUTTON_INV, -1), be_const_int(151) },
|
||||
{ be_const_key(IBEACON_TX, 13), be_const_int(114) },
|
||||
{ be_const_key(SWT1_NP, -1), be_const_int(6) },
|
||||
{ be_const_key(SDCARD_CS, 62), be_const_int(210) },
|
||||
{ be_const_key(KEY1_PD, -1), be_const_int(240) },
|
||||
{ be_const_key(BUZZER, 69), be_const_int(15) },
|
||||
{ be_const_key(SM2135_DAT, -1), be_const_int(127) },
|
||||
{ be_const_key(CNTR1_NP, -1), be_const_int(12) },
|
||||
{ be_const_key(NRF24_CS, 49), be_const_int(197) },
|
||||
{ be_const_key(DYP_RX, -1), be_const_int(182) },
|
||||
{ be_const_key(IRSEND, -1), be_const_int(33) },
|
||||
{ be_const_key(WEBCAM_SIOC, 258), be_const_int(158) },
|
||||
{ be_const_key(MAX7219CLK, 56), be_const_int(231) },
|
||||
{ be_const_key(WIEGAND_D0, 165), be_const_int(216) },
|
||||
{ be_const_key(ZIGBEE_RX, -1), be_const_int(112) },
|
||||
{ be_const_key(CHANGE, 33), be_const_int(4) },
|
||||
{ be_const_key(AS608_RX, -1), be_const_int(188) },
|
||||
{ be_const_key(TCP_RX, -1), be_const_int(172) },
|
||||
{ be_const_key(PZEM017_RX, -1), be_const_int(49) },
|
||||
{ be_const_key(NRF24_DC, -1), be_const_int(198) },
|
||||
{ be_const_key(BACKLIGHT, 35), be_const_int(31) },
|
||||
{ be_const_key(SSPI_MOSI, -1), be_const_int(27) },
|
||||
{ be_const_key(MAX31855DO, -1), be_const_int(80) },
|
||||
{ be_const_key(LE01MR_RX, -1), be_const_int(140) },
|
||||
{ be_const_key(I2S_IN_SLCT, -1), be_const_int(248) },
|
||||
{ be_const_key(ETH_PHY_POWER, -1), be_const_int(173) },
|
||||
{ be_const_key(ADE7953_IRQ, 29), be_const_int(108) },
|
||||
{ be_const_key(SSPI_MISO, -1), be_const_int(26) },
|
||||
{ be_const_key(WINDMETER_SPEED, 79), be_const_int(168) },
|
||||
{ be_const_key(IBEACON_RX, -1), be_const_int(115) },
|
||||
{ be_const_key(TX2X_TXD_BLACK, 8), be_const_int(70) },
|
||||
{ be_const_key(TM1637CLK, 102), be_const_int(222) },
|
||||
{ be_const_key(KEY1_INV, -1), be_const_int(3) },
|
||||
{ be_const_key(BOILER_OT_RX, -1), be_const_int(166) },
|
||||
{ be_const_key(DDSU666_TX, -1), be_const_int(124) },
|
||||
{ be_const_key(WEBCAM_DATA, -1), be_const_int(159) },
|
||||
{ be_const_key(DDS2382_RX, -1), be_const_int(123) },
|
||||
{ be_const_key(EXS_ENABLE, 53), be_const_int(129) },
|
||||
{ be_const_key(AS608_TX, -1), be_const_int(187) },
|
||||
{ be_const_key(OLED_RESET, 100), be_const_int(32) },
|
||||
{ be_const_key(AS3935, -1), be_const_int(146) },
|
||||
{ be_const_key(LMT01, -1), be_const_int(178) },
|
||||
{ be_const_key(ADC_INPUT, -1), be_const_int(147) },
|
||||
{ be_const_key(SDM72_TX, 235), be_const_int(220) },
|
||||
{ be_const_key(ADC_TEMP, -1), be_const_int(148) },
|
||||
{ be_const_key(LEDLNK, 7), be_const_int(17) },
|
||||
{ be_const_key(DAC, -1), be_const_int(-1) },
|
||||
{ be_const_key(SAIR_RX, -1), be_const_int(51) },
|
||||
{ be_const_key(SOLAXX1_RX, -1), be_const_int(110) },
|
||||
{ be_const_key(WEBCAM_PCLK, -1), be_const_int(162) },
|
||||
{ be_const_key(KEY1_NP, 14), be_const_int(2) },
|
||||
{ be_const_key(TFMINIPLUS_TX, -1), be_const_int(234) },
|
||||
{ be_const_key(SR04_TRIG, -1), be_const_int(58) },
|
||||
{ be_const_key(A4988_STP, 182), be_const_int(117) },
|
||||
{ be_const_key(TASMOTACLIENT_TXD, -1), be_const_int(130) },
|
||||
{ be_const_key(HX711_DAT, 207), be_const_int(69) },
|
||||
{ be_const_key(HM10_RX, -1), be_const_int(138) },
|
||||
{ be_const_key(ARIRFSEL, 249), be_const_int(99) },
|
||||
{ be_const_key(MIEL_HVAC_TX, 141), be_const_int(183) },
|
||||
{ be_const_key(NRG_SEL, -1), be_const_int(81) },
|
||||
{ be_const_key(DEEPSLEEP, 132), be_const_int(128) },
|
||||
{ be_const_key(CSE7761_TX, -1), be_const_int(228) },
|
||||
{ be_const_key(WS2812, 18), be_const_int(43) },
|
||||
{ be_const_key(WE517_RX, 188), be_const_int(186) },
|
||||
{ be_const_key(PROJECTOR_CTRL_TX, -1), be_const_int(224) },
|
||||
{ be_const_key(SI7021, 242), be_const_int(39) },
|
||||
{ be_const_key(SM16716_SEL, -1), be_const_int(93) },
|
||||
{ be_const_key(KEY1_INV_PD, -1), be_const_int(241) },
|
||||
{ be_const_key(SPI_CLK, -1), be_const_int(23) },
|
||||
{ be_const_key(ZEROCROSS, -1), be_const_int(236) },
|
||||
{ be_const_key(OUTPUT_OPEN_DRAIN, -1), be_const_int(18) },
|
||||
{ be_const_key(REL1, -1), be_const_int(7) },
|
||||
{ be_const_key(NRG_SEL_INV, -1), be_const_int(82) },
|
||||
{ be_const_key(RC522_CS, -1), be_const_int(196) },
|
||||
{ be_const_key(ADC_BUTTON, -1), be_const_int(150) },
|
||||
{ be_const_key(SAIR_TX, -1), be_const_int(50) },
|
||||
{ be_const_key(OUTPUT_HI, 105), be_const_int(120) },
|
||||
{ be_const_key(LE01MR_TX, -1), be_const_int(141) },
|
||||
{ be_const_key(ILI9341_DC, 22), be_const_int(200) },
|
||||
{ be_const_key(SR04_ECHO, 263), be_const_int(59) },
|
||||
{ be_const_key(HJL_CF, 241), be_const_int(85) },
|
||||
{ be_const_key(I2S_OUT_CLK, -1), be_const_int(244) },
|
||||
{ be_const_key(MIEL_HVAC_RX, 12), be_const_int(184) },
|
||||
{ be_const_key(GPS_RX, 247), be_const_int(136) },
|
||||
{ be_const_key(pin_mode, -1), be_const_func(gp_pin_mode) },
|
||||
{ be_const_key(P9813_CLK, -1), be_const_int(192) },
|
||||
{ be_const_key(ZIGBEE_TX, 262), be_const_int(111) },
|
||||
{ be_const_key(dac_voltage, -1), be_const_func(gp_dac_voltage) },
|
||||
{ be_const_key(INPUT_PULLUP, -1), be_const_int(5) },
|
||||
{ be_const_key(SDM120_TX, -1), be_const_int(60) },
|
||||
{ be_const_key(HRXL_RX, -1), be_const_int(144) },
|
||||
{ be_const_key(pin, -1), be_const_func(gp_pin) },
|
||||
{ be_const_key(HRE_CLOCK, -1), be_const_int(106) },
|
||||
{ be_const_key(DHT11, -1), be_const_int(37) },
|
||||
{ be_const_key(PWM1_INV, 109), be_const_int(14) },
|
||||
{ be_const_key(A4988_MS1, 94), be_const_int(119) },
|
||||
{ be_const_key(SBR_RX, -1), be_const_int(57) },
|
||||
{ be_const_key(SWT1_PD, -1), be_const_int(242) },
|
||||
{ be_const_key(FALLING, 5), be_const_int(2) },
|
||||
{ be_const_key(PULLUP, -1), be_const_int(4) },
|
||||
{ be_const_key(TELEINFO_RX, -1), be_const_int(176) },
|
||||
{ be_const_key(MCP39F5_RX, -1), be_const_int(87) },
|
||||
{ be_const_key(ETH_PHY_MDIO, -1), be_const_int(175) },
|
||||
{ be_const_key(BL0940_RX, -1), be_const_int(170) },
|
||||
{ be_const_key(NEOPOOL_TX, 248), be_const_int(218) },
|
||||
{ be_const_key(VL53L0X_XSHUT1, -1), be_const_int(230) },
|
||||
{ be_const_key(MCP39F5_RST, 203), be_const_int(88) },
|
||||
{ be_const_key(HLW_CF, 231), be_const_int(84) },
|
||||
{ be_const_key(WEBCAM_PSRCS, -1), be_const_int(165) },
|
||||
{ be_const_key(SSD1331_DC, -1), be_const_int(209) },
|
||||
{ be_const_key(ST7789_CS, -1), be_const_int(206) },
|
||||
{ be_const_key(SDM72_RX, 66), be_const_int(221) },
|
||||
{ be_const_key(SSD1351_DC, -1), be_const_int(226) },
|
||||
{ be_const_key(SSPI_SCLK, -1), be_const_int(28) },
|
||||
{ be_const_key(I2S_IN_CLK, -1), be_const_int(247) },
|
||||
{ be_const_key(SM16716_DAT, -1), be_const_int(92) },
|
||||
{ be_const_key(I2C_SDA, -1), be_const_int(20) },
|
||||
{ be_const_key(PZEM004_RX, -1), be_const_int(47) },
|
||||
{ be_const_key(TCP_TX, -1), be_const_int(171) },
|
||||
{ be_const_key(SDM630_RX, -1), be_const_int(63) },
|
||||
{ be_const_key(SWT1, -1), be_const_int(5) },
|
||||
{ be_const_key(ROT1B, -1), be_const_int(103) },
|
||||
{ be_const_key(I2C_SCL, -1), be_const_int(19) },
|
||||
{ be_const_key(RXD, -1), be_const_int(101) },
|
||||
{ be_const_key(DSB, 261), be_const_int(41) },
|
||||
{ be_const_key(MCP39F5_TX, 252), be_const_int(86) },
|
||||
{ be_const_key(HIGH, 266), be_const_int(1) },
|
||||
{ be_const_key(RC522_RST, -1), be_const_int(191) },
|
||||
{ be_const_key(SSPI_DC, -1), be_const_int(30) },
|
||||
{ be_const_key(LOW, -1), be_const_int(0) },
|
||||
{ be_const_key(BUZZER_INV, -1), be_const_int(16) },
|
||||
{ be_const_key(XPT2046_CS, -1), be_const_int(227) },
|
||||
{ be_const_key(WEBCAM_HSD, -1), be_const_int(164) },
|
||||
{ be_const_key(TM1638STB, -1), be_const_int(66) },
|
||||
{ be_const_key(PMS5003_RX, -1), be_const_int(53) },
|
||||
{ be_const_key(SPI_DC, -1), be_const_int(25) },
|
||||
{ be_const_key(MHZ_RXD, -1), be_const_int(45) },
|
||||
{ be_const_key(ILI9488_CS, 119), be_const_int(201) },
|
||||
{ be_const_key(HX711_SCK, 57), be_const_int(68) },
|
||||
{ be_const_key(SDM630_TX, 227), be_const_int(62) },
|
||||
{ be_const_key(SHELLY_DIMMER_BOOT0, -1), be_const_int(189) },
|
||||
{ be_const_key(EPD_DATA, -1), be_const_int(238) },
|
||||
{ be_const_key(WE517_TX, -1), be_const_int(185) },
|
||||
{ be_const_key(TXD, 234), be_const_int(100) },
|
||||
{ be_const_key(OUTPUT, -1), be_const_int(2) },
|
||||
{ be_const_key(SSPI_MAX31865_CS1, -1), be_const_int(105) },
|
||||
{ be_const_key(WEBCAM_PSCLK, -1), be_const_int(163) },
|
||||
{ be_const_key(WEBCAM_SIOD, -1), be_const_int(157) },
|
||||
{ be_const_key(MGC3130_RESET, -1), be_const_int(74) },
|
||||
{ be_const_key(KEY1, -1), be_const_int(1) },
|
||||
{ be_const_key(MGC3130_XFER, -1), be_const_int(73) },
|
||||
{ be_const_key(ST7789_DC, 245), be_const_int(207) },
|
||||
{ be_const_key(GPS_TX, 123), be_const_int(137) },
|
||||
{ be_const_key(ADC_CT_POWER, 58), be_const_int(153) },
|
||||
{ be_const_key(member, -1), be_const_func(gp_member) },
|
||||
{ be_const_key(digital_write, -1), be_const_func(gp_digital_write) },
|
||||
{ be_const_key(pin_mode, 1), be_const_func(gp_pin_mode) },
|
||||
{ be_const_key(pin_used, -1), be_const_func(gp_pin_used) },
|
||||
{ be_const_key(dac_voltage, -1), be_const_func(gp_dac_voltage) },
|
||||
{ be_const_key(digital_read, 3), be_const_func(gp_digital_read) },
|
||||
};
|
||||
|
||||
static be_define_const_map(
|
||||
m_libgpio_map,
|
||||
270
|
||||
7
|
||||
);
|
||||
|
||||
static be_define_const_module(
|
||||
|
@ -1,17 +0,0 @@
|
||||
#include "be_constobj.h"
|
||||
|
||||
static be_define_const_map_slots(m_libpersist_map) {
|
||||
{ be_const_key(init, -1), be_const_closure(_anonymous__closure) },
|
||||
};
|
||||
|
||||
static be_define_const_map(
|
||||
m_libpersist_map,
|
||||
1
|
||||
);
|
||||
|
||||
static be_define_const_module(
|
||||
m_libpersist,
|
||||
"persist"
|
||||
);
|
||||
|
||||
BE_EXPORT_VARIABLE be_define_const_native_module(persist);
|
@ -1,13 +1,15 @@
|
||||
#include "be_constobj.h"
|
||||
|
||||
static be_define_const_map_slots(m_libpath_map) {
|
||||
{ be_const_key(exists, -1), be_const_func(m_path_exists) },
|
||||
{ be_const_key(last_modified, 0), be_const_func(m_path_last_modified) },
|
||||
{ be_const_key(listdir, -1), be_const_func(m_path_listdir) },
|
||||
{ be_const_key(last_modified, 2), be_const_func(m_path_last_modified) },
|
||||
{ be_const_key(exists, 3), be_const_func(m_path_exists) },
|
||||
{ be_const_key(remove, -1), be_const_func(m_path_remove) },
|
||||
};
|
||||
|
||||
static be_define_const_map(
|
||||
m_libpath_map,
|
||||
2
|
||||
4
|
||||
);
|
||||
|
||||
static be_define_const_module(
|
||||
|
@ -217,18 +217,18 @@ static binstance* newobject(bvm *vm, bclass *c)
|
||||
/* Instanciate new instance from stack with argc parameters */
|
||||
/* Pushes the constructor on the stack to be executed if a construtor is found */
|
||||
/* Returns true if a constructor is found */
|
||||
bbool be_class_newobj(bvm *vm, bclass *c, bvalue *reg, int argc, int mode)
|
||||
bbool be_class_newobj(bvm *vm, bclass *c, int32_t pos, int argc, int mode)
|
||||
{
|
||||
bvalue init;
|
||||
size_t pos = reg - vm->reg;
|
||||
binstance *obj = newobject(vm, c); /* create empty object hierarchy from class hierarchy */
|
||||
reg = vm->reg + pos - mode; /* the stack may have changed, mode=1 when class is instanciated from module #104 */
|
||||
var_setinstance(reg, obj);
|
||||
var_setinstance(reg + mode, obj); /* copy to reg and reg+1 if mode==1 */
|
||||
// reg = vm->reg + pos - mode; /* the stack may have changed, mode=1 when class is instanciated from module #104 */
|
||||
var_setinstance(vm->reg + pos, obj);
|
||||
var_setinstance(vm->reg + pos - mode, obj); /* copy to reg and reg+1 if mode==1 */
|
||||
/* find constructor */
|
||||
obj = instance_member(vm, obj, str_literal(vm, "init"), &init);
|
||||
if (obj && var_type(&init) != MT_VARIABLE) {
|
||||
/* copy argv */
|
||||
bvalue * reg;
|
||||
for (reg = vm->reg + pos + 1; argc > 0; --argc) {
|
||||
reg[argc] = reg[argc - 2];
|
||||
}
|
||||
|
@ -58,7 +58,7 @@ void be_prim_method_bind(bvm *vm, bclass *c, bstring *name, bntvfunc f);
|
||||
void be_closure_method_bind(bvm *vm, bclass *c, bstring *name, bclosure *cl);
|
||||
int be_class_closure_count(bclass *c);
|
||||
void be_class_upvalue_init(bvm *vm, bclass *c);
|
||||
bbool be_class_newobj(bvm *vm, bclass *c, bvalue *argv, int argc, int mode);
|
||||
bbool be_class_newobj(bvm *vm, bclass *c, int32_t pos, int argc, int mode);
|
||||
int be_instance_member_simple(bvm *vm, binstance *obj, bstring *name, bvalue *dst);
|
||||
int be_instance_member(bvm *vm, binstance *obj, bstring *name, bvalue *dst);
|
||||
int be_class_member(bvm *vm, bclass *obj, bstring *name, bvalue *dst);
|
||||
|
@ -243,7 +243,9 @@ static void m_solidify_proto(bvm *vm, bproto *pr, const char * func_name, int bu
|
||||
}
|
||||
|
||||
logfmt("%*s(be_nested_const_str(\"%s\", %i, %i)),\n", indent, "", str(pr->name), be_strhash(pr->name), str_len(pr->name));
|
||||
logfmt("%*s(be_nested_const_str(\"%s\", %i, %i)),\n", indent, "", func_source, be_strhash(pr->source), str_len(pr->source));
|
||||
// logfmt("%*s(be_nested_const_str(\"%s\", %i, %i)),\n", indent, "", func_source, be_strhash(pr->source), str_len(pr->source));
|
||||
// hard-code source as "input" for solidified
|
||||
logfmt("%*s((bstring*) &be_const_str_input),\n", indent, "");
|
||||
|
||||
logfmt("%*s( &(const binstruction[%2d]) { /* code */\n", indent, "", pr->codesize);
|
||||
for (int pc = 0; pc < pr->codesize; pc++) {
|
||||
@ -388,7 +390,7 @@ static void m_solidify_module(bvm *vm, bmodule *ml, int builtins)
|
||||
logfmt(" NULL,\n");
|
||||
}
|
||||
logfmt(");\n");
|
||||
logfmt("BE_EXPORT_VARIABLE be_define_const_native_module(%s, NULL);\n", module_name);
|
||||
logfmt("BE_EXPORT_VARIABLE be_define_const_native_module(%s);\n", module_name);
|
||||
logfmt("/********************************************************************/\n");
|
||||
|
||||
}
|
||||
|
@ -142,7 +142,7 @@
|
||||
_vm->cf->status = PRIM_FUNC; \
|
||||
}
|
||||
|
||||
static void prep_closure(bvm *vm, bvalue *reg, int argc, int mode);
|
||||
static void prep_closure(bvm *vm, int32_t pos, int argc, int mode);
|
||||
|
||||
static void attribute_error(bvm *vm, const char *t, bvalue *b, bvalue *c)
|
||||
{
|
||||
@ -1062,10 +1062,11 @@ newframe: /* a new call frame */
|
||||
++var, --argc, mode = 1;
|
||||
goto recall;
|
||||
case BE_CLASS:
|
||||
if (be_class_newobj(vm, var_toobj(var), var, ++argc, mode)) { /* instanciate object and find constructor */
|
||||
if (be_class_newobj(vm, var_toobj(var), var - reg, ++argc, mode)) { /* instanciate object and find constructor */
|
||||
reg = vm->reg + mode; /* constructor found */
|
||||
mode = 0;
|
||||
var = RA() + 1; /* to next register */
|
||||
reg = vm->reg;
|
||||
goto recall; /* call constructor */
|
||||
}
|
||||
break;
|
||||
@ -1101,7 +1102,7 @@ newframe: /* a new call frame */
|
||||
// *(reg + proto->argc - 1) = *(vm->top-2); /* change the vararg argument to now contain the list instance */
|
||||
// vm->top = top_save; /* restore top of stack pointer */
|
||||
// }
|
||||
prep_closure(vm, var, argc, mode);
|
||||
prep_closure(vm, var - reg, argc, mode);
|
||||
reg = vm->reg; /* `reg` has changed, now new base register */
|
||||
goto newframe; /* continue execution of the closure */
|
||||
}
|
||||
@ -1163,14 +1164,13 @@ newframe: /* a new call frame */
|
||||
}
|
||||
}
|
||||
|
||||
static void prep_closure(bvm *vm, bvalue *reg, int argc, int mode)
|
||||
static void prep_closure(bvm *vm, int32_t pos, int argc, int mode)
|
||||
{
|
||||
bvalue *v, *end;
|
||||
bproto *proto = var2cl(reg)->proto;
|
||||
push_closure(vm, reg, proto->nstack, mode);
|
||||
v = vm->reg + argc;
|
||||
bproto *proto = var2cl(vm->reg + pos)->proto;
|
||||
push_closure(vm, vm->reg + pos, proto->nstack, mode);
|
||||
end = vm->reg + proto->argc;
|
||||
for (; v <= end; ++v) {
|
||||
for (v = vm->reg + argc; v <= end; ++v) {
|
||||
var_setnil(v);
|
||||
}
|
||||
if (proto->varg) { /* there are vararg at the last argument, build the list */
|
||||
@ -1189,7 +1189,7 @@ static void prep_closure(bvm *vm, bvalue *reg, int argc, int mode)
|
||||
}
|
||||
}
|
||||
|
||||
static void do_closure(bvm *vm, bvalue *reg, int argc)
|
||||
static void do_closure(bvm *vm, int32_t pos, int argc)
|
||||
{
|
||||
// bvalue *v, *end;
|
||||
// bproto *proto = var2cl(reg)->proto;
|
||||
@ -1199,31 +1199,31 @@ static void do_closure(bvm *vm, bvalue *reg, int argc)
|
||||
// for (; v <= end; ++v) {
|
||||
// var_setnil(v);
|
||||
// }
|
||||
prep_closure(vm, reg, argc, 0);
|
||||
prep_closure(vm, pos, argc, 0);
|
||||
vm_exec(vm);
|
||||
}
|
||||
|
||||
static void do_ntvclos(bvm *vm, bvalue *reg, int argc)
|
||||
static void do_ntvclos(bvm *vm, int32_t pos, int argc)
|
||||
{
|
||||
bntvclos *f = var_toobj(reg);
|
||||
push_native(vm, reg, argc, 0);
|
||||
bntvclos *f = var_toobj(vm->reg + pos);
|
||||
push_native(vm, vm->reg + pos, argc, 0);
|
||||
f->f(vm); /* call C primitive function */
|
||||
ret_native(vm);
|
||||
}
|
||||
|
||||
static void do_ntvfunc(bvm *vm, bvalue *reg, int argc)
|
||||
static void do_ntvfunc(bvm *vm, int32_t pos, int argc)
|
||||
{
|
||||
bntvfunc f = var_tontvfunc(reg);
|
||||
push_native(vm, reg, argc, 0);
|
||||
bntvfunc f = var_tontvfunc(vm->reg + pos);
|
||||
push_native(vm, vm->reg + pos, argc, 0);
|
||||
f(vm); /* call C primitive function */
|
||||
ret_native(vm);
|
||||
}
|
||||
|
||||
static void do_class(bvm *vm, bvalue *reg, int argc)
|
||||
static void do_class(bvm *vm, int32_t pos, int argc)
|
||||
{
|
||||
if (be_class_newobj(vm, var_toobj(reg), reg, ++argc, 0)) {
|
||||
if (be_class_newobj(vm, var_toobj(vm->reg + pos), pos, ++argc, 0)) {
|
||||
be_incrtop(vm);
|
||||
be_dofunc(vm, reg + 1, argc);
|
||||
be_dofunc(vm, vm->reg + pos + 1, argc);
|
||||
be_stackpop(vm, 1);
|
||||
}
|
||||
}
|
||||
@ -1232,11 +1232,12 @@ void be_dofunc(bvm *vm, bvalue *v, int argc)
|
||||
{
|
||||
be_assert(vm->reg <= v && v < vm->stacktop);
|
||||
be_assert(vm->stack <= vm->reg && vm->reg < vm->stacktop);
|
||||
int32_t pos = v - vm->reg;
|
||||
switch (var_type(v)) {
|
||||
case BE_CLASS: do_class(vm, v, argc); break;
|
||||
case BE_CLOSURE: do_closure(vm, v, argc); break;
|
||||
case BE_NTVCLOS: do_ntvclos(vm, v, argc); break;
|
||||
case BE_NTVFUNC: do_ntvfunc(vm, v, argc); break;
|
||||
case BE_CLASS: do_class(vm, pos, argc); break;
|
||||
case BE_CLOSURE: do_closure(vm, pos, argc); break;
|
||||
case BE_NTVCLOS: do_ntvclos(vm, pos, argc); break;
|
||||
case BE_NTVFUNC: do_ntvfunc(vm, pos, argc); break;
|
||||
default: call_error(vm, v);
|
||||
}
|
||||
}
|
||||
|
14
lib/libesp32/Zip-readonly-FS/library.json
Normal file
14
lib/libesp32/Zip-readonly-FS/library.json
Normal file
@ -0,0 +1,14 @@
|
||||
{
|
||||
"name": "Zip-readonly-FS",
|
||||
"version": "1.0",
|
||||
"description": "Simple filesystem to open an uncompressed ZIP file and read-only",
|
||||
"license": "MIT",
|
||||
"homepage": "https://github.com/arendst/Tasmota",
|
||||
"frameworks": "*",
|
||||
"platforms": "*",
|
||||
"authors":
|
||||
{
|
||||
"name": "Stephan Hadinger",
|
||||
"maintainer": true
|
||||
}
|
||||
}
|
463
lib/libesp32/Zip-readonly-FS/src/ZipReadFS.cpp
Normal file
463
lib/libesp32/Zip-readonly-FS/src/ZipReadFS.cpp
Normal file
@ -0,0 +1,463 @@
|
||||
/*
|
||||
ZipReadFS.cpp - FS overlay to read uncompressed ZIP files
|
||||
|
||||
Copyright (C) 2021 Stephan Hadinger
|
||||
|
||||
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 <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifdef ESP32
|
||||
|
||||
#include "ZipReadFS.h"
|
||||
|
||||
extern FS *zip_ufsp;
|
||||
|
||||
#define USE_TASMOTA_LOG
|
||||
|
||||
#ifdef USE_TASMOTA_LOG
|
||||
extern void AddLog(uint32_t loglevel, PGM_P formatP, ...);
|
||||
enum LoggingLevels {LOG_LEVEL_NONE, LOG_LEVEL_ERROR, LOG_LEVEL_INFO, LOG_LEVEL_DEBUG, LOG_LEVEL_DEBUG_MORE};
|
||||
#endif
|
||||
|
||||
/********************************************************************
|
||||
** Convert DOS time to time_t
|
||||
** from: https://opensource.apple.com/source/gcc3/gcc3-1161/fastjar/dostime.c
|
||||
********************************************************************/
|
||||
time_t dos2unixtime(uint32_t dostime)
|
||||
/* Return the Unix time_t value (GMT/UTC time) for the DOS format (local)
|
||||
* time dostime, where dostime is a four byte value (date in most
|
||||
* significant word, time in least significant word), see dostime()
|
||||
* function.
|
||||
*/
|
||||
{
|
||||
struct tm *t; /* argument for mktime() */
|
||||
time_t clock = time(NULL);
|
||||
|
||||
t = localtime(&clock);
|
||||
t->tm_isdst = -1; /* let mktime() determine if DST is in effect */
|
||||
/* Convert DOS time to UNIX time_t format */
|
||||
t->tm_sec = (((int)dostime) << 1) & 0x3e;
|
||||
t->tm_min = (((int)dostime) >> 5) & 0x3f;
|
||||
t->tm_hour = (((int)dostime) >> 11) & 0x1f;
|
||||
t->tm_mday = (int)(dostime >> 16) & 0x1f;
|
||||
t->tm_mon = ((int)(dostime >> 21) & 0x0f) - 1;
|
||||
t->tm_year = ((int)(dostime >> 25) & 0x7f) + 80;
|
||||
|
||||
return mktime(t);
|
||||
}
|
||||
|
||||
/********************************************************************
|
||||
** Zip file parser
|
||||
**
|
||||
********************************************************************/
|
||||
template <typename T> class LList;
|
||||
|
||||
struct ZipHeader {
|
||||
uint16_t padding; // need to offset by 16 bites so that 32 bits below are aligned to 4 bytes boundaries
|
||||
uint16_t signature1;
|
||||
uint16_t signature2;
|
||||
uint16_t version;
|
||||
uint16_t gen_purpose_flags;
|
||||
uint16_t compression;
|
||||
uint16_t last_mod_time;
|
||||
uint16_t last_mod_date;
|
||||
uint32_t crc32;
|
||||
uint32_t size_compressed;
|
||||
uint32_t size_uncompressed;
|
||||
uint16_t filename_size;
|
||||
uint16_t extra_field_size;
|
||||
};
|
||||
|
||||
class ZipEntry {
|
||||
public:
|
||||
ZipEntry() :
|
||||
file_name(), file_start(0), file_len(0), last_mod(0)
|
||||
{};
|
||||
// ZipEntry(const char * fname, uint32_t start, uint32_t len) :
|
||||
// file_name(fname), file_start(start), file_len(len)
|
||||
// {};
|
||||
|
||||
String file_name; // name of the file as used by Berry, with all directories removed
|
||||
uint32_t file_start; // offset in bytes where this file starts in the archive
|
||||
uint32_t file_len; // length in bytes of the file
|
||||
time_t last_mod;
|
||||
};
|
||||
|
||||
class ZipArchive {
|
||||
public:
|
||||
ZipArchive(File * _f) :
|
||||
f(_f), entries()
|
||||
{};
|
||||
~ZipArchive(void) {
|
||||
f->close(); // TODO
|
||||
}
|
||||
|
||||
bool parse(void);
|
||||
|
||||
File * f;
|
||||
LList<ZipEntry> entries;
|
||||
};
|
||||
|
||||
class ZipEntryFileImpl : public FileImpl {
|
||||
public:
|
||||
ZipEntryFileImpl(File * f) : zip(f) { }
|
||||
|
||||
protected:
|
||||
ZipArchive zip;
|
||||
};
|
||||
|
||||
/********************************************************************
|
||||
** Neutral file overlay
|
||||
**
|
||||
********************************************************************/
|
||||
|
||||
class ZipReadFileImpl;
|
||||
typedef std::shared_ptr<FileImpl> ZipReadFileImplPtr;
|
||||
|
||||
class ZipReadFileImpl : public FileImpl {
|
||||
public:
|
||||
ZipReadFileImpl(File f) { _f = f; }
|
||||
virtual ~ZipReadFileImpl() {}
|
||||
size_t write(const uint8_t *buf, size_t size) {
|
||||
return _f.write(buf, size);
|
||||
}
|
||||
size_t read(uint8_t* buf, size_t size) {
|
||||
return _f.read(buf, size);
|
||||
}
|
||||
void flush() {
|
||||
_f.flush();
|
||||
}
|
||||
bool seek(uint32_t pos, SeekMode mode) {
|
||||
return _f.seek(pos, mode);
|
||||
}
|
||||
size_t position() const {
|
||||
return _f.position();
|
||||
}
|
||||
size_t size() const {
|
||||
return _f.size();
|
||||
}
|
||||
void close() {
|
||||
_f.close();
|
||||
}
|
||||
time_t getLastWrite() {
|
||||
return _f.getLastWrite();
|
||||
}
|
||||
const char* path() const {
|
||||
return _f.path();
|
||||
}
|
||||
const char* name() const {
|
||||
return _f.name();
|
||||
}
|
||||
boolean isDirectory(void) {
|
||||
return _f.isDirectory();
|
||||
}
|
||||
FileImplPtr openNextFile(const char* mode) {
|
||||
return nullptr; // TODO
|
||||
}
|
||||
void rewindDirectory(void) {
|
||||
return _f.rewindDirectory();
|
||||
}
|
||||
operator bool() {
|
||||
return (bool) _f;
|
||||
}
|
||||
|
||||
protected:
|
||||
File _f;
|
||||
};
|
||||
|
||||
/********************************************************************
|
||||
** Subfile implementation
|
||||
**
|
||||
** Takes a `File` object of the ZIP archive
|
||||
** First byte in archive and len
|
||||
********************************************************************/
|
||||
|
||||
class ZipItemImpl;
|
||||
typedef std::shared_ptr<ZipItemImpl> ZipItemImplPtr;
|
||||
|
||||
class ZipItemImpl : public FileImpl {
|
||||
public:
|
||||
|
||||
ZipItemImpl(File f, uint32_t first_byte, uint32_t len, time_t last_mod) {
|
||||
_f = f;
|
||||
_first_byte = first_byte;
|
||||
_len = len;
|
||||
_seek = 0;
|
||||
_last_mod = last_mod;
|
||||
}
|
||||
|
||||
virtual ~ZipItemImpl() {}
|
||||
|
||||
size_t write(const uint8_t *buf, size_t size) {
|
||||
return 0; // not accepted
|
||||
}
|
||||
|
||||
size_t read(uint8_t* buf, size_t size) {
|
||||
// AddLog(LOG_LEVEL_DEBUG, "ZIP: read bytes=%i seek=%i len=%i", size, _seek, _len);
|
||||
if (_seek < _len) {
|
||||
if (size + _seek > _len) {
|
||||
size = _len - _seek; // always > 0 because of guarding test
|
||||
}
|
||||
bool bret = _f.seek(_first_byte + _seek, SeekSet);
|
||||
// AddLog(LOG_LEVEL_DEBUG, "ZIP: seek_ret ret=%i zip_seek=%i", bret, _first_byte + _seek);
|
||||
if (bret) {
|
||||
size_t ret = _f.read(buf, size);
|
||||
// AddLog(LOG_LEVEL_DEBUG, "ZIP: read done ret=%i zip_seek=%i", ret, size);
|
||||
_seek += ret;
|
||||
if (_seek > _len) { _seek = _len; }
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
return 0; // abort
|
||||
}
|
||||
|
||||
void flush() {
|
||||
// do nothing
|
||||
}
|
||||
|
||||
bool seek(uint32_t pos, SeekMode mode) {
|
||||
AddLog(LOG_LEVEL_DEBUG, "ZIP: seek pos=%i mode=%i", pos, mode);
|
||||
if (SeekSet == mode) {
|
||||
if (pos <= _len) {
|
||||
_seek = pos;
|
||||
return true;
|
||||
}
|
||||
} else if (SeekCur == mode) {
|
||||
if (_seek + pos <= _len) {
|
||||
_seek += pos;
|
||||
return true;
|
||||
}
|
||||
} else if (SeekEnd == mode) {
|
||||
_seek = _len;
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
size_t position() const {
|
||||
AddLog(LOG_LEVEL_DEBUG, "ZIP: position return=%i", _seek);
|
||||
return _seek;
|
||||
}
|
||||
|
||||
size_t size() const {
|
||||
AddLog(LOG_LEVEL_DEBUG, "ZIP: size return=%i", _len);
|
||||
return _len;
|
||||
}
|
||||
|
||||
void close() {
|
||||
// do nothing
|
||||
}
|
||||
time_t getLastWrite() {
|
||||
return _last_mod;
|
||||
}
|
||||
|
||||
const char* path() const {
|
||||
return _f.path(); // TODO
|
||||
}
|
||||
|
||||
const char* name() const {
|
||||
return _f.name(); // TODO
|
||||
}
|
||||
|
||||
boolean isDirectory(void) {
|
||||
return false; // no directory allowed
|
||||
}
|
||||
|
||||
FileImplPtr openNextFile(const char* mode) {
|
||||
return nullptr; // TODO
|
||||
}
|
||||
|
||||
void rewindDirectory(void) {
|
||||
// ignore
|
||||
}
|
||||
|
||||
operator bool() {
|
||||
return true;
|
||||
}
|
||||
|
||||
protected:
|
||||
File _f;
|
||||
uint32_t _first_byte;
|
||||
uint32_t _len;
|
||||
uint32_t _seek;
|
||||
time_t _last_mod;
|
||||
};
|
||||
|
||||
/********************************************************************
|
||||
** Zip file parser
|
||||
** Implementation
|
||||
********************************************************************/
|
||||
|
||||
// parse the Zip archive to extract all entries
|
||||
// returns true if ok
|
||||
bool ZipArchive::parse(void) {
|
||||
ZipHeader header;
|
||||
f->seek(0); // start of file
|
||||
int32_t offset = 0;
|
||||
const size_t zip_header_size = sizeof(header) - sizeof(header.padding);
|
||||
|
||||
while (1) {
|
||||
f->seek(offset);
|
||||
int32_t bytes_read = f->read(sizeof(header.padding) + (uint8_t*) &header, zip_header_size);
|
||||
if (bytes_read != zip_header_size) {
|
||||
break;
|
||||
}
|
||||
// AddLog(LOG_LEVEL_DEBUG, "ZIG: header version=%i flags=%p compress=%i mod_time=%i mod_date=%i size=%i-%i fnamesize=%i",
|
||||
// header.version, header.gen_purpose_flags, header.compression, header.last_mod_time, header.last_mod_date,
|
||||
// header.size_compressed, header.size_uncompressed, header.filename_size);
|
||||
// Check signature
|
||||
if (header.signature1 != 0x4B50) {
|
||||
AddLog(LOG_LEVEL_INFO, "ZIP: invalid zip signature");
|
||||
return false;
|
||||
}
|
||||
if (header.signature2 != 0x0403) {
|
||||
AddLog(LOG_LEVEL_DEBUG, "ZIP: end of file section");
|
||||
break;
|
||||
}
|
||||
// Check no extra field
|
||||
if (header.gen_purpose_flags != 0x0000) {
|
||||
AddLog(LOG_LEVEL_INFO, "ZIP: invalid general purpose flags 0x%04X", header.gen_purpose_flags);
|
||||
return false;
|
||||
}
|
||||
// Check no compression
|
||||
if (header.compression != 0x0000) {
|
||||
AddLog(LOG_LEVEL_INFO, "ZIP: compressed files unsupported 0x%04X", header.compression);
|
||||
return false;
|
||||
}
|
||||
// Check size is the same for compressed and uncompressed
|
||||
if (header.size_compressed != header.size_uncompressed) {
|
||||
AddLog(LOG_LEVEL_INFO, "ZIP: compressed size differs from uncompressed %i - %i", header.size_compressed, header.size_uncompressed);
|
||||
return false;
|
||||
}
|
||||
// Check file name size
|
||||
if (header.filename_size > 64) {
|
||||
AddLog(LOG_LEVEL_INFO, "ZIP: entry filename size too long %i", header.filename_size);
|
||||
return false;
|
||||
}
|
||||
|
||||
// read full filename
|
||||
char fname[header.filename_size + 1];
|
||||
if (f->read((uint8_t*) &fname[0], header.filename_size) != header.filename_size) {
|
||||
return false;
|
||||
}
|
||||
fname[header.filename_size] = 0; // add NULL termination
|
||||
|
||||
// Remove any directory names, and keep only what's after the last `/``
|
||||
char * fname_suffix;
|
||||
char * saveptr;
|
||||
fname_suffix = strtok_r(&fname[0], "#", &saveptr);
|
||||
char * res = fname_suffix;
|
||||
while (res) {
|
||||
res = strtok_r(nullptr, "#", &saveptr);
|
||||
if (res) { fname_suffix = res; }
|
||||
}
|
||||
offset += zip_header_size + header.filename_size + header.extra_field_size;
|
||||
|
||||
ZipEntry & entry = entries.addToLast();
|
||||
entry.file_name = fname_suffix;
|
||||
entry.file_start = offset;
|
||||
entry.file_len = header.size_uncompressed;
|
||||
entry.last_mod = dos2unixtime((header.last_mod_date << 16) | header.last_mod_time);
|
||||
offset += header.size_uncompressed;
|
||||
|
||||
AddLog(LOG_LEVEL_DEBUG, "ZIP: found file '%s' (%i bytes - offset %i) - next entry %i", &fname[0], header.size_uncompressed, entry.file_start, offset);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
/********************************************************************
|
||||
** Encapsulation of FS and File to piggyback on Arduino
|
||||
**
|
||||
********************************************************************/
|
||||
|
||||
FileImplPtr ZipReadFSImpl::open(const char* path, const char* mode, const bool create) {
|
||||
if (*_fs == nullptr) { return nullptr; }
|
||||
|
||||
if (strchr(path, '#')) {
|
||||
// we don't support any other mode than "r" and no-create
|
||||
if (strcmp(mode, "r") != 0 || create) {
|
||||
AddLog(LOG_LEVEL_INFO, "ZIP: writing to zip is not supported");
|
||||
return ZipReadFileImplPtr(); // return an error
|
||||
}
|
||||
// treat as a ZIP archive
|
||||
char sub_path[strlen(path)+1];
|
||||
strcpy(sub_path, path);
|
||||
|
||||
// extract the suffix
|
||||
char *tok;
|
||||
char *prefix = strtok_r(sub_path, "#", &tok);
|
||||
char *suffix = strtok_r(NULL, "", &tok);
|
||||
AddLog(LOG_LEVEL_DEBUG, "ZIP: prefix=%s suffix=%s", prefix, suffix);
|
||||
// parse ZIP archive
|
||||
File zipfile = (*_fs)->open(prefix, "r", false);
|
||||
if ((bool)zipfile) {
|
||||
// we could read the file
|
||||
ZipArchive zip_archive = ZipArchive(&zipfile);
|
||||
zip_archive.parse();
|
||||
|
||||
for (auto & entry : zip_archive.entries) {
|
||||
if (entry.file_name.equals(suffix)) {
|
||||
// found
|
||||
AddLog(LOG_LEVEL_DEBUG, "ZIP: file '%s' in archive (start=%i - len=%i - last_mod=%i)", suffix, entry.file_start, entry.file_len, entry.last_mod);
|
||||
return ZipItemImplPtr(new ZipItemImpl((*_fs)->open(prefix, "r", false), entry.file_start, entry.file_len, entry.last_mod));
|
||||
}
|
||||
}
|
||||
return ZipReadFileImplPtr(); // return an error
|
||||
} else {
|
||||
AddLog(LOG_LEVEL_INFO, "ZIP: could not open '%s'", prefix);
|
||||
return ZipReadFileImplPtr(); // return an error
|
||||
}
|
||||
} else {
|
||||
// simple file, do nothing
|
||||
return ZipReadFileImplPtr(new ZipReadFileImpl((*_fs)->open(path, mode, create)));
|
||||
}
|
||||
}
|
||||
|
||||
bool ZipReadFSImpl::exists(const char* path) {
|
||||
if (*_fs == nullptr) { return false; }
|
||||
|
||||
if (strchr(path, '#')) {
|
||||
// treat as a ZIP archive
|
||||
char sub_path[strlen(path)+1];
|
||||
strcpy(sub_path, path);
|
||||
|
||||
// extract the suffix
|
||||
char *tok;
|
||||
char *prefix = strtok_r(sub_path, "#", &tok);
|
||||
char *suffix = strtok_r(NULL, "", &tok);
|
||||
// parse ZIP archive
|
||||
File zipfile = (*_fs)->open(prefix, "r", false);
|
||||
if ((bool)zipfile) {
|
||||
// we could read the file
|
||||
ZipArchive zip_archive = ZipArchive(&zipfile);
|
||||
zip_archive.parse();
|
||||
|
||||
for (auto & entry : zip_archive.entries) {
|
||||
if (entry.file_name.equals(suffix)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
} else {
|
||||
// simple file, do nothing
|
||||
return (*_fs)->exists(path);
|
||||
}
|
||||
}
|
||||
|
||||
ZipReadFSImpl::~ZipReadFSImpl() {};
|
||||
|
||||
#endif // ESP32
|
67
lib/libesp32/Zip-readonly-FS/src/ZipReadFS.h
Normal file
67
lib/libesp32/Zip-readonly-FS/src/ZipReadFS.h
Normal file
@ -0,0 +1,67 @@
|
||||
|
||||
#ifndef __ZIP_READ_FS__
|
||||
#define __ZIP_READ_FS__
|
||||
|
||||
#include <Arduino.h>
|
||||
|
||||
#ifdef ESP32
|
||||
|
||||
#include <FS.h>
|
||||
#include <vfs_api.h>
|
||||
#include <LList.h>
|
||||
|
||||
class ZipReadFSImpl;
|
||||
typedef std::shared_ptr<FSImpl> ZipReadFSImplPtr;
|
||||
|
||||
|
||||
class ZipReadFSImpl : public FSImpl {
|
||||
public:
|
||||
|
||||
ZipReadFSImpl(FS **fs) : _fs(fs) {};
|
||||
virtual ~ZipReadFSImpl();
|
||||
|
||||
FileImplPtr open(const char* path, const char* mode, const bool create);
|
||||
|
||||
bool exists(const char* path);
|
||||
|
||||
bool rename(const char* pathFrom, const char* pathTo) {
|
||||
if (*_fs) {
|
||||
return (*_fs)->rename(pathFrom, pathTo);
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
bool remove(const char* path) {
|
||||
if (*_fs) {
|
||||
return (*_fs)->remove(path);
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
bool mkdir(const char *path) {
|
||||
if (*_fs) {
|
||||
return (*_fs)->mkdir(path);
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
bool rmdir(const char *path) {
|
||||
if (*_fs) {
|
||||
return (*_fs)->rmdir(path);
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
void mountpoint(const char *) {
|
||||
};
|
||||
const char * mountpoint() {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
private:
|
||||
FS **_fs;
|
||||
};
|
||||
|
||||
#endif // ESP32
|
||||
|
||||
#endif // __ZIP_READ_FS__
|
@ -35,12 +35,12 @@ extern "C"{
|
||||
#define ESP_MFI_DEBUG_FL "\n"
|
||||
#define CONFIG_ESP_MFI_DEBUG_ENABLE
|
||||
#ifdef CONFIG_ESP_MFI_DEBUG_ENABLE
|
||||
#define ESP_MFI_DEBUG_ENABLE
|
||||
// #define ESP_MFI_DEBUG_ENABLE
|
||||
#endif /* CONFIG_ESP_MFI_DEBUG_ENABLE */
|
||||
|
||||
#define CONFIG_ESP_MFI_ASSERT
|
||||
#ifdef CONFIG_ESP_MFI_ASSERT
|
||||
#define ESP_MFI_ASSERT_ENABLE
|
||||
// #define ESP_MFI_ASSERT_ENABLE
|
||||
#endif /* CONFIG_ESP_MFI_ASSERT */
|
||||
|
||||
#define CONFIG_MFI_DEBUG_LEVEL_INIT 0
|
||||
|
@ -13,68 +13,8 @@
|
||||
// limitations under the License.
|
||||
#pragma once
|
||||
|
||||
#include_next "mbedtls/bignum.h"
|
||||
#include "sdkconfig.h"
|
||||
|
||||
/**
|
||||
* This is a wrapper for the main mbedtls/bignum.h. This wrapper
|
||||
* provides a few additional ESP32-only functions.
|
||||
*
|
||||
* This is because we don't set MBEDTLS_BIGNUM_ALT in the same way we
|
||||
* do for AES, SHA, etc. Because we still use most of the bignum.h
|
||||
* implementation and just replace a few hardware accelerated
|
||||
* functions (see MBEDTLS_MPI_EXP_MOD_ALT & MBEDTLS_MPI_MUL_MPI_ALT in
|
||||
* esp_config.h).
|
||||
*
|
||||
* @note Unlike the other hardware accelerator support functions in esp32/hwcrypto, there is no
|
||||
* generic "hwcrypto/bignum.h" header for using these functions without mbedTLS. The reason for this
|
||||
* is that all of the function implementations depend strongly upon the mbedTLS MPI implementation.
|
||||
*/
|
||||
|
||||
/**
|
||||
* @brief Lock access to RSA Accelerator (MPI/bignum operations)
|
||||
*
|
||||
* RSA Accelerator hardware unit can only be used by one
|
||||
* consumer at a time.
|
||||
*
|
||||
* @note This function is non-recursive (do not call it twice from the
|
||||
* same task.)
|
||||
*
|
||||
* @note You do not need to call this if you are using the mbedTLS bignum.h
|
||||
* API or esp_mpi_xxx functions. This function is only needed if you
|
||||
* want to call ROM RSA functions or access the registers directly.
|
||||
*
|
||||
*/
|
||||
void esp_mpi_acquire_hardware(void);
|
||||
|
||||
/**
|
||||
* @brief Unlock access to RSA Accelerator (MPI/bignum operations)
|
||||
*
|
||||
* Has to be called once for each call to esp_mpi_acquire_hardware().
|
||||
*
|
||||
* @note You do not need to call this if you are using the mbedTLS bignum.h
|
||||
* API or esp_mpi_xxx functions. This function is only needed if you
|
||||
* want to call ROM RSA functions or access the registers directly.
|
||||
*/
|
||||
void esp_mpi_release_hardware(void);
|
||||
|
||||
//#if CONFIG_MBEDTLS_HARDWARE_MPI
|
||||
|
||||
/* @brief MPI modular mupltiplication function
|
||||
*
|
||||
* Calculates Z = (X * Y) mod M using MPI hardware acceleration.
|
||||
*
|
||||
* This is not part of the standard mbedTLS bignum API.
|
||||
*
|
||||
* @note All of X, Y & Z should be less than 4096 bit long or an error is returned.
|
||||
*
|
||||
* @param Z Result bignum, should be pre-initialised with mbedtls_mpi_init().
|
||||
* @param X First multiplication argument.
|
||||
* @param Y Second multiplication argument.
|
||||
* @param M Modulus value for result.
|
||||
*
|
||||
* @return 0 on success, mbedTLS MPI error codes on failure.
|
||||
*/
|
||||
int esp_mpi_mul_mpi_mod(mbedtls_mpi *Z, const mbedtls_mpi *X, const mbedtls_mpi *Y, const mbedtls_mpi *M);
|
||||
|
||||
//#endif // CONFIG_MBEDTLS_HARDWARE_MPI
|
||||
#if CONFIG_IDF_TARGET_ESP32
|
||||
#include "bignum_ESP32.h"
|
||||
#elif CONFIG_IDF_TARGET_ESP32C3
|
||||
#include "bignum_ESP32_C3.h"
|
||||
#endif
|
||||
|
@ -21,6 +21,7 @@
|
||||
*
|
||||
*/
|
||||
|
||||
#if CONFIG_IDF_TARGET_ESP32
|
||||
#if __has_include("esp_idf_version.h")
|
||||
#include "esp_idf_version.h"
|
||||
#if ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL(4, 0, 0)
|
||||
@ -35,6 +36,9 @@
|
||||
#include "bignum_impl.h"
|
||||
#include <sys/param.h>
|
||||
#include <sys/lock.h>
|
||||
#if CONFIG_IDF_TARGET_ESP32C3
|
||||
#include "esp32c3/dport_access.h"
|
||||
#endif
|
||||
|
||||
static _lock_t mpi_lock;
|
||||
|
||||
@ -284,3 +288,4 @@ void esp_mpi_mult_mpi_failover_mod_mult_hw_op(const mbedtls_mpi *X, const mbedtl
|
||||
start_op(RSA_MULT_START_REG);
|
||||
|
||||
}
|
||||
#endif //CONFIG_IDF_TARGET_ESP32
|
82
lib/libesp32_div/ESP32-HomeKit/src/port/bignum_ESP32.h
Normal file
82
lib/libesp32_div/ESP32-HomeKit/src/port/bignum_ESP32.h
Normal file
@ -0,0 +1,82 @@
|
||||
// Copyright 2015-2020 Espressif Systems (Shanghai) PTE LTD
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
#if CONFIG_IDF_TARGET_ESP32
|
||||
#pragma once
|
||||
|
||||
#include_next "mbedtls/bignum.h"
|
||||
#include "sdkconfig.h"
|
||||
|
||||
/**
|
||||
* This is a wrapper for the main mbedtls/bignum.h. This wrapper
|
||||
* provides a few additional ESP32-only functions.
|
||||
*
|
||||
* This is because we don't set MBEDTLS_BIGNUM_ALT in the same way we
|
||||
* do for AES, SHA, etc. Because we still use most of the bignum.h
|
||||
* implementation and just replace a few hardware accelerated
|
||||
* functions (see MBEDTLS_MPI_EXP_MOD_ALT & MBEDTLS_MPI_MUL_MPI_ALT in
|
||||
* esp_config.h).
|
||||
*
|
||||
* @note Unlike the other hardware accelerator support functions in esp32/hwcrypto, there is no
|
||||
* generic "hwcrypto/bignum.h" header for using these functions without mbedTLS. The reason for this
|
||||
* is that all of the function implementations depend strongly upon the mbedTLS MPI implementation.
|
||||
*/
|
||||
|
||||
/**
|
||||
* @brief Lock access to RSA Accelerator (MPI/bignum operations)
|
||||
*
|
||||
* RSA Accelerator hardware unit can only be used by one
|
||||
* consumer at a time.
|
||||
*
|
||||
* @note This function is non-recursive (do not call it twice from the
|
||||
* same task.)
|
||||
*
|
||||
* @note You do not need to call this if you are using the mbedTLS bignum.h
|
||||
* API or esp_mpi_xxx functions. This function is only needed if you
|
||||
* want to call ROM RSA functions or access the registers directly.
|
||||
*
|
||||
*/
|
||||
void esp_mpi_acquire_hardware(void);
|
||||
|
||||
/**
|
||||
* @brief Unlock access to RSA Accelerator (MPI/bignum operations)
|
||||
*
|
||||
* Has to be called once for each call to esp_mpi_acquire_hardware().
|
||||
*
|
||||
* @note You do not need to call this if you are using the mbedTLS bignum.h
|
||||
* API or esp_mpi_xxx functions. This function is only needed if you
|
||||
* want to call ROM RSA functions or access the registers directly.
|
||||
*/
|
||||
void esp_mpi_release_hardware(void);
|
||||
|
||||
//#if CONFIG_MBEDTLS_HARDWARE_MPI
|
||||
|
||||
/* @brief MPI modular mupltiplication function
|
||||
*
|
||||
* Calculates Z = (X * Y) mod M using MPI hardware acceleration.
|
||||
*
|
||||
* This is not part of the standard mbedTLS bignum API.
|
||||
*
|
||||
* @note All of X, Y & Z should be less than 4096 bit long or an error is returned.
|
||||
*
|
||||
* @param Z Result bignum, should be pre-initialised with mbedtls_mpi_init().
|
||||
* @param X First multiplication argument.
|
||||
* @param Y Second multiplication argument.
|
||||
* @param M Modulus value for result.
|
||||
*
|
||||
* @return 0 on success, mbedTLS MPI error codes on failure.
|
||||
*/
|
||||
int esp_mpi_mul_mpi_mod(mbedtls_mpi *Z, const mbedtls_mpi *X, const mbedtls_mpi *Y, const mbedtls_mpi *M);
|
||||
|
||||
//#endif // CONFIG_MBEDTLS_HARDWARE_MPI
|
||||
#endif CONFIG_IDF_TARGET_ESP32
|
108
lib/libesp32_div/ESP32-HomeKit/src/port/bignum_ESP32_C3.c
Normal file
108
lib/libesp32_div/ESP32-HomeKit/src/port/bignum_ESP32_C3.c
Normal file
@ -0,0 +1,108 @@
|
||||
/**
|
||||
* \brief Multi-precision integer library, ESP-IDF hardware accelerated parts
|
||||
*
|
||||
* based on mbedTLS implementation
|
||||
*
|
||||
* Copyright (C) 2006-2015, ARM Limited, All Rights Reserved
|
||||
* Additions Copyright (C) 2016-2020, Espressif Systems (Shanghai) PTE Ltd
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License"); you may
|
||||
* not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*
|
||||
*/
|
||||
|
||||
#if CONFIG_IDF_TARGET_ESP32C3
|
||||
#if __has_include("esp_idf_version.h")
|
||||
#include "esp_idf_version.h"
|
||||
#endif
|
||||
|
||||
#include <sys/param.h>
|
||||
#include "soc/hwcrypto_periph.h"
|
||||
#include "driver/periph_ctrl.h"
|
||||
#include "mbedtls/bignum.h"
|
||||
#include "bignum_impl.h"
|
||||
#include "soc/system_reg.h"
|
||||
#include "soc/periph_defs.h"
|
||||
#include "esp_crypto_lock.h"
|
||||
|
||||
/* Copy mbedTLS MPI bignum 'mpi' to hardware memory block at 'mem_base'.
|
||||
|
||||
If hw_words is higher than the number of words in the bignum then
|
||||
these additional words will be zeroed in the memory buffer.
|
||||
|
||||
*/
|
||||
static inline void mpi_to_mem_block(uint32_t mem_base, const mbedtls_mpi *mpi, size_t num_words)
|
||||
{
|
||||
uint32_t *pbase = (uint32_t *)mem_base;
|
||||
uint32_t copy_words = MIN(num_words, mpi->n);
|
||||
|
||||
/* Copy MPI data to memory block registers */
|
||||
for (int i = 0; i < copy_words; i++) {
|
||||
pbase[i] = mpi->p[i];
|
||||
}
|
||||
|
||||
/* Zero any remaining memory block data */
|
||||
for (int i = copy_words; i < num_words; i++) {
|
||||
pbase[i] = 0;
|
||||
}
|
||||
}
|
||||
|
||||
/* Read mbedTLS MPI bignum back from hardware memory block.
|
||||
|
||||
Reads num_words words from block.
|
||||
|
||||
Bignum 'x' should already be grown to at least num_words by caller (can be done while
|
||||
calculation is in progress, to save some cycles)
|
||||
*/
|
||||
static inline void mem_block_to_mpi(mbedtls_mpi *x, uint32_t mem_base, int num_words)
|
||||
{
|
||||
|
||||
/* Copy data from memory block registers */
|
||||
const size_t REG_WIDTH = sizeof(uint32_t);
|
||||
for (size_t i = 0; i < num_words; i++) {
|
||||
x->p[i] = REG_READ(mem_base + (i * REG_WIDTH));
|
||||
}
|
||||
/* Zero any remaining limbs in the bignum, if the buffer is bigger
|
||||
than num_words */
|
||||
for (size_t i = num_words; i < x->n; i++) {
|
||||
x->p[i] = 0;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/* Begin an RSA operation. op_reg specifies which 'START' register
|
||||
to write to.
|
||||
*/
|
||||
static inline void start_op(uint32_t op_reg)
|
||||
{
|
||||
/* Clear interrupt status */
|
||||
REG_WRITE(RSA_CLEAR_INTERRUPT_REG, 1);
|
||||
|
||||
/* Note: above REG_WRITE includes a memw, so we know any writes
|
||||
to the memory blocks are also complete. */
|
||||
|
||||
REG_WRITE(op_reg, 1);
|
||||
}
|
||||
|
||||
/* Wait for an RSA operation to complete.
|
||||
*/
|
||||
static inline void wait_op_complete(void)
|
||||
{
|
||||
while (REG_READ(RSA_QUERY_INTERRUPT_REG) != 1)
|
||||
{ }
|
||||
|
||||
/* clear the interrupt */
|
||||
REG_WRITE(RSA_CLEAR_INTERRUPT_REG, 1);
|
||||
}
|
||||
|
||||
#endif //CONFIG_IDF_TARGET_ESP32C3
|
87
lib/libesp32_div/ESP32-HomeKit/src/port/bignum_ESP32_C3.h
Normal file
87
lib/libesp32_div/ESP32-HomeKit/src/port/bignum_ESP32_C3.h
Normal file
@ -0,0 +1,87 @@
|
||||
// Copyright 2015-2020 Espressif Systems (Shanghai) PTE LTD
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
#if CONFIG_IDF_TARGET_ESP32C3
|
||||
#pragma once
|
||||
|
||||
#include_next "mbedtls/bignum.h"
|
||||
#include "sdkconfig.h"
|
||||
|
||||
/**
|
||||
* This is a wrapper for the main mbedtls/bignum.h. This wrapper
|
||||
* provides a few additional ESP32-only functions.
|
||||
*
|
||||
* This is because we don't set MBEDTLS_BIGNUM_ALT in the same way we
|
||||
* do for AES, SHA, etc. Because we still use most of the bignum.h
|
||||
* implementation and just replace a few hardware accelerated
|
||||
* functions (see MBEDTLS_MPI_EXP_MOD_ALT & MBEDTLS_MPI_MUL_MPI_ALT in
|
||||
* esp_config.h).
|
||||
*
|
||||
* @note Unlike the other hardware accelerator support functions in esp32/hwcrypto, there is no
|
||||
* generic "hwcrypto/bignum.h" header for using these functions without mbedTLS. The reason for this
|
||||
* is that all of the function implementations depend strongly upon the mbedTLS MPI implementation.
|
||||
*/
|
||||
|
||||
/**
|
||||
* @brief Lock access to RSA Accelerator (MPI/bignum operations)
|
||||
*
|
||||
* RSA Accelerator hardware unit can only be used by one
|
||||
* consumer at a time.
|
||||
*
|
||||
* @note This function is non-recursive (do not call it twice from the
|
||||
* same task.)
|
||||
*
|
||||
* @note You do not need to call this if you are using the mbedTLS bignum.h
|
||||
* API or esp_mpi_xxx functions. This function is only needed if you
|
||||
* want to call ROM RSA functions or access the registers directly.
|
||||
*
|
||||
*/
|
||||
void esp_mpi_acquire_hardware(void);
|
||||
|
||||
/**
|
||||
* @brief Unlock access to RSA Accelerator (MPI/bignum operations)
|
||||
*
|
||||
* Has to be called once for each call to esp_mpi_acquire_hardware().
|
||||
*
|
||||
* @note You do not need to call this if you are using the mbedTLS bignum.h
|
||||
* API or esp_mpi_xxx functions. This function is only needed if you
|
||||
* want to call ROM RSA functions or access the registers directly.
|
||||
*/
|
||||
void esp_mpi_release_hardware(void);
|
||||
|
||||
//#if CONFIG_MBEDTLS_HARDWARE_MPI
|
||||
|
||||
/* @brief MPI modular mupltiplication function
|
||||
*
|
||||
* Calculates Z = (X * Y) mod M using MPI hardware acceleration.
|
||||
*
|
||||
* This is not part of the standard mbedTLS bignum API.
|
||||
*
|
||||
* @note All of X, Y & Z should be less than 4096 bit long or an error is returned.
|
||||
*
|
||||
* @param Z Result bignum, should be pre-initialised with mbedtls_mpi_init().
|
||||
* @param X First multiplication argument.
|
||||
* @param Y Second multiplication argument.
|
||||
* @param M Modulus value for result.
|
||||
*
|
||||
* @return 0 on success, mbedTLS MPI error codes on failure.
|
||||
*/
|
||||
int esp_mpi_mul_mpi_mod(mbedtls_mpi *Z, const mbedtls_mpi *X, const mbedtls_mpi *Y, const mbedtls_mpi *M);
|
||||
|
||||
void esp_mpi_mul_mpi_mod_hw_op(const mbedtls_mpi *X, const mbedtls_mpi *Y, const mbedtls_mpi *M, const mbedtls_mpi *Rinv, mbedtls_mpi_uint Mprime, size_t num_words);
|
||||
static inline void mpi_to_mem_block(uint32_t mem_base, const mbedtls_mpi *mpi, size_t num_words);
|
||||
void esp_mpi_mul_mpi_hw_op(const mbedtls_mpi *X, const mbedtls_mpi *Y, size_t num_words);
|
||||
|
||||
|
||||
//#endif // CONFIG_MBEDTLS_HARDWARE_MPI
|
||||
#endif //CONFIG_IDF_TARGET_ESP32C3
|
@ -10,7 +10,7 @@
|
||||
exponentiation instead.
|
||||
*/
|
||||
|
||||
#define CONFIG_IDF_TARGET_ESP32 1
|
||||
// #define CONFIG_IDF_TARGET_ESP32 1
|
||||
|
||||
#if CONFIG_IDF_TARGET_ESP32
|
||||
#define ESP_MPI_USE_MONT_EXP
|
||||
@ -19,7 +19,7 @@
|
||||
//#define MBEDTLS_MPI_MUL_MPI_ALT
|
||||
#endif
|
||||
|
||||
|
||||
#if CONFIG_IDF_TARGET_ESP32
|
||||
int esp_mpi_exp_mod( mbedtls_mpi *Z, const mbedtls_mpi *X, const mbedtls_mpi *Y, const mbedtls_mpi *M, mbedtls_mpi *_Rinv );
|
||||
|
||||
/**
|
||||
@ -86,7 +86,11 @@ int esp_mont_hw_op(mbedtls_mpi* Z, const mbedtls_mpi* X, const mbedtls_mpi* Y, c
|
||||
*
|
||||
*/
|
||||
void esp_mpi_exp_mpi_mod_hw_op(const mbedtls_mpi *X, const mbedtls_mpi *Y, const mbedtls_mpi *M, const mbedtls_mpi *Rinv, mbedtls_mpi_uint Mprime, size_t hw_words);
|
||||
|
||||
#endif //CONFIG_IDF_TARGET_ESP32
|
||||
#endif //ESP_MPI_USE_MONT_EXP
|
||||
|
||||
#if CONFIG_IDF_TARGET_ESP32C3
|
||||
void esp_mpi_exp_mpi_mod_hw_op(const mbedtls_mpi *X, const mbedtls_mpi *Y, const mbedtls_mpi *M, const mbedtls_mpi *Rinv, mbedtls_mpi_uint Mprime, size_t num_words);
|
||||
#endif //CONFIG_IDF_TARGET_ESP32C3
|
||||
|
||||
#endif
|
||||
|
@ -79,7 +79,7 @@ static inline size_t bits_to_words(size_t bits)
|
||||
/* Return the number of words actually used to represent an mpi
|
||||
number.
|
||||
*/
|
||||
#if defined(MBEDTLS_MPI_EXP_MOD_ALT)
|
||||
#if defined(MBEDTLS_MPI_EXP_MOD_ALT) || defined(CONFIG_IDF_TARGET_ESP32C3)
|
||||
static size_t mpi_words(const mbedtls_mpi *mpi)
|
||||
{
|
||||
for (size_t i = mpi->n; i > 0; i--) {
|
||||
@ -369,6 +369,87 @@ cleanup:
|
||||
|
||||
#endif /* MBEDTLS_MPI_EXP_MOD_ALT */
|
||||
|
||||
#if CONFIG_IDF_TARGET_ESP32C3
|
||||
int esp_mpi_exp_mod( mbedtls_mpi *Z, const mbedtls_mpi *X, const mbedtls_mpi *Y, const mbedtls_mpi *M, mbedtls_mpi *_Rinv )
|
||||
{
|
||||
int ret = 0;
|
||||
size_t x_words = mpi_words(X);
|
||||
size_t y_words = mpi_words(Y);
|
||||
size_t m_words = mpi_words(M);
|
||||
|
||||
|
||||
/* "all numbers must be the same length", so choose longest number
|
||||
as cardinal length of operation...
|
||||
*/
|
||||
size_t num_words = esp_mpi_hardware_words(MAX(m_words, MAX(x_words, y_words)));
|
||||
|
||||
mbedtls_mpi Rinv_new; /* used if _Rinv == NULL */
|
||||
mbedtls_mpi *Rinv; /* points to _Rinv (if not NULL) othwerwise &RR_new */
|
||||
mbedtls_mpi_uint Mprime;
|
||||
|
||||
if (mbedtls_mpi_cmp_int(M, 0) <= 0 || (M->p[0] & 1) == 0) {
|
||||
return MBEDTLS_ERR_MPI_BAD_INPUT_DATA;
|
||||
}
|
||||
|
||||
if (mbedtls_mpi_cmp_int(Y, 0) < 0) {
|
||||
return MBEDTLS_ERR_MPI_BAD_INPUT_DATA;
|
||||
}
|
||||
|
||||
if (mbedtls_mpi_cmp_int(Y, 0) == 0) {
|
||||
return mbedtls_mpi_lset(Z, 1);
|
||||
}
|
||||
|
||||
if (num_words * 32 > SOC_RSA_MAX_BIT_LEN) {
|
||||
return MBEDTLS_ERR_MPI_NOT_ACCEPTABLE;
|
||||
}
|
||||
|
||||
/* Determine RR pointer, either _RR for cached value
|
||||
or local RR_new */
|
||||
if (_Rinv == NULL) {
|
||||
mbedtls_mpi_init(&Rinv_new);
|
||||
Rinv = &Rinv_new;
|
||||
} else {
|
||||
Rinv = _Rinv;
|
||||
}
|
||||
if (Rinv->p == NULL) {
|
||||
MBEDTLS_MPI_CHK(calculate_rinv(Rinv, M, num_words));
|
||||
}
|
||||
|
||||
Mprime = modular_inverse(M);
|
||||
|
||||
// Montgomery exponentiation: Z = X ^ Y mod M (HAC 14.94)
|
||||
#ifdef ESP_MPI_USE_MONT_EXP
|
||||
ret = mpi_montgomery_exp_calc(Z, X, Y, M, Rinv, num_words, Mprime) ;
|
||||
MBEDTLS_MPI_CHK(ret);
|
||||
#else
|
||||
esp_mpi_enable_hardware_hw_op();
|
||||
|
||||
esp_mpi_exp_mpi_mod_hw_op(X, Y, M, Rinv, Mprime, num_words);
|
||||
ret = mbedtls_mpi_grow(Z, m_words);
|
||||
if (ret != 0) {
|
||||
esp_mpi_disable_hardware_hw_op();
|
||||
goto cleanup;
|
||||
}
|
||||
esp_mpi_read_result_hw_op(Z, m_words);
|
||||
esp_mpi_disable_hardware_hw_op();
|
||||
#endif
|
||||
|
||||
// Compensate for negative X
|
||||
if (X->s == -1 && (Y->p[0] & 1) != 0) {
|
||||
Z->s = -1;
|
||||
MBEDTLS_MPI_CHK(mbedtls_mpi_add_mpi(Z, M, Z));
|
||||
} else {
|
||||
Z->s = 1;
|
||||
}
|
||||
|
||||
cleanup:
|
||||
if (_Rinv == NULL) {
|
||||
mbedtls_mpi_free(&Rinv_new);
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
#endif //CONFIG_IDF_TARGET_ESP32C3
|
||||
|
||||
|
||||
|
||||
#if defined(MBEDTLS_MPI_MUL_MPI_ALT) /* MBEDTLS_MPI_MUL_MPI_ALT */
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user