diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index e892e2467..a217911ee 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -7,7 +7,7 @@ - [ ] Only relevant files were touched - [ ] Only one feature/fix was added per PR and the code change compiles without warnings - [ ] The code change is tested and works with Tasmota core ESP8266 V.2.7.4.9 - - [ ] The code change is tested and works with Tasmota core ESP32 V.1.0.7.1 + - [ ] The code change is tested and works with Tasmota core ESP32 V.1.0.7.3 - [ ] I accept the [CLA](https://github.com/arendst/Tasmota/blob/development/CONTRIBUTING.md#contributor-license-agreement-cla). _NOTE: The code change must pass CI tests. **Your PR cannot be merged unless tests pass**_ diff --git a/.github/workflows/CI_github.yml b/.github/workflows/CI_github.yml index c5e37b063..84017f6f4 100644 --- a/.github/workflows/CI_github.yml +++ b/.github/workflows/CI_github.yml @@ -7,7 +7,7 @@ jobs: tasmota: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v1 + - uses: actions/checkout@v2 - name: Set up Python uses: actions/setup-python@v1 - name: Install dependencies @@ -26,7 +26,7 @@ jobs: tasmota-minimal: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v1 + - uses: actions/checkout@v2 - name: Set up Python uses: actions/setup-python@v1 - name: Install dependencies @@ -45,7 +45,7 @@ jobs: tasmota-lite: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v1 + - uses: actions/checkout@v2 - name: Set up Python uses: actions/setup-python@v1 - name: Install dependencies @@ -64,7 +64,7 @@ jobs: tasmota-knx: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v1 + - uses: actions/checkout@v2 - name: Set up Python uses: actions/setup-python@v1 - name: Install dependencies @@ -83,7 +83,7 @@ jobs: tasmota-sensors: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v1 + - uses: actions/checkout@v2 - name: Set up Python uses: actions/setup-python@v1 - name: Install dependencies @@ -102,7 +102,7 @@ jobs: tasmota-display: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v1 + - uses: actions/checkout@v2 - name: Set up Python uses: actions/setup-python@v1 - name: Install dependencies @@ -121,7 +121,7 @@ jobs: tasmota-ir: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v1 + - uses: actions/checkout@v2 - name: Set up Python uses: actions/setup-python@v1 - name: Install dependencies @@ -140,7 +140,7 @@ jobs: tasmota-zbbridge: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v1 + - uses: actions/checkout@v2 - name: Set up Python uses: actions/setup-python@v1 - name: Install dependencies @@ -159,7 +159,7 @@ jobs: tasmota-zigbee: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v1 + - uses: actions/checkout@v2 - name: Set up Python uses: actions/setup-python@v1 - name: Install dependencies @@ -178,7 +178,7 @@ jobs: tasmota-AF: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v1 + - uses: actions/checkout@v2 - name: Set up Python uses: actions/setup-python@v1 - name: Install dependencies @@ -197,7 +197,7 @@ jobs: tasmota-BG: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v1 + - uses: actions/checkout@v2 - name: Set up Python uses: actions/setup-python@v1 - name: Install dependencies @@ -216,7 +216,7 @@ jobs: tasmota-BR: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v1 + - uses: actions/checkout@v2 - name: Set up Python uses: actions/setup-python@v1 - name: Install dependencies @@ -235,7 +235,7 @@ jobs: tasmota-CN: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v1 + - uses: actions/checkout@v2 - name: Set up Python uses: actions/setup-python@v1 - name: Install dependencies @@ -254,7 +254,7 @@ jobs: tasmota-CZ: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v1 + - uses: actions/checkout@v2 - name: Set up Python uses: actions/setup-python@v1 - name: Install dependencies @@ -273,7 +273,7 @@ jobs: tasmota-DE: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v1 + - uses: actions/checkout@v2 - name: Set up Python uses: actions/setup-python@v1 - name: Install dependencies @@ -292,7 +292,7 @@ jobs: tasmota-ES: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v1 + - uses: actions/checkout@v2 - name: Set up Python uses: actions/setup-python@v1 - name: Install dependencies @@ -311,7 +311,7 @@ jobs: tasmota-FR: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v1 + - uses: actions/checkout@v2 - name: Set up Python uses: actions/setup-python@v1 - name: Install dependencies @@ -330,7 +330,7 @@ jobs: tasmota-FY: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v1 + - uses: actions/checkout@v2 - name: Set up Python uses: actions/setup-python@v1 - name: Install dependencies @@ -349,7 +349,7 @@ jobs: tasmota-GR: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v1 + - uses: actions/checkout@v2 - name: Set up Python uses: actions/setup-python@v1 - name: Install dependencies @@ -368,7 +368,7 @@ jobs: tasmota-HE: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v1 + - uses: actions/checkout@v2 - name: Set up Python uses: actions/setup-python@v1 - name: Install dependencies @@ -387,7 +387,7 @@ jobs: tasmota-HU: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v1 + - uses: actions/checkout@v2 - name: Set up Python uses: actions/setup-python@v1 - name: Install dependencies @@ -406,7 +406,7 @@ jobs: tasmota-IT: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v1 + - uses: actions/checkout@v2 - name: Set up Python uses: actions/setup-python@v1 - name: Install dependencies @@ -425,7 +425,7 @@ jobs: tasmota-KO: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v1 + - uses: actions/checkout@v2 - name: Set up Python uses: actions/setup-python@v1 - name: Install dependencies @@ -444,7 +444,7 @@ jobs: tasmota-NL: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v1 + - uses: actions/checkout@v2 - name: Set up Python uses: actions/setup-python@v1 - name: Install dependencies @@ -463,7 +463,7 @@ jobs: tasmota-PL: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v1 + - uses: actions/checkout@v2 - name: Set up Python uses: actions/setup-python@v1 - name: Install dependencies @@ -482,7 +482,7 @@ jobs: tasmota-PT: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v1 + - uses: actions/checkout@v2 - name: Set up Python uses: actions/setup-python@v1 - name: Install dependencies @@ -501,7 +501,7 @@ jobs: tasmota-RO: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v1 + - uses: actions/checkout@v2 - name: Set up Python uses: actions/setup-python@v1 - name: Install dependencies @@ -520,7 +520,7 @@ jobs: tasmota-RU: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v1 + - uses: actions/checkout@v2 - name: Set up Python uses: actions/setup-python@v1 - name: Install dependencies @@ -539,7 +539,7 @@ jobs: tasmota-SE: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v1 + - uses: actions/checkout@v2 - name: Set up Python uses: actions/setup-python@v1 - name: Install dependencies @@ -558,7 +558,7 @@ jobs: tasmota-SK: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v1 + - uses: actions/checkout@v2 - name: Set up Python uses: actions/setup-python@v1 - name: Install dependencies @@ -577,7 +577,7 @@ jobs: tasmota-TR: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v1 + - uses: actions/checkout@v2 - name: Set up Python uses: actions/setup-python@v1 - name: Install dependencies @@ -596,7 +596,7 @@ jobs: tasmota-TW: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v1 + - uses: actions/checkout@v2 - name: Set up Python uses: actions/setup-python@v1 - name: Install dependencies @@ -615,7 +615,7 @@ jobs: tasmota-UK: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v1 + - uses: actions/checkout@v2 - name: Set up Python uses: actions/setup-python@v1 - name: Install dependencies @@ -634,7 +634,7 @@ jobs: tasmota-VN: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v1 + - uses: actions/checkout@v2 - name: Set up Python uses: actions/setup-python@v1 - name: Install dependencies diff --git a/.github/workflows/CI_github_ESP32.yml b/.github/workflows/CI_github_ESP32.yml index 0b63de0da..b01c6af2c 100644 --- a/.github/workflows/CI_github_ESP32.yml +++ b/.github/workflows/CI_github_ESP32.yml @@ -7,7 +7,7 @@ jobs: tasmota32: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v1 + - uses: actions/checkout@v2 - name: Set up Python uses: actions/setup-python@v1 - name: Install dependencies @@ -27,7 +27,7 @@ jobs: tasmota32solo1: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v1 + - uses: actions/checkout@v2 - name: Set up Python uses: actions/setup-python@v1 - name: Install dependencies @@ -47,7 +47,7 @@ jobs: tasmota32-webcam: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v1 + - uses: actions/checkout@v2 - name: Set up Python uses: actions/setup-python@v1 - name: Install dependencies @@ -67,7 +67,7 @@ jobs: tasmota32-odroidgo: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v1 + - uses: actions/checkout@v2 - name: Set up Python uses: actions/setup-python@v1 - name: Install dependencies @@ -87,7 +87,7 @@ jobs: tasmota32-core2: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v1 + - uses: actions/checkout@v2 - name: Set up Python uses: actions/setup-python@v1 - name: Install dependencies @@ -107,7 +107,7 @@ jobs: tasmota32-bluetooth: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v1 + - uses: actions/checkout@v2 - name: Set up Python uses: actions/setup-python@v1 - name: Install dependencies @@ -127,7 +127,7 @@ jobs: tasmota32-display: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v1 + - uses: actions/checkout@v2 - name: Set up Python uses: actions/setup-python@v1 - name: Install dependencies @@ -147,7 +147,7 @@ jobs: tasmota32-lvgl: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v1 + - uses: actions/checkout@v2 - name: Set up Python uses: actions/setup-python@v1 - name: Install dependencies @@ -167,7 +167,7 @@ jobs: tasmota32-ir: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v1 + - uses: actions/checkout@v2 - name: Set up Python uses: actions/setup-python@v1 - name: Install dependencies @@ -187,7 +187,7 @@ jobs: tasmota32-AF: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v1 + - uses: actions/checkout@v2 - name: Set up Python uses: actions/setup-python@v1 - name: Install dependencies @@ -207,7 +207,7 @@ jobs: tasmota32-BG: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v1 + - uses: actions/checkout@v2 - name: Set up Python uses: actions/setup-python@v1 - name: Install dependencies @@ -227,7 +227,7 @@ jobs: tasmota32-BR: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v1 + - uses: actions/checkout@v2 - name: Set up Python uses: actions/setup-python@v1 - name: Install dependencies @@ -247,7 +247,7 @@ jobs: tasmota32-CN: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v1 + - uses: actions/checkout@v2 - name: Set up Python uses: actions/setup-python@v1 - name: Install dependencies @@ -267,7 +267,7 @@ jobs: tasmota32-CZ: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v1 + - uses: actions/checkout@v2 - name: Set up Python uses: actions/setup-python@v1 - name: Install dependencies @@ -287,7 +287,7 @@ jobs: tasmota32-DE: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v1 + - uses: actions/checkout@v2 - name: Set up Python uses: actions/setup-python@v1 - name: Install dependencies @@ -307,7 +307,7 @@ jobs: tasmota32-ES: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v1 + - uses: actions/checkout@v2 - name: Set up Python uses: actions/setup-python@v1 - name: Install dependencies @@ -327,7 +327,7 @@ jobs: tasmota32-FR: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v1 + - uses: actions/checkout@v2 - name: Set up Python uses: actions/setup-python@v1 - name: Install dependencies @@ -347,7 +347,7 @@ jobs: tasmota32-FY: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v1 + - uses: actions/checkout@v2 - name: Set up Python uses: actions/setup-python@v1 - name: Install dependencies @@ -367,7 +367,7 @@ jobs: tasmota32-GR: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v1 + - uses: actions/checkout@v2 - name: Set up Python uses: actions/setup-python@v1 - name: Install dependencies @@ -387,7 +387,7 @@ jobs: tasmota32-HE: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v1 + - uses: actions/checkout@v2 - name: Set up Python uses: actions/setup-python@v1 - name: Install dependencies @@ -407,7 +407,7 @@ jobs: tasmota32-HU: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v1 + - uses: actions/checkout@v2 - name: Set up Python uses: actions/setup-python@v1 - name: Install dependencies @@ -427,7 +427,7 @@ jobs: tasmota32-IT: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v1 + - uses: actions/checkout@v2 - name: Set up Python uses: actions/setup-python@v1 - name: Install dependencies @@ -447,7 +447,7 @@ jobs: tasmota32-KO: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v1 + - uses: actions/checkout@v2 - name: Set up Python uses: actions/setup-python@v1 - name: Install dependencies @@ -467,7 +467,7 @@ jobs: tasmota32-NL: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v1 + - uses: actions/checkout@v2 - name: Set up Python uses: actions/setup-python@v1 - name: Install dependencies @@ -487,7 +487,7 @@ jobs: tasmota32-PL: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v1 + - uses: actions/checkout@v2 - name: Set up Python uses: actions/setup-python@v1 - name: Install dependencies @@ -507,7 +507,7 @@ jobs: tasmota32-PT: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v1 + - uses: actions/checkout@v2 - name: Set up Python uses: actions/setup-python@v1 - name: Install dependencies @@ -527,7 +527,7 @@ jobs: tasmota32-RO: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v1 + - uses: actions/checkout@v2 - name: Set up Python uses: actions/setup-python@v1 - name: Install dependencies @@ -547,7 +547,7 @@ jobs: tasmota32-RU: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v1 + - uses: actions/checkout@v2 - name: Set up Python uses: actions/setup-python@v1 - name: Install dependencies @@ -567,7 +567,7 @@ jobs: tasmota32-SE: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v1 + - uses: actions/checkout@v2 - name: Set up Python uses: actions/setup-python@v1 - name: Install dependencies @@ -587,7 +587,7 @@ jobs: tasmota32-SK: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v1 + - uses: actions/checkout@v2 - name: Set up Python uses: actions/setup-python@v1 - name: Install dependencies @@ -607,7 +607,7 @@ jobs: tasmota32-TR: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v1 + - uses: actions/checkout@v2 - name: Set up Python uses: actions/setup-python@v1 - name: Install dependencies @@ -627,7 +627,7 @@ jobs: tasmota32-TW: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v1 + - uses: actions/checkout@v2 - name: Set up Python uses: actions/setup-python@v1 - name: Install dependencies @@ -647,7 +647,7 @@ jobs: tasmota32-UK: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v1 + - uses: actions/checkout@v2 - name: Set up Python uses: actions/setup-python@v1 - name: Install dependencies @@ -667,7 +667,7 @@ jobs: tasmota32-VN: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v1 + - uses: actions/checkout@v2 - name: Set up Python uses: actions/setup-python@v1 - name: Install dependencies diff --git a/.github/workflows/Tasmota_build.yml b/.github/workflows/Tasmota_build_development.yml similarity index 80% rename from .github/workflows/Tasmota_build.yml rename to .github/workflows/Tasmota_build_development.yml index a67ae0bd8..f36fec5a8 100644 --- a/.github/workflows/Tasmota_build.yml +++ b/.github/workflows/Tasmota_build_development.yml @@ -1,35 +1,20 @@ -name: Build_firmware +name: Build_firmware_development on: + workflow_dispatch: # Manually start a workflow push: branches: development + paths-ignore: + - '.github/**' # Ignore changes towards the .github directory + - '**.md' # Do no build if *.md files changes jobs: - tasmota_pull: - runs-on: ubuntu-latest - continue-on-error: true - steps: - - uses: actions/checkout@v1 - - name: Use latest Tasmota development - run: | - git config --local user.name "Platformio BUILD" - git switch -c work - git remote add -f Tasmota "https://github.com/arendst/Tasmota.git" - git merge Tasmota/development --allow-unrelated-histories - - name: Push Tasmota # Push updates of latest Tasmota development to repo - uses: ad-m/github-push-action@master - with: - github_token: ${{ secrets.GITHUB_TOKEN }} - branch: 'development' - force: true - tasmota: - needs: tasmota_pull runs-on: ubuntu-latest continue-on-error: true steps: - - uses: actions/checkout@v1 + - uses: actions/checkout@v2 - name: Set up Python uses: actions/setup-python@v1 - name: Install dependencies @@ -45,11 +30,10 @@ jobs: tasmota-minimal: - needs: tasmota_pull runs-on: ubuntu-latest continue-on-error: true steps: - - uses: actions/checkout@v1 + - uses: actions/checkout@v2 - name: Set up Python uses: actions/setup-python@v1 - name: Install dependencies @@ -65,11 +49,10 @@ jobs: tasmota-lite: - needs: tasmota_pull runs-on: ubuntu-latest continue-on-error: true steps: - - uses: actions/checkout@v1 + - uses: actions/checkout@v2 - name: Set up Python uses: actions/setup-python@v1 - name: Install dependencies @@ -85,11 +68,10 @@ jobs: tasmota-knx: - needs: tasmota_pull runs-on: ubuntu-latest continue-on-error: true steps: - - uses: actions/checkout@v1 + - uses: actions/checkout@v2 - name: Set up Python uses: actions/setup-python@v1 - name: Install dependencies @@ -105,11 +87,10 @@ jobs: tasmota-sensors: - needs: tasmota_pull runs-on: ubuntu-latest continue-on-error: true steps: - - uses: actions/checkout@v1 + - uses: actions/checkout@v2 - name: Set up Python uses: actions/setup-python@v1 - name: Install dependencies @@ -125,11 +106,10 @@ jobs: tasmota-display: - needs: tasmota_pull runs-on: ubuntu-latest continue-on-error: true steps: - - uses: actions/checkout@v1 + - uses: actions/checkout@v2 - name: Set up Python uses: actions/setup-python@v1 - name: Install dependencies @@ -145,11 +125,10 @@ jobs: tasmota-ir: - needs: tasmota_pull runs-on: ubuntu-latest continue-on-error: true steps: - - uses: actions/checkout@v1 + - uses: actions/checkout@v2 - name: Set up Python uses: actions/setup-python@v1 - name: Install dependencies @@ -165,11 +144,10 @@ jobs: tasmota-zbbridge: - needs: tasmota_pull runs-on: ubuntu-latest continue-on-error: true steps: - - uses: actions/checkout@v1 + - uses: actions/checkout@v2 - name: Set up Python uses: actions/setup-python@v1 - name: Install dependencies @@ -185,11 +163,10 @@ jobs: tasmota-zigbee: - needs: tasmota_pull runs-on: ubuntu-latest continue-on-error: true steps: - - uses: actions/checkout@v1 + - uses: actions/checkout@v2 - name: Set up Python uses: actions/setup-python@v1 - name: Install dependencies @@ -205,11 +182,10 @@ jobs: tasmota-AF: - needs: tasmota_pull runs-on: ubuntu-latest continue-on-error: true steps: - - uses: actions/checkout@v1 + - uses: actions/checkout@v2 - name: Set up Python uses: actions/setup-python@v1 - name: Install dependencies @@ -225,11 +201,10 @@ jobs: tasmota-BG: - needs: tasmota_pull runs-on: ubuntu-latest continue-on-error: true steps: - - uses: actions/checkout@v1 + - uses: actions/checkout@v2 - name: Set up Python uses: actions/setup-python@v1 - name: Install dependencies @@ -245,11 +220,10 @@ jobs: tasmota-BR: - needs: tasmota_pull runs-on: ubuntu-latest continue-on-error: true steps: - - uses: actions/checkout@v1 + - uses: actions/checkout@v2 - name: Set up Python uses: actions/setup-python@v1 - name: Install dependencies @@ -265,11 +239,10 @@ jobs: tasmota-CN: - needs: tasmota_pull runs-on: ubuntu-latest continue-on-error: true steps: - - uses: actions/checkout@v1 + - uses: actions/checkout@v2 - name: Set up Python uses: actions/setup-python@v1 - name: Install dependencies @@ -285,11 +258,10 @@ jobs: tasmota-CZ: - needs: tasmota_pull runs-on: ubuntu-latest continue-on-error: true steps: - - uses: actions/checkout@v1 + - uses: actions/checkout@v2 - name: Set up Python uses: actions/setup-python@v1 - name: Install dependencies @@ -305,11 +277,10 @@ jobs: tasmota-DE: - needs: tasmota_pull runs-on: ubuntu-latest continue-on-error: true steps: - - uses: actions/checkout@v1 + - uses: actions/checkout@v2 - name: Set up Python uses: actions/setup-python@v1 - name: Install dependencies @@ -325,11 +296,10 @@ jobs: tasmota-ES: - needs: tasmota_pull runs-on: ubuntu-latest continue-on-error: true steps: - - uses: actions/checkout@v1 + - uses: actions/checkout@v2 - name: Set up Python uses: actions/setup-python@v1 - name: Install dependencies @@ -345,11 +315,10 @@ jobs: tasmota-FR: - needs: tasmota_pull runs-on: ubuntu-latest continue-on-error: true steps: - - uses: actions/checkout@v1 + - uses: actions/checkout@v2 - name: Set up Python uses: actions/setup-python@v1 - name: Install dependencies @@ -365,11 +334,10 @@ jobs: tasmota-FY: - needs: tasmota_pull runs-on: ubuntu-latest continue-on-error: true steps: - - uses: actions/checkout@v1 + - uses: actions/checkout@v2 - name: Set up Python uses: actions/setup-python@v1 - name: Install dependencies @@ -385,11 +353,10 @@ jobs: tasmota-GR: - needs: tasmota_pull runs-on: ubuntu-latest continue-on-error: true steps: - - uses: actions/checkout@v1 + - uses: actions/checkout@v2 - name: Set up Python uses: actions/setup-python@v1 - name: Install dependencies @@ -405,11 +372,10 @@ jobs: tasmota-HE: - needs: tasmota_pull runs-on: ubuntu-latest continue-on-error: true steps: - - uses: actions/checkout@v1 + - uses: actions/checkout@v2 - name: Set up Python uses: actions/setup-python@v1 - name: Install dependencies @@ -425,11 +391,10 @@ jobs: tasmota-HU: - needs: tasmota_pull runs-on: ubuntu-latest continue-on-error: true steps: - - uses: actions/checkout@v1 + - uses: actions/checkout@v2 - name: Set up Python uses: actions/setup-python@v1 - name: Install dependencies @@ -445,11 +410,10 @@ jobs: tasmota-IT: - needs: tasmota_pull runs-on: ubuntu-latest continue-on-error: true steps: - - uses: actions/checkout@v1 + - uses: actions/checkout@v2 - name: Set up Python uses: actions/setup-python@v1 - name: Install dependencies @@ -465,11 +429,10 @@ jobs: tasmota-KO: - needs: tasmota_pull runs-on: ubuntu-latest continue-on-error: true steps: - - uses: actions/checkout@v1 + - uses: actions/checkout@v2 - name: Set up Python uses: actions/setup-python@v1 - name: Install dependencies @@ -485,11 +448,10 @@ jobs: tasmota-NL: - needs: tasmota_pull runs-on: ubuntu-latest continue-on-error: true steps: - - uses: actions/checkout@v1 + - uses: actions/checkout@v2 - name: Set up Python uses: actions/setup-python@v1 - name: Install dependencies @@ -505,11 +467,10 @@ jobs: tasmota-PL: - needs: tasmota_pull runs-on: ubuntu-latest continue-on-error: true steps: - - uses: actions/checkout@v1 + - uses: actions/checkout@v2 - name: Set up Python uses: actions/setup-python@v1 - name: Install dependencies @@ -525,11 +486,10 @@ jobs: tasmota-PT: - needs: tasmota_pull runs-on: ubuntu-latest continue-on-error: true steps: - - uses: actions/checkout@v1 + - uses: actions/checkout@v2 - name: Set up Python uses: actions/setup-python@v1 - name: Install dependencies @@ -545,11 +505,10 @@ jobs: tasmota-RO: - needs: tasmota_pull runs-on: ubuntu-latest continue-on-error: true steps: - - uses: actions/checkout@v1 + - uses: actions/checkout@v2 - name: Set up Python uses: actions/setup-python@v1 - name: Install dependencies @@ -565,11 +524,10 @@ jobs: tasmota-RU: - needs: tasmota_pull runs-on: ubuntu-latest continue-on-error: true steps: - - uses: actions/checkout@v1 + - uses: actions/checkout@v2 - name: Set up Python uses: actions/setup-python@v1 - name: Install dependencies @@ -585,11 +543,10 @@ jobs: tasmota-SE: - needs: tasmota_pull runs-on: ubuntu-latest continue-on-error: true steps: - - uses: actions/checkout@v1 + - uses: actions/checkout@v2 - name: Set up Python uses: actions/setup-python@v1 - name: Install dependencies @@ -605,11 +562,10 @@ jobs: tasmota-SK: - needs: tasmota_pull runs-on: ubuntu-latest continue-on-error: true steps: - - uses: actions/checkout@v1 + - uses: actions/checkout@v2 - name: Set up Python uses: actions/setup-python@v1 - name: Install dependencies @@ -625,11 +581,10 @@ jobs: tasmota-TR: - needs: tasmota_pull runs-on: ubuntu-latest continue-on-error: true steps: - - uses: actions/checkout@v1 + - uses: actions/checkout@v2 - name: Set up Python uses: actions/setup-python@v1 - name: Install dependencies @@ -645,11 +600,10 @@ jobs: tasmota-TW: - needs: tasmota_pull runs-on: ubuntu-latest continue-on-error: true steps: - - uses: actions/checkout@v1 + - uses: actions/checkout@v2 - name: Set up Python uses: actions/setup-python@v1 - name: Install dependencies @@ -665,11 +619,10 @@ jobs: tasmota-UK: - needs: tasmota_pull runs-on: ubuntu-latest continue-on-error: true steps: - - uses: actions/checkout@v1 + - uses: actions/checkout@v2 - name: Set up Python uses: actions/setup-python@v1 - name: Install dependencies @@ -685,11 +638,10 @@ jobs: tasmota-VN: - needs: tasmota_pull runs-on: ubuntu-latest continue-on-error: true steps: - - uses: actions/checkout@v1 + - uses: actions/checkout@v2 - name: Set up Python uses: actions/setup-python@v1 - name: Install dependencies @@ -705,11 +657,10 @@ jobs: tasmota32: - needs: tasmota_pull runs-on: ubuntu-latest continue-on-error: true steps: - - uses: actions/checkout@v1 + - uses: actions/checkout@v2 - name: Set up Python uses: actions/setup-python@v1 - name: Install dependencies @@ -725,11 +676,10 @@ jobs: tasmota32solo1: - needs: tasmota_pull runs-on: ubuntu-latest continue-on-error: true steps: - - uses: actions/checkout@v1 + - uses: actions/checkout@v2 - name: Set up Python uses: actions/setup-python@v1 - name: Install dependencies @@ -745,11 +695,10 @@ jobs: tasmota32-webcam: - needs: tasmota_pull runs-on: ubuntu-latest continue-on-error: true steps: - - uses: actions/checkout@v1 + - uses: actions/checkout@v2 - name: Set up Python uses: actions/setup-python@v1 - name: Install dependencies @@ -765,11 +714,10 @@ jobs: tasmota32-odroidgo: - needs: tasmota_pull runs-on: ubuntu-latest continue-on-error: true steps: - - uses: actions/checkout@v1 + - uses: actions/checkout@v2 - name: Set up Python uses: actions/setup-python@v1 - name: Install dependencies @@ -785,11 +733,10 @@ jobs: tasmota32-core2: - needs: tasmota_pull runs-on: ubuntu-latest continue-on-error: true steps: - - uses: actions/checkout@v1 + - uses: actions/checkout@v2 - name: Set up Python uses: actions/setup-python@v1 - name: Install dependencies @@ -805,11 +752,10 @@ jobs: tasmota32-bluetooth: - needs: tasmota_pull runs-on: ubuntu-latest continue-on-error: true steps: - - uses: actions/checkout@v1 + - uses: actions/checkout@v2 - name: Set up Python uses: actions/setup-python@v1 - name: Install dependencies @@ -825,11 +771,10 @@ jobs: tasmota32-display: - needs: tasmota_pull runs-on: ubuntu-latest continue-on-error: true steps: - - uses: actions/checkout@v1 + - uses: actions/checkout@v2 - name: Set up Python uses: actions/setup-python@v1 - name: Install dependencies @@ -845,11 +790,10 @@ jobs: tasmota32-lvgl: - needs: tasmota_pull runs-on: ubuntu-latest continue-on-error: true steps: - - uses: actions/checkout@v1 + - uses: actions/checkout@v2 - name: Set up Python uses: actions/setup-python@v1 - name: Install dependencies @@ -865,11 +809,10 @@ jobs: tasmota32-ir: - needs: tasmota_pull runs-on: ubuntu-latest continue-on-error: true steps: - - uses: actions/checkout@v1 + - uses: actions/checkout@v2 - name: Set up Python uses: actions/setup-python@v1 - name: Install dependencies @@ -885,11 +828,10 @@ jobs: tasmota32-AF: - needs: tasmota_pull runs-on: ubuntu-latest continue-on-error: true steps: - - uses: actions/checkout@v1 + - uses: actions/checkout@v2 - name: Set up Python uses: actions/setup-python@v1 - name: Install dependencies @@ -905,11 +847,10 @@ jobs: tasmota32-BG: - needs: tasmota_pull runs-on: ubuntu-latest continue-on-error: true steps: - - uses: actions/checkout@v1 + - uses: actions/checkout@v2 - name: Set up Python uses: actions/setup-python@v1 - name: Install dependencies @@ -925,11 +866,10 @@ jobs: tasmota32-BR: - needs: tasmota_pull runs-on: ubuntu-latest continue-on-error: true steps: - - uses: actions/checkout@v1 + - uses: actions/checkout@v2 - name: Set up Python uses: actions/setup-python@v1 - name: Install dependencies @@ -945,11 +885,10 @@ jobs: tasmota32-CN: - needs: tasmota_pull runs-on: ubuntu-latest continue-on-error: true steps: - - uses: actions/checkout@v1 + - uses: actions/checkout@v2 - name: Set up Python uses: actions/setup-python@v1 - name: Install dependencies @@ -965,11 +904,10 @@ jobs: tasmota32-CZ: - needs: tasmota_pull runs-on: ubuntu-latest continue-on-error: true steps: - - uses: actions/checkout@v1 + - uses: actions/checkout@v2 - name: Set up Python uses: actions/setup-python@v1 - name: Install dependencies @@ -985,11 +923,10 @@ jobs: tasmota32-DE: - needs: tasmota_pull runs-on: ubuntu-latest continue-on-error: true steps: - - uses: actions/checkout@v1 + - uses: actions/checkout@v2 - name: Set up Python uses: actions/setup-python@v1 - name: Install dependencies @@ -1005,11 +942,10 @@ jobs: tasmota32-ES: - needs: tasmota_pull runs-on: ubuntu-latest continue-on-error: true steps: - - uses: actions/checkout@v1 + - uses: actions/checkout@v2 - name: Set up Python uses: actions/setup-python@v1 - name: Install dependencies @@ -1025,11 +961,10 @@ jobs: tasmota32-FR: - needs: tasmota_pull runs-on: ubuntu-latest continue-on-error: true steps: - - uses: actions/checkout@v1 + - uses: actions/checkout@v2 - name: Set up Python uses: actions/setup-python@v1 - name: Install dependencies @@ -1045,11 +980,10 @@ jobs: tasmota32-FY: - needs: tasmota_pull runs-on: ubuntu-latest continue-on-error: true steps: - - uses: actions/checkout@v1 + - uses: actions/checkout@v2 - name: Set up Python uses: actions/setup-python@v1 - name: Install dependencies @@ -1065,11 +999,10 @@ jobs: tasmota32-GR: - needs: tasmota_pull runs-on: ubuntu-latest continue-on-error: true steps: - - uses: actions/checkout@v1 + - uses: actions/checkout@v2 - name: Set up Python uses: actions/setup-python@v1 - name: Install dependencies @@ -1085,11 +1018,10 @@ jobs: tasmota32-HE: - needs: tasmota_pull runs-on: ubuntu-latest continue-on-error: true steps: - - uses: actions/checkout@v1 + - uses: actions/checkout@v2 - name: Set up Python uses: actions/setup-python@v1 - name: Install dependencies @@ -1105,11 +1037,10 @@ jobs: tasmota32-HU: - needs: tasmota_pull runs-on: ubuntu-latest continue-on-error: true steps: - - uses: actions/checkout@v1 + - uses: actions/checkout@v2 - name: Set up Python uses: actions/setup-python@v1 - name: Install dependencies @@ -1125,11 +1056,10 @@ jobs: tasmota32-IT: - needs: tasmota_pull runs-on: ubuntu-latest continue-on-error: true steps: - - uses: actions/checkout@v1 + - uses: actions/checkout@v2 - name: Set up Python uses: actions/setup-python@v1 - name: Install dependencies @@ -1145,11 +1075,10 @@ jobs: tasmota32-KO: - needs: tasmota_pull runs-on: ubuntu-latest continue-on-error: true steps: - - uses: actions/checkout@v1 + - uses: actions/checkout@v2 - name: Set up Python uses: actions/setup-python@v1 - name: Install dependencies @@ -1165,11 +1094,10 @@ jobs: tasmota32-NL: - needs: tasmota_pull runs-on: ubuntu-latest continue-on-error: true steps: - - uses: actions/checkout@v1 + - uses: actions/checkout@v2 - name: Set up Python uses: actions/setup-python@v1 - name: Install dependencies @@ -1185,11 +1113,10 @@ jobs: tasmota32-PL: - needs: tasmota_pull runs-on: ubuntu-latest continue-on-error: true steps: - - uses: actions/checkout@v1 + - uses: actions/checkout@v2 - name: Set up Python uses: actions/setup-python@v1 - name: Install dependencies @@ -1205,11 +1132,10 @@ jobs: tasmota32-PT: - needs: tasmota_pull runs-on: ubuntu-latest continue-on-error: true steps: - - uses: actions/checkout@v1 + - uses: actions/checkout@v2 - name: Set up Python uses: actions/setup-python@v1 - name: Install dependencies @@ -1225,11 +1151,10 @@ jobs: tasmota32-RO: - needs: tasmota_pull runs-on: ubuntu-latest continue-on-error: true steps: - - uses: actions/checkout@v1 + - uses: actions/checkout@v2 - name: Set up Python uses: actions/setup-python@v1 - name: Install dependencies @@ -1245,11 +1170,10 @@ jobs: tasmota32-RU: - needs: tasmota_pull runs-on: ubuntu-latest continue-on-error: true steps: - - uses: actions/checkout@v1 + - uses: actions/checkout@v2 - name: Set up Python uses: actions/setup-python@v1 - name: Install dependencies @@ -1265,11 +1189,10 @@ jobs: tasmota32-SE: - needs: tasmota_pull runs-on: ubuntu-latest continue-on-error: true steps: - - uses: actions/checkout@v1 + - uses: actions/checkout@v2 - name: Set up Python uses: actions/setup-python@v1 - name: Install dependencies @@ -1285,11 +1208,10 @@ jobs: tasmota32-SK: - needs: tasmota_pull runs-on: ubuntu-latest continue-on-error: true steps: - - uses: actions/checkout@v1 + - uses: actions/checkout@v2 - name: Set up Python uses: actions/setup-python@v1 - name: Install dependencies @@ -1305,11 +1227,10 @@ jobs: tasmota32-TR: - needs: tasmota_pull runs-on: ubuntu-latest continue-on-error: true steps: - - uses: actions/checkout@v1 + - uses: actions/checkout@v2 - name: Set up Python uses: actions/setup-python@v1 - name: Install dependencies @@ -1325,11 +1246,10 @@ jobs: tasmota32-TW: - needs: tasmota_pull runs-on: ubuntu-latest continue-on-error: true steps: - - uses: actions/checkout@v1 + - uses: actions/checkout@v2 - name: Set up Python uses: actions/setup-python@v1 - name: Install dependencies @@ -1345,11 +1265,10 @@ jobs: tasmota32-UK: - needs: tasmota_pull runs-on: ubuntu-latest continue-on-error: true steps: - - uses: actions/checkout@v1 + - uses: actions/checkout@v2 - name: Set up Python uses: actions/setup-python@v1 - name: Install dependencies @@ -1365,11 +1284,10 @@ jobs: tasmota32-VN: - needs: tasmota_pull runs-on: ubuntu-latest continue-on-error: true steps: - - uses: actions/checkout@v1 + - uses: actions/checkout@v2 - name: Set up Python uses: actions/setup-python@v1 - name: Install dependencies @@ -1389,16 +1307,6 @@ jobs: runs-on: ubuntu-latest continue-on-error: true steps: - - uses: actions/checkout@v1 - - name: Delete all files and folders - run: | - rm -rf * - git config --local user.name "Platformio BUILD" - git checkout firmware - - name: Display files from branch firmware - run: ls -R - - name: Remove old firmware files - run: rm -rf ./firmware/* - uses: actions/download-artifact@v2 with: name: firmware @@ -1410,8 +1318,6 @@ jobs: run: | mkdir -p ./firmware/tasmota/languages mkdir -p ./firmware/tasmota32/languages - mkdir -p ./firmware/tasmota32/ESP32_needed_files/ - mkdir -p ./firmware/tasmota32/Odroid_go_and_core2_needed_files/ mkdir -p ./firmware/map [ ! -f ./mv_firmware/map/* ] || mv ./mv_firmware/map/* ./firmware/map/ [ ! -f ./mv_firmware/firmware/tasmota.* ] || mv ./mv_firmware/firmware/tasmota.* ./firmware/tasmota/ @@ -1434,29 +1340,14 @@ jobs: [ ! -f ./mv_firmware/firmware/tasmota32-bluetooth.* ] || mv ./mv_firmware/firmware/tasmota32-bluetooth.* ./firmware/tasmota32/ [ ! -f ./mv_firmware/firmware/tasmota32* ] || mv ./mv_firmware/firmware/tasmota32* ./firmware/tasmota32/languages/ [ ! -f ./mv_firmware/firmware/* ] || mv ./mv_firmware/firmware/* ./firmware/tasmota/languages/ - [ ! -f ./tools/Esptool/ESP32/*.* ] || mv ./tools/Esptool/ESP32/*.* ./firmware/tasmota32/ESP32_needed_files/ - [ ! -f ./tools/Esptool/Odroid_go_and_core2/*.* ] || mv ./tools/Esptool/Odroid_go_and_core2/*.* ./firmware/tasmota32/Odroid_go_and_core2_needed_files/ - [ ! -f ./FIRMWARE.md ] || mv -f ./FIRMWARE.md ./README.md - - uses: actions/checkout@v2 - with: - ref: release-firmware - path: tmp-folder - - name: Display files from branch release-firmware - run: | - ls -R ./tmp-folder - mkdir -p ./release-firmware/ - cp -rf ./tmp-folder/firmware/* ./release-firmware/ - rm -rf ./tmp-folder - - name: Display files to commit + - name: Display files to transfer run: ls -R ./* - - name: Commit files # transfer the new binaries back into the repository - run: | - git rm -r --cached . - git add -f ./* - git commit -m "Tasmota ESP Binaries http://tasmota.com" - - name: Push changes # push the firmware files to branch firmware - uses: ad-m/github-push-action@master + - name: Push Firmware files to https://github.com/arendst/Tasmota-firmware + uses: dmnemec/copy_file_to_another_repo_action@main + env: + API_TOKEN_GITHUB: ${{ secrets.API_TOKEN_GITHUB }} with: - github_token: ${{ secrets.GITHUB_TOKEN }} - branch: 'firmware' - force: true + source_file: 'firmware' + destination_repo: 'arendst/Tasmota-firmware' + user_email: 'github-actions@github.com' + user_name: 'github-actions' diff --git a/.github/workflows/Tasmota_build_master.yml b/.github/workflows/Tasmota_build_master.yml index d138ac4d7..5bc79c06d 100644 --- a/.github/workflows/Tasmota_build_master.yml +++ b/.github/workflows/Tasmota_build_master.yml @@ -1,35 +1,18 @@ -name: Build_firmware +name: Build_firmware_master on: push: branches: master + paths-ignore: + - '.github/**' # Ignore changes towards the .github directory jobs: - tasmota_pull: - runs-on: ubuntu-latest - continue-on-error: true - steps: - - uses: actions/checkout@v1 - - name: Use Tasmota master - run: | - git config --local user.name "Platformio BUILD" - git switch -c work - git remote add -f Tasmota "https://github.com/arendst/Tasmota.git" - git merge Tasmota/master --allow-unrelated-histories - - name: Push Tasmota # Push updates of latest Tasmota master to repo - uses: ad-m/github-push-action@master - with: - github_token: ${{ secrets.GITHUB_TOKEN }} - branch: 'master' - force: true - tasmota: - needs: tasmota_pull runs-on: ubuntu-latest continue-on-error: true steps: - - uses: actions/checkout@v1 + - uses: actions/checkout@v2 - name: Set up Python uses: actions/setup-python@v1 - name: Install dependencies @@ -45,11 +28,10 @@ jobs: tasmota-minimal: - needs: tasmota_pull runs-on: ubuntu-latest continue-on-error: true steps: - - uses: actions/checkout@v1 + - uses: actions/checkout@v2 - name: Set up Python uses: actions/setup-python@v1 - name: Install dependencies @@ -65,11 +47,10 @@ jobs: tasmota-lite: - needs: tasmota_pull runs-on: ubuntu-latest continue-on-error: true steps: - - uses: actions/checkout@v1 + - uses: actions/checkout@v2 - name: Set up Python uses: actions/setup-python@v1 - name: Install dependencies @@ -85,11 +66,10 @@ jobs: tasmota-knx: - needs: tasmota_pull runs-on: ubuntu-latest continue-on-error: true steps: - - uses: actions/checkout@v1 + - uses: actions/checkout@v2 - name: Set up Python uses: actions/setup-python@v1 - name: Install dependencies @@ -105,11 +85,10 @@ jobs: tasmota-sensors: - needs: tasmota_pull runs-on: ubuntu-latest continue-on-error: true steps: - - uses: actions/checkout@v1 + - uses: actions/checkout@v2 - name: Set up Python uses: actions/setup-python@v1 - name: Install dependencies @@ -125,11 +104,10 @@ jobs: tasmota-display: - needs: tasmota_pull runs-on: ubuntu-latest continue-on-error: true steps: - - uses: actions/checkout@v1 + - uses: actions/checkout@v2 - name: Set up Python uses: actions/setup-python@v1 - name: Install dependencies @@ -145,11 +123,10 @@ jobs: tasmota-ir: - needs: tasmota_pull runs-on: ubuntu-latest continue-on-error: true steps: - - uses: actions/checkout@v1 + - uses: actions/checkout@v2 - name: Set up Python uses: actions/setup-python@v1 - name: Install dependencies @@ -165,11 +142,10 @@ jobs: tasmota-zbbridge: - needs: tasmota_pull runs-on: ubuntu-latest continue-on-error: true steps: - - uses: actions/checkout@v1 + - uses: actions/checkout@v2 - name: Set up Python uses: actions/setup-python@v1 - name: Install dependencies @@ -185,11 +161,10 @@ jobs: tasmota-zigbee: - needs: tasmota_pull runs-on: ubuntu-latest continue-on-error: true steps: - - uses: actions/checkout@v1 + - uses: actions/checkout@v2 - name: Set up Python uses: actions/setup-python@v1 - name: Install dependencies @@ -205,11 +180,10 @@ jobs: tasmota-AF: - needs: tasmota_pull runs-on: ubuntu-latest continue-on-error: true steps: - - uses: actions/checkout@v1 + - uses: actions/checkout@v2 - name: Set up Python uses: actions/setup-python@v1 - name: Install dependencies @@ -225,11 +199,10 @@ jobs: tasmota-BG: - needs: tasmota_pull runs-on: ubuntu-latest continue-on-error: true steps: - - uses: actions/checkout@v1 + - uses: actions/checkout@v2 - name: Set up Python uses: actions/setup-python@v1 - name: Install dependencies @@ -245,11 +218,10 @@ jobs: tasmota-BR: - needs: tasmota_pull runs-on: ubuntu-latest continue-on-error: true steps: - - uses: actions/checkout@v1 + - uses: actions/checkout@v2 - name: Set up Python uses: actions/setup-python@v1 - name: Install dependencies @@ -265,11 +237,10 @@ jobs: tasmota-CN: - needs: tasmota_pull runs-on: ubuntu-latest continue-on-error: true steps: - - uses: actions/checkout@v1 + - uses: actions/checkout@v2 - name: Set up Python uses: actions/setup-python@v1 - name: Install dependencies @@ -285,11 +256,10 @@ jobs: tasmota-CZ: - needs: tasmota_pull runs-on: ubuntu-latest continue-on-error: true steps: - - uses: actions/checkout@v1 + - uses: actions/checkout@v2 - name: Set up Python uses: actions/setup-python@v1 - name: Install dependencies @@ -305,11 +275,10 @@ jobs: tasmota-DE: - needs: tasmota_pull runs-on: ubuntu-latest continue-on-error: true steps: - - uses: actions/checkout@v1 + - uses: actions/checkout@v2 - name: Set up Python uses: actions/setup-python@v1 - name: Install dependencies @@ -325,11 +294,10 @@ jobs: tasmota-ES: - needs: tasmota_pull runs-on: ubuntu-latest continue-on-error: true steps: - - uses: actions/checkout@v1 + - uses: actions/checkout@v2 - name: Set up Python uses: actions/setup-python@v1 - name: Install dependencies @@ -345,11 +313,10 @@ jobs: tasmota-FR: - needs: tasmota_pull runs-on: ubuntu-latest continue-on-error: true steps: - - uses: actions/checkout@v1 + - uses: actions/checkout@v2 - name: Set up Python uses: actions/setup-python@v1 - name: Install dependencies @@ -365,11 +332,10 @@ jobs: tasmota-FY: - needs: tasmota_pull runs-on: ubuntu-latest continue-on-error: true steps: - - uses: actions/checkout@v1 + - uses: actions/checkout@v2 - name: Set up Python uses: actions/setup-python@v1 - name: Install dependencies @@ -385,11 +351,10 @@ jobs: tasmota-GR: - needs: tasmota_pull runs-on: ubuntu-latest continue-on-error: true steps: - - uses: actions/checkout@v1 + - uses: actions/checkout@v2 - name: Set up Python uses: actions/setup-python@v1 - name: Install dependencies @@ -405,11 +370,10 @@ jobs: tasmota-HE: - needs: tasmota_pull runs-on: ubuntu-latest continue-on-error: true steps: - - uses: actions/checkout@v1 + - uses: actions/checkout@v2 - name: Set up Python uses: actions/setup-python@v1 - name: Install dependencies @@ -425,11 +389,10 @@ jobs: tasmota-HU: - needs: tasmota_pull runs-on: ubuntu-latest continue-on-error: true steps: - - uses: actions/checkout@v1 + - uses: actions/checkout@v2 - name: Set up Python uses: actions/setup-python@v1 - name: Install dependencies @@ -445,11 +408,10 @@ jobs: tasmota-IT: - needs: tasmota_pull runs-on: ubuntu-latest continue-on-error: true steps: - - uses: actions/checkout@v1 + - uses: actions/checkout@v2 - name: Set up Python uses: actions/setup-python@v1 - name: Install dependencies @@ -465,11 +427,10 @@ jobs: tasmota-KO: - needs: tasmota_pull runs-on: ubuntu-latest continue-on-error: true steps: - - uses: actions/checkout@v1 + - uses: actions/checkout@v2 - name: Set up Python uses: actions/setup-python@v1 - name: Install dependencies @@ -485,11 +446,10 @@ jobs: tasmota-NL: - needs: tasmota_pull runs-on: ubuntu-latest continue-on-error: true steps: - - uses: actions/checkout@v1 + - uses: actions/checkout@v2 - name: Set up Python uses: actions/setup-python@v1 - name: Install dependencies @@ -505,11 +465,10 @@ jobs: tasmota-PL: - needs: tasmota_pull runs-on: ubuntu-latest continue-on-error: true steps: - - uses: actions/checkout@v1 + - uses: actions/checkout@v2 - name: Set up Python uses: actions/setup-python@v1 - name: Install dependencies @@ -525,11 +484,10 @@ jobs: tasmota-PT: - needs: tasmota_pull runs-on: ubuntu-latest continue-on-error: true steps: - - uses: actions/checkout@v1 + - uses: actions/checkout@v2 - name: Set up Python uses: actions/setup-python@v1 - name: Install dependencies @@ -545,11 +503,10 @@ jobs: tasmota-RO: - needs: tasmota_pull runs-on: ubuntu-latest continue-on-error: true steps: - - uses: actions/checkout@v1 + - uses: actions/checkout@v2 - name: Set up Python uses: actions/setup-python@v1 - name: Install dependencies @@ -565,11 +522,10 @@ jobs: tasmota-RU: - needs: tasmota_pull runs-on: ubuntu-latest continue-on-error: true steps: - - uses: actions/checkout@v1 + - uses: actions/checkout@v2 - name: Set up Python uses: actions/setup-python@v1 - name: Install dependencies @@ -585,11 +541,10 @@ jobs: tasmota-SE: - needs: tasmota_pull runs-on: ubuntu-latest continue-on-error: true steps: - - uses: actions/checkout@v1 + - uses: actions/checkout@v2 - name: Set up Python uses: actions/setup-python@v1 - name: Install dependencies @@ -605,11 +560,10 @@ jobs: tasmota-SK: - needs: tasmota_pull runs-on: ubuntu-latest continue-on-error: true steps: - - uses: actions/checkout@v1 + - uses: actions/checkout@v2 - name: Set up Python uses: actions/setup-python@v1 - name: Install dependencies @@ -625,11 +579,10 @@ jobs: tasmota-TR: - needs: tasmota_pull runs-on: ubuntu-latest continue-on-error: true steps: - - uses: actions/checkout@v1 + - uses: actions/checkout@v2 - name: Set up Python uses: actions/setup-python@v1 - name: Install dependencies @@ -645,11 +598,10 @@ jobs: tasmota-TW: - needs: tasmota_pull runs-on: ubuntu-latest continue-on-error: true steps: - - uses: actions/checkout@v1 + - uses: actions/checkout@v2 - name: Set up Python uses: actions/setup-python@v1 - name: Install dependencies @@ -665,11 +617,10 @@ jobs: tasmota-UK: - needs: tasmota_pull runs-on: ubuntu-latest continue-on-error: true steps: - - uses: actions/checkout@v1 + - uses: actions/checkout@v2 - name: Set up Python uses: actions/setup-python@v1 - name: Install dependencies @@ -685,11 +636,10 @@ jobs: tasmota-VN: - needs: tasmota_pull runs-on: ubuntu-latest continue-on-error: true steps: - - uses: actions/checkout@v1 + - uses: actions/checkout@v2 - name: Set up Python uses: actions/setup-python@v1 - name: Install dependencies @@ -705,11 +655,10 @@ jobs: tasmota32: - needs: tasmota_pull runs-on: ubuntu-latest continue-on-error: true steps: - - uses: actions/checkout@v1 + - uses: actions/checkout@v2 - name: Set up Python uses: actions/setup-python@v1 - name: Install dependencies @@ -725,11 +674,10 @@ jobs: tasmota32solo1: - needs: tasmota_pull runs-on: ubuntu-latest continue-on-error: true steps: - - uses: actions/checkout@v1 + - uses: actions/checkout@v2 - name: Set up Python uses: actions/setup-python@v1 - name: Install dependencies @@ -745,11 +693,10 @@ jobs: tasmota32-webcam: - needs: tasmota_pull runs-on: ubuntu-latest continue-on-error: true steps: - - uses: actions/checkout@v1 + - uses: actions/checkout@v2 - name: Set up Python uses: actions/setup-python@v1 - name: Install dependencies @@ -765,11 +712,10 @@ jobs: tasmota32-odroidgo: - needs: tasmota_pull runs-on: ubuntu-latest continue-on-error: true steps: - - uses: actions/checkout@v1 + - uses: actions/checkout@v2 - name: Set up Python uses: actions/setup-python@v1 - name: Install dependencies @@ -785,11 +731,10 @@ jobs: tasmota32-core2: - needs: tasmota_pull runs-on: ubuntu-latest continue-on-error: true steps: - - uses: actions/checkout@v1 + - uses: actions/checkout@v2 - name: Set up Python uses: actions/setup-python@v1 - name: Install dependencies @@ -805,11 +750,10 @@ jobs: tasmota32-bluetooth: - needs: tasmota_pull runs-on: ubuntu-latest continue-on-error: true steps: - - uses: actions/checkout@v1 + - uses: actions/checkout@v2 - name: Set up Python uses: actions/setup-python@v1 - name: Install dependencies @@ -825,11 +769,10 @@ jobs: tasmota32-display: - needs: tasmota_pull runs-on: ubuntu-latest continue-on-error: true steps: - - uses: actions/checkout@v1 + - uses: actions/checkout@v2 - name: Set up Python uses: actions/setup-python@v1 - name: Install dependencies @@ -845,11 +788,10 @@ jobs: tasmota32-lvgl: - needs: tasmota_pull runs-on: ubuntu-latest continue-on-error: true steps: - - uses: actions/checkout@v1 + - uses: actions/checkout@v2 - name: Set up Python uses: actions/setup-python@v1 - name: Install dependencies @@ -865,11 +807,10 @@ jobs: tasmota32-ir: - needs: tasmota_pull runs-on: ubuntu-latest continue-on-error: true steps: - - uses: actions/checkout@v1 + - uses: actions/checkout@v2 - name: Set up Python uses: actions/setup-python@v1 - name: Install dependencies @@ -885,11 +826,10 @@ jobs: tasmota32-AF: - needs: tasmota_pull runs-on: ubuntu-latest continue-on-error: true steps: - - uses: actions/checkout@v1 + - uses: actions/checkout@v2 - name: Set up Python uses: actions/setup-python@v1 - name: Install dependencies @@ -905,11 +845,10 @@ jobs: tasmota32-BG: - needs: tasmota_pull runs-on: ubuntu-latest continue-on-error: true steps: - - uses: actions/checkout@v1 + - uses: actions/checkout@v2 - name: Set up Python uses: actions/setup-python@v1 - name: Install dependencies @@ -925,11 +864,10 @@ jobs: tasmota32-BR: - needs: tasmota_pull runs-on: ubuntu-latest continue-on-error: true steps: - - uses: actions/checkout@v1 + - uses: actions/checkout@v2 - name: Set up Python uses: actions/setup-python@v1 - name: Install dependencies @@ -945,11 +883,10 @@ jobs: tasmota32-CN: - needs: tasmota_pull runs-on: ubuntu-latest continue-on-error: true steps: - - uses: actions/checkout@v1 + - uses: actions/checkout@v2 - name: Set up Python uses: actions/setup-python@v1 - name: Install dependencies @@ -965,11 +902,10 @@ jobs: tasmota32-CZ: - needs: tasmota_pull runs-on: ubuntu-latest continue-on-error: true steps: - - uses: actions/checkout@v1 + - uses: actions/checkout@v2 - name: Set up Python uses: actions/setup-python@v1 - name: Install dependencies @@ -985,11 +921,10 @@ jobs: tasmota32-DE: - needs: tasmota_pull runs-on: ubuntu-latest continue-on-error: true steps: - - uses: actions/checkout@v1 + - uses: actions/checkout@v2 - name: Set up Python uses: actions/setup-python@v1 - name: Install dependencies @@ -1005,11 +940,10 @@ jobs: tasmota32-ES: - needs: tasmota_pull runs-on: ubuntu-latest continue-on-error: true steps: - - uses: actions/checkout@v1 + - uses: actions/checkout@v2 - name: Set up Python uses: actions/setup-python@v1 - name: Install dependencies @@ -1025,11 +959,10 @@ jobs: tasmota32-FR: - needs: tasmota_pull runs-on: ubuntu-latest continue-on-error: true steps: - - uses: actions/checkout@v1 + - uses: actions/checkout@v2 - name: Set up Python uses: actions/setup-python@v1 - name: Install dependencies @@ -1045,11 +978,10 @@ jobs: tasmota32-FY: - needs: tasmota_pull runs-on: ubuntu-latest continue-on-error: true steps: - - uses: actions/checkout@v1 + - uses: actions/checkout@v2 - name: Set up Python uses: actions/setup-python@v1 - name: Install dependencies @@ -1065,11 +997,10 @@ jobs: tasmota32-GR: - needs: tasmota_pull runs-on: ubuntu-latest continue-on-error: true steps: - - uses: actions/checkout@v1 + - uses: actions/checkout@v2 - name: Set up Python uses: actions/setup-python@v1 - name: Install dependencies @@ -1085,11 +1016,10 @@ jobs: tasmota32-HE: - needs: tasmota_pull runs-on: ubuntu-latest continue-on-error: true steps: - - uses: actions/checkout@v1 + - uses: actions/checkout@v2 - name: Set up Python uses: actions/setup-python@v1 - name: Install dependencies @@ -1105,11 +1035,10 @@ jobs: tasmota32-HU: - needs: tasmota_pull runs-on: ubuntu-latest continue-on-error: true steps: - - uses: actions/checkout@v1 + - uses: actions/checkout@v2 - name: Set up Python uses: actions/setup-python@v1 - name: Install dependencies @@ -1125,11 +1054,10 @@ jobs: tasmota32-IT: - needs: tasmota_pull runs-on: ubuntu-latest continue-on-error: true steps: - - uses: actions/checkout@v1 + - uses: actions/checkout@v2 - name: Set up Python uses: actions/setup-python@v1 - name: Install dependencies @@ -1145,11 +1073,10 @@ jobs: tasmota32-KO: - needs: tasmota_pull runs-on: ubuntu-latest continue-on-error: true steps: - - uses: actions/checkout@v1 + - uses: actions/checkout@v2 - name: Set up Python uses: actions/setup-python@v1 - name: Install dependencies @@ -1165,11 +1092,10 @@ jobs: tasmota32-NL: - needs: tasmota_pull runs-on: ubuntu-latest continue-on-error: true steps: - - uses: actions/checkout@v1 + - uses: actions/checkout@v2 - name: Set up Python uses: actions/setup-python@v1 - name: Install dependencies @@ -1185,11 +1111,10 @@ jobs: tasmota32-PL: - needs: tasmota_pull runs-on: ubuntu-latest continue-on-error: true steps: - - uses: actions/checkout@v1 + - uses: actions/checkout@v2 - name: Set up Python uses: actions/setup-python@v1 - name: Install dependencies @@ -1205,11 +1130,10 @@ jobs: tasmota32-PT: - needs: tasmota_pull runs-on: ubuntu-latest continue-on-error: true steps: - - uses: actions/checkout@v1 + - uses: actions/checkout@v2 - name: Set up Python uses: actions/setup-python@v1 - name: Install dependencies @@ -1225,11 +1149,10 @@ jobs: tasmota32-RO: - needs: tasmota_pull runs-on: ubuntu-latest continue-on-error: true steps: - - uses: actions/checkout@v1 + - uses: actions/checkout@v2 - name: Set up Python uses: actions/setup-python@v1 - name: Install dependencies @@ -1245,11 +1168,10 @@ jobs: tasmota32-RU: - needs: tasmota_pull runs-on: ubuntu-latest continue-on-error: true steps: - - uses: actions/checkout@v1 + - uses: actions/checkout@v2 - name: Set up Python uses: actions/setup-python@v1 - name: Install dependencies @@ -1265,11 +1187,10 @@ jobs: tasmota32-SE: - needs: tasmota_pull runs-on: ubuntu-latest continue-on-error: true steps: - - uses: actions/checkout@v1 + - uses: actions/checkout@v2 - name: Set up Python uses: actions/setup-python@v1 - name: Install dependencies @@ -1285,11 +1206,10 @@ jobs: tasmota32-SK: - needs: tasmota_pull runs-on: ubuntu-latest continue-on-error: true steps: - - uses: actions/checkout@v1 + - uses: actions/checkout@v2 - name: Set up Python uses: actions/setup-python@v1 - name: Install dependencies @@ -1305,11 +1225,10 @@ jobs: tasmota32-TR: - needs: tasmota_pull runs-on: ubuntu-latest continue-on-error: true steps: - - uses: actions/checkout@v1 + - uses: actions/checkout@v2 - name: Set up Python uses: actions/setup-python@v1 - name: Install dependencies @@ -1325,11 +1244,10 @@ jobs: tasmota32-TW: - needs: tasmota_pull runs-on: ubuntu-latest continue-on-error: true steps: - - uses: actions/checkout@v1 + - uses: actions/checkout@v2 - name: Set up Python uses: actions/setup-python@v1 - name: Install dependencies @@ -1345,11 +1263,10 @@ jobs: tasmota32-UK: - needs: tasmota_pull runs-on: ubuntu-latest continue-on-error: true steps: - - uses: actions/checkout@v1 + - uses: actions/checkout@v2 - name: Set up Python uses: actions/setup-python@v1 - name: Install dependencies @@ -1365,11 +1282,10 @@ jobs: tasmota32-VN: - needs: tasmota_pull runs-on: ubuntu-latest continue-on-error: true steps: - - uses: actions/checkout@v1 + - uses: actions/checkout@v2 - name: Set up Python uses: actions/setup-python@v1 - name: Install dependencies @@ -1389,7 +1305,7 @@ jobs: runs-on: ubuntu-latest continue-on-error: true steps: - - uses: actions/checkout@v1 + - uses: actions/checkout@v2 - uses: actions/download-artifact@v2 with: name: firmware @@ -1404,48 +1320,41 @@ jobs: files: ./mv_firmware/firmware/* env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - + - name: Move firmware files in sub-folders run: | - mkdir -p ./firmware/tasmota/languages - mkdir -p ./firmware/tasmota32/languages - mkdir -p ./firmware/tasmota32/ESP32_needed_files/ - mkdir -p ./firmware/tasmota32/Odroid_go_and_core2_needed_files/ - mkdir -p ./firmware/map - [ ! -f ./mv_firmware/map/* ] || mv ./mv_firmware/map/* ./firmware/map/ - [ ! -f ./mv_firmware/firmware/tasmota.* ] || mv ./mv_firmware/firmware/tasmota.* ./firmware/tasmota/ - [ ! -f ./mv_firmware/firmware/tasmota-sensors.* ] || mv ./mv_firmware/firmware/tasmota-sensors.* ./firmware/tasmota/ - [ ! -f ./mv_firmware/firmware/tasmota-minimal.* ] || mv ./mv_firmware/firmware/tasmota-minimal.* ./firmware/tasmota/ - [ ! -f ./mv_firmware/firmware/tasmota-lite.* ] || mv ./mv_firmware/firmware/tasmota-lite.* ./firmware/tasmota/ - [ ! -f ./mv_firmware/firmware/tasmota-ir*.* ] || mv ./mv_firmware/firmware/tasmota-ir*.* ./firmware/tasmota/ - [ ! -f ./mv_firmware/firmware/tasmota-display.* ] || mv ./mv_firmware/firmware/tasmota-display.* ./firmware/tasmota/ - [ ! -f ./mv_firmware/firmware/tasmota-knx.* ] || mv ./mv_firmware/firmware/tasmota-knx.* ./firmware/tasmota/ - [ ! -f ./mv_firmware/firmware/tasmota-zbbridge.* ] || mv ./mv_firmware/firmware/tasmota-zbbridge.* ./firmware/tasmota/ - [ ! -f ./mv_firmware/firmware/tasmota-zigbee.* ] || mv ./mv_firmware/firmware/tasmota-zigbee.* ./firmware/tasmota/ - [ ! -f ./mv_firmware/firmware/tasmota32.* ] || mv ./mv_firmware/firmware/tasmota32.* ./firmware/tasmota32/ - [ ! -f ./mv_firmware/firmware/tasmota32solo1*.* ] || mv ./mv_firmware/firmware/tasmota32solo1*.* ./firmware/tasmota32/ - [ ! -f ./mv_firmware/firmware/tasmota32-ir*.* ] || mv ./mv_firmware/firmware/tasmota32-ir*.* ./firmware/tasmota32/ - [ ! -f ./mv_firmware/firmware/tasmota32-display.* ] || mv ./mv_firmware/firmware/tasmota32-display.* ./firmware/tasmota32/ - [ ! -f ./mv_firmware/firmware/tasmota32-lvgl.* ] || mv ./mv_firmware/firmware/tasmota32-lvgl.* ./firmware/tasmota32/ - [ ! -f ./mv_firmware/firmware/tasmota32-web*.* ] || mv ./mv_firmware/firmware/tasmota32-web*.* ./firmware/tasmota32/ - [ ! -f ./mv_firmware/firmware/tasmota32-odroidgo.* ] || mv ./mv_firmware/firmware/tasmota32-odroidgo.* ./firmware/tasmota32/ - [ ! -f ./mv_firmware/firmware/tasmota32-core2.* ] || mv ./mv_firmware/firmware/tasmota32-core2.* ./firmware/tasmota32/ - [ ! -f ./mv_firmware/firmware/tasmota32-bluetooth.* ] || mv ./mv_firmware/firmware/tasmota32-bluetooth.* ./firmware/tasmota32/ - [ ! -f ./mv_firmware/firmware/tasmota32* ] || mv ./mv_firmware/firmware/tasmota32* ./firmware/tasmota32/languages/ - [ ! -f ./mv_firmware/firmware/* ] || mv ./mv_firmware/firmware/* ./firmware/tasmota/languages/ - [ ! -f ./tools/Esptool/ESP32/*.* ] || mv ./tools/Esptool/ESP32/*.* ./firmware/tasmota32/ESP32_needed_files/ - [ ! -f ./tools/Esptool/Odroid_go_and_core2/*.* ] || mv ./tools/Esptool/Odroid_go_and_core2/*.* ./firmware/tasmota32/Odroid_go_and_core2_needed_files/ - [ ! -f ./FIRMWARE.md ] || mv -f ./RELEASENOTES.md ./README.md - - name: Commit files # transfer the new binaries back into the repository - run: | - git config --local user.name "Platformio BUILD" - git rm -r --cached . - git add ./README.md - git add -f ./firmware/*.* - git commit -m "Tasmota ESP Binaries http://tasmota.com" - - name: Push changes # push the firmware files to branch firmware - uses: ad-m/github-push-action@master + mkdir -p ./release-firmware/tasmota/languages + mkdir -p ./release-firmware/tasmota32/languages + mkdir -p ./release-firmware/map + [ ! -f ./mv_firmware/map/* ] || mv ./mv_firmware/map/* ./release-firmware/map/ + [ ! -f ./mv_firmware/firmware/tasmota.* ] || mv ./mv_firmware/firmware/tasmota.* ./release-firmware/tasmota/ + [ ! -f ./mv_firmware/firmware/tasmota-sensors.* ] || mv ./mv_firmware/firmware/tasmota-sensors.* ./release-firmware/tasmota/ + [ ! -f ./mv_firmware/firmware/tasmota-minimal.* ] || mv ./mv_firmware/firmware/tasmota-minimal.* ./release-firmware/tasmota/ + [ ! -f ./mv_firmware/firmware/tasmota-lite.* ] || mv ./mv_firmware/firmware/tasmota-lite.* ./release-firmware/tasmota/ + [ ! -f ./mv_firmware/firmware/tasmota-ir*.* ] || mv ./mv_firmware/firmware/tasmota-ir*.* ./release-firmware/tasmota/ + [ ! -f ./mv_firmware/firmware/tasmota-display.* ] || mv ./mv_firmware/firmware/tasmota-display.* ./release-firmware/tasmota/ + [ ! -f ./mv_firmware/firmware/tasmota-knx.* ] || mv ./mv_firmware/firmware/tasmota-knx.* ./release-firmware/tasmota/ + [ ! -f ./mv_firmware/firmware/tasmota-zbbridge.* ] || mv ./mv_firmware/firmware/tasmota-zbbridge.* ./release-firmware/tasmota/ + [ ! -f ./mv_firmware/firmware/tasmota-zigbee.* ] || mv ./mv_firmware/firmware/tasmota-zigbee.* ./release-firmware/tasmota/ + [ ! -f ./mv_firmware/firmware/tasmota32.* ] || mv ./mv_firmware/firmware/tasmota32.* ./release-firmware/tasmota32/ + [ ! -f ./mv_firmware/firmware/tasmota32solo1*.* ] || mv ./mv_firmware/firmware/tasmota32solo1*.* ./release-firmware/tasmota32/ + [ ! -f ./mv_firmware/firmware/tasmota32-ir*.* ] || mv ./mv_firmware/firmware/tasmota32-ir*.* ./release-firmware/tasmota32/ + [ ! -f ./mv_firmware/firmware/tasmota32-display.* ] || mv ./mv_firmware/firmware/tasmota32-display.* ./release-firmware/tasmota32/ + [ ! -f ./mv_firmware/firmware/tasmota32-lvgl.* ] || mv ./mv_firmware/firmware/tasmota32-lvgl.* ./release-firmware/tasmota32/ + [ ! -f ./mv_firmware/firmware/tasmota32-web*.* ] || mv ./mv_firmware/firmware/tasmota32-web*.* ./release-firmware/tasmota32/ + [ ! -f ./mv_firmware/firmware/tasmota32-odroidgo.* ] || mv ./mv_firmware/firmware/tasmota32-odroidgo.* ./release-firmware/tasmota32/ + [ ! -f ./mv_firmware/firmware/tasmota32-core2.* ] || mv ./mv_firmware/firmware/tasmota32-core2.* ./release-firmware/tasmota32/ + [ ! -f ./mv_firmware/firmware/tasmota32-bluetooth.* ] || mv ./mv_firmware/firmware/tasmota32-bluetooth.* ./release-firmware/tasmota32/ + [ ! -f ./mv_firmware/firmware/tasmota32* ] || mv ./mv_firmware/firmware/tasmota32* ./release-firmware/tasmota32/languages/ + [ ! -f ./mv_firmware/firmware/* ] || mv ./mv_firmware/firmware/* ./release-firmware/tasmota/languages/ + - name: Display files + run: ls -R ./* + - name: Push Firmware files to https://github.com/arendst/Tasmota-firmware + uses: dmnemec/copy_file_to_another_repo_action@main + env: + API_TOKEN_GITHUB: ${{ secrets.API_TOKEN_GITHUB }} with: - github_token: ${{ secrets.GITHUB_TOKEN }} - branch: 'release-firmware' - force: true + source_file: 'release-firmware' + destination_repo: 'arendst/Tasmota-firmware' + user_email: 'github-actions@github.com' + user_name: 'github-actions' diff --git a/CHANGELOG.md b/CHANGELOG.md index 17fb77879..f4a01c052 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,17 +3,66 @@ All notable changes to this project will be documented in this file. ## [Unreleased] - Development -## [9.5.0.3] +## [9.5.0.6] +### Added +- Version bump to monitor possible HTTP issues releated to ``SetOption128`` + +## [9.5.0.5] 20210815 +### Added +- Inital support for Wi-Fi extender (#12784) +- Neopool commands ``NPPHRes``, ``NPCLRes`` and ``NPIonRes`` (#12813) +- Support for (Yeelight) Mi Desk Pro using binary tasmota32solo1.bin +- Initial support for influxdb using ``#define USE_INFLUXDB`` and several ``Ifx`` commands +- Command ``SetOption128 1`` disabling web referer check default blocking HTTP web commands (#12828) + +### Changed +- NeoPixelBus library from v2.6.3 to v2.6.7 +- Make Sonoff L1 MusicSync persistent (#12008) +- Relax NTP poll if no ntpserver can be resolved by DNS +- Move firmware binaries to https://github.com/arendst/Tasmota-firmware/tree/main/release-firmware +- Default disable CORS for enhanced security and provide user compile option ``#define USE_CORS`` (#12827) +- Prometheus: All metrics are prefixed with ``tasmota_`` (#12842) + Memory metrics have been cleaned up to work consistently between ESP8266 and ESP32 + The device name is reported as an info metric + +### Fixed +- Neopool communication error (#12813) +- Negative power values for ADE7953 based devices like Shelly EM (#12874) + +## [9.5.0.4] 20210801 +### Added +- Support for second DNS server +- Optional IP filter to command ``TCPStart`` (#12806) + +### Changed +- ESP8266Audio library from v1.5.0 to v1.9.2 + +## [9.5.0.3] 20210729 ### Added - Command ``SetSensor1..127 0|1`` to globally disable individual sensor driver - Support for CAN bus and Freedom Won Battery Management System by Marius Bezuidenhout (#12651) +- Berry ESP32 support for I2S audio mp3 playback +- Berry add module ``introspect`` +- Berry add ``tasmota.wifi()`` and ``tasmota.eth()`` +- LVGL new widget ``lv_wifi_bars`` + +### Changed +- ESP32 core library from v1.0.7.1 to v1.0.7.3 - Disable PSRAM on unsupported hardware +- Replace spaces by hyphens in final hostname (#12710) +- Message ``Upload buffer miscompare`` into ``Not enough space`` +- ESP32 remove GPIO initialization to INPUT from not used GPIOs to allow JTAG support + +### Fixed +- Discovery fails when using ``%hostname%`` in a topic (#12710) +- ESP32-Solo OTA upgrade +- ESP32 buzzer in PWM mode exception (#12717) ## [9.5.0.2] 20210714 ### Added - Initial support for Tasmota Mesh (TasMesh) providing node/broker communication using ESP-NOW (#11939) - MQTT minimum password length restriction in GUI (#12553) -- Command ``SetOption127 1`` to force Wifi in no-sleep mode even if ``Sleep 0`` is not enabled +- Command ``SetOption127 1`` to force Wi-Fi in no-sleep mode even if ``Sleep 0`` is not enabled - Support for Technoline WS2300-15 Anemometer (#12573) - Support for Telaire T6700 Series CO2 sensor by Alexander Savchenko (#12618) diff --git a/FIRMWARE.md b/FIRMWARE.md index cc03ba3a8..7262450aa 100644 --- a/FIRMWARE.md +++ b/FIRMWARE.md @@ -27,7 +27,7 @@ See [CHANGELOG.md](https://github.com/arendst/Tasmota/blob/development/tasmota/C Unless your Tasmota powered device exhibits a problem or you need to make use of a feature that is not available in the Tasmota version currently installed on your device, leave your device alone - it works so don't make unnecessary changes! If the release version (i.e., the master branch) exhibits unexpected behaviour for your device and configuration, you should upgrade to the latest development version instead to see if your problem is resolved as some bugs in previous releases or development builds may already have been resolved. -If new commits have been merged and they compile successfuly, new binary files for every variant will be placed here https://github.com/arendst/Tasmota/tree/firmware/firmware (this URL address can NOT be used for OTA updates) It is important to note that these binaries are based on the current development codebase. These commits are tested as much as is possible and are typically quite stable. However, it is infeasible to test on the hundreds of different types of devices with all the available configuration options permitted. +If new commits have been merged and they compile successfuly, new binary files for every variant will be placed here https://github.com/arendst/Tasmota-firmware/tree/main/firmware (this URL address can NOT be used for OTA updates) It is important to note that these binaries are based on the current development codebase. These commits are tested as much as is possible and are typically quite stable. However, it is infeasible to test on the hundreds of different types of devices with all the available configuration options permitted. Note that there is a chance, as with any upgrade, that the device may not function as expected. You must always account for the possibility that you may need to flash the device via the serial programming interface if the OTA upgrade fails. Even with the master release, you should always attempt to test the device or a similar prototype before upgrading a device which is in production or is hard to reach. And, as always, make a backup of the device configuration before beginning any firmware update. @@ -40,5 +40,5 @@ If your device connects to mains electricity (AC power) there is danger of elect We don't take any responsibility nor liability for using this software nor for the installation or any tips, advice, videos, etc. given by any member of this site or any related site. ## Quick Install -Download one of the binaries https://github.com/arendst/Tasmota/tree/firmware/firmware and flash it to your hardware [using our installation guide](https://tasmota.github.io/docs/Getting-Started). +Download one of the binaries https://github.com/arendst/Tasmota-firmware/tree/main/firmware and flash it to your hardware [using our installation guide](https://tasmota.github.io/docs/Getting-Started). diff --git a/README.md b/README.md index 3f8e113d7..e76dde344 100644 --- a/README.md +++ b/README.md @@ -19,7 +19,7 @@ See [RELEASENOTES.md](https://github.com/arendst/Tasmota/blob/master/RELEASENOTE Firmware binaries can be downloaded from http://ota.tasmota.com/tasmota/release/ or http://ota.tasmota.com/tasmota32/release/ for ESP32 binaries. -Easy initial installation of Tasmota can be performed using the [Tasmota WebInstaller](https://arendst.github.io/Tasmota/). +Easy initial installation of Tasmota can be performed using the [Tasmota WebInstaller](https://arendst.github.io/Tasmota-firmware/). ## Development diff --git a/RELEASENOTES.md b/RELEASENOTES.md index 8eb3fae60..828af7ac0 100644 --- a/RELEASENOTES.md +++ b/RELEASENOTES.md @@ -40,7 +40,7 @@ For initial configuration this release supports Webserver based **WifiManager** ## Initial installation -Easy initial installation of Tasmota can be performed using the [Tasmota WebInstaller](https://arendst.github.io/Tasmota/). +Easy initial installation of Tasmota can be performed using the [Tasmota WebInstaller](https://arendst.github.io/Tasmota-firmware/). ## Provided Binary Downloads @@ -60,7 +60,7 @@ The following binary downloads have been compiled with ESP8266/Arduino library c Above binaries are also available as gzipped version allowing faster uploads. Latest released binaries can be downloaded from -- https://github.com/arendst/Tasmota/tree/release-firmware +- https://github.com/arendst/Tasmota-firmware/tree/main/release-firmware - http://ota.tasmota.com/tasmota/release Historical binaries can be downloaded from @@ -69,7 +69,7 @@ Historical binaries can be downloaded from The latter links can be used for OTA upgrades too like ``OtaUrl http://ota.tasmota.com/tasmota/release/tasmota.bin.gz`` ### ESP32 based -The following binary downloads have been compiled with ESP32/Arduino library core version **1.0.6**. +The following binary downloads have been compiled with ESP32/Arduino library core version **1.0.7.3**. - **tasmota32.bin** = The Tasmota version with most drivers including additional sensors and KNX for 4M+ flash. **RECOMMENDED RELEASE BINARY** - **tasmota32_8M.bin** = The Tasmota version with most drivers including additional sensors and KNX for 8M+ flash. @@ -84,7 +84,7 @@ The following binary downloads have been compiled with ESP32/Arduino library cor - **tasmota32-core2.bin** = The Core2 version is specifically tailored to M5Stack Core2 hardware for 8M+ flash. Latest released binaries can be downloaded from -- https://github.com/arendst/Tasmota/tree/release-firmware +- https://github.com/arendst/Tasmota-firmware/tree/main/release-firmware - http://ota.tasmota.com/tasmota32/release Historical binaries can be downloaded from @@ -98,36 +98,57 @@ 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 v9.5.0.3 +## Changelog v9.5.0.6 ### Added -- Release of [Tasmota WebInstaller](https://arendst.github.io/Tasmota/) -- Command ``SetOption127 1`` to force Wifi in no-sleep mode even if ``Sleep 0`` is not enabled +- Release of [Tasmota WebInstaller](https://arendst.github.io/Tasmota-firmware/) +- Command ``SetOption127 1`` to force Wi-Fi in no-sleep mode even if ``Sleep 0`` is not enabled - Command ``SetSensor1..127 0|1`` to globally disable individual sensor driver +- Neopool commands ``NPPHRes``, ``NPCLRes`` and ``NPIonRes`` [#12813](https://github.com/arendst/Tasmota/issues/12813) +- Support for second DNS server +- Support for (Yeelight) Mi Desk Pro using binary tasmota32solo1.bin +- Initial support for influxdb using ``#define USE_INFLUXDB`` and several ``Ifx`` commands - Initial support for Tasmota Mesh (TasMesh) providing node/broker communication using ESP-NOW [#11939](https://github.com/arendst/Tasmota/issues/11939) - Berry ESP32 partition manager [#12465](https://github.com/arendst/Tasmota/issues/12465) +- Berry ESP32 support for I2S audio mp3 playback - Support for AM2320 Temperature and Humidity Sensor by Lars Wessels [#12485](https://github.com/arendst/Tasmota/issues/12485) - Rule event support as JSON payload [#12496](https://github.com/arendst/Tasmota/issues/12496) - MQTT minimum password length restriction in GUI [#12553](https://github.com/arendst/Tasmota/issues/12553) - Support for Technoline WS2300-15 Anemometer [#12573](https://github.com/arendst/Tasmota/issues/12573) - Support for Telaire T6700 Series CO2 sensor by Alexander Savchenko [#12618](https://github.com/arendst/Tasmota/issues/12618) - Support for CAN bus and Freedom Won Battery Management System by Marius Bezuidenhout [#12651](https://github.com/arendst/Tasmota/issues/12651) +- Optional IP filter to command ``TCPStart`` [#12806](https://github.com/arendst/Tasmota/issues/12806) +- Inital support for Wi-Fi extender [#12784](https://github.com/arendst/Tasmota/issues/12784) +- Command ``SetOption128 1`` disabling web referer check default blocking HTTP web commands [#12828](https://github.com/arendst/Tasmota/issues/12828) ### Changed -- ESP32 core library from v1.0.6 to v1.0.7.1 +- Move firmware binaries to https://github.com/arendst/Tasmota-firmware/tree/main/release-firmware +- ESP32 core library from v1.0.6 to v1.0.7.3 - IRremoteESP8266 library from v2.7.18 to v2.7.19 +- NeoPixelBus library from v2.6.3 to v2.6.7 +- Message ``Upload buffer miscompare`` into ``Not enough space`` - ESP32 Ethernet Phy Type information to IDF v3+ - Speed up initial GUI console refresh - Enable UFILESYS, GUI_TRASH_FILE and GUI_EDIT_FILE for any device compiled with more than 1M flash size - ESP32 internal sensor driver id moved from 87 to 127 - Extended supported sensor driver range to 128 +- Disable PSRAM on unsupported hardware +- ESP32 remove GPIO initialization to INPUT from not used GPIOs to allow JTAG support +- Relax NTP poll if no ntpserver can be resolved by DNS +- Make Sonoff L1 MusicSync persistent [#12008](https://github.com/arendst/Tasmota/issues/12008) - Simplified configuration for ir-full and removal of tasmota-ircustom [#12428](https://github.com/arendst/Tasmota/issues/12428) - Refactor platformio [#12442](https://github.com/arendst/Tasmota/issues/12442) - Allow buttons to work in AP normal mode [#12518](https://github.com/arendst/Tasmota/issues/12518) - Enable Ping and rule features for any device compiled with more than 1M flash size [#12539](https://github.com/arendst/Tasmota/issues/12539) +- Replace spaces by hyphens in final hostname [#12710](https://github.com/arendst/Tasmota/issues/12710) +- Default disable CORS for enhanced security and provide user compile option ``#define USE_CORS`` [#12827](https://github.com/arendst/Tasmota/issues/12827) +- Prometheus: All metrics are prefixed with ``tasmota_`` [#12842](https://github.com/arendst/Tasmota/issues/12842) + Memory metrics have been cleaned up to work consistently between ESP8266 and ESP32 + The device name is reported as an info metric ### Fixed - ESP32 core v2.0.0 setting hostname - ESP32-C3 settings layout for configuration backup and restore +- ESP32-Solo OTA upgrade - DDS238-2 wrong reactive power value [#12283](https://github.com/arendst/Tasmota/issues/12283) - ESP32 Webcam add boundary marker before sending mjpeg image [#12376](https://github.com/arendst/Tasmota/issues/12376) - NO VALID JSON regression from may 4th [#12440](https://github.com/arendst/Tasmota/issues/12440) @@ -140,6 +161,7 @@ The latter links can be used for OTA upgrades too like ``OtaUrl http://ota.tasmo - Exception 28 when unable to send MQTT message and a topic name without a slash '/' [#12555](https://github.com/arendst/Tasmota/issues/12555) - Wi-Fi initial setup workaround for 11n only routers [#12566](https://github.com/arendst/Tasmota/issues/12566) - ESP32 do not use chip temperature sensor as global temperature if external temperature sensor is used [#12630](https://github.com/arendst/Tasmota/issues/12630) - -### Noted -- ESP32 single core **tasmota32solo1.bin** binary can only be uploaded using the GUI as OTA upload will trigger the watchdog timer \ No newline at end of file +- Discovery fails when using ``%hostname%`` in a topic [#12710](https://github.com/arendst/Tasmota/issues/12710) +- ESP32 buzzer in PWM mode exception (#12717)[#12717](https://github.com/arendst/Tasmota/issues/12717) +- Neopool communication error [#12813](https://github.com/arendst/Tasmota/issues/12813) +- Negative power values for ADE7953 based devices like Shelly EM [#12874](https://github.com/arendst/Tasmota/issues/12874) diff --git a/boards/esp32-cam.json b/boards/esp32-cam.json index ce02822f5..e9b30d24f 100644 --- a/boards/esp32-cam.json +++ b/boards/esp32-cam.json @@ -19,7 +19,7 @@ "can" ], "debug": { - "openocd_board": "esp-wroom-32.cfg" + "openocd_target": "esp32.cfg" }, "frameworks": [ "arduino", diff --git a/boards/esp32-m5core2.json b/boards/esp32-m5core2.json index c5055333a..0170649fa 100644 --- a/boards/esp32-m5core2.json +++ b/boards/esp32-m5core2.json @@ -18,6 +18,9 @@ "ethernet", "can" ], + "debug": { + "openocd_target": "esp32.cfg" + }, "frameworks": [ "arduino", "espidf" diff --git a/boards/esp32-odroid.json b/boards/esp32-odroid.json index 690119675..28b82ba29 100644 --- a/boards/esp32-odroid.json +++ b/boards/esp32-odroid.json @@ -18,6 +18,9 @@ "ethernet", "can" ], + "debug": { + "openocd_target": "esp32.cfg" + }, "frameworks": [ "arduino", "espidf" diff --git a/boards/esp32_16M.json b/boards/esp32_16M.json index 6ebd73c76..7bcc0db53 100644 --- a/boards/esp32_16M.json +++ b/boards/esp32_16M.json @@ -19,7 +19,7 @@ "can" ], "debug": { - "openocd_board": "esp-wroom-32.cfg" + "openocd_target": "esp32.cfg" }, "frameworks": [ "arduino", diff --git a/boards/esp32_4M.json b/boards/esp32_4M.json index 91ee508ea..4f549bb3e 100644 --- a/boards/esp32_4M.json +++ b/boards/esp32_4M.json @@ -19,7 +19,7 @@ "can" ], "debug": { - "openocd_board": "esp-wroom-32.cfg" + "openocd_target": "esp32.cfg" }, "frameworks": [ "arduino", diff --git a/boards/esp32_8M.json b/boards/esp32_8M.json index ad13a394f..616eb16d3 100644 --- a/boards/esp32_8M.json +++ b/boards/esp32_8M.json @@ -19,7 +19,7 @@ "can" ], "debug": { - "openocd_board": "esp-wroom-32.cfg" + "openocd_target": "esp32.cfg" }, "frameworks": [ "arduino", diff --git a/boards/esp32_solo1_4M.json b/boards/esp32_solo1_4M.json new file mode 100644 index 000000000..64759d331 --- /dev/null +++ b/boards/esp32_solo1_4M.json @@ -0,0 +1,38 @@ +{ + "build": { + "arduino":{ + "ldscript": "esp32_out.ld" + }, + "core": "esp32", + "extra_flags": "-DARDUINO_ESP32_DEV -DESP32_4M", + "f_cpu": "80000000L", + "f_flash": "40000000L", + "flash_mode": "dout", + "mcu": "esp32", + "variant": "esp32", + "partitions": "esp32_partition_app1856k_spiffs320k.csv" + }, + "connectivity": [ + "wifi", + "bluetooth", + "ethernet", + "can" + ], + "debug": { + "openocd_target": "esp32-solo-1.cfg" + }, + "frameworks": [ + "arduino", + "espidf" + ], + "name": "Espressif Generic ESP32 4M Flash, Tasmota 1856k Code/OTA, 320k SPIFFS", + "upload": { + "flash_size": "4MB", + "maximum_ram_size": 327680, + "maximum_size": 4194304, + "require_upload_port": true, + "speed": 460800 + }, + "url": "https://en.wikipedia.org/wiki/ESP32", + "vendor": "Espressif" +} diff --git a/boards/esp32c3.json b/boards/esp32c3.json index e4ce02579..cedcf1500 100644 --- a/boards/esp32c3.json +++ b/boards/esp32c3.json @@ -14,8 +14,12 @@ "connectivity": [ "wifi" ], + "debug": { + "openocd_target": "esp32c3.cfg" + }, "frameworks": [ - "arduino" + "arduino", + "espidf" ], "name": "Espressif Generic ESP32-C3 4M Flash, Tasmota 1856k Code/OTA, 320k SPIFFS", "upload": { @@ -25,6 +29,6 @@ "require_upload_port": true, "speed": 460800 }, - "url": "https://docs.espressif.com/projects/esp-idf/en/latest", + "url": "https://docs.espressif.com/projects/esp-idf/en/latest/esp32c3/hw-reference/esp32c3/user-guide-devkitm-1.html", "vendor": "Espressif" } diff --git a/lib/lib_audio/ESP8266Audio/README.md b/lib/lib_audio/ESP8266Audio/README.md index c8c92ff67..f243db52a 100644 --- a/lib/lib_audio/ESP8266Audio/README.md +++ b/lib/lib_audio/ESP8266Audio/README.md @@ -1,4 +1,4 @@ -# ESP8266Audio - supports ESP8266 & ESP32 [![Gitter](https://badges.gitter.im/ESP8266Audio/community.svg)](https://gitter.im/ESP8266Audio/community?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge) +# ESP8266Audio - supports ESP8266 & ESP32 & Raspberry Pi RP2040[![Gitter](https://badges.gitter.im/ESP8266Audio/community.svg)](https://gitter.im/ESP8266Audio/community?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge) Arduino library for parsing and decoding MOD, WAV, MP3, FLAC, MIDI, AAC, and RTTL files and playing them on an I2S DAC or even using a software-simulated delta-sigma DAC with dynamic 32x-128x oversampling. ESP8266 is fully supported and most mature, but ESP32 is also mostly there with built-in DAC as well as external ones. diff --git a/lib/lib_audio/ESP8266Audio/examples/PlayWAVFromFunction/PlayWAVFromFunction.ino b/lib/lib_audio/ESP8266Audio/examples/PlayWAVFromFunction/PlayWAVFromFunction.ino new file mode 100644 index 000000000..fe0cc896d --- /dev/null +++ b/lib/lib_audio/ESP8266Audio/examples/PlayWAVFromFunction/PlayWAVFromFunction.ino @@ -0,0 +1,78 @@ +#include +#include "AudioFileSourceFunction.h" +#include "AudioGeneratorWAV.h" +#include "AudioOutputI2SNoDAC.h" + +float hz = 440.f; + +// pre-defined function can also be used to generate the wave +float sine_wave(const float time) { + float v = sin(TWO_PI * hz * time); // C + v *= fmod(time, 1.f); // change linear + v *= 0.5; // scale + return v; +}; + +AudioGeneratorWAV* wav; +AudioFileSourceFunction* file; +AudioOutputI2SNoDAC* out; + +void setup() { + Serial.begin(115200); + delay(1000); + + // ===== create instance with length of song in [sec] ===== + file = new AudioFileSourceFunction(8.); + // + // you can set (sec, channels, hz, bit/sample) but you should care about + // the trade-off between performance and the audio quality + // + // file = new AudioFileSourceFunction(sec, channels, hz, bit/sample); + // channels : default = 1 + // hz : default = 8000 (8000, 11025, 22050, 44100, 48000, etc.) + // bit/sample : default = 16 (8, 16, 32) + + // ===== set your sound function ===== + file->addAudioGenerators([&](const float time) { + float v = sin(TWO_PI * hz * time); // generate sine wave + v *= fmod(time, 1.f); // change linear + v *= 0.5; // scale + return v; + }); + // + // sound function should have one argument(float) and one return(float) + // param : float (current time [sec] of the song) + // return : float (the amplitude of sound which varies from -1.f to +1.f) + // + // sound function can be registerd only one or the same number with channels + // if the channels > 1 && the number of function == 1, + // same function are used to generate the sound in every channel + // + // file = new AudioFileSourceFunction(8., 2); + // file->addAudioGenerators( + // // L (channel 0) + // [](const float time) { + // return 0.25 * sin(TWO_PI * 440.f * time) * fmod(time, 1.f); // C + // }, + // // R (channel 1) + // [](const float time) { + // return 0.25 * sin(TWO_PI * 550.f * time) * fmod(time, 1.f); // E + // } + // ); + // + // you can also use the pre-defined function + // file->addAudioGenerators(sine_wave); + + out = new AudioOutputI2SNoDAC(); + wav = new AudioGeneratorWAV(); + wav->begin(file, out); +} + +void loop() { + if (wav->isRunning()) { + if (!wav->loop()) wav->stop(); + } else { + Serial.println("function done!"); + delay(1000); + } +} diff --git a/lib/lib_audio/ESP8266Audio/examples/PlayWAVFromPROGMEM/PlayWAVFromPROGMEM.ino b/lib/lib_audio/ESP8266Audio/examples/PlayWAVFromPROGMEM/PlayWAVFromPROGMEM.ino index 5221c913c..cb488f1c3 100644 --- a/lib/lib_audio/ESP8266Audio/examples/PlayWAVFromPROGMEM/PlayWAVFromPROGMEM.ino +++ b/lib/lib_audio/ESP8266Audio/examples/PlayWAVFromPROGMEM/PlayWAVFromPROGMEM.ino @@ -1,9 +1,4 @@ #include -#ifdef ESP32 - #include -#else - #include -#endif #include "AudioFileSourcePROGMEM.h" #include "AudioGeneratorWAV.h" @@ -18,7 +13,6 @@ AudioOutputI2SNoDAC *out; void setup() { - WiFi.mode(WIFI_OFF); Serial.begin(115200); delay(1000); Serial.printf("WAV start\n"); diff --git a/lib/lib_audio/ESP8266Audio/examples/StreamMP3FromHTTP/StreamMP3FromHTTP.ino b/lib/lib_audio/ESP8266Audio/examples/StreamMP3FromHTTP/StreamMP3FromHTTP.ino index 8ea451576..84d7d5b37 100644 --- a/lib/lib_audio/ESP8266Audio/examples/StreamMP3FromHTTP/StreamMP3FromHTTP.ino +++ b/lib/lib_audio/ESP8266Audio/examples/StreamMP3FromHTTP/StreamMP3FromHTTP.ino @@ -22,7 +22,7 @@ const char* ssid = STASSID; const char* password = STAPSK; // Randomly picked URL -const char *URL="http://streaming.shoutcast.com/80sPlanet?lang=en-US"; +const char *URL="http://kvbstreams.dyndns.org:8000/wkvi-am"; AudioGeneratorMP3 *mp3; AudioFileSourceICYStream *file; diff --git a/lib/lib_audio/ESP8266Audio/examples/StreamOnHost/AudioOutputLinuxDSP.h b/lib/lib_audio/ESP8266Audio/examples/StreamOnHost/AudioOutputLinuxDSP.h new file mode 100644 index 000000000..743410e84 --- /dev/null +++ b/lib/lib_audio/ESP8266Audio/examples/StreamOnHost/AudioOutputLinuxDSP.h @@ -0,0 +1,118 @@ +/* + AudioOutput + Base class of an audio output player + + Copyright (C) 2017 Earle F. Philhower, III + + 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 . +*/ + +#ifndef _AUDIOOUTPUTNULLSLOW_H +#define _AUDIOOUTPUTNULLSLOW_H + +#include +#include +#include +#include +#include +#include +#include + +#include "AudioOutput.h" + +class AudioOutputNullSlow : public AudioOutput +{ + public: + AudioOutputNullSlow() { }; + ~AudioOutputNullSlow() {}; + virtual bool begin() { samples = 0; startms = millis(); return true; } + + virtual bool ConsumeSample(int16_t sample[2]) { + + if (fd < 0) { + fd = open("/dev/dsp", O_RDWR); + if (fd < 0) { + perror("open of /dev/dsp failed (Try with 'padsp this-exec')"); + exit(1); + } + } + + if (channels && lastchannels != channels) { + Serial.printf("CHANNELS=%d\n", channels); + int arg = channels; /* mono or stereo */ + int status = ioctl(fd, SOUND_PCM_WRITE_CHANNELS, &arg); + if (status == -1) { + perror("SOUND_PCM_WRITE_CHANNELS ioctl failed"); + exit(1); + } else if (arg != channels) { + perror("unable to set number of channels"); + exit(1); + } + lastchannels = channels; + } + + if (lastchannels > 0 && hertz && lasthertz != hertz) { + Serial.printf("FREQ=%d\n", hertz); + int arg = hertz*4/lastchannels; /* sampling rate */ + int status = ioctl(fd, SOUND_PCM_WRITE_RATE, &arg); + if (status == -1) { + perror("SOUND_PCM_WRITE_RATE ioctl failed"); + exit(1); + } + lasthertz = hertz; + } + + if (bps && lastbps != bps) { + Serial.printf("BPS=%d\n", bps); + int arg = bps; /* sample size */ + int status = ioctl(fd, SOUND_PCM_WRITE_BITS, &arg); + if (status == -1) { + perror("SOUND_PCM_WRITE_BITS ioctl failed"); + exit(1); + } else if (arg != bps) { + perror("unable to set sample size"); + exit(1); + } + lastbps = bps; + } + + if ((++samples & ((1<<9)-1)) == 0) { + // let the main loop a chance to run + return false; + } + + if (write(fd, sample, sizeof(sample)) != sizeof(sample)) { + perror("doing sound"); + exit(1); + } + + return true; + } + + virtual bool stop() { endms = millis(); return true; }; + unsigned long GetMilliseconds() { return endms - startms; } + int GetSamples() { return samples; } + int GetFrequency() { return hertz; } + + protected: + unsigned long startms; + unsigned long endms; + int samples; + int lastchannels = -1; + int lasthertz = -1; + int lastbps = -1; + int fd = -1; +}; + +#endif diff --git a/lib/lib_audio/ESP8266Audio/examples/StreamOnHost/AudioOutputNullSlow.h b/lib/lib_audio/ESP8266Audio/examples/StreamOnHost/AudioOutputNullSlow.h new file mode 100644 index 000000000..e85cd9ee9 --- /dev/null +++ b/lib/lib_audio/ESP8266Audio/examples/StreamOnHost/AudioOutputNullSlow.h @@ -0,0 +1,57 @@ +/* + AudioOutput + Base class of an audio output player + + Copyright (C) 2017 Earle F. Philhower, III + + 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 . +*/ + +#ifndef _AUDIOOUTPUTNULLSLOW_H +#define _AUDIOOUTPUTNULLSLOW_H + +#include "AudioOutput.h" + +class AudioOutputNullSlow : public AudioOutput +{ + public: + AudioOutputNullSlow() { }; + ~AudioOutputNullSlow() {}; + virtual bool begin() { samples = 0; startms = millis(); return true; } + virtual bool ConsumeSample(int16_t sample[2]) { + // return false (= output buffer full) + // sometimes to let the main loop running + constexpr int everylog2 = 10; + if ((++samples & ((1< 0) { + // simulate real time + delay(1000/(hertz >> everylog2)); + } + return false; + } + return true; + } + virtual bool stop() { endms = millis(); return true; }; + unsigned long GetMilliseconds() { return endms - startms; } + int GetSamples() { return samples; } + int GetFrequency() { return hertz; } + + protected: + unsigned long startms; + unsigned long endms; + int samples; +}; + +#endif + diff --git a/lib/lib_audio/ESP8266Audio/examples/StreamOnHost/StreamOnHost.ino b/lib/lib_audio/ESP8266Audio/examples/StreamOnHost/StreamOnHost.ino new file mode 100644 index 000000000..876562d1b --- /dev/null +++ b/lib/lib_audio/ESP8266Audio/examples/StreamOnHost/StreamOnHost.ino @@ -0,0 +1,118 @@ +#include + +#ifdef ESP32 + #include +#else + #include +#endif +#include "AudioFileSourceICYStream.h" +#include "AudioFileSourceBuffer.h" +#include "AudioGeneratorMP3.h" +#if AUDIO +#pragma message("Outputting audio") +#include "AudioOutputLinuxDSP.h" +#else +#pragma message("No audio") +#include "AudioOutputNullSlow.h" +#endif + +// To run, set your ESP8266 build to 160MHz, update the SSID info, and upload. + +// Enter your WiFi setup here: +#ifndef STASSID +#define STASSID "your-ssid" +#define STAPSK "your-password" +#endif + +const char* ssid = STASSID; +const char* password = STAPSK; + +// Randomly picked URL +//const char *URL="http://kvbstreams.dyndns.org:8000/wkvi-am"; +//const char *URL="http://stream2.pvpjamz.com:8706/stream"; +// that one is not well decoded: +const char *URL="http://icecast.radiofrance.fr/franceinter-lofi.mp3"; + +AudioGeneratorMP3 *mp3; +AudioFileSourceICYStream *file; +AudioFileSourceBuffer *buff; +AudioOutputNullSlow *out; + +// Called when a metadata event occurs (i.e. an ID3 tag, an ICY block, etc. +void MDCallback(void *cbData, const char *type, bool isUnicode, const char *string) +{ + const char *ptr = reinterpret_cast(cbData); + (void) isUnicode; // Punt this ball for now + // Note that the type and string may be in PROGMEM, so copy them to RAM for printf + char s1[32], s2[64]; + strncpy_P(s1, type, sizeof(s1)); + s1[sizeof(s1)-1]=0; + strncpy_P(s2, string, sizeof(s2)); + s2[sizeof(s2)-1]=0; + Serial.printf("METADATA(%s) '%s' = '%s'\n", ptr, s1, s2); + Serial.flush(); +} + +// Called when there's a warning or error (like a buffer underflow or decode hiccup) +void StatusCallback(void *cbData, int code, const char *string) +{ + const char *ptr = reinterpret_cast(cbData); + // Note that the string may be in PROGMEM, so copy it to RAM for printf + char s1[64]; + strncpy_P(s1, string, sizeof(s1)); + s1[sizeof(s1)-1]=0; + Serial.printf("STATUS(%s) '%d' = '%s'\n", ptr, code, s1); + Serial.flush(); +} + + +void setup() +{ + Serial.begin(115200); + delay(1000); + Serial.println("Connecting to WiFi"); + + WiFi.disconnect(); + WiFi.softAPdisconnect(true); + WiFi.mode(WIFI_STA); + + WiFi.begin(ssid, password); + + // Try forever + while (WiFi.status() != WL_CONNECTED) { + Serial.println("...Connecting to WiFi"); + delay(1000); + } + Serial.println("Connected"); + + audioLogger = &Serial; + file = new AudioFileSourceICYStream(); + file->RegisterMetadataCB(MDCallback, (void*)"ICY"); + file->useHTTP10(); + file->open(URL); + buff = new AudioFileSourceBuffer(file, 2048); + buff->RegisterStatusCB(StatusCallback, (void*)"buffer"); + out = new AudioOutputNullSlow(); + mp3 = new AudioGeneratorMP3(); + mp3->RegisterStatusCB(StatusCallback, (void*)"mp3"); + mp3->begin(buff, out); +} + + +void loop() +{ + static int lastms = 0; + + if (mp3->isRunning()) { + if (millis()-lastms > 1000) { + lastms = millis(); + Serial.printf("Running for %d ms...\n", lastms); + Serial.flush(); + } + if (!mp3->loop()) mp3->stop(); + } else { + Serial.printf("MP3 done\n"); + delay(1000); + } +} + diff --git a/lib/lib_audio/ESP8266Audio/examples/StreamOnHost/onHost b/lib/lib_audio/ESP8266Audio/examples/StreamOnHost/onHost new file mode 100755 index 000000000..014845692 --- /dev/null +++ b/lib/lib_audio/ESP8266Audio/examples/StreamOnHost/onHost @@ -0,0 +1,66 @@ +#!/bin/bash + +ino=${PWD##*/} + +if [ ! -d "${ESP8266ARDUINO}/tests/host" ]; then + echo "\${ESP8266ARDUINO} should point to ESP8266 Arduino core directory" + exit 1 +fi + +THISLIB=$(pwd)/../.. +MAD=$(ls ${THISLIB}/src/libmad/*.c) +PAGER=${PAGER:-less} + +cd ${ESP8266ARDUINO}/tests/host + +if [ "$1" = "clean" ]; then + make clean + cd ${THISLIB} + rm -f src/*.o src/libmad/*.o + exit 0 +elif [ "$1" = diff ]; then + cd ${THISLIB}/examples + diff -u StreamMP3FromHTTP/StreamMP3FromHTTP.ino ${ino}/${ino}.ino | ${PAGER} + exit 0 +else + echo "" + echo "usage:" + echo " $0" + echo " $0 clean" + echo " $0 diff" + echo " AUDIO=a VALGRIND=v FORCE32=f $0" + echo " a=1 play sound (use padsp, open /dev/dsp)" + echo " v=1 run in native mode (FORCE32=0) with valgrind" + echo " f=1 run in 32 bits mode (if gcc-multilib is installed)" + echo "variable ESP8266ARDUINO must point to esp8266 Arduino core directory" + echo "" + [ "$1" = "-h" ] && exit 0 + sleep 1 +fi + +run="" + +[ -z "${FORCE32}" ] && FORCE32=0 +[ -z "${AUDIO}" ] && AUDIO=1 + +if [ "${AUDIO}" = 1 ]; then + run="${run} padsp" +fi + +if [ "${VALGRIND}" = 1 ]; then + FORCE32=0 + run="$run valgrind" +fi + +touch ${THISLIB}/examples/${ino}/${ino}.ino # rebuild + +eval make FORCE32=${FORCE32} -j \ + USERCSOURCES=\"${MAD}\" \ + USERCXXSOURCES=\"${THISLIB}/src/AudioFileSourceBuffer.cpp ${THISLIB}/src/AudioLogger.cpp ${THISLIB}/src/AudioGeneratorMP3.cpp ${THISLIB}/src/AudioFileSourceICYStream.cpp ${THISLIB}/src/AudioFileSourceHTTPStream.cpp\" \ + USERCFLAGS=\"-I${THISLIB}/src/ -DAUDIO=${AUDIO}\" \ + ${THISLIB}/examples/${ino}/${ino} + +set -x + +$run ./bin/${ino}/${ino} "$@" +stty sane diff --git a/lib/lib_audio/ESP8266Audio/keywords.txt b/lib/lib_audio/ESP8266Audio/keywords.txt index 251f431e3..75b11139c 100644 --- a/lib/lib_audio/ESP8266Audio/keywords.txt +++ b/lib/lib_audio/ESP8266Audio/keywords.txt @@ -22,6 +22,7 @@ AudioGeneratorWAV KEYWORD1 AudioOutput KEYWORD1 AudioOutputI2S KEYWORD1 AudioOutputI2SNoDAC KEYWORD1 +AudioOutputI2SClass KEYWORD1 AudioOutputNull KEYWORD1 AudioOutputBuffer KEYWORD1 AudioOutputSerialWAV KEYWORD1 diff --git a/lib/lib_audio/ESP8266Audio/library.json b/lib/lib_audio/ESP8266Audio/library.json index 5986c2a41..139291880 100644 --- a/lib/lib_audio/ESP8266Audio/library.json +++ b/lib/lib_audio/ESP8266Audio/library.json @@ -1,6 +1,6 @@ { "name": "ESP8266Audio", - "description": "Audio file format and I2S DAC library", + "description": "Audio file format and I2S DAC library for ESP8266, ESP32, and Raspberry Pi Pico RP2040", "keywords": "ESP8266, ESP32, MP3, AAC, WAV, MOD, FLAC, RTTTL, MIDI, I2S, DAC, Delta-Sigma, TTS", "authors": [ { @@ -14,13 +14,9 @@ "type": "git", "url": "https://github.com/earlephilhower/ESP8266Audio" }, - "version": "1.5.0", + "version": "1.9.2", "homepage": "https://github.com/earlephilhower/ESP8266Audio", - "dependencies": { - "SPI": "1.0" - }, "frameworks": "Arduino", - "platforms": ["espressif8266", "espressif32"], "examples": [ "examples/*/*.ino" ] diff --git a/lib/lib_audio/ESP8266Audio/library.properties b/lib/lib_audio/ESP8266Audio/library.properties index 0eb36bee2..111915c1c 100644 --- a/lib/lib_audio/ESP8266Audio/library.properties +++ b/lib/lib_audio/ESP8266Audio/library.properties @@ -1,9 +1,9 @@ name=ESP8266Audio -version=1.5.0 +version=1.9.2 author=Earle F. Philhower, III maintainer=Earle F. Philhower, III -sentence=Audio file and I2S sound playing routines. +sentence=Audio file and I2S sound playing routines for ESP8266, ESP32, and Raspberry Pi Pico RP2040 paragraph=Decode compressed MP3, AAC, FLAC, Screamtracker MOD, MIDI, RTTL, TI Talkie, and WAV and play on an I2S DAC or a software-driven delta-sigma DAC and 1-transistor amplifier. category=Signal Input/Output url=https://github.com/earlephilhower/ESP8266Audio -architectures=esp8266,esp32 +architectures=esp8266,esp32,rp2040 diff --git a/lib/lib_audio/ESP8266Audio/src/AudioFileSourceFS.h b/lib/lib_audio/ESP8266Audio/src/AudioFileSourceFS.h index fea34c29e..4e1cb8ec0 100644 --- a/lib/lib_audio/ESP8266Audio/src/AudioFileSourceFS.h +++ b/lib/lib_audio/ESP8266Audio/src/AudioFileSourceFS.h @@ -29,8 +29,8 @@ class AudioFileSourceFS : public AudioFileSource { public: - AudioFileSourceFS(FS &fs) { filesystem = &fs; } - AudioFileSourceFS(FS &fs, const char *filename); + AudioFileSourceFS(fs::FS &fs) { filesystem = &fs; } + AudioFileSourceFS(fs::FS &fs, const char *filename); virtual ~AudioFileSourceFS() override; virtual bool open(const char *filename) override; @@ -42,8 +42,8 @@ class AudioFileSourceFS : public AudioFileSource virtual uint32_t getPos() override { if (!f) return 0; else return f.position(); }; private: - FS *filesystem; - File f; + fs::FS *filesystem; + fs::File f; }; diff --git a/lib/lib_audio/ESP8266Audio/src/AudioFileSourceFunction.cpp b/lib/lib_audio/ESP8266Audio/src/AudioFileSourceFunction.cpp new file mode 100644 index 000000000..9e86eff21 --- /dev/null +++ b/lib/lib_audio/ESP8266Audio/src/AudioFileSourceFunction.cpp @@ -0,0 +1,148 @@ +/* + AudioFileSourceFunction + Audio ouptut generator which can generate WAV file data from function + + Copyright (C) 2021 Hideaki Tai + + 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 . +*/ + +#include "AudioFileSourceFunction.h" + +AudioFileSourceFunction::AudioFileSourceFunction(float sec, uint16_t channels, uint32_t sample_per_sec, uint16_t bits_per_sample) { + uint32_t bytes_per_sec = sample_per_sec * channels * bits_per_sample / 8; + uint32_t len = uint32_t(sec * (float)bytes_per_sec); + + // RIFF chunk + strncpy(wav_header.riff.chunk_id, "RIFF", 4); + wav_header.riff.chunk_size = 4 // size of riff chunk w/o chunk_id and chunk_size + + 8 + 16 // size of format chunk + + 8 + len; // size of data chunk + strncpy(wav_header.riff.format, "WAVE", 4); + + // format chunk + strncpy(wav_header.format.chunk_id, "fmt ", 4); + wav_header.format.chunk_size = 16; + wav_header.format.format_tag = 0x0001; // PCM + wav_header.format.channels = channels; + wav_header.format.sample_per_sec = sample_per_sec; + wav_header.format.avg_bytes_per_sec = bytes_per_sec; + wav_header.format.block_align = channels * bits_per_sample / 8; + wav_header.format.bits_per_sample = bits_per_sample; + + // data chunk + strncpy(wav_header.data.chunk_id, "data", 4); + wav_header.data.chunk_size = len; + + funcs.reserve(channels); + pos = 0; + size = sizeof(WavHeader) + len; + is_ready = false; + is_unique = false; +} + +AudioFileSourceFunction::~AudioFileSourceFunction() { + close(); +} + +uint32_t AudioFileSourceFunction::read(void* data, uint32_t len) { + // callback size must be 1 or equal to channels + if (!is_ready) + return 0; + + uint8_t* d = reinterpret_cast(data); + uint32_t i = 0; + while (i < len) { + uint32_t p = pos + i; + if (p < sizeof(WavHeader)) { + // header bytes + d[i] = wav_header.bytes[p]; + i += 1; + } else { + // data bytes + float time = (float)(p - sizeof(WavHeader)) / (float)wav_header.format.avg_bytes_per_sec; + float v = funcs[0](time); + for (size_t ch = 0; ch < wav_header.format.channels; ++ch) { + if (!is_unique && ch > 0) + v = funcs[ch](time); + + switch (wav_header.format.bits_per_sample) { + case 8: { + Uint8AndInt8 vs {int8_t(v * (float)0x7F)}; + d[i] = vs.u; + break; + } + case 32: { + Uint8AndInt32 vs {int32_t(v * (float)0x7FFFFFFF)}; + d[i + 0] = vs.u[0]; + d[i + 1] = vs.u[1]; + d[i + 2] = vs.u[2]; + d[i + 3] = vs.u[3]; + break; + } + case 16: + default: { + Uint8AndInt16 vs {int16_t(v * (float)0x7FFF)}; + d[i + 0] = vs.u[0]; + d[i + 1] = vs.u[1]; + break; + } + } + } + i += wav_header.format.block_align; + } + } + pos += i; + return (pos >= size) ? 0 : i; +} + +bool AudioFileSourceFunction::seek(int32_t pos, int dir) { + if (dir == SEEK_SET) { + if (pos < 0 || (uint32_t)pos >= size) + return false; + this->pos = pos; + } else if (dir == SEEK_CUR) { + int32_t p = (int32_t)this->pos + pos; + if (p < 0 || (uint32_t)p >= size) + return false; + this->pos = p; + } else { + int32_t p = (int32_t)this->size + pos; + if (p < 0 || (uint32_t)p >= size) + return false; + this->pos = p; + } + return true; +} + +bool AudioFileSourceFunction::close() { + funcs.clear(); + pos = 0; + size = 0; + is_ready = false; + is_unique = false; + return true; +} + +bool AudioFileSourceFunction::isOpen() { + return is_ready; +} + +uint32_t AudioFileSourceFunction::getSize() { + return size; +} + +uint32_t AudioFileSourceFunction::getPos() { + return pos; +} diff --git a/lib/lib_audio/ESP8266Audio/src/AudioFileSourceFunction.h b/lib/lib_audio/ESP8266Audio/src/AudioFileSourceFunction.h new file mode 100644 index 000000000..6c41229ae --- /dev/null +++ b/lib/lib_audio/ESP8266Audio/src/AudioFileSourceFunction.h @@ -0,0 +1,119 @@ +/* + AudioFileSourceFunction + Audio ouptut generator which can generate WAV file data from function + + Copyright (C) 2021 Hideaki Tai + + 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 . +*/ + +#ifndef _AUDIOFILESOURCEFUNCTION_H +#define _AUDIOFILESOURCEFUNCTION_H + +#include +#include +#include + +#include "AudioFileSource.h" + +class AudioFileSourceFunction : public AudioFileSource { + union WavHeader { + struct { + // RIFF chunk + struct { + char chunk_id[4]; // "RIFF" + uint32_t chunk_size; // 4 + (8 + sizeof(format_chunk)(16)) + (8 + sizeof(data_chunk)) + char format[4]; // "WAVE" + } riff; + // format chunk + struct { + char chunk_id[4]; // "fmt " + uint32_t chunk_size; // 16 + uint16_t format_tag; // 1: PCM + uint16_t channels; // 1: MONO, 2: STEREO + uint32_t sample_per_sec; // 8000, 11025, 22050, 44100, 48000 + uint32_t avg_bytes_per_sec; // sample_per_sec * channels * bits_per_sample / 8 + uint16_t block_align; // channels * bits_per_sample / 8 + uint16_t bits_per_sample; // 8, 16, 32 + } format; + // data chunk + struct { + char chunk_id[4]; // "data" + uint32_t chunk_size; // num_samples * channels * bytes_per_sample + // audio data follows here... + } data; + }; + uint8_t bytes[44]; + } wav_header; + + union Uint8AndInt8 { + int8_t i; + uint8_t u; + }; + + union Uint8AndInt16 { + int16_t i; + uint8_t u[2]; + }; + + union Uint8AndInt32 { + int32_t i; + uint8_t u[4]; + }; + + using callback_t = std::function; + std::vector funcs; + uint32_t pos; + uint32_t size; + bool is_ready; + bool is_unique; + +public: + AudioFileSourceFunction(float sec, uint16_t channels = 1, uint32_t sample_per_sec = 8000, uint16_t bits_per_sample = 16); + virtual ~AudioFileSourceFunction() override; + + template + bool addAudioGenerators(const F& f, Fs&&... fs) { + funcs.emplace_back(f); + return addAudioGenerators(std::forward(fs)...); + } + bool addAudioGenerators() { + funcs.shrink_to_fit(); + if (funcs.size() == 1) { + is_ready = true; + is_unique = true; + return true; + } else if (funcs.size() == wav_header.format.channels) { + is_ready = true; + is_unique = false; + return true; + } else { + is_ready = false; + is_unique = false; + funcs.clear(); + return false; + } + } + + virtual uint32_t read(void* data, uint32_t len) override; + virtual bool seek(int32_t pos, int dir) override; + + virtual bool close() override; + virtual bool isOpen() override; + + virtual uint32_t getSize() override; + virtual uint32_t getPos() override; +}; + +#endif // _AUDIOFILESOURCEFUNCTION_H diff --git a/lib/lib_audio/ESP8266Audio/src/AudioFileSourceHTTPStream.cpp b/lib/lib_audio/ESP8266Audio/src/AudioFileSourceHTTPStream.cpp index c07eb0944..c5d0b8334 100644 --- a/lib/lib_audio/ESP8266Audio/src/AudioFileSourceHTTPStream.cpp +++ b/lib/lib_audio/ESP8266Audio/src/AudioFileSourceHTTPStream.cpp @@ -18,6 +18,8 @@ along with this program. If not, see . */ +#if defined(ESP32) || defined(ESP8266) + #include "AudioFileSourceHTTPStream.h" AudioFileSourceHTTPStream::AudioFileSourceHTTPStream() @@ -40,7 +42,7 @@ bool AudioFileSourceHTTPStream::open(const char *url) http.begin(client, url); http.setReuse(true); #ifndef ESP32 - http.setFollowRedirects(HTTPC_STRICT_FOLLOW_REDIRECTS); + http.setFollowRedirects(HTTPC_FORCE_FOLLOW_REDIRECTS); #endif int code = http.GET(); if (code != HTTP_CODE_OK) { @@ -84,7 +86,7 @@ retry: cb.st(STATUS_DISCONNECTED, PSTR("Stream disconnected")); http.end(); for (int i = 0; i < reconnectTries; i++) { - char buff[32]; + char buff[64]; sprintf_P(buff, PSTR("Attempting to reconnect, try %d"), i); cb.st(STATUS_RECONNECTING, buff); delay(reconnectDelayMs); @@ -152,3 +154,5 @@ uint32_t AudioFileSourceHTTPStream::getPos() { return pos; } + +#endif diff --git a/lib/lib_audio/ESP8266Audio/src/AudioFileSourceHTTPStream.h b/lib/lib_audio/ESP8266Audio/src/AudioFileSourceHTTPStream.h index e764b45d8..34e54663d 100644 --- a/lib/lib_audio/ESP8266Audio/src/AudioFileSourceHTTPStream.h +++ b/lib/lib_audio/ESP8266Audio/src/AudioFileSourceHTTPStream.h @@ -1,7 +1,7 @@ /* AudioFileSourceHTTPStream Connect to a HTTP based streaming service - + Copyright (C) 2017 Earle F. Philhower, III This program is free software: you can redistribute it and/or modify @@ -18,14 +18,13 @@ along with this program. If not, see . */ -#ifndef _AUDIOFILESOURCEHTTPSTREAM_H -#define _AUDIOFILESOURCEHTTPSTREAM_H +#if defined(ESP32) || defined(ESP8266) +#pragma once #include #ifdef ESP32 #include #else - #include #include #endif #include "AudioFileSource.h" @@ -38,7 +37,7 @@ class AudioFileSourceHTTPStream : public AudioFileSource AudioFileSourceHTTPStream(); AudioFileSourceHTTPStream(const char *url); virtual ~AudioFileSourceHTTPStream() override; - + virtual bool open(const char *url) override; virtual uint32_t read(void *data, uint32_t len) override; virtual uint32_t readNonBlock(void *data, uint32_t len) override; @@ -48,6 +47,7 @@ class AudioFileSourceHTTPStream : public AudioFileSource virtual uint32_t getSize() override; virtual uint32_t getPos() override; bool SetReconnect(int tries, int delayms) { reconnectTries = tries; reconnectDelayMs = delayms; return true; } + void useHTTP10 () { http.useHTTP10(true); } enum { STATUS_HTTPFAIL=2, STATUS_DISCONNECTED, STATUS_RECONNECTING, STATUS_RECONNECTED, STATUS_NODATA }; @@ -64,3 +64,4 @@ class AudioFileSourceHTTPStream : public AudioFileSource #endif + diff --git a/lib/lib_audio/ESP8266Audio/src/AudioFileSourceICYStream.cpp b/lib/lib_audio/ESP8266Audio/src/AudioFileSourceICYStream.cpp index cc7cc5e27..63c84f328 100644 --- a/lib/lib_audio/ESP8266Audio/src/AudioFileSourceICYStream.cpp +++ b/lib/lib_audio/ESP8266Audio/src/AudioFileSourceICYStream.cpp @@ -17,6 +17,9 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ + +#if defined(ESP32) || defined(ESP8266) + #define _GNU_SOURCE #include "AudioFileSourceICYStream.h" @@ -83,12 +86,16 @@ AudioFileSourceICYStream::~AudioFileSourceICYStream() uint32_t AudioFileSourceICYStream::readInternal(void *data, uint32_t len, bool nonBlock) { + // Ensure we can't possibly read 2 ICY headers in a single go #355 + if (icyMetaInt > 1) { + len = std::min((int)(icyMetaInt >> 1), (int)len); + } retry: if (!http.connected()) { cb.st(STATUS_DISCONNECTED, PSTR("Stream disconnected")); http.end(); for (int i = 0; i < reconnectTries; i++) { - char buff[32]; + char buff[64]; sprintf_P(buff, PSTR("Attempting to reconnect, try %d"), i); cb.st(STATUS_RECONNECTING, buff); delay(reconnectDelayMs); @@ -211,3 +218,5 @@ retry: icyByteCount += ret; return read; } + +#endif diff --git a/lib/lib_audio/ESP8266Audio/src/AudioFileSourceICYStream.h b/lib/lib_audio/ESP8266Audio/src/AudioFileSourceICYStream.h index dacbf7efd..97688a57d 100644 --- a/lib/lib_audio/ESP8266Audio/src/AudioFileSourceICYStream.h +++ b/lib/lib_audio/ESP8266Audio/src/AudioFileSourceICYStream.h @@ -1,7 +1,7 @@ /* AudioFileSourceHTTPStream Connect to a HTTP based streaming service - + Copyright (C) 2017 Earle F. Philhower, III This program is free software: you can redistribute it and/or modify @@ -18,8 +18,8 @@ along with this program. If not, see . */ -#ifndef _AUDIOFILESOURCEICYSTREAM_H -#define _AUDIOFILESOURCEICYSTREAM_H +#if defined(ESP32) || defined(ESP8266) +#pragma once #include #ifdef ESP32 @@ -36,7 +36,7 @@ class AudioFileSourceICYStream : public AudioFileSourceHTTPStream AudioFileSourceICYStream(); AudioFileSourceICYStream(const char *url); virtual ~AudioFileSourceICYStream() override; - + virtual bool open(const char *url) override; private: @@ -45,5 +45,4 @@ class AudioFileSourceICYStream : public AudioFileSourceHTTPStream int icyByteCount; }; - #endif diff --git a/lib/lib_audio/ESP8266Audio/src/AudioFileSourceID3.cpp b/lib/lib_audio/ESP8266Audio/src/AudioFileSourceID3.cpp index 1723b8d4d..2a22bb180 100644 --- a/lib/lib_audio/ESP8266Audio/src/AudioFileSourceID3.cpp +++ b/lib/lib_audio/ESP8266Audio/src/AudioFileSourceID3.cpp @@ -143,6 +143,7 @@ uint32_t AudioFileSourceID3::read(void *data, uint32_t len) if (ret<10) return ret; if ((buff[0]!='I') || (buff[1]!='D') || (buff[2]!='3') || (buff[3]>0x04) || (buff[3]<0x02) || (buff[4]!=0)) { + cb.md("eof", false, "id3"); return 10 + src->read(buff+10, len-10); } @@ -212,9 +213,9 @@ uint32_t AudioFileSourceID3::read(void *data, uint32_t len) // Read the value and send to callback char value[64]; - uint16_t i; + uint32_t i; bool isUnicode = (id3.getByte()==1) ? true : false; - for (i=0; iread(data, len); } diff --git a/lib/lib_audio/ESP8266Audio/src/AudioFileSourceSD.h b/lib/lib_audio/ESP8266Audio/src/AudioFileSourceSD.h index 3eb079bce..eacd99188 100644 --- a/lib/lib_audio/ESP8266Audio/src/AudioFileSourceSD.h +++ b/lib/lib_audio/ESP8266Audio/src/AudioFileSourceSD.h @@ -1,7 +1,7 @@ /* AudioFileSourceSPIFFS Input SD card "file" to be used by AudioGenerator - + Copyright (C) 2017 Earle F. Philhower, III This program is free software: you can redistribute it and/or modify @@ -22,10 +22,6 @@ #define _AUDIOFILESOURCESD_H #include "AudioFileSource.h" -#ifdef ESP8266 -#include -#include -#endif #include @@ -35,7 +31,7 @@ class AudioFileSourceSD : public AudioFileSource AudioFileSourceSD(); AudioFileSourceSD(const char *filename); virtual ~AudioFileSourceSD() override; - + virtual bool open(const char *filename) override; virtual uint32_t read(void *data, uint32_t len) override; virtual bool seek(int32_t pos, int dir) override; @@ -50,3 +46,4 @@ class AudioFileSourceSD : public AudioFileSource #endif + diff --git a/lib/lib_audio/ESP8266Audio/src/AudioFileSourceSPIRAMBuffer.cpp b/lib/lib_audio/ESP8266Audio/src/AudioFileSourceSPIRAMBuffer.cpp index fafadcea8..2c9eb3b96 100644 --- a/lib/lib_audio/ESP8266Audio/src/AudioFileSourceSPIRAMBuffer.cpp +++ b/lib/lib_audio/ESP8266Audio/src/AudioFileSourceSPIRAMBuffer.cpp @@ -22,6 +22,8 @@ along with this program. If not, see . */ +#if defined(ESP32) || defined(ESP8266) + #include #include "AudioFileSourceSPIRAMBuffer.h" @@ -165,3 +167,5 @@ bool AudioFileSourceSPIRAMBuffer::loop() } return true; } + +#endif diff --git a/lib/lib_audio/ESP8266Audio/src/AudioFileSourceSPIRAMBuffer.h b/lib/lib_audio/ESP8266Audio/src/AudioFileSourceSPIRAMBuffer.h index 19d915f1a..d8c05540b 100644 --- a/lib/lib_audio/ESP8266Audio/src/AudioFileSourceSPIRAMBuffer.h +++ b/lib/lib_audio/ESP8266Audio/src/AudioFileSourceSPIRAMBuffer.h @@ -19,8 +19,8 @@ along with this program. If not, see . */ -#ifndef _AUDIOFILESOURCESPIRAMBUFFER_H -#define _AUDIOFILESOURCESPIRAMBUFFER_H +#if defined(ESP32) || defined(ESP8266) +#pragma once #include "AudioFileSource.h" #include diff --git a/lib/lib_audio/ESP8266Audio/src/AudioGenerator.h b/lib/lib_audio/ESP8266Audio/src/AudioGenerator.h index 889b2285c..6d974876a 100644 --- a/lib/lib_audio/ESP8266Audio/src/AudioGenerator.h +++ b/lib/lib_audio/ESP8266Audio/src/AudioGenerator.h @@ -35,6 +35,7 @@ class AudioGenerator virtual bool loop() { return false; }; virtual bool stop() { return false; }; virtual bool isRunning() { return false;}; + virtual void desync () { }; public: virtual bool RegisterMetadataCB(AudioStatus::metadataCBFn fn, void *data) { return cb.RegisterMetadataCB(fn, data); } diff --git a/lib/lib_audio/ESP8266Audio/src/AudioGeneratorAAC.cpp b/lib/lib_audio/ESP8266Audio/src/AudioGeneratorAAC.cpp index 98f720786..c7568676a 100644 --- a/lib/lib_audio/ESP8266Audio/src/AudioGeneratorAAC.cpp +++ b/lib/lib_audio/ESP8266Audio/src/AudioGeneratorAAC.cpp @@ -144,8 +144,13 @@ bool AudioGeneratorAAC::loop() // If we've got data, try and pump it out... while (validSamples) { - lastSample[0] = outSample[curSample*2]; - lastSample[1] = outSample[curSample*2 + 1]; + if (lastChannels == 1) { + lastSample[0] = outSample[curSample]; + lastSample[1] = outSample[curSample]; + } else { + lastSample[0] = outSample[curSample*2]; + lastSample[1] = outSample[curSample*2 + 1]; + } if (!output->ConsumeSample(lastSample)) goto done; // Can't send, but no error detected validSamples--; curSample++; diff --git a/lib/lib_audio/ESP8266Audio/src/AudioGeneratorFLAC.cpp b/lib/lib_audio/ESP8266Audio/src/AudioGeneratorFLAC.cpp index 1af00ce3a..bd6e801c9 100644 --- a/lib/lib_audio/ESP8266Audio/src/AudioGeneratorFLAC.cpp +++ b/lib/lib_audio/ESP8266Audio/src/AudioGeneratorFLAC.cpp @@ -177,9 +177,9 @@ FLAC__StreamDecoderWriteStatus AudioGeneratorFLAC::write_cb(const FLAC__StreamDe // Hackish warning here. FLAC sends the buffer but doesn't free it until the next call to decode_frame, so we stash // the pointers here and use it in our loop() instead of memcpy()'ing into yet another buffer. buffLen = frame->header.blocksize; - buff[0] = buffer[0]; - if (frame->header.channels>1) buff[1] = buffer[1]; - else buff[1] = buffer[0]; + buff[0] = (const int *)buffer[0]; + if (frame->header.channels>1) buff[1] = (const int *)buffer[1]; + else buff[1] = (const int *)buffer[0]; buffPtr = 0; return FLAC__STREAM_DECODER_WRITE_STATUS_CONTINUE; } diff --git a/lib/lib_audio/ESP8266Audio/src/AudioGeneratorMP3.cpp b/lib/lib_audio/ESP8266Audio/src/AudioGeneratorMP3.cpp index 2979a5848..d962c9e0b 100644 --- a/lib/lib_audio/ESP8266Audio/src/AudioGeneratorMP3.cpp +++ b/lib/lib_audio/ESP8266Audio/src/AudioGeneratorMP3.cpp @@ -1,7 +1,7 @@ /* AudioGeneratorMP3 Wrap libmad MP3 library to play audio - + Copyright (C) 2017 Earle F. Philhower, III This program is free software: you can redistribute it and/or modify @@ -29,11 +29,23 @@ AudioGeneratorMP3::AudioGeneratorMP3() buff = NULL; nsCountMax = 1152/32; madInitted = false; - preallocateSpace = NULL; - preallocateSize = 0; } -AudioGeneratorMP3::AudioGeneratorMP3(void *space, int size) +AudioGeneratorMP3::AudioGeneratorMP3(void *space, int size): preallocateSpace(space), preallocateSize(size) +{ + running = false; + file = NULL; + output = NULL; + buff = NULL; + nsCountMax = 1152/32; + madInitted = false; +} + +AudioGeneratorMP3::AudioGeneratorMP3(void *buff, int buffSize, void *stream, int streamSize, void *frame, int frameSize, void *synth, int synthSize): + preallocateSpace(buff), preallocateSize(buffSize), + preallocateStreamSpace(stream), preallocateStreamSize(streamSize), + preallocateFrameSpace(frame), preallocateFrameSize(frameSize), + preallocateSynthSpace(synth), preallocateSynthSize(synthSize) { running = false; file = NULL; @@ -41,8 +53,6 @@ AudioGeneratorMP3::AudioGeneratorMP3(void *space, int size) buff = NULL; nsCountMax = 1152/32; madInitted = false; - preallocateSpace = space; - preallocateSize = size; } AudioGeneratorMP3::~AudioGeneratorMP3() @@ -52,7 +62,7 @@ AudioGeneratorMP3::~AudioGeneratorMP3() free(synth); free(frame); free(stream); - } + } } @@ -109,7 +119,12 @@ enum mad_flow AudioGeneratorMP3::Input() if (stream->next_frame) { unused = lastBuffLen - (stream->next_frame - buff); - memmove(buff, stream->next_frame, unused); + if (unused < 0) { + desync(); + unused = 0; + } else { + memmove(buff, stream->next_frame, unused); + } stream->next_frame = NULL; } @@ -125,6 +140,10 @@ enum mad_flow AudioGeneratorMP3::Input() // Can't read any from the file, and we don't have anything left. It's done.... return MAD_FLOW_STOP; } + if (len < 0) { + desync(); + unused = 0; + } lastBuffLen = len + unused; mad_stream_buffer(stream, buff, lastBuffLen); @@ -132,6 +151,16 @@ enum mad_flow AudioGeneratorMP3::Input() return MAD_FLOW_CONTINUE; } +void AudioGeneratorMP3::desync () +{ + audioLogger->printf_P(PSTR("MP3:desync\n")); + if (stream) { + stream->next_frame = nullptr; + stream->this_frame = nullptr; + stream->sync = 0; + } + lastBuffLen = 0; +} bool AudioGeneratorMP3::DecodeNextFrame() { @@ -153,7 +182,7 @@ bool AudioGeneratorMP3::GetOneSample(int16_t sample[2]) output->SetChannels(synth->pcm.channels); lastChannels = synth->pcm.channels; } - + // If we're here, we have one decoded frame and sent 0 or more samples out if (samplePtr < synth->pcm.length) { sample[AudioOutput::LEFTCHANNEL ] = synth->pcm.samples[0][samplePtr]; @@ -161,7 +190,7 @@ bool AudioGeneratorMP3::GetOneSample(int16_t sample[2]) samplePtr++; } else { samplePtr = 0; - + switch ( mad_synth_frame_onens(synth, frame, nsCount++) ) { case MAD_FLOW_STOP: case MAD_FLOW_BREAK: audioLogger->printf_P(PSTR("msf1ns failed\n")); @@ -196,6 +225,18 @@ retry: } if (!DecodeNextFrame()) { + if (stream->error == MAD_ERROR_BUFLEN) { + // randomly seeking can lead to endless + // and unrecoverable "MAD_ERROR_BUFLEN" loop + audioLogger->printf_P(PSTR("MP3:ERROR_BUFLEN %d\n"), unrecoverable); + if (++unrecoverable >= 3) { + unrecoverable = 0; + stop(); + return running; + } + } else { + unrecoverable = 0; + } goto retry; } samplePtr = 9999; @@ -229,6 +270,9 @@ bool AudioGeneratorMP3::begin(AudioFileSource *source, AudioOutput *output) return false; // Error } + // Reset error count from previous file + unrecoverable = 0; + output->SetBitsPerSample(16); // Constant for MP3 decoder output->SetChannels(2); @@ -243,16 +287,32 @@ bool AudioGeneratorMP3::begin(AudioFileSource *source, AudioOutput *output) lastBuffLen = 0; // Allocate all large memory chunks - if (preallocateSpace) { + if (preallocateStreamSize + preallocateFrameSize + preallocateSynthSize) { + if (preallocateSize >= preAllocBuffSize() && + preallocateStreamSize >= preAllocStreamSize() && + preallocateFrameSize >= preAllocFrameSize() && + preallocateSynthSize >= preAllocSynthSize()) { + buff = reinterpret_cast(preallocateSpace); + stream = reinterpret_cast(preallocateStreamSpace); + frame = reinterpret_cast(preallocateFrameSpace); + synth = reinterpret_cast(preallocateSynthSpace); + } + else { + audioLogger->printf_P("OOM error in MP3: Want %d/%d/%d/%d bytes, have %d/%d/%d/%d bytes preallocated.\n", + preAllocBuffSize(), preAllocStreamSize(), preAllocFrameSize(), preAllocSynthSize(), + preallocateSize, preallocateStreamSize, preallocateFrameSize, preallocateSynthSize); + return false; + } + } else if (preallocateSpace) { uint8_t *p = reinterpret_cast(preallocateSpace); buff = reinterpret_cast(p); - p += (buffLen+7) & ~7; + p += preAllocBuffSize(); stream = reinterpret_cast(p); - p += (sizeof(struct mad_stream)+7) & ~7; + p += preAllocStreamSize(); frame = reinterpret_cast(p); - p += (sizeof(struct mad_frame)+7) & ~7; + p += preAllocFrameSize(); synth = reinterpret_cast(p); - p += (sizeof(struct mad_synth)+7) & ~7; + p += preAllocSynthSize(); int neededBytes = p - reinterpret_cast(preallocateSpace); if (neededBytes > preallocateSize) { audioLogger->printf_P("OOM error in MP3: Want %d bytes, have %d bytes preallocated.\n", neededBytes, preallocateSize); @@ -272,19 +332,17 @@ bool AudioGeneratorMP3::begin(AudioFileSource *source, AudioOutput *output) stream = NULL; frame = NULL; synth = NULL; - uint32_t size = buffLen + sizeof(struct mad_stream) + sizeof(struct mad_frame) + sizeof(struct mad_synth); - audioLogger->printf_P("OOM error in MP3: Want %d bytes\n", size); return false; } } - + mad_stream_init(stream); mad_frame_init(frame); mad_synth_init(synth); synth->pcm.length = 0; mad_stream_options(stream, 0); // TODO - add options support madInitted = true; - + running = true; return true; } @@ -304,7 +362,7 @@ extern "C" { { return 8192; } -#elif defined(ESP8266) +#elif defined(ESP8266) && !defined(CORE_MOCK) #include extern cont_t g_cont; @@ -351,3 +409,4 @@ extern "C" { } #endif } + diff --git a/lib/lib_audio/ESP8266Audio/src/AudioGeneratorMP3.h b/lib/lib_audio/ESP8266Audio/src/AudioGeneratorMP3.h index 750cecaca..0f4e439e9 100644 --- a/lib/lib_audio/ESP8266Audio/src/AudioGeneratorMP3.h +++ b/lib/lib_audio/ESP8266Audio/src/AudioGeneratorMP3.h @@ -30,17 +30,31 @@ class AudioGeneratorMP3 : public AudioGenerator public: AudioGeneratorMP3(); AudioGeneratorMP3(void *preallocateSpace, int preallocateSize); + AudioGeneratorMP3(void *buff, int buffSize, void *stream, int streamSize, void *frame, int frameSize, void *synth, int synthSize); virtual ~AudioGeneratorMP3() override; virtual bool begin(AudioFileSource *source, AudioOutput *output) override; virtual bool loop() override; virtual bool stop() override; virtual bool isRunning() override; - - protected: - void *preallocateSpace; - int preallocateSize; + virtual void desync () override; - const int buffLen = 0x600; // Slightly larger than largest MP3 frame + static constexpr int preAllocSize () { return preAllocBuffSize() + preAllocStreamSize() + preAllocFrameSize() + preAllocSynthSize(); } + static constexpr int preAllocBuffSize () { return ((buffLen + 7) & ~7); } + static constexpr int preAllocStreamSize () { return ((sizeof(struct mad_stream) + 7) & ~7); } + static constexpr int preAllocFrameSize () { return (sizeof(struct mad_frame) + 7) & ~7; } + static constexpr int preAllocSynthSize () { return (sizeof(struct mad_synth) + 7) & ~7; } + + protected: + void *preallocateSpace = nullptr; + int preallocateSize = 0; + void *preallocateStreamSpace = nullptr; + int preallocateStreamSize = 0; + void *preallocateFrameSpace = nullptr; + int preallocateFrameSize = 0; + void *preallocateSynthSpace = nullptr; + int preallocateSynthSize = 0; + + static constexpr int buffLen = 0x600; // Slightly larger than largest MP3 frame unsigned char *buff; int lastReadPos; int lastBuffLen; @@ -62,6 +76,8 @@ class AudioGeneratorMP3 : public AudioGenerator bool DecodeNextFrame(); bool GetOneSample(int16_t sample[2]); + private: + int unrecoverable = 0; }; #endif diff --git a/lib/lib_audio/ESP8266Audio/src/AudioOutputFilterBiquad.cpp b/lib/lib_audio/ESP8266Audio/src/AudioOutputFilterBiquad.cpp new file mode 100644 index 000000000..5c8af8e5c --- /dev/null +++ b/lib/lib_audio/ESP8266Audio/src/AudioOutputFilterBiquad.cpp @@ -0,0 +1,245 @@ +/* + AudioOutputFilterBiquad + Implements a Biquad filter + + Copyright (C) 2012 Nigel Redmon + Copyright (C) 2021 William Bérubé + + 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 . +*/ + +#include +#include "AudioOutputFilterBiquad.h" + +AudioOutputFilterBiquad::AudioOutputFilterBiquad(AudioOutput *sink) +{ + this->sink = sink; + + type = bq_type_lowpass; + a0 = 1.0; + a1 = a2 = b1 = b2 = 0.0; + Fc = 0.50; + Q = 0.707; + peakGain = 0.0; + z1 = z2 = 0.0; +} + +AudioOutputFilterBiquad::AudioOutputFilterBiquad(int type, float Fc, float Q, float peakGain, AudioOutput *sink) +{ + this->sink = sink; + + SetBiquad(type, Fc, Q, peakGain); + z1 = z2 = 0.0; +} + +AudioOutputFilterBiquad::~AudioOutputFilterBiquad() {} + +bool AudioOutputFilterBiquad::SetRate(int hz) +{ + return sink->SetRate(hz); +} + +bool AudioOutputFilterBiquad::SetBitsPerSample(int bits) +{ + return sink->SetBitsPerSample(bits); +} + +bool AudioOutputFilterBiquad::SetChannels(int channels) +{ + return sink->SetChannels(channels); +} + +bool AudioOutputFilterBiquad::SetGain(float gain) +{ + return sink->SetGain(gain); +} + +void AudioOutputFilterBiquad::SetType(int type) +{ + this->type = type; + CalcBiquad(); +} + +void AudioOutputFilterBiquad::SetFc(float Fc) +{ + this->Fc = Fc; + CalcBiquad(); +} + +void AudioOutputFilterBiquad::SetQ(float Q) +{ + this->Q = Q; + CalcBiquad(); +} + +void AudioOutputFilterBiquad::SetPeakGain(float peakGain) +{ + this->peakGain = peakGain; + CalcBiquad(); +} + +void AudioOutputFilterBiquad::SetBiquad(int type, float Fc, float Q, float peakGain) +{ + this->type = type; + this->Fc = Fc; + this->Q = Q; + this->peakGain = peakGain; + CalcBiquad(); +} + +void AudioOutputFilterBiquad::CalcBiquad() +{ + float norm; + float V = pow(10, fabs(peakGain) / 20.0); + float K = tan(M_PI * Fc); + + switch (this->type) { + case bq_type_lowpass: + norm = 1 / (1 + K / Q + K * K); + a0 = K * K * norm; + a1 = 2 * a0; + a2 = a0; + b1 = 2 * (K * K - 1) * norm; + b2 = (1 - K / Q + K * K) * norm; + break; + + case bq_type_highpass: + norm = 1 / (1 + K / Q + K * K); + a0 = 1 * norm; + a1 = -2 * a0; + a2 = a0; + b1 = 2 * (K * K - 1) * norm; + b2 = (1 - K / Q + K * K) * norm; + break; + + case bq_type_bandpass: + norm = 1 / (1 + K / Q + K * K); + a0 = K / Q * norm; + a1 = 0; + a2 = -a0; + b1 = 2 * (K * K - 1) * norm; + b2 = (1 - K / Q + K * K) * norm; + break; + + case bq_type_notch: + norm = 1 / (1 + K / Q + K * K); + a0 = (1 + K * K) * norm; + a1 = 2 * (K * K - 1) * norm; + a2 = a0; + b1 = a1; + b2 = (1 - K / Q + K * K) * norm; + break; + + case bq_type_peak: + if (peakGain >= 0) { // boost + norm = 1 / (1 + 1/Q * K + K * K); + a0 = (1 + V/Q * K + K * K) * norm; + a1 = 2 * (K * K - 1) * norm; + a2 = (1 - V/Q * K + K * K) * norm; + b1 = a1; + b2 = (1 - 1/Q * K + K * K) * norm; + } else { // cut + norm = 1 / (1 + V/Q * K + K * K); + a0 = (1 + 1/Q * K + K * K) * norm; + a1 = 2 * (K * K - 1) * norm; + a2 = (1 - 1/Q * K + K * K) * norm; + b1 = a1; + b2 = (1 - V/Q * K + K * K) * norm; + } + break; + + case bq_type_lowshelf: + if (peakGain >= 0) { // boost + norm = 1 / (1 + sqrt(2) * K + K * K); + a0 = (1 + sqrt(2*V) * K + V * K * K) * norm; + a1 = 2 * (V * K * K - 1) * norm; + a2 = (1 - sqrt(2*V) * K + V * K * K) * norm; + b1 = 2 * (K * K - 1) * norm; + b2 = (1 - sqrt(2) * K + K * K) * norm; + } + else { // cut + norm = 1 / (1 + sqrt(2*V) * K + V * K * K); + a0 = (1 + sqrt(2) * K + K * K) * norm; + a1 = 2 * (K * K - 1) * norm; + a2 = (1 - sqrt(2) * K + K * K) * norm; + b1 = 2 * (V * K * K - 1) * norm; + b2 = (1 - sqrt(2*V) * K + V * K * K) * norm; + } + break; + + case bq_type_highshelf: + if (peakGain >= 0) { // boost + norm = 1 / (1 + sqrt(2) * K + K * K); + a0 = (V + sqrt(2*V) * K + K * K) * norm; + a1 = 2 * (K * K - V) * norm; + a2 = (V - sqrt(2*V) * K + K * K) * norm; + b1 = 2 * (K * K - 1) * norm; + b2 = (1 - sqrt(2) * K + K * K) * norm; + } + else { // cut + norm = 1 / (V + sqrt(2*V) * K + K * K); + a0 = (1 + sqrt(2) * K + K * K) * norm; + a1 = 2 * (K * K - 1) * norm; + a2 = (1 - sqrt(2) * K + K * K) * norm; + b1 = 2 * (K * K - V) * norm; + b2 = (V - sqrt(2*V) * K + K * K) * norm; + } + break; + } + + i_a0 = a0 * BQ_DECAL; + i_a1 = a1 * BQ_DECAL; + i_a2 = a2 * BQ_DECAL; + + i_b1 = b1 * BQ_DECAL; + i_b2 = b2 * BQ_DECAL; + + i_lz1 = i_rz1 = z1 * BQ_DECAL; + i_lz2 = i_rz2 = z2 * BQ_DECAL; + + i_Fc = Fc * BQ_DECAL; + i_Q = Q * BQ_DECAL; + i_peakGain = peakGain * BQ_DECAL; +} + +bool AudioOutputFilterBiquad::begin() +{ + return sink->begin(); +} + +bool AudioOutputFilterBiquad::ConsumeSample(int16_t sample[2]) +{ + + int32_t leftSample = (sample[LEFTCHANNEL] << BQ_SHIFT) / 2; + int32_t rightSample = (sample[RIGHTCHANNEL] << BQ_SHIFT) / 2; + + int64_t leftOutput = ((leftSample * i_a0) >> BQ_SHIFT) + i_lz1; + i_lz1 = ((leftSample * i_a1) >> BQ_SHIFT) + i_lz2 - ((i_b1 * leftOutput) >> BQ_SHIFT); + i_lz2 = ((leftSample * i_a2) >> BQ_SHIFT) - ((i_b2 * leftOutput) >> BQ_SHIFT); + + int64_t rightOutput = ((rightSample * i_a0) >> BQ_SHIFT) + i_rz1; + i_rz1 = ((rightSample * i_a1) >> BQ_SHIFT) + i_rz2 - ((i_b1 * rightOutput) >> BQ_SHIFT); + i_rz2 = ((rightSample * i_a2) >> BQ_SHIFT) - ((i_b2 * rightOutput) >> BQ_SHIFT); + + int16_t out[2]; + out[LEFTCHANNEL] = (int16_t)(leftOutput >> BQ_SHIFT); + out[RIGHTCHANNEL] = (int16_t)(rightOutput >> BQ_SHIFT); + + return sink->ConsumeSample(out); +} + +bool AudioOutputFilterBiquad::stop() +{ + return sink->stop(); +} diff --git a/lib/lib_audio/ESP8266Audio/src/AudioOutputFilterBiquad.h b/lib/lib_audio/ESP8266Audio/src/AudioOutputFilterBiquad.h new file mode 100644 index 000000000..f4dc95f51 --- /dev/null +++ b/lib/lib_audio/ESP8266Audio/src/AudioOutputFilterBiquad.h @@ -0,0 +1,80 @@ +/* + AudioOutputFilterBiquad + Implements a Biquad filter + + Copyright (C) 2012 Nigel Redmon + Copyright (C) 2021 William Bérubé + + 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 . +*/ + +#ifndef _AudioOutputFilterBiquad_H +#define _AudioOutputFilterBiquad_H + +#include "AudioOutput.h" + +#define BQ_SHIFT 16 +#define BQ_DECAL 65536 + +enum { + bq_type_lowpass = 0, + bq_type_highpass, + bq_type_bandpass, + bq_type_notch, + bq_type_peak, + bq_type_lowshelf, + bq_type_highshelf +}; + +class AudioOutputFilterBiquad : public AudioOutput +{ + public: + AudioOutputFilterBiquad(AudioOutput *sink); + AudioOutputFilterBiquad(int type, float Fc, float Q, float peakGain, AudioOutput *sink); + virtual ~AudioOutputFilterBiquad() override; + virtual bool SetRate(int hz) override; + virtual bool SetBitsPerSample(int bits) override; + virtual bool SetChannels(int chan) override; + virtual bool SetGain(float f) override; + virtual bool begin() override; + virtual bool ConsumeSample(int16_t sample[2]) override; + virtual bool stop() override; + + private: + void SetType(int type); + void SetFc(float Fc); + void SetQ(float Q); + void SetPeakGain(float peakGain); + void SetBiquad(int type, float Fc, float Q, float peakGain); + + protected: + AudioOutput *sink; + int buffSize; + int16_t *leftSample; + int16_t *rightSample; + int writePtr; + int readPtr; + bool filled; + int type; + void CalcBiquad(); + int64_t i_a0, i_a1, i_a2, i_b1, i_b2; + int64_t i_Fc, i_Q, i_peakGain; + int64_t i_lz1, i_lz2, i_rz1, i_rz2; + float a0, a1, a2, b1, b2; + float Fc, Q, peakGain; + float z1, z2; +}; + +#endif + diff --git a/lib/lib_audio/ESP8266Audio/src/AudioOutputI2S.cpp b/lib/lib_audio/ESP8266Audio/src/AudioOutputI2S.cpp index c028df105..5e524894d 100644 --- a/lib/lib_audio/ESP8266Audio/src/AudioOutputI2S.cpp +++ b/lib/lib_audio/ESP8266Audio/src/AudioOutputI2S.cpp @@ -21,11 +21,16 @@ #include #ifdef ESP32 #include "driver/i2s.h" -#else - #include +#elif defined(ARDUINO_ARCH_RP2040) || defined(ESP8266) + #ifdef ARDUINO_ESP8266_MAJOR //this define was added in ESP8266 Arduino Core version v3.0.1 + #include "core_esp8266_i2s.h" //for Arduino core >= 3.0.1 + #else + #include "i2s.h" //for Arduino core <= 3.0.0 + #endif #endif #include "AudioOutputI2S.h" +#if defined(ESP32) || defined(ESP8266) AudioOutputI2S::AudioOutputI2S(int port, int output_mode, int dma_buf_count, int use_apll) { this->portNo = port; @@ -35,115 +40,93 @@ AudioOutputI2S::AudioOutputI2S(int port, int output_mode, int dma_buf_count, int output_mode = EXTERNAL_I2S; } this->output_mode = output_mode; -#ifdef ESP32 - if (!i2sOn) { - if (use_apll == APLL_AUTO) { - // don't use audio pll on buggy rev0 chips - use_apll = APLL_DISABLE; - esp_chip_info_t out_info; - esp_chip_info(&out_info); - if(out_info.revision > 0) { - use_apll = APLL_ENABLE; - } - } + this->use_apll = use_apll; - i2s_mode_t mode = (i2s_mode_t)(I2S_MODE_MASTER | I2S_MODE_TX); -#if CONFIG_IDF_TARGET_ESP32 // ESP32/PICO-D4 - if (output_mode == INTERNAL_DAC) { - mode = (i2s_mode_t)(mode | I2S_MODE_DAC_BUILT_IN); - } else if (output_mode == INTERNAL_PDM) { - mode = (i2s_mode_t)(mode | I2S_MODE_PDM); - } -#endif - - i2s_comm_format_t comm_fmt = (i2s_comm_format_t)(I2S_COMM_FORMAT_I2S | I2S_COMM_FORMAT_I2S_MSB); - if (output_mode == INTERNAL_DAC) { - comm_fmt = (i2s_comm_format_t)I2S_COMM_FORMAT_I2S_MSB; - } - - i2s_config_t i2s_config_dac = { - .mode = mode, - .sample_rate = 44100, - .bits_per_sample = I2S_BITS_PER_SAMPLE_16BIT, - .channel_format = I2S_CHANNEL_FMT_RIGHT_LEFT, - .communication_format = comm_fmt, - .intr_alloc_flags = ESP_INTR_FLAG_LEVEL1, // lowest interrupt priority - .dma_buf_count = dma_buf_count, - .dma_buf_len = 64, - .use_apll = use_apll // Use audio PLL - }; - audioLogger->printf("+%d %p\n", portNo, &i2s_config_dac); - if (i2s_driver_install((i2s_port_t)portNo, &i2s_config_dac, 0, NULL) != ESP_OK) { - audioLogger->println("ERROR: Unable to install I2S drives\n"); - } - if (output_mode == INTERNAL_DAC || output_mode == INTERNAL_PDM) { - i2s_set_pin((i2s_port_t)portNo, NULL); - i2s_set_dac_mode(I2S_DAC_CHANNEL_BOTH_EN); - } else { - SetPinout(26, 25, 22); - } - i2s_zero_dma_buffer((i2s_port_t)portNo); - } -#else - (void) dma_buf_count; - (void) use_apll; - if (!i2sOn) { - orig_bck = READ_PERI_REG(PERIPHS_IO_MUX_MTDO_U); - orig_ws = READ_PERI_REG(PERIPHS_IO_MUX_GPIO2_U); - i2s_begin(); - } -#endif - i2sOn = true; + //set defaults mono = false; bps = 16; channels = 2; + hertz = 44100; + bclkPin = 26; + wclkPin = 25; + doutPin = 22; SetGain(1.0); - SetRate(44100); // Default } -AudioOutputI2S::~AudioOutputI2S() +bool AudioOutputI2S::SetPinout() { -#ifdef ESP32 - if (i2sOn) { - audioLogger->printf("UNINSTALL I2S\n"); - i2s_driver_uninstall((i2s_port_t)portNo); //stop & destroy i2s driver - } -#else - if (i2sOn) i2s_end(); -#endif - i2sOn = false; + #ifdef ESP32 + if (output_mode == INTERNAL_DAC || output_mode == INTERNAL_PDM) + return false; // Not allowed + + i2s_pin_config_t pins = { + .bck_io_num = bclkPin, + .ws_io_num = wclkPin, + .data_out_num = doutPin, + .data_in_num = I2S_PIN_NO_CHANGE}; + i2s_set_pin((i2s_port_t)portNo, &pins); + return true; + #else + (void)bclkPin; + (void)wclkPin; + (void)doutPin; + return false; + #endif } bool AudioOutputI2S::SetPinout(int bclk, int wclk, int dout) { -#ifdef ESP32 - if (output_mode == INTERNAL_DAC || output_mode == INTERNAL_PDM) return false; // Not allowed + bclkPin = bclk; + wclkPin = wclk; + doutPin = dout; + if (i2sOn) + return SetPinout(); - i2s_pin_config_t pins = { - .bck_io_num = bclk, - .ws_io_num = wclk, - .data_out_num = dout, - .data_in_num = I2S_PIN_NO_CHANGE - }; - i2s_set_pin((i2s_port_t)portNo, &pins); return true; -#else - (void) bclk; - (void) wclk; - (void) dout; - return false; +} +#elif defined(ARDUINO_ARCH_RP2040) +AudioOutputI2S::AudioOutputI2S(long sampleRate, pin_size_t sck, pin_size_t data) { + i2sOn = false; + mono = false; + bps = 16; + channels = 2; + hertz = sampleRate; + bclkPin = sck; + doutPin = data; + SetGain(1.0); +} #endif + +AudioOutputI2S::~AudioOutputI2S() +{ + #ifdef ESP32 + if (i2sOn) { + audioLogger->printf("UNINSTALL I2S\n"); + i2s_driver_uninstall((i2s_port_t)portNo); //stop & destroy i2s driver + } + #elif defined(ESP8266) + if (i2sOn) + i2s_end(); + #elif defined(ARDUINO_ARCH_RP2040) + stop(); + #endif + i2sOn = false; } bool AudioOutputI2S::SetRate(int hz) { // TODO - have a list of allowable rates from constructor, check them this->hertz = hz; -#ifdef ESP32 - i2s_set_sample_rates((i2s_port_t)portNo, AdjustI2SRate(hz)); -#else - i2s_set_rate(AdjustI2SRate(hz)); -#endif + if (i2sOn) + { + #ifdef ESP32 + i2s_set_sample_rates((i2s_port_t)portNo, AdjustI2SRate(hz)); + #elif defined(ESP8266) + i2s_set_rate(AdjustI2SRate(hz)); + #elif defined(ARDUINO_ARCH_RP2040) + I2S.setFrequency(hz); + #endif + } return true; } @@ -167,13 +150,106 @@ bool AudioOutputI2S::SetOutputModeMono(bool mono) return true; } -bool AudioOutputI2S::begin() +bool AudioOutputI2S::begin(bool txDAC) { + #ifdef ESP32 + if (!i2sOn) + { + if (use_apll == APLL_AUTO) + { + // don't use audio pll on buggy rev0 chips + use_apll = APLL_DISABLE; + esp_chip_info_t out_info; + esp_chip_info(&out_info); + if (out_info.revision > 0) + { + use_apll = APLL_ENABLE; + } + } + + i2s_mode_t mode = (i2s_mode_t)(I2S_MODE_MASTER | I2S_MODE_TX); + if (output_mode == INTERNAL_DAC) + { + mode = (i2s_mode_t)(mode | I2S_MODE_DAC_BUILT_IN); + } + else if (output_mode == INTERNAL_PDM) + { + mode = (i2s_mode_t)(mode | I2S_MODE_PDM); + } + + i2s_comm_format_t comm_fmt = (i2s_comm_format_t)(I2S_COMM_FORMAT_I2S | I2S_COMM_FORMAT_I2S_MSB); + if (output_mode == INTERNAL_DAC) + { + comm_fmt = (i2s_comm_format_t)I2S_COMM_FORMAT_I2S_MSB; + } + + i2s_config_t i2s_config_dac = { + .mode = mode, + .sample_rate = 44100, + .bits_per_sample = I2S_BITS_PER_SAMPLE_16BIT, + .channel_format = I2S_CHANNEL_FMT_RIGHT_LEFT, + .communication_format = comm_fmt, + .intr_alloc_flags = ESP_INTR_FLAG_LEVEL1, // lowest interrupt priority + .dma_buf_count = dma_buf_count, + .dma_buf_len = 64, + .use_apll = use_apll // Use audio PLL + }; + audioLogger->printf("+%d %p\n", portNo, &i2s_config_dac); + if (i2s_driver_install((i2s_port_t)portNo, &i2s_config_dac, 0, NULL) != ESP_OK) + { + audioLogger->println("ERROR: Unable to install I2S drives\n"); + } + if (output_mode == INTERNAL_DAC || output_mode == INTERNAL_PDM) + { + i2s_set_pin((i2s_port_t)portNo, NULL); + i2s_set_dac_mode(I2S_DAC_CHANNEL_BOTH_EN); + } + else + { + SetPinout(); + } + i2s_zero_dma_buffer((i2s_port_t)portNo); + } + #elif defined(ESP8266) + (void)dma_buf_count; + (void)use_apll; + if (!i2sOn) + { + orig_bck = READ_PERI_REG(PERIPHS_IO_MUX_MTDO_U); + orig_ws = READ_PERI_REG(PERIPHS_IO_MUX_GPIO2_U); + #ifdef I2S_HAS_BEGIN_RXTX_DRIVE_CLOCKS + if (!i2s_rxtxdrive_begin(false, true, false, txDAC)) { + return false; + } + #else + if (!i2s_rxtx_begin(false, true)) { + return false; + } + if (!txDAC) { + audioLogger->printf_P(PSTR("I2SNoDAC: esp8266 arduino core should be upgraded to avoid conflicts with SPI\n")); + } + #endif + } + #elif defined(ARDUINO_ARCH_RP2040) + (void)txDAC; + if (!i2sOn) { + I2S.setBCLK(bclkPin); + I2S.setDOUT(doutPin); + I2S.begin(hertz); + } + #endif + i2sOn = true; + SetRate(hertz); // Default return true; } bool AudioOutputI2S::ConsumeSample(int16_t sample[2]) { + + //return if we haven't called ::begin yet + if (!i2sOn) + return false; + int16_t ms[2]; ms[0] = sample[0]; @@ -185,43 +261,59 @@ bool AudioOutputI2S::ConsumeSample(int16_t sample[2]) int32_t ttl = ms[LEFTCHANNEL] + ms[RIGHTCHANNEL]; ms[LEFTCHANNEL] = ms[RIGHTCHANNEL] = (ttl>>1) & 0xffff; } -#ifdef ESP32 - uint32_t s32; - if (output_mode == INTERNAL_DAC) { - int16_t l = Amplify(ms[LEFTCHANNEL]) + 0x8000; - int16_t r = Amplify(ms[RIGHTCHANNEL]) + 0x8000; - s32 = (r<<16) | (l&0xffff); - } else { - s32 = ((Amplify(ms[RIGHTCHANNEL]))<<16) | (Amplify(ms[LEFTCHANNEL]) & 0xffff); - } + #ifdef ESP32 + uint32_t s32; + if (output_mode == INTERNAL_DAC) + { + int16_t l = Amplify(ms[LEFTCHANNEL]) + 0x8000; + int16_t r = Amplify(ms[RIGHTCHANNEL]) + 0x8000; + s32 = (r << 16) | (l & 0xffff); + } + else + { + s32 = ((Amplify(ms[RIGHTCHANNEL])) << 16) | (Amplify(ms[LEFTCHANNEL]) & 0xffff); + } // Deprecated. Use i2s_write -// return i2s_write_bytes((i2s_port_t)portNo, (const char*)&s32, sizeof(uint32_t), 0); - size_t bytes_written; - i2s_write((i2s_port_t)portNo, (const char*)&s32, sizeof(uint32_t), &bytes_written, 0); - return bytes_written; -#else - uint32_t s32 = ((Amplify(ms[RIGHTCHANNEL]))<<16) | (Amplify(ms[LEFTCHANNEL]) & 0xffff); - return i2s_write_sample_nb(s32); // If we can't store it, return false. OTW true -#endif +// return i2s_write_bytes((i2s_port_t)portNo, (const char *)&s32, sizeof(uint32_t), 0); + size_t bytes_written; + i2s_write((i2s_port_t)portNo, (const char*)&s32, sizeof(uint32_t), &bytes_written, 0); + return bytes_written; + #elif defined(ESP8266) + uint32_t s32 = ((Amplify(ms[RIGHTCHANNEL])) << 16) | (Amplify(ms[LEFTCHANNEL]) & 0xffff); + return i2s_write_sample_nb(s32); // If we can't store it, return false. OTW true + #elif defined(ARDUINO_ARCH_RP2040) + return !!I2S.write((void*)ms, 4); + #endif } -void AudioOutputI2S::flush() { -#ifdef ESP32 - // makes sure that all stored DMA samples are consumed / played - int buffersize = 64 * this->dma_buf_count; - int16_t samples[2] = {0x0,0x0}; - for (int i=0;idma_buf_count; + int16_t samples[2] = {0x0, 0x0}; + for (int i = 0; i < buffersize; i++) + { + while (!ConsumeSample(samples)) + { + delay(10); + } } - } -#endif + #elif defined(ARDUINO_ARCH_RP2040) + I2S.flush(); + #endif } bool AudioOutputI2S::stop() { -#ifdef ESP32 - i2s_zero_dma_buffer((i2s_port_t)portNo); -#endif + if (!i2sOn) + return false; + + #ifdef ESP32 + i2s_zero_dma_buffer((i2s_port_t)portNo); + #elif defined(ARDUINO_ARCH_RP2040) + I2S.end(); + #endif + i2sOn = false; return true; } diff --git a/lib/lib_audio/ESP8266Audio/src/AudioOutputI2S.h b/lib/lib_audio/ESP8266Audio/src/AudioOutputI2S.h index 6070ca4e8..90370dc27 100644 --- a/lib/lib_audio/ESP8266Audio/src/AudioOutputI2S.h +++ b/lib/lib_audio/ESP8266Audio/src/AudioOutputI2S.h @@ -18,41 +18,47 @@ along with this program. If not, see . */ -#ifndef _AUDIOOUTPUTI2S_H -#define _AUDIOOUTPUTI2S_H +#pragma once #include "AudioOutput.h" class AudioOutputI2S : public AudioOutput { public: +#if defined(ESP32) || defined(ESP8266) AudioOutputI2S(int port=0, int output_mode=EXTERNAL_I2S, int dma_buf_count = 8, int use_apll=APLL_DISABLE); - virtual ~AudioOutputI2S() override; bool SetPinout(int bclkPin, int wclkPin, int doutPin); + enum : int { APLL_AUTO = -1, APLL_ENABLE = 1, APLL_DISABLE = 0 }; + enum : int { EXTERNAL_I2S = 0, INTERNAL_DAC = 1, INTERNAL_PDM = 2 }; +#elif defined(ARDUINO_ARCH_RP2040) + AudioOutputI2S(long sampleRate = 44100, pin_size_t sck = 26, pin_size_t data = 28); +#endif + virtual ~AudioOutputI2S() override; virtual bool SetRate(int hz) override; virtual bool SetBitsPerSample(int bits) override; virtual bool SetChannels(int channels) override; - virtual bool begin() override; + virtual bool begin() override { return begin(true); } virtual bool ConsumeSample(int16_t sample[2]) override; virtual void flush() override; virtual bool stop() override; + bool begin(bool txDAC); bool SetOutputModeMono(bool mono); // Force mono output no matter the input - enum : int { APLL_AUTO = -1, APLL_ENABLE = 1, APLL_DISABLE = 0 }; - enum : int { EXTERNAL_I2S = 0, INTERNAL_DAC = 1, INTERNAL_PDM = 2 }; - protected: + bool SetPinout(); virtual int AdjustI2SRate(int hz) { return hz; } uint8_t portNo; int output_mode; bool mono; bool i2sOn; int dma_buf_count; + int use_apll; // We can restore the old values and free up these pins when in NoDAC mode uint32_t orig_bck; uint32_t orig_ws; + + uint8_t bclkPin; + uint8_t wclkPin; + uint8_t doutPin; }; - -#endif - diff --git a/lib/lib_audio/ESP8266Audio/src/AudioOutputI2SNoDAC.cpp b/lib/lib_audio/ESP8266Audio/src/AudioOutputI2SNoDAC.cpp index 4f7b21ff7..116d9ac74 100644 --- a/lib/lib_audio/ESP8266Audio/src/AudioOutputI2SNoDAC.cpp +++ b/lib/lib_audio/ESP8266Audio/src/AudioOutputI2SNoDAC.cpp @@ -21,8 +21,12 @@ #include #ifdef ESP32 #include "driver/i2s.h" -#else - #include +#elif defined(ARDUINO_ARCH_RP2040) || defined(ESP8266) + #ifdef ARDUINO_ESP8266_MAJOR //this define was added in ESP8266 Arduino Core version v3.0.1 + #include "core_esp8266_i2s.h" //for Arduino core >= 3.0.1 + #else + #include "i2s.h" //for Arduino core <= 3.0.0 + #endif #endif #include "AudioOutputI2SNoDAC.h" @@ -32,7 +36,7 @@ AudioOutputI2SNoDAC::AudioOutputI2SNoDAC(int port) : AudioOutputI2S(port, false) SetOversampling(32); lastSamp = 0; cumErr = 0; -#ifndef ESP32 +#ifdef ESP8266 WRITE_PERI_REG(PERIPHS_IO_MUX_MTDO_U, orig_bck); WRITE_PERI_REG(PERIPHS_IO_MUX_GPIO2_U, orig_ws); #endif @@ -95,19 +99,23 @@ bool AudioOutputI2SNoDAC::ConsumeSample(int16_t sample[2]) // Either send complete pulse stream or nothing #ifdef ESP32 - // Deprecated. Use i2s_write // if (!i2s_write_bytes((i2s_port_t)portNo, (const char *)dsBuff, sizeof(uint32_t) * (oversample/32), 0)) size_t bytes_written; i2s_write((i2s_port_t)portNo, (const char *)dsBuff, sizeof(uint32_t) * (oversample/32), &bytes_written, 0); if (!bytes_written) return false; -#else +#elif defined(ESP8266) if (!i2s_write_sample_nb(dsBuff[0])) return false; // No room at the inn // At this point we've sent in first of possibly 8 32-bits, need to send // remaining ones even if they block. for (int i = 32; i < oversample; i+=32) i2s_write_sample( dsBuff[i / 32]); +#elif defined(ARDUINO_ARCH_RP2040) + int16_t *p = (int16_t *) dsBuff; + for (int i = 0; i < oversample / 16; i++) { + I2S.write(*(p++)); + } #endif return true; } diff --git a/lib/lib_audio/ESP8266Audio/src/AudioOutputI2SNoDAC.h b/lib/lib_audio/ESP8266Audio/src/AudioOutputI2SNoDAC.h index b5f321457..2a6322524 100644 --- a/lib/lib_audio/ESP8266Audio/src/AudioOutputI2SNoDAC.h +++ b/lib/lib_audio/ESP8266Audio/src/AudioOutputI2SNoDAC.h @@ -18,8 +18,7 @@ along with this program. If not, see . */ -#ifndef _AUDIOOUTPUTI2SNODAC_H -#define _AUDIOOUTPUTI2SNODAC_H +#pragma once #include "AudioOutputI2S.h" @@ -28,6 +27,7 @@ class AudioOutputI2SNoDAC : public AudioOutputI2S public: AudioOutputI2SNoDAC(int port = 0); virtual ~AudioOutputI2SNoDAC() override; + virtual bool begin() override { return AudioOutputI2S::begin(false); } virtual bool ConsumeSample(int16_t sample[2]) override; bool SetOversampling(int os); @@ -41,6 +41,3 @@ class AudioOutputI2SNoDAC : public AudioOutputI2S fixed24p8_t lastSamp; // Last sample value fixed24p8_t cumErr; // Running cumulative error since time began }; - -#endif - diff --git a/lib/lib_audio/ESP8266Audio/src/AudioOutputSPDIF.cpp b/lib/lib_audio/ESP8266Audio/src/AudioOutputSPDIF.cpp index 8c993c5f9..53483d4ac 100644 --- a/lib/lib_audio/ESP8266Audio/src/AudioOutputSPDIF.cpp +++ b/lib/lib_audio/ESP8266Audio/src/AudioOutputSPDIF.cpp @@ -37,6 +37,7 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ +#if defined(ESP32) || defined(ESP8266) #include #if defined(ESP32) @@ -286,3 +287,5 @@ bool AudioOutputSPDIF::stop() frame_num = 0; return true; } + +#endif diff --git a/lib/lib_audio/ESP8266Audio/src/AudioOutputSPDIF.h b/lib/lib_audio/ESP8266Audio/src/AudioOutputSPDIF.h index 92a4e46e4..5da160b3d 100644 --- a/lib/lib_audio/ESP8266Audio/src/AudioOutputSPDIF.h +++ b/lib/lib_audio/ESP8266Audio/src/AudioOutputSPDIF.h @@ -30,8 +30,8 @@ along with this program. If not, see . */ -#ifndef _AUDIOOUTPUTSPDIF_H -#define _AUDIOOUTPUTSPDIF_H +#if defined(ESP32) || defined(ESP8266) +#pragma once #include "AudioOutput.h" diff --git a/lib/lib_audio/ESP8266Audio/src/AudioOutputULP.cpp b/lib/lib_audio/ESP8266Audio/src/AudioOutputULP.cpp new file mode 100644 index 000000000..63177e3a1 --- /dev/null +++ b/lib/lib_audio/ESP8266Audio/src/AudioOutputULP.cpp @@ -0,0 +1,262 @@ +/* + AudioOutputULP + Outputs to ESP32 DAC through the ULP, freeing I2S for other uses + + Copyright (C) 2020 Martin Laclaustra, based on bitluni's code + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +*/ + +#ifdef ESP32 + +#include "AudioOutputULP.h" +#include +#include +#include +#include +#include + +uint32_t create_I_WR_REG(uint32_t reg, uint32_t low_bit, uint32_t high_bit, uint32_t val){ + typedef union {ulp_insn_t ulp_ins; uint32_t ulp_bin;} ulp_union; + const ulp_insn_t singleinstruction[] = {I_WR_REG(reg, low_bit, high_bit, val)}; + ulp_union recover_ins; + recover_ins.ulp_ins=singleinstruction[0]; + return (uint32_t)(recover_ins.ulp_bin); +} + +uint32_t create_I_BXI(uint32_t imm_pc){ + typedef union {ulp_insn_t ulp_ins; uint32_t ulp_bin;} ulp_union; + const ulp_insn_t singleinstruction[] = {I_BXI(imm_pc)}; + ulp_union recover_ins; + recover_ins.ulp_ins=singleinstruction[0]; + return (uint32_t)(recover_ins.ulp_bin); +} + +bool AudioOutputULP::begin() +{ + if(!stereoOutput){ + waitingOddSample = false; + //totalSampleWords += 512; + //dacTableStart2 = dacTableStart1; + } + + //calculate the actual ULP clock + unsigned long rtc_8md256_period = rtc_clk_cal(RTC_CAL_8MD256, 1000); + unsigned long rtc_fast_freq_hz = 1000000ULL * (1 << RTC_CLK_CAL_FRACT) * 256 / rtc_8md256_period; + + //initialize DACs + if(activeDACs & 1){ + dac_output_enable(DAC_CHANNEL_1); + dac_output_voltage(DAC_CHANNEL_1, 128); + } + if(activeDACs & 2){ + dac_output_enable(DAC_CHANNEL_2); + dac_output_voltage(DAC_CHANNEL_2, 128); + } + + int retAddress1 = 9; + int retAddress2 = 14; + + int loopCycles = 134; + int loopHalfCycles1 = 90; + int loopHalfCycles2 = 44; + + Serial.print("Real RTC clock: "); + Serial.println(rtc_fast_freq_hz); + + uint32_t dt = (rtc_fast_freq_hz / hertz) - loopCycles; + uint32_t dt2 = 0; + if(!stereoOutput){ + dt = (rtc_fast_freq_hz / hertz) - loopHalfCycles1; + dt2 = (rtc_fast_freq_hz / hertz) - loopHalfCycles2; + } + + Serial.print("dt: "); + Serial.println(dt); + + Serial.print("dt2: "); + Serial.println(dt2); + + const ulp_insn_t stereo[] = { + //reset offset register + I_MOVI(R3, 0), + //delay to get the right sampling rate + I_DELAY(dt), // 6 + dt + //reset sample index + I_MOVI(R0, 0), // 6 + //write the index back to memory for the main cpu + I_ST(R0, R3, indexAddress), // 8 + //load the samples + I_LD(R1, R0, bufferStart), // 8 + //mask the lower 8 bits + I_ANDI(R2, R1, 0x00ff), // 6 + //multiply by 2 + I_LSHI(R2, R2, 1), // 6 + //add start position + I_ADDI(R2, R2, dacTableStart1),// 6 + //jump to the dac opcode + I_BXR(R2), // 4 + //back from first dac + //delay between the two samples in mono rendering + I_DELAY(dt2), // 6 + dt2 + //mask the upper 8 bits + I_ANDI(R2, R1, 0xff00), // 6 + //shift the upper bits to right and multiply by 2 + I_RSHI(R2, R2, 8 - 1), // 6 + //add start position of second dac table + I_ADDI(R2, R2, dacTableStart2),// 6 + //jump to the dac opcode + I_BXR(R2), // 4 + //here we get back from writing the second sample + //load 0x8080 as sample + I_MOVI(R1, 0x8080), // 6 + //write 0x8080 in the sample buffer + I_ST(R1, R0, indexAddress), // 8 + //increment the sample index + I_ADDI(R0, R0, 1), // 6 + //if reached end of the buffer, jump relative to index reset + I_BGE(-16, totalSampleWords), // 4 + //wait to get the right sample rate (2 cycles more to compensate the index reset) + I_DELAY((unsigned int)dt + 2), // 8 + dt + //if not, jump absolute to where index is written to memory + I_BXI(3) // 4 + }; + // write io and jump back another 12 + 4 + 12 + 4 + + size_t load_addr = 0; + size_t size = sizeof(stereo)/sizeof(ulp_insn_t); + ulp_process_macros_and_load(load_addr, stereo, &size); + // this is how to get the opcodes + // for(int i = 0; i < size; i++) + // Serial.println(RTC_SLOW_MEM[i], HEX); + + //create DAC opcode tables + switch(activeDACs){ + case 1: + for(int i = 0; i < 256; i++) + { + RTC_SLOW_MEM[dacTableStart1 + i * 2] = create_I_WR_REG(RTC_IO_PAD_DAC1_REG,19,26,i); //dac1: 0x1D4C0121 | (i << 10) + RTC_SLOW_MEM[dacTableStart1 + 1 + i * 2] = create_I_BXI(retAddress1); // 0x80000000 + retAddress1 * 4 + RTC_SLOW_MEM[dacTableStart2 + i * 2] = create_I_WR_REG(RTC_IO_PAD_DAC1_REG,19,26,i); //dac2: 0x1D4C0122 | (i << 10) + RTC_SLOW_MEM[dacTableStart2 + 1 + i * 2] = create_I_BXI(retAddress2); // 0x80000000 + retAddress2 * 4 + } + break; + case 2: + for(int i = 0; i < 256; i++) + { + RTC_SLOW_MEM[dacTableStart1 + i * 2] = create_I_WR_REG(RTC_IO_PAD_DAC2_REG,19,26,i); //dac1: 0x1D4C0121 | (i << 10) + RTC_SLOW_MEM[dacTableStart1 + 1 + i * 2] = create_I_BXI(retAddress1); // 0x80000000 + retAddress1 * 4 + RTC_SLOW_MEM[dacTableStart2 + i * 2] = create_I_WR_REG(RTC_IO_PAD_DAC2_REG,19,26,i); //dac2: 0x1D4C0122 | (i << 10) + RTC_SLOW_MEM[dacTableStart2 + 1 + i * 2] = create_I_BXI(retAddress2); // 0x80000000 + retAddress2 * 4 + } + break; + case 3: + for(int i = 0; i < 256; i++) + { + RTC_SLOW_MEM[dacTableStart1 + i * 2] = create_I_WR_REG(RTC_IO_PAD_DAC1_REG,19,26,i); //dac1: 0x1D4C0121 | (i << 10) + RTC_SLOW_MEM[dacTableStart1 + 1 + i * 2] = create_I_BXI(retAddress1); // 0x80000000 + retAddress1 * 4 + RTC_SLOW_MEM[dacTableStart2 + i * 2] = create_I_WR_REG(RTC_IO_PAD_DAC1_REG,19,26,i); //dac2: 0x1D4C0122 | (i << 10) + RTC_SLOW_MEM[dacTableStart2 + 1 + i * 2] = create_I_BXI(retAddress2); // 0x80000000 + retAddress2 * 4 + } + break; + } + + //set all samples to 128 (silence) + for(int i = 0; i < totalSampleWords; i++) + RTC_SLOW_MEM[bufferStart + i] = 0x8080; + + //start + RTC_SLOW_MEM[indexAddress] = 0; + ulp_run(0); + + //wait until ULP starts using samples and the index of output sample advances + while(RTC_SLOW_MEM[indexAddress] == 0) + delay(1); + + return true; +} + +bool AudioOutputULP::ConsumeSample(int16_t sample[2]) +{ + int16_t ms[2]; + ms[0] = sample[0]; + ms[1] = sample[1]; + MakeSampleStereo16( ms ); + + // TODO: needs improvement (counting is different here with respect to ULP code) + int currentSample = RTC_SLOW_MEM[indexAddress] & 0xffff; + int currentWord = currentSample >> 1; + + for (int i=0; i<2; i++) { + ms[i] = ((ms[i] >> 8) + 128) & 0xff; + } + if(!stereoOutput) // mix both channels + ms[0] = (uint16_t)(( (uint32_t)((int32_t)(ms[0]) + (int32_t)(ms[1])) >> 1 ) & 0xff); + + if(waitingOddSample){ // always true for stereo because samples are consumed in pairs + if(lastFilledWord != currentWord) // accept sample if writing index lastFilledWord has not reached index of output sample + { + unsigned int w; + if(stereoOutput){ + w = ms[0]; + w |= ms[1] << 8; + } else { + w = bufferedOddSample; + w |= ms[0] << 8; + bufferedOddSample = 128; + waitingOddSample = false; + } + RTC_SLOW_MEM[bufferStart + lastFilledWord] = w; + lastFilledWord++; + if(lastFilledWord == totalSampleWords) + lastFilledWord = 0; + return true; + } else { + return false; + } + } else { + bufferedOddSample = ms[0]; + waitingOddSample = true; + return true; + } +} + + +bool AudioOutputULP::stop() +{ + audioLogger->printf_P(PSTR("\n\n\nstop\n\n\n")); + const ulp_insn_t stopulp[] = { + //stop the timer + I_END(), + //end the program + I_HALT()}; + + size_t load_addr = 0; + size_t size = sizeof(stopulp)/sizeof(ulp_insn_t); + ulp_process_macros_and_load(load_addr, stopulp, &size); + + //start + ulp_run(0); + + if(activeDACs & 1){ + dac_output_voltage(DAC_CHANNEL_1, 128); + } + if(activeDACs & 2){ + dac_output_voltage(DAC_CHANNEL_2, 128); + } + + return true; +} + +#endif diff --git a/lib/lib_audio/ESP8266Audio/src/AudioOutputULP.h b/lib/lib_audio/ESP8266Audio/src/AudioOutputULP.h new file mode 100644 index 000000000..fc4e438c1 --- /dev/null +++ b/lib/lib_audio/ESP8266Audio/src/AudioOutputULP.h @@ -0,0 +1,69 @@ +/* + AudioOutputULP + Outputs to ESP32 DAC through the ULP, freeing I2S for other uses + + Copyright (C) 2020 Martin Laclaustra, based on bitluni's code + + 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 . +*/ + +// Instructions: +// AudioOutputULP out = new AudioOutputULP(); // stereo +// Connect left channel on pin 25 +// Connect right channel on pin 26 +// OR +// Connect mono channel on either of them (stereo samples are downmixed) +// AudioOutputULP out = new AudioOutputULP(1); // mono, only DAC 1 +// OR +// AudioOutputULP out = new AudioOutputULP(2); // mono, only DAC 2 + + +#ifndef _AUDIOOUTPUTULP_H +#define _AUDIOOUTPUTULP_H + +#include "AudioOutput.h" + +#ifdef ESP32 + +class AudioOutputULP : public AudioOutput +{ + public: + AudioOutputULP(int argActiveDACs=3) {if(argActiveDACs<1||argActiveDACs>2)argActiveDACs=3;activeDACs=argActiveDACs;stereoOutput=activeDACs==3;}; + ~AudioOutputULP() {}; + virtual bool begin() override; + virtual bool ConsumeSample(int16_t sample[2]) override; + virtual bool stop() override; + enum : int { DAC1 = 1, DAC2 = 2 }; + private: + int lastFilledWord = 0; + uint8_t bufferedOddSample = 128; + bool waitingOddSample = true; // must be set to false for mono output + int activeDACs = 3; // 1:DAC1; 2:DAC2; 3:both; + bool stereoOutput = true; + const int opcodeCount = 20; + const uint32_t dacTableStart1 = 2048 - 512; + const uint32_t dacTableStart2 = dacTableStart1 - 512; + uint32_t totalSampleWords = 2048 - 512 - 512 - (opcodeCount + 1); // add 512 for mono + const int totalSamples = totalSampleWords * 2; + const uint32_t indexAddress = opcodeCount; + const uint32_t bufferStart = indexAddress + 1; +}; + +#else + +#error Only the ESP32 supports ULP audio output + +#endif + +#endif diff --git a/lib/lib_audio/ESP8266Audio/src/ESP8266Audio.h b/lib/lib_audio/ESP8266Audio/src/ESP8266Audio.h new file mode 100644 index 000000000..eb0acc52a --- /dev/null +++ b/lib/lib_audio/ESP8266Audio/src/ESP8266Audio.h @@ -0,0 +1,50 @@ +// Lazy "include all the things" header for simplicity. +// In general a user should only include the specific headers they need +// to miniimize build times. + +// Input stage +#include "AudioFileSourceBuffer.h" +#include "AudioFileSourceFATFS.h" +#include "AudioFileSourceFS.h" +#include "AudioFileSource.h" +#include "AudioFileSourceHTTPStream.h" +#include "AudioFileSourceICYStream.h" +#include "AudioFileSourceID3.h" +#include "AudioFileSourceLittleFS.h" +#include "AudioFileSourcePROGMEM.h" +#include "AudioFileSourceSD.h" +#include "AudioFileSourceSPIFFS.h" +#include "AudioFileSourceSPIRAMBuffer.h" +#include "AudioFileSourceSTDIO.h" + +// Misc. plumbing +#include "AudioFileStream.h" +#include "AudioLogger.h" +#include "AudioStatus.h" + +// Actual decode/audio generation logic +#include "AudioGeneratorAAC.h" +#include "AudioGeneratorFLAC.h" +#include "AudioGenerator.h" +#include "AudioGeneratorMIDI.h" +#include "AudioGeneratorMOD.h" +#include "AudioGeneratorMP3a.h" +#include "AudioGeneratorMP3.h" +#include "AudioGeneratorOpus.h" +#include "AudioGeneratorRTTTL.h" +#include "AudioGeneratorTalkie.h" +#include "AudioGeneratorWAV.h" + +// Render(output) sounds +#include "AudioOutputBuffer.h" +#include "AudioOutputFilterDecimate.h" +#include "AudioOutput.h" +#include "AudioOutputI2S.h" +#include "AudioOutputI2SNoDAC.h" +#include "AudioOutputMixer.h" +#include "AudioOutputNull.h" +#include "AudioOutputSerialWAV.h" +#include "AudioOutputSPDIF.h" +#include "AudioOutputSPIFFSWAV.h" +#include "AudioOutputSTDIO.h" +#include "AudioOutputULP.h" diff --git a/lib/lib_audio/ESP8266Audio/src/libflac/bitreader.c b/lib/lib_audio/ESP8266Audio/src/libflac/bitreader.c index a64c1ce53..b2a751d40 100644 --- a/lib/lib_audio/ESP8266Audio/src/libflac/bitreader.c +++ b/lib/lib_audio/ESP8266Audio/src/libflac/bitreader.c @@ -121,6 +121,8 @@ struct FLAC__BitReader { void *client_data; }; +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wstrict-aliasing" static inline void crc16_update_word_(FLAC__BitReader *br, brword word) { unsigned crc = br->read_crc16; @@ -149,6 +151,7 @@ static inline void crc16_update_word_(FLAC__BitReader *br, brword word) #endif br->crc16_align = 0; } +#pragma GCC diagnostic pop static FLAC__bool bitreader_read_from_client_(FLAC__BitReader *br) { @@ -338,6 +341,8 @@ void FLAC__bitreader_reset_read_crc16(FLAC__BitReader *br, FLAC__uint16 seed) br->crc16_align = br->consumed_bits; } +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wstrict-aliasing" FLAC__uint16 FLAC__bitreader_get_read_crc16(FLAC__BitReader *br) { FLAC__ASSERT(0 != br); @@ -353,6 +358,7 @@ FLAC__uint16 FLAC__bitreader_get_read_crc16(FLAC__BitReader *br) } return br->read_crc16; } +#pragma GCC diagnostic pop inline FLAC__bool FLAC__bitreader_is_consumed_byte_aligned(const FLAC__BitReader *br) { diff --git a/lib/lib_audio/ESP8266Audio/src/libflac/config.h b/lib/lib_audio/ESP8266Audio/src/libflac/config.h index b6efd1dc8..cf6c07dfe 100644 --- a/lib/lib_audio/ESP8266Audio/src/libflac/config.h +++ b/lib/lib_audio/ESP8266Audio/src/libflac/config.h @@ -2,9 +2,7 @@ #ifdef DEBUG #undef NDEBUG -#endif - -#ifndef NDEBUG +#else #define NDEBUG #endif diff --git a/lib/lib_audio/ESP8266Audio/src/libflac/cpu.c b/lib/lib_audio/ESP8266Audio/src/libflac/cpu.c index efed11b7f..cd650a09c 100644 --- a/lib/lib_audio/ESP8266Audio/src/libflac/cpu.c +++ b/lib/lib_audio/ESP8266Audio/src/libflac/cpu.c @@ -31,7 +31,7 @@ */ //#ifdef HAVE_CONFIG_H -# include +# include "config.h" //#endif #include "private/cpu.h" diff --git a/lib/lib_audio/ESP8266Audio/src/libflac/crc.c b/lib/lib_audio/ESP8266Audio/src/libflac/crc.c index 1b531e3d1..88ef8cfbc 100644 --- a/lib/lib_audio/ESP8266Audio/src/libflac/crc.c +++ b/lib/lib_audio/ESP8266Audio/src/libflac/crc.c @@ -136,7 +136,8 @@ FLAC__uint8 FLAC__crc8(const FLAC__byte *data, unsigned len) return crc; } - +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wstrict-aliasing" unsigned FLAC__crc16(const FLAC__byte *data, unsigned len) { unsigned crc = 0; @@ -146,3 +147,4 @@ unsigned FLAC__crc16(const FLAC__byte *data, unsigned len) return crc; } +#pragma GCC diagnostic pop diff --git a/lib/lib_audio/ESP8266Audio/src/libflac/stream_decoder.c b/lib/lib_audio/ESP8266Audio/src/libflac/stream_decoder.c index eabcf092c..ec172fe8d 100644 --- a/lib/lib_audio/ESP8266Audio/src/libflac/stream_decoder.c +++ b/lib/lib_audio/ESP8266Audio/src/libflac/stream_decoder.c @@ -2021,6 +2021,8 @@ FLAC__bool frame_sync_(FLAC__StreamDecoder *decoder) return true; } +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wstrict-aliasing" FLAC__bool read_frame_(FLAC__StreamDecoder *decoder, FLAC__bool *got_a_frame, FLAC__bool do_full_decode) { uint32_t channel; @@ -2167,6 +2169,7 @@ FLAC__bool read_frame_(FLAC__StreamDecoder *decoder, FLAC__bool *got_a_frame, FL decoder->protected_->state = FLAC__STREAM_DECODER_SEARCH_FOR_FRAME_SYNC; return true; } +#pragma GCC diagnostic pop FLAC__bool read_frame_header_(FLAC__StreamDecoder *decoder) { diff --git a/lib/lib_audio/ESP8266Audio/src/libhelix-aac/assembly.h b/lib/lib_audio/ESP8266Audio/src/libhelix-aac/assembly.h index fc4d76739..595a8fc97 100644 --- a/lib/lib_audio/ESP8266Audio/src/libhelix-aac/assembly.h +++ b/lib/lib_audio/ESP8266Audio/src/libhelix-aac/assembly.h @@ -223,7 +223,7 @@ Word64 MADD64(Word64 sum64, int x, int y); /* toolchain: ARM ADS or RealView * target architecture: ARM v.4 and above (requires 'M' type processor for 32x32->64 multiplier) */ -#elif defined (__arm) && defined (__ARMCC_VERSION) +#elif defined (XXX__arm) && defined (__ARMCC_VERSION) static __inline int MULSHIFT32(int x, int y) { @@ -336,7 +336,7 @@ static __inline Word64 MADD64(Word64 sum64, int x, int y) /* toolchain: ARM gcc * target architecture: ARM v.4 and above (requires 'M' type processor for 32x32->64 multiplier) */ -#elif defined(__GNUC__) && defined(__arm__) +#elif defined(__GNUC__) && defined(XXXX__arm__) static inline int MULSHIFT32(int x, int y) { diff --git a/lib/lib_audio/ESP8266Audio/src/libhelix-aac/sbr.c b/lib/lib_audio/ESP8266Audio/src/libhelix-aac/sbr.c index ec046720c..e46391585 100644 --- a/lib/lib_audio/ESP8266Audio/src/libhelix-aac/sbr.c +++ b/lib/lib_audio/ESP8266Audio/src/libhelix-aac/sbr.c @@ -44,6 +44,7 @@ **************************************************************************************/ #if defined(USE_DEFAULT_STDLIB) || defined(ARDUINO) +#include #include #else #include "hlxclib/stdlib.h" diff --git a/lib/lib_audio/ESP8266Audio/src/libhelix-aac/sbrhfgen.c b/lib/lib_audio/ESP8266Audio/src/libhelix-aac/sbrhfgen.c index 7ebc047af..e5f27eb6d 100644 --- a/lib/lib_audio/ESP8266Audio/src/libhelix-aac/sbrhfgen.c +++ b/lib/lib_audio/ESP8266Audio/src/libhelix-aac/sbrhfgen.c @@ -76,7 +76,7 @@ static const int newBWTab[4][4] PROGMEM = { * Notes: this is carefully written to be efficient on ARM * use the assembly code version in sbrcov.s when building for ARM! **************************************************************************************/ -#if (defined (__arm) && defined (__ARMCC_VERSION)) || (defined (_WIN32) && defined (_WIN32_WCE) && defined (ARM)) || (defined(__GNUC__) && defined(__arm__)) +#if (defined (XXXX__arm) && defined (__ARMCC_VERSION)) || (defined (_WIN32) && defined (_WIN32_WCE) && defined (ARM)) || (defined(__GNUC__) && defined(XXXX__arm__)) #ifdef __cplusplus extern "C" #endif @@ -237,7 +237,7 @@ static int CalcCovariance1(int *XBuf, int *p01reN, int *p01imN, int *p12reN, int * Notes: this is carefully written to be efficient on ARM * use the assembly code version in sbrcov.s when building for ARM! **************************************************************************************/ -#if (defined (__arm) && defined (__ARMCC_VERSION)) || (defined (_WIN32) && defined (_WIN32_WCE) && defined (ARM)) || (defined(__GNUC__) && defined(__arm__)) +#if (defined (XXXX__arm) && defined (__ARMCC_VERSION)) || (defined (_WIN32) && defined (_WIN32_WCE) && defined (ARM)) || (defined(__GNUC__) && defined(XXXX__arm__)) #ifdef __cplusplus extern "C" #endif diff --git a/lib/lib_audio/ESP8266Audio/src/libhelix-mp3/assembly.h b/lib/lib_audio/ESP8266Audio/src/libhelix-mp3/assembly.h index 9c10c4da0..b9e46c529 100644 --- a/lib/lib_audio/ESP8266Audio/src/libhelix-mp3/assembly.h +++ b/lib/lib_audio/ESP8266Audio/src/libhelix-mp3/assembly.h @@ -217,7 +217,7 @@ static __inline int CLZ(int x) return numZeros; } -#elif defined ARM_ADS +#elif defined XXXARM_ADS static __inline int MULSHIFT32(int x, int y) { @@ -267,7 +267,7 @@ static __inline int CLZ(int x) return numZeros; } -#elif defined(__GNUC__) && defined(__thumb__) +#elif defined(__GNUC__) && defined(XXXX__thumb__) static __inline int MULSHIFT32(int x, int y) diff --git a/lib/lib_audio/ESP8266Audio/src/libmad/global.h b/lib/lib_audio/ESP8266Audio/src/libmad/global.h index a6debfd8b..a688495f8 100644 --- a/lib/lib_audio/ESP8266Audio/src/libmad/global.h +++ b/lib/lib_audio/ESP8266Audio/src/libmad/global.h @@ -48,6 +48,7 @@ # endif # if !defined(HAVE_ASSERT_H) +# undef assert # if defined(NDEBUG) # define assert(x) /* nothing */ # else diff --git a/lib/lib_audio/ESP8266Audio/src/libopus/celt/celt_decoder.c b/lib/lib_audio/ESP8266Audio/src/libopus/celt/celt_decoder.c index 329b6f6cc..7e7296ed5 100644 --- a/lib/lib_audio/ESP8266Audio/src/libopus/celt/celt_decoder.c +++ b/lib/lib_audio/ESP8266Audio/src/libopus/celt/celt_decoder.c @@ -482,7 +482,7 @@ static int celt_plc_pitch_search(celt_sig *decode_mem[2], int C, int arch) int pitch_index; VARDECL( opus_val16, lp_pitch_buf ); SAVE_STACK; - ALLOC( lp_pitch_buf, DECODE_BUFFER_SIZE>>1, opus_val16 ); + opus_val16 *lp_pitch_buf = (opus_val16*)malloc((DECODE_BUFFER_SIZE>>1) * sizeof(opus_val16)); //ALLOC( lp_pitch_buf, DECODE_BUFFER_SIZE>>1, opus_val16 ); pitch_downsample(decode_mem, lp_pitch_buf, DECODE_BUFFER_SIZE, C, arch); pitch_search(lp_pitch_buf+(PLC_PITCH_LAG_MAX>>1), lp_pitch_buf, @@ -490,6 +490,7 @@ static int celt_plc_pitch_search(celt_sig *decode_mem[2], int C, int arch) PLC_PITCH_LAG_MAX-PLC_PITCH_LAG_MIN, &pitch_index, arch); pitch_index = PLC_PITCH_LAG_MAX-pitch_index; RESTORE_STACK; + free(lp_pitch_buf); return pitch_index; } diff --git a/lib/lib_audio/ESP8266Audio/src/libopus/config.h b/lib/lib_audio/ESP8266Audio/src/libopus/config.h index 3577204b6..dc1ee1e98 100644 --- a/lib/lib_audio/ESP8266Audio/src/libopus/config.h +++ b/lib/lib_audio/ESP8266Audio/src/libopus/config.h @@ -206,3 +206,5 @@ # define _Restrict # define __restrict__ #endif + +#include diff --git a/lib/lib_audio/ESP8266Audio/src/libopus/repacketizer.c b/lib/lib_audio/ESP8266Audio/src/libopus/repacketizer.c index 5a1eb675e..36732293f 100644 --- a/lib/lib_audio/ESP8266Audio/src/libopus/repacketizer.c +++ b/lib/lib_audio/ESP8266Audio/src/libopus/repacketizer.c @@ -239,21 +239,30 @@ opus_int32 opus_repacketizer_out(OpusRepacketizer *rp, unsigned char *data, opus int opus_packet_pad(unsigned char *data, opus_int32 len, opus_int32 new_len) { - OpusRepacketizer rp; + OpusRepacketizer *rp = (OpusRepacketizer*)malloc(sizeof(OpusRepacketizer)); opus_int32 ret; - if (len < 1) + if (len < 1) { + free(rp); return OPUS_BAD_ARG; - if (len==new_len) + } + if (len==new_len) { + free(rp); return OPUS_OK; - else if (len > new_len) + } + else if (len > new_len) { + free(rp); return OPUS_BAD_ARG; - opus_repacketizer_init(&rp); + } + opus_repacketizer_init(rp); /* Moving payload to the end of the packet so we can do in-place padding */ OPUS_MOVE(data+new_len-len, data, len); - ret = opus_repacketizer_cat(&rp, data+new_len-len, len); - if (ret != OPUS_OK) + ret = opus_repacketizer_cat(rp, data+new_len-len, len); + if (ret != OPUS_OK) { + free(rp); return ret; - ret = opus_repacketizer_out_range_impl(&rp, 0, rp.nb_frames, data, new_len, 0, 1); + } + ret = opus_repacketizer_out_range_impl(rp, 0, rp->nb_frames, data, new_len, 0, 1); + free(rp); if (ret > 0) return OPUS_OK; else @@ -262,15 +271,20 @@ int opus_packet_pad(unsigned char *data, opus_int32 len, opus_int32 new_len) opus_int32 opus_packet_unpad(unsigned char *data, opus_int32 len) { - OpusRepacketizer rp; + OpusRepacketizer *rp = (OpusRepacketizer*)malloc(sizeof(OpusRepacketizer)); opus_int32 ret; - if (len < 1) + if (len < 1) { + free(rp); return OPUS_BAD_ARG; - opus_repacketizer_init(&rp); - ret = opus_repacketizer_cat(&rp, data, len); - if (ret < 0) + } + opus_repacketizer_init(rp); + ret = opus_repacketizer_cat(rp, data, len); + if (ret < 0) { + free(rp); return ret; - ret = opus_repacketizer_out_range_impl(&rp, 0, rp.nb_frames, data, len, 0, 0); + } + ret = opus_repacketizer_out_range_impl(rp, 0, rp->nb_frames, data, len, 0, 0); + free(rp); celt_assert(ret > 0 && ret <= len); return ret; } @@ -312,12 +326,14 @@ opus_int32 opus_multistream_packet_unpad(unsigned char *data, opus_int32 len, in unsigned char toc; opus_int16 size[48]; opus_int32 packet_offset; - OpusRepacketizer rp; + OpusRepacketizer *rp = (OpusRepacketizer*)malloc(sizeof(OpusRepacketizer)); unsigned char *dst; opus_int32 dst_len; - if (len < 1) + if (len < 1){ + free(rp); return OPUS_BAD_ARG; + } dst = data; dst_len = 0; /* Unpad all frames */ @@ -325,25 +341,34 @@ opus_int32 opus_multistream_packet_unpad(unsigned char *data, opus_int32 len, in { opus_int32 ret; int self_delimited = s!=nb_streams-1; - if (len<=0) + if (len<=0) { + free(rp); return OPUS_INVALID_PACKET; - opus_repacketizer_init(&rp); + } + opus_repacketizer_init(rp); ret = opus_packet_parse_impl(data, len, self_delimited, &toc, NULL, size, NULL, &packet_offset); - if (ret<0) + if (ret<0) { + free(rp); return ret; - ret = opus_repacketizer_cat_impl(&rp, data, packet_offset, self_delimited); - if (ret < 0) + } + ret = opus_repacketizer_cat_impl(rp, data, packet_offset, self_delimited); + if (ret < 0) { + free(rp); return ret; - ret = opus_repacketizer_out_range_impl(&rp, 0, rp.nb_frames, dst, len, self_delimited, 0); - if (ret < 0) + } + ret = opus_repacketizer_out_range_impl(rp, 0, rp->nb_frames, dst, len, self_delimited, 0); + if (ret < 0) { + free(rp); return ret; + } else dst_len += ret; dst += ret; data += packet_offset; len -= packet_offset; } + free(rp); return dst_len; } diff --git a/lib/lib_audio/ESP8266Audio/src/libopus/silk/NLSF2A.c b/lib/lib_audio/ESP8266Audio/src/libopus/silk/NLSF2A.c index 40718e7a8..2b3e3340d 100644 --- a/lib/lib_audio/ESP8266Audio/src/libopus/silk/NLSF2A.c +++ b/lib/lib_audio/ESP8266Audio/src/libopus/silk/NLSF2A.c @@ -80,10 +80,11 @@ void silk_NLSF2A( }; const unsigned char *ordering; opus_int k, i, dd; - opus_int32 cos_LSF_QA[ SILK_MAX_ORDER_LPC ]; - opus_int32 P[ SILK_MAX_ORDER_LPC / 2 + 1 ], Q[ SILK_MAX_ORDER_LPC / 2 + 1 ]; + opus_int32 *cos_LSF_QA = (opus_int32*)malloc(sizeof(opus_int32) * SILK_MAX_ORDER_LPC ); + opus_int32 *P = (opus_int32*)malloc(sizeof(opus_int32) * (SILK_MAX_ORDER_LPC / 2 + 1)); + opus_int32 *Q= (opus_int32*)malloc(sizeof(opus_int32) * (SILK_MAX_ORDER_LPC / 2 + 1)); opus_int32 Ptmp, Qtmp, f_int, f_frac, cos_val, delta; - opus_int32 a32_QA1[ SILK_MAX_ORDER_LPC ]; + opus_int32 *a32_QA1 = (opus_int32*)malloc(sizeof(opus_int32) * SILK_MAX_ORDER_LPC ); silk_assert( LSF_COS_TAB_SZ_FIX == 128 ); celt_assert( d==10 || d==16 ); @@ -137,5 +138,9 @@ void silk_NLSF2A( a_Q12[ k ] = (opus_int16)silk_RSHIFT_ROUND( a32_QA1[ k ], QA + 1 - 12 ); /* QA+1 -> Q12 */ } } + free(cos_LSF_QA); + free(P); + free(Q); + free(a32_QA1); } diff --git a/lib/lib_audio/ESP8266Audio/src/libopus/silk/fixed/burg_modified_FIX.c b/lib/lib_audio/ESP8266Audio/src/libopus/silk/fixed/burg_modified_FIX.c index b4a31d605..dd7862983 100644 --- a/lib/lib_audio/ESP8266Audio/src/libopus/silk/fixed/burg_modified_FIX.c +++ b/lib/lib_audio/ESP8266Audio/src/libopus/silk/fixed/burg_modified_FIX.c @@ -57,12 +57,12 @@ void silk_burg_modified_c( opus_int k, n, s, lz, rshifts, reached_max_gain; opus_int32 C0, num, nrg, rc_Q31, invGain_Q30, Atmp_QA, Atmp1, tmp1, tmp2, x1, x2; const opus_int16 *x_ptr; - opus_int32 C_first_row[ SILK_MAX_ORDER_LPC ]; - opus_int32 C_last_row[ SILK_MAX_ORDER_LPC ]; - opus_int32 Af_QA[ SILK_MAX_ORDER_LPC ]; - opus_int32 CAf[ SILK_MAX_ORDER_LPC + 1 ]; - opus_int32 CAb[ SILK_MAX_ORDER_LPC + 1 ]; - opus_int32 xcorr[ SILK_MAX_ORDER_LPC ]; + opus_int32 *C_first_row = (opus_int32*)malloc(sizeof(opus_int32) * SILK_MAX_ORDER_LPC); + opus_int32 *C_last_row = (opus_int32*)malloc(sizeof(opus_int32) * SILK_MAX_ORDER_LPC); + opus_int32 *Af_QA = (opus_int32*)malloc(sizeof(opus_int32) * SILK_MAX_ORDER_LPC); + opus_int32 *CAf = (opus_int32*)malloc(sizeof(opus_int32) * (SILK_MAX_ORDER_LPC+1)); + opus_int32 *CAb = (opus_int32*)malloc(sizeof(opus_int32) * (SILK_MAX_ORDER_LPC+1)); + opus_int32 *xcorr = (opus_int32*)malloc(sizeof(opus_int32) * SILK_MAX_ORDER_LPC); opus_int64 C0_64; celt_assert( subfr_length * nb_subfr <= MAX_FRAME_SIZE ); @@ -277,4 +277,10 @@ void silk_burg_modified_c( *res_nrg = silk_SMLAWW( nrg, silk_SMMUL( SILK_FIX_CONST( FIND_LPC_COND_FAC, 32 ), C0 ), -tmp1 );/* Q( -rshifts ) */ *res_nrg_Q = -rshifts; } + free(C_first_row); + free(C_last_row); + free(Af_QA); + free(CAf); + free(CAb); + free(xcorr); } diff --git a/lib/lib_audio/ESP8266Audio/src/libopus/silk/fixed/warped_autocorrelation_FIX.c b/lib/lib_audio/ESP8266Audio/src/libopus/silk/fixed/warped_autocorrelation_FIX.c index 7ef3a7efc..9c21f2a9b 100644 --- a/lib/lib_audio/ESP8266Audio/src/libopus/silk/fixed/warped_autocorrelation_FIX.c +++ b/lib/lib_audio/ESP8266Audio/src/libopus/silk/fixed/warped_autocorrelation_FIX.c @@ -49,8 +49,8 @@ void silk_warped_autocorrelation_FIX_c( { opus_int n, i, lsh; opus_int32 tmp1_QS, tmp2_QS; - opus_int32 state_QS[ MAX_SHAPE_LPC_ORDER + 1 ] = { 0 }; - opus_int64 corr_QC[ MAX_SHAPE_LPC_ORDER + 1 ] = { 0 }; + opus_int32 *state_QS = (opus_int32*)calloc(MAX_SHAPE_LPC_ORDER + 1, sizeof(opus_int32)); + opus_int64 *corr_QC = (opus_int64*)calloc(MAX_SHAPE_LPC_ORDER + 1, sizeof(opus_int64)); /* Order must be even */ celt_assert( ( order & 1 ) == 0 ); @@ -88,5 +88,7 @@ void silk_warped_autocorrelation_FIX_c( } } silk_assert( corr_QC[ 0 ] >= 0 ); /* If breaking, decrease QC*/ + free(state_QS); + free(corr_QC); } #endif /* OVERRIDE_silk_warped_autocorrelation_FIX_c */ diff --git a/lib/lib_audio/ESP8266Audio/src/libopus/silk/resampler_down2_3.c b/lib/lib_audio/ESP8266Audio/src/libopus/silk/resampler_down2_3.c index d8ce95c68..62aab5682 100644 --- a/lib/lib_audio/ESP8266Audio/src/libopus/silk/resampler_down2_3.c +++ b/lib/lib_audio/ESP8266Audio/src/libopus/silk/resampler_down2_3.c @@ -48,7 +48,8 @@ void silk_resampler_down2_3( opus_int32 *buf_ptr; SAVE_STACK; - ALLOC( buf, RESAMPLER_MAX_BATCH_SIZE_IN + ORDER_FIR, opus_int32 ); +// ALLOC( buf, RESAMPLER_MAX_BATCH_SIZE_IN + ORDER_FIR, opus_int32 ); + opus_int32 *buf = (opus_int32*)malloc((RESAMPLER_MAX_BATCH_SIZE_IN + ORDER_FIR) * sizeof(opus_int32)); /* Copy buffered samples to start of buffer */ silk_memcpy( buf, S, ORDER_FIR * sizeof( opus_int32 ) ); @@ -99,5 +100,6 @@ void silk_resampler_down2_3( /* Copy last part of filtered signal to the state for the next call */ silk_memcpy( S, &buf[ nSamplesIn ], ORDER_FIR * sizeof( opus_int32 ) ); + free(buf); RESTORE_STACK; } diff --git a/lib/lib_audio/ESP8266Audio/src/libtinysoundfont/tsf.h b/lib/lib_audio/ESP8266Audio/src/libtinysoundfont/tsf.h index e1a43221e..4ac232d14 100644 --- a/lib/lib_audio/ESP8266Audio/src/libtinysoundfont/tsf.h +++ b/lib/lib_audio/ESP8266Audio/src/libtinysoundfont/tsf.h @@ -486,16 +486,17 @@ struct tsf_stream_memory { const char* buffer; unsigned int total, pos; }; static int tsf_stream_memory_read(struct tsf_stream_memory* m, void* ptr, unsigned int size) { if (size > m->total - m->pos) size = m->total - m->pos; TSF_MEMCPY(ptr, m->buffer+m->pos, size); m->pos += size; return size; } static int tsf_stream_memory_tell(struct tsf_stream_memory* m) { return m->pos; } static int tsf_stream_memory_size(struct tsf_stream_memory* m) { return m->total; } -static int tsf_stream_memory_skip(struct tsf_stream_memory* m, unsigned int count) { if (m->pos + count > m->total) return 0; m->pos += count; return 1; } +static int tsf_stream_memory_skip(struct tsf_stream_memory* m, unsigned int count) { if (m->pos + count > m->total) count = m->total - m->pos; m->pos += count; return 1; } static int tsf_stream_memory_seek(struct tsf_stream_memory* m, unsigned int pos) { if (pos > m->total) return 0; else m->pos = pos; return 1; } -static int tsf_stream_memory_close(struct tsf_stream_memory* m) { (void)m; return 1; } +static int tsf_stream_memory_close(struct tsf_stream_memory* m) { TSF_FREE(m); return 1; } TSFDEF tsf* tsf_load_memory(const void* buffer, int size) { struct tsf_stream stream = { TSF_NULL, (int(*)(void*,void*,unsigned int))&tsf_stream_memory_read, (int(*)(void*))&tsf_stream_memory_tell, (int(*)(void*,unsigned int))&tsf_stream_memory_skip, (int(*)(void*,unsigned int))&tsf_stream_memory_seek, (int(*)(void*))&tsf_stream_memory_close, (int(*)(void*))&tsf_stream_memory_size }; - struct tsf_stream_memory f = { 0, 0, 0 }; - f.buffer = (const char*)buffer; - f.total = size; - stream.data = &f; + struct tsf_stream_memory* f = (struct tsf_stream_memory*)TSF_MALLOC(sizeof(struct tsf_stream_memory)); + f->pos = 0; + f->buffer = (const char*)buffer; + f->total = size; + stream.data = f; return tsf_load(&stream); } diff --git a/lib/lib_audio/ESP8266Audio/src/opusfile/opusfile.c b/lib/lib_audio/ESP8266Audio/src/opusfile/opusfile.c index bfd3c9e5d..7ffe32f89 100644 --- a/lib/lib_audio/ESP8266Audio/src/opusfile/opusfile.c +++ b/lib/lib_audio/ESP8266Audio/src/opusfile/opusfile.c @@ -90,12 +90,12 @@ int op_test(OpusHead *_head, ogg_sync_init(&oy); data=ogg_sync_buffer(&oy,(long)_initial_bytes); if(data!=NULL){ - ogg_stream_state os; + ogg_stream_state *os = (ogg_stream_state*)malloc(sizeof(ogg_stream_state)); ogg_page og; int ret; memcpy(data,_initial_data,_initial_bytes); ogg_sync_wrote(&oy,(long)_initial_bytes); - ogg_stream_init(&os,-1); + ogg_stream_init(os,-1); err=OP_FALSE; do{ ogg_packet op; @@ -104,11 +104,11 @@ int op_test(OpusHead *_head, if(ret<0)continue; /*Stop if we run out of data.*/ if(!ret)break; - ogg_stream_reset_serialno(&os,ogg_page_serialno(&og)); - ogg_stream_pagein(&os,&og); + ogg_stream_reset_serialno(os,ogg_page_serialno(&og)); + ogg_stream_pagein(os,&og); /*Only process the first packet on this page (if it's a BOS packet, it's required to be the only one).*/ - if(ogg_stream_packetout(&os,&op)==1){ + if(ogg_stream_packetout(os,&op)==1){ if(op.b_o_s){ ret=opus_head_parse(_head,op.packet,op.bytes); /*If this didn't look like Opus, keep going.*/ @@ -122,7 +122,8 @@ int op_test(OpusHead *_head, } } while(err==OP_FALSE); - ogg_stream_clear(&os); + ogg_stream_clear(os); + free(os); } else err=OP_EFAULT; ogg_sync_clear(&oy); @@ -835,7 +836,7 @@ static int op_find_initial_pcm_offset(OggOpusFile *_of, ogg_int64_t cur_page_gp; ogg_uint32_t serialno; opus_int32 total_duration; - int durations[255]; + int *durations = (int*)malloc(255 * sizeof(int)); int cur_page_eos; int op_count; int pi; @@ -852,26 +853,31 @@ static int op_find_initial_pcm_offset(OggOpusFile *_of, Otherwise there are no audio data packets in the whole logical stream.*/ if(OP_UNLIKELY(page_offset<0)){ /*Fail if there was a read error.*/ - if(page_offsethead.pre_skip>0)return OP_EBADTIMESTAMP; + if(_link->head.pre_skip>0) {free(durations); return OP_EBADTIMESTAMP;} _link->pcm_file_offset=0; /*Set pcm_end and end_offset so we can skip the call to op_find_final_pcm_offset().*/ _link->pcm_start=_link->pcm_end=0; _link->end_offset=_link->data_offset; + free(durations); return 0; } /*Similarly, if we hit the next link in the chain, we've gone too far.*/ if(OP_UNLIKELY(ogg_page_bos(_og))){ - if(_link->head.pre_skip>0)return OP_EBADTIMESTAMP; + if(_link->head.pre_skip>0) { + free(durations); + return OP_EBADTIMESTAMP; + } /*Set pcm_end and end_offset so we can skip the call to op_find_final_pcm_offset().*/ _link->pcm_file_offset=0; _link->pcm_start=_link->pcm_end=0; _link->end_offset=_link->data_offset; /*Tell the caller we've got a buffered page for them.*/ + free(durations); return 1; } /*Ignore pages from other streams (not strictly necessary, because of the @@ -901,7 +907,10 @@ static int op_find_initial_pcm_offset(OggOpusFile *_of, cur_page_gp=_of->op[op_count-1].granulepos; /*But getting a packet without a valid granule position on the page is not okay.*/ - if(cur_page_gp==-1)return OP_EBADTIMESTAMP; + if(cur_page_gp==-1) { + free(durations); + return OP_EBADTIMESTAMP; + } cur_page_eos=_of->op[op_count-1].e_o_s; if(OP_LIKELY(!cur_page_eos)){ /*The EOS flag wasn't set. @@ -910,6 +919,7 @@ static int op_find_initial_pcm_offset(OggOpusFile *_of, if(OP_UNLIKELY(op_granpos_add(&pcm_start,cur_page_gp,-total_duration)<0)){ /*The starting granule position MUST not be smaller than the amount of audio on the first page with completed packets.*/ + free(durations); return OP_EBADTIMESTAMP; } } @@ -923,6 +933,7 @@ static int op_find_initial_pcm_offset(OggOpusFile *_of, /*However, the end-trimming MUST not ask us to trim more samples than exist after applying the pre-skip.*/ if(OP_UNLIKELY(op_granpos_cmp(cur_page_gp,_link->head.pre_skip)<0)){ + free(durations); return OP_EBADTIMESTAMP; } } @@ -957,6 +968,7 @@ static int op_find_initial_pcm_offset(OggOpusFile *_of, _link->pcm_file_offset=0; _of->prev_packet_gp=_link->pcm_start=pcm_start; _of->prev_page_offset=page_offset; + free(durations); return 0; } @@ -1391,32 +1403,34 @@ static int op_open_seekable2_impl(OggOpusFile *_of){ /*64 seek records should be enough for anybody. Actually, with a bisection search in a 63-bit range down to OP_CHUNK_SIZE granularity, much more than enough.*/ - OpusSeekRecord sr[64]; + OpusSeekRecord *sr = (OpusSeekRecord*)malloc(64 * sizeof(OpusSeekRecord)); opus_int64 data_offset; int ret; /*We can seek, so set out learning all about this file.*/ (*_of->callbacks.seek)(_of->stream,0,SEEK_END); _of->offset=_of->end=(*_of->callbacks.tell)(_of->stream); - if(OP_UNLIKELY(_of->end<0))return OP_EREAD; + if(OP_UNLIKELY(_of->end<0)){free(sr); return OP_EREAD;} data_offset=_of->links[0].data_offset; - if(OP_UNLIKELY(_of->endendend, _of->links[0].serialno,_of->serialnos,_of->nserialnos); - if(OP_UNLIKELY(ret<0))return ret; + if(OP_UNLIKELY(ret<0)){free(sr); return ret;} /*If there's any trailing junk, forget about it.*/ _of->end=sr[0].offset+sr[0].size; - if(OP_UNLIKELY(_of->endendserialnos,&_of->nserialnos,&_of->cserialnos); + free(sr); + return ret; } static int op_open_seekable2(OggOpusFile *_of){ ogg_sync_state oy_start; - ogg_stream_state os_start; + ogg_stream_state *os_start = (ogg_stream_state*)malloc(sizeof(ogg_stream_state)); ogg_packet *op_start; opus_int64 prev_page_offset; opus_int64 start_offset; @@ -1435,9 +1449,9 @@ static int op_open_seekable2(OggOpusFile *_of){ start_op_count=_of->op_count; /*This is a bit too large to put on the stack unconditionally.*/ op_start=(ogg_packet *)_ogg_malloc(sizeof(*op_start)*start_op_count); - if(op_start==NULL)return OP_EFAULT; + if(op_start==NULL){free(os_start); return OP_EFAULT;} *&oy_start=_of->oy; - *&os_start=_of->os; + *os_start=_of->os; prev_page_offset=_of->prev_page_offset; start_offset=_of->offset; memcpy(op_start,_of->op,sizeof(*op_start)*start_op_count); @@ -1449,7 +1463,7 @@ static int op_open_seekable2(OggOpusFile *_of){ ogg_stream_clear(&_of->os); ogg_sync_clear(&_of->oy); *&_of->oy=*&oy_start; - *&_of->os=*&os_start; + *&_of->os=*os_start; _of->offset=start_offset; _of->op_count=start_op_count; memcpy(_of->op,op_start,sizeof(*_of->op)*start_op_count); @@ -1457,9 +1471,10 @@ static int op_open_seekable2(OggOpusFile *_of){ _of->prev_packet_gp=_of->links[0].pcm_start; _of->prev_page_offset=prev_page_offset; _of->cur_discard_count=_of->links[0].head.pre_skip; - if(OP_UNLIKELY(ret<0))return ret; + if(OP_UNLIKELY(ret<0)){free(os_start); return ret;} /*And restore the position indicator.*/ ret=(*_of->callbacks.seek)(_of->stream,op_position(_of),SEEK_SET); + free(os_start); return OP_UNLIKELY(ret<0)?OP_EREAD:0; } @@ -1980,7 +1995,7 @@ static int op_fetch_and_process_page(OggOpusFile *_of, ogg_stream_pagein(&_of->os,&og); if(OP_LIKELY(_of->ready_state>=OP_INITSET)){ opus_int32 total_duration; - int durations[255]; + int *durations = (int*)malloc(255 * sizeof(int)); int op_count; int report_hole; report_hole=0; @@ -2037,7 +2052,7 @@ static int op_fetch_and_process_page(OggOpusFile *_of, Proceed to the next link, rather than risk playing back some samples that shouldn't have been played.*/ _of->op_count=0; - if(report_hole)return OP_HOLE; + if(report_hole){ free(durations); return OP_HOLE; } continue; } /*By default discard 80 ms of data after a seek, unless we seek @@ -2145,9 +2160,9 @@ static int op_fetch_and_process_page(OggOpusFile *_of, _of->prev_page_offset=_page_offset; _of->op_count=op_count=pi; } - if(report_hole)return OP_HOLE; + if(report_hole) { free(durations); return OP_HOLE; } /*If end-trimming didn't trim all the packets, we're done.*/ - if(op_count>0)return 0; + if(op_count>0) { free(durations); return 0; } } } } diff --git a/lib/lib_audio/ESP8266Audio/tests/common.sh b/lib/lib_audio/ESP8266Audio/tests/common.sh old mode 100644 new mode 100755 diff --git a/lib/lib_audio/ESP8266Audio/tests/host/Makefile b/lib/lib_audio/ESP8266Audio/tests/host/Makefile index 9a219465e..25156dbcd 100644 --- a/lib/lib_audio/ESP8266Audio/tests/host/Makefile +++ b/lib/lib_audio/ESP8266Audio/tests/host/Makefile @@ -73,12 +73,17 @@ libopus=../../src/libopus/opus_decoder.c ../../src/libopus/opus_projection_decod opusfile=../../src/opusfile/opusfile.c ../../src/opusfile/stream.c ../../src/opusfile/internal.c ../../src/opusfile/info.c -CCOPTS=-g -Wunused-parameter -Wall -m32 -include Arduino.h -CPPOPTS=-g -Wunused-parameter -Wall -std=c++11 -m32 -include Arduino.h +libflac=../../src/libflac/md5.c ../../src/libflac/window.c ../../src/libflac/memory.c ../../src/libflac/cpu.c \ +../../src/libflac/fixed.c ../../src/libflac/format.c ../../src/libflac/lpc.c ../../src/libflac/crc.c \ +../../src/libflac/bitreader.c ../../src/libflac/bitmath.c ../../src/libflac/stream_decoder.c ../../src/libflac/float.c + + +CCOPTS=-g -Wunused-parameter -Wall -m32 -include Arduino.h -Wstack-usage=300 +CPPOPTS=-g -Wunused-parameter -Wall -std=c++11 -m32 -Wstack-usage=300 -include Arduino.h .phony: all -all: mp3 aac wav midi opus +all: mp3 aac wav midi opus flac mp3: FORCE rm -f *.o @@ -94,6 +99,13 @@ aac: FORCE rm -f *.o echo valgrind --leak-check=full --track-origins=yes -v --error-limit=no --show-leak-kinds=all ./aac +flac: FORCE + rm -f *.o + gcc $(CCOPTS) -DUSE_DEFAULT_STDLIB -c $(libflac) -I ../../src/ -I ../../src/libflac -I. + g++ $(CPPOPTS) -o flac flac.cpp Serial.cpp *.o ../../src/AudioFileSourceSTDIO.cpp ../../src/AudioOutputSTDIO.cpp ../../src/AudioFileSourceID3.cpp ../../src/AudioGeneratorFLAC.cpp ../../src/AudioLogger.cpp -I ../../src/ -I. + rm -f *.o + echo valgrind --leak-check=full --track-origins=yes -v --error-limit=no --show-leak-kinds=all ./flac + wav: FORCE rm -f *.o g++ $(CPPOPTS) -o wav wav.cpp Serial.cpp ../../src/AudioFileSourceSTDIO.cpp ../../src/AudioOutputSTDIO.cpp ../../src/AudioGeneratorWAV.cpp ../../src/AudioLogger.cpp -I ../../src/ -I. @@ -116,6 +128,6 @@ opus: FORCE echo valgrind --leak-check=full --track-origins=yes -v --error-limit=no --show-leak-kinds=all ./opus clean: - rm -f mp3 aac wav midi opus *.o + rm -f mp3 aac wav midi opus flac *.o FORCE: diff --git a/lib/lib_audio/ESP8266Audio/tests/host/flac.cpp b/lib/lib_audio/ESP8266Audio/tests/host/flac.cpp new file mode 100644 index 000000000..2d7110da1 --- /dev/null +++ b/lib/lib_audio/ESP8266Audio/tests/host/flac.cpp @@ -0,0 +1,24 @@ +#include +#include "AudioFileSourceSTDIO.h" +#include "AudioOutputSTDIO.h" +#include "AudioGeneratorFLAC.h" + +#define AAC "gs-16b-2c-44100hz.flac" + +int main(int argc, char **argv) +{ + (void) argc; + (void) argv; + AudioFileSourceSTDIO *in = new AudioFileSourceSTDIO(AAC); + AudioOutputSTDIO *out = new AudioOutputSTDIO(); + out->SetFilename("out.flac.wav"); + AudioGeneratorFLAC *flac = new AudioGeneratorFLAC(); + + flac->begin(in, out); + while (flac->loop()) { /*noop*/ } + flac->stop(); + + delete flac; + delete out; + delete in; +} diff --git a/lib/lib_audio/ESP8266Audio/tests/host/gs-16b-2c-44100hz.flac b/lib/lib_audio/ESP8266Audio/tests/host/gs-16b-2c-44100hz.flac new file mode 100644 index 000000000..177132146 Binary files /dev/null and b/lib/lib_audio/ESP8266Audio/tests/host/gs-16b-2c-44100hz.flac differ diff --git a/lib/lib_audio/ESP8266AudioAttention.md b/lib/lib_audio/ESP8266AudioAttention.md new file mode 100644 index 000000000..7077d8211 --- /dev/null +++ b/lib/lib_audio/ESP8266AudioAttention.md @@ -0,0 +1,82 @@ +The current library needs two fixes solving the deprecated ``i2s_write_bytes`` function. + +In file AudioOutputI2S.cpp: + +bool AudioOutputI2S::ConsumeSample(int16_t sample[2]) +{ + + //return if we haven't called ::begin yet + if (!i2sOn) + return false; + + int16_t ms[2]; + + ms[0] = sample[0]; + ms[1] = sample[1]; + MakeSampleStereo16( ms ); + + if (this->mono) { + // Average the two samples and overwrite + int32_t ttl = ms[LEFTCHANNEL] + ms[RIGHTCHANNEL]; + ms[LEFTCHANNEL] = ms[RIGHTCHANNEL] = (ttl>>1) & 0xffff; + } + #ifdef ESP32 + uint32_t s32; + if (output_mode == INTERNAL_DAC) + { + int16_t l = Amplify(ms[LEFTCHANNEL]) + 0x8000; + int16_t r = Amplify(ms[RIGHTCHANNEL]) + 0x8000; + s32 = (r << 16) | (l & 0xffff); + } + else + { + s32 = ((Amplify(ms[RIGHTCHANNEL])) << 16) | (Amplify(ms[LEFTCHANNEL]) & 0xffff); + } +// Deprecated. Use i2s_write +// return i2s_write_bytes((i2s_port_t)portNo, (const char *)&s32, sizeof(uint32_t), 0); + size_t bytes_written; + i2s_write((i2s_port_t)portNo, (const char*)&s32, sizeof(uint32_t), &bytes_written, 0); + return bytes_written; + #elif defined(ESP8266) + uint32_t s32 = ((Amplify(ms[RIGHTCHANNEL])) << 16) | (Amplify(ms[LEFTCHANNEL]) & 0xffff); + return i2s_write_sample_nb(s32); // If we can't store it, return false. OTW true + #elif defined(ARDUINO_ARCH_RP2040) + return !!I2S.write((void*)ms, 4); + #endif +} + +In file AudioOutputI2SNoDac.cpp: + +bool AudioOutputI2SNoDAC::ConsumeSample(int16_t sample[2]) +{ + int16_t ms[2]; + ms[0] = sample[0]; + ms[1] = sample[1]; + MakeSampleStereo16( ms ); + + // Make delta-sigma filled buffer + uint32_t dsBuff[8]; + DeltaSigma(ms, dsBuff); + + // Either send complete pulse stream or nothing +#ifdef ESP32 +// Deprecated. Use i2s_write +// if (!i2s_write_bytes((i2s_port_t)portNo, (const char *)dsBuff, sizeof(uint32_t) * (oversample/32), 0)) + size_t bytes_written; + i2s_write((i2s_port_t)portNo, (const char *)dsBuff, sizeof(uint32_t) * (oversample/32), &bytes_written, 0); + if (!bytes_written) + return false; +#elif defined(ESP8266) + if (!i2s_write_sample_nb(dsBuff[0])) return false; // No room at the inn + // At this point we've sent in first of possibly 8 32-bits, need to send + // remaining ones even if they block. + for (int i = 32; i < oversample; i+=32) + i2s_write_sample( dsBuff[i / 32]); +#elif defined(ARDUINO_ARCH_RP2040) + int16_t *p = (int16_t *) dsBuff; + for (int i = 0; i < oversample / 16; i++) { + I2S.write(*(p++)); + } +#endif + return true; +} diff --git a/lib/lib_basic/NeoPixelBus/examples/topologies/NeoPixelRingDynamicTopologyTest/NeoPixelRingDynamicTopologyTest.ino b/lib/lib_basic/NeoPixelBus/examples/topologies/NeoPixelRingDynamicTopologyTest/NeoPixelRingDynamicTopologyTest.ino new file mode 100644 index 000000000..57aa6e4b8 --- /dev/null +++ b/lib/lib_basic/NeoPixelBus/examples/topologies/NeoPixelRingDynamicTopologyTest/NeoPixelRingDynamicTopologyTest.ino @@ -0,0 +1,122 @@ +//---------------------------------------------------------------------- +// NeoPixelRingTopologyTest +// This will display specific colors in specific locations on the led rings +// +// This is useful in confirming the layout of your rings +// +// It does require that you have the actual series of rings connected +//---------------------------------------------------------------------- + +#include + +const uint8_t PixelCount = 119; +const uint8_t PixelPin = 2; // make sure to set this to the correct pin, ignored for Esp8266 + +// define the layout of your series of rings +// +// This example is using all of Adafruits rings and a Jewel in the center. +// The center is the input and all the rings are connected in series going outward +// +// Rings: +// 0 - 1 (virtual ring, the center of the jewel) +// 1 - 6 (virtual ring, the outer ring of the jewel) +// 2 - 12 count ring +// 3 - 16 count ring +// 4 - 24 count ring +// 5 - 60 count ring comprised of four arc segments +// +// The values below in Rings[] are the index of the first pixel in each ring. +// An extra value is appended for a virtual ring start that also +// represents the total count of pixels in the complete series and this extra +// value is required. +// +class MyRingsLayout +{ +public: + void Begin() { + // this is where you load your dynamic rings layout and init Rings and RingCount + // this example will just set these to static numbers to simulate a dynamic layout + RingCount = 6; + Rings = new uint16_t[RingCount]; + + Rings[0] = 1; + Rings[1] = 6; + Rings[2] = 12; + Rings[3] = 16; + Rings[4] = 24; + Rings[5] = 60; // don't forget the final count of pixels as the last item + } + +protected: + uint16_t* Rings; + uint8_t RingCount; + + uint8_t _ringCount() const + { + return RingCount; + } +}; + +// use the MyRingsLayout to declare the topo object +// +NeoRingTopology topo; + +// declare our strip +// +NeoPixelBus strip(PixelCount, PixelPin); + +// define some handy colors +// +RgbColor red(128, 0, 0); +RgbColor green(0, 128, 0); +RgbColor blue(0, 0, 128); +RgbColor black(0); + +void setup() +{ + Serial.begin(115200); + while (!Serial); // wait for serial attach + + Serial.println(); + Serial.println("Initializing..."); + + topo.Begin(); + + strip.Begin(); + strip.Show(); + + Serial.println(); + Serial.println("Running..."); +} + +void loop() +{ + delay(2500); + + Serial.println(); + Serial.println("If your panel is correctly defined, you should see ..."); + Serial.println("First pixel in each ring is Red."); + Serial.println("Middle pixel in each ring is Green."); + Serial.println("Last Pixel in each ring is Blue."); + + + // use the topo to map the 2d polar cordinate to the pixel + // and use that to SetPixelColor + for (uint16_t ring = 0; ring < topo.getCountOfRings(); ring++) + { + // first pixel in each ring is red + strip.SetPixelColor(topo.Map(ring, 0), red); + // last pixel in each ring is blue + strip.SetPixelColor(topo.Map(ring, topo.getPixelCountAtRing(ring) - 1), blue); + // middle pixel in each ring is green + strip.SetPixelColor(topo.Map(ring, topo.getPixelCountAtRing(ring) / 2), green); + } + strip.Show(); + + delay(5000); + + Serial.println(); + Serial.println("Cleared to black ..."); + strip.ClearTo(black); + strip.Show(); +} diff --git a/lib/lib_basic/NeoPixelBus/examples/topologies/NeoPixelRingTopologyTest/NeoPixelRingTopologyTest.ino b/lib/lib_basic/NeoPixelBus/examples/topologies/NeoPixelRingTopologyTest/NeoPixelRingTopologyTest.ino index 64a1bcdde..26d526fd7 100644 --- a/lib/lib_basic/NeoPixelBus/examples/topologies/NeoPixelRingTopologyTest/NeoPixelRingTopologyTest.ino +++ b/lib/lib_basic/NeoPixelBus/examples/topologies/NeoPixelRingTopologyTest/NeoPixelRingTopologyTest.ino @@ -34,6 +34,11 @@ class MyRingsLayout { protected: const uint16_t Rings[7] = {0, 1, 7, 19, 35, 59, PixelCount}; + + uint8_t _ringCount() const + { + return sizeof(Rings) / sizeof(Rings[0]); + } }; // use the MyRingsLayout to declare the topo object @@ -97,4 +102,3 @@ void loop() strip.ClearTo(black); strip.Show(); } - diff --git a/lib/lib_basic/NeoPixelBus/keywords.txt b/lib/lib_basic/NeoPixelBus/keywords.txt index 71280f07b..03f59e82c 100644 --- a/lib/lib_basic/NeoPixelBus/keywords.txt +++ b/lib/lib_basic/NeoPixelBus/keywords.txt @@ -17,6 +17,7 @@ HsbColor KEYWORD1 HtmlColor KEYWORD1 NeoNoSettings KEYWORD1 NeoTm1814Settings KEYWORD1 +NeoTm1914Settings KEYWORD1 NeoSpiSettings KEYWORD1 NeoGrbFeature KEYWORD1 NeoGrbwFeature KEYWORD1 @@ -25,6 +26,8 @@ NeoRgbFeature KEYWORD1 NeoBrgFeature KEYWORD1 NeoRbgFeature KEYWORD1 NeoWrgbTm1814Feature KEYWORD1 +NeoRgbTm1914Feature KEYWORD1 +NeoGrbTm1914Feature KEYWORD1 DotStarBgrFeature KEYWORD1 DotStarLbgrFeature KEYWORD1 Lpd6803GrbFeature KEYWORD1 @@ -43,6 +46,7 @@ NeoWs2812Method KEYWORD1 NeoWs2811Method KEYWORD1 NeoSk6812Method KEYWORD1 NeoTm1814Method KEYWORD1 +NeoTm1914Method KEYWORD1 NeoTm1829Method KEYWORD1 NeoTx1812Method KEYWORD1 NeoLc8812Method KEYWORD1 @@ -55,6 +59,7 @@ NeoWs2812InvertedMethod KEYWORD1 NeoWs2811InvertedMethod KEYWORD1 NeoSk6812InvertedMethod KEYWORD1 NeoTm1814InvertedMethod KEYWORD1 +NeoTm1914InvertedMethod KEYWORD1 NeoTm1829InvertedMethod KEYWORD1 NeoTx1812InvertedMethod KEYWORD1 NeoLc8812InvertedMethod KEYWORD1 @@ -62,6 +67,7 @@ NeoApa106InvertedMethod KEYWORD1 NeoEsp8266DmaWs2812xMethod KEYWORD1 NeoEsp8266DmaSk6812Method KEYWORD1 NeoEsp8266DmaTm1814Method KEYWORD1 +NeoEsp8266DmaTm1914Method KEYWORD1 NeoEsp8266DmaTm1829Method KEYWORD1 NeoEsp8266DmaApa106Method KEYWORD1 NeoEsp8266Dma800KbpsMethod KEYWORD1 @@ -69,6 +75,7 @@ NeoEsp8266Dma400KbpsMethod KEYWORD1 NeoEsp8266DmaInvertedWs2812xMethod KEYWORD1 NeoEsp8266DmaInvertedSk6812Method KEYWORD1 NeoEsp8266DmaInvertedTm1814Method KEYWORD1 +NeoEsp8266DmaInvertedTm1914Method KEYWORD1 NeoEsp8266DmaInvertedTm1829Method KEYWORD1 NeoEsp8266DmaInvertedApa106Method KEYWORD1 NeoEsp8266DmaInverted800KbpsMethod KEYWORD1 @@ -79,6 +86,7 @@ NeoEsp8266Uart0Ws2812Method KEYWORD1 NeoEsp8266Uart0Ws2811Method KEYWORD1 NeoEsp8266Uart0Sk6812Method KEYWORD1 NeoEsp8266Uart0Tm1814Method KEYWORD1 +NeoEsp8266Uart0Tm1914Method KEYWORD1 NeoEsp8266Uart0Tm1829Method KEYWORD1 NeoEsp8266Uart0Lc8812Method KEYWORD1 NeoEsp8266Uart0Apa106Method KEYWORD1 @@ -90,6 +98,7 @@ NeoEsp8266AsyncUart0Ws2812Method KEYWORD1 NeoEsp8266AsyncUart0Ws2811Method KEYWORD1 NeoEsp8266AsyncUart0Sk6812Method KEYWORD1 NeoEsp8266AsyncUart0Tm1814Method KEYWORD1 +NeoEsp8266AsyncUart0Tm1914Method KEYWORD1 NeoEsp8266AsyncUart0Tm1829Method KEYWORD1 NeoEsp8266AsyncUart0Lc8812Method KEYWORD1 NeoEsp8266AsyncUart0Apa106Method KEYWORD1 @@ -101,6 +110,7 @@ NeoEsp8266Uart1Ws2812Method KEYWORD1 NeoEsp8266Uart1Ws2811Method KEYWORD1 NeoEsp8266Uart1Sk6812Method KEYWORD1 NeoEsp8266Uart1Tm1814 KEYWORD1 +NeoEsp8266Uart1Tm1914 KEYWORD1 NeoEsp8266Uart1Tm1829 KEYWORD1 NeoEsp8266Uart1Lc8812Method KEYWORD1 NeoEsp8266Uart1Apa106Method KEYWORD1 @@ -112,6 +122,7 @@ NeoEsp8266AsyncUart1Ws2812Method KEYWORD1 NeoEsp8266AsyncUart1Ws2811Method KEYWORD1 NeoEsp8266AsyncUart1Sk6812Method KEYWORD1 NeoEsp8266AsyncUart1Tm1814 KEYWORD1 +NeoEsp8266AsyncUart1Tm1914 KEYWORD1 NeoEsp8266AsyncUart1Tm1829 KEYWORD1 NeoEsp8266AsyncUart1Lc8812Method KEYWORD1 NeoEsp8266AsyncUart1Apa106Method KEYWORD1 @@ -123,6 +134,7 @@ NeoEsp8266Uart0Ws2812InvertedMethod KEYWORD1 NeoEsp8266Uart0Ws2811InvertedMethod KEYWORD1 NeoEsp8266Uart0Sk6812InvertedMethod KEYWORD1 NeoEsp8266Uart0Tm1814InvertedMethod KEYWORD1 +NeoEsp8266Uart0Tm1914InvertedMethod KEYWORD1 NeoEsp8266Uart0Tm1829InvertedMethod KEYWORD1 NeoEsp8266Uart0Lc8812InvertedMethod KEYWORD1 NeoEsp8266Uart0Apa106InvertedMethod KEYWORD1 @@ -134,6 +146,7 @@ NeoEsp8266AsyncUart0Ws2812InvertedMethod KEYWORD1 NeoEsp8266AsyncUart0Ws2811InvertedMethod KEYWORD1 NeoEsp8266AsyncUart0Sk6812InvertedMethod KEYWORD1 NeoEsp8266AsyncUart0Tm1814InvertedMethod KEYWORD1 +NeoEsp8266AsyncUart0Tm1914InvertedMethod KEYWORD1 NeoEsp8266AsyncUart0Tm1829InvertedMethod KEYWORD1 NeoEsp8266AsyncUart0Lc8812InvertedMethod KEYWORD1 NeoEsp8266AsyncUart0Apa106InvertedMethod KEYWORD1 @@ -145,6 +158,7 @@ NeoEsp8266Uart1Ws2812InvertedMethod KEYWORD1 NeoEsp8266Uart1Ws2811InvertedMethod KEYWORD1 NeoEsp8266Uart1Sk6812InvertedMethod KEYWORD1 NeoEsp8266Uart1Tm1814InvertedMethod KEYWORD1 +NeoEsp8266Uart1Tm1914InvertedMethod KEYWORD1 NeoEsp8266Uart1Tm1829InvertedMethod KEYWORD1 NeoEsp8266Uart1Lc8812InvertedMethod KEYWORD1 NeoEsp8266Uart1Apa106InvertedMethod KEYWORD1 @@ -156,6 +170,7 @@ NeoEsp8266AsyncUart1Ws2812InvertedMethod KEYWORD1 NeoEsp8266AsyncUart1Ws2811InvertedMethod KEYWORD1 NeoEsp8266AsyncUart1Sk6812InvertedMethod KEYWORD1 NeoEsp8266AsyncUart1Tm1814InvertedMethod KEYWORD1 +NeoEsp8266AsyncUart1Tm1914InvertedMethod KEYWORD1 NeoEsp8266AsyncUart1Tm1829InvertedMethod KEYWORD1 NeoEsp8266AsyncUart1Lc8812InvertedMethod KEYWORD1 NeoEsp8266AsyncUart1Apa106InvertedMethod KEYWORD1 @@ -167,6 +182,7 @@ NeoEsp8266BitBangWs2812Method KEYWORD1 NeoEsp8266BitBangWs2811Method KEYWORD1 NeoEsp8266BitBangSk6812Method KEYWORD1 NeoEsp8266BitBangTm1814Method KEYWORD1 +NeoEsp8266BitBangTm1914Method KEYWORD1 NeoEsp8266BitBangTm1829Method KEYWORD1 NeoEsp8266BitBangLc8812Method KEYWORD1 NeoEsp8266BitBangApa106Method KEYWORD1 @@ -178,6 +194,7 @@ NeoEsp8266BitBangWs2812InvertedMethod KEYWORD1 NeoEsp8266BitBangWs2811InvertedMethod KEYWORD1 NeoEsp8266BitBangSk6812InvertedMethod KEYWORD1 NeoEsp8266BitBangTm1814InvertedMethod KEYWORD1 +NeoEsp8266BitBangTm1914InvertedMethod KEYWORD1 NeoEsp8266BitBangTm1829InvertedMethod KEYWORD1 NeoEsp8266BitBangLc8812InvertedMethod KEYWORD1 NeoEsp8266BitBangApa106InvertedMethod KEYWORD1 @@ -186,12 +203,14 @@ NeoEsp8266BitBang400KbpsInvertedMethod KEYWORD1 NeoEsp32I2sNWs2812xMethod KEYWORD1 NeoEsp32I2sNSk6812Method KEYWORD1 NeoEsp32I2sNTm1814Method KEYWORD1 +NeoEsp32I2sNTm1914Method KEYWORD1 NeoEsp32I2sN800KbpsMethod KEYWORD1 NeoEsp32I2sN400KbpsMethod KEYWORD1 NeoEsp32I2sNApa106Method KEYWORD1 NeoEsp32I2s0Ws2812xMethod KEYWORD1 NeoEsp32I2s0Sk6812Method KEYWORD1 NeoEsp32I2s0Tm1814Method KEYWORD1 +NeoEsp32I2s0Tm1914Method KEYWORD1 NeoEsp32I2s0Tm1829Method KEYWORD1 NeoEsp32I2s0800KbpsMethod KEYWORD1 NeoEsp32I2s0400KbpsMethod KEYWORD1 @@ -199,6 +218,7 @@ NeoEsp32I2s0Apa106Method KEYWORD1 NeoEsp32I2s1Ws2812xMethod KEYWORD1 NeoEsp32I2s1Sk6812Method KEYWORD1 NeoEsp32I2s1Tm1814Method KEYWORD1 +NeoEsp32I2s1Tm1914Method KEYWORD1 NeoEsp32I2s1Tm1829Method KEYWORD1 NeoEsp32I2s1800KbpsMethod KEYWORD1 NeoEsp32I2s1400KbpsMethod KEYWORD1 @@ -206,12 +226,14 @@ NeoEsp32I2s1Apa106Method KEYWORD1 NeoEsp32I2sNWs2812xInvertedMethod KEYWORD1 NeoEsp32I2sNSk6812InvertedMethod KEYWORD1 NeoEsp32I2sNTm1814InvertedMethod KEYWORD1 +NeoEsp32I2sNTm1914InvertedMethod KEYWORD1 NeoEsp32I2sN800KbpsInvertedMethod KEYWORD1 NeoEsp32I2sN400KbpsInvertedMethod KEYWORD1 NeoEsp32I2sNApa106InvertedMethod KEYWORD1 NeoEsp32I2s0Ws2812xInvertedMethod KEYWORD1 NeoEsp32I2s0Sk6812InvertedMethod KEYWORD1 NeoEsp32I2s0Tm1814InvertedMethod KEYWORD1 +NeoEsp32I2s0Tm1914InvertedMethod KEYWORD1 NeoEsp32I2s0Tm1829InvertedMethod KEYWORD1 NeoEsp32I2s0800KbpsInvertedMethod KEYWORD1 NeoEsp32I2s0400KbpsInvertedMethod KEYWORD1 @@ -219,6 +241,7 @@ NeoEsp32I2s0Apa106InvertedMethod KEYWORD1 NeoEsp32I2s1Ws2812xInvertedMethod KEYWORD1 NeoEsp32I2s1Sk6812InvertedMethod KEYWORD1 NeoEsp32I2s1Tm1814InvertedMethod KEYWORD1 +NeoEsp32I2s1Tm1914InvertedMethod KEYWORD1 NeoEsp32I2s1Tm1829InvertedMethod KEYWORD1 NeoEsp32I2s1800KbpsInvertedMethod KEYWORD1 NeoEsp32I2s1400KbpsInvertedMethod KEYWORD1 @@ -227,6 +250,8 @@ NeoEsp32RmtNWs2811Method KEYWORD1 NeoEsp32RmtNWs2812xMethod KEYWORD1 NeoEsp32RmtNSk6812Method KEYWORD1 NeoEsp32RmtNTm1814Method KEYWORD1 +NeoEsp32RmtNTm1914Method KEYWORD1 +NeoEsp32RmtNTm1829Method KEYWORD1 NeoEsp32RmtNApa106Method KEYWORD1 NeoEsp32RmtN800KbpsMethod KEYWORD1 NeoEsp32RmtN400KbpsMethod KEYWORD1 @@ -234,6 +259,7 @@ NeoEsp32Rmt0Ws2811Method KEYWORD1 NeoEsp32Rmt0Ws2812xMethod KEYWORD1 NeoEsp32Rmt0Sk6812Method KEYWORD1 NeoEsp32Rmt0Tm1814Method KEYWORD1 +NeoEsp32Rmt0Tm1914Method KEYWORD1 NeoEsp32Rmt0Tm1829Method KEYWORD1 NeoEsp32Rmt0Apa106Method KEYWORD1 NeoEsp32Rmt0800KbpsMethod KEYWORD1 @@ -242,7 +268,8 @@ NeoEsp32Rmt1Ws2811Method KEYWORD1 NeoEsp32Rmt1Ws2812xMethod KEYWORD1 NeoEsp32Rmt1Sk6812Method KEYWORD1 NeoEsp32Rmt1Tm1814Method KEYWORD1 -NeoEsp32Rmt1Tm1814Method KEYWORD1 +NeoEsp32Rmt1Tm1914Method KEYWORD1 +NeoEsp32Rmt1Tm1829Method KEYWORD1 NeoEsp32Rmt1Apa106Method KEYWORD1 NeoEsp32Rmt1800KbpsMethod KEYWORD1 NeoEsp32Rmt1400KbpsMethod KEYWORD1 @@ -251,6 +278,7 @@ NeoEsp32Rmt2Ws2812xMethod KEYWORD1 NeoEsp32Rmt2Sk6812Method KEYWORD1 NeoEsp32Rmt2Tm1814Method KEYWORD1 NeoEsp32Rmt2Tm1829Method KEYWORD1 +NeoEsp32Rmt2Tm1914Method KEYWORD1 NeoEsp32Rmt2Apa106Method KEYWORD1 NeoEsp32Rmt2800KbpsMethod KEYWORD1 NeoEsp32Rmt2400KbpsMethod KEYWORD1 @@ -258,6 +286,7 @@ NeoEsp32Rmt3Ws2811Method KEYWORD1 NeoEsp32Rmt3Ws2812xMethod KEYWORD1 NeoEsp32Rmt3Sk6812Method KEYWORD1 NeoEsp32Rmt3Tm1814Method KEYWORD1 +NeoEsp32Rmt3Tm1914Method KEYWORD1 NeoEsp32Rmt3Tm1829Method KEYWORD1 NeoEsp32Rmt3Apa106Method KEYWORD1 NeoEsp32Rmt3800KbpsMethod KEYWORD1 @@ -266,6 +295,7 @@ NeoEsp32Rmt4Ws2811Method KEYWORD1 NeoEsp32Rmt4Ws2812xMethod KEYWORD1 NeoEsp32Rmt4Sk6812Method KEYWORD1 NeoEsp32Rmt4Tm1814Method KEYWORD1 +NeoEsp32Rmt4Tm1914Method KEYWORD1 NeoEsp32Rmt4Tm1829Method KEYWORD1 NeoEsp32Rmt4Apa106Method KEYWORD1 NeoEsp32Rmt4800KbpsMethod KEYWORD1 @@ -274,6 +304,7 @@ NeoEsp32Rmt5Ws2811Method KEYWORD1 NeoEsp32Rmt5Ws2812xMethod KEYWORD1 NeoEsp32Rmt5Sk6812Method KEYWORD1 NeoEsp32Rmt5Tm1814Method KEYWORD1 +NeoEsp32Rmt5Tm1914Method KEYWORD1 NeoEsp32Rmt5Tm1829Method KEYWORD1 NeoEsp32Rmt5Apa106Method KEYWORD1 NeoEsp32Rmt5800KbpsMethod KEYWORD1 @@ -282,6 +313,7 @@ NeoEsp32Rmt6Ws2811Method KEYWORD1 NeoEsp32Rmt6Ws2812xMethod KEYWORD1 NeoEsp32Rmt6Sk6812Method KEYWORD1 NeoEsp32Rmt6Tm1814Method KEYWORD1 +NeoEsp32Rmt6Tm1914Method KEYWORD1 NeoEsp32Rmt6Tm1829Method KEYWORD1 NeoEsp32Rmt6Apa106Method KEYWORD1 NeoEsp32Rmt6800KbpsMethod KEYWORD1 @@ -290,6 +322,7 @@ NeoEsp32Rmt7Ws2811Method KEYWORD1 NeoEsp32Rmt7Ws2812xMethod KEYWORD1 NeoEsp32Rmt7Sk6812Method KEYWORD1 NeoEsp32Rmt7Tm1814Method KEYWORD1 +NeoEsp32Rmt7Tm1914Method KEYWORD1 NeoEsp32Rmt7Tm1829Method KEYWORD1 NeoEsp32Rmt7Apa106Method KEYWORD1 NeoEsp32Rmt7800KbpsMethod KEYWORD1 @@ -298,6 +331,8 @@ NeoEsp32RmtNWs2811InvertedMethod KEYWORD1 NeoEsp32RmtNWs2812xInvertedMethod KEYWORD1 NeoEsp32RmtNSk6812InvertedMethod KEYWORD1 NeoEsp32RmtNTm1814InvertedMethod KEYWORD1 +NeoEsp32RmtNTm1914InvertedMethod KEYWORD1 +NeoEsp32RmtNTm1829InvertedMethod KEYWORD1 NeoEsp32RmtNApa106InvertedMethod KEYWORD1 NeoEsp32RmtN800KbpsInvertedMethod KEYWORD1 NeoEsp32RmtN400KbpsInvertedMethod KEYWORD1 @@ -305,6 +340,7 @@ NeoEsp32Rmt0Ws2811InvertedMethod KEYWORD1 NeoEsp32Rmt0Ws2812xInvertedMethod KEYWORD1 NeoEsp32Rmt0Sk6812InvertedMethod KEYWORD1 NeoEsp32Rmt0Tm1814InvertedMethod KEYWORD1 +NeoEsp32Rmt0Tm1914InvertedMethod KEYWORD1 NeoEsp32Rmt0Tm1829InvertedMethod KEYWORD1 NeoEsp32Rmt0Apa106InvertedMethod KEYWORD1 NeoEsp32Rmt0800KbpsInvertedMethod KEYWORD1 @@ -313,6 +349,7 @@ NeoEsp32Rmt1Ws2811InvertedMethod KEYWORD1 NeoEsp32Rmt1Ws2812xInvertedMethod KEYWORD1 NeoEsp32Rmt1Sk6812InvertedMethod KEYWORD1 NeoEsp32Rmt1Tm1814InvertedMethod KEYWORD1 +NeoEsp32Rmt1Tm1914InvertedMethod KEYWORD1 NeoEsp32Rmt1Tm1829InvertedMethod KEYWORD1 NeoEsp32Rmt1Apa106InvertedMethod KEYWORD1 NeoEsp32Rmt1800KbpsInvertedMethod KEYWORD1 @@ -321,6 +358,7 @@ NeoEsp32Rmt2Ws2811InvertedMethod KEYWORD1 NeoEsp32Rmt2Ws2812xInvertedMethod KEYWORD1 NeoEsp32Rmt2Sk6812InvertedMethod KEYWORD1 NeoEsp32Rmt2Tm1814InvertedMethod KEYWORD1 +NeoEsp32Rmt2Tm1914InvertedMethod KEYWORD1 NeoEsp32Rmt2Tm1829InvertedMethod KEYWORD1 NeoEsp32Rmt2Apa106InvertedMethod KEYWORD1 NeoEsp32Rmt2800KbpsInvertedMethod KEYWORD1 @@ -329,6 +367,7 @@ NeoEsp32Rmt3Ws2811InvertedMethod KEYWORD1 NeoEsp32Rmt3Ws2812xInvertedMethod KEYWORD1 NeoEsp32Rmt3Sk6812InvertedMethod KEYWORD1 NeoEsp32Rmt3Tm1814InvertedMethod KEYWORD1 +NeoEsp32Rmt3Tm1914InvertedMethod KEYWORD1 NeoEsp32Rmt3Tm1829InvertedMethod KEYWORD1 NeoEsp32Rmt3Apa106InvertedMethod KEYWORD1 NeoEsp32Rmt3800KbpsInvertedMethod KEYWORD1 @@ -337,6 +376,7 @@ NeoEsp32Rmt4Ws2811InvertedMethod KEYWORD1 NeoEsp32Rmt4Ws2812xInvertedMethod KEYWORD1 NeoEsp32Rmt4Sk6812InvertedMethod KEYWORD1 NeoEsp32Rmt4Tm1814InvertedMethod KEYWORD1 +NeoEsp32Rmt4Tm1914InvertedMethod KEYWORD1 NeoEsp32Rmt4Tm1829InvertedMethod KEYWORD1 NeoEsp32Rmt4Apa106InvertedMethod KEYWORD1 NeoEsp32Rmt4800KbpsInvertedMethod KEYWORD1 @@ -345,6 +385,7 @@ NeoEsp32Rmt5Ws2811InvertedMethod KEYWORD1 NeoEsp32Rmt5Ws2812xInvertedMethod KEYWORD1 NeoEsp32Rmt5Sk6812InvertedMethod KEYWORD1 NeoEsp32Rmt5Tm1814InvertedMethod KEYWORD1 +NeoEsp32Rmt5Tm1914InvertedMethod KEYWORD1 NeoEsp32Rmt5Tm1829InvertedMethod KEYWORD1 NeoEsp32Rmt5Apa106InvertedMethod KEYWORD1 NeoEsp32Rmt5800KbpsInvertedMethod KEYWORD1 @@ -353,6 +394,7 @@ NeoEsp32Rmt6Ws2811InvertedMethod KEYWORD1 NeoEsp32Rmt6Ws2812xInvertedMethod KEYWORD1 NeoEsp32Rmt6Sk6812InvertedMethod KEYWORD1 NeoEsp32Rmt6Tm1814InvertedMethod KEYWORD1 +NeoEsp32Rmt6Tm1914InvertedMethod KEYWORD1 NeoEsp32Rmt6Tm1829InvertedMethod KEYWORD1 NeoEsp32Rmt6Apa106InvertedMethod KEYWORD1 NeoEsp32Rmt6800KbpsInvertedMethod KEYWORD1 @@ -361,6 +403,7 @@ NeoEsp32Rmt7Ws2811InvertedMethod KEYWORD1 NeoEsp32Rmt7Ws2812xInvertedMethod KEYWORD1 NeoEsp32Rmt7Sk6812InvertedMethod KEYWORD1 NeoEsp32Rmt7Tm1814InvertedMethod KEYWORD1 +NeoEsp32Rmt7Tm1914InvertedMethod KEYWORD1 NeoEsp32Rmt7Tm1829InvertedMethod KEYWORD1 NeoEsp32Rmt7Apa106InvertedMethod KEYWORD1 NeoEsp32Rmt7800KbpsInvertedMethod KEYWORD1 @@ -371,6 +414,7 @@ NeoEsp32BitBangWs2812Method KEYWORD1 NeoEsp32BitBangWs2811Method KEYWORD1 NeoEsp32BitBangSk6812Method KEYWORD1 NeoEsp32BitBangTm1814Method KEYWORD1 +NeoEsp32BitBangTm1914Method KEYWORD1 NeoEsp32BitBangTm1829Method KEYWORD1 NeoEsp32BitBangLc8812Method KEYWORD1 NeoEsp32BitBangApa106Method KEYWORD1 @@ -382,6 +426,7 @@ NeoEsp32BitBangWs2812InvertedMethod KEYWORD1 NeoEsp32BitBangWs2811InvertedMethod KEYWORD1 NeoEsp32BitBangSk6812InvertedMethod KEYWORD1 NeoEsp32BitBangTm1814InvertedMethod KEYWORD1 +NeoEsp32BitBangTm1914InvertedMethod KEYWORD1 NeoEsp32BitBangTm1829InvertedMethod KEYWORD1 NeoEsp32BitBangLc8812InvertedMethod KEYWORD1 NeoEsp32BitBangApa106InvertedMethod KEYWORD1 @@ -390,6 +435,7 @@ NeoEsp32BitBang400KbpsInvertedMethod KEYWORD1 NeoNrf52xPwmNWs2812xMethod KEYWORD1 NeoNrf52xPwmNSk6812Method KEYWORD1 NeoNrf52xPwmNTm1814Method KEYWORD1 +NeoNrf52xPwmNTm1914Method KEYWORD1 NeoNrf52xPwmNTm1829Method KEYWORD1 NeoNrf52xPwmNTx1812Method KEYWORD1 NeoNrf52xPwmN800KbpsMethod KEYWORD1 @@ -398,6 +444,7 @@ NeoNrf52xPwmNApa106Method KEYWORD1 NeoNrf52xPwm0Ws2812xMethod KEYWORD1 NeoNrf52xPwm0Sk6812Method KEYWORD1 NeoNrf52xPwm0Tm1814Method KEYWORD1 +NeoNrf52xPwm0Tm1914Method KEYWORD1 NeoNrf52xPwm0Tm1829Method KEYWORD1 NeoNrf52xPwm0Tx1812Method KEYWORD1 NeoNrf52xPwm0800KbpsMethod KEYWORD1 @@ -406,6 +453,7 @@ NeoNrf52xPwm0Apa106Method KEYWORD1 NeoNrf52xPwm1Ws2812xMethod KEYWORD1 NeoNrf52xPwm1Sk6812Method KEYWORD1 NeoNrf52xPwm1Tm1814Method KEYWORD1 +NeoNrf52xPwm1Tm1914Method KEYWORD1 NeoNrf52xPwm1Tm1829Method KEYWORD1 NeoNrf52xPwm1Tx1812Method KEYWORD1 NeoNrf52xPwm1800KbpsMethod KEYWORD1 @@ -414,6 +462,7 @@ NeoNrf52xPwm1Apa106Method KEYWORD1 NeoNrf52xPwm2Ws2812xMethod KEYWORD1 NeoNrf52xPwm2Sk6812Method KEYWORD1 NeoNrf52xPwm2Tm1814Method KEYWORD1 +NeoNrf52xPwm2Tm1914Method KEYWORD1 NeoNrf52xPwm2Tm1829Method KEYWORD1 NeoNrf52xPwm2Tx1812Method KEYWORD1 NeoNrf52xPwm2800KbpsMethod KEYWORD1 @@ -422,6 +471,7 @@ NeoNrf52xPwm2Apa106Method KEYWORD1 NeoNrf52xPwm3Ws2812xMethod KEYWORD1 NeoNrf52xPwm3Sk6812Method KEYWORD1 NeoNrf52xPwm3Tm1814Method KEYWORD1 +NeoNrf52xPwm3Tm1914Method KEYWORD1 NeoNrf52xPwm3Tm1829Method KEYWORD1 NeoNrf52xPwm3Tx1812Method KEYWORD1 NeoNrf52xPwm3800KbpsMethod KEYWORD1 @@ -430,6 +480,7 @@ NeoNrf52xPwm3Apa106Method KEYWORD1 NeoNrf52xPwmNWs2812xInvertedMethod KEYWORD1 NeoNrf52xPwmNSk6812InvertedMethod KEYWORD1 NeoNrf52xPwmNTm1814InvertedMethod KEYWORD1 +NeoNrf52xPwmNTm1914InvertedMethod KEYWORD1 NeoNrf52xPwmNTm1829InvertedMethod KEYWORD1 NeoNrf52xPwmNTx1812InvertedMethod KEYWORD1 NeoNrf52xPwmN800KbpsInvertedMethod KEYWORD1 @@ -438,6 +489,7 @@ NeoNrf52xPwmNApa106InvertedMethod KEYWORD1 NeoNrf52xPwm0Ws2812xInvertedMethod KEYWORD1 NeoNrf52xPwm0Sk6812InvertedMethod KEYWORD1 NeoNrf52xPwm0Tm1814InvertedMethod KEYWORD1 +NeoNrf52xPwm0Tm1914InvertedMethod KEYWORD1 NeoNrf52xPwm0Tm1829InvertedMethod KEYWORD1 NeoNrf52xPwm0Tx1812InvertedMethod KEYWORD1 NeoNrf52xPwm0800KbpsInvertedMethod KEYWORD1 @@ -446,6 +498,7 @@ NeoNrf52xPwm0Apa106InvertedMethod KEYWORD1 NeoNrf52xPwm1Ws2812xInvertedMethod KEYWORD1 NeoNrf52xPwm1Sk6812InvertedMethod KEYWORD1 NeoNrf52xPwm1Tm1814InvertedMethod KEYWORD1 +NeoNrf52xPwm1Tm1914InvertedMethod KEYWORD1 NeoNrf52xPwm1Tm1829InvertedMethod KEYWORD1 NeoNrf52xPwm1Tx1812InvertedMethod KEYWORD1 NeoNrf52xPwm1800KbpsInvertedMethod KEYWORD1 @@ -454,6 +507,7 @@ NeoNrf52xPwm1Apa106InvertedMethod KEYWORD1 NeoNrf52xPwm2Ws2812xInvertedMethod KEYWORD1 NeoNrf52xPwm2Sk6812InvertedMethod KEYWORD1 NeoNrf52xPwm2Tm1814InvertedMethod KEYWORD1 +NeoNrf52xPwm2Tm1914InvertedMethod KEYWORD1 NeoNrf52xPwm2Tm1829InvertedMethod KEYWORD1 NeoNrf52xPwm2Tx1812InvertedMethod KEYWORD1 NeoNrf52xPwm2800KbpsInvertedMethod KEYWORD1 @@ -462,6 +516,7 @@ NeoNrf52xPwm2Apa106InvertedMethod KEYWORD1 NeoNrf52xPwm3Ws2812xInvertedMethod KEYWORD1 NeoNrf52xPwm3Sk6812InvertedMethod KEYWORD1 NeoNrf52xPwm3Tm1814InvertedMethod KEYWORD1 +NeoNrf52xPwm3Tm1914InvertedMethod KEYWORD1 NeoNrf52xPwm3Tm1829InvertedMethod KEYWORD1 NeoNrf52xPwm3Tx1812InvertedMethod KEYWORD1 NeoNrf52xPwm3800KbpsInvertedMethod KEYWORD1 diff --git a/lib/lib_basic/NeoPixelBus/library.json b/lib/lib_basic/NeoPixelBus/library.json index c684dfdee..306e6e094 100644 --- a/lib/lib_basic/NeoPixelBus/library.json +++ b/lib/lib_basic/NeoPixelBus/library.json @@ -1,13 +1,13 @@ { "name": "NeoPixelBus", - "keywords": "NeoPixel, WS2811, WS2812, WS2813, SK6812, DotStar, APA102, SK9822, APA106, LPD8806, LPD6803, P9813, TM1829, TM1814, TX1812, WS2801 RGB, RGBW", - "description": "A library that makes controlling NeoPixels (APA106, WS2811, WS2812, WS2813, SK6812, TM1829, TM1814, TX1812) and DotStars (APA102, LPD8806, LPD6803, SK9822, WS2801, P9813) easy. Supports most Arduino platforms, including async hardware support for Esp8266, Esp32, and Nrf52 (Nano 33 BLE). Support for RGBW pixels and 7 Segment LED direct driven. Includes seperate RgbColor, RgbwColor, Rgb16Color, Rgb48Color, HslColor, and HsbColor objects. Includes an animator class that helps create asyncronous animations. For all platforms; there are two methods of sending DotStar data, hardware SPI and software SPI.", + "keywords": "NeoPixel, WS2811, WS2812, WS2813, SK6812, DotStar, APA102, SK9822, APA106, LPD8806, LPD6803, P9813, TM1829, TM1814, TM1914, TX1812, WS2801 RGB, RGBW", + "description": "A library that makes controlling NeoPixels (APA106, WS2811, WS2812, WS2813, SK6812, TM1829, TM1814, TM1914, TX1812) and DotStars (APA102, LPD8806, LPD6803, SK9822, WS2801, P9813) easy. Supports most Arduino platforms, including async hardware support for Esp8266, Esp32, and Nrf52 (Nano 33 BLE). Support for RGBW pixels and 7 Segment LED direct driven. Includes seperate RgbColor, RgbwColor, Rgb16Color, Rgb48Color, HslColor, and HsbColor objects. Includes an animator class that helps create asyncronous animations. For all platforms; there are two methods of sending DotStar data, hardware SPI and software SPI.", "homepage": "https://github.com/Makuna/NeoPixelBus/wiki", "repository": { "type": "git", "url": "https://github.com/Makuna/NeoPixelBus" }, - "version": "2.6.3", + "version": "2.6.7", "frameworks": "arduino", "platforms": "*", "dependencies": [ diff --git a/lib/lib_basic/NeoPixelBus/library.properties b/lib/lib_basic/NeoPixelBus/library.properties index d3fea5120..35c9faea1 100644 --- a/lib/lib_basic/NeoPixelBus/library.properties +++ b/lib/lib_basic/NeoPixelBus/library.properties @@ -1,8 +1,8 @@ name=NeoPixelBus by Makuna -version=2.6.3 +version=2.6.7 author=Michael C. Miller (makuna@live.com) maintainer=Michael C. Miller (makuna@live.com) -sentence=A library that makes controlling NeoPixels (APA106, WS2811, WS2812, WS2813, SK6812, TM1829, TM1814, TX1812) and DotStars (APA102, LPD8806, LPD6803, SK9822, WS2801, P9813) easy. +sentence=A library that makes controlling NeoPixels (APA106, WS2811, WS2812, WS2813, SK6812, TM1829, TM1814, TM1914, TX1812) and DotStars (APA102, LPD8806, LPD6803, SK9822, WS2801, P9813) easy. paragraph=Supports most Arduino platforms, including async hardware support for Esp8266, Esp32, and Nrf52 (Nano 33 BLE). Support for RGBW pixels and 7 Segment LED direct driven. Includes seperate RgbColor, RgbwColor, Rgb16Color, Rgb48Color, HslColor, and HsbColor objects. Includes an animator class that helps create asyncronous animations. Supports Matrix layout of pixels. Includes Gamma corretion object. For all platforms; there are two methods of sending DotStar data, hardware SPI and software SPI. category=Display url=https://github.com/Makuna/NeoPixelBus/wiki diff --git a/lib/lib_basic/NeoPixelBus/src/NeoPixelBrightnessBus.h b/lib/lib_basic/NeoPixelBus/src/NeoPixelBrightnessBus.h index 6b93a6547..e110fdfc2 100644 --- a/lib/lib_basic/NeoPixelBus/src/NeoPixelBrightnessBus.h +++ b/lib/lib_basic/NeoPixelBus/src/NeoPixelBrightnessBus.h @@ -70,6 +70,12 @@ public: _brightness(255) { } + + NeoPixelBrightnessBus(uint16_t countPixels, uint8_t pin, NeoBusChannel channel) : + NeoPixelBus(countPixels, pin, channel), + _brightness(255) + { + } NeoPixelBrightnessBus(uint16_t countPixels, uint8_t pinClock, uint8_t pinData) : NeoPixelBus(countPixels, pinClock, pinData), diff --git a/lib/lib_basic/NeoPixelBus/src/NeoPixelBus.h b/lib/lib_basic/NeoPixelBus/src/NeoPixelBus.h index 2151567f0..1f06ef52c 100644 --- a/lib/lib_basic/NeoPixelBus/src/NeoPixelBus.h +++ b/lib/lib_basic/NeoPixelBus/src/NeoPixelBus.h @@ -63,6 +63,7 @@ License along with NeoPixel. If not, see #include "internal/NeoColorFeatures.h" #include "internal/NeoTm1814ColorFeatures.h" +#include "internal/NeoTm1914ColorFeatures.h" #include "internal/DotStarColorFeatures.h" #include "internal/Lpd8806ColorFeatures.h" #include "internal/Lpd6803ColorFeatures.h" diff --git a/lib/lib_basic/NeoPixelBus/src/internal/NeoArmMethod.h b/lib/lib_basic/NeoPixelBus/src/internal/NeoArmMethod.h index b0199ae1b..ef1f7cf69 100644 --- a/lib/lib_basic/NeoPixelBus/src/internal/NeoArmMethod.h +++ b/lib/lib_basic/NeoPixelBus/src/internal/NeoArmMethod.h @@ -224,6 +224,7 @@ typedef NeoArmMethodBase> Ne typedef NeoArmMethodBase> NeoArm800KbpsMethod; typedef NeoArmMethodBase> NeoArm400KbpsMethod; +typedef NeoArmTm1814InvertedMethod NeoArmTm1914InvertedMethod; #elif defined(__MKL26Z64__) // Teensy-LC @@ -355,6 +356,7 @@ typedef NeoArmMethodBase NeoArmTm1814InvertedMethod; typedef NeoArmMethodBase NeoArmTm1829InvertedMethod; typedef NeoArmMethodBase NeoArm800KbpsMethod; typedef NeoArm800KbpsMethod NeoArmApa106Method; +typedef NeoArmTm1814InvertedMethod NeoArmTm1914InvertedMethod; #else #error "Teensy-LC: Sorry, only 48 MHz is supported, please set Tools > CPU Speed to 48 MHz" @@ -505,6 +507,7 @@ typedef NeoArmMethodBase> NeoArm800KbpsMethod; typedef NeoArmMethodBase> NeoArm400KbpsMethod; typedef NeoArm400KbpsMethod NeoArmApa106Method; +typedef NeoArmTm1814InvertedMethod NeoArmTm1914InvertedMethod; #elif defined(ARDUINO_STM32_FEATHER) || defined(ARDUINO_ARCH_STM32L4) || defined(ARDUINO_ARCH_STM32F4) || defined(ARDUINO_ARCH_STM32F1)// FEATHER WICED (120MHz) @@ -695,10 +698,11 @@ public: typedef NeoArmMethodBase> NeoArmWs2812xMethod; typedef NeoArmMethodBase> NeoArmSk6812Method; -typedef NeoArmMethodBase> NeoArmTm1814InvertedMethod; -typedef NeoArmMethodBase> NeoArmTm1829InvertedMethod; +typedef NeoArmMethodBase> NeoArmTm1814InvertedMethod; +typedef NeoArmMethodBase> NeoArmTm1829InvertedMethod; typedef NeoArmMethodBase> NeoArm800KbpsMethod; typedef NeoArm800KbpsMethod NeoArmApa106Method; +typedef NeoArmTm1814InvertedMethod NeoArmTm1914InvertedMethod; #else // Other ARM architecture -- Presumed Arduino Due @@ -836,6 +840,7 @@ typedef NeoArmMethodBase> NeoA typedef NeoArmMethodBase> NeoArm800KbpsMethod; typedef NeoArmMethodBase> NeoArm400KbpsMethod; typedef NeoArm400KbpsMethod NeoArmApa106Method; +typedef NeoArmTm1814InvertedMethod NeoArmTm1914InvertedMethod; #endif @@ -852,8 +857,9 @@ typedef NeoArmWs2812xMethod Neo800KbpsMethod; #ifdef NeoArm400KbpsMethod // this is needed due to missing 400Kbps for some platforms typedef NeoArm400KbpsMethod Neo400KbpsMethod; #endif -// there is no invert methods for arm, but the norm for TM1814 is inverted, so +// there is no non-invert methods for arm, but the norm for TM1814 is inverted, so typedef NeoArmTm1814InvertedMethod NeoTm1814InvertedMethod; +typedef NeoArmTm1914InvertedMethod NeoTm1914InvertedMethod; typedef NeoArmTm1829InvertedMethod NeoTm1829InvertedMethod; #endif // defined(__arm__) diff --git a/lib/lib_basic/NeoPixelBus/src/internal/NeoAvrMethod.h b/lib/lib_basic/NeoPixelBus/src/internal/NeoAvrMethod.h index 673ba8eca..685ab56ef 100644 --- a/lib/lib_basic/NeoPixelBus/src/internal/NeoAvrMethod.h +++ b/lib/lib_basic/NeoPixelBus/src/internal/NeoAvrMethod.h @@ -219,7 +219,7 @@ typedef NeoAvrMethodBase NeoAvrTm1814InvertedMethod; typedef NeoAvrMethodBase NeoAvrTm1829InvertedMethod; typedef NeoAvrMethodBase NeoAvr800KbpsMethod; typedef NeoAvrMethodBase NeoAvr400KbpsMethod; - +typedef NeoAvrTm1814InvertedMethod NeoAvrTm1914InvertedMethod; // AVR doesn't have alternatives yet, so there is just the default typedef NeoAvrWs2812xMethod NeoWs2813Method; @@ -232,7 +232,9 @@ typedef NeoAvr400KbpsMethod NeoApa106Method; typedef NeoAvrWs2812xMethod Neo800KbpsMethod; typedef NeoAvr400KbpsMethod Neo400KbpsMethod; +// there is no non-invert methods for avr, but the norm for TM1814 is inverted, so typedef NeoAvrTm1814InvertedMethod NeoTm1814InvertedMethod; +typedef NeoAvrTm1914InvertedMethod NeoTm1914InvertedMethod; typedef NeoAvrTm1829InvertedMethod NeoTm1829InvertedMethod; #endif diff --git a/lib/lib_basic/NeoPixelBus/src/internal/NeoBusChannel.h b/lib/lib_basic/NeoPixelBus/src/internal/NeoBusChannel.h index 9fc374d33..6f4b3c66f 100644 --- a/lib/lib_basic/NeoPixelBus/src/internal/NeoBusChannel.h +++ b/lib/lib_basic/NeoPixelBus/src/internal/NeoBusChannel.h @@ -1,30 +1,43 @@ #pragma once // For those platforms/methods that support dynamic channel setting +// +// ESP32 - 8 TX channels +// ESP32S2 - 4 TX channels +// ESP32C3 - 2 TX channels +// NRF52840 - 3 or 4 channels (some variants only have 3) + enum NeoBusChannel { NeoBusChannel_0, NeoBusChannel_1, + +#if !defined(CONFIG_IDF_TARGET_ESP32C3) + NeoBusChannel_2, // NRF52x has only 3 or 4 channels of PWM #if defined(ARDUINO_ARCH_NRF52840) #if defined(NRF_PWM3) - NeoBusChannel_3 + NeoBusChannel_3, #endif -// ESP32 has either 8 or 4 channels (S2 has only 4) +// ESP32 has either 8, 4, or 2 channels (S2 has only 4, C3 only 2) #elif defined(ARDUINO_ARCH_ESP32) NeoBusChannel_3, -#if !defined(CONFIG_IDF_TARGET_ESP32S2) && !defined(CONFIG_IDF_TARGET_ESP32C3) +#if !defined(CONFIG_IDF_TARGET_ESP32S2) NeoBusChannel_4, NeoBusChannel_5, NeoBusChannel_6, NeoBusChannel_7, -#endif +#endif // !defined(CONFIG_IDF_TARGET_ESP32S2) + +#endif // !defined(CONFIG_IDF_TARGET_ESP32C3) #endif // ARDUINO_ARCH_ESP32 + + NeoBusChannel_COUNT }; \ No newline at end of file diff --git a/lib/lib_basic/NeoPixelBus/src/internal/NeoEsp32I2sMethod.h b/lib/lib_basic/NeoPixelBus/src/internal/NeoEsp32I2sMethod.h index 8d1d9dbee..9dbaa7fe7 100644 --- a/lib/lib_basic/NeoPixelBus/src/internal/NeoEsp32I2sMethod.h +++ b/lib/lib_basic/NeoPixelBus/src/internal/NeoEsp32I2sMethod.h @@ -61,6 +61,14 @@ public: const static uint16_t ResetTimeUs = 200; }; +class NeoEsp32I2sSpeedTm1914 +{ +public: + const static uint32_t I2sSampleRate = 100000; + const static uint16_t ByteSendTimeUs = 10; + const static uint16_t ResetTimeUs = 200; +}; + class NeoEsp32I2sSpeedTm1829 { public: @@ -161,6 +169,7 @@ public: yield(); } + gpio_matrix_out(_pin, 0x100, false, false); pinMode(_pin, INPUT); free(_data); @@ -277,6 +286,7 @@ typedef NeoEsp32I2sMethodBase NeoEsp32I2s0Sk6812Method; typedef NeoEsp32I2sMethodBase NeoEsp32I2s0Tm1814Method; typedef NeoEsp32I2sMethodBase NeoEsp32I2s0Tm1829Method; +typedef NeoEsp32I2sMethodBase NeoEsp32I2s0Tm1914Method; typedef NeoEsp32I2sMethodBase NeoEsp32I2s0800KbpsMethod; typedef NeoEsp32I2sMethodBase NeoEsp32I2s0400KbpsMethod; typedef NeoEsp32I2sMethodBase NeoEsp32I2s0Apa106Method; @@ -285,6 +295,7 @@ typedef NeoEsp32I2sMethodBase NeoEsp32I2s0Ws2812xInvertedMethod; typedef NeoEsp32I2sMethodBase NeoEsp32I2s0Sk6812InvertedMethod; typedef NeoEsp32I2sMethodBase NeoEsp32I2s0Tm1814InvertedMethod; +typedef NeoEsp32I2sMethodBase NeoEsp32I2s0Tm1914InvertedMethod; typedef NeoEsp32I2sMethodBase NeoEsp32I2s0Tm1829InvertedMethod; typedef NeoEsp32I2sMethodBase NeoEsp32I2s0800KbpsInvertedMethod; typedef NeoEsp32I2sMethodBase NeoEsp32I2s0400KbpsInvertedMethod; @@ -297,6 +308,7 @@ typedef NeoEsp32I2sMethodBase NeoEsp32I2s1Sk6812Method; typedef NeoEsp32I2sMethodBase NeoEsp32I2s1Tm1814Method; typedef NeoEsp32I2sMethodBase NeoEsp32I2s1Tm1829Method; +typedef NeoEsp32I2sMethodBase NeoEsp32I2s1Tm1914Method; typedef NeoEsp32I2sMethodBase NeoEsp32I2s1800KbpsMethod; typedef NeoEsp32I2sMethodBase NeoEsp32I2s1400KbpsMethod; typedef NeoEsp32I2sMethodBase NeoEsp32I2s1Apa106Method; @@ -305,6 +317,7 @@ typedef NeoEsp32I2sMethodBase NeoEsp32I2s1Sk6812InvertedMethod; typedef NeoEsp32I2sMethodBase NeoEsp32I2s1Tm1814InvertedMethod; typedef NeoEsp32I2sMethodBase NeoEsp32I2s1Tm1829InvertedMethod; +typedef NeoEsp32I2sMethodBase NeoEsp32I2s1Tm1914InvertedMethod; typedef NeoEsp32I2sMethodBase NeoEsp32I2s1800KbpsInvertedMethod; typedef NeoEsp32I2sMethodBase NeoEsp32I2s1400KbpsInvertedMethod; typedef NeoEsp32I2sMethodBase NeoEsp32I2s1Apa106InvertedMethod; @@ -313,6 +326,8 @@ typedef NeoEsp32I2sMethodBase NeoEsp32I2sNWs2812xMethod; typedef NeoEsp32I2sMethodBase NeoEsp32I2sNSk6812Method; typedef NeoEsp32I2sMethodBase NeoEsp32I2sNTm1814Method; +typedef NeoEsp32I2sMethodBase NeoEsp32I2sNTm1829Method; +typedef NeoEsp32I2sMethodBase NeoEsp32I2sNTm1914Method; typedef NeoEsp32I2sMethodBase NeoEsp32I2sN800KbpsMethod; typedef NeoEsp32I2sMethodBase NeoEsp32I2sN400KbpsMethod; typedef NeoEsp32I2sMethodBase NeoEsp32I2sNApa106Method; @@ -320,6 +335,8 @@ typedef NeoEsp32I2sMethodBase NeoEsp32I2sNWs2812xInvertedMethod; typedef NeoEsp32I2sMethodBase NeoEsp32I2sNSk6812InvertedMethod; typedef NeoEsp32I2sMethodBase NeoEsp32I2sNTm1814InvertedMethod; +typedef NeoEsp32I2sMethodBase NeoEsp32I2sNTm1829InvertedMethod; +typedef NeoEsp32I2sMethodBase NeoEsp32I2sNTm1914InvertedMethod; typedef NeoEsp32I2sMethodBase NeoEsp32I2sN800KbpsInvertedMethod; typedef NeoEsp32I2sMethodBase NeoEsp32I2sN400KbpsInvertedMethod; typedef NeoEsp32I2sMethodBase NeoEsp32I2sNApa106InvertedMethod; @@ -337,6 +354,7 @@ typedef NeoEsp32I2s1Ws2812xMethod NeoWs2811Method; typedef NeoEsp32I2s1Sk6812Method NeoSk6812Method; typedef NeoEsp32I2s1Tm1814Method NeoTm1814Method; typedef NeoEsp32I2s1Tm1829Method NeoTm1829Method; +typedef NeoEsp32I2s1Tm1914Method NeoTm1914Method; typedef NeoEsp32I2s1Sk6812Method NeoLc8812Method; typedef NeoEsp32I2s1Apa106Method NeoApa106Method; @@ -350,6 +368,7 @@ typedef NeoEsp32I2s1800KbpsInvertedMethod NeoWs2812InvertedMethod; typedef NeoEsp32I2s1Sk6812InvertedMethod NeoSk6812InvertedMethod; typedef NeoEsp32I2s1Tm1814InvertedMethod NeoTm1814InvertedMethod; typedef NeoEsp32I2s1Tm1829InvertedMethod NeoTm1829InvertedMethod; +typedef NeoEsp32I2s1Tm1914InvertedMethod NeoTm1914InvertedMethod; typedef NeoEsp32I2s1Sk6812InvertedMethod NeoLc8812InvertedMethod; typedef NeoEsp32I2s1Apa106InvertedMethod NeoApa106InvertedMethod; diff --git a/lib/lib_basic/NeoPixelBus/src/internal/NeoEsp32RmtMethod.cpp b/lib/lib_basic/NeoPixelBus/src/internal/NeoEsp32RmtMethod.cpp index f1a351819..f25d20d8f 100644 --- a/lib/lib_basic/NeoPixelBus/src/internal/NeoEsp32RmtMethod.cpp +++ b/lib/lib_basic/NeoPixelBus/src/internal/NeoEsp32RmtMethod.cpp @@ -153,6 +153,28 @@ void NeoEsp32RmtSpeedTm1814::Translate(const void* src, RmtBit0, RmtBit1, RmtDurationReset); } +void NeoEsp32RmtSpeedTm1829::Translate(const void* src, + rmt_item32_t* dest, + size_t src_size, + size_t wanted_num, + size_t* translated_size, + size_t* item_num) +{ + _translate(src, dest, src_size, wanted_num, translated_size, item_num, + RmtBit0, RmtBit1, RmtDurationReset); +} + +void NeoEsp32RmtSpeedTm1914::Translate(const void* src, + rmt_item32_t* dest, + size_t src_size, + size_t wanted_num, + size_t* translated_size, + size_t* item_num) +{ + _translate(src, dest, src_size, wanted_num, translated_size, item_num, + RmtBit0, RmtBit1, RmtDurationReset); +} + void NeoEsp32RmtSpeed800Kbps::Translate(const void* src, rmt_item32_t* dest, size_t src_size, @@ -241,6 +263,28 @@ void NeoEsp32RmtInvertedSpeedTm1814::Translate(const void* src, RmtBit0, RmtBit1, RmtDurationReset); } +void NeoEsp32RmtInvertedSpeedTm1829::Translate(const void* src, + rmt_item32_t* dest, + size_t src_size, + size_t wanted_num, + size_t* translated_size, + size_t* item_num) +{ + _translate(src, dest, src_size, wanted_num, translated_size, item_num, + RmtBit0, RmtBit1, RmtDurationReset); +} + +void NeoEsp32RmtInvertedSpeedTm1914::Translate(const void* src, + rmt_item32_t* dest, + size_t src_size, + size_t wanted_num, + size_t* translated_size, + size_t* item_num) +{ + _translate(src, dest, src_size, wanted_num, translated_size, item_num, + RmtBit0, RmtBit1, RmtDurationReset); +} + void NeoEsp32RmtInvertedSpeed800Kbps::Translate(const void* src, rmt_item32_t* dest, size_t src_size, diff --git a/lib/lib_basic/NeoPixelBus/src/internal/NeoEsp32RmtMethod.h b/lib/lib_basic/NeoPixelBus/src/internal/NeoEsp32RmtMethod.h index 66cd7c2d7..6d98ccd04 100644 --- a/lib/lib_basic/NeoPixelBus/src/internal/NeoEsp32RmtMethod.h +++ b/lib/lib_basic/NeoPixelBus/src/internal/NeoEsp32RmtMethod.h @@ -184,6 +184,22 @@ public: size_t* item_num); }; +// normal is inverted signal +class NeoEsp32RmtSpeedTm1914 : public NeoEsp32RmtInvertedSpeedBase +{ +public: + const static DRAM_ATTR uint32_t RmtBit0 = Item32Val(360, 890); + const static DRAM_ATTR uint32_t RmtBit1 = Item32Val(720, 530); + const static DRAM_ATTR uint16_t RmtDurationReset = FromNs(200000); // 200us + + static void IRAM_ATTR Translate(const void* src, + rmt_item32_t* dest, + size_t src_size, + size_t wanted_num, + size_t* translated_size, + size_t* item_num); +}; + class NeoEsp32RmtSpeed800Kbps : public NeoEsp32RmtSpeedBase { public: @@ -321,6 +337,22 @@ public: size_t* item_num); }; +// normal is inverted signal +class NeoEsp32RmtInvertedSpeedTm1914 : public NeoEsp32RmtSpeedBase +{ +public: + const static DRAM_ATTR uint32_t RmtBit0 = Item32Val(360, 890); + const static DRAM_ATTR uint32_t RmtBit1 = Item32Val(720, 530); + const static DRAM_ATTR uint16_t RmtDurationReset = FromNs(200000); // 200us + + static void IRAM_ATTR Translate(const void* src, + rmt_item32_t* dest, + size_t src_size, + size_t wanted_num, + size_t* translated_size, + size_t* item_num); +}; + class NeoEsp32RmtInvertedSpeed800Kbps : public NeoEsp32RmtInvertedSpeedBase { public: @@ -490,6 +522,9 @@ public: ESP_ERROR_CHECK(rmt_driver_uninstall(_channel.RmtChannelNumber)); + gpio_matrix_out(_pin, 0x100, false, false); + pinMode(_pin, INPUT); + free(_dataEditing); free(_dataSending); } @@ -502,7 +537,7 @@ public: void Initialize() { - rmt_config_t config; + rmt_config_t config = {}; config.rmt_mode = RMT_MODE_TX; config.channel = _channel.RmtChannelNumber; @@ -585,6 +620,8 @@ typedef NeoEsp32RmtMethodBase NeoEs typedef NeoEsp32RmtMethodBase NeoEsp32RmtNWs2812xMethod; typedef NeoEsp32RmtMethodBase NeoEsp32RmtNSk6812Method; typedef NeoEsp32RmtMethodBase NeoEsp32RmtNTm1814Method; +typedef NeoEsp32RmtMethodBase NeoEsp32RmtNTm1829Method; +typedef NeoEsp32RmtMethodBase NeoEsp32RmtNTm1914Method; typedef NeoEsp32RmtMethodBase NeoEsp32RmtNApa106Method; typedef NeoEsp32RmtMethodBase NeoEsp32RmtNTx1812Method; typedef NeoEsp32RmtMethodBase NeoEsp32RmtN800KbpsMethod; @@ -595,6 +632,7 @@ typedef NeoEsp32RmtMethodBase NeoE typedef NeoEsp32RmtMethodBase NeoEsp32Rmt0Sk6812Method; typedef NeoEsp32RmtMethodBase NeoEsp32Rmt0Tm1814Method; typedef NeoEsp32RmtMethodBase NeoEsp32Rmt0Tm1829Method; +typedef NeoEsp32RmtMethodBase NeoEsp32Rmt0Tm1914Method; typedef NeoEsp32RmtMethodBase NeoEsp32Rmt0Apa106Method; typedef NeoEsp32RmtMethodBase NeoEsp32Rmt0Tx1812Method; typedef NeoEsp32RmtMethodBase NeoEsp32Rmt0800KbpsMethod; @@ -605,16 +643,20 @@ typedef NeoEsp32RmtMethodBase NeoE typedef NeoEsp32RmtMethodBase NeoEsp32Rmt1Sk6812Method; typedef NeoEsp32RmtMethodBase NeoEsp32Rmt1Tm1814Method; typedef NeoEsp32RmtMethodBase NeoEsp32Rmt1Tm1829Method; +typedef NeoEsp32RmtMethodBase NeoEsp32Rmt1Tm1914Method; typedef NeoEsp32RmtMethodBase NeoEsp32Rmt1Apa106Method; typedef NeoEsp32RmtMethodBase NeoEsp32Rmt1Tx1812Method; typedef NeoEsp32RmtMethodBase NeoEsp32Rmt1800KbpsMethod; typedef NeoEsp32RmtMethodBase NeoEsp32Rmt1400KbpsMethod; +#if !defined(CONFIG_IDF_TARGET_ESP32C3) + typedef NeoEsp32RmtMethodBase NeoEsp32Rmt2Ws2811Method; typedef NeoEsp32RmtMethodBase NeoEsp32Rmt2Ws2812xMethod; typedef NeoEsp32RmtMethodBase NeoEsp32Rmt2Sk6812Method; typedef NeoEsp32RmtMethodBase NeoEsp32Rmt2Tm1814Method; typedef NeoEsp32RmtMethodBase NeoEsp32Rmt2Tm1829Method; +typedef NeoEsp32RmtMethodBase NeoEsp32Rmt2Tm1914Method; typedef NeoEsp32RmtMethodBase NeoEsp32Rmt2Apa106Method; typedef NeoEsp32RmtMethodBase NeoEsp32Rmt2Tx1812Method; typedef NeoEsp32RmtMethodBase NeoEsp32Rmt2800KbpsMethod; @@ -625,19 +667,20 @@ typedef NeoEsp32RmtMethodBase NeoE typedef NeoEsp32RmtMethodBase NeoEsp32Rmt3Sk6812Method; typedef NeoEsp32RmtMethodBase NeoEsp32Rmt3Tm1814Method; typedef NeoEsp32RmtMethodBase NeoEsp32Rmt3Tm1829Method; +typedef NeoEsp32RmtMethodBase NeoEsp32Rmt3Tm1914Method; typedef NeoEsp32RmtMethodBase NeoEsp32Rmt3Apa106Method; typedef NeoEsp32RmtMethodBase NeoEsp32Rmt3Tx1812Method; typedef NeoEsp32RmtMethodBase NeoEsp32Rmt3800KbpsMethod; typedef NeoEsp32RmtMethodBase NeoEsp32Rmt3400KbpsMethod; -#if !defined(CONFIG_IDF_TARGET_ESP32S2) && !defined(CONFIG_IDF_TARGET_ESP32C3) -// (RMT_CHANNEL_MAX == 8) +#if !defined(CONFIG_IDF_TARGET_ESP32S2) typedef NeoEsp32RmtMethodBase NeoEsp32Rmt4Ws2811Method; typedef NeoEsp32RmtMethodBase NeoEsp32Rmt4Ws2812xMethod; typedef NeoEsp32RmtMethodBase NeoEsp32Rmt4Sk6812Method; typedef NeoEsp32RmtMethodBase NeoEsp32Rmt4Tm1814Method; typedef NeoEsp32RmtMethodBase NeoEsp32Rmt4Tm1829Method; +typedef NeoEsp32RmtMethodBase NeoEsp32Rmt4Tm1914Method; typedef NeoEsp32RmtMethodBase NeoEsp32Rmt4Apa106Method; typedef NeoEsp32RmtMethodBase NeoEsp32Rmt4Tx1812Method; typedef NeoEsp32RmtMethodBase NeoEsp32Rmt4800KbpsMethod; @@ -648,6 +691,7 @@ typedef NeoEsp32RmtMethodBase NeoE typedef NeoEsp32RmtMethodBase NeoEsp32Rmt5Sk6812Method; typedef NeoEsp32RmtMethodBase NeoEsp32Rmt5Tm1814Method; typedef NeoEsp32RmtMethodBase NeoEsp32Rmt5Tm1829Method; +typedef NeoEsp32RmtMethodBase NeoEsp32Rmt5Tm1914Method; typedef NeoEsp32RmtMethodBase NeoEsp32Rmt5Apa106Method; typedef NeoEsp32RmtMethodBase NeoEsp32Rmt5Tx1812Method; typedef NeoEsp32RmtMethodBase NeoEsp32Rmt5800KbpsMethod; @@ -658,6 +702,7 @@ typedef NeoEsp32RmtMethodBase NeoE typedef NeoEsp32RmtMethodBase NeoEsp32Rmt6Sk6812Method; typedef NeoEsp32RmtMethodBase NeoEsp32Rmt6Tm1814Method; typedef NeoEsp32RmtMethodBase NeoEsp32Rmt6Tm1829Method; +typedef NeoEsp32RmtMethodBase NeoEsp32Rmt6Tm1914Method; typedef NeoEsp32RmtMethodBase NeoEsp32Rmt6Apa106Method; typedef NeoEsp32RmtMethodBase NeoEsp32Rmt6Tx1812Method; typedef NeoEsp32RmtMethodBase NeoEsp32Rmt6800KbpsMethod; @@ -668,18 +713,22 @@ typedef NeoEsp32RmtMethodBase NeoE typedef NeoEsp32RmtMethodBase NeoEsp32Rmt7Sk6812Method; typedef NeoEsp32RmtMethodBase NeoEsp32Rmt7Tm1814Method; typedef NeoEsp32RmtMethodBase NeoEsp32Rmt7Tm1829Method; +typedef NeoEsp32RmtMethodBase NeoEsp32Rmt7Tm1914Method; typedef NeoEsp32RmtMethodBase NeoEsp32Rmt7Apa106Method; typedef NeoEsp32RmtMethodBase NeoEsp32Rmt7Tx1812Method; typedef NeoEsp32RmtMethodBase NeoEsp32Rmt7800KbpsMethod; typedef NeoEsp32RmtMethodBase NeoEsp32Rmt7400KbpsMethod; -#endif +#endif // !defined(CONFIG_IDF_TARGET_ESP32S2) +#endif // !defined(CONFIG_IDF_TARGET_ESP32C3) // inverted typedef NeoEsp32RmtMethodBase NeoEsp32RmtNWs2811InvertedMethod; typedef NeoEsp32RmtMethodBase NeoEsp32RmtNWs2812xInvertedMethod; typedef NeoEsp32RmtMethodBase NeoEsp32RmtNSk6812InvertedMethod; typedef NeoEsp32RmtMethodBase NeoEsp32RmtNTm1814InvertedMethod; +typedef NeoEsp32RmtMethodBase NeoEsp32RmtNTm1829InvertedMethod; +typedef NeoEsp32RmtMethodBase NeoEsp32RmtNTm1914InvertedMethod; typedef NeoEsp32RmtMethodBase NeoEsp32RmtNApa106InvertedMethod; typedef NeoEsp32RmtMethodBase NeoEsp32RmtNTx1812InvertedMethod; typedef NeoEsp32RmtMethodBase NeoEsp32RmtN800KbpsInvertedMethod; @@ -690,6 +739,7 @@ typedef NeoEsp32RmtMethodBase NeoEsp32Rmt0Sk6812InvertedMethod; typedef NeoEsp32RmtMethodBase NeoEsp32Rmt0Tm1814InvertedMethod; typedef NeoEsp32RmtMethodBase NeoEsp32Rmt0Tm1829InvertedMethod; +typedef NeoEsp32RmtMethodBase NeoEsp32Rmt0Tm1914InvertedMethod; typedef NeoEsp32RmtMethodBase NeoEsp32Rmt0Apa106InvertedMethod; typedef NeoEsp32RmtMethodBase NeoEsp32Rmt0Tx1812InvertedMethod; typedef NeoEsp32RmtMethodBase NeoEsp32Rmt0800KbpsInvertedMethod; @@ -700,16 +750,20 @@ typedef NeoEsp32RmtMethodBase NeoEsp32Rmt1Sk6812InvertedMethod; typedef NeoEsp32RmtMethodBase NeoEsp32Rmt1Tm1814InvertedMethod; typedef NeoEsp32RmtMethodBase NeoEsp32Rmt1Tm1829InvertedMethod; +typedef NeoEsp32RmtMethodBase NeoEsp32Rmt1Tm1914InvertedMethod; typedef NeoEsp32RmtMethodBase NeoEsp32Rmt1Apa106InvertedMethod; typedef NeoEsp32RmtMethodBase NeoEsp32Rmt1Tx1812InvertedMethod; typedef NeoEsp32RmtMethodBase NeoEsp32Rmt1800KbpsInvertedMethod; typedef NeoEsp32RmtMethodBase NeoEsp32Rmt1400KbpsInvertedMethod; +#if !defined(CONFIG_IDF_TARGET_ESP32C3) + typedef NeoEsp32RmtMethodBase NeoEsp32Rmt2Ws2811InvertedMethod; typedef NeoEsp32RmtMethodBase NeoEsp32Rmt2Ws2812xInvertedMethod; typedef NeoEsp32RmtMethodBase NeoEsp32Rmt2Sk6812InvertedMethod; typedef NeoEsp32RmtMethodBase NeoEsp32Rmt2Tm1814InvertedMethod; typedef NeoEsp32RmtMethodBase NeoEsp32Rmt2Tm1829InvertedMethod; +typedef NeoEsp32RmtMethodBase NeoEsp32Rmt2Tm1914InvertedMethod; typedef NeoEsp32RmtMethodBase NeoEsp32Rmt2Apa106InvertedMethod; typedef NeoEsp32RmtMethodBase NeoEsp32Rmt2Tx1812InvertedMethod; typedef NeoEsp32RmtMethodBase NeoEsp32Rmt2800KbpsInvertedMethod; @@ -720,19 +774,20 @@ typedef NeoEsp32RmtMethodBase NeoEsp32Rmt3Sk6812InvertedMethod; typedef NeoEsp32RmtMethodBase NeoEsp32Rmt3Tm1814InvertedMethod; typedef NeoEsp32RmtMethodBase NeoEsp32Rmt3Tm1829InvertedMethod; +typedef NeoEsp32RmtMethodBase NeoEsp32Rmt3Tm1914InvertedMethod; typedef NeoEsp32RmtMethodBase NeoEsp32Rmt3Apa106InvertedMethod; typedef NeoEsp32RmtMethodBase NeoEsp32Rmt3Tx1812InvertedMethod; typedef NeoEsp32RmtMethodBase NeoEsp32Rmt3800KbpsInvertedMethod; typedef NeoEsp32RmtMethodBase NeoEsp32Rmt3400KbpsInvertedMethod; -#if !defined(CONFIG_IDF_TARGET_ESP32S2) && !defined(CONFIG_IDF_TARGET_ESP32C3) -// (RMT_CHANNEL_MAX == 8) +#if !defined(CONFIG_IDF_TARGET_ESP32S2) typedef NeoEsp32RmtMethodBase NeoEsp32Rmt4Ws2811InvertedMethod; typedef NeoEsp32RmtMethodBase NeoEsp32Rmt4Ws2812xInvertedMethod; typedef NeoEsp32RmtMethodBase NeoEsp32Rmt4Sk6812InvertedMethod; typedef NeoEsp32RmtMethodBase NeoEsp32Rmt4Tm1814InvertedMethod; typedef NeoEsp32RmtMethodBase NeoEsp32Rmt4Tm1829InvertedMethod; +typedef NeoEsp32RmtMethodBase NeoEsp32Rmt4Tm1914InvertedMethod; typedef NeoEsp32RmtMethodBase NeoEsp32Rmt4Apa106InvertedMethod; typedef NeoEsp32RmtMethodBase NeoEsp32Rmt4Tx1812InvertedMethod; typedef NeoEsp32RmtMethodBase NeoEsp32Rmt4800KbpsInvertedMethod; @@ -743,6 +798,7 @@ typedef NeoEsp32RmtMethodBase NeoEsp32Rmt5Sk6812InvertedMethod; typedef NeoEsp32RmtMethodBase NeoEsp32Rmt5Tm1814InvertedMethod; typedef NeoEsp32RmtMethodBase NeoEsp32Rmt5Tm1829InvertedMethod; +typedef NeoEsp32RmtMethodBase NeoEsp32Rmt5Tm1914InvertedMethod; typedef NeoEsp32RmtMethodBase NeoEsp32Rmt5Apa106InvertedMethod; typedef NeoEsp32RmtMethodBase NeoEsp32Rmt5Tx1812InvertedMethod; typedef NeoEsp32RmtMethodBase NeoEsp32Rmt5800KbpsInvertedMethod; @@ -753,6 +809,7 @@ typedef NeoEsp32RmtMethodBase NeoEsp32Rmt6Sk6812InvertedMethod; typedef NeoEsp32RmtMethodBase NeoEsp32Rmt6Tm1814InvertedMethod; typedef NeoEsp32RmtMethodBase NeoEsp32Rmt6Tm1829InvertedMethod; +typedef NeoEsp32RmtMethodBase NeoEsp32Rmt6Tm1914InvertedMethod; typedef NeoEsp32RmtMethodBase NeoEsp32Rmt6Apa106InvertedMethod; typedef NeoEsp32RmtMethodBase NeoEsp32Rmt6Tx1812InvertedMethod; typedef NeoEsp32RmtMethodBase NeoEsp32Rmt6800KbpsInvertedMethod; @@ -763,21 +820,57 @@ typedef NeoEsp32RmtMethodBase NeoEsp32Rmt7Sk6812InvertedMethod; typedef NeoEsp32RmtMethodBase NeoEsp32Rmt7Tm1814InvertedMethod; typedef NeoEsp32RmtMethodBase NeoEsp32Rmt7Tm1829InvertedMethod; +typedef NeoEsp32RmtMethodBase NeoEsp32Rmt7Tm1914InvertedMethod; typedef NeoEsp32RmtMethodBase NeoEsp32Rmt7Apa106InvertedMethod; typedef NeoEsp32RmtMethodBase NeoEsp32Rmt7Tx1812InvertedMethod; typedef NeoEsp32RmtMethodBase NeoEsp32Rmt7800KbpsInvertedMethod; typedef NeoEsp32RmtMethodBase NeoEsp32Rmt7400KbpsInvertedMethod; -#endif +#endif // !defined(CONFIG_IDF_TARGET_ESP32S2) +#endif // !defined(CONFIG_IDF_TARGET_ESP32C3) #if defined(NEOPIXEL_ESP32_RMT_DEFAULT) || defined(CONFIG_IDF_TARGET_ESP32S2) || defined(CONFIG_IDF_TARGET_ESP32C3) + // Normally I2s method is the default, defining NEOPIXEL_ESP32_RMT_DEFAULT // will switch to use RMT as the default method // The ESP32S2 & ESP32C3 will always defualt to RMT -#if !defined(CONFIG_IDF_TARGET_ESP32S2) && !defined(CONFIG_IDF_TARGET_ESP32C3) -// (RMT_CHANNEL_MAX == 8) +#if defined(CONFIG_IDF_TARGET_ESP32S2) || defined(CONFIG_IDF_TARGET_ESP32C3) + +// RMT channel 1 method is the default method for Esp32S2 & Esp32C3 +typedef NeoEsp32Rmt1Ws2812xMethod NeoWs2813Method; +typedef NeoEsp32Rmt1Ws2812xMethod NeoWs2812xMethod; +typedef NeoEsp32Rmt1800KbpsMethod NeoWs2812Method; +typedef NeoEsp32Rmt1Ws2812xMethod NeoWs2811Method; +typedef NeoEsp32Rmt1Sk6812Method NeoSk6812Method; +typedef NeoEsp32Rmt1Tm1814Method NeoTm1814Method; +typedef NeoEsp32Rmt1Tm1829Method NeoTm1829Method; +typedef NeoEsp32Rmt1Tm1914Method NeoTm1914Method; +typedef NeoEsp32Rmt1Sk6812Method NeoLc8812Method; +typedef NeoEsp32Rmt1Apa106Method NeoApa106Method; +typedef NeoEsp32Rmt1Tx1812Method NeoTx1812Method; + +typedef NeoEsp32Rmt1Ws2812xMethod Neo800KbpsMethod; +typedef NeoEsp32Rmt1400KbpsMethod Neo400KbpsMethod; + +typedef NeoEsp32Rmt1Ws2812xInvertedMethod NeoWs2813InvertedMethod; +typedef NeoEsp32Rmt1Ws2812xInvertedMethod NeoWs2812xInvertedMethod; +typedef NeoEsp32Rmt1Ws2812xInvertedMethod NeoWs2811InvertedMethod; +typedef NeoEsp32Rmt1800KbpsInvertedMethod NeoWs2812InvertedMethod; +typedef NeoEsp32Rmt1Sk6812InvertedMethod NeoSk6812InvertedMethod; +typedef NeoEsp32Rmt1Tm1814InvertedMethod NeoTm1814InvertedMethod; +typedef NeoEsp32Rmt1Tm1829InvertedMethod NeoTm1829InvertedMethod; +typedef NeoEsp32Rmt1Tm1914InvertedMethod NeoTm1914InvertedMethod; +typedef NeoEsp32Rmt1Sk6812InvertedMethod NeoLc8812InvertedMethod; +typedef NeoEsp32Rmt1Apa106InvertedMethod NeoApa106InvertedMethod; +typedef NeoEsp32Rmt1Tx1812InvertedMethod NeoTx1812InvertedMethod; + +typedef NeoEsp32Rmt1Ws2812xInvertedMethod Neo800KbpsInvertedMethod; +typedef NeoEsp32Rmt1400KbpsInvertedMethod Neo400KbpsInvertedMethod; + +#else // defined(CONFIG_IDF_TARGET_ESP32S2) || defined(CONFIG_IDF_TARGET_ESP32C3) + // RMT channel 6 method is the default method for Esp32 typedef NeoEsp32Rmt6Ws2812xMethod NeoWs2813Method; typedef NeoEsp32Rmt6Ws2812xMethod NeoWs2812xMethod; @@ -786,6 +879,7 @@ typedef NeoEsp32Rmt6Ws2812xMethod NeoWs2811Method; typedef NeoEsp32Rmt6Sk6812Method NeoSk6812Method; typedef NeoEsp32Rmt6Tm1814Method NeoTm1814Method; typedef NeoEsp32Rmt6Tm1829Method NeoTm1829Method; +typedef NeoEsp32Rmt6Tm1914Method NeoTm1914Method; typedef NeoEsp32Rmt6Sk6812Method NeoLc8812Method; typedef NeoEsp32Rmt6Apa106Method NeoApa106Method; typedef NeoEsp32Rmt6Tx1812Method NeoTx1812Method; @@ -800,45 +894,16 @@ typedef NeoEsp32Rmt6800KbpsInvertedMethod NeoWs2812InvertedMethod; typedef NeoEsp32Rmt6Sk6812InvertedMethod NeoSk6812InvertedMethod; typedef NeoEsp32Rmt6Tm1814InvertedMethod NeoTm1814InvertedMethod; typedef NeoEsp32Rmt6Tm1829InvertedMethod NeoTm1829InvertedMethod; +typedef NeoEsp32Rmt6Tm1914InvertedMethod NeoTm1914InvertedMethod; typedef NeoEsp32Rmt6Sk6812InvertedMethod NeoLc8812InvertedMethod; typedef NeoEsp32Rmt6Apa106InvertedMethod NeoApa106InvertedMethod; typedef NeoEsp32Rmt6Tx1812InvertedMethod NeoTx1812InvertedMethod; typedef NeoEsp32Rmt6Ws2812xInvertedMethod Neo800KbpsInvertedMethod; typedef NeoEsp32Rmt6400KbpsInvertedMethod Neo400KbpsInvertedMethod; -#else // !defined(CONFIG_IDF_TARGET_ESP32S2) && !defined(CONFIG_IDF_TARGET_ESP32C3) -// RMT channel 3 method is the default method for Esp32S2 & Esp32C3 -typedef NeoEsp32Rmt3Ws2812xMethod NeoWs2813Method; -typedef NeoEsp32Rmt3Ws2812xMethod NeoWs2812xMethod; -typedef NeoEsp32Rmt3800KbpsMethod NeoWs2812Method; -typedef NeoEsp32Rmt3Ws2812xMethod NeoWs2811Method; -typedef NeoEsp32Rmt3Sk6812Method NeoSk6812Method; -typedef NeoEsp32Rmt3Tm1814Method NeoTm1814Method; -typedef NeoEsp32Rmt3Tm1829Method NeoTm1829Method; -typedef NeoEsp32Rmt3Sk6812Method NeoLc8812Method; -typedef NeoEsp32Rmt3Apa106Method NeoApa106Method; -typedef NeoEsp32Rmt3Tx1812Method NeoTx1812Method; +#endif // defined(CONFIG_IDF_TARGET_ESP32S2) || defined(CONFIG_IDF_TARGET_ESP32C3) -typedef NeoEsp32Rmt3Ws2812xMethod Neo800KbpsMethod; -typedef NeoEsp32Rmt3400KbpsMethod Neo400KbpsMethod; - -typedef NeoEsp32Rmt3Ws2812xInvertedMethod NeoWs2813InvertedMethod; -typedef NeoEsp32Rmt3Ws2812xInvertedMethod NeoWs2812xInvertedMethod; -typedef NeoEsp32Rmt3Ws2812xInvertedMethod NeoWs2811InvertedMethod; -typedef NeoEsp32Rmt3800KbpsInvertedMethod NeoWs2812InvertedMethod; -typedef NeoEsp32Rmt3Sk6812InvertedMethod NeoSk6812InvertedMethod; -typedef NeoEsp32Rmt3Tm1814InvertedMethod NeoTm1814InvertedMethod; -typedef NeoEsp32Rmt3Tm1829InvertedMethod NeoTm1829InvertedMethod; -typedef NeoEsp32Rmt3Sk6812InvertedMethod NeoLc8812InvertedMethod; -typedef NeoEsp32Rmt3Apa106InvertedMethod NeoApa106InvertedMethod; -typedef NeoEsp32Rmt3Tx1812InvertedMethod NeoTx1812InvertedMethod; - -typedef NeoEsp32Rmt3Ws2812xInvertedMethod Neo800KbpsInvertedMethod; -typedef NeoEsp32Rmt3400KbpsInvertedMethod Neo400KbpsInvertedMethod; - -#endif // !defined(CONFIG_IDF_TARGET_ESP32S2) && !defined(CONFIG_IDF_TARGET_ESP32C3) - -#endif // defined(NEOPIXEL_ESP32_RMT_DEFAULT) +#endif // defined(NEOPIXEL_ESP32_RMT_DEFAULT) || defined(CONFIG_IDF_TARGET_ESP32S2) || defined(CONFIG_IDF_TARGET_ESP32C3) #endif diff --git a/lib/lib_basic/NeoPixelBus/src/internal/NeoEsp8266DmaMethod.cpp b/lib/lib_basic/NeoPixelBus/src/internal/NeoEsp8266DmaMethod.cpp new file mode 100644 index 000000000..4bfc7d340 --- /dev/null +++ b/lib/lib_basic/NeoPixelBus/src/internal/NeoEsp8266DmaMethod.cpp @@ -0,0 +1,36 @@ +/*------------------------------------------------------------------------- +NeoPixel library helper functions for Esp8266. + +Written by Michael C. Miller. + +I invest time and resources providing this open source code, +please support me by dontating (see https://github.com/Makuna/NeoPixelBus) + +------------------------------------------------------------------------- +This file is part of the Makuna/NeoPixelBus library. + +NeoPixelBus is free software: you can redistribute it and/or modify +it under the terms of the GNU Lesser General Public License as +published by the Free Software Foundation, either version 3 of +the License, or (at your option) any later version. + +NeoPixelBus 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 Lesser General Public License for more details. + +You should have received a copy of the GNU Lesser General Public +License along with NeoPixel. If not, see +. +-------------------------------------------------------------------------*/ + +#include +#include "NeoSettings.h" +#include "NeoBusChannel.h" +#include "NeoEsp8266DmaMethod.h" + +#ifdef ARDUINO_ARCH_ESP8266 + +NeoEsp8266DmaMethodCore* NeoEsp8266DmaMethodCore::s_this; + +#endif \ No newline at end of file diff --git a/lib/lib_basic/NeoPixelBus/src/internal/NeoEsp8266DmaMethod.h b/lib/lib_basic/NeoPixelBus/src/internal/NeoEsp8266DmaMethod.h index 103215655..7a8a32330 100644 --- a/lib/lib_basic/NeoPixelBus/src/internal/NeoEsp8266DmaMethod.h +++ b/lib/lib_basic/NeoPixelBus/src/internal/NeoEsp8266DmaMethod.h @@ -32,18 +32,21 @@ License along with NeoPixel. If not, see #ifdef ARDUINO_ARCH_ESP8266 +#include "Arduino.h" + extern "C" { -#include "Arduino.h" #include "osapi.h" #include "ets_sys.h" #include "i2s_reg.h" -#ifndef ARDUINO_ESP8266_RELEASE_3_0_1 -#include "i2s.h" -#else -#include "core_esp8266_i2s.h" + +#ifdef ARDUINO_ESP8266_MAJOR //this define was added in ESP8266 Arduino Core version v3.0.1 + #include "core_esp8266_i2s.h" //for Arduino core >= 3.0.1 +#else + #include "i2s.h" //for Arduino core <= 3.0.0 #endif + #include "eagle_soc.h" #include "esp8266_peri.h" #include "slc_register.h" @@ -230,7 +233,72 @@ const uint16_t c_maxDmaBlockSize = 4095; const uint16_t c_dmaBytesPerPixelBytes = 4; const uint8_t c_I2sPin = 3; // due to I2S hardware, the pin used is restricted to this -template class NeoEsp8266DmaMethodBase +class NeoEsp8266DmaMethodCore +{ +protected: + static NeoEsp8266DmaMethodCore* s_this; // for the ISR + + volatile NeoDmaState _dmaState; + + slc_queue_item* _i2sBufDesc; // dma block descriptors + uint16_t _i2sBufDescCount; // count of block descriptors in _i2sBufDesc + + + // This routine is called as soon as the DMA routine has something to tell us. All we + // handle here is the RX_EOF_INT status, which indicate the DMA has sent a buffer whose + // descriptor has the 'EOF' field set to 1. + // in the case of this code, the second to last state descriptor + static void IRAM_ATTR i2s_slc_isr(void) + { + ETS_SLC_INTR_DISABLE(); + + uint32_t slc_intr_status = SLCIS; + + SLCIC = 0xFFFFFFFF; + + if ((slc_intr_status & SLCIRXEOF) && s_this) + { + switch (s_this->_dmaState) + { + case NeoDmaState_Idle: + break; + + case NeoDmaState_Pending: + { + slc_queue_item* finished_item = (slc_queue_item*)SLCRXEDA; + + // data block has pending data waiting to send, prepare it + // point last state block to top + (finished_item + 1)->next_link_ptr = s_this->_i2sBufDesc; + + s_this->_dmaState = NeoDmaState_Sending; + } + break; + + case NeoDmaState_Sending: + { + slc_queue_item* finished_item = (slc_queue_item*)SLCRXEDA; + + // the data block had actual data sent + // point last state block to first state block thus + // just looping and not sending the data blocks + (finished_item + 1)->next_link_ptr = finished_item; + + s_this->_dmaState = NeoDmaState_Zeroing; + } + break; + + case NeoDmaState_Zeroing: + s_this->_dmaState = NeoDmaState_Idle; + break; + } + } + + ETS_SLC_INTR_ENABLE(); + } +}; + +template class NeoEsp8266DmaMethodBase : NeoEsp8266DmaMethodCore { public: typedef NeoNoSettings SettingsObject; @@ -436,8 +504,6 @@ public: } private: - static NeoEsp8266DmaMethodBase* s_this; // for the ISR - const size_t _sizeData; // Size of '_data' buffer uint8_t* _data; // Holds LED color values @@ -449,64 +515,8 @@ private: // buffer size = (24 * (reset time / 50)) / 6 uint8_t _i2sZeroes[(24L * (T_SPEED::ResetTimeUs / 50L)) / 6L]; - slc_queue_item* _i2sBufDesc; // dma block descriptors - uint16_t _i2sBufDescCount; // count of block descriptors in _i2sBufDesc uint16_t _is2BufMaxBlockSize; // max size based on size of a pixel of a single block - volatile NeoDmaState _dmaState; - - // This routine is called as soon as the DMA routine has something to tell us. All we - // handle here is the RX_EOF_INT status, which indicate the DMA has sent a buffer whose - // descriptor has the 'EOF' field set to 1. - // in the case of this code, the second to last state descriptor - static void IRAM_ATTR i2s_slc_isr(void) - { - ETS_SLC_INTR_DISABLE(); - - uint32_t slc_intr_status = SLCIS; - - SLCIC = 0xFFFFFFFF; - - if ((slc_intr_status & SLCIRXEOF) && s_this) - { - switch (s_this->_dmaState) - { - case NeoDmaState_Idle: - break; - - case NeoDmaState_Pending: - { - slc_queue_item* finished_item = (slc_queue_item*)SLCRXEDA; - - // data block has pending data waiting to send, prepare it - // point last state block to top - (finished_item + 1)->next_link_ptr = s_this->_i2sBufDesc; - - s_this->_dmaState = NeoDmaState_Sending; - } - break; - - case NeoDmaState_Sending: - { - slc_queue_item* finished_item = (slc_queue_item*)SLCRXEDA; - - // the data block had actual data sent - // point last state block to first state block thus - // just looping and not sending the data blocks - (finished_item + 1)->next_link_ptr = finished_item; - - s_this->_dmaState = NeoDmaState_Zeroing; - } - break; - - case NeoDmaState_Zeroing: - s_this->_dmaState = NeoDmaState_Idle; - break; - } - } - - ETS_SLC_INTR_ENABLE(); - } void FillBuffers() { @@ -548,23 +558,24 @@ private: }; -template -NeoEsp8266DmaMethodBase* NeoEsp8266DmaMethodBase::s_this; // normal typedef NeoEsp8266DmaMethodBase NeoEsp8266DmaWs2812xMethod; typedef NeoEsp8266DmaMethodBase NeoEsp8266DmaSk6812Method; typedef NeoEsp8266DmaMethodBase NeoEsp8266DmaTm1814Method; typedef NeoEsp8266DmaMethodBase NeoEsp8266DmaTm1829Method; +typedef NeoEsp8266DmaTm1814Method NeoEsp8266DmaTm1914Method; typedef NeoEsp8266DmaMethodBase NeoEsp8266Dma800KbpsMethod; typedef NeoEsp8266DmaMethodBase NeoEsp8266Dma400KbpsMethod; typedef NeoEsp8266DmaMethodBase NeoEsp8266DmaApa106Method; + // inverted typedef NeoEsp8266DmaMethodBase NeoEsp8266DmaInvertedWs2812xMethod; typedef NeoEsp8266DmaMethodBase NeoEsp8266DmaInvertedSk6812Method; typedef NeoEsp8266DmaMethodBase NeoEsp8266DmaInvertedTm1814Method; typedef NeoEsp8266DmaMethodBase NeoEsp8266DmaInvertedTm1829Method; +typedef NeoEsp8266DmaInvertedTm1814Method NeoEsp8266DmaInvertedTm1914Method; typedef NeoEsp8266DmaMethodBase NeoEsp8266DmaInverted800KbpsMethod; typedef NeoEsp8266DmaMethodBase NeoEsp8266DmaInverted400KbpsMethod; typedef NeoEsp8266DmaMethodBase NeoEsp8266DmaInvertedApa106Method; @@ -577,6 +588,7 @@ typedef NeoEsp8266DmaWs2812xMethod NeoWs2811Method; typedef NeoEsp8266DmaSk6812Method NeoSk6812Method; typedef NeoEsp8266DmaTm1814Method NeoTm1814Method; typedef NeoEsp8266DmaTm1829Method NeoTm1829Method; +typedef NeoEsp8266DmaTm1914Method NeoTm1914Method; typedef NeoEsp8266DmaSk6812Method NeoLc8812Method; typedef NeoEsp8266DmaApa106Method NeoApa106Method; @@ -591,6 +603,7 @@ typedef NeoEsp8266DmaInvertedWs2812xMethod NeoWs2811InvertedMethod; typedef NeoEsp8266DmaInvertedSk6812Method NeoSk6812InvertedMethod; typedef NeoEsp8266DmaInvertedTm1814Method NeoTm1814InvertedMethod; typedef NeoEsp8266DmaInvertedTm1829Method NeoTm1829InvertedMethod; +typedef NeoEsp8266DmaInvertedTm1914Method NeoTm1914InvertedMethod; typedef NeoEsp8266DmaInvertedSk6812Method NeoLc8812InvertedMethod; typedef NeoEsp8266DmaInvertedApa106Method NeoApa106InvertedMethod; diff --git a/lib/lib_basic/NeoPixelBus/src/internal/NeoEsp8266UartMethod.h b/lib/lib_basic/NeoPixelBus/src/internal/NeoEsp8266UartMethod.h index 3d57d7cdd..9ef2f4b45 100644 --- a/lib/lib_basic/NeoPixelBus/src/internal/NeoEsp8266UartMethod.h +++ b/lib/lib_basic/NeoPixelBus/src/internal/NeoEsp8266UartMethod.h @@ -429,6 +429,7 @@ typedef NeoEsp8266UartMethodBase NeoEsp32 typedef NeoEsp32BitBangWs2812xMethod NeoEsp32BitBangWs2813Method; typedef NeoEsp32BitBang800KbpsMethod NeoEsp32BitBangWs2812Method; +typedef NeoEsp32BitBangTm1814Method NeoEsp32BitBangTm1914Method; typedef NeoEsp32BitBangSk6812Method NeoEsp32BitBangLc8812Method; typedef NeoEspBitBangMethodBase NeoEsp32BitBangWs2811InvertedMethod; @@ -339,6 +340,7 @@ typedef NeoEspBitBangMethodBase NeoEsp82 typedef NeoEsp8266BitBangWs2812xMethod NeoEsp8266BitBangWs2813Method; typedef NeoEsp8266BitBang800KbpsMethod NeoEsp8266BitBangWs2812Method; +typedef NeoEsp8266BitBangTm1814Method NeoEsp8266BitBangTm1914Method; typedef NeoEsp8266BitBangSk6812Method NeoEsp8266BitBangLc8812Method; typedef NeoEspBitBangMethodBase NeoEsp8266BitBangWs2811InvertedMethod; @@ -367,6 +370,7 @@ typedef NeoEspBitBangMethodBase NeoNrf52xPw typedef NeoNrf52xMethodBase NeoNrf52xPwmNSk6812Method; typedef NeoNrf52xMethodBase NeoNrf52xPwmNTm1814Method; typedef NeoNrf52xMethodBase NeoNrf52xPwmNTm1829Method; +typedef NeoNrf52xMethodBase NeoNrf52xPwmNTm1914Method; typedef NeoNrf52xMethodBase NeoNrf52xPwmNTx1812Method; typedef NeoNrf52xMethodBase NeoNrf52xPwmNApa106Method; typedef NeoNrf52xMethodBase NeoNrf52xPwmN800KbpsMethod; @@ -509,6 +532,7 @@ typedef NeoNrf52xMethodBase NeoNrf52xPw typedef NeoNrf52xMethodBase NeoNrf52xPwm0Sk6812Method; typedef NeoNrf52xMethodBase NeoNrf52xPwm0Tm1814Method; typedef NeoNrf52xMethodBase NeoNrf52xPwm0Tm1829Method; +typedef NeoNrf52xMethodBase NeoNrf52xPwm0Tm1914Method; typedef NeoNrf52xMethodBase NeoNrf52xPwm0Tx1812Method; typedef NeoNrf52xMethodBase NeoNrf52xPwm0Apa106Method; typedef NeoNrf52xMethodBase NeoNrf52xPwm0800KbpsMethod; @@ -519,6 +543,7 @@ typedef NeoNrf52xMethodBase NeoNrf52xPw typedef NeoNrf52xMethodBase NeoNrf52xPwm1Sk6812Method; typedef NeoNrf52xMethodBase NeoNrf52xPwm1Tm1814Method; typedef NeoNrf52xMethodBase NeoNrf52xPwm1Tm1829Method; +typedef NeoNrf52xMethodBase NeoNrf52xPwm1Tm1914Method; typedef NeoNrf52xMethodBase NeoNrf52xPwm1Tx1812Method; typedef NeoNrf52xMethodBase NeoNrf52xPwm1Apa106Method; typedef NeoNrf52xMethodBase NeoNrf52xPwm1800KbpsMethod; @@ -529,6 +554,7 @@ typedef NeoNrf52xMethodBase NeoNrf52xPw typedef NeoNrf52xMethodBase NeoNrf52xPwm2Sk6812Method; typedef NeoNrf52xMethodBase NeoNrf52xPwm2Tm1814Method; typedef NeoNrf52xMethodBase NeoNrf52xPwm2Tm1829Method; +typedef NeoNrf52xMethodBase NeoNrf52xPwm2Tm1914Method; typedef NeoNrf52xMethodBase NeoNrf52xPwm2Tx1812Method; typedef NeoNrf52xMethodBase NeoNrf52xPwm2Apa106Method; typedef NeoNrf52xMethodBase NeoNrf52xPwm2800KbpsMethod; @@ -540,6 +566,7 @@ typedef NeoNrf52xMethodBase NeoNrf52xPw typedef NeoNrf52xMethodBase NeoNrf52xPwm3Sk6812Method; typedef NeoNrf52xMethodBase NeoNrf52xPwm3Tm1814Method; typedef NeoNrf52xMethodBase NeoNrf52xPwm3Tm1829Method; +typedef NeoNrf52xMethodBase NeoNrf52xPwm3Tm1914Method; typedef NeoNrf52xMethodBase NeoNrf52xPwm3Tx1812Method; typedef NeoNrf52xMethodBase NeoNrf52xPwm3Apa106Method; typedef NeoNrf52xMethodBase NeoNrf52xPwm3800KbpsMethod; @@ -552,6 +579,7 @@ typedef NeoNrf52xMethodBase Neo typedef NeoNrf52xMethodBase NeoNrf52xPwmNSk6812InvertedMethod; typedef NeoNrf52xMethodBase NeoNrf52xPwmNTm1814InvertedMethod; typedef NeoNrf52xMethodBase NeoNrf52xPwmNTm1829InvertedMethod; +typedef NeoNrf52xMethodBase NeoNrf52xPwmNTm1914InvertedMethod; typedef NeoNrf52xMethodBase NeoNrf52xPwmNTx1812InvertedMethod; typedef NeoNrf52xMethodBase NeoNrf52xPwmNApa106InvertedMethod; typedef NeoNrf52xMethodBase NeoNrf52xPwmN800KbpsInvertedMethod; @@ -562,6 +590,7 @@ typedef NeoNrf52xMethodBase Neo typedef NeoNrf52xMethodBase NeoNrf52xPwm0Sk6812InvertedMethod; typedef NeoNrf52xMethodBase NeoNrf52xPwm0Tm1814InvertedMethod; typedef NeoNrf52xMethodBase NeoNrf52xPwm0Tm1829InvertedMethod; +typedef NeoNrf52xMethodBase NeoNrf52xPwm0Tm1914InvertedMethod; typedef NeoNrf52xMethodBase NeoNrf52xPwm0Tx1812InvertedMethod; typedef NeoNrf52xMethodBase NeoNrf52xPwm0Apa106InvertedMethod; typedef NeoNrf52xMethodBase NeoNrf52xPwm0800KbpsInvertedMethod; @@ -572,6 +601,7 @@ typedef NeoNrf52xMethodBase Neo typedef NeoNrf52xMethodBase NeoNrf52xPwm1Sk6812InvertedMethod; typedef NeoNrf52xMethodBase NeoNrf52xPwm1Tm1814InvertedMethod; typedef NeoNrf52xMethodBase NeoNrf52xPwm1Tm1829InvertedMethod; +typedef NeoNrf52xMethodBase NeoNrf52xPwm1Tm1914InvertedMethod; typedef NeoNrf52xMethodBase NeoNrf52xPwm1Tx1812InvertedMethod; typedef NeoNrf52xMethodBase NeoNrf52xPwm1Apa106InvertedMethod; typedef NeoNrf52xMethodBase NeoNrf52xPwm1800KbpsInvertedMethod; @@ -582,6 +612,7 @@ typedef NeoNrf52xMethodBase Neo typedef NeoNrf52xMethodBase NeoNrf52xPwm2Sk6812InvertedMethod; typedef NeoNrf52xMethodBase NeoNrf52xPwm2Tm1814InvertedMethod; typedef NeoNrf52xMethodBase NeoNrf52xPwm2Tm1829InvertedMethod; +typedef NeoNrf52xMethodBase NeoNrf52xPwm2Tm1914InvertedMethod; typedef NeoNrf52xMethodBase NeoNrf52xPwm2Tx1812InvertedMethod; typedef NeoNrf52xMethodBase NeoNrf52xPwm2Apa106InvertedMethod; typedef NeoNrf52xMethodBase NeoNrf52xPwm2800KbpsInvertedMethod; @@ -593,6 +624,7 @@ typedef NeoNrf52xMethodBase Neo typedef NeoNrf52xMethodBase NeoNrf52xPwm3Sk6812InvertedMethod; typedef NeoNrf52xMethodBase NeoNrf52xPwm3Tm1814InvertedMethod; typedef NeoNrf52xMethodBase NeoNrf52xPwm3Tm1829InvertedMethod; +typedef NeoNrf52xMethodBase NeoNrf52xPwm3Tm1914InvertedMethod; typedef NeoNrf52xMethodBase NeoNrf52xPwm3Tx1812InvertedMethod; typedef NeoNrf52xMethodBase NeoNrf52xPwm3Apa106InvertedMethod; typedef NeoNrf52xMethodBase NeoNrf52xPwm3800KbpsInvertedMethod; @@ -607,6 +639,7 @@ typedef NeoNrf52xPwm2Ws2812xMethod NeoWs2811Method; typedef NeoNrf52xPwm2Sk6812Method NeoSk6812Method; typedef NeoNrf52xPwm2Tm1814Method NeoTm1814Method; typedef NeoNrf52xPwm2Tm1829Method NeoTm1829Method; +typedef NeoNrf52xPwm2Tm1914Method NeoTm1914Method; typedef NeoNrf52xPwm2Tx1812Method NeoTx1812Method; typedef NeoNrf52xPwm2Sk6812Method NeoLc8812Method; typedef NeoNrf52xPwm2Apa106Method NeoApa106Method; @@ -621,6 +654,7 @@ typedef NeoNrf52xPwm2800KbpsInvertedMethod NeoWs2812InvertedMethod; typedef NeoNrf52xPwm2Sk6812InvertedMethod NeoSk6812InvertedMethod; typedef NeoNrf52xPwm2Tm1814InvertedMethod NeoTm1814InvertedMethod; typedef NeoNrf52xPwm2Tm1829InvertedMethod NeoTm1829InvertedMethod; +typedef NeoNrf52xPwm2Tm1914InvertedMethod NeoTm1914InvertedMethod; typedef NeoNrf52xPwm2Tx1812InvertedMethod NeoTx1812InvertedMethod; typedef NeoNrf52xPwm2Sk6812InvertedMethod NeoLc8812InvertedMethod; typedef NeoNrf52xPwm2Apa106InvertedMethod NeoApa106InvertedMethod; diff --git a/lib/lib_basic/NeoPixelBus/src/internal/NeoRingTopology.h b/lib/lib_basic/NeoPixelBus/src/internal/NeoRingTopology.h index e598fa462..7255a97e3 100644 --- a/lib/lib_basic/NeoPixelBus/src/internal/NeoRingTopology.h +++ b/lib/lib_basic/NeoPixelBus/src/internal/NeoRingTopology.h @@ -29,7 +29,7 @@ License along with NeoPixel. If not, see . -------------------------------------------------------------------------*/ -template class NeoRingTopology : protected T_LAYOUT +template class NeoRingTopology : public T_LAYOUT { public: NeoRingTopology() @@ -85,7 +85,7 @@ public: uint8_t getCountOfRings() const { - return _ringCount() - 1; // minus one as the Rings includes the extra value + return T_LAYOUT::_ringCount() - 1; // minus one as the Rings includes the extra value } uint16_t getPixelCountAtRing(uint8_t ring) const @@ -100,7 +100,7 @@ public: uint16_t getPixelCount() const { - return T_LAYOUT::Rings[_ringCount() - 1]; // the last entry is the total count + return T_LAYOUT::Rings[T_LAYOUT::_ringCount() - 1]; // the last entry is the total count } private: @@ -109,8 +109,4 @@ private: return T_LAYOUT::Rings[ring] + pixel; } - uint8_t _ringCount() const - { - return sizeof(T_LAYOUT::Rings) / sizeof(T_LAYOUT::Rings[0]); - } }; diff --git a/lib/lib_basic/NeoPixelBus/src/internal/NeoTm1814ColorFeatures.h b/lib/lib_basic/NeoPixelBus/src/internal/NeoTm1814ColorFeatures.h index bc5035f9f..00d0dfa37 100644 --- a/lib/lib_basic/NeoPixelBus/src/internal/NeoTm1814ColorFeatures.h +++ b/lib/lib_basic/NeoPixelBus/src/internal/NeoTm1814ColorFeatures.h @@ -83,7 +83,7 @@ public: static const uint8_t* pixels(const uint8_t* pData) { - return pData; + return pData + SettingsSize; } }; diff --git a/lib/lib_basic/NeoPixelBus/src/internal/NeoTm1914ColorFeatures.h b/lib/lib_basic/NeoPixelBus/src/internal/NeoTm1914ColorFeatures.h new file mode 100644 index 000000000..52bc03d18 --- /dev/null +++ b/lib/lib_basic/NeoPixelBus/src/internal/NeoTm1914ColorFeatures.h @@ -0,0 +1,174 @@ +/*------------------------------------------------------------------------- +NeoTm1914ColorFeatures provides feature classes to describe color order and +color depth for NeoPixelBus template class specific to the TM1914 chip + +Written by Michael C. Miller. + +I invest time and resources providing this open source code, +please support me by dontating (see https://github.com/Makuna/NeoPixelBus) + +------------------------------------------------------------------------- +This file is part of the Makuna/NeoPixelBus library. + +NeoPixelBus is free software: you can redistribute it and/or modify +it under the terms of the GNU Lesser General Public License as +published by the Free Software Foundation, either version 3 of +the License, or (at your option) any later version. + +NeoPixelBus 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 Lesser General Public License for more details. + +You should have received a copy of the GNU Lesser General Public +License along with NeoPixel. If not, see +. +-------------------------------------------------------------------------*/ +#pragma once + +enum NeoTm1914_Mode +{ + NeoTm1914_Mode_DinFdinAutoSwitch, // Switches between DIN and FDIN on any signal pause > 300ms + NeoTm1914_Mode_DinOnly, // DIN input pin used exclusively + NeoTm1914_Mode_FdinOnly // FDIN input pin used exclusively +}; + +class NeoTm1914Settings +{ +public: + NeoTm1914Settings(NeoTm1914_Mode mode = NeoTm1914_Mode_DinOnly) : + Mode(mode) + { + } + + NeoTm1914_Mode Mode; +}; + +class Neo3ElementsTm1914Settings : public Neo3Elements +{ +public: + typedef NeoTm1914Settings SettingsObject; + static const size_t SettingsSize = 6; + + static void applySettings(uint8_t* pData, const SettingsObject& settings) + { + uint8_t* pSet = pData; + uint8_t mode = 0xff; + + // C1 - the mode + *pSet++ = 0xff; + *pSet++ = 0xff; + + switch (settings.Mode) + { + case NeoTm1914_Mode_DinFdinAutoSwitch: + mode = 0xff; + break; + + case NeoTm1914_Mode_FdinOnly: + mode = 0xfa; + break; + + case NeoTm1914_Mode_DinOnly: + default: + mode = 0xf5; + break; + } + *pSet++ = mode; + + // C2 - ones compliment of the above + uint8_t* pC1 = pData; + for (uint8_t elem = 0; elem < 3; elem++) + { + *pSet++ = ~(*pC1++); + } + } + + static uint8_t* pixels(uint8_t* pData) + { + return pData + SettingsSize; + } + + static const uint8_t* pixels(const uint8_t* pData) + { + return pData + SettingsSize; + } +}; + + +class NeoRgbTm1914Feature : public Neo3ElementsTm1914Settings +{ +public: + static void applyPixelColor(uint8_t* pPixels, uint16_t indexPixel, ColorObject color) + { + uint8_t* p = getPixelAddress(pPixels, indexPixel); + + *p++ = color.R; + *p++ = color.G; + *p = color.B; + } + + static ColorObject retrievePixelColor(const uint8_t* pPixels, uint16_t indexPixel) + { + ColorObject color; + const uint8_t* p = getPixelAddress(pPixels, indexPixel); + + color.R = *p++; + color.G = *p++; + color.B = *p; + + return color; + } + + static ColorObject retrievePixelColor_P(PGM_VOID_P pPixels, uint16_t indexPixel) + { + ColorObject color; + const uint8_t* p = getPixelAddress((const uint8_t*)pPixels, indexPixel); + + color.R = pgm_read_byte(p++); + color.G = pgm_read_byte(p++); + color.B = pgm_read_byte(p); + + return color; + } + +}; + + +class NeoGrbTm1914Feature : public Neo3ElementsTm1914Settings +{ +public: + static void applyPixelColor(uint8_t* pPixels, uint16_t indexPixel, ColorObject color) + { + uint8_t* p = getPixelAddress(pPixels, indexPixel); + + *p++ = color.G; + *p++ = color.R; + *p = color.B; + } + + static ColorObject retrievePixelColor(const uint8_t* pPixels, uint16_t indexPixel) + { + ColorObject color; + const uint8_t* p = getPixelAddress(pPixels, indexPixel); + + color.G = *p++; + color.R = *p++; + color.B = *p; + + return color; + } + + static ColorObject retrievePixelColor_P(PGM_VOID_P pPixels, uint16_t indexPixel) + { + ColorObject color; + const uint8_t* p = getPixelAddress((const uint8_t*)pPixels, indexPixel); + + color.G = pgm_read_byte(p++); + color.R = pgm_read_byte(p++); + color.B = pgm_read_byte(p); + + return color; + } + +}; \ No newline at end of file diff --git a/lib/lib_div/lib_mail/src/ESP_Mail_FS.h b/lib/lib_div/lib_mail/src/ESP_Mail_FS.h index 973a33492..0e9007fcb 100644 --- a/lib/lib_div/lib_mail/src/ESP_Mail_FS.h +++ b/lib/lib_div/lib_mail/src/ESP_Mail_FS.h @@ -19,15 +19,8 @@ */ // #define ESP_Mail_DEFAULT_FLASH_FS SPIFFS -#ifdef ESP8266 - #include - #define ESP_Mail_DEFAULT_FLASH_FS LittleFS -#endif - -#ifdef ESP32 - #include - #define ESP_Mail_DEFAULT_FLASH_FS LITTLEFS -#endif +#include +#define ESP_Mail_DEFAULT_FLASH_FS LittleFS /** * To use SD card file systems with different hardware interface diff --git a/lib/libesp32/Berry/default/be_aes_gcm_lib.c b/lib/libesp32/Berry/default/be_aes_gcm_lib.c new file mode 100644 index 000000000..3276cdd05 --- /dev/null +++ b/lib/libesp32/Berry/default/be_aes_gcm_lib.c @@ -0,0 +1,44 @@ +/******************************************************************** + * Berry module `webserver` + * + * To use: `import webserver` + * + * Allows to respond to HTTP request + *******************************************************************/ +#include "be_constobj.h" + +#ifdef USE_ALEXA_AVS + +extern int m_aes_gcm_init(bvm *vm); +extern int m_aes_gcm_encryt(bvm *vm); +extern int m_aes_gcm_decryt(bvm *vm); +extern int m_aes_gcm_tag(bvm *vm); + +#if BE_USE_PRECOMPILED_OBJECT +#include "../generate/be_fixed_be_class_aes_gcm.h" +#endif + +void be_load_aes_gcm_lib(bvm *vm) { + // insert the class GCM in module AES + be_newmodule(vm); + be_setname(vm, -1, "AES"); + be_setglobal(vm, "AES"); + + be_pushntvclass(vm, &be_class_aes_gcm); + be_setmember(vm, -2, "GCM"); + be_pop(vm, 2); +} +/* @const_object_info_begin + +class be_class_aes_gcm (scope: global, name: GCM) { + .p1, var + .p2, var + + init, func(m_aes_gcm_init) + encrypt, func(m_aes_gcm_encryt) + decrypt, func(m_aes_gcm_decryt) + tag, func(m_aes_gcm_tag) +} +@const_object_info_end */ + +#endif // USE_ALEXA_AVS diff --git a/lib/libesp32/Berry/default/be_driverlib.c b/lib/libesp32/Berry/default/be_driverlib.c index e8ff3a74c..6035a8736 100644 --- a/lib/libesp32/Berry/default/be_driverlib.c +++ b/lib/libesp32/Berry/default/be_driverlib.c @@ -7,169 +7,143 @@ #include "be_constobj.h" /******************************************************************** - class Driver2 : Driver - var every_second - var every_100ms - var web_add_handler - var web_add_button - var web_add_main_button - var web_add_management_button - var web_add_config_button - var web_add_console_button - var save_before_restart - var web_sensor - var json_append - var button_pressed - var display - - def get_tasmota() - import global - return global.tasmota - end - - def add_cmd(c, f) - var tasmota = self.get_tasmota() - tasmota.add_cmd(c, / cmd, idx, payload, payload_json -> f(self, cmd, idx, payload, payload_json)) - end - end +** Solidified function: init ********************************************************************/ +be_local_closure(init, /* name */ + be_nested_proto( + 1, /* nstack */ + 1, /* argc */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 0, /* has constants */ + NULL, /* no const */ + (be_nested_const_str("init", 380752755, 4)), + (be_nested_const_str("input", -103256197, 5)), + ( &(const binstruction[ 1]) { /* code */ + 0x80000000, // 0000 RET 0 R0 + }) + ) +); +/*******************************************************************/ + /******************************************************************** ** Solidified function: get_tasmota ********************************************************************/ be_local_closure(get_tasmota, /* name */ be_nested_proto( - 3, /* nstack */ + 2, /* nstack */ 1, /* argc */ 0, /* has upvals */ NULL, /* no upvals */ 0, /* has sup protos */ NULL, /* no sub protos */ 1, /* has constants */ - ( &(const bvalue[ 2]) { /* upvals */ - { { .s=be_nested_const_str("global", 503252654, 6) }, BE_STRING}, - { { .s=be_nested_const_str("tasmota", 424643812, 7) }, BE_STRING}, + ( &(const bvalue[ 1]) { /* constants */ + be_nested_string("tasmota", 424643812, 7), /* R256 - K0 */ }), (be_nested_const_str("get_tasmota", 334356779, 11)), - (be_nested_const_str("stdin", -1529146723, 5)), - ( &(const binstruction[ 3]) { /* code */ - 0xA4060000, // 0000 IMPORT R1 R256 - 0x88080301, // 0001 GETMBR R2 R1 R257 - 0x80040400, // 0002 RET 1 R2 + (be_nested_const_str("input", -103256197, 5)), + ( &(const binstruction[ 2]) { /* code */ + 0xB8060000, // 0000 GETNGBL R1 R256 + 0x80040200, // 0001 RET 1 R1 }) ) ); /*******************************************************************/ + /******************************************************************** ** Solidified function: add_cmd ********************************************************************/ be_local_closure(add_cmd, /* name */ be_nested_proto( - 8, /* nstack */ + 7, /* nstack */ 3, /* argc */ 0, /* has upvals */ NULL, /* no upvals */ 1, /* has sup protos */ - be_nested_proto( - 10, /* nstack */ - 4, /* argc */ - 1, /* has upvals */ - ( &(const bupvaldesc[ 2]) { /* upvals */ - be_local_const_upval(1, 2), - be_local_const_upval(1, 0), - }), - 0, /* has sup protos */ - NULL, /* no sub protos */ - 0, /* has constants */ - NULL, /* no const */ - (be_nested_const_str("", 607256038, 8)), - (be_nested_const_str("stdin", -1529146723, 5)), - ( &(const binstruction[ 8]) { /* code */ - 0x68100000, // 0000 GETUPV R4 U0 - 0x68140001, // 0001 GETUPV R5 U1 - 0x5C180000, // 0002 MOVE R6 R0 - 0x5C1C0200, // 0003 MOVE R7 R1 - 0x5C200400, // 0004 MOVE R8 R2 - 0x5C240600, // 0005 MOVE R9 R3 - 0x7C100A00, // 0006 CALL R4 5 - 0x80040800, // 0007 RET 1 R4 - }) - ), + ( &(const struct bproto*[ 1]) { + be_nested_proto( + 10, /* nstack */ + 4, /* argc */ + 1, /* has upvals */ + ( &(const bupvaldesc[ 2]) { /* upvals */ + be_local_const_upval(1, 2), + be_local_const_upval(1, 0), + }), + 0, /* has sup protos */ + NULL, /* no sub protos */ + 0, /* has constants */ + NULL, /* no const */ + (be_nested_const_str("", 607256038, 8)), + (be_nested_const_str("input", -103256197, 5)), + ( &(const binstruction[ 8]) { /* code */ + 0x68100000, // 0000 GETUPV R4 U0 + 0x68140001, // 0001 GETUPV R5 U1 + 0x5C180000, // 0002 MOVE R6 R0 + 0x5C1C0200, // 0003 MOVE R7 R1 + 0x5C200400, // 0004 MOVE R8 R2 + 0x5C240600, // 0005 MOVE R9 R3 + 0x7C100A00, // 0006 CALL R4 5 + 0x80040800, // 0007 RET 1 R4 + }) + ), + }), 1, /* has constants */ - ( &(const bvalue[ 2]) { /* upvals */ - { { .s=be_nested_const_str("get_tasmota", 334356779, 11) }, BE_STRING}, - { { .s=be_nested_const_str("add_cmd", -933336417, 7) }, BE_STRING}, + ( &(const bvalue[ 2]) { /* constants */ + be_nested_string("tasmota", 424643812, 7), /* R256 - K0 */ + be_nested_string("add_cmd", -933336417, 7), /* R257 - K1 */ }), (be_nested_const_str("add_cmd", -933336417, 7)), - (be_nested_const_str("stdin", -1529146723, 5)), - ( &(const binstruction[ 8]) { /* code */ - 0x8C0C0100, // 0000 GETMET R3 R0 R256 - 0x7C0C0200, // 0001 CALL R3 1 - 0x8C100701, // 0002 GETMET R4 R3 R257 - 0x5C180200, // 0003 MOVE R6 R1 - 0x841C0000, // 0004 CLOSURE R7 P0 - 0x7C100600, // 0005 CALL R4 3 - 0xA0000000, // 0006 CLOSE 0 - 0x80000000, // 0007 RET 0 R0 + (be_nested_const_str("input", -103256197, 5)), + ( &(const binstruction[ 7]) { /* code */ + 0xB80E0000, // 0000 GETNGBL R3 R256 + 0x8C0C0701, // 0001 GETMET R3 R3 R257 + 0x5C140200, // 0002 MOVE R5 R1 + 0x84180000, // 0003 CLOSURE R6 P0 + 0x7C0C0600, // 0004 CALL R3 3 + 0xA0000000, // 0005 CLOSE 0 + 0x80000000, // 0006 RET 0 R0 }) ) ); /*******************************************************************/ -#if BE_USE_PRECOMPILED_OBJECT -#include "../generate/be_fixed_be_class_tasmota_driver.h" -#endif -void be_load_driverlib(bvm *vm) { -#if !BE_USE_PRECOMPILED_OBJECT - static const bnfuncinfo members[] = { - { "every_second", NULL }, - { "every_100ms", NULL }, - { "web_add_handler", NULL }, - { "web_add_button", NULL }, - { "web_add_main_button", NULL }, - { "web_add_management_button", NULL }, - { "web_add_config_button", NULL }, - { "web_add_console_button", NULL }, - { "save_before_restart", NULL }, - { "web_sensor", NULL }, - { "json_append", NULL }, - { "button_pressed", NULL }, - { "display", NULL }, +/******************************************************************** +** Solidified class: Driver +********************************************************************/ +be_local_class(Driver, + 13, + NULL, + be_nested_map(16, + ( (struct bmapnode*) &(const bmapnode[]) { + { be_nested_key("web_add_main_button", -334599632, 19, 14), be_const_index(4) }, + { be_nested_key("web_add_console_button", -813531104, 22, -1), be_const_index(7) }, + { be_nested_key("web_add_management_button", -1556090110, 25, 8), be_const_index(5) }, + { be_nested_key("init", 380752755, 4, -1), be_const_closure(init_closure) }, + { be_nested_key("json_append", -1292948012, 11, -1), be_const_index(10) }, + { be_nested_key("web_add_config_button", 639674325, 21, 7), be_const_index(6) }, + { be_nested_key("every_100ms", 1546407804, 11, -1), be_const_index(1) }, + { be_nested_key("display", 1164572437, 7, -1), be_const_index(12) }, + { be_nested_key("web_add_button", -757092238, 14, 13), be_const_index(3) }, + { be_nested_key("every_second", 2075451465, 12, -1), be_const_index(0) }, + { be_nested_key("save_before_restart", 1253239338, 19, -1), be_const_index(8) }, + { be_nested_key("get_tasmota", 334356779, 11, -1), be_const_closure(get_tasmota_closure) }, + { be_nested_key("web_sensor", -1394870324, 10, 6), be_const_index(9) }, + { be_nested_key("web_add_handler", -304792334, 15, -1), be_const_index(2) }, + { be_nested_key("button_pressed", 1694209616, 14, 1), be_const_index(11) }, + { be_nested_key("add_cmd", -933336417, 7, -1), be_const_closure(add_cmd_closure) }, + })), + (be_nested_const_str("Driver", -718580993, 6)) +); +/*******************************************************************/ - { NULL, (bntvfunc) BE_CLOSURE }, /* mark section for berry closures */ - { "get_tasmota", (bntvfunc) &get_tasmota_closure }, - { "add_cmd", (bntvfunc) &add_cmd_closure }, - - { NULL, NULL } - }; - be_regclass(vm, "Driver", members); -#else - be_pushntvclass(vm, &be_class_tasmota_driver); +void be_load_Driver_class(bvm *vm) { + be_pushntvclass(vm, &be_class_Driver); be_setglobal(vm, "Driver"); be_pop(vm, 1); -#endif } -/* @const_object_info_begin - -class be_class_tasmota_driver (scope: global, name: Driver) { - every_second, var - every_100ms, var - web_add_handler, var - web_add_button, var - web_add_main_button, var - web_add_management_button, var - web_add_config_button, var - web_add_console_button, var - save_before_restart, var - web_sensor, var - json_append, var - button_pressed, var - display, var - - get_tasmota, closure(get_tasmota_closure) - - add_cmd, closure(add_cmd_closure) -} -@const_object_info_end */ diff --git a/lib/libesp32/Berry/default/be_gpio_lib.c b/lib/libesp32/Berry/default/be_gpio_lib.c index d2c9bf8db..045fbd23e 100644 --- a/lib/libesp32/Berry/default/be_gpio_lib.c +++ b/lib/libesp32/Berry/default/be_gpio_lib.c @@ -275,7 +275,18 @@ be_native_module_attr_table(gpio) { be_native_module_int("HALLEFFECT", 237), be_native_module_int("EPD_DATA", 238), be_native_module_int("INPUT", 239), - be_native_module_int("SENSOR_END", 240), + be_native_module_int("KEY1_PD", 240), + be_native_module_int("KEY1_INV_PD", 241), + be_native_module_int("SWT1_PD", 242), + be_native_module_int("I2S_OUT_DATA", 243), + be_native_module_int("I2S_OUT_CLK", 244), + be_native_module_int("I2S_OUT_SLCT", 245), + be_native_module_int("I2S_IN_DATA", 246), + be_native_module_int("I2S_IN_CLK", 247), + be_native_module_int("I2S_IN_SLCT", 248), + be_native_module_int("INTERRUPT", 249), + + be_native_module_int("SENSOR_END", 250), be_native_module_function("pin_mode", gp_pin_mode), be_native_module_function("digital_write", gp_digital_write), @@ -546,7 +557,18 @@ module gpio (scope: global) { HALLEFFECT, int(237) EPD_DATA, int(238) INPUT, int(239) - SENSOR_END, int(240) + 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) pin_mode, func(gp_pin_mode) digital_write, func(gp_digital_write) diff --git a/lib/libesp32/Berry/default/be_i2c_driverlib.c b/lib/libesp32/Berry/default/be_i2c_driverlib.c index 2f9faf038..4fe868dae 100644 --- a/lib/libesp32/Berry/default/be_i2c_driverlib.c +++ b/lib/libesp32/Berry/default/be_i2c_driverlib.c @@ -9,384 +9,375 @@ *******************************************************************/ #include "be_constobj.h" -extern bclass* be_class_tasmota_driver; // Parent class +extern bclass* be_class_Driver; // Parent class /******************************************************************** ** Solidified function: init ********************************************************************/ - -/********** Solidified proto: init */ -be_define_local_const_str(init_str_name, "init", 380752755, 4); -be_define_local_const_str(init_str_source, "input", -103256197, 5); -be_define_local_const_str(init_str_0, "get_tasmota", 334356779, 11); -be_define_local_const_str(init_str_1, "i2c_enabled", 218388101, 11); -be_define_local_const_str(init_str_2, "addr", 1087856498, 4); -be_define_local_const_str(init_str_3, "wire", -212213352, 4); -be_define_local_const_str(init_str_4, "wire_scan", -1623691416, 9); -be_define_local_const_str(init_str_5, "function", -1630125495, 8); -be_define_local_const_str(init_str_6, "name", -1925595674, 4); -be_define_local_const_str(init_str_7, "I2C:", 813483371, 4); -be_define_local_const_str(init_str_8, "detected on bus", 1432002650, 15); -be_define_local_const_str(init_str_9, "bus", 1607822841, 3); - -static const bvalue init_ktab[10] = { - { { .s=be_local_const_str(init_str_0) }, BE_STRING}, - { { .s=be_local_const_str(init_str_1) }, BE_STRING}, - { { .s=be_local_const_str(init_str_2) }, BE_STRING}, - { { .s=be_local_const_str(init_str_3) }, BE_STRING}, - { { .s=be_local_const_str(init_str_4) }, BE_STRING}, - { { .s=be_local_const_str(init_str_5) }, BE_STRING}, - { { .s=be_local_const_str(init_str_6) }, BE_STRING}, - { { .s=be_local_const_str(init_str_7) }, BE_STRING}, - { { .s=be_local_const_str(init_str_8) }, BE_STRING}, - { { .s=be_local_const_str(init_str_9) }, BE_STRING}, -}; - -static const uint32_t init_code[44] = { - 0x8C100100, // 0000 GETMET R4 R0 R256 - 0x7C100200, // 0001 CALL R4 1 - 0x4C140000, // 0002 LDNIL 5 - 0x20140605, // 0003 NE R5 R3 R5 - 0x78160004, // 0004 JMPF R5 #000A - 0x8C140901, // 0005 GETMET R5 R4 R257 - 0x5C1C0600, // 0006 MOVE R7 R3 - 0x7C140400, // 0007 CALL R5 2 - 0x74160000, // 0008 JMPT R5 #000A - 0x80000A00, // 0009 RET 0 R5 - 0x90020402, // 000A SETMBR R0 R258 R2 - 0x8C140904, // 000B GETMET R5 R4 R260 - 0x881C0102, // 000C GETMBR R7 R0 R258 - 0x7C140400, // 000D CALL R5 2 - 0x90020605, // 000E SETMBR R0 R259 R5 - 0x88140103, // 000F GETMBR R5 R0 R259 - 0x78160019, // 0010 JMPF R5 #002B - 0x60140015, // 0011 GETGBL R5 G21 - 0x5C180200, // 0012 MOVE R6 R1 - 0x7C140200, // 0013 CALL R5 1 - 0x1C140B05, // 0014 EQ R5 R5 R261 - 0x78160004, // 0015 JMPF R5 #001B - 0x5C140200, // 0016 MOVE R5 R1 - 0x5C180000, // 0017 MOVE R6 R0 - 0x7C140200, // 0018 CALL R5 1 - 0x90020C05, // 0019 SETMBR R0 R262 R5 - 0x70020000, // 001A JMP #001C - 0x90020C01, // 001B SETMBR R0 R262 R1 - 0x88140106, // 001C GETMBR R5 R0 R262 - 0x4C180000, // 001D LDNIL 6 - 0x1C140A06, // 001E EQ R5 R5 R6 - 0x78160001, // 001F JMPF R5 #0022 - 0x4C140000, // 0020 LDNIL 5 - 0x90020605, // 0021 SETMBR R0 R259 R5 - 0x88140103, // 0022 GETMBR R5 R0 R259 - 0x78160006, // 0023 JMPF R5 #002B - 0x6014000F, // 0024 GETGBL R5 G15 - 0x58180007, // 0025 LDCONST R6 K7 - 0x881C0106, // 0026 GETMBR R7 R0 R262 - 0x58200008, // 0027 LDCONST R8 K8 - 0x88240103, // 0028 GETMBR R9 R0 R259 - 0x88241309, // 0029 GETMBR R9 R9 R265 - 0x7C140800, // 002A CALL R5 4 - 0x80000000, // 002B RET 0 R0 -}; - -be_define_local_proto(init, 10, 4, 1, 0, 0); -be_define_local_closure(init); - +be_local_closure(init, /* name */ + be_nested_proto( + 10, /* nstack */ + 4, /* argc */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[10]) { /* constants */ + be_nested_string("get_tasmota", 334356779, 11), + be_nested_string("i2c_enabled", 218388101, 11), + be_nested_string("addr", 1087856498, 4), + be_nested_string("wire", -212213352, 4), + be_nested_string("wire_scan", -1623691416, 9), + be_nested_string("function", -1630125495, 8), + be_nested_string("name", -1925595674, 4), + be_nested_string("I2C:", 813483371, 4), + be_nested_string("detected on bus", 1432002650, 15), + be_nested_string("bus", 1607822841, 3), + }), + (be_nested_const_str("init", 380752755, 4)), + (be_nested_const_str("input", -103256197, 5)), + ( &(const binstruction[44]) { /* code */ + 0x8C100100, // 0000 GETMET R4 R0 R256 + 0x7C100200, // 0001 CALL R4 1 + 0x4C140000, // 0002 LDNIL 5 + 0x20140605, // 0003 NE R5 R3 R5 + 0x78160004, // 0004 JMPF R5 #000A + 0x8C140901, // 0005 GETMET R5 R4 R257 + 0x5C1C0600, // 0006 MOVE R7 R3 + 0x7C140400, // 0007 CALL R5 2 + 0x74160000, // 0008 JMPT R5 #000A + 0x80000A00, // 0009 RET 0 R5 + 0x90020402, // 000A SETMBR R0 R258 R2 + 0x8C140904, // 000B GETMET R5 R4 R260 + 0x881C0102, // 000C GETMBR R7 R0 R258 + 0x7C140400, // 000D CALL R5 2 + 0x90020605, // 000E SETMBR R0 R259 R5 + 0x88140103, // 000F GETMBR R5 R0 R259 + 0x78160019, // 0010 JMPF R5 #002B + 0x60140015, // 0011 GETGBL R5 G21 + 0x5C180200, // 0012 MOVE R6 R1 + 0x7C140200, // 0013 CALL R5 1 + 0x1C140B05, // 0014 EQ R5 R5 R261 + 0x78160004, // 0015 JMPF R5 #001B + 0x5C140200, // 0016 MOVE R5 R1 + 0x5C180000, // 0017 MOVE R6 R0 + 0x7C140200, // 0018 CALL R5 1 + 0x90020C05, // 0019 SETMBR R0 R262 R5 + 0x70020000, // 001A JMP #001C + 0x90020C01, // 001B SETMBR R0 R262 R1 + 0x88140106, // 001C GETMBR R5 R0 R262 + 0x4C180000, // 001D LDNIL 6 + 0x1C140A06, // 001E EQ R5 R5 R6 + 0x78160001, // 001F JMPF R5 #0022 + 0x4C140000, // 0020 LDNIL 5 + 0x90020605, // 0021 SETMBR R0 R259 R5 + 0x88140103, // 0022 GETMBR R5 R0 R259 + 0x78160006, // 0023 JMPF R5 #002B + 0x6014000F, // 0024 GETGBL R5 G15 + 0x58180007, // 0025 LDCONST R6 K7 + 0x881C0106, // 0026 GETMBR R7 R0 R262 + 0x58200008, // 0027 LDCONST R8 K8 + 0x88240103, // 0028 GETMBR R9 R0 R259 + 0x88241309, // 0029 GETMBR R9 R9 R265 + 0x7C140800, // 002A CALL R5 4 + 0x80000000, // 002B RET 0 R0 + }) + ) +); /*******************************************************************/ /******************************************************************** ** Solidified function: write8 ********************************************************************/ - -/********** Solidified proto: write8 */ -be_define_local_const_str(write8_str_name, "write8", -1160975764, 6); -be_define_local_const_str(write8_str_source, "input", -103256197, 5); -be_define_local_const_str(write8_str_0, "wire", -212213352, 4); -be_define_local_const_str(write8_str_1, "write", -1104765092, 5); -be_define_local_const_str(write8_str_2, "addr", 1087856498, 4); - -static const bvalue write8_ktab[4] = { - { { .s=be_local_const_str(write8_str_0) }, BE_STRING}, - { { .s=be_local_const_str(write8_str_1) }, BE_STRING}, - { { .s=be_local_const_str(write8_str_2) }, BE_STRING}, - { { .i=1 }, BE_INT}, -}; - -static const uint32_t write8_code[8] = { - 0x880C0100, // 0000 GETMBR R3 R0 R256 - 0x8C0C0701, // 0001 GETMET R3 R3 R257 - 0x88140102, // 0002 GETMBR R5 R0 R258 - 0x5C180200, // 0003 MOVE R6 R1 - 0x5C1C0400, // 0004 MOVE R7 R2 - 0x58200003, // 0005 LDCONST R8 K3 - 0x7C0C0A00, // 0006 CALL R3 5 - 0x80040600, // 0007 RET 1 R3 -}; - -be_define_local_proto(write8, 9, 3, 1, 0, 0); -be_define_local_closure(write8); - +be_local_closure(write8, /* name */ + be_nested_proto( + 9, /* nstack */ + 3, /* argc */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[ 4]) { /* constants */ + be_nested_string("wire", -212213352, 4), + be_nested_string("write", -1104765092, 5), + be_nested_string("addr", 1087856498, 4), + be_const_int(1), + }), + (be_nested_const_str("write8", -1160975764, 6)), + (be_nested_const_str("input", -103256197, 5)), + ( &(const binstruction[ 8]) { /* code */ + 0x880C0100, // 0000 GETMBR R3 R0 R256 + 0x8C0C0701, // 0001 GETMET R3 R3 R257 + 0x88140102, // 0002 GETMBR R5 R0 R258 + 0x5C180200, // 0003 MOVE R6 R1 + 0x5C1C0400, // 0004 MOVE R7 R2 + 0x58200003, // 0005 LDCONST R8 K3 + 0x7C0C0A00, // 0006 CALL R3 5 + 0x80040600, // 0007 RET 1 R3 + }) + ) +); /*******************************************************************/ /******************************************************************** ** Solidified function: write_bit ********************************************************************/ - -/********** Solidified proto: write_bit */ -be_define_local_const_str(write_bit_str_name, "write_bit", -1633976860, 9); -be_define_local_const_str(write_bit_str_source, "input", -103256197, 5); -be_define_local_const_str(write_bit_str_2, "write8", -1160975764, 6); -be_define_local_const_str(write_bit_str_3, "read8", -1492179129, 5); - -static const bvalue write_bit_ktab[4] = { - { { .i=0 }, BE_INT}, - { { .i=1 }, BE_INT}, - { { .s=be_local_const_str(write_bit_str_2) }, BE_STRING}, - { { .s=be_local_const_str(write_bit_str_3) }, BE_STRING}, -}; - -static const uint32_t write_bit_code[26] = { - 0x14100500, // 0000 LT R4 R2 R256 - 0x74120002, // 0001 JMPT R4 #0005 - 0x54120006, // 0002 LDINT R4 7 - 0x24100404, // 0003 GT R4 R2 R4 - 0x78120000, // 0004 JMPF R4 #0006 - 0x80000800, // 0005 RET 0 R4 - 0x38120202, // 0006 SHL R4 R257 R2 - 0x780E0007, // 0007 JMPF R3 #0010 - 0x8C140102, // 0008 GETMET R5 R0 R258 - 0x5C1C0200, // 0009 MOVE R7 R1 - 0x8C200103, // 000A GETMET R8 R0 R259 - 0x5C280200, // 000B MOVE R10 R1 - 0x7C200400, // 000C CALL R8 2 - 0x30201004, // 000D OR R8 R8 R4 - 0x7C140600, // 000E CALL R5 3 - 0x70020008, // 000F JMP #0019 - 0x8C140102, // 0010 GETMET R5 R0 R258 - 0x5C1C0200, // 0011 MOVE R7 R1 - 0x8C200103, // 0012 GETMET R8 R0 R259 - 0x5C280200, // 0013 MOVE R10 R1 - 0x7C200400, // 0014 CALL R8 2 - 0x542600FE, // 0015 LDINT R9 255 - 0x4241204, // 0016 SUB R9 R9 R4 - 0x2C201009, // 0017 AND R8 R8 R9 - 0x7C140600, // 0018 CALL R5 3 - 0x80000000, // 0019 RET 0 R0 -}; - -be_define_local_proto(write_bit, 11, 4, 1, 0, 0); -be_define_local_closure(write_bit); - +be_local_closure(write_bit, /* name */ + be_nested_proto( + 11, /* nstack */ + 4, /* argc */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[ 4]) { /* constants */ + be_const_int(0), + be_const_int(1), + be_nested_string("write8", -1160975764, 6), + be_nested_string("read8", -1492179129, 5), + }), + (be_nested_const_str("write_bit", -1633976860, 9)), + (be_nested_const_str("input", -103256197, 5)), + ( &(const binstruction[26]) { /* code */ + 0x14100500, // 0000 LT R4 R2 R256 + 0x74120002, // 0001 JMPT R4 #0005 + 0x54120006, // 0002 LDINT R4 7 + 0x24100404, // 0003 GT R4 R2 R4 + 0x78120000, // 0004 JMPF R4 #0006 + 0x80000800, // 0005 RET 0 R4 + 0x38120202, // 0006 SHL R4 R257 R2 + 0x780E0007, // 0007 JMPF R3 #0010 + 0x8C140102, // 0008 GETMET R5 R0 R258 + 0x5C1C0200, // 0009 MOVE R7 R1 + 0x8C200103, // 000A GETMET R8 R0 R259 + 0x5C280200, // 000B MOVE R10 R1 + 0x7C200400, // 000C CALL R8 2 + 0x30201004, // 000D OR R8 R8 R4 + 0x7C140600, // 000E CALL R5 3 + 0x70020008, // 000F JMP #0019 + 0x8C140102, // 0010 GETMET R5 R0 R258 + 0x5C1C0200, // 0011 MOVE R7 R1 + 0x8C200103, // 0012 GETMET R8 R0 R259 + 0x5C280200, // 0013 MOVE R10 R1 + 0x7C200400, // 0014 CALL R8 2 + 0x542600FE, // 0015 LDINT R9 255 + 0x04241204, // 0016 SUB R9 R9 R4 + 0x2C201009, // 0017 AND R8 R8 R9 + 0x7C140600, // 0018 CALL R5 3 + 0x80000000, // 0019 RET 0 R0 + }) + ) +); /*******************************************************************/ - /******************************************************************** ** Solidified function: read8 ********************************************************************/ - -/********** Solidified proto: read8 */ -be_define_local_const_str(read8_str_name, "read8", -1492179129, 5); -be_define_local_const_str(read8_str_source, "input", -103256197, 5); -be_define_local_const_str(read8_str_0, "wire", -212213352, 4); -be_define_local_const_str(read8_str_1, "read", -824204347, 4); -be_define_local_const_str(read8_str_2, "addr", 1087856498, 4); - -static const bvalue read8_ktab[4] = { - { { .s=be_local_const_str(read8_str_0) }, BE_STRING}, - { { .s=be_local_const_str(read8_str_1) }, BE_STRING}, - { { .s=be_local_const_str(read8_str_2) }, BE_STRING}, - { { .i=1 }, BE_INT}, -}; - -static const uint32_t read8_code[7] = { - 0x88080100, // 0000 GETMBR R2 R0 R256 - 0x8C080501, // 0001 GETMET R2 R2 R257 - 0x88100102, // 0002 GETMBR R4 R0 R258 - 0x5C140200, // 0003 MOVE R5 R1 - 0x58180003, // 0004 LDCONST R6 K3 - 0x7C080800, // 0005 CALL R2 4 - 0x80040400, // 0006 RET 1 R2 -}; - -be_define_local_proto(read8, 7, 2, 1, 0, 0); -be_define_local_closure(read8); - +be_local_closure(read8, /* name */ + be_nested_proto( + 7, /* nstack */ + 2, /* argc */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[ 4]) { /* constants */ + be_nested_string("wire", -212213352, 4), + be_nested_string("read", -824204347, 4), + be_nested_string("addr", 1087856498, 4), + be_const_int(1), + }), + (be_nested_const_str("read8", -1492179129, 5)), + (be_nested_const_str("input", -103256197, 5)), + ( &(const binstruction[ 7]) { /* code */ + 0x88080100, // 0000 GETMBR R2 R0 R256 + 0x8C080501, // 0001 GETMET R2 R2 R257 + 0x88100102, // 0002 GETMBR R4 R0 R258 + 0x5C140200, // 0003 MOVE R5 R1 + 0x58180003, // 0004 LDCONST R6 K3 + 0x7C080800, // 0005 CALL R2 4 + 0x80040400, // 0006 RET 1 R2 + }) + ) +); /*******************************************************************/ /******************************************************************** ** Solidified function: read12 ********************************************************************/ - -/********** Solidified proto: read12 */ -be_define_local_const_str(read12_str_name, "read12", -3890326, 6); -be_define_local_const_str(read12_str_source, "input", -103256197, 5); -be_define_local_const_str(read12_str_0, "wire", -212213352, 4); -be_define_local_const_str(read12_str_1, "read_bytes", -718234123, 10); -be_define_local_const_str(read12_str_2, "addr", 1087856498, 4); - -static const bvalue read12_ktab[6] = { - { { .s=be_local_const_str(read12_str_0) }, BE_STRING}, - { { .s=be_local_const_str(read12_str_1) }, BE_STRING}, - { { .s=be_local_const_str(read12_str_2) }, BE_STRING}, - { { .i=2 }, BE_INT}, - { { .i=0 }, BE_INT}, - { { .i=1 }, BE_INT}, -}; - -static const uint32_t read12_code[12] = { - 0x88080100, // 0000 GETMBR R2 R0 R256 - 0x8C080501, // 0001 GETMET R2 R2 R257 - 0x88100102, // 0002 GETMBR R4 R0 R258 - 0x5C140200, // 0003 MOVE R5 R1 - 0x58180003, // 0004 LDCONST R6 K3 - 0x7C080800, // 0005 CALL R2 4 - 0x940C0504, // 0006 GETIDX R3 R2 R260 - 0x54120003, // 0007 LDINT R4 4 - 0x380C0604, // 0008 SHL R3 R3 R4 - 0x94100505, // 0009 GETIDX R4 R2 R261 - 0xC0604, // 000A ADD R3 R3 R4 - 0x80040600, // 000B RET 1 R3 -}; - -be_define_local_proto(read12, 7, 2, 1, 0, 0); -be_define_local_closure(read12); - +be_local_closure(read12, /* name */ + be_nested_proto( + 7, /* nstack */ + 2, /* argc */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[ 6]) { /* constants */ + be_nested_string("wire", -212213352, 4), + be_nested_string("read_bytes", -718234123, 10), + be_nested_string("addr", 1087856498, 4), + be_const_int(2), + be_const_int(0), + be_const_int(1), + }), + (be_nested_const_str("read12", -3890326, 6)), + (be_nested_const_str("input", -103256197, 5)), + ( &(const binstruction[12]) { /* code */ + 0x88080100, // 0000 GETMBR R2 R0 R256 + 0x8C080501, // 0001 GETMET R2 R2 R257 + 0x88100102, // 0002 GETMBR R4 R0 R258 + 0x5C140200, // 0003 MOVE R5 R1 + 0x58180003, // 0004 LDCONST R6 K3 + 0x7C080800, // 0005 CALL R2 4 + 0x940C0504, // 0006 GETIDX R3 R2 R260 + 0x54120003, // 0007 LDINT R4 4 + 0x380C0604, // 0008 SHL R3 R3 R4 + 0x94100505, // 0009 GETIDX R4 R2 R261 + 0x000C0604, // 000A ADD R3 R3 R4 + 0x80040600, // 000B RET 1 R3 + }) + ) +); /*******************************************************************/ - /******************************************************************** ** Solidified function: read13 ********************************************************************/ - -/********** Solidified proto: read13 */ -be_define_local_const_str(read13_str_name, "read13", 12887293, 6); -be_define_local_const_str(read13_str_source, "input", -103256197, 5); -be_define_local_const_str(read13_str_0, "wire", -212213352, 4); -be_define_local_const_str(read13_str_1, "read_bytes", -718234123, 10); -be_define_local_const_str(read13_str_2, "addr", 1087856498, 4); - -static const bvalue read13_ktab[6] = { - { { .s=be_local_const_str(read13_str_0) }, BE_STRING}, - { { .s=be_local_const_str(read13_str_1) }, BE_STRING}, - { { .s=be_local_const_str(read13_str_2) }, BE_STRING}, - { { .i=2 }, BE_INT}, - { { .i=0 }, BE_INT}, - { { .i=1 }, BE_INT}, -}; - -static const uint32_t read13_code[12] = { - 0x88080100, // 0000 GETMBR R2 R0 R256 - 0x8C080501, // 0001 GETMET R2 R2 R257 - 0x88100102, // 0002 GETMBR R4 R0 R258 - 0x5C140200, // 0003 MOVE R5 R1 - 0x58180003, // 0004 LDCONST R6 K3 - 0x7C080800, // 0005 CALL R2 4 - 0x940C0504, // 0006 GETIDX R3 R2 R260 - 0x54120004, // 0007 LDINT R4 5 - 0x380C0604, // 0008 SHL R3 R3 R4 - 0x94100505, // 0009 GETIDX R4 R2 R261 - 0xC0604, // 000A ADD R3 R3 R4 - 0x80040600, // 000B RET 1 R3 -}; - -be_define_local_proto(read13, 7, 2, 1, 0, 0); -be_define_local_closure(read13); - +be_local_closure(read13, /* name */ + be_nested_proto( + 7, /* nstack */ + 2, /* argc */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[ 6]) { /* constants */ + be_nested_string("wire", -212213352, 4), + be_nested_string("read_bytes", -718234123, 10), + be_nested_string("addr", 1087856498, 4), + be_const_int(2), + be_const_int(0), + be_const_int(1), + }), + (be_nested_const_str("read13", 12887293, 6)), + (be_nested_const_str("input", -103256197, 5)), + ( &(const binstruction[12]) { /* code */ + 0x88080100, // 0000 GETMBR R2 R0 R256 + 0x8C080501, // 0001 GETMET R2 R2 R257 + 0x88100102, // 0002 GETMBR R4 R0 R258 + 0x5C140200, // 0003 MOVE R5 R1 + 0x58180003, // 0004 LDCONST R6 K3 + 0x7C080800, // 0005 CALL R2 4 + 0x940C0504, // 0006 GETIDX R3 R2 R260 + 0x54120004, // 0007 LDINT R4 5 + 0x380C0604, // 0008 SHL R3 R3 R4 + 0x94100505, // 0009 GETIDX R4 R2 R261 + 0x000C0604, // 000A ADD R3 R3 R4 + 0x80040600, // 000B RET 1 R3 + }) + ) +); /*******************************************************************/ - /******************************************************************** ** Solidified function: read24 ********************************************************************/ - -/********** Solidified proto: read24 */ -be_define_local_const_str(read24_str_name, "read24", 1808533811, 6); -be_define_local_const_str(read24_str_source, "input", -103256197, 5); -be_define_local_const_str(read24_str_0, "wire", -212213352, 4); -be_define_local_const_str(read24_str_1, "read_bytes", -718234123, 10); -be_define_local_const_str(read24_str_2, "addr", 1087856498, 4); - -static const bvalue read24_ktab[7] = { - { { .s=be_local_const_str(read24_str_0) }, BE_STRING}, - { { .s=be_local_const_str(read24_str_1) }, BE_STRING}, - { { .s=be_local_const_str(read24_str_2) }, BE_STRING}, - { { .i=3 }, BE_INT}, - { { .i=0 }, BE_INT}, - { { .i=1 }, BE_INT}, - { { .i=2 }, BE_INT}, -}; - -static const uint32_t read24_code[16] = { - 0x88080100, // 0000 GETMBR R2 R0 R256 - 0x8C080501, // 0001 GETMET R2 R2 R257 - 0x88100102, // 0002 GETMBR R4 R0 R258 - 0x5C140200, // 0003 MOVE R5 R1 - 0x58180003, // 0004 LDCONST R6 K3 - 0x7C080800, // 0005 CALL R2 4 - 0x940C0504, // 0006 GETIDX R3 R2 R260 - 0x5412000F, // 0007 LDINT R4 16 - 0x380C0604, // 0008 SHL R3 R3 R4 - 0x94100505, // 0009 GETIDX R4 R2 R261 - 0x54160007, // 000A LDINT R5 8 - 0x38100805, // 000B SHL R4 R4 R5 - 0xC0604, // 000C ADD R3 R3 R4 - 0x94100506, // 000D GETIDX R4 R2 R262 - 0xC0604, // 000E ADD R3 R3 R4 - 0x80040600, // 000F RET 1 R3 -}; - -be_define_local_proto(read24, 7, 2, 1, 0, 0); -be_define_local_closure(read24); - +be_local_closure(read24, /* name */ + be_nested_proto( + 7, /* nstack */ + 2, /* argc */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[ 7]) { /* constants */ + be_nested_string("wire", -212213352, 4), + be_nested_string("read_bytes", -718234123, 10), + be_nested_string("addr", 1087856498, 4), + be_const_int(3), + be_const_int(0), + be_const_int(1), + be_const_int(2), + }), + (be_nested_const_str("read24", 1808533811, 6)), + (be_nested_const_str("input", -103256197, 5)), + ( &(const binstruction[16]) { /* code */ + 0x88080100, // 0000 GETMBR R2 R0 R256 + 0x8C080501, // 0001 GETMET R2 R2 R257 + 0x88100102, // 0002 GETMBR R4 R0 R258 + 0x5C140200, // 0003 MOVE R5 R1 + 0x58180003, // 0004 LDCONST R6 K3 + 0x7C080800, // 0005 CALL R2 4 + 0x940C0504, // 0006 GETIDX R3 R2 R260 + 0x5412000F, // 0007 LDINT R4 16 + 0x380C0604, // 0008 SHL R3 R3 R4 + 0x94100505, // 0009 GETIDX R4 R2 R261 + 0x54160007, // 000A LDINT R5 8 + 0x38100805, // 000B SHL R4 R4 R5 + 0x000C0604, // 000C ADD R3 R3 R4 + 0x94100506, // 000D GETIDX R4 R2 R262 + 0x000C0604, // 000E ADD R3 R3 R4 + 0x80040600, // 000F RET 1 R3 + }) + ) +); /*******************************************************************/ /******************************************************************** ** Solidified function: read32 ********************************************************************/ - -/********** Solidified proto: read32 */ -be_define_local_const_str(read32_str_name, "read32", 1741276240, 6); -be_define_local_const_str(read32_str_source, "input", -103256197, 5); -be_define_local_const_str(read32_str_0, "wire", -212213352, 4); -be_define_local_const_str(read32_str_1, "read_bytes", -718234123, 10); -be_define_local_const_str(read32_str_2, "addr", 1087856498, 4); - -static const bvalue read32_ktab[7] = { - { { .s=be_local_const_str(read32_str_0) }, BE_STRING}, - { { .s=be_local_const_str(read32_str_1) }, BE_STRING}, - { { .s=be_local_const_str(read32_str_2) }, BE_STRING}, - { { .i=0 }, BE_INT}, - { { .i=1 }, BE_INT}, - { { .i=2 }, BE_INT}, - { { .i=3 }, BE_INT}, -}; - -static const uint32_t read32_code[20] = { - 0x88080100, // 0000 GETMBR R2 R0 R256 - 0x8C080501, // 0001 GETMET R2 R2 R257 - 0x88100102, // 0002 GETMBR R4 R0 R258 - 0x5C140200, // 0003 MOVE R5 R1 - 0x541A0003, // 0004 LDINT R6 4 - 0x7C080800, // 0005 CALL R2 4 - 0x940C0503, // 0006 GETIDX R3 R2 R259 - 0x54120017, // 0007 LDINT R4 24 - 0x380C0604, // 0008 SHL R3 R3 R4 - 0x94100504, // 0009 GETIDX R4 R2 R260 - 0x5416000F, // 000A LDINT R5 16 - 0x38100805, // 000B SHL R4 R4 R5 - 0xC0604, // 000C ADD R3 R3 R4 - 0x94100505, // 000D GETIDX R4 R2 R261 - 0x54160007, // 000E LDINT R5 8 - 0x38100805, // 000F SHL R4 R4 R5 - 0xC0604, // 0010 ADD R3 R3 R4 - 0x94100506, // 0011 GETIDX R4 R2 R262 - 0xC0604, // 0012 ADD R3 R3 R4 - 0x80040600, // 0013 RET 1 R3 -}; - -be_define_local_proto(read32, 7, 2, 1, 0, 0); -be_define_local_closure(read32); - +be_local_closure(read32, /* name */ + be_nested_proto( + 7, /* nstack */ + 2, /* argc */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[ 7]) { /* constants */ + be_nested_string("wire", -212213352, 4), + be_nested_string("read_bytes", -718234123, 10), + be_nested_string("addr", 1087856498, 4), + be_const_int(0), + be_const_int(1), + be_const_int(2), + be_const_int(3), + }), + (be_nested_const_str("read32", 1741276240, 6)), + (be_nested_const_str("input", -103256197, 5)), + ( &(const binstruction[20]) { /* code */ + 0x88080100, // 0000 GETMBR R2 R0 R256 + 0x8C080501, // 0001 GETMET R2 R2 R257 + 0x88100102, // 0002 GETMBR R4 R0 R258 + 0x5C140200, // 0003 MOVE R5 R1 + 0x541A0003, // 0004 LDINT R6 4 + 0x7C080800, // 0005 CALL R2 4 + 0x940C0503, // 0006 GETIDX R3 R2 R259 + 0x54120017, // 0007 LDINT R4 24 + 0x380C0604, // 0008 SHL R3 R3 R4 + 0x94100504, // 0009 GETIDX R4 R2 R260 + 0x5416000F, // 000A LDINT R5 16 + 0x38100805, // 000B SHL R4 R4 R5 + 0x000C0604, // 000C ADD R3 R3 R4 + 0x94100505, // 000D GETIDX R4 R2 R261 + 0x54160007, // 000E LDINT R5 8 + 0x38100805, // 000F SHL R4 R4 R5 + 0x000C0604, // 0010 ADD R3 R3 R4 + 0x94100506, // 0011 GETIDX R4 R2 R262 + 0x000C0604, // 0012 ADD R3 R3 R4 + 0x80040600, // 0013 RET 1 R3 + }) + ) +); /*******************************************************************/ @@ -427,7 +418,7 @@ void be_load_driver_i2c_lib(bvm *vm) { } /* @const_object_info_begin -class be_class_tasmota_i2c_driver (scope: global, name: I2C_Driver, super: be_class_tasmota_driver) { +class be_class_tasmota_i2c_driver (scope: global, name: I2C_Driver, super: be_class_Driver) { wire, var addr, var name, var diff --git a/lib/libesp32/Berry/default/be_i2s_audio_lib.c b/lib/libesp32/Berry/default/be_i2s_audio_lib.c new file mode 100644 index 000000000..888cb2d42 --- /dev/null +++ b/lib/libesp32/Berry/default/be_i2s_audio_lib.c @@ -0,0 +1,115 @@ +/******************************************************************** + * Tasmota I2S audio classes + * + * + *******************************************************************/ +#include "be_constobj.h" + +#ifdef USE_I2S +#ifdef USE_I2S_AUDIO_BERRY + +extern int i2s_output_i2s_init(bvm *vm); +extern int i2s_output_i2s_deinit(bvm *vm); +extern int i2s_output_i2s_stop(bvm *vm); + +extern int i2s_generator_wav_init(bvm *vm); +extern int i2s_generator_wav_deinit(bvm *vm); +extern int i2s_generator_wav_begin(bvm *vm); +extern int i2s_generator_wav_loop(bvm *vm); +extern int i2s_generator_wav_stop(bvm *vm); +extern int i2s_generator_wav_isrunning(bvm *vm); + +extern int i2s_generator_mp3_init(bvm *vm); +extern int i2s_generator_mp3_deinit(bvm *vm); +extern int i2s_generator_mp3_begin(bvm *vm); +extern int i2s_generator_mp3_loop(bvm *vm); +extern int i2s_generator_mp3_stop(bvm *vm); +extern int i2s_generator_mp3_isrunning(bvm *vm); + +#ifdef USE_UFILESYS +extern int i2s_file_source_fs_init(bvm *vm); +extern int i2s_file_source_fs_deinit(bvm *vm); +#endif // USE_UFILESYS + + +#if BE_USE_PRECOMPILED_OBJECT +#include "../generate/be_fixed_be_class_audio_output.h" +#include "../generate/be_fixed_be_class_audio_output_i2s.h" +#include "../generate/be_fixed_be_class_audio_generator.h" +#include "../generate/be_fixed_be_class_audio_generator_wav.h" +#include "../generate/be_fixed_be_class_audio_generator_mp3.h" +#include "../generate/be_fixed_be_class_audio_file_source.h" +#include "../generate/be_fixed_be_class_audio_file_source_fs.h" +#endif + +void be_load_driver_audio_lib(bvm *vm) { + be_pushntvclass(vm, &be_class_audio_output); + be_setglobal(vm, "AudioOutput"); + be_pop(vm, 1); + + be_pushntvclass(vm, &be_class_audio_output_i2s); + be_setglobal(vm, "AudioOutputI2S"); + be_pop(vm, 1); + + be_pushntvclass(vm, &be_class_audio_generator_wav); + be_setglobal(vm, "AudioGeneratorWAV"); + be_pop(vm, 1); + + be_pushntvclass(vm, &be_class_audio_generator_mp3); + be_setglobal(vm, "AudioGeneratorMP3"); + be_pop(vm, 1); + +#ifdef USE_UFILESYS + be_pushntvclass(vm, &be_class_audio_file_source_fs); + be_setglobal(vm, "AudioFileSourceFS"); + be_pop(vm, 1); +#endif // USE_UFILESYS +} + +/* @const_object_info_begin + +class be_class_audio_output (scope: global, name: AudioOutput) { + .p, var +} + +class be_class_audio_generator (scope: global, name: AudioGenerator) { + .p, var +} + +class be_class_audio_file_source (scope: global, name: AudioFileSource) { + .p, var +} + +class be_class_audio_output_i2s (scope: global, name: AudioOutputI2S, super: be_class_audio_output) { + init, func(i2s_output_i2s_init) + deinit, func(i2s_output_i2s_deinit) + stop, func(i2s_output_i2s_stop) +} + +class be_class_audio_generator_wav (scope: global, name: AudioGeneratorWAV, super: be_class_audio_generator) { + init, func(i2s_generator_wav_init) + deinit, func(i2s_generator_wav_deinit) + begin, func(i2s_generator_wav_begin) + loop, func(i2s_generator_wav_loop) + stop, func(i2s_generator_wav_stop) + isrunning, func(i2s_generator_wav_isrunning) +} + +class be_class_audio_generator_mp3 (scope: global, name: AudioGeneratorMP3, super: be_class_audio_generator) { + init, func(i2s_generator_mp3_init) + deinit, func(i2s_generator_mp3_deinit) + begin, func(i2s_generator_mp3_begin) + loop, func(i2s_generator_mp3_loop) + stop, func(i2s_generator_mp3_stop) + isrunning, func(i2s_generator_mp3_isrunning) +} + +class be_class_audio_file_source_fs (scope: global, name: AudioFileSourceFS, super: be_class_audio_file_source) { + init, func(i2s_file_source_fs_init) + deinit, func(i2s_file_source_fs_deinit) +} + +@const_object_info_end */ + +#endif // USE_I2S_AUDIO_BERRY +#endif // USE_I2S \ No newline at end of file diff --git a/lib/libesp32/Berry/default/be_lv_lvgl_module.c b/lib/libesp32/Berry/default/be_lv_lvgl_module.c index 0e5db42fc..4785b3621 100644 --- a/lib/libesp32/Berry/default/be_lv_lvgl_module.c +++ b/lib/libesp32/Berry/default/be_lv_lvgl_module.c @@ -34,6 +34,7 @@ static int lv_get_ver_res(void) { /* `lv` methods */ const lvbe_call_c_t lv_func[] = { + { "color_mix", (void*) &lv_color_mix, "lv_color", "(lv_color)(lv_color)i" }, { "draw_arc", (void*) &lv_draw_arc, "", "iiiii(lv_area)(lv_draw_line_dsc)" }, { "draw_img", (void*) &lv_draw_img, "", "(lv_area)(lv_area).(lv_draw_img_dsc)" }, { "draw_img_dsc_init", (void*) &lv_draw_img_dsc_init, "", "(lv_draw_img_dsc)" }, @@ -45,8 +46,8 @@ const lvbe_call_c_t lv_func[] = { { "draw_mask_angle_init", (void*) &lv_draw_mask_angle_init, "", "(lv_draw_mask_angle_param)iiii" }, { "draw_mask_fade_init", (void*) &lv_draw_mask_fade_init, "", "(lv_draw_mask_fade_param)(lv_area)iiii" }, { "draw_mask_get_cnt", (void*) &lv_draw_mask_get_cnt, "i", "" }, - { "draw_mask_line_angle_init", (void*) &lv_draw_mask_line_angle_init, "", "(lv_draw_mask_line_param)iii(lv_draw_mask_line_side)" }, - { "draw_mask_line_points_init", (void*) &lv_draw_mask_line_points_init, "", "(lv_draw_mask_line_param)iiii(lv_draw_mask_line_side)" }, + { "draw_mask_line_angle_init", (void*) &lv_draw_mask_line_angle_init, "", "(lv_draw_mask_line_param)iiii" }, + { "draw_mask_line_points_init", (void*) &lv_draw_mask_line_points_init, "", "(lv_draw_mask_line_param)iiiii" }, { "draw_mask_map_init", (void*) &lv_draw_mask_map_init, "", "(lv_draw_mask_map_param)(lv_area)(lv_opa)" }, { "draw_mask_radius_init", (void*) &lv_draw_mask_radius_init, "", "(lv_draw_mask_radius_param)(lv_area)ib" }, { "draw_mask_remove_custom", (void*) &lv_draw_mask_remove_custom, ".", "." }, @@ -54,6 +55,7 @@ const lvbe_call_c_t lv_func[] = { { "draw_polygon", (void*) &lv_draw_polygon, "", "ii(lv_area)(lv_draw_rect_dsc)" }, { "draw_px", (void*) &lv_draw_px, "", "(lv_point)(lv_area)(lv_style)" }, { "draw_rect", (void*) &lv_draw_rect, "", "(lv_area)(lv_area)(lv_draw_rect_dsc)" }, + { "draw_rect_dsc_init", (void*) &lv_draw_rect_dsc_init, "", "(lv_draw_rect_dsc)" }, { "draw_triangle", (void*) &lv_draw_triangle, "", "i(lv_area)(lv_draw_rect_dsc)" }, { "event_get_data", (void*) &lv_event_get_data, ".", "" }, { "event_send", (void*) &lv_event_send, "i", "(lv_obj)i." }, @@ -63,6 +65,7 @@ const lvbe_call_c_t lv_func[] = { { "get_ver_res", (void*) &lv_get_ver_res, "i", "" }, { "layer_sys", (void*) &lv_layer_sys, "lv_obj", "" }, { "layer_top", (void*) &lv_layer_top, "lv_obj", "" }, + { "refr_now", (void*) &lv_refr_now, "", "" }, { "scr_act", (void*) &lv_scr_act, "lv_obj", "" }, { "scr_load", (void*) &lv_scr_load, "", "(lv_obj)" }, { "scr_load_anim", (void*) &lv_scr_load_anim, "", "(lv_obj)(lv_scr_load_anim)iib" }, @@ -171,6 +174,13 @@ const be_constint_t lv0_constants[] = { { "CPICKER_TYPE_DISC", LV_CPICKER_TYPE_DISC }, { "CPICKER_TYPE_RECT", LV_CPICKER_TYPE_RECT }, { "CYAN", 65535 }, + { "DESIGN_COVER_CHK", LV_DESIGN_COVER_CHK }, + { "DESIGN_DRAW_MAIN", LV_DESIGN_DRAW_MAIN }, + { "DESIGN_DRAW_POST", LV_DESIGN_DRAW_POST }, + { "DESIGN_RES_COVER", LV_DESIGN_RES_COVER }, + { "DESIGN_RES_MASKED", LV_DESIGN_RES_MASKED }, + { "DESIGN_RES_NOT_COVER", LV_DESIGN_RES_NOT_COVER }, + { "DESIGN_RES_OK", LV_DESIGN_RES_OK }, { "DISP_ROT_180", LV_DISP_ROT_180 }, { "DISP_ROT_270", LV_DISP_ROT_270 }, { "DISP_ROT_90", LV_DISP_ROT_90 }, @@ -257,6 +267,21 @@ const be_constint_t lv0_constants[] = { { "GRAD_DIR_VER", LV_GRAD_DIR_VER }, { "GRAY", 8421504 }, { "GREEN", 32768 }, + { "IMG_CF_ALPHA_1BIT", LV_IMG_CF_ALPHA_1BIT }, + { "IMG_CF_ALPHA_2BIT", LV_IMG_CF_ALPHA_2BIT }, + { "IMG_CF_ALPHA_4BIT", LV_IMG_CF_ALPHA_4BIT }, + { "IMG_CF_ALPHA_8BIT", LV_IMG_CF_ALPHA_8BIT }, + { "IMG_CF_INDEXED_1BIT", LV_IMG_CF_INDEXED_1BIT }, + { "IMG_CF_INDEXED_2BIT", LV_IMG_CF_INDEXED_2BIT }, + { "IMG_CF_INDEXED_4BIT", LV_IMG_CF_INDEXED_4BIT }, + { "IMG_CF_INDEXED_8BIT", LV_IMG_CF_INDEXED_8BIT }, + { "IMG_CF_RAW", LV_IMG_CF_RAW }, + { "IMG_CF_RAW_ALPHA", LV_IMG_CF_RAW_ALPHA }, + { "IMG_CF_RAW_CHROMA_KEYED", LV_IMG_CF_RAW_CHROMA_KEYED }, + { "IMG_CF_TRUE_COLOR", LV_IMG_CF_TRUE_COLOR }, + { "IMG_CF_TRUE_COLOR_ALPHA", LV_IMG_CF_TRUE_COLOR_ALPHA }, + { "IMG_CF_TRUE_COLOR_CHROMA_KEYED", LV_IMG_CF_TRUE_COLOR_CHROMA_KEYED }, + { "IMG_CF_UNKNOWN", LV_IMG_CF_UNKNOWN }, { "INDEV_STATE_PR", LV_INDEV_STATE_PR }, { "INDEV_STATE_REL", LV_INDEV_STATE_REL }, { "KEYBOARD_MODE_NUM", LV_KEYBOARD_MODE_NUM }, @@ -345,6 +370,7 @@ const be_constint_t lv0_constants[] = { { "PROTECT_POS", LV_PROTECT_POS }, { "PROTECT_PRESS_LOST", LV_PROTECT_PRESS_LOST }, { "PURPLE", 8388736 }, + { "RADIUS_CIRCLE", 32767 }, { "RED", 16711680 }, { "ROLLER_MODE_INFINITE", LV_ROLLER_MODE_INFINITE }, { "ROLLER_MODE_NORMAL", LV_ROLLER_MODE_NORMAL }, diff --git a/lib/libesp32/Berry/default/be_lvgl_color_lib.c b/lib/libesp32/Berry/default/be_lvgl_color_lib.c index d76fd8ced..27eabbbd1 100644 --- a/lib/libesp32/Berry/default/be_lvgl_color_lib.c +++ b/lib/libesp32/Berry/default/be_lvgl_color_lib.c @@ -9,6 +9,7 @@ extern int lco_init(bvm *vm); // generic function extern int lco_tostring(bvm *vm); // generic function +extern int lco_toint(bvm *vm); // generic function #if BE_USE_PRECOMPILED_OBJECT @@ -21,6 +22,7 @@ void be_load_lvgl_color_lib(bvm *vm) { { ".p", NULL }, // keeping track of styles to avoid GC { "init", lco_init }, { "tostring", lco_tostring }, + { "toint", lco_toint }, // { NULL, (bntvfunc) BE_CLOSURE }, /* mark section for berry closures */ @@ -39,6 +41,7 @@ class be_class_lv_color (scope: global, name: lv_color) { .p, var init, func(lco_init) tostring, func(lco_tostring) + toint, func(lco_toint) } @const_object_info_end */ diff --git a/lib/libesp32/Berry/default/be_lvgl_ctypes.c b/lib/libesp32/Berry/default/be_lvgl_ctypes.c index a3b50440d..a8932a39f 100644 --- a/lib/libesp32/Berry/default/be_lvgl_ctypes.c +++ b/lib/libesp32/Berry/default/be_lvgl_ctypes.c @@ -38,7 +38,6 @@ int32_t bin_search_ctypes(const char * needle, const void * table, size_t elt_si enum { - ctypes_i32 = 14, ctypes_i16 = 12, ctypes_i8 = 11, @@ -62,7 +61,8 @@ typedef struct be_ctypes_structure_item_t { uint16_t offset_bytes; uint8_t offset_bits : 3; uint8_t len_bits : 5; - int8_t type; + int8_t type : 5; + uint8_t mapping : 3; } be_ctypes_structure_item_t; typedef struct be_ctypes_structure_t { @@ -78,6 +78,7 @@ typedef struct be_ctypes_class_t { typedef struct be_ctypes_classes_t { uint16_t size; + const char **instance_mapping; /* array of instance class names for automatic instanciation of class */ const be_ctypes_class_t * classes; } be_ctypes_classes_t; @@ -176,7 +177,7 @@ int be_ctypes_member(bvm *vm) { be_pushint(vm, member->len_bits); be_call(vm, 3); be_pop(vm, 3); - be_return(vm); + // int result at top of stack } else { // general int support int size = member->type; // eventually 1/2/4, positive if little endian, negative if big endian @@ -196,8 +197,28 @@ int be_ctypes_member(bvm *vm) { be_pushint(vm, size); be_call(vm, 3); be_pop(vm, 3); - be_return(vm); + // int result at top of stack } + // the int result is at top of the stack + // check if we need an instance mapping + if (member->mapping > 0) { + // find the name of the class + + // get global array of classes from global variable '.ctypes_classes' + be_getglobal(vm, ".ctypes_classes"); + const be_ctypes_classes_t * be_ctypes_classes = (const be_ctypes_classes_t *) be_tocomptr(vm, -1); + be_pop(vm, 1); + + const char * mapping_name = be_ctypes_classes->instance_mapping[member->mapping - 1]; + if (mapping_name) { + be_getglobal(vm, mapping_name); // stack: class + be_pushvalue(vm, -2); // stack: class, value + be_pushint(vm, -1); // stack; class, value, -1 + be_call(vm, 2); // call constructor with 2 parameters + be_pop(vm, 2); // leave new instance on top of stack + } + } + be_return(vm); } be_return_nil(vm); @@ -209,6 +230,22 @@ int be_ctypes_member(bvm *vm) { // 3: value int be_ctypes_setmember(bvm *vm) { int argc = be_top(vm); + + // If the value is an instance, we call 'toint()' and replace the value + if (be_isinstance(vm, 3)) { + + be_getmember(vm, 3, "toint"); + if (!be_isnil(vm, -1)) { + be_pushvalue(vm, 3); + be_call(vm, 1); + be_pop(vm, 1); + be_moveto(vm, -1, 3); + } else { + be_raise(vm, "value_error", "Value is an instance without 'toint()' method"); + } + be_pop(vm, 1); + } + be_getmember(vm, 1, ".def"); const be_ctypes_structure_t *definitions; definitions = (const be_ctypes_structure_t *) be_tocomptr(vm, -1); diff --git a/lib/libesp32/Berry/default/be_lvgl_ctypes_definitions.c b/lib/libesp32/Berry/default/be_lvgl_ctypes_definitions.c index 767e3830e..e40f4edde 100644 --- a/lib/libesp32/Berry/default/be_lvgl_ctypes_definitions.c +++ b/lib/libesp32/Berry/default/be_lvgl_ctypes_definitions.c @@ -7,8 +7,11 @@ #include "lvgl.h" -enum { +/******************************************************************** + * Generated code, don't edit + *******************************************************************/ +enum { ctypes_i32 = 14, ctypes_i16 = 12, ctypes_i8 = 11, @@ -32,7 +35,8 @@ typedef struct be_ctypes_structure_item_t { uint16_t offset_bytes; uint8_t offset_bits : 3; uint8_t len_bits : 5; - int8_t type; + int8_t type : 5; + uint8_t mapping : 3; } be_ctypes_structure_item_t; typedef struct be_ctypes_structure_t { @@ -48,368 +52,337 @@ typedef struct be_ctypes_class_t { typedef struct be_ctypes_classes_t { uint16_t size; + const char **instance_mapping; /* array of instance class names for automatic instanciation of class */ const be_ctypes_class_t * classes; } be_ctypes_classes_t; -// extern const be_ctypes_class_t *g_ctypes_classes; - - BE_EXPORT_VARIABLE extern const bclass be_class_lv_ctypes; - - -// const be_ctypes_structure_t be_lv_area_t = { -// 4, -// (const be_ctypes_structure_item_t[4]) { -// { "x1", 0, 16, ctypes_int }, -// { "x2", 32, 16, ctypes_int }, -// { "y1", 16, 16, ctypes_int }, -// { "y2", 48, 16, ctypes_int }, -// // }}; - -// #if BE_USE_PRECOMPILED_OBJECT -// #include "../generate/be_fixed_be_class_lv_area_t.h" -// #endif - -// void be_load_lvgl_lv_area_t_lib(bvm *vm) { -// #if !BE_USE_PRECOMPILED_OBJECT -// static const bnfuncinfo members[] = { -// { NULL, NULL } -// }; -// be_regclass(vm, "lv_area_t", members); - -// be_getglobal(vm, "lv_area_t"); -// be_getglobal(vm, "lv_ctypes"); -// be_setsuper(vm, -2); -// be_pop(vm, 2); -// #else -// be_pushntvclass(vm, &be_class_lv_area_t); -// be_setglobal(vm, "lv_area_t"); -// be_pop(vm, 1); -// #endif -// } - void ctypes_register_class(bvm *vm, const bclass * ctypes_class, const be_ctypes_structure_t * definitions) { be_pushntvclass(vm, ctypes_class); be_setglobal(vm, str(ctypes_class->name)); be_pop(vm, 1); } -/******************************************************************** - * Generated code, don't edit - *******************************************************************/ +/********************************************************************/ const be_ctypes_structure_t be_lv_point = { 4, /* size in bytes */ 2, /* number of elements */ (const be_ctypes_structure_item_t[2]) { - { "x", 0, 0, 0, 12 }, - { "y", 2, 0, 0, 12 }, + { "x", 0, 0, 0, 12, 0 }, + { "y", 2, 0, 0, 12, 0 }, }}; const be_ctypes_structure_t be_lv_area = { 8, /* size in bytes */ 4, /* number of elements */ (const be_ctypes_structure_item_t[4]) { - { "x1", 0, 0, 0, 12 }, - { "x2", 4, 0, 0, 12 }, - { "y1", 2, 0, 0, 12 }, - { "y2", 6, 0, 0, 12 }, + { "x1", 0, 0, 0, 12, 0 }, + { "x2", 4, 0, 0, 12, 0 }, + { "y1", 2, 0, 0, 12, 0 }, + { "y2", 6, 0, 0, 12, 0 }, }}; const be_ctypes_structure_t be_lv_draw_rect_dsc = { 77, /* size in bytes */ 43, /* number of elements */ (const be_ctypes_structure_item_t[43]) { - { "bg_blend_mode", 12, 0, 0, 1 }, - { "bg_color", 2, 0, 0, 2 }, - { "bg_grad_color", 4, 0, 0, 2 }, - { "bg_grad_color_stop", 9, 0, 0, 12 }, - { "bg_grad_dir", 6, 0, 0, 1 }, - { "bg_main_color_stop", 7, 0, 0, 12 }, - { "bg_opa", 11, 0, 0, 1 }, - { "border_blend_mode", 20, 0, 0, 1 }, - { "border_color", 13, 0, 0, 2 }, - { "border_opa", 19, 0, 0, 1 }, - { "border_post", 21, 0, 1, 0 }, - { "border_side", 17, 0, 0, 12 }, - { "border_width", 15, 0, 0, 12 }, - { "outline_blend_mode", 29, 0, 0, 1 }, - { "outline_color", 22, 0, 0, 2 }, - { "outline_opa", 28, 0, 0, 1 }, - { "outline_pad", 26, 0, 0, 12 }, - { "outline_width", 24, 0, 0, 12 }, - { "pattern_blend_mode", 55, 0, 0, 1 }, - { "pattern_font", 46, 0, 0, 4 }, - { "pattern_image", 42, 0, 0, 4 }, - { "pattern_opa", 52, 0, 0, 1 }, - { "pattern_recolor", 50, 0, 0, 2 }, - { "pattern_recolor_opa", 53, 0, 0, 1 }, - { "pattern_repeat", 54, 0, 1, 0 }, - { "radius", 0, 0, 0, 12 }, - { "shadow_blend_mode", 41, 0, 0, 1 }, - { "shadow_color", 30, 0, 0, 2 }, - { "shadow_ofs_x", 34, 0, 0, 12 }, - { "shadow_ofs_y", 36, 0, 0, 12 }, - { "shadow_opa", 40, 0, 0, 1 }, - { "shadow_spread", 38, 0, 0, 12 }, - { "shadow_width", 32, 0, 0, 12 }, - { "value_align", 75, 0, 0, 1 }, - { "value_blend_mode", 76, 0, 0, 1 }, - { "value_color", 65, 0, 0, 2 }, - { "value_font", 60, 0, 0, 4 }, - { "value_letter_space", 71, 0, 0, 12 }, - { "value_line_space", 73, 0, 0, 12 }, - { "value_ofs_x", 67, 0, 0, 12 }, - { "value_ofs_y", 69, 0, 0, 12 }, - { "value_opa", 64, 0, 0, 1 }, - { "value_str", 56, 0, 0, 4 }, + { "bg_blend_mode", 12, 0, 0, 1, 0 }, + { "bg_color", 2, 0, 0, 2, 1 }, + { "bg_grad_color", 4, 0, 0, 2, 1 }, + { "bg_grad_color_stop", 9, 0, 0, 12, 0 }, + { "bg_grad_dir", 6, 0, 0, 1, 0 }, + { "bg_main_color_stop", 7, 0, 0, 12, 0 }, + { "bg_opa", 11, 0, 0, 1, 0 }, + { "border_blend_mode", 20, 0, 0, 1, 0 }, + { "border_color", 13, 0, 0, 2, 1 }, + { "border_opa", 19, 0, 0, 1, 0 }, + { "border_post", 21, 0, 1, 0, 0 }, + { "border_side", 17, 0, 0, 12, 0 }, + { "border_width", 15, 0, 0, 12, 0 }, + { "outline_blend_mode", 29, 0, 0, 1, 0 }, + { "outline_color", 22, 0, 0, 2, 1 }, + { "outline_opa", 28, 0, 0, 1, 0 }, + { "outline_pad", 26, 0, 0, 12, 0 }, + { "outline_width", 24, 0, 0, 12, 0 }, + { "pattern_blend_mode", 55, 0, 0, 1, 0 }, + { "pattern_font", 46, 0, 0, 4, 0 }, + { "pattern_image", 42, 0, 0, 4, 0 }, + { "pattern_opa", 52, 0, 0, 1, 0 }, + { "pattern_recolor", 50, 0, 0, 2, 1 }, + { "pattern_recolor_opa", 53, 0, 0, 1, 0 }, + { "pattern_repeat", 54, 0, 1, 0, 0 }, + { "radius", 0, 0, 0, 12, 0 }, + { "shadow_blend_mode", 41, 0, 0, 1, 0 }, + { "shadow_color", 30, 0, 0, 2, 1 }, + { "shadow_ofs_x", 34, 0, 0, 12, 0 }, + { "shadow_ofs_y", 36, 0, 0, 12, 0 }, + { "shadow_opa", 40, 0, 0, 1, 0 }, + { "shadow_spread", 38, 0, 0, 12, 0 }, + { "shadow_width", 32, 0, 0, 12, 0 }, + { "value_align", 75, 0, 0, 1, 0 }, + { "value_blend_mode", 76, 0, 0, 1, 0 }, + { "value_color", 65, 0, 0, 2, 1 }, + { "value_font", 60, 0, 0, 4, 0 }, + { "value_letter_space", 71, 0, 0, 12, 0 }, + { "value_line_space", 73, 0, 0, 12, 0 }, + { "value_ofs_x", 67, 0, 0, 12, 0 }, + { "value_ofs_y", 69, 0, 0, 12, 0 }, + { "value_opa", 64, 0, 0, 1, 0 }, + { "value_str", 56, 0, 0, 4, 0 }, }}; const be_ctypes_structure_t be_lv_draw_line_dsc = { 10, /* size in bytes */ 9, /* number of elements */ (const be_ctypes_structure_item_t[9]) { - { "blend_mode", 9, 0, 2, 0 }, - { "color", 0, 0, 0, 2 }, - { "dash_gap", 6, 0, 0, 12 }, - { "dash_width", 4, 0, 0, 12 }, - { "opa", 8, 0, 0, 1 }, - { "raw_end", 9, 4, 1, 0 }, - { "round_end", 9, 3, 1, 0 }, - { "round_start", 9, 2, 1, 0 }, - { "width", 2, 0, 0, 12 }, + { "blend_mode", 9, 0, 2, 0, 0 }, + { "color", 0, 0, 0, 2, 1 }, + { "dash_gap", 6, 0, 0, 12, 0 }, + { "dash_width", 4, 0, 0, 12, 0 }, + { "opa", 8, 0, 0, 1, 0 }, + { "raw_end", 9, 4, 1, 0, 0 }, + { "round_end", 9, 3, 1, 0, 0 }, + { "round_start", 9, 2, 1, 0, 0 }, + { "width", 2, 0, 0, 12, 0 }, }}; const be_ctypes_structure_t be_lv_draw_img_dsc = { 14, /* size in bytes */ 9, /* number of elements */ (const be_ctypes_structure_item_t[9]) { - { "angle", 1, 0, 0, 2 }, - { "antialias", 13, 0, 1, 0 }, - { "blend_mode", 12, 0, 0, 1 }, - { "opa", 0, 0, 0, 1 }, - { "pivot_x", 3, 0, 0, 12 }, - { "pivot_y", 5, 0, 0, 12 }, - { "recolor", 10, 0, 0, 2 }, - { "recolor_opa", 9, 0, 0, 1 }, - { "zoom", 7, 0, 0, 2 }, + { "angle", 1, 0, 0, 2, 0 }, + { "antialias", 13, 0, 1, 0, 0 }, + { "blend_mode", 12, 0, 0, 1, 0 }, + { "opa", 0, 0, 0, 1, 0 }, + { "pivot_x", 3, 0, 0, 12, 0 }, + { "pivot_y", 5, 0, 0, 12, 0 }, + { "recolor", 10, 0, 0, 2, 1 }, + { "recolor_opa", 9, 0, 0, 1, 0 }, + { "zoom", 7, 0, 0, 2, 0 }, }}; const be_ctypes_structure_t be_lv_draw_label_dsc = { 31, /* size in bytes */ 15, /* number of elements */ (const be_ctypes_structure_item_t[15]) { - { "bidi_dir", 27, 0, 0, 1 }, - { "blend_mode", 30, 0, 0, 1 }, - { "color", 0, 0, 0, 2 }, - { "decor", 29, 0, 0, 1 }, - { "flag", 28, 0, 0, 1 }, - { "font", 6, 0, 0, 4 }, - { "letter_space", 13, 0, 0, 12 }, - { "line_space", 11, 0, 0, 12 }, - { "ofs_x", 23, 0, 0, 12 }, - { "ofs_y", 25, 0, 0, 12 }, - { "opa", 10, 0, 0, 1 }, - { "sel_bg_color", 4, 0, 0, 2 }, - { "sel_color", 2, 0, 0, 2 }, - { "sel_end", 19, 0, 0, 4 }, - { "sel_start", 15, 0, 0, 4 }, + { "bidi_dir", 27, 0, 0, 1, 0 }, + { "blend_mode", 30, 0, 0, 1, 0 }, + { "color", 0, 0, 0, 2, 1 }, + { "decor", 29, 0, 0, 1, 0 }, + { "flag", 28, 0, 0, 1, 0 }, + { "font", 6, 0, 0, 4, 0 }, + { "letter_space", 13, 0, 0, 12, 0 }, + { "line_space", 11, 0, 0, 12, 0 }, + { "ofs_x", 23, 0, 0, 12, 0 }, + { "ofs_y", 25, 0, 0, 12, 0 }, + { "opa", 10, 0, 0, 1, 0 }, + { "sel_bg_color", 4, 0, 0, 2, 1 }, + { "sel_color", 2, 0, 0, 2, 1 }, + { "sel_end", 19, 0, 0, 4, 0 }, + { "sel_start", 15, 0, 0, 4, 0 }, }}; const be_ctypes_structure_t be_lv_draw_mask_common_dsc = { 5, /* size in bytes */ 2, /* number of elements */ (const be_ctypes_structure_item_t[2]) { - { "cb", 0, 0, 0, 4 }, - { "type", 4, 0, 0, 1 }, + { "cb", 0, 0, 0, 4, 0 }, + { "type", 4, 0, 0, 1, 0 }, }}; const be_ctypes_structure_t be_lv_draw_mask_line_param_cfg = { 9, /* size in bytes */ 5, /* number of elements */ (const be_ctypes_structure_item_t[5]) { - { "p1_x", 0, 0, 0, 12 }, - { "p1_y", 2, 0, 0, 12 }, - { "p2_x", 4, 0, 0, 12 }, - { "p2_y", 6, 0, 0, 12 }, - { "side", 8, 0, 2, 0 }, + { "p1_x", 0, 0, 0, 12, 0 }, + { "p1_y", 2, 0, 0, 12, 0 }, + { "p2_x", 4, 0, 0, 12, 0 }, + { "p2_y", 6, 0, 0, 12, 0 }, + { "side", 8, 0, 2, 0, 0 }, }}; const be_ctypes_structure_t be_lv_draw_mask_line_param = { 35, /* size in bytes */ 15, /* number of elements */ (const be_ctypes_structure_item_t[15]) { - { "cfg_p1_x", 5, 0, 0, 12 }, - { "cfg_p1_y", 7, 0, 0, 12 }, - { "cfg_p2_x", 9, 0, 0, 12 }, - { "cfg_p2_y", 11, 0, 0, 12 }, - { "cfg_side", 13, 0, 2, 0 }, - { "dsc_cb", 0, 0, 0, 4 }, - { "dsc_type", 4, 0, 0, 1 }, - { "flat", 34, 0, 1, 0 }, - { "inv", 34, 1, 1, 0 }, - { "origo_x", 14, 0, 0, 12 }, - { "origo_y", 16, 0, 0, 12 }, - { "spx", 30, 0, 0, 14 }, - { "steep", 26, 0, 0, 14 }, - { "xy_steep", 18, 0, 0, 14 }, - { "yx_steep", 22, 0, 0, 14 }, + { "cfg_p1_x", 5, 0, 0, 12, 0 }, + { "cfg_p1_y", 7, 0, 0, 12, 0 }, + { "cfg_p2_x", 9, 0, 0, 12, 0 }, + { "cfg_p2_y", 11, 0, 0, 12, 0 }, + { "cfg_side", 13, 0, 2, 0, 0 }, + { "dsc_cb", 0, 0, 0, 4, 0 }, + { "dsc_type", 4, 0, 0, 1, 0 }, + { "flat", 34, 0, 1, 0, 0 }, + { "inv", 34, 1, 1, 0, 0 }, + { "origo_x", 14, 0, 0, 12, 0 }, + { "origo_y", 16, 0, 0, 12, 0 }, + { "spx", 30, 0, 0, 14, 0 }, + { "steep", 26, 0, 0, 14, 0 }, + { "xy_steep", 18, 0, 0, 14, 0 }, + { "yx_steep", 22, 0, 0, 14, 0 }, }}; const be_ctypes_structure_t be_lv_draw_mask_angle_param_cfg = { 8, /* size in bytes */ 4, /* number of elements */ (const be_ctypes_structure_item_t[4]) { - { "end_angle", 6, 0, 0, 12 }, - { "start_angle", 4, 0, 0, 12 }, - { "vertex_p_x", 0, 0, 0, 12 }, - { "vertex_p_y", 2, 0, 0, 12 }, + { "end_angle", 6, 0, 0, 12, 0 }, + { "start_angle", 4, 0, 0, 12, 0 }, + { "vertex_p_x", 0, 0, 0, 12, 0 }, + { "vertex_p_y", 2, 0, 0, 12, 0 }, }}; const be_ctypes_structure_t be_lv_draw_mask_angle_param = { 85, /* size in bytes */ 37, /* number of elements */ (const be_ctypes_structure_item_t[37]) { - { "cfg_end_angle", 11, 0, 0, 12 }, - { "cfg_start_angle", 9, 0, 0, 12 }, - { "cfg_vertex_p_x", 5, 0, 0, 12 }, - { "cfg_vertex_p_y", 7, 0, 0, 12 }, - { "delta_deg", 83, 0, 0, 2 }, - { "dsc_cb", 0, 0, 0, 4 }, - { "dsc_type", 4, 0, 0, 1 }, - { "end_line_cfg_p1_x", 53, 0, 0, 12 }, - { "end_line_cfg_p1_y", 55, 0, 0, 12 }, - { "end_line_cfg_p2_x", 57, 0, 0, 12 }, - { "end_line_cfg_p2_y", 59, 0, 0, 12 }, - { "end_line_cfg_side", 61, 0, 2, 0 }, - { "end_line_dsc_cb", 48, 0, 0, 4 }, - { "end_line_dsc_type", 52, 0, 0, 1 }, - { "end_line_flat", 82, 0, 1, 0 }, - { "end_line_inv", 82, 1, 1, 0 }, - { "end_line_origo_x", 62, 0, 0, 12 }, - { "end_line_origo_y", 64, 0, 0, 12 }, - { "end_line_spx", 78, 0, 0, 14 }, - { "end_line_steep", 74, 0, 0, 14 }, - { "end_line_xy_steep", 66, 0, 0, 14 }, - { "end_line_yx_steep", 70, 0, 0, 14 }, - { "start_line_cfg_p1_x", 18, 0, 0, 12 }, - { "start_line_cfg_p1_y", 20, 0, 0, 12 }, - { "start_line_cfg_p2_x", 22, 0, 0, 12 }, - { "start_line_cfg_p2_y", 24, 0, 0, 12 }, - { "start_line_cfg_side", 26, 0, 2, 0 }, - { "start_line_dsc_cb", 13, 0, 0, 4 }, - { "start_line_dsc_type", 17, 0, 0, 1 }, - { "start_line_flat", 47, 0, 1, 0 }, - { "start_line_inv", 47, 1, 1, 0 }, - { "start_line_origo_x", 27, 0, 0, 12 }, - { "start_line_origo_y", 29, 0, 0, 12 }, - { "start_line_spx", 43, 0, 0, 14 }, - { "start_line_steep", 39, 0, 0, 14 }, - { "start_line_xy_steep", 31, 0, 0, 14 }, - { "start_line_yx_steep", 35, 0, 0, 14 }, + { "cfg_end_angle", 11, 0, 0, 12, 0 }, + { "cfg_start_angle", 9, 0, 0, 12, 0 }, + { "cfg_vertex_p_x", 5, 0, 0, 12, 0 }, + { "cfg_vertex_p_y", 7, 0, 0, 12, 0 }, + { "delta_deg", 83, 0, 0, 2, 0 }, + { "dsc_cb", 0, 0, 0, 4, 0 }, + { "dsc_type", 4, 0, 0, 1, 0 }, + { "end_line_cfg_p1_x", 53, 0, 0, 12, 0 }, + { "end_line_cfg_p1_y", 55, 0, 0, 12, 0 }, + { "end_line_cfg_p2_x", 57, 0, 0, 12, 0 }, + { "end_line_cfg_p2_y", 59, 0, 0, 12, 0 }, + { "end_line_cfg_side", 61, 0, 2, 0, 0 }, + { "end_line_dsc_cb", 48, 0, 0, 4, 0 }, + { "end_line_dsc_type", 52, 0, 0, 1, 0 }, + { "end_line_flat", 82, 0, 1, 0, 0 }, + { "end_line_inv", 82, 1, 1, 0, 0 }, + { "end_line_origo_x", 62, 0, 0, 12, 0 }, + { "end_line_origo_y", 64, 0, 0, 12, 0 }, + { "end_line_spx", 78, 0, 0, 14, 0 }, + { "end_line_steep", 74, 0, 0, 14, 0 }, + { "end_line_xy_steep", 66, 0, 0, 14, 0 }, + { "end_line_yx_steep", 70, 0, 0, 14, 0 }, + { "start_line_cfg_p1_x", 18, 0, 0, 12, 0 }, + { "start_line_cfg_p1_y", 20, 0, 0, 12, 0 }, + { "start_line_cfg_p2_x", 22, 0, 0, 12, 0 }, + { "start_line_cfg_p2_y", 24, 0, 0, 12, 0 }, + { "start_line_cfg_side", 26, 0, 2, 0, 0 }, + { "start_line_dsc_cb", 13, 0, 0, 4, 0 }, + { "start_line_dsc_type", 17, 0, 0, 1, 0 }, + { "start_line_flat", 47, 0, 1, 0, 0 }, + { "start_line_inv", 47, 1, 1, 0, 0 }, + { "start_line_origo_x", 27, 0, 0, 12, 0 }, + { "start_line_origo_y", 29, 0, 0, 12, 0 }, + { "start_line_spx", 43, 0, 0, 14, 0 }, + { "start_line_steep", 39, 0, 0, 14, 0 }, + { "start_line_xy_steep", 31, 0, 0, 14, 0 }, + { "start_line_yx_steep", 35, 0, 0, 14, 0 }, }}; const be_ctypes_structure_t be_lv_draw_mask_radius_param_cfg = { 11, /* size in bytes */ 6, /* number of elements */ (const be_ctypes_structure_item_t[6]) { - { "outer", 10, 0, 1, 0 }, - { "radius", 8, 0, 0, 12 }, - { "rect_x1", 0, 0, 0, 12 }, - { "rect_x2", 4, 0, 0, 12 }, - { "rect_y1", 2, 0, 0, 12 }, - { "rect_y2", 6, 0, 0, 12 }, + { "outer", 10, 0, 1, 0, 0 }, + { "radius", 8, 0, 0, 12, 0 }, + { "rect_x1", 0, 0, 0, 12, 0 }, + { "rect_x2", 4, 0, 0, 12, 0 }, + { "rect_y1", 2, 0, 0, 12, 0 }, + { "rect_y2", 6, 0, 0, 12, 0 }, }}; const be_ctypes_structure_t be_lv_sqrt_res = { 4, /* size in bytes */ 2, /* number of elements */ (const be_ctypes_structure_item_t[2]) { - { "f", 2, 0, 0, 2 }, - { "i", 0, 0, 0, 2 }, + { "f", 2, 0, 0, 2, 0 }, + { "i", 0, 0, 0, 2, 0 }, }}; const be_ctypes_structure_t be_lv_draw_mask_radius_param = { 24, /* size in bytes */ 11, /* number of elements */ (const be_ctypes_structure_item_t[11]) { - { "cfg_outer", 15, 0, 1, 0 }, - { "cfg_radius", 13, 0, 0, 12 }, - { "cfg_rect_x1", 5, 0, 0, 12 }, - { "cfg_rect_x2", 9, 0, 0, 12 }, - { "cfg_rect_y1", 7, 0, 0, 12 }, - { "cfg_rect_y2", 11, 0, 0, 12 }, - { "dsc_cb", 0, 0, 0, 4 }, - { "dsc_type", 4, 0, 0, 1 }, - { "y_prev", 16, 0, 0, 14 }, - { "y_prev_x_f", 22, 0, 0, 2 }, - { "y_prev_x_i", 20, 0, 0, 2 }, + { "cfg_outer", 15, 0, 1, 0, 0 }, + { "cfg_radius", 13, 0, 0, 12, 0 }, + { "cfg_rect_x1", 5, 0, 0, 12, 0 }, + { "cfg_rect_x2", 9, 0, 0, 12, 0 }, + { "cfg_rect_y1", 7, 0, 0, 12, 0 }, + { "cfg_rect_y2", 11, 0, 0, 12, 0 }, + { "dsc_cb", 0, 0, 0, 4, 0 }, + { "dsc_type", 4, 0, 0, 1, 0 }, + { "y_prev", 16, 0, 0, 14, 0 }, + { "y_prev_x_f", 22, 0, 0, 2, 0 }, + { "y_prev_x_i", 20, 0, 0, 2, 0 }, }}; const be_ctypes_structure_t be_lv_draw_mask_fade_param_cfg = { 14, /* size in bytes */ 8, /* number of elements */ (const be_ctypes_structure_item_t[8]) { - { "coords_x1", 0, 0, 0, 12 }, - { "coords_x2", 4, 0, 0, 12 }, - { "coords_y1", 2, 0, 0, 12 }, - { "coords_y2", 6, 0, 0, 12 }, - { "opa_bottom", 13, 0, 0, 1 }, - { "opa_top", 12, 0, 0, 1 }, - { "y_bottom", 10, 0, 0, 12 }, - { "y_top", 8, 0, 0, 12 }, + { "coords_x1", 0, 0, 0, 12, 0 }, + { "coords_x2", 4, 0, 0, 12, 0 }, + { "coords_y1", 2, 0, 0, 12, 0 }, + { "coords_y2", 6, 0, 0, 12, 0 }, + { "opa_bottom", 13, 0, 0, 1, 0 }, + { "opa_top", 12, 0, 0, 1, 0 }, + { "y_bottom", 10, 0, 0, 12, 0 }, + { "y_top", 8, 0, 0, 12, 0 }, }}; const be_ctypes_structure_t be_lv_draw_mask_fade_param = { 19, /* size in bytes */ 10, /* number of elements */ (const be_ctypes_structure_item_t[10]) { - { "cfg_coords_x1", 5, 0, 0, 12 }, - { "cfg_coords_x2", 9, 0, 0, 12 }, - { "cfg_coords_y1", 7, 0, 0, 12 }, - { "cfg_coords_y2", 11, 0, 0, 12 }, - { "cfg_opa_bottom", 18, 0, 0, 1 }, - { "cfg_opa_top", 17, 0, 0, 1 }, - { "cfg_y_bottom", 15, 0, 0, 12 }, - { "cfg_y_top", 13, 0, 0, 12 }, - { "dsc_cb", 0, 0, 0, 4 }, - { "dsc_type", 4, 0, 0, 1 }, + { "cfg_coords_x1", 5, 0, 0, 12, 0 }, + { "cfg_coords_x2", 9, 0, 0, 12, 0 }, + { "cfg_coords_y1", 7, 0, 0, 12, 0 }, + { "cfg_coords_y2", 11, 0, 0, 12, 0 }, + { "cfg_opa_bottom", 18, 0, 0, 1, 0 }, + { "cfg_opa_top", 17, 0, 0, 1, 0 }, + { "cfg_y_bottom", 15, 0, 0, 12, 0 }, + { "cfg_y_top", 13, 0, 0, 12, 0 }, + { "dsc_cb", 0, 0, 0, 4, 0 }, + { "dsc_type", 4, 0, 0, 1, 0 }, }}; const be_ctypes_structure_t be_lv_draw_mask_map_param_cfg = { 12, /* size in bytes */ 5, /* number of elements */ (const be_ctypes_structure_item_t[5]) { - { "coords_x1", 0, 0, 0, 12 }, - { "coords_x2", 4, 0, 0, 12 }, - { "coords_y1", 2, 0, 0, 12 }, - { "coords_y2", 6, 0, 0, 12 }, - { "map", 8, 0, 0, 4 }, + { "coords_x1", 0, 0, 0, 12, 0 }, + { "coords_x2", 4, 0, 0, 12, 0 }, + { "coords_y1", 2, 0, 0, 12, 0 }, + { "coords_y2", 6, 0, 0, 12, 0 }, + { "map", 8, 0, 0, 4, 0 }, }}; const be_ctypes_structure_t be_lv_draw_mask_map_param = { 17, /* size in bytes */ 7, /* number of elements */ (const be_ctypes_structure_item_t[7]) { - { "cfg_coords_x1", 5, 0, 0, 12 }, - { "cfg_coords_x2", 9, 0, 0, 12 }, - { "cfg_coords_y1", 7, 0, 0, 12 }, - { "cfg_coords_y2", 11, 0, 0, 12 }, - { "cfg_map", 13, 0, 0, 4 }, - { "dsc_cb", 0, 0, 0, 4 }, - { "dsc_type", 4, 0, 0, 1 }, + { "cfg_coords_x1", 5, 0, 0, 12, 0 }, + { "cfg_coords_x2", 9, 0, 0, 12, 0 }, + { "cfg_coords_y1", 7, 0, 0, 12, 0 }, + { "cfg_coords_y2", 11, 0, 0, 12, 0 }, + { "cfg_map", 13, 0, 0, 4, 0 }, + { "dsc_cb", 0, 0, 0, 4, 0 }, + { "dsc_type", 4, 0, 0, 1, 0 }, }}; const be_ctypes_structure_t be_lv_draw_mask_saved = { 8, /* size in bytes */ 2, /* number of elements */ (const be_ctypes_structure_item_t[2]) { - { "custom_id", 4, 0, 0, 4 }, - { "param", 0, 0, 0, 4 }, + { "custom_id", 4, 0, 0, 4, 0 }, + { "param", 0, 0, 0, 4, 0 }, }}; +const char * be_ctypes_instance_mappings[] = { + "lv_color", + NULL +}; + const be_ctypes_classes_t be_ctypes_classes[] = { 19, + be_ctypes_instance_mappings, (const be_ctypes_class_t[19]) { { "lv_area", &be_lv_area }, { "lv_draw_img_dsc", &be_lv_draw_img_dsc }, @@ -500,8 +473,6 @@ void be_load_ctypes_definitions_lib(bvm *vm) { static be_define_const_empty_class(be_class_lv_sqrt_res, &be_class_lv_ctypes, lv_sqrt_res); ctypes_register_class(vm, &be_class_lv_sqrt_res, &be_lv_sqrt_res); } - -/*******************************************************************/ - +/********************************************************************/ #endif // USE_LVGL \ No newline at end of file diff --git a/lib/libesp32/Berry/default/be_lvgl_signal_bars_lib.c b/lib/libesp32/Berry/default/be_lvgl_signal_bars_lib.c new file mode 100644 index 000000000..060789ae0 --- /dev/null +++ b/lib/libesp32/Berry/default/be_lvgl_signal_bars_lib.c @@ -0,0 +1,374 @@ +/******************************************************************** + * Tasmota LVGL lv_signal_bars widget + *******************************************************************/ +#include "be_constobj.h" + +#ifdef USE_LVGL + +#include "lvgl.h" + +/******************************************************************** +** Solidified function: my_design_cb +********************************************************************/ +be_local_closure(my_design_cb, /* name */ + be_nested_proto( + 21, /* nstack */ + 3, /* argc */ + 0, /* has upvals */ + NULL, /* no upvals */ + 1, /* has sup protos */ + ( &(const struct bproto*[ 1]) { + be_nested_proto( + 2, /* nstack */ + 1, /* argc */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[ 1]) { /* constants */ + be_const_int(1), /* R256 - K0 */ + }), + (be_nested_const_str("atleast1", 1956331672, 8)), + (be_nested_const_str("input", -103256197, 5)), + ( &(const binstruction[ 6]) { /* code */ + 0x28040100, // 0000 GE R1 R0 R256 + 0x78060001, // 0001 JMPF R1 #0004 + 0x80040000, // 0002 RET 1 R0 + 0x70020000, // 0003 JMP #0005 + 0x80060000, // 0004 RET 1 R256 + 0x80000000, // 0005 RET 0 R0 + }) + ), + }), + 1, /* has constants */ + ( &(const bvalue[33]) { /* constants */ + be_nested_string("get_height", -723211773, 10), /* R256 - K0 */ + be_nested_string("get_width", -1001549996, 9), /* R257 - K1 */ + be_const_int(3), /* R258 - K2 */ + be_const_int(2), /* R259 - K3 */ + be_nested_string("lv", 1529997255, 2), /* R260 - K4 */ + be_nested_string("DESIGN_COVER_CHK", -1298406708, 16), /* R261 - K5 */ + be_nested_string("ancestor_design", 421545719, 15), /* R262 - K6 */ + be_nested_string("call", -1276017495, 4), /* R263 - K7 */ + be_nested_string("DESIGN_DRAW_MAIN", -904475754, 16), /* R264 - K8 */ + be_nested_string("get_coords", 1044089006, 10), /* R265 - K9 */ + be_nested_string("x1", 274927234, 2), /* R266 - K10 */ + be_nested_string("y1", -1939865569, 2), /* R267 - K11 */ + be_nested_string("draw_line_dsc_init", -428273650, 18), /* R268 - K12 */ + be_nested_string("line_dsc", -200476318, 8), /* R269 - K13 */ + be_nested_string("init_draw_line_dsc", -1787031256, 18), /* R270 - K14 */ + be_nested_string("OBJ_PART_MAIN", 658062838, 13), /* R271 - K15 */ + be_nested_string("round_start", -1345482912, 11), /* R272 - K16 */ + be_const_int(1), /* R273 - K17 */ + be_nested_string("round_end", 985288225, 9), /* R274 - K18 */ + be_nested_string("width", -1786286561, 5), /* R275 - K19 */ + be_nested_string("get_style_line_color", 805371932, 20), /* R276 - K20 */ + be_nested_string("STATE_DEFAULT", 712406428, 13), /* R277 - K21 */ + be_nested_string("get_style_bg_color", 964794381, 18), /* R278 - K22 */ + be_const_int(0), /* R279 - K23 */ + be_nested_string("color", 1031692888, 5), /* R280 - K24 */ + be_nested_string("percentage", -1756136011, 10), /* R281 - K25 */ + be_nested_string("p1", -1605446022, 2), /* R282 - K26 */ + be_nested_string("y", -66302220, 1), /* R283 - K27 */ + be_nested_string("x", -49524601, 1), /* R284 - K28 */ + be_nested_string("p2", -1622223641, 2), /* R285 - K29 */ + be_nested_string("draw_line", 1634465686, 9), /* R286 - K30 */ + be_nested_string("stop_iteration", -121173395, 14), /* R287 - K31 */ + be_nested_string("DESIGN_RES_OK", -1265307123, 13), /* R288 - K32 */ + }), + (be_nested_const_str("my_design_cb", -1173588798, 12)), + (be_nested_const_str("input", -103256197, 5)), + ( &(const binstruction[119]) { /* code */ + 0x840C0000, // 0000 CLOSURE R3 P0 + 0x8C100100, // 0001 GETMET R4 R0 R256 + 0x7C100200, // 0002 CALL R4 1 + 0x8C140101, // 0003 GETMET R5 R0 R257 + 0x7C140200, // 0004 CALL R5 1 + 0x5C180600, // 0005 MOVE R6 R3 + 0x541E000E, // 0006 LDINT R7 15 + 0x0C1C0A07, // 0007 DIV R7 R5 R7 + 0x7C180200, // 0008 CALL R6 1 + 0x5C1C0600, // 0009 MOVE R7 R3 + 0x08200D02, // 000A MUL R8 R6 R258 + 0x04200A08, // 000B SUB R8 R5 R8 + 0x54260003, // 000C LDINT R9 4 + 0x0C201009, // 000D DIV R8 R8 R9 + 0x7C1C0200, // 000E CALL R7 1 + 0x0C200F03, // 000F DIV R8 R7 R259 + 0xB8260800, // 0010 GETNGBL R9 R260 + 0x88241305, // 0011 GETMBR R9 R9 R261 + 0x1C240409, // 0012 EQ R9 R2 R9 + 0x78260007, // 0013 JMPF R9 #001C + 0x88240106, // 0014 GETMBR R9 R0 R262 + 0x8C241307, // 0015 GETMET R9 R9 R263 + 0x5C2C0000, // 0016 MOVE R11 R0 + 0x5C300200, // 0017 MOVE R12 R1 + 0x5C340400, // 0018 MOVE R13 R2 + 0x7C240800, // 0019 CALL R9 4 + 0x80041200, // 001A RET 1 R9 + 0x70020057, // 001B JMP #0074 + 0xB8260800, // 001C GETNGBL R9 R260 + 0x88241308, // 001D GETMBR R9 R9 R264 + 0x1C240409, // 001E EQ R9 R2 R9 + 0x78260053, // 001F JMPF R9 #0074 + 0x8C240109, // 0020 GETMET R9 R0 R265 + 0x5C2C0200, // 0021 MOVE R11 R1 + 0x7C240400, // 0022 CALL R9 2 + 0x8824030A, // 0023 GETMBR R9 R1 R266 + 0x8828030B, // 0024 GETMBR R10 R1 R267 + 0xB82E0800, // 0025 GETNGBL R11 R260 + 0x8C2C170C, // 0026 GETMET R11 R11 R268 + 0x8834010D, // 0027 GETMBR R13 R0 R269 + 0x7C2C0400, // 0028 CALL R11 2 + 0x8C2C010E, // 0029 GETMET R11 R0 R270 + 0xB8360800, // 002A GETNGBL R13 R260 + 0x88341B0F, // 002B GETMBR R13 R13 R271 + 0x8838010D, // 002C GETMBR R14 R0 R269 + 0x7C2C0600, // 002D CALL R11 3 + 0x882C010D, // 002E GETMBR R11 R0 R269 + 0x902E2111, // 002F SETMBR R11 R272 R273 + 0x882C010D, // 0030 GETMBR R11 R0 R269 + 0x902E2511, // 0031 SETMBR R11 R274 R273 + 0x882C010D, // 0032 GETMBR R11 R0 R269 + 0x902E2607, // 0033 SETMBR R11 R275 R7 + 0x8C2C0114, // 0034 GETMET R11 R0 R276 + 0xB8360800, // 0035 GETNGBL R13 R260 + 0x88341B0F, // 0036 GETMBR R13 R13 R271 + 0xB83A0800, // 0037 GETNGBL R14 R260 + 0x88381D15, // 0038 GETMBR R14 R14 R277 + 0x7C2C0600, // 0039 CALL R11 3 + 0x8C300116, // 003A GETMET R12 R0 R278 + 0xB83A0800, // 003B GETNGBL R14 R260 + 0x88381D0F, // 003C GETMBR R14 R14 R271 + 0xB83E0800, // 003D GETNGBL R15 R260 + 0x883C1F15, // 003E GETMBR R15 R15 R277 + 0x7C300600, // 003F CALL R12 3 + 0x60340000, // 0040 GETGBL R13 G0 + 0x403A2F02, // 0041 CONNECT R14 R279 R258 + 0x7C340200, // 0042 CALL R13 1 + 0xA802002C, // 0043 EXBLK 0 #0071 + 0x5C381A00, // 0044 MOVE R14 R13 + 0x7C380000, // 0045 CALL R14 0 + 0x883C010D, // 0046 GETMBR R15 R0 R269 + 0x88400119, // 0047 GETMBR R16 R0 R281 + 0x00441D11, // 0048 ADD R17 R14 R273 + 0x544A0013, // 0049 LDINT R18 20 + 0x08442212, // 004A MUL R17 R17 R18 + 0x28402011, // 004B GE R16 R16 R17 + 0x78420001, // 004C JMPF R16 #004F + 0x5C401600, // 004D MOVE R16 R11 + 0x70020000, // 004E JMP #0050 + 0x5C401800, // 004F MOVE R16 R12 + 0x903E3010, // 0050 SETMBR R15 R280 R16 + 0x883C011A, // 0051 GETMBR R15 R0 R282 + 0x00401404, // 0052 ADD R16 R10 R4 + 0x04402111, // 0053 SUB R16 R16 R273 + 0x04402008, // 0054 SUB R16 R16 R8 + 0x903E3610, // 0055 SETMBR R15 R283 R16 + 0x883C011A, // 0056 GETMBR R15 R0 R282 + 0x00400E06, // 0057 ADD R16 R7 R6 + 0x08401C10, // 0058 MUL R16 R14 R16 + 0x00401210, // 0059 ADD R16 R9 R16 + 0x00402008, // 005A ADD R16 R16 R8 + 0x903E3810, // 005B SETMBR R15 R284 R16 + 0x883C011D, // 005C GETMBR R15 R0 R285 + 0x0442040E, // 005D SUB R16 R258 R14 + 0x04440807, // 005E SUB R17 R4 R7 + 0x08402011, // 005F MUL R16 R16 R17 + 0x54460003, // 0060 LDINT R17 4 + 0x0C402011, // 0061 DIV R16 R16 R17 + 0x00401410, // 0062 ADD R16 R10 R16 + 0x00402008, // 0063 ADD R16 R16 R8 + 0x903E3610, // 0064 SETMBR R15 R283 R16 + 0x883C011D, // 0065 GETMBR R15 R0 R285 + 0x8840011A, // 0066 GETMBR R16 R0 R282 + 0x8840211C, // 0067 GETMBR R16 R16 R284 + 0x903E3810, // 0068 SETMBR R15 R284 R16 + 0xB83E0800, // 0069 GETNGBL R15 R260 + 0x8C3C1F1E, // 006A GETMET R15 R15 R286 + 0x8844011A, // 006B GETMBR R17 R0 R282 + 0x8848011D, // 006C GETMBR R18 R0 R285 + 0x5C4C0200, // 006D MOVE R19 R1 + 0x8850010D, // 006E GETMBR R20 R0 R269 + 0x7C3C0A00, // 006F CALL R15 5 + 0x7001FFD2, // 0070 JMP #0044 + 0x5834001F, // 0071 LDCONST R13 K31 + 0xAC340200, // 0072 CATCH R13 1 0 + 0xB0080000, // 0073 RAISE 2 R0 R0 + 0xB8260800, // 0074 GETNGBL R9 R260 + 0x88241320, // 0075 GETMBR R9 R9 R288 + 0x80041200, // 0076 RET 1 R9 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: get_percentage +********************************************************************/ +be_local_closure(get_percentage, /* name */ + be_nested_proto( + 2, /* nstack */ + 1, /* argc */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[ 1]) { /* constants */ + be_nested_string("percentage", -1756136011, 10), /* R256 - K0 */ + }), + (be_nested_const_str("get_percentage", -1414483304, 14)), + (be_nested_const_str("input", -103256197, 5)), + ( &(const binstruction[ 2]) { /* code */ + 0x88040100, // 0000 GETMBR R1 R0 R256 + 0x80040200, // 0001 RET 1 R1 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: init +********************************************************************/ +be_local_closure(init, /* name */ + be_nested_proto( + 7, /* nstack */ + 3, /* argc */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[14]) { /* constants */ + be_nested_string("lv_obj", -37134147, 6), /* R256 - K0 */ + be_nested_string("init", 380752755, 4), /* R257 - K1 */ + be_nested_string("ancestor_design", 421545719, 15), /* R258 - K2 */ + be_nested_string("get_design_cb", -825649242, 13), /* R259 - K3 */ + be_nested_string("set_design_cb", 1469311634, 13), /* R260 - K4 */ + be_nested_string("my_design_cb", -1173588798, 12), /* R261 - K5 */ + be_nested_string("percentage", -1756136011, 10), /* R262 - K6 */ + be_nested_string("p1", -1605446022, 2), /* R263 - K7 */ + be_nested_string("lv_point", -174745506, 8), /* R264 - K8 */ + be_nested_string("p2", -1622223641, 2), /* R265 - K9 */ + be_nested_string("line_dsc", -200476318, 8), /* R266 - K10 */ + be_nested_string("lv_draw_line_dsc", -1872162060, 16), /* R267 - K11 */ + be_nested_string("area", -1693507260, 4), /* R268 - K12 */ + be_nested_string("lv_area", -1773816895, 7), /* R269 - K13 */ + }), + (be_nested_const_str("init", 380752755, 4)), + (be_nested_const_str("input", -103256197, 5)), + ( &(const binstruction[29]) { /* code */ + 0x600C0014, // 0000 GETGBL R3 G20 + 0x5C100000, // 0001 MOVE R4 R0 + 0xB8160000, // 0002 GETNGBL R5 R256 + 0x7C0C0400, // 0003 CALL R3 2 + 0x8C0C0701, // 0004 GETMET R3 R3 R257 + 0x5C140200, // 0005 MOVE R5 R1 + 0x5C180400, // 0006 MOVE R6 R2 + 0x7C0C0600, // 0007 CALL R3 3 + 0x8C0C0103, // 0008 GETMET R3 R0 R259 + 0x7C0C0200, // 0009 CALL R3 1 + 0x90020403, // 000A SETMBR R0 R258 R3 + 0x8C0C0104, // 000B GETMET R3 R0 R260 + 0x88140105, // 000C GETMBR R5 R0 R261 + 0x7C0C0400, // 000D CALL R3 2 + 0x540E0063, // 000E LDINT R3 100 + 0x90020C03, // 000F SETMBR R0 R262 R3 + 0xB80E1000, // 0010 GETNGBL R3 R264 + 0x7C0C0000, // 0011 CALL R3 0 + 0x90020E03, // 0012 SETMBR R0 R263 R3 + 0xB80E1000, // 0013 GETNGBL R3 R264 + 0x7C0C0000, // 0014 CALL R3 0 + 0x90021203, // 0015 SETMBR R0 R265 R3 + 0xB80E1600, // 0016 GETNGBL R3 R267 + 0x7C0C0000, // 0017 CALL R3 0 + 0x90021403, // 0018 SETMBR R0 R266 R3 + 0xB80E1A00, // 0019 GETNGBL R3 R269 + 0x7C0C0000, // 001A CALL R3 0 + 0x90021803, // 001B SETMBR R0 R268 R3 + 0x80000000, // 001C RET 0 R0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: set_percentage +********************************************************************/ +be_local_closure(set_percentage, /* name */ + be_nested_proto( + 5, /* nstack */ + 2, /* argc */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[ 3]) { /* constants */ + be_nested_string("percentage", -1756136011, 10), /* R256 - K0 */ + be_const_int(0), /* R257 - K1 */ + be_nested_string("invalidate", -1645232368, 10), /* R258 - K2 */ + }), + (be_nested_const_str("set_percentage", -1342944572, 14)), + (be_nested_const_str("input", -103256197, 5)), + ( &(const binstruction[18]) { /* code */ + 0x88080100, // 0000 GETMBR R2 R0 R256 + 0x540E0004, // 0001 LDINT R3 5 + 0x0C080403, // 0002 DIV R2 R2 R3 + 0x540E0063, // 0003 LDINT R3 100 + 0x240C0203, // 0004 GT R3 R1 R3 + 0x780E0000, // 0005 JMPF R3 #0007 + 0x54060063, // 0006 LDINT R1 100 + 0x140C0301, // 0007 LT R3 R1 R257 + 0x780E0000, // 0008 JMPF R3 #000A + 0x58040001, // 0009 LDCONST R1 K1 + 0x90020001, // 000A SETMBR R0 R256 R1 + 0x540E0004, // 000B LDINT R3 5 + 0x0C0C0203, // 000C DIV R3 R1 R3 + 0x200C0403, // 000D NE R3 R2 R3 + 0x780E0001, // 000E JMPF R3 #0011 + 0x8C0C0102, // 000F GETMET R3 R0 R258 + 0x7C0C0200, // 0010 CALL R3 1 + 0x80000000, // 0011 RET 0 R0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified class: lv_signal_bars +********************************************************************/ +extern const bclass be_class_lv_obj; +be_local_class(lv_signal_bars, + 6, + &be_class_lv_obj, + be_nested_map(10, + ( (struct bmapnode*) &(const bmapnode[]) { + { be_nested_key("p1", -1605446022, 2, -1), be_const_index(2) }, + { be_nested_key("my_design_cb", -1173588798, 12, -1), be_const_closure(my_design_cb_closure) }, + { be_nested_key("get_percentage", -1414483304, 14, -1), be_const_closure(get_percentage_closure) }, + { be_nested_key("init", 380752755, 4, 7), be_const_closure(init_closure) }, + { be_nested_key("set_percentage", -1342944572, 14, 0), be_const_closure(set_percentage_closure) }, + { be_nested_key("percentage", -1756136011, 10, 3), be_const_index(1) }, + { be_nested_key("area", -1693507260, 4, -1), be_const_index(5) }, + { be_nested_key("p2", -1622223641, 2, -1), be_const_index(3) }, + { be_nested_key("line_dsc", -200476318, 8, 1), be_const_index(4) }, + { be_nested_key("ancestor_design", 421545719, 15, -1), be_const_index(0) }, + })), + (be_nested_const_str("lv_signal_bars", -780994737, 14)) +); +/*******************************************************************/ + +void be_load_lv_signal_bars_class(bvm *vm) { + be_pushntvclass(vm, &be_class_lv_signal_bars); + be_setglobal(vm, "lv_signal_bars"); + be_pop(vm, 1); +} + +#endif // USE_LVGL \ No newline at end of file diff --git a/lib/libesp32/Berry/default/be_lvgl_signal_wifi_lib.c b/lib/libesp32/Berry/default/be_lvgl_signal_wifi_lib.c new file mode 100644 index 000000000..6e0a401af --- /dev/null +++ b/lib/libesp32/Berry/default/be_lvgl_signal_wifi_lib.c @@ -0,0 +1,113 @@ +/******************************************************************** + * Tasmota LVGL lv_signal_bars widget + *******************************************************************/ +#include "be_constobj.h" + +#ifdef USE_LVGL + +#include "lvgl.h" + +/******************************************************************** +** Solidified function: init +********************************************************************/ +be_local_closure(init, /* name */ + be_nested_proto( + 7, /* nstack */ + 3, /* argc */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[ 4]) { /* constants */ + be_nested_string("lv_signal_bars", -780994737, 14), /* R256 - K0 */ + be_nested_string("init", 380752755, 4), /* R257 - K1 */ + be_nested_string("tasmota", 424643812, 7), /* R258 - K2 */ + be_nested_string("add_driver", 1654458371, 10), /* R259 - K3 */ + }), + (be_nested_const_str("init", 380752755, 4)), + (be_nested_const_str("input", -103256197, 5)), + ( &(const binstruction[13]) { /* code */ + 0x600C0014, // 0000 GETGBL R3 G20 + 0x5C100000, // 0001 MOVE R4 R0 + 0xB8160000, // 0002 GETNGBL R5 R256 + 0x7C0C0400, // 0003 CALL R3 2 + 0x8C0C0701, // 0004 GETMET R3 R3 R257 + 0x5C140200, // 0005 MOVE R5 R1 + 0x5C180400, // 0006 MOVE R6 R2 + 0x7C0C0600, // 0007 CALL R3 3 + 0xB80E0400, // 0008 GETNGBL R3 R258 + 0x8C0C0703, // 0009 GETMET R3 R3 R259 + 0x5C140000, // 000A MOVE R5 R0 + 0x7C0C0400, // 000B CALL R3 2 + 0x80000000, // 000C RET 0 R0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: every_second +********************************************************************/ +be_local_closure(every_second, /* name */ + be_nested_proto( + 6, /* nstack */ + 1, /* argc */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[ 5]) { /* constants */ + be_nested_string("tasmota", 424643812, 7), /* R256 - K0 */ + be_nested_string("wifi", 120087624, 4), /* R257 - K1 */ + be_nested_string("find", -1108310694, 4), /* R258 - K2 */ + be_nested_string("quality", -1697296346, 7), /* R259 - K3 */ + be_nested_string("set_percentage", -1342944572, 14), /* R260 - K4 */ + }), + (be_nested_const_str("every_second", 2075451465, 12)), + (be_nested_const_str("input", -103256197, 5)), + ( &(const binstruction[13]) { /* code */ + 0xB8060000, // 0000 GETNGBL R1 R256 + 0x8C040301, // 0001 GETMET R1 R1 R257 + 0x7C040200, // 0002 CALL R1 1 + 0x8C080302, // 0003 GETMET R2 R1 R258 + 0x58100003, // 0004 LDCONST R4 K3 + 0x7C080400, // 0005 CALL R2 2 + 0x4C0C0000, // 0006 LDNIL 3 + 0x200C0403, // 0007 NE R3 R2 R3 + 0x780E0002, // 0008 JMPF R3 #000C + 0x8C0C0104, // 0009 GETMET R3 R0 R260 + 0x5C140400, // 000A MOVE R5 R2 + 0x7C0C0400, // 000B CALL R3 2 + 0x80000000, // 000C RET 0 R0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified class: lv_wifi_bars +********************************************************************/ +extern const bclass be_class_lv_signal_bars; +be_local_class(lv_wifi_bars, + 0, + &be_class_lv_signal_bars, + be_nested_map(2, + ( (struct bmapnode*) &(const bmapnode[]) { + { be_nested_key("init", 380752755, 4, -1), be_const_closure(init_closure) }, + { be_nested_key("every_second", 2075451465, 12, 0), be_const_closure(every_second_closure) }, + })), + (be_nested_const_str("lv_wifi_bars", 2109539196, 12)) +); +/*******************************************************************/ + +void be_load_lv_wifi_bars_class(bvm *vm) { + be_pushntvclass(vm, &be_class_lv_wifi_bars); + be_setglobal(vm, "lv_wifi_bars"); + be_pop(vm, 1); +} + +#endif // USE_LVGL \ No newline at end of file diff --git a/lib/libesp32/Berry/default/be_lvgl_widgets_lib.c b/lib/libesp32/Berry/default/be_lvgl_widgets_lib.c index 5c2161432..9bf31a2ca 100644 --- a/lib/libesp32/Berry/default/be_lvgl_widgets_lib.c +++ b/lib/libesp32/Berry/default/be_lvgl_widgets_lib.c @@ -852,6 +852,7 @@ extern int lvbe_msgbox_get_btnmatrix(bvm *vm); /* `lv_objmask` external functions definitions */ extern int lvbe_objmask_create(bvm *vm); +extern int lvbe_objmask_add_mask(bvm *vm); extern int lvbe_objmask_update_mask(bvm *vm); extern int lvbe_objmask_remove_mask(bvm *vm); diff --git a/lib/libesp32/Berry/default/be_modtab.c b/lib/libesp32/Berry/default/be_modtab.c index 42ef74c7f..b84559548 100644 --- a/lib/libesp32/Berry/default/be_modtab.c +++ b/lib/libesp32/Berry/default/be_modtab.c @@ -20,6 +20,7 @@ be_extern_native_module(sys); be_extern_native_module(debug); be_extern_native_module(gc); be_extern_native_module(solidify); +be_extern_native_module(introspect); /* Tasmota specific */ be_extern_native_module(light); @@ -68,6 +69,9 @@ BERRY_LOCAL const bntvmodule* const be_module_table[] = { #endif #if BE_USE_SOLIDIFY_MODULE &be_native_module(solidify), +#endif +#if BE_USE_INTROSPECT_MODULE + &be_native_module(introspect), #endif /* user-defined modules register start */ @@ -96,9 +100,14 @@ BERRY_LOCAL const bntvmodule* const be_module_table[] = { #ifdef ESP32 extern void be_load_tasmota_ntvlib(bvm *vm); extern void be_load_wirelib(bvm *vm); -extern void be_load_driverlib(bvm *vm); +extern void be_load_Driver_class(bvm *vm); extern void be_load_driver_i2c_lib(bvm *vm); extern void be_load_md5_lib(bvm *vm); +extern void be_load_aes_gcm_lib(bvm *vm); + +#ifdef USE_I2S_AUDIO_BERRY +extern void be_load_driver_audio_lib(bvm *vm); +#endif #ifdef USE_LVGL extern void be_load_lvgl_color_lib(bvm *vm); @@ -108,6 +117,9 @@ extern void be_load_lvgl_cb_lib(bvm *vm); extern void be_load_lvgl_cb_all_lib(bvm *vm); extern void be_load_lvgl_ctypes_lib(bvm *vm); extern void be_load_ctypes_definitions_lib(bvm *vm); +// custom widgets +extern void be_load_lv_signal_bars_class(bvm *vm); +extern void be_load_lv_wifi_bars_class(bvm *vm); #endif// USE_LVGL /* this code loads the native class definitions */ @@ -120,12 +132,18 @@ BERRY_API void be_load_custom_libs(bvm *vm) /* be_load_xxxlib(vm); */ #endif be_load_tasmota_ntvlib(vm); - be_load_driverlib(vm); + be_load_Driver_class(vm); be_load_md5_lib(vm); +#ifdef USE_ALEXA_AVS + be_load_aes_gcm_lib(vm); +#endif #ifdef USE_I2C be_load_wirelib(vm); be_load_driver_i2c_lib(vm); #endif // USE_I2C +#ifdef USE_I2S_AUDIO_BERRY + be_load_driver_audio_lib(vm); +#endif #ifdef USE_LVGL // LVGL be_load_lvgl_color_lib(vm); @@ -136,6 +154,9 @@ BERRY_API void be_load_custom_libs(bvm *vm) be_load_lvgl_cb_all_lib(vm); be_load_lvgl_ctypes_lib(vm); be_load_ctypes_definitions_lib(vm); + // custom widgets + be_load_lv_signal_bars_class(vm); + be_load_lv_wifi_bars_class(vm); #endif // USE_LVGL } #endif diff --git a/lib/libesp32/Berry/default/be_tasmotalib.c b/lib/libesp32/Berry/default/be_tasmotalib.c index f0268439e..f14657f33 100644 --- a/lib/libesp32/Berry/default/be_tasmotalib.c +++ b/lib/libesp32/Berry/default/be_tasmotalib.c @@ -7,6 +7,7 @@ extern int l_getFreeHeap(bvm *vm); extern int l_publish(bvm *vm); +extern int l_publish_result(bvm *vm); extern int l_cmd(bvm *vm); extern int l_get_cb(bvm *vm); extern int l_getoption(bvm *vm); @@ -15,6 +16,8 @@ extern int l_timereached(bvm *vm); extern int l_rtc(bvm *vm); extern int l_time_dump(bvm *vm); extern int l_memory(bvm *vm); +extern int l_wifi(bvm *vm); +extern int l_eth(bvm *vm); extern int l_yield(bvm *vm); extern int l_delay(bvm *vm); extern int l_scaleuint(bvm *vm); @@ -1361,200 +1364,112 @@ be_local_closure(gc, /* name */ ********************************************************************/ be_local_closure(event, /* name */ be_nested_proto( - 16, /* nstack */ - 5, /* argc */ + 19, /* nstack */ + 6, /* argc */ 0, /* has upvals */ NULL, /* no upvals */ 0, /* has sup protos */ NULL, /* no sub protos */ 1, /* has constants */ - ( &(const bvalue[29]) { /* upvals */ - { { .s=be_nested_const_str("cmd", -158181397, 3) }, BE_STRING}, - { { .s=be_nested_const_str("exec_cmd", 493567399, 8) }, BE_STRING}, - { { .s=be_nested_const_str("rule", -64077613, 4) }, BE_STRING}, - { { .s=be_nested_const_str("exec_rules", 1445221092, 10) }, BE_STRING}, - { { .s=be_nested_const_str("mqtt_data", -1756753932, 9) }, BE_STRING}, - { { .s=be_nested_const_str("gc", 1042313471, 2) }, BE_STRING}, - { { .s=be_nested_const_str("every_50ms", -1911083288, 10) }, BE_STRING}, - { { .s=be_nested_const_str("run_deferred", 371594696, 12) }, BE_STRING}, - { { .s=be_nested_const_str("_drivers", -1034638311, 8) }, BE_STRING}, - { { .s=be_nested_const_str("every_second", 2075451465, 12) }, BE_STRING}, - { { .s=be_nested_const_str("every_100ms", 1546407804, 11) }, BE_STRING}, - { { .s=be_nested_const_str("web_add_button", -757092238, 14) }, BE_STRING}, - { { .s=be_nested_const_str("web_add_main_button", -334599632, 19) }, BE_STRING}, - { { .s=be_nested_const_str("web_add_management_button", -1556090110, 25) }, BE_STRING}, - { { .s=be_nested_const_str("web_add_config_button", 639674325, 21) }, BE_STRING}, - { { .s=be_nested_const_str("web_add_console_button", -813531104, 22) }, BE_STRING}, - { { .s=be_nested_const_str("save_before_restart", 1253239338, 19) }, BE_STRING}, - { { .s=be_nested_const_str("web_add_handler", -304792334, 15) }, BE_STRING}, - { { .s=be_nested_const_str("web_sensor", -1394870324, 10) }, BE_STRING}, - { { .s=be_nested_const_str("json_append", -1292948012, 11) }, BE_STRING}, - { { .s=be_nested_const_str("button_pressed", 1694209616, 14) }, BE_STRING}, - { { .s=be_nested_const_str("button_preselif", 491115394, 15) }, BE_STRING}, - { { .s=be_nested_const_str("display", 1164572437, 7) }, BE_STRING}, - { { .s=be_nested_const_str("string", 398550328, 6) }, BE_STRING}, - { { .s=be_nested_const_str("log", 1062293841, 3) }, BE_STRING}, - { { .s=be_nested_const_str("format", -1180859054, 6) }, BE_STRING}, - { { .s=be_nested_const_str("BRY: exception %s - %m", -1290966132, 22) }, BE_STRING}, - { { .i=3 }, BE_INT}, - { { .s=be_nested_const_str("stop_iteration", -121173395, 14) }, BE_STRING}, + ( &(const bvalue[15]) { /* constants */ + be_nested_string("introspect", 164638290, 10), /* R256 - K0 */ + be_nested_string("every_50ms", -1911083288, 10), /* R257 - K1 */ + be_nested_string("run_deferred", 371594696, 12), /* R258 - K2 */ + be_nested_string("cmd", -158181397, 3), /* R259 - K3 */ + be_nested_string("exec_cmd", 493567399, 8), /* R260 - K4 */ + be_nested_string("rule", -64077613, 4), /* R261 - K5 */ + be_nested_string("exec_rules", 1445221092, 10), /* R262 - K6 */ + be_nested_string("gc", 1042313471, 2), /* R263 - K7 */ + be_nested_string("_drivers", -1034638311, 8), /* R264 - K8 */ + be_nested_string("get", 1410115415, 3), /* R265 - K9 */ + be_nested_string("function", -1630125495, 8), /* R266 - K10 */ + be_nested_string("string", 398550328, 6), /* R267 - K11 */ + be_nested_string("format", -1180859054, 6), /* R268 - K12 */ + be_nested_string("BRY: Exception> '%s' - %s", -2047976332, 25), /* R269 - K13 */ + be_nested_string("stop_iteration", -121173395, 14), /* R270 - K14 */ }), (be_nested_const_str("event", -30355297, 5)), (be_nested_const_str("input", -103256197, 5)), - ( &(const binstruction[153]) { /* code */ - 0x1C140300, // 0000 EQ R5 R1 R256 - 0x78160006, // 0001 JMPF R5 #0009 - 0x8C140101, // 0002 GETMET R5 R0 R257 - 0x5C1C0400, // 0003 MOVE R7 R2 - 0x5C200600, // 0004 MOVE R8 R3 - 0x5C240800, // 0005 MOVE R9 R4 - 0x7C140800, // 0006 CALL R5 4 - 0x80040A00, // 0007 RET 1 R5 - 0x7002008E, // 0008 JMP #0098 - 0x1C140302, // 0009 EQ R5 R1 R258 - 0x78160004, // 000A JMPF R5 #0010 - 0x8C140103, // 000B GETMET R5 R0 R259 - 0x5C1C0800, // 000C MOVE R7 R4 - 0x7C140400, // 000D CALL R5 2 - 0x80040A00, // 000E RET 1 R5 - 0x70020087, // 000F JMP #0098 - 0x1C140304, // 0010 EQ R5 R1 R260 - 0x78160002, // 0011 JMPF R5 #0015 - 0x4C140000, // 0012 LDNIL 5 - 0x80040A00, // 0013 RET 1 R5 - 0x70020082, // 0014 JMP #0098 - 0x1C140305, // 0015 EQ R5 R1 R261 - 0x78160003, // 0016 JMPF R5 #001B - 0x8C140105, // 0017 GETMET R5 R0 R261 - 0x7C140200, // 0018 CALL R5 1 - 0x80040A00, // 0019 RET 1 R5 - 0x7002007C, // 001A JMP #0098 - 0x1C140306, // 001B EQ R5 R1 R262 - 0x78160003, // 001C JMPF R5 #0021 - 0x8C140107, // 001D GETMET R5 R0 R263 - 0x7C140200, // 001E CALL R5 1 - 0x80040A00, // 001F RET 1 R5 - 0x70020076, // 0020 JMP #0098 - 0x88140108, // 0021 GETMBR R5 R0 R264 - 0x78160074, // 0022 JMPF R5 #0098 - 0x60140000, // 0023 GETGBL R5 G0 - 0x88180108, // 0024 GETMBR R6 R0 R264 - 0x7C140200, // 0025 CALL R5 1 - 0xA802006D, // 0026 EXBLK 0 #0095 - 0x5C180A00, // 0027 MOVE R6 R5 - 0x7C180000, // 0028 CALL R6 0 - 0xA802005E, // 0029 EXBLK 0 #0089 - 0x1C1C0309, // 002A EQ R7 R1 R265 - 0x781E0004, // 002B JMPF R7 #0031 - 0x881C0D09, // 002C GETMBR R7 R6 R265 - 0x781E0002, // 002D JMPF R7 #0031 - 0x8C1C0D09, // 002E GETMET R7 R6 R265 - 0x7C1C0200, // 002F CALL R7 1 - 0x70020055, // 0030 JMP #0087 - 0x1C1C030A, // 0031 EQ R7 R1 R266 - 0x781E0004, // 0032 JMPF R7 #0038 - 0x881C0D0A, // 0033 GETMBR R7 R6 R266 - 0x781E0002, // 0034 JMPF R7 #0038 - 0x8C1C0D0A, // 0035 GETMET R7 R6 R266 - 0x7C1C0200, // 0036 CALL R7 1 - 0x7002004E, // 0037 JMP #0087 - 0x1C1C030B, // 0038 EQ R7 R1 R267 - 0x781E0004, // 0039 JMPF R7 #003F - 0x881C0D0B, // 003A GETMBR R7 R6 R267 - 0x781E0002, // 003B JMPF R7 #003F - 0x8C1C0D0B, // 003C GETMET R7 R6 R267 - 0x7C1C0200, // 003D CALL R7 1 - 0x70020047, // 003E JMP #0087 - 0x1C1C030C, // 003F EQ R7 R1 R268 - 0x781E0004, // 0040 JMPF R7 #0046 - 0x881C0D0C, // 0041 GETMBR R7 R6 R268 - 0x781E0002, // 0042 JMPF R7 #0046 - 0x8C1C0D0C, // 0043 GETMET R7 R6 R268 - 0x7C1C0200, // 0044 CALL R7 1 - 0x70020040, // 0045 JMP #0087 - 0x1C1C030D, // 0046 EQ R7 R1 R269 - 0x781E0004, // 0047 JMPF R7 #004D - 0x881C0D0D, // 0048 GETMBR R7 R6 R269 - 0x781E0002, // 0049 JMPF R7 #004D - 0x8C1C0D0D, // 004A GETMET R7 R6 R269 - 0x7C1C0200, // 004B CALL R7 1 - 0x70020039, // 004C JMP #0087 - 0x1C1C030E, // 004D EQ R7 R1 R270 - 0x781E0004, // 004E JMPF R7 #0054 - 0x881C0D0E, // 004F GETMBR R7 R6 R270 - 0x781E0002, // 0050 JMPF R7 #0054 - 0x8C1C0D0E, // 0051 GETMET R7 R6 R270 - 0x7C1C0200, // 0052 CALL R7 1 - 0x70020032, // 0053 JMP #0087 - 0x1C1C030F, // 0054 EQ R7 R1 R271 - 0x781E0004, // 0055 JMPF R7 #005B - 0x881C0D0F, // 0056 GETMBR R7 R6 R271 - 0x781E0002, // 0057 JMPF R7 #005B - 0x8C1C0D0F, // 0058 GETMET R7 R6 R271 - 0x7C1C0200, // 0059 CALL R7 1 - 0x7002002B, // 005A JMP #0087 - 0x1C1C0310, // 005B EQ R7 R1 R272 - 0x781E0004, // 005C JMPF R7 #0062 - 0x881C0D10, // 005D GETMBR R7 R6 R272 - 0x781E0002, // 005E JMPF R7 #0062 - 0x8C1C0D10, // 005F GETMET R7 R6 R272 - 0x7C1C0200, // 0060 CALL R7 1 - 0x70020024, // 0061 JMP #0087 - 0x1C1C0311, // 0062 EQ R7 R1 R273 - 0x781E0004, // 0063 JMPF R7 #0069 - 0x881C0D11, // 0064 GETMBR R7 R6 R273 - 0x781E0002, // 0065 JMPF R7 #0069 - 0x8C1C0D11, // 0066 GETMET R7 R6 R273 - 0x7C1C0200, // 0067 CALL R7 1 - 0x7002001D, // 0068 JMP #0087 - 0x1C1C0312, // 0069 EQ R7 R1 R274 - 0x781E0004, // 006A JMPF R7 #0070 - 0x881C0D12, // 006B GETMBR R7 R6 R274 - 0x781E0002, // 006C JMPF R7 #0070 - 0x8C1C0D12, // 006D GETMET R7 R6 R274 - 0x7C1C0200, // 006E CALL R7 1 - 0x70020016, // 006F JMP #0087 - 0x1C1C0313, // 0070 EQ R7 R1 R275 - 0x781E0004, // 0071 JMPF R7 #0077 - 0x881C0D13, // 0072 GETMBR R7 R6 R275 - 0x781E0002, // 0073 JMPF R7 #0077 - 0x8C1C0D13, // 0074 GETMET R7 R6 R275 - 0x7C1C0200, // 0075 CALL R7 1 - 0x7002000F, // 0076 JMP #0087 - 0x1C1C0314, // 0077 EQ R7 R1 R276 - 0x781E0007, // 0078 JMPF R7 #0081 - 0x881C0D14, // 0079 GETMBR R7 R6 R276 - 0x781E0005, // 007A JMPF R7 #0081 - 0x1C1C0311, // 007B EQ R7 R1 R273 - 0x781DFFFE, // 007C JMPF R7 #007C - 0x881C0D16, // 007D GETMBR R7 R6 R278 - 0x8C1C0D16, // 007E GETMET R7 R6 R278 - 0x7C1C0200, // 007F CALL R7 1 - 0x70020005, // 0080 JMP #0087 - 0x1C1C0316, // 0081 EQ R7 R1 R278 - 0x781E0003, // 0082 JMPF R7 #0087 - 0x881C0D16, // 0083 GETMBR R7 R6 R278 - 0x781E0001, // 0084 JMPF R7 #0087 - 0x8C1C0D16, // 0085 GETMET R7 R6 R278 - 0x7C1C0200, // 0086 CALL R7 1 - 0xA8040001, // 0087 EXBLK 1 1 - 0x7002000A, // 0088 JMP #0094 - 0xAC1C0002, // 0089 CATCH R7 0 2 - 0x70020007, // 008A JMP #0093 - 0xA4262E00, // 008B IMPORT R9 R279 - 0x8C280118, // 008C GETMET R10 R0 R280 - 0x8C301319, // 008D GETMET R12 R9 R281 - 0x5838001A, // 008E LDCONST R14 K26 - 0x583C001B, // 008F LDCONST R15 K27 - 0x7C300600, // 0090 CALL R12 3 - 0x7C280400, // 0091 CALL R10 2 - 0x70020000, // 0092 JMP #0094 - 0xB0080000, // 0093 RAISE 2 R0 R0 - 0x7001FF91, // 0094 JMP #0027 - 0x5814001C, // 0095 LDCONST R5 K28 - 0xAC140200, // 0096 CATCH R5 1 0 - 0xB0080000, // 0097 RAISE 2 R0 R0 - 0x80000000, // 0098 RET 0 R0 + ( &(const binstruction[79]) { /* code */ + 0xA41A0000, // 0000 IMPORT R6 R256 + 0x1C1C0301, // 0001 EQ R7 R1 R257 + 0x781E0001, // 0002 JMPF R7 #0005 + 0x8C1C0102, // 0003 GETMET R7 R0 R258 + 0x7C1C0200, // 0004 CALL R7 1 + 0x1C1C0303, // 0005 EQ R7 R1 R259 + 0x781E0006, // 0006 JMPF R7 #000E + 0x8C1C0104, // 0007 GETMET R7 R0 R260 + 0x5C240400, // 0008 MOVE R9 R2 + 0x5C280600, // 0009 MOVE R10 R3 + 0x5C2C0800, // 000A MOVE R11 R4 + 0x7C1C0800, // 000B CALL R7 4 + 0x80040E00, // 000C RET 1 R7 + 0x7002003F, // 000D JMP #004E + 0x1C1C0305, // 000E EQ R7 R1 R261 + 0x781E0004, // 000F JMPF R7 #0015 + 0x8C1C0106, // 0010 GETMET R7 R0 R262 + 0x5C240800, // 0011 MOVE R9 R4 + 0x7C1C0400, // 0012 CALL R7 2 + 0x80040E00, // 0013 RET 1 R7 + 0x70020038, // 0014 JMP #004E + 0x1C1C0307, // 0015 EQ R7 R1 R263 + 0x781E0003, // 0016 JMPF R7 #001B + 0x8C1C0107, // 0017 GETMET R7 R0 R263 + 0x7C1C0200, // 0018 CALL R7 1 + 0x80040E00, // 0019 RET 1 R7 + 0x70020032, // 001A JMP #004E + 0x881C0108, // 001B GETMBR R7 R0 R264 + 0x781E0030, // 001C JMPF R7 #004E + 0x601C0000, // 001D GETGBL R7 G0 + 0x88200108, // 001E GETMBR R8 R0 R264 + 0x7C1C0200, // 001F CALL R7 1 + 0xA8020027, // 0020 EXBLK 0 #0049 + 0x5C200E00, // 0021 MOVE R8 R7 + 0x7C200000, // 0022 CALL R8 0 + 0x8C240D09, // 0023 GETMET R9 R6 R265 + 0x5C2C1000, // 0024 MOVE R11 R8 + 0x5C300200, // 0025 MOVE R12 R1 + 0x7C240600, // 0026 CALL R9 3 + 0x60280015, // 0027 GETGBL R10 G21 + 0x5C2C1200, // 0028 MOVE R11 R9 + 0x7C280200, // 0029 CALL R10 1 + 0x1C28150A, // 002A EQ R10 R10 R266 + 0x782A001B, // 002B JMPF R10 #0048 + 0xA802000E, // 002C EXBLK 0 #003C + 0x5C281200, // 002D MOVE R10 R9 + 0x5C2C1000, // 002E MOVE R11 R8 + 0x5C300400, // 002F MOVE R12 R2 + 0x5C340600, // 0030 MOVE R13 R3 + 0x5C380800, // 0031 MOVE R14 R4 + 0x5C3C0A00, // 0032 MOVE R15 R5 + 0x7C280A00, // 0033 CALL R10 5 + 0x502C0200, // 0034 LDBOOL R11 1 0 + 0x1C2C140B, // 0035 EQ R11 R10 R11 + 0x782E0002, // 0036 JMPF R11 #003A + 0x502C0200, // 0037 LDBOOL R11 1 0 + 0xA8040002, // 0038 EXBLK 1 2 + 0x80041600, // 0039 RET 1 R11 + 0xA8040001, // 003A EXBLK 1 1 + 0x7002000B, // 003B JMP #0048 + 0xAC280002, // 003C CATCH R10 0 2 + 0x70020008, // 003D JMP #0047 + 0xA4321600, // 003E IMPORT R12 R267 + 0x6034000F, // 003F GETGBL R13 G15 + 0x8C38190C, // 0040 GETMET R14 R12 R268 + 0x5840000D, // 0041 LDCONST R16 K13 + 0x5C441400, // 0042 MOVE R17 R10 + 0x5C481600, // 0043 MOVE R18 R11 + 0x7C380800, // 0044 CALL R14 4 + 0x7C340200, // 0045 CALL R13 1 + 0x70020000, // 0046 JMP #0048 + 0xB0080000, // 0047 RAISE 2 R0 R0 + 0x7001FFD7, // 0048 JMP #0021 + 0x581C000E, // 0049 LDCONST R7 K14 + 0xAC1C0200, // 004A CATCH R7 1 0 + 0xB0080000, // 004B RAISE 2 R0 R0 + 0x501C0000, // 004C LDBOOL R7 0 0 + 0x80040E00, // 004D RET 1 R7 + 0x80000000, // 004E RET 0 R0 }) ) ); @@ -1843,54 +1758,47 @@ static const bclosure wire_scan_closure = { /******************************************************************** ** Solidified function: time_str ********************************************************************/ - -/********** Solidified proto: time_str */ -be_define_local_const_str(time_str_str_name, "time_str", -1681139684, 8); -be_define_local_const_str(time_str_str_source, "input", -103256197, 5); -be_define_local_const_str(time_str_str_0, "string", 398550328, 6); -be_define_local_const_str(time_str_str_1, "time_dump", -964556549, 9); -be_define_local_const_str(time_str_str_2, "format", -1180859054, 6); -be_define_local_const_str(time_str_str_3, "%04d-%02d-%02dT%02d:%02d:%02d", -869438695, 29); -be_define_local_const_str(time_str_str_4, "year", -1367388900, 4); -be_define_local_const_str(time_str_str_5, "month", -696646139, 5); -be_define_local_const_str(time_str_str_6, "day", -464576003, 3); -be_define_local_const_str(time_str_str_7, "hour", -1241306097, 4); -be_define_local_const_str(time_str_str_8, "min", -913357481, 3); -be_define_local_const_str(time_str_str_9, "sec", -1155074638, 3); - -static const bvalue time_str_ktab[10] = { - { { .s=be_local_const_str(time_str_str_0) }, BE_STRING}, - { { .s=be_local_const_str(time_str_str_1) }, BE_STRING}, - { { .s=be_local_const_str(time_str_str_2) }, BE_STRING}, - { { .s=be_local_const_str(time_str_str_3) }, BE_STRING}, - { { .s=be_local_const_str(time_str_str_4) }, BE_STRING}, - { { .s=be_local_const_str(time_str_str_5) }, BE_STRING}, - { { .s=be_local_const_str(time_str_str_6) }, BE_STRING}, - { { .s=be_local_const_str(time_str_str_7) }, BE_STRING}, - { { .s=be_local_const_str(time_str_str_8) }, BE_STRING}, - { { .s=be_local_const_str(time_str_str_9) }, BE_STRING}, -}; - -static const uint32_t time_str_code[14] = { - 0xA40A0000, // 0000 IMPORT R2 R256 - 0x8C0C0101, // 0001 GETMET R3 R0 R257 - 0x5C140200, // 0002 MOVE R5 R1 - 0x7C0C0400, // 0003 CALL R3 2 - 0x8C100502, // 0004 GETMET R4 R2 R258 - 0x58180003, // 0005 LDCONST R6 K3 - 0x941C0704, // 0006 GETIDX R7 R3 R260 - 0x94200705, // 0007 GETIDX R8 R3 R261 - 0x94240706, // 0008 GETIDX R9 R3 R262 - 0x94280707, // 0009 GETIDX R10 R3 R263 - 0x942C0708, // 000A GETIDX R11 R3 R264 - 0x94300709, // 000B GETIDX R12 R3 R265 - 0x7C101000, // 000C CALL R4 8 - 0x80040800, // 000D RET 1 R4 -}; - -be_define_local_proto(time_str, 13, 2, 1, 0, 0); -be_define_local_closure(time_str); - +be_local_closure(time_str, /* name */ + be_nested_proto( + 13, /* nstack */ + 2, /* argc */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[10]) { /* constants */ + be_nested_string("string", 398550328, 6), + be_nested_string("time_dump", -964556549, 9), + be_nested_string("format", -1180859054, 6), + be_nested_string("%04d-%02d-%02dT%02d:%02d:%02d", -869438695, 29), + be_nested_string("year", -1367388900, 4), + be_nested_string("month", -696646139, 5), + be_nested_string("day", -464576003, 3), + be_nested_string("hour", -1241306097, 4), + be_nested_string("min", -913357481, 3), + be_nested_string("sec", -1155074638, 3), + }), + (be_nested_const_str("time_str", -1681139684, 8)), + (be_nested_const_str("input", -103256197, 5)), + ( &(const binstruction[14]) { /* code */ + 0xA40A0000, // 0000 IMPORT R2 R256 + 0x8C0C0101, // 0001 GETMET R3 R0 R257 + 0x5C140200, // 0002 MOVE R5 R1 + 0x7C0C0400, // 0003 CALL R3 2 + 0x8C100502, // 0004 GETMET R4 R2 R258 + 0x58180003, // 0005 LDCONST R6 K3 + 0x941C0704, // 0006 GETIDX R7 R3 R260 + 0x94200705, // 0007 GETIDX R8 R3 R261 + 0x94240706, // 0008 GETIDX R9 R3 R262 + 0x94280707, // 0009 GETIDX R10 R3 R263 + 0x942C0708, // 000A GETIDX R11 R3 R264 + 0x94300709, // 000B GETIDX R12 R3 R265 + 0x7C101000, // 000C CALL R4 8 + 0x80040800, // 000D RET 1 R4 + }) + ) +); /*******************************************************************/ /******************************************************************** @@ -2166,115 +2074,112 @@ static const bclosure set_light_closure = { /*******************************************************************/ - /******************************************************************** ** Solidified function: cb_dispatch ********************************************************************/ - -/********** Solidified proto: cb_dispatch */ -be_define_local_const_str(cb_dispatch_str_name, "cb_dispatch", 1741510499, 11); -be_define_local_const_str(cb_dispatch_str_source, "input", -103256197, 5); -be_define_local_const_str(cb_dispatch_str_0, "_cb", -251666929, 3); -be_define_local_const_str(cb_dispatch_str_2, "find", -1108310694, 4); - -static const bvalue cb_dispatch_ktab[3] = { - { { .s=be_local_const_str(cb_dispatch_str_0) }, BE_STRING}, - { { .i=0 }, BE_INT}, - { { .s=be_local_const_str(cb_dispatch_str_2) }, BE_STRING}, -}; - -static const uint32_t cb_dispatch_code[20] = { - 0x88180100, // 0000 GETMBR R6 R0 R256 - 0x4C1C0000, // 0001 LDNIL 7 - 0x1C180C07, // 0002 EQ R6 R6 R7 - 0x781A0000, // 0003 JMPF R6 #0005 - 0x80060200, // 0004 RET 1 R257 - 0x88180100, // 0005 GETMBR R6 R0 R256 - 0x8C180D02, // 0006 GETMET R6 R6 R258 - 0x5C200200, // 0007 MOVE R8 R1 - 0x7C180400, // 0008 CALL R6 2 - 0x4C1C0000, // 0009 LDNIL 7 - 0x201C0C07, // 000A NE R7 R6 R7 - 0x781E0006, // 000B JMPF R7 #0013 - 0x5C1C0C00, // 000C MOVE R7 R6 - 0x5C200400, // 000D MOVE R8 R2 - 0x5C240600, // 000E MOVE R9 R3 - 0x5C280800, // 000F MOVE R10 R4 - 0x5C2C0A00, // 0010 MOVE R11 R5 - 0x7C1C0800, // 0011 CALL R7 4 - 0x80040E00, // 0012 RET 1 R7 - 0x80060200, // 0013 RET 1 R257 -}; - -be_define_local_proto(cb_dispatch, 12, 6, 1, 0, 0); -be_define_local_closure(cb_dispatch); - +be_local_closure(cb_dispatch, /* name */ + be_nested_proto( + 12, /* nstack */ + 6, /* argc */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[ 3]) { /* constants */ + be_nested_string("_cb", -251666929, 3), + be_const_int(0), + be_nested_string("find", -1108310694, 4), + }), + (be_nested_const_str("cb_dispatch", 1741510499, 11)), + (be_nested_const_str("input", -103256197, 5)), + ( &(const binstruction[20]) { /* code */ + 0x88180100, // 0000 GETMBR R6 R0 R256 + 0x4C1C0000, // 0001 LDNIL 7 + 0x1C180C07, // 0002 EQ R6 R6 R7 + 0x781A0000, // 0003 JMPF R6 #0005 + 0x80060200, // 0004 RET 1 R257 + 0x88180100, // 0005 GETMBR R6 R0 R256 + 0x8C180D02, // 0006 GETMET R6 R6 R258 + 0x5C200200, // 0007 MOVE R8 R1 + 0x7C180400, // 0008 CALL R6 2 + 0x4C1C0000, // 0009 LDNIL 7 + 0x201C0C07, // 000A NE R7 R6 R7 + 0x781E0006, // 000B JMPF R7 #0013 + 0x5C1C0C00, // 000C MOVE R7 R6 + 0x5C200400, // 000D MOVE R8 R2 + 0x5C240600, // 000E MOVE R9 R3 + 0x5C280800, // 000F MOVE R10 R4 + 0x5C2C0A00, // 0010 MOVE R11 R5 + 0x7C1C0800, // 0011 CALL R7 4 + 0x80040E00, // 0012 RET 1 R7 + 0x80060200, // 0013 RET 1 R257 + }) + ) +); /*******************************************************************/ /******************************************************************** ** Solidified function: gen_cb ********************************************************************/ - -/********** Solidified proto: gen_cb */ -be_define_local_const_str(gen_cb_str_name, "gen_cb", -1049739745, 6); -be_define_local_const_str(gen_cb_str_source, "input", -103256197, 5); -be_define_local_const_str(gen_cb_str_0, "_cb", -251666929, 3); -be_define_local_const_str(gen_cb_str_2, "find", -1108310694, 4); -be_define_local_const_str(gen_cb_str_3, "_get_cb", 1448849122, 7); -be_define_local_const_str(gen_cb_str_4, "stop_iteration", -121173395, 14); -be_define_local_const_str(gen_cb_str_5, "internal_error", -1775809127, 14); -be_define_local_const_str(gen_cb_str_6, "No callback available", 633786138, 21); - -static const bvalue gen_cb_ktab[7] = { - { { .s=be_local_const_str(gen_cb_str_0) }, BE_STRING}, - { { .i=0 }, BE_INT}, - { { .s=be_local_const_str(gen_cb_str_2) }, BE_STRING}, - { { .s=be_local_const_str(gen_cb_str_3) }, BE_STRING}, - { { .s=be_local_const_str(gen_cb_str_4) }, BE_STRING}, - { { .s=be_local_const_str(gen_cb_str_5) }, BE_STRING}, - { { .s=be_local_const_str(gen_cb_str_6) }, BE_STRING}, -}; - -static const uint32_t gen_cb_code[34] = { - 0x88080100, // 0000 GETMBR R2 R0 R256 - 0x4C0C0000, // 0001 LDNIL 3 - 0x1C080403, // 0002 EQ R2 R2 R3 - 0x780A0002, // 0003 JMPF R2 #0007 - 0x6008000B, // 0004 GETGBL R2 G11 - 0x7C080000, // 0005 CALL R2 0 - 0x90020002, // 0006 SETMBR R0 R256 R2 - 0x60080000, // 0007 GETGBL R2 G0 - 0x540E0012, // 0008 LDINT R3 19 - 0x400E0203, // 0009 CONNECT R3 R257 R3 - 0x7C080200, // 000A CALL R2 1 - 0xA8020010, // 000B EXBLK 0 #001D - 0x5C0C0400, // 000C MOVE R3 R2 - 0x7C0C0000, // 000D CALL R3 0 - 0x88100100, // 000E GETMBR R4 R0 R256 - 0x8C100902, // 000F GETMET R4 R4 R258 - 0x5C180600, // 0010 MOVE R6 R3 - 0x7C100400, // 0011 CALL R4 2 - 0x4C140000, // 0012 LDNIL 5 - 0x1C100805, // 0013 EQ R4 R4 R5 - 0x78120006, // 0014 JMPF R4 #001C - 0x88100100, // 0015 GETMBR R4 R0 R256 - 0x98100601, // 0016 SETIDX R4 R3 R1 - 0x8C100103, // 0017 GETMET R4 R0 R259 - 0x5C180600, // 0018 MOVE R6 R3 - 0x7C100400, // 0019 CALL R4 2 - 0xA8040001, // 001A EXBLK 1 1 - 0x80040800, // 001B RET 1 R4 - 0x7001FFEE, // 001C JMP #000C - 0x58080004, // 001D LDCONST R2 K4 - 0xAC080200, // 001E CATCH R2 1 0 - 0xB0080000, // 001F RAISE 2 R0 R0 - 0xB0060B06, // 0020 RAISE 1 R261 R262 - 0x80000000, // 0021 RET 0 R0 -}; - -be_define_local_proto(gen_cb, 7, 2, 1, 0, 0); -be_define_local_closure(gen_cb); - +be_local_closure(gen_cb, /* name */ + be_nested_proto( + 7, /* nstack */ + 2, /* argc */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + ( &(const bvalue[ 7]) { /* constants */ + be_nested_string("_cb", -251666929, 3), + be_const_int(0), + be_nested_string("find", -1108310694, 4), + be_nested_string("_get_cb", 1448849122, 7), + be_nested_string("stop_iteration", -121173395, 14), + be_nested_string("internal_error", -1775809127, 14), + be_nested_string("No callback available", 633786138, 21), + }), + (be_nested_const_str("gen_cb", -1049739745, 6)), + (be_nested_const_str("input", -103256197, 5)), + ( &(const binstruction[34]) { /* code */ + 0x88080100, // 0000 GETMBR R2 R0 R256 + 0x4C0C0000, // 0001 LDNIL 3 + 0x1C080403, // 0002 EQ R2 R2 R3 + 0x780A0002, // 0003 JMPF R2 #0007 + 0x6008000B, // 0004 GETGBL R2 G11 + 0x7C080000, // 0005 CALL R2 0 + 0x90020002, // 0006 SETMBR R0 R256 R2 + 0x60080000, // 0007 GETGBL R2 G0 + 0x540E0012, // 0008 LDINT R3 19 + 0x400E0203, // 0009 CONNECT R3 R257 R3 + 0x7C080200, // 000A CALL R2 1 + 0xA8020010, // 000B EXBLK 0 #001D + 0x5C0C0400, // 000C MOVE R3 R2 + 0x7C0C0000, // 000D CALL R3 0 + 0x88100100, // 000E GETMBR R4 R0 R256 + 0x8C100902, // 000F GETMET R4 R4 R258 + 0x5C180600, // 0010 MOVE R6 R3 + 0x7C100400, // 0011 CALL R4 2 + 0x4C140000, // 0012 LDNIL 5 + 0x1C100805, // 0013 EQ R4 R4 R5 + 0x78120006, // 0014 JMPF R4 #001C + 0x88100100, // 0015 GETMBR R4 R0 R256 + 0x98100601, // 0016 SETIDX R4 R3 R1 + 0x8C100103, // 0017 GETMET R4 R0 R259 + 0x5C180600, // 0018 MOVE R6 R3 + 0x7C100400, // 0019 CALL R4 2 + 0xA8040001, // 001A EXBLK 1 1 + 0x80040800, // 001B RET 1 R4 + 0x7001FFEE, // 001C JMP #000C + 0x58080004, // 001D LDCONST R2 K4 + 0xAC080200, // 001E CATCH R2 1 0 + 0xB0080000, // 001F RAISE 2 R0 R0 + 0xB0060B06, // 0020 RAISE 1 R261 R262 + 0x80000000, // 0021 RET 0 R0 + }) + ) +); /*******************************************************************/ @@ -2297,6 +2202,7 @@ void be_load_tasmota_ntvlib(bvm *vm) { "wire2", NULL }, { "get_free_heap", l_getFreeHeap }, { "publish", l_publish }, + { "publish_result", l_publish_result }, { "_cmd", l_cmd }, { "_get_cb", l_get_cb }, { "get_option", l_getoption }, @@ -2305,6 +2211,8 @@ void be_load_tasmota_ntvlib(bvm *vm) { "rtc", l_rtc }, { "time_dump", l_time_dump }, { "memory", l_memory }, + { "wifi", l_wifi }, + { "eth", l_eth }, { "yield", l_yield }, { "delay", l_delay }, { "scale_uint", l_scaleuint }, @@ -2378,6 +2286,7 @@ class be_class_tasmota (scope: global, name: Tasmota) { get_free_heap, func(l_getFreeHeap) publish, func(l_publish) + publish_result, func(l_publish_result) _cmd, func(l_cmd) _get_cb, func(l_get_cb) get_option, func(l_getoption) @@ -2386,6 +2295,8 @@ class be_class_tasmota (scope: global, name: Tasmota) { rtc, func(l_rtc) time_dump, func(l_time_dump) memory, func(l_memory) + wifi, func(l_wifi) + eth, func(l_eth) yield, func(l_yield) delay, func(l_delay) scale_uint, func(l_scaleuint) diff --git a/lib/libesp32/Berry/default/berry_conf.h b/lib/libesp32/Berry/default/berry_conf.h index c13952e58..aaa244434 100644 --- a/lib/libesp32/Berry/default/berry_conf.h +++ b/lib/libesp32/Berry/default/berry_conf.h @@ -83,7 +83,7 @@ * expanded if the number of free is less than BE_STACK_FREE_MIN. * Default: 10 **/ -#define BE_STACK_FREE_MIN 10 +#define BE_STACK_FREE_MIN 20 /* Macro: BE_STACK_FREE_MIN * The short string will hold the hash value when the value is @@ -158,6 +158,7 @@ #define BE_USE_DEBUG_MODULE 1 #define BE_USE_GC_MODULE 1 #define BE_USE_SOLIDIFY_MODULE 1 +#define BE_USE_INTROSPECT_MODULE 1 /* Macro: BE_EXPLICIT_XXX * If these macros are defined, the corresponding function will diff --git a/lib/libesp32/Berry/default/embedded/Driver.be b/lib/libesp32/Berry/default/embedded/Driver.be new file mode 100644 index 000000000..d0782f024 --- /dev/null +++ b/lib/libesp32/Berry/default/embedded/Driver.be @@ -0,0 +1,29 @@ +#- Native code used for testing and code solidification -# +#- Do not use it -# + +class Driver + var every_second + var every_100ms + var web_add_handler + var web_add_button + var web_add_main_button + var web_add_management_button + var web_add_config_button + var web_add_console_button + var save_before_restart + var web_sensor + var json_append + var button_pressed + var display + + def init() + end + + def get_tasmota() + return tasmota + end + + def add_cmd(c, f) + tasmota.add_cmd(c, / cmd, idx, payload, payload_json -> f(self, cmd, idx, payload, payload_json)) + end +end diff --git a/lib/libesp32/Berry/default/embedded/Tasmota.be b/lib/libesp32/Berry/default/embedded/Tasmota.be index 4b3647168..7b36f6caf 100644 --- a/lib/libesp32/Berry/default/embedded/Tasmota.be +++ b/lib/libesp32/Berry/default/embedded/Tasmota.be @@ -1,7 +1,7 @@ #- Native code used for testing and code solidification -# #- Do not use it -# -class Tasmota2 : Tasmota +class Tasmota # add `chars_in_string(s:string,c:string) -> int`` # looks for any char in c, and return the position of the first char @@ -241,35 +241,27 @@ class Tasmota2 : Tasmota end - def event(type, cmd, idx, payload) - if type=='cmd' return self.exec_cmd(cmd, idx, payload) - elif type=='rule' return self.exec_rules(payload) - elif type=='mqtt_data' return nil - elif type=='gc' return self.gc() - elif type=='every_50ms' return self.run_deferred() + def event(event_type, cmd, idx, payload, raw) + import introspect + if event_type=='every_50ms' self.run_deferred() end #- first run deferred events -# + + if event_type=='cmd' return self.exec_cmd(cmd, idx, payload) + elif event_type=='rule' return self.exec_rules(payload) + elif event_type=='gc' return self.gc() elif self._drivers for d:self._drivers - try - if type=='every_second' && d.every_second d.every_second() - elif type=='every_100ms' && d.every_100ms d.every_100ms() - elif type=='web_add_button' && d.web_add_button d.web_add_button() - elif type=='web_add_main_button' && d.web_add_main_button d.web_add_main_button() - elif type=='web_add_management_button' && d.web_add_management_button d.web_add_management_button() - elif type=='web_add_config_button' && d.web_add_config_button d.web_add_config_button() - elif type=='web_add_console_button' && d.web_add_console_button d.web_add_console_button() - elif type=='save_before_restart' && d.save_before_restart d.save_before_restart() - elif type=='web_add_handler' && d.web_add_handler d.web_add_handler() - elif type=='web_sensor' && d.web_sensor d.web_sensor() - elif type=='json_append' && d.json_append d.json_append() - elif type=='button_pressed' && d.button_pressed d.button_pressed() - elif type=='web_add_handler' && d.display d.display() - elif type=='display' && d.display d.display() + var f = introspect.get(d, event_type) # try to match a function or method with the same name + if type(f) == 'function' + try + var done = f(d, cmd, idx, payload, raw) + if done == true return true end + except .. as e,m + import string + print(string.format("BRY: Exception> '%s' - %s", e, m)) end - except .. as e,m - import string - print(string.format("BRY: Exception> '%s' - %s", e, m)) end end + return false end end @@ -297,4 +289,3 @@ class Tasmota2 : Tasmota end end -tasmota = Tasmota2() \ No newline at end of file diff --git a/lib/libesp32/Berry/default/embedded/lv_signal_bars.be b/lib/libesp32/Berry/default/embedded/lv_signal_bars.be new file mode 100644 index 000000000..59985cf7d --- /dev/null +++ b/lib/libesp32/Berry/default/embedded/lv_signal_bars.be @@ -0,0 +1,98 @@ +#- LVGL lv_signal_bars and lv_wifi_bars + - +--# + +class lv_signal_bars : lv_obj + var ancestor_design # previous design_cb + var percentage + var p1, p2, line_dsc, area + + def init(parent, copy) + # init parent object + super(self, lv_obj).init(parent, copy) + # keep a copy of + self.ancestor_design = self.get_design_cb() + self.set_design_cb(self.my_design_cb) + # own values + self.percentage = 100 + # pre-allocate buffers + self.p1 = lv_point() + self.p2 = lv_point() + self.line_dsc = lv_draw_line_dsc() + self.area = lv_area() + end + + def my_design_cb(area, mode) + def atleast1(x) if x >= 1 return x else return 1 end end + # the model is that we have 4 bars and inter-bar (1/4 of width) + var height = self.get_height() + var width = self.get_width() + + var inter_bar = atleast1(width / 15) + var bar = atleast1((width - inter_bar * 3) / 4) + var bar_offset = bar / 2 + + if mode == lv.DESIGN_COVER_CHK + #- Return false if the object is not covers the clip_area area -# + return self.ancestor_design.call(self, area, mode) + + elif mode == lv.DESIGN_DRAW_MAIN + #self.ancestor_design.call(self, area, mode) - don't draw a background + + # get coordinates of area + self.get_coords(area) + var x_ofs = area.x1 + var y_ofs = area.y1 + + lv.draw_line_dsc_init(self.line_dsc) + self.init_draw_line_dsc(lv.OBJ_PART_MAIN, self.line_dsc) + + self.line_dsc.round_start = 1 + self.line_dsc.round_end = 1 + self.line_dsc.width = bar + var on_color = self.get_style_line_color(lv.OBJ_PART_MAIN, lv.STATE_DEFAULT) + var off_color = self.get_style_bg_color(lv.OBJ_PART_MAIN, lv.STATE_DEFAULT) + + for i:0..3 + self.line_dsc.color = self.percentage >= (i+1)*20 ? on_color : off_color + self.p1.y = y_ofs + height - 1 - bar_offset + self.p1.x = x_ofs + i * (bar + inter_bar) + bar_offset + self.p2.y = y_ofs + ((3 - i) * (height - bar)) / 4 + bar_offset + self.p2.x = self.p1.x + lv.draw_line(self.p1, self.p2, area, self.line_dsc) + end + #elif mode == lv.DESIGN_DRAW_POST # we don't want a frame around this object + #self.ancestor_design.call(self, area, mode) + end + return lv.DESIGN_RES_OK + end + + def set_percentage(v) + var old_bars = self.percentage / 5 + if v > 100 v = 100 end + if v < 0 v = 0 end + self.percentage = v + if old_bars != v / 5 + self.invalidate() # be frugal and avoid updating the widget if it's not needed + end + end + + def get_percentage() + return self.percentage + end +end + +class lv_wifi_bars: lv_signal_bars + def init(parent, copy) + super(self, lv_signal_bars).init(parent, copy) + tasmota.add_driver(self) + end + + def every_second() + var wifi = tasmota.wifi() + var quality = wifi.find("quality") + if quality != nil + self.set_percentage(quality) + end + end +end \ No newline at end of file diff --git a/lib/libesp32/Berry/generate/be_const_strtab.h b/lib/libesp32/Berry/generate/be_const_strtab.h index 6691c08f6..e4b933205 100644 --- a/lib/libesp32/Berry/generate/be_const_strtab.h +++ b/lib/libesp32/Berry/generate/be_const_strtab.h @@ -1,634 +1,652 @@ -extern const bcstring be_const_str_lv_style; -extern const bcstring be_const_str_ETH_PHY_MDIO; -extern const bcstring be_const_str_SYMBOL_PLUS; -extern const bcstring be_const_str_hex; -extern const bcstring be_const_str_setrange; -extern const bcstring be_const_str_bus; -extern const bcstring be_const_str_concat; -extern const bcstring be_const_str_raise; -extern const bcstring be_const_str_ROT1A; -extern const bcstring be_const_str_SPI_CLK; -extern const bcstring be_const_str_SYMBOL_MINUS; -extern const bcstring be_const_str_WEBCAM_PSCLK; -extern const bcstring be_const_str_top; -extern const bcstring be_const_str_EPAPER42_CS; -extern const bcstring be_const_str_return; -extern const bcstring be_const_str_MCP39F5_RST; -extern const bcstring be_const_str_OUTPUT_OPEN_DRAIN; -extern const bcstring be_const_str_write_bytes; -extern const bcstring be_const_str_SYMBOL_SETTINGS; -extern const bcstring be_const_str_call; -extern const bcstring be_const_str_lv_draw_mask_angle_param; -extern const bcstring be_const_str_pi; -extern const bcstring be_const_str_acos; -extern const bcstring be_const_str_atan; -extern const bcstring be_const_str_content_flush; -extern const bcstring be_const_str_SYMBOL_BACKSPACE; -extern const bcstring be_const_str_TM1638STB; -extern const bcstring be_const_str_resp_cmnd; -extern const bcstring be_const_str_web_add_management_button; -extern const bcstring be_const_str_NRG_SEL; -extern const bcstring be_const_str_SYMBOL_OK; -extern const bcstring be_const_str_Wire; -extern const bcstring be_const_str_SYMBOL_BATTERY_3; -extern const bcstring be_const_str_init; +extern const bcstring be_const_str_OPTION_A; +extern const bcstring be_const_str_pin; +extern const bcstring be_const_str_BACKLIGHT; +extern const bcstring be_const_str_HIGH; +extern const bcstring be_const_str_SYMBOL_IMAGE; +extern const bcstring be_const_str_content_stop; +extern const bcstring be_const_str_int; +extern const bcstring be_const_str_push; +extern const bcstring be_const_str_SR04_TRIG; +extern const bcstring be_const_str_VL53L0X_XSHUT1; +extern const bcstring be_const_str_millis; +extern const bcstring be_const_str_LE01MR_RX; +extern const bcstring be_const_str_lv_indev; +extern const bcstring be_const_str_RC522_CS; +extern const bcstring be_const_str_SYMBOL_REFRESH; extern const bcstring be_const_str_redirect; -extern const bcstring be_const_str_ADC_TEMP; +extern const bcstring be_const_str_response_append; +extern const bcstring be_const_str_else; +extern const bcstring be_const_str_ADE7953_IRQ; +extern const bcstring be_const_str_SWT1; +extern const bcstring be_const_str_SYMBOL_BLUETOOTH; extern const bcstring be_const_str__get_cb; -extern const bcstring be_const_str_finish; -extern const bcstring be_const_str_SPI_DC; -extern const bcstring be_const_str_MIEL_HVAC_RX; -extern const bcstring be_const_str_NEOPOOL_TX; +extern const bcstring be_const_str_SSPI_MISO; +extern const bcstring be_const_str_SYMBOL_PREV; +extern const bcstring be_const_str_KEY1_TC; +extern const bcstring be_const_str_ADC_BUTTON; +extern const bcstring be_const_str_lv_table; +extern const bcstring be_const_str_SM16716_DAT; +extern const bcstring be_const_str_SYMBOL_BACKSPACE; +extern const bcstring be_const_str_TX2X_TXD_BLACK; +extern const bcstring be_const_str_CSE7761_TX; +extern const bcstring be_const_str_OUTPUT_HI; +extern const bcstring be_const_str_SYMBOL_DRIVE; +extern const bcstring be_const_str_lv_tileview; +extern const bcstring be_const_str_read13; +extern const bcstring be_const_str_EPAPER29_CS; +extern const bcstring be_const_str_write; +extern const bcstring be_const_str_opt_connect; +extern const bcstring be_const_str_; +extern const bcstring be_const_str_ELECTRIQ_MOODL_TX; +extern const bcstring be_const_str_KEY1_INV; extern const bcstring be_const_str_SSD1331_CS; -extern const bcstring be_const_str_TELEINFO_RX; -extern const bcstring be_const_str_SHELLY_DIMMER_RST_INV; -extern const bcstring be_const_str_MAX7219CS; +extern const bcstring be_const_str_TASMOTACLIENT_RST; +extern const bcstring be_const_str_add_cmd; +extern const bcstring be_const_str_OLED_RESET; +extern const bcstring be_const_str_SBR_TX; extern const bcstring be_const_str_pin_mode; -extern const bcstring be_const_str_SDM72_RX; -extern const bcstring be_const_str_SYMBOL_HOME; -extern const bcstring be_const_str_TM1637CLK; -extern const bcstring be_const_str_char; -extern const bcstring be_const_str_resp_cmnd_done; -extern const bcstring be_const_str_ADC_LIGHT; -extern const bcstring be_const_str_ZIGBEE_TX; -extern const bcstring be_const_str_lv_dropdown; -extern const bcstring be_const_str_A4988_DIR; -extern const bcstring be_const_str_AS3935; -extern const bcstring be_const_str_lv_sqrt_res; -extern const bcstring be_const_str_IEM3000_TX; -extern const bcstring be_const_str_cosh; -extern const bcstring be_const_str_web_sensor; -extern const bcstring be_const_str_continue; -extern const bcstring be_const_str_BS814_DAT; -extern const bcstring be_const_str_opt_add; -extern const bcstring be_const_str_A4988_ENA; -extern const bcstring be_const_str_lv_point; -extern const bcstring be_const_str_delay; -extern const bcstring be_const_str_resp_cmnd_str; -extern const bcstring be_const_str_iter; -extern const bcstring be_const_str_fromstring; -extern const bcstring be_const_str_lv_event_cb; -extern const bcstring be_const_str_CNTR1_NP; -extern const bcstring be_const_str_tanh; -extern const bcstring be_const_str_lv_objmask; -extern const bcstring be_const_str_SOLAXX1_RX; extern const bcstring be_const_str_HRE_CLOCK; extern const bcstring be_const_str_MAX31855CS; -extern const bcstring be_const_str_SDM630_TX; -extern const bcstring be_const_str_every_second; -extern const bcstring be_const_str_SYMBOL_AUDIO; -extern const bcstring be_const_str_RC522_CS; -extern const bcstring be_const_str_def; -extern const bcstring be_const_str_REL1; -extern const bcstring be_const_str_load_font; -extern const bcstring be_const_str_real; -extern const bcstring be_const_str_set; -extern const bcstring be_const_str_PZEM016_RX; -extern const bcstring be_const_str_SSPI_CS; -extern const bcstring be_const_str_SYMBOL_TRASH; -extern const bcstring be_const_str_wire; -extern const bcstring be_const_str_REL1_INV; -extern const bcstring be_const_str_FTC532; -extern const bcstring be_const_str_OUTPUT_HI; -extern const bcstring be_const_str_classof; -extern const bcstring be_const_str_web_send_decimal; -extern const bcstring be_const_str_opt_neq; -extern const bcstring be_const_str_LED1_INV; -extern const bcstring be_const_str_load; -extern const bcstring be_const_str_ADC_INPUT; -extern const bcstring be_const_str_SPI_CS; -extern const bcstring be_const_str_WEBCAM_RESET; -extern const bcstring be_const_str_ceil; -extern const bcstring be_const_str_clear; -extern const bcstring be_const_str_cmd; -extern const bcstring be_const_str_response_append; -extern const bcstring be_const_str_lv_btn; -extern const bcstring be_const_str_lv_draw_line_dsc; -extern const bcstring be_const_str_gc; -extern const bcstring be_const_str_WINDMETER_SPEED; -extern const bcstring be_const_str_number; -extern const bcstring be_const_str_write_bit; -extern const bcstring be_const_str_WEBCAM_SIOC; -extern const bcstring be_const_str_I2C_SCL; -extern const bcstring be_const_str_XPT2046_CS; -extern const bcstring be_const_str_lv_calendar; -extern const bcstring be_const_str_RISING; -extern const bcstring be_const_str_arg; -extern const bcstring be_const_str__read; -extern const bcstring be_const_str_rand; -extern const bcstring be_const_str_SYMBOL_SHUFFLE; -extern const bcstring be_const_str_DDSU666_TX; -extern const bcstring be_const_str_web_add_button; -extern const bcstring be_const_str_except; -extern const bcstring be_const_str_RFRECV; -extern const bcstring be_const_str_PZEM017_RX; -extern const bcstring be_const_str_RA8876_CS; -extern const bcstring be_const_str_KEY1_INV; -extern const bcstring be_const_str___iterator__; -extern const bcstring be_const_str_lv_draw_mask_map_param_cfg; -extern const bcstring be_const_str_module; -extern const bcstring be_const_str_ADC_BUTTON; -extern const bcstring be_const_str_get_tasmota; -extern const bcstring be_const_str_read24; -extern const bcstring be_const_str_start; -extern const bcstring be_const_str_MIEL_HVAC_TX; -extern const bcstring be_const_str_SYMBOL_DRIVE; -extern const bcstring be_const_str_SYMBOL_WARNING; -extern const bcstring be_const_str_gamma8; -extern const bcstring be_const_str_lv_draw_mask_line_param; -extern const bcstring be_const_str_memory; -extern const bcstring be_const_str_SPI_MOSI; -extern const bcstring be_const_str_digital_read; -extern const bcstring be_const_str_lv_design_cb; -extern const bcstring be_const_str_MD5; -extern const bcstring be_const_str_get_option; -extern const bcstring be_const_str_lv_checkbox; -extern const bcstring be_const_str_PMS5003_RX; -extern const bcstring be_const_str_SYMBOL_BATTERY_2; -extern const bcstring be_const_str_read32; -extern const bcstring be_const_str_dump; -extern const bcstring be_const_str_SYMBOL_EYE_CLOSE; -extern const bcstring be_const_str_SYMBOL_IMAGE; -extern const bcstring be_const_str_abs; -extern const bcstring be_const_str_traceback; -extern const bcstring be_const_str_HPMA_RX; -extern const bcstring be_const_str_SM16716_DAT; -extern const bcstring be_const_str_SYMBOL_PAUSE; -extern const bcstring be_const_str_attrdump; -extern const bcstring be_const_str_lv_draw_mask_fade_param; -extern const bcstring be_const_str_CC1101_GDO0; -extern const bcstring be_const_str_super; -extern const bcstring be_const_str_if; -extern const bcstring be_const_str_TCP_RX; -extern const bcstring be_const_str_keys; -extern const bcstring be_const_str_lv_led; -extern const bcstring be_const_str_time_dump; -extern const bcstring be_const_str_HPMA_TX; -extern const bcstring be_const_str_PN532_TXD; -extern const bcstring be_const_str_compile; -extern const bcstring be_const_str_TCP_TX; -extern const bcstring be_const_str_lv_gauge_format_cb; -extern const bcstring be_const_str_remove_rule; -extern const bcstring be_const_str_KEY1_TC; -extern const bcstring be_const_str_TASMOTACLIENT_RST; -extern const bcstring be_const_str_tolower; -extern const bcstring be_const_str_type; -extern const bcstring be_const_str_lv_cont; -extern const bcstring be_const_str_every_100ms; -extern const bcstring be_const_str_lv_list; -extern const bcstring be_const_str_CSE7766_TX; -extern const bcstring be_const_str__available; -extern const bcstring be_const_str_display; -extern const bcstring be_const_str_sin; -extern const bcstring be_const_str_SM2135_DAT; -extern const bcstring be_const_str_WEBCAM_SIOD; -extern const bcstring be_const_str_publish; -extern const bcstring be_const_str_input; -extern const bcstring be_const_str_map; -extern const bcstring be_const_str_IRRECV; -extern const bcstring be_const_str_SSD1351_CS; -extern const bcstring be_const_str_SYMBOL_PLAY; -extern const bcstring be_const_str_MGC3130_RESET; -extern const bcstring be_const_str_SYMBOL_SAVE; -extern const bcstring be_const_str_lv_draw_mask_radius_param_cfg; -extern const bcstring be_const_str_resp_cmnd_failed; -extern const bcstring be_const_str_ADC_RANGE; -extern const bcstring be_const_str_PZEM0XX_TX; -extern const bcstring be_const_str_SYMBOL_USB; -extern const bcstring be_const_str_int; -extern const bcstring be_const_str_time_str; -extern const bcstring be_const_str_LEDLNK_INV; -extern const bcstring be_const_str_VL53L0X_XSHUT1; -extern const bcstring be_const_str_set_power; -extern const bcstring be_const_str__end_transmission; -extern const bcstring be_const_str_get; -extern const bcstring be_const_str_SPI_MISO; -extern const bcstring be_const_str_print; -extern const bcstring be_const_str_format; -extern const bcstring be_const_str_MAX7219DIN; -extern const bcstring be_const_str_lv_img; -extern const bcstring be_const_str_HM10_RX; -extern const bcstring be_const_str_allocated; -extern const bcstring be_const_str_while; -extern const bcstring be_const_str_getbits; -extern const bcstring be_const_str_lv_spinner; -extern const bcstring be_const_str_pow; -extern const bcstring be_const_str_A4988_MS1; -extern const bcstring be_const_str_SYMBOL_KEYBOARD; -extern const bcstring be_const_str_lv_slider; -extern const bcstring be_const_str_read13; -extern const bcstring be_const_str_NRF24_CS; -extern const bcstring be_const_str_PWM1; -extern const bcstring be_const_str_SWT1; -extern const bcstring be_const_str_SSD1331_DC; -extern const bcstring be_const_str_PMS5003_TX; -extern const bcstring be_const_str_TM1638DIO; -extern const bcstring be_const_str__cmd; -extern const bcstring be_const_str_asin; -extern const bcstring be_const_str_read12; -extern const bcstring be_const_str_state; -extern const bcstring be_const_str_exec_cmd; -extern const bcstring be_const_str_HLW_CF; -extern const bcstring be_const_str_SYMBOL_DIRECTORY; -extern const bcstring be_const_str_SYMBOL_PASTE; -extern const bcstring be_const_str_resolvecmnd; -extern const bcstring be_const_str_ST7789_CS; -extern const bcstring be_const_str_SYMBOL_BATTERY_FULL; -extern const bcstring be_const_str_log10; -extern const bcstring be_const_str_TXD; -extern const bcstring be_const_str_SYMBOL_EYE_OPEN; -extern const bcstring be_const_str__buffer; -extern const bcstring be_const_str_EXS_ENABLE; -extern const bcstring be_const_str_HJL_CF; -extern const bcstring be_const_str_lv_draw_mask_fade_param_cfg; -extern const bcstring be_const_str_PROJECTOR_CTRL_RX; -extern const bcstring be_const_str_SBR_TX; -extern const bcstring be_const_str_sqrt; -extern const bcstring be_const_str_MAX31855DO; -extern const bcstring be_const_str_SYMBOL_DOWN; -extern const bcstring be_const_str_save_before_restart; -extern const bcstring be_const_str_write8; -extern const bcstring be_const_str_byte; -extern const bcstring be_const_str_write; -extern const bcstring be_const_str_GPS_TX; -extern const bcstring be_const_str_ELECTRIQ_MOODL_TX; -extern const bcstring be_const_str_SYMBOL_BATTERY_1; -extern const bcstring be_const_str_WE517_RX; -extern const bcstring be_const_str_digital_write; -extern const bcstring be_const_str_lv_spinbox; -extern const bcstring be_const_str_lv_switch; -extern const bcstring be_const_str_pin; -extern const bcstring be_const_str_pin_used; -extern const bcstring be_const_str_SAIR_RX; -extern const bcstring be_const_str_SI7021; -extern const bcstring be_const_str_WE517_TX; -extern const bcstring be_const_str_lv_obj; -extern const bcstring be_const_str_SSPI_MAX31865_CS1; -extern const bcstring be_const_str_DHT22; -extern const bcstring be_const_str_arg_size; -extern const bcstring be_const_str_millis; -extern const bcstring be_const_str_remove; -extern const bcstring be_const_str_deinit; -extern const bcstring be_const_str_wire2; -extern const bcstring be_const_str_SYMBOL_FILE; -extern const bcstring be_const_str_lv_canvas; -extern const bcstring be_const_str_ROT1A_NP; -extern const bcstring be_const_str_WEBCAM_DATA; -extern const bcstring be_const_str_IEM3000_RX; -extern const bcstring be_const_str_NEOPOOL_RX; -extern const bcstring be_const_str_OUTPUT; -extern const bcstring be_const_str_lv_msgbox; -extern const bcstring be_const_str_has_arg; -extern const bcstring be_const_str_lv_table; -extern const bcstring be_const_str_SSPI_MOSI; -extern const bcstring be_const_str_CSE7761_TX; -extern const bcstring be_const_str_P9813_DAT; -extern const bcstring be_const_str_WEBCAM_PWDN; -extern const bcstring be_const_str_count; -extern const bcstring be_const_str_LMT01; -extern const bcstring be_const_str_read8; -extern const bcstring be_const_str_PN532_RXD; -extern const bcstring be_const_str_PZEM004_RX; -extern const bcstring be_const_str__begin_transmission; -extern const bcstring be_const_str_web_add_console_button; -extern const bcstring be_const_str_web_add_handler; -extern const bcstring be_const_str_INPUT_PULLDOWN; -extern const bcstring be_const_str_CSE7761_RX; -extern const bcstring be_const_str_find; -extern const bcstring be_const_str_break; -extern const bcstring be_const_str_NRG_SEL_INV; -extern const bcstring be_const_str_ILI9488_CS; -extern const bcstring be_const_str_MCP39F5_RX; -extern const bcstring be_const_str_ROT1B; -extern const bcstring be_const_str_opt_call; -extern const bcstring be_const_str_SOLAXX1_TX; -extern const bcstring be_const_str_SHELLY_DIMMER_BOOT0; -extern const bcstring be_const_str_WEBCAM_VSYNC; -extern const bcstring be_const_str_tan; -extern const bcstring be_const_str_web_send; -extern const bcstring be_const_str_LED1; -extern const bcstring be_const_str_INPUT_PULLUP; -extern const bcstring be_const_str_chars_in_string; -extern const bcstring be_const_str_else; -extern const bcstring be_const_str_nil; -extern const bcstring be_const_str_MAX31855CLK; -extern const bcstring be_const_str_SYMBOL_GPS; -extern const bcstring be_const_str_lv_draw_mask_map_param; -extern const bcstring be_const_str_SWT1_NP; -extern const bcstring be_const_str_log; -extern const bcstring be_const_str_read_bytes; -extern const bcstring be_const_str_dot_def; -extern const bcstring be_const_str_SYMBOL_CALL; -extern const bcstring be_const_str_DHT11; -extern const bcstring be_const_str_NRG_CF1; -extern const bcstring be_const_str_SYMBOL_MUTE; -extern const bcstring be_const_str_ETH_PHY_POWER; -extern const bcstring be_const_str_TFMINIPLUS_TX; -extern const bcstring be_const_str_EPAPER29_CS; -extern const bcstring be_const_str_lv_chart; -extern const bcstring be_const_str_name; -extern const bcstring be_const_str_event; -extern const bcstring be_const_str_ADC_JOY; -extern const bcstring be_const_str_FALLING; -extern const bcstring be_const_str_remove_cmd; -extern const bcstring be_const_str_CSE7766_RX; -extern const bcstring be_const_str_DYP_RX; -extern const bcstring be_const_str_LEDLNK; -extern const bcstring be_const_str_IRSEND; -extern const bcstring be_const_str_lv_textarea; -extern const bcstring be_const_str_RFSEND; -extern const bcstring be_const_str_SSD1351_DC; -extern const bcstring be_const_str_SYMBOL_COPY; -extern const bcstring be_const_str_SYMBOL_UP; -extern const bcstring be_const_str_TX2X_TXD_BLACK; -extern const bcstring be_const_str_json_append; -extern const bcstring be_const_str_TUYA_RX; -extern const bcstring be_const_str_HRE_DATA; -extern const bcstring be_const_str_DDSU666_RX; -extern const bcstring be_const_str_reverse_gamma10; -extern const bcstring be_const_str_SM16716_SEL; -extern const bcstring be_const_str_TASMOTACLIENT_RST_INV; -extern const bcstring be_const_str_add_rule; -extern const bcstring be_const_str_resize; -extern const bcstring be_const_str_resp_cmnd_error; -extern const bcstring be_const_str_ADC_BUTTON_INV; -extern const bcstring be_const_str_TASMOTACLIENT_TXD; -extern const bcstring be_const_str_MP3_DFR562; -extern const bcstring be_const_str_RC522_RST; -extern const bcstring be_const_str_SYMBOL_LEFT; -extern const bcstring be_const_str_rad; -extern const bcstring be_const_str_ARIRFSEL; -extern const bcstring be_const_str_MHZ_TXD; -extern const bcstring be_const_str_SAIR_TX; -extern const bcstring be_const_str_sinh; -extern const bcstring be_const_str_lv_group_focus_cb; -extern const bcstring be_const_str_SENSOR_END; -extern const bcstring be_const_str_assert; -extern const bcstring be_const_str_reverse; -extern const bcstring be_const_str_codedump; -extern const bcstring be_const_str_CNTR1; -extern const bcstring be_const_str_lv_draw_mask_saved; -extern const bcstring be_const_str_read; -extern const bcstring be_const_str_DDS2382_TX; -extern const bcstring be_const_str_ROT1B_NP; -extern const bcstring be_const_str_SSPI_MISO; -extern const bcstring be_const_str___upper__; -extern const bcstring be_const_str_pop; -extern const bcstring be_const_str_SDCARD_CS; -extern const bcstring be_const_str__write; -extern const bcstring be_const_str_lv_draw_mask_line_param_cfg; -extern const bcstring be_const_str_setmember; -extern const bcstring be_const_str_I2C_Driver; -extern const bcstring be_const_str_addr; -extern const bcstring be_const_str_find_key_i; -extern const bcstring be_const_str_BOILER_OT_TX; extern const bcstring be_const_str_P9813_CLK; +extern const bcstring be_const_str_SYMBOL_WARNING; extern const bcstring be_const_str_lv_area; extern const bcstring be_const_str_split; -extern const bcstring be_const_str_CHANGE; -extern const bcstring be_const_str_SM2135_CLK; -extern const bcstring be_const_str_ZEROCROSS; -extern const bcstring be_const_str_i2c_enabled; -extern const bcstring be_const_str_lv_color; -extern const bcstring be_const_str_wire1; -extern const bcstring be_const_str_lv_draw_rect_dsc; -extern const bcstring be_const_str_seti; -extern const bcstring be_const_str_ST7789_DC; -extern const bcstring be_const_str_var; -extern const bcstring be_const_str_MCP39F5_TX; -extern const bcstring be_const_str__ccmd; -extern const bcstring be_const_str_AS608_TX; -extern const bcstring be_const_str_TM1638CLK; -extern const bcstring be_const_str_get_free_heap; -extern const bcstring be_const_str_lv_keyboard; -extern const bcstring be_const_str_elif; -extern const bcstring be_const_str_KEY1; -extern const bcstring be_const_str_LE01MR_TX; -extern const bcstring be_const_str_lv_tileview; -extern const bcstring be_const_str_class; -extern const bcstring be_const_str_BUZZER_INV; -extern const bcstring be_const_str_lv_roller; -extern const bcstring be_const_str_ADC_CT_POWER; -extern const bcstring be_const_str_asstring; -extern const bcstring be_const_str_lv_draw_mask_angle_param_cfg; -extern const bcstring be_const_str_save; -extern const bcstring be_const_str_size; -extern const bcstring be_const_str_NONE; -extern const bcstring be_const_str_exp; -extern const bcstring be_const_str_on; -extern const bcstring be_const_str_BL0940_RX; -extern const bcstring be_const_str_WIEGAND_D0; -extern const bcstring be_const_str_check_privileged_access; -extern const bcstring be_const_str_lv_indev; -extern const bcstring be_const_str_opt_eq; -extern const bcstring be_const_str_TFMINIPLUS_RX; -extern const bcstring be_const_str_PULLDOWN; -extern const bcstring be_const_str_; -extern const bcstring be_const_str_arg_name; -extern const bcstring be_const_str_screenshot; -extern const bcstring be_const_str_setbits; -extern const bcstring be_const_str_SYMBOL_LOOP; -extern const bcstring be_const_str_MHZ_RXD; -extern const bcstring be_const_str_get_power; -extern const bcstring be_const_str_lv_font; -extern const bcstring be_const_str_BACKLIGHT; -extern const bcstring be_const_str_BS814_CLK; -extern const bcstring be_const_str_PULLUP; -extern const bcstring be_const_str_TM1637DIO; -extern const bcstring be_const_str_lv_btnmatrix; -extern const bcstring be_const_str_SR04_ECHO; -extern const bcstring be_const_str_ADE7953_IRQ; -extern const bcstring be_const_str_classname; -extern const bcstring be_const_str_str; -extern const bcstring be_const_str_SYMBOL_PREV; -extern const bcstring be_const_str_add_driver; -extern const bcstring be_const_str_content_button; -extern const bcstring be_const_str_HX711_DAT; -extern const bcstring be_const_str_dot_p; -extern const bcstring be_const_str_content_stop; -extern const bcstring be_const_str_exists; -extern const bcstring be_const_str_GPS_RX; -extern const bcstring be_const_str_HX711_SCK; -extern const bcstring be_const_str_RDM6300_RX; -extern const bcstring be_const_str_AZ_RXD; -extern const bcstring be_const_str_Tasmota; -extern const bcstring be_const_str_ZIGBEE_RX; -extern const bcstring be_const_str_imax; -extern const bcstring be_const_str_montserrat_font; -extern const bcstring be_const_str_srand; -extern const bcstring be_const_str_time_reached; -extern const bcstring be_const_str_try_rule; -extern const bcstring be_const_str_LOW; -extern const bcstring be_const_str_SDM120_TX; -extern const bcstring be_const_str_SYMBOL_BELL; -extern const bcstring be_const_str_tostring; -extern const bcstring be_const_str_DDS2382_RX; -extern const bcstring be_const_str_HRXL_RX; -extern const bcstring be_const_str_button_pressed; -extern const bcstring be_const_str_lv_arc; -extern const bcstring be_const_str_SDM120_RX; -extern const bcstring be_const_str_SYMBOL_POWER; -extern const bcstring be_const_str_list; -extern const bcstring be_const_str_lv_bar; -extern const bcstring be_const_str_lv_linemeter; -extern const bcstring be_const_str_lv_page; -extern const bcstring be_const_str_upper; -extern const bcstring be_const_str_wire_scan; -extern const bcstring be_const_str_SBR_RX; -extern const bcstring be_const_str_gamma10; -extern const bcstring be_const_str_PWM1_INV; -extern const bcstring be_const_str_exec_rules; -extern const bcstring be_const_str_ETH_PHY_MDC; +extern const bcstring be_const_str_LED1_INV; +extern const bcstring be_const_str_SENSOR_END; +extern const bcstring be_const_str_TFMINIPLUS_TX; extern const bcstring be_const_str_content_send_style; -extern const bcstring be_const_str_run_deferred; -extern const bcstring be_const_str_SYMBOL_REFRESH; -extern const bcstring be_const_str_TASMOTACLIENT_RXD; -extern const bcstring be_const_str_WS2812; -extern const bcstring be_const_str_PROJECTOR_CTRL_TX; -extern const bcstring be_const_str_lv_line; -extern const bcstring be_const_str_SYMBOL_VOLUME_MAX; -extern const bcstring be_const_str_MAX7219CLK; -extern const bcstring be_const_str_RF_SENSOR; -extern const bcstring be_const_str_WEBCAM_PCLK; -extern const bcstring be_const_str_lv_imgbtn; +extern const bcstring be_const_str_ADC_INPUT; +extern const bcstring be_const_str_GCM; +extern const bcstring be_const_str_INPUT_PULLUP; +extern const bcstring be_const_str_read; +extern const bcstring be_const_str_seg7_font; +extern const bcstring be_const_str_LOW; +extern const bcstring be_const_str_ST7789_DC; +extern const bcstring be_const_str_SYMBOL_SETTINGS; +extern const bcstring be_const_str_TASMOTACLIENT_RST_INV; +extern const bcstring be_const_str_add; +extern const bcstring be_const_str_read32; +extern const bcstring be_const_str_HRXL_RX; +extern const bcstring be_const_str_lv_msgbox; +extern const bcstring be_const_str_SYMBOL_EYE_CLOSE; +extern const bcstring be_const_str_AudioFileSource; +extern const bcstring be_const_str_ILI9488_CS; +extern const bcstring be_const_str_SHELLY_DIMMER_RST_INV; +extern const bcstring be_const_str_SYMBOL_TRASH; +extern const bcstring be_const_str_attrdump; +extern const bcstring be_const_str_copy; +extern const bcstring be_const_str_lv_keyboard; +extern const bcstring be_const_str_sqrt; +extern const bcstring be_const_str_I2S_IN_DATA; +extern const bcstring be_const_str_SDM72_RX; +extern const bcstring be_const_str_SYMBOL_DOWN; +extern const bcstring be_const_str_gamma8; +extern const bcstring be_const_str_CSE7766_TX; +extern const bcstring be_const_str_SHELLY_DIMMER_BOOT0; +extern const bcstring be_const_str_SYMBOL_AUDIO; extern const bcstring be_const_str_try; -extern const bcstring be_const_str_EPD_DATA; -extern const bcstring be_const_str_cb_dispatch; -extern const bcstring be_const_str_ADC_PH; -extern const bcstring be_const_str_DHT11_OUT; -extern const bcstring be_const_str_SYMBOL_RIGHT; -extern const bcstring be_const_str_IBEACON_TX; -extern const bcstring be_const_str_gen_cb; +extern const bcstring be_const_str_SM2135_DAT; +extern const bcstring be_const_str_get_option; +extern const bcstring be_const_str_lv_win; +extern const bcstring be_const_str_WEBCAM_HREF; +extern const bcstring be_const_str_IEM3000_TX; +extern const bcstring be_const_str_OUTPUT; +extern const bcstring be_const_str_SYMBOL_NEW_LINE; +extern const bcstring be_const_str_IRSEND; +extern const bcstring be_const_str_TELEINFO_RX; +extern const bcstring be_const_str_WE517_TX; +extern const bcstring be_const_str_I2C_SCL; +extern const bcstring be_const_str_WEBCAM_PWDN; +extern const bcstring be_const_str_cos; +extern const bcstring be_const_str_NRG_SEL; +extern const bcstring be_const_str_SDS0X1_RX; +extern const bcstring be_const_str_WIEGAND_D1; +extern const bcstring be_const_str_ZIGBEE_RX; +extern const bcstring be_const_str_MD5; +extern const bcstring be_const_str_reverse_gamma10; +extern const bcstring be_const_str_add_rule; +extern const bcstring be_const_str_finish; +extern const bcstring be_const_str_lv_btn; +extern const bcstring be_const_str_resp_cmnd_error; +extern const bcstring be_const_str_WE517_RX; +extern const bcstring be_const_str_WEBCAM_PSRCS; +extern const bcstring be_const_str_digital_write; +extern const bcstring be_const_str_lv_draw_mask_map_param; +extern const bcstring be_const_str_lv_spinbox; +extern const bcstring be_const_str_SYMBOL_CALL; +extern const bcstring be_const_str_SYMBOL_PLUS; +extern const bcstring be_const_str_elif; +extern const bcstring be_const_str_DHT22; +extern const bcstring be_const_str_set_power; +extern const bcstring be_const_str_ST7789_CS; +extern const bcstring be_const_str_content_send; +extern const bcstring be_const_str_iter; +extern const bcstring be_const_str_load; +extern const bcstring be_const_str_LED1; +extern const bcstring be_const_str_SYMBOL_BATTERY_FULL; +extern const bcstring be_const_str_floor; +extern const bcstring be_const_str_lv_checkbox; +extern const bcstring be_const_str_MAX31855CLK; +extern const bcstring be_const_str_SYMBOL_BATTERY_2; +extern const bcstring be_const_str_find; +extern const bcstring be_const_str_lv_point; +extern const bcstring be_const_str_end; +extern const bcstring be_const_str_read24; +extern const bcstring be_const_str_AudioGenerator; +extern const bcstring be_const_str_P9813_DAT; +extern const bcstring be_const_str_TM1637CLK; +extern const bcstring be_const_str__cb; +extern const bcstring be_const_str_ILI9341_DC; +extern const bcstring be_const_str_RXD; +extern const bcstring be_const_str_SSPI_SCLK; +extern const bcstring be_const_str_yield; +extern const bcstring be_const_str_WEBCAM_DATA; +extern const bcstring be_const_str_lv_draw_line_dsc; +extern const bcstring be_const_str_content_button; +extern const bcstring be_const_str_EXS_ENABLE; +extern const bcstring be_const_str_MIEL_HVAC_RX; +extern const bcstring be_const_str_lv_style; +extern const bcstring be_const_str_LMT01; +extern const bcstring be_const_str_read8; +extern const bcstring be_const_str_members; +extern const bcstring be_const_str_ADC_TEMP; +extern const bcstring be_const_str_DCKI; +extern const bcstring be_const_str_HJL_CF; +extern const bcstring be_const_str_MHZ_RXD; +extern const bcstring be_const_str__cmd; +extern const bcstring be_const_str_lv_page; +extern const bcstring be_const_str_resp_cmnd_failed; +extern const bcstring be_const_str_save; +extern const bcstring be_const_str_SAIR_RX; +extern const bcstring be_const_str_allocated; +extern const bcstring be_const_str_has_arg; +extern const bcstring be_const_str_rad; +extern const bcstring be_const_str_HX711_SCK; +extern const bcstring be_const_str_SOLAXX1_RX; +extern const bcstring be_const_str_SDM630_TX; +extern const bcstring be_const_str_resp_cmnd_done; +extern const bcstring be_const_str_A4988_MS1; +extern const bcstring be_const_str_ETH_PHY_MDC; +extern const bcstring be_const_str_KEY1_NP; +extern const bcstring be_const_str_find_op; +extern const bcstring be_const_str_member; +extern const bcstring be_const_str_SR04_ECHO; +extern const bcstring be_const_str_load_freetype_font; +extern const bcstring be_const_str_lv_draw_rect_dsc; +extern const bcstring be_const_str_FALLING; +extern const bcstring be_const_str_KEY1_INV_PD; +extern const bcstring be_const_str_TXD; +extern const bcstring be_const_str_MCP39F5_RX; +extern const bcstring be_const_str_WEBCAM_SIOC; +extern const bcstring be_const_str_while; +extern const bcstring be_const_str_RDM6300_RX; +extern const bcstring be_const_str_ctypes_bytes; +extern const bcstring be_const_str_AZ_RXD; +extern const bcstring be_const_str_SYMBOL_DIRECTORY; +extern const bcstring be_const_str_AS608_RX; +extern const bcstring be_const_str__begin_transmission; +extern const bcstring be_const_str_deg; +extern const bcstring be_const_str_SYMBOL_VOLUME_MID; +extern const bcstring be_const_str_chars_in_string; +extern const bcstring be_const_str_publish_result; +extern const bcstring be_const_str_lv_arc; +extern const bcstring be_const_str_DSB_OUT; +extern const bcstring be_const_str_module; +extern const bcstring be_const_str_state; +extern const bcstring be_const_str_BS814_CLK; +extern const bcstring be_const_str_HM10_TX; +extern const bcstring be_const_str_NRG_CF1; +extern const bcstring be_const_str_SM16716_CLK; +extern const bcstring be_const_str_lv_draw_mask_common_dsc; +extern const bcstring be_const_str_lv_group; +extern const bcstring be_const_str_montserrat_font; +extern const bcstring be_const_str_opt_eq; +extern const bcstring be_const_str_ZEROCROSS; +extern const bcstring be_const_str_INPUT_PULLDOWN; +extern const bcstring be_const_str_REL1; +extern const bcstring be_const_str_set; +extern const bcstring be_const_str_dump; +extern const bcstring be_const_str_MAX7219DIN; +extern const bcstring be_const_str_CC1101_GDO2; +extern const bcstring be_const_str_IBEACON_RX; +extern const bcstring be_const_str__write; +extern const bcstring be_const_str_KEY1_INV_NP; +extern const bcstring be_const_str_SYMBOL_EJECT; +extern const bcstring be_const_str_top; +extern const bcstring be_const_str_SPI_MOSI; +extern const bcstring be_const_str_lv_chart; +extern const bcstring be_const_str_publish; +extern const bcstring be_const_str_BUZZER_INV; +extern const bcstring be_const_str_CNTR1; +extern const bcstring be_const_str_SPI_MISO; +extern const bcstring be_const_str_SYMBOL_DOWNLOAD; +extern const bcstring be_const_str_real; +extern const bcstring be_const_str_I2S_OUT_CLK; +extern const bcstring be_const_str_INPUT; +extern const bcstring be_const_str_lv_draw_img_dsc; +extern const bcstring be_const_str_do; +extern const bcstring be_const_str_SYMBOL_DUMMY; +extern const bcstring be_const_str_type; +extern const bcstring be_const_str__request_from; +extern const bcstring be_const_str___lower__; +extern const bcstring be_const_str_detect; +extern const bcstring be_const_str_AudioGeneratorWAV; +extern const bcstring be_const_str_HPMA_TX; +extern const bcstring be_const_str_input; +extern const bcstring be_const_str_issubclass; +extern const bcstring be_const_str_SYMBOL_PLAY; +extern const bcstring be_const_str__rules; +extern const bcstring be_const_str_bytes; +extern const bcstring be_const_str_lv_sqrt_res; +extern const bcstring be_const_str_tostring; +extern const bcstring be_const_str_lv_draw_mask_map_param_cfg; +extern const bcstring be_const_str_lv_img; extern const bcstring be_const_str_open; -extern const bcstring be_const_str_OLED_RESET; +extern const bcstring be_const_str_ADC_RANGE; +extern const bcstring be_const_str_INTERRUPT; +extern const bcstring be_const_str_MAX7219CS; +extern const bcstring be_const_str_opt_neq; +extern const bcstring be_const_str_I2S_IN_SLCT; +extern const bcstring be_const_str_PULLUP; +extern const bcstring be_const_str_EPD_DATA; +extern const bcstring be_const_str_range; +extern const bcstring be_const_str_SWT1_PD; +extern const bcstring be_const_str_lv_roller; +extern const bcstring be_const_str_log; +extern const bcstring be_const_str_HM10_RX; +extern const bcstring be_const_str_SYMBOL_BULLET; +extern const bcstring be_const_str_I2C_Driver; +extern const bcstring be_const_str_MIEL_HVAC_TX; +extern const bcstring be_const_str_WEBCAM_PCLK; +extern const bcstring be_const_str_WIEGAND_D0; +extern const bcstring be_const_str_delay; +extern const bcstring be_const_str_imax; +extern const bcstring be_const_str_EPAPER42_CS; +extern const bcstring be_const_str_SYMBOL_EDIT; +extern const bcstring be_const_str_SYMBOL_STOP; +extern const bcstring be_const_str_write_bytes; +extern const bcstring be_const_str_A4988_DIR; +extern const bcstring be_const_str_ADC_CT_POWER; +extern const bcstring be_const_str_cosh; +extern const bcstring be_const_str_RFSEND; +extern const bcstring be_const_str_SYMBOL_PAUSE; +extern const bcstring be_const_str_get_free_heap; +extern const bcstring be_const_str_set_light; +extern const bcstring be_const_str_sinh; +extern const bcstring be_const_str_time_str; +extern const bcstring be_const_str_BOILER_OT_TX; +extern const bcstring be_const_str_ARIRFRCV; +extern const bcstring be_const_str_SYMBOL_KEYBOARD; +extern const bcstring be_const_str_lv_btnmatrix; +extern const bcstring be_const_str_class; +extern const bcstring be_const_str_if; +extern const bcstring be_const_str_TFMINIPLUS_RX; +extern const bcstring be_const_str_lv_draw_mask_radius_param; +extern const bcstring be_const_str_DDSU666_RX; +extern const bcstring be_const_str_SYMBOL_BATTERY_3; +extern const bcstring be_const_str_lv_label; +extern const bcstring be_const_str_print; +extern const bcstring be_const_str_lv_draw_label_dsc; +extern const bcstring be_const_str_remove_rule; +extern const bcstring be_const_str_SWT1_NP; +extern const bcstring be_const_str_SYMBOL_SD_CARD; +extern const bcstring be_const_str_WEBCAM_HSD; +extern const bcstring be_const_str_WINDMETER_SPEED; +extern const bcstring be_const_str_lv_bar; +extern const bcstring be_const_str_lv_line; +extern const bcstring be_const_str_tolower; +extern const bcstring be_const_str_lv_draw_mask_line_param_cfg; +extern const bcstring be_const_str_lv_objmask; +extern const bcstring be_const_str_HLW_CF; extern const bcstring be_const_str_lv_cpicker; +extern const bcstring be_const_str_start; +extern const bcstring be_const_str_classof; +extern const bcstring be_const_str_concat; +extern const bcstring be_const_str_exec_rules; +extern const bcstring be_const_str_write8; +extern const bcstring be_const_str_LE01MR_TX; +extern const bcstring be_const_str_rtc; +extern const bcstring be_const_str__ccmd; +extern const bcstring be_const_str_asstring; +extern const bcstring be_const_str_lv_linemeter; +extern const bcstring be_const_str_lv_switch; +extern const bcstring be_const_str_number; +extern const bcstring be_const_str_read_bytes; +extern const bcstring be_const_str_dot_p; +extern const bcstring be_const_str_bus; +extern const bcstring be_const_str_lv_group_focus_cb; +extern const bcstring be_const_str_SDS0X1_TX; +extern const bcstring be_const_str_SDM72_TX; +extern const bcstring be_const_str_AS3935; +extern const bcstring be_const_str_SYMBOL_NEXT; +extern const bcstring be_const_str_BS814_DAT; +extern const bcstring be_const_str_lv_draw_mask_fade_param_cfg; +extern const bcstring be_const_str_upper; +extern const bcstring be_const_str_OUTPUT_LO; +extern const bcstring be_const_str_ROT1B; +extern const bcstring be_const_str_exists; +extern const bcstring be_const_str_lv_draw_mask_fade_param; +extern const bcstring be_const_str_SYMBOL_HOME; +extern const bcstring be_const_str_TUYA_TX; +extern const bcstring be_const_str_begin; +extern const bcstring be_const_str_encrypt; +extern const bcstring be_const_str_resolvecmnd; +extern const bcstring be_const_str_WEBCAM_VSYNC; +extern const bcstring be_const_str_item; +extern const bcstring be_const_str_lv_slider; +extern const bcstring be_const_str_sin; +extern const bcstring be_const_str_HALLEFFECT; +extern const bcstring be_const_str_time_dump; +extern const bcstring be_const_str_OPEN_DRAIN; +extern const bcstring be_const_str_A4988_STP; +extern const bcstring be_const_str_DDS2382_TX; +extern const bcstring be_const_str_lv_gauge_format_cb; +extern const bcstring be_const_str_lv_signal_cb; +extern const bcstring be_const_str_update; +extern const bcstring be_const_str_SYMBOL_SAVE; +extern const bcstring be_const_str_lv_cont; +extern const bcstring be_const_str_ARIRFSEL; +extern const bcstring be_const_str_HPMA_RX; +extern const bcstring be_const_str_I2S_OUT_DATA; +extern const bcstring be_const_str_ETH_PHY_POWER; +extern const bcstring be_const_str_count; +extern const bcstring be_const_str_lv_imgbtn; +extern const bcstring be_const_str_wifi; +extern const bcstring be_const_str_KEY1; +extern const bcstring be_const_str__end_transmission; +extern const bcstring be_const_str_SYMBOL_CHARGE; +extern const bcstring be_const_str_i2c_enabled; +extern const bcstring be_const_str_lv_event_cb; +extern const bcstring be_const_str_SYMBOL_VIDEO; +extern const bcstring be_const_str_acos; +extern const bcstring be_const_str_asin; +extern const bcstring be_const_str_content_flush; +extern const bcstring be_const_str_read12; +extern const bcstring be_const_str_SYMBOL_CLOSE; +extern const bcstring be_const_str_SYMBOL_UP; +extern const bcstring be_const_str_SSPI_MOSI; +extern const bcstring be_const_str_SYMBOL_BATTERY_EMPTY; +extern const bcstring be_const_str_FTC532; +extern const bcstring be_const_str_MAX31855DO; +extern const bcstring be_const_str_SPI_CLK; +extern const bcstring be_const_str_ceil; +extern const bcstring be_const_str_try_rule; +extern const bcstring be_const_str_IRRECV; +extern const bcstring be_const_str_remove_cmd; +extern const bcstring be_const_str_RA8876_CS; +extern const bcstring be_const_str_lv_cb; +extern const bcstring be_const_str_lv_draw_mask_radius_param_cfg; +extern const bcstring be_const_str_TM1638DIO; +extern const bcstring be_const_str_lv_textarea; +extern const bcstring be_const_str_PROJECTOR_CTRL_RX; +extern const bcstring be_const_str_SYMBOL_COPY; +extern const bcstring be_const_str_abs; +extern const bcstring be_const_str_SAIR_TX; +extern const bcstring be_const_str_SBR_RX; +extern const bcstring be_const_str_lv_spinner; +extern const bcstring be_const_str_SYMBOL_MINUS; +extern const bcstring be_const_str_byte; +extern const bcstring be_const_str_web_send; +extern const bcstring be_const_str_clear; +extern const bcstring be_const_str_content_start; +extern const bcstring be_const_str_wire1; +extern const bcstring be_const_str_SYMBOL_FILE; +extern const bcstring be_const_str_nil; +extern const bcstring be_const_str_RFRECV; +extern const bcstring be_const_str__timers; +extern const bcstring be_const_str_call; +extern const bcstring be_const_str_lv_draw_mask_angle_param; +extern const bcstring be_const_str_calldepth; +extern const bcstring be_const_str_SDM120_RX; +extern const bcstring be_const_str_lv_font; +extern const bcstring be_const_str_exec_cmd; +extern const bcstring be_const_str_lv_obj; +extern const bcstring be_const_str_wire; +extern const bcstring be_const_str_as; +extern const bcstring be_const_str_RF_SENSOR; +extern const bcstring be_const_str_exp; +extern const bcstring be_const_str_LEDLNK_INV; +extern const bcstring be_const_str_resp_cmnd; +extern const bcstring be_const_str_dot_p2; +extern const bcstring be_const_str_HRE_DATA; +extern const bcstring be_const_str_ADC_PH; +extern const bcstring be_const_str_PN532_TXD; +extern const bcstring be_const_str_SDM630_RX; +extern const bcstring be_const_str_cmd; +extern const bcstring be_const_str_lv_draw_mask_saved; +extern const bcstring be_const_str_seti; +extern const bcstring be_const_str_SDM120_TX; +extern const bcstring be_const_str_IEM3000_RX; +extern const bcstring be_const_str_ZIGBEE_RST; +extern const bcstring be_const_str_gc; +extern const bcstring be_const_str_var; +extern const bcstring be_const_str_get_power; +extern const bcstring be_const_str_pin_used; +extern const bcstring be_const_str_dot_def; +extern const bcstring be_const_str_SDCARD_CS; +extern const bcstring be_const_str_SSD1351_DC; +extern const bcstring be_const_str_SYMBOL_VOLUME_MAX; +extern const bcstring be_const_str_DHT11; +extern const bcstring be_const_str_DSB; +extern const bcstring be_const_str_getbits; +extern const bcstring be_const_str_PWM1_INV; +extern const bcstring be_const_str_memory; +extern const bcstring be_const_str_raise; +extern const bcstring be_const_str_BUZZER; +extern const bcstring be_const_str_ROT1A; +extern const bcstring be_const_str_TM1637DIO; +extern const bcstring be_const_str_WEBCAM_PSCLK; +extern const bcstring be_const_str_ZIGBEE_TX; +extern const bcstring be_const_str_super; +extern const bcstring be_const_str_WEBCAM_SIOD; +extern const bcstring be_const_str_lv_design_cb; +extern const bcstring be_const_str_name; +extern const bcstring be_const_str_SYMBOL_RIGHT; +extern const bcstring be_const_str_DI; +extern const bcstring be_const_str_SM16716_SEL; +extern const bcstring be_const_str_load_font; +extern const bcstring be_const_str_SYMBOL_GPS; +extern const bcstring be_const_str_TASMOTACLIENT_TXD; +extern const bcstring be_const_str_gen_cb; +extern const bcstring be_const_str_write_bit; +extern const bcstring be_const_str_MAX7219CLK; +extern const bcstring be_const_str_addr; +extern const bcstring be_const_str_pow; +extern const bcstring be_const_str_loop; +extern const bcstring be_const_str_DEEPSLEEP; +extern const bcstring be_const_str_SPI_CS; +extern const bcstring be_const_str_get_light; +extern const bcstring be_const_str_keys; +extern const bcstring be_const_str_run_deferred; +extern const bcstring be_const_str_MCP39F5_RST; +extern const bcstring be_const_str_except; +extern const bcstring be_const_str_ROT1A_NP; +extern const bcstring be_const_str_WS2812; +extern const bcstring be_const_str_PZEM017_RX; +extern const bcstring be_const_str_scale_uint; +extern const bcstring be_const_str_HX711_DAT; +extern const bcstring be_const_str_PROJECTOR_CTRL_TX; +extern const bcstring be_const_str_SSPI_CS; +extern const bcstring be_const_str_list; +extern const bcstring be_const_str_pop; +extern const bcstring be_const_str_MGC3130_XFER; +extern const bcstring be_const_str_GPS_RX; +extern const bcstring be_const_str_SYMBOL_USB; +extern const bcstring be_const_str_XPT2046_CS; +extern const bcstring be_const_str_stop; +extern const bcstring be_const_str_lv_list; +extern const bcstring be_const_str_AudioOutputI2S; +extern const bcstring be_const_str_WEBCAM_RESET; +extern const bcstring be_const_str_TELEINFO_ENABLE; +extern const bcstring be_const_str_map; +extern const bcstring be_const_str_ADC_JOY; +extern const bcstring be_const_str_I2C_SDA; +extern const bcstring be_const_str_SSD1351_CS; +extern const bcstring be_const_str_setbits; +extern const bcstring be_const_str_str; +extern const bcstring be_const_str___upper__; +extern const bcstring be_const_str__buffer; +extern const bcstring be_const_str_AZ_TXD; +extern const bcstring be_const_str_NEOPOOL_TX; +extern const bcstring be_const_str_PMS5003_TX; +extern const bcstring be_const_str__drivers; +extern const bcstring be_const_str_opt_call; +extern const bcstring be_const_str_find_key_i; +extern const bcstring be_const_str_CC1101_GDO0; +extern const bcstring be_const_str_arg_size; +extern const bcstring be_const_str_AudioGeneratorMP3; +extern const bcstring be_const_str_set_timer; +extern const bcstring be_const_str_PZEM004_RX; +extern const bcstring be_const_str_cb_dispatch; +extern const bcstring be_const_str_fromstring; +extern const bcstring be_const_str_lv_color; +extern const bcstring be_const_str_geti; +extern const bcstring be_const_str_log10; +extern const bcstring be_const_str_eth; +extern const bcstring be_const_str___iterator__; +extern const bcstring be_const_str_NONE; +extern const bcstring be_const_str_SYMBOL_CUT; +extern const bcstring be_const_str_erase; +extern const bcstring be_const_str_SOLAXX1_TX; +extern const bcstring be_const_str_hex; +extern const bcstring be_const_str_arg; +extern const bcstring be_const_str_lv_tabview; extern const bcstring be_const_str_scan; extern const bcstring be_const_str_toupper; -extern const bcstring be_const_str_SDS0X1_RX; -extern const bcstring be_const_str_content_send; -extern const bcstring be_const_str_lv_group; -extern const bcstring be_const_str_AS608_RX; -extern const bcstring be_const_str_SYMBOL_CHARGE; -extern const bcstring be_const_str_get_light; -extern const bcstring be_const_str_load_freetype_font; -extern const bcstring be_const_str_setitem; -extern const bcstring be_const_str_opt_connect; -extern const bcstring be_const_str_SDM72_TX; -extern const bcstring be_const_str_SYMBOL_VOLUME_MID; -extern const bcstring be_const_str_TELEINFO_ENABLE; -extern const bcstring be_const_str_collect; -extern const bcstring be_const_str__timers; -extern const bcstring be_const_str_add; -extern const bcstring be_const_str_isinstance; -extern const bcstring be_const_str_rtc; -extern const bcstring be_const_str_lv_draw_img_dsc; -extern const bcstring be_const_str_HIGH; -extern const bcstring be_const_str_add_cmd; -extern const bcstring be_const_str_erase; -extern const bcstring be_const_str_as; -extern const bcstring be_const_str_DSB; -extern const bcstring be_const_str_KEY1_INV_NP; -extern const bcstring be_const_str___lower__; -extern const bcstring be_const_str_set_light; -extern const bcstring be_const_str_ARIRFRCV; -extern const bcstring be_const_str_KEY1_NP; -extern const bcstring be_const_str_WIEGAND_D1; -extern const bcstring be_const_str_find_op; +extern const bcstring be_const_str_tan; extern const bcstring be_const_str_NRF24_DC; -extern const bcstring be_const_str_content_start; -extern const bcstring be_const_str_SYMBOL_STOP; -extern const bcstring be_const_str_lv_win; -extern const bcstring be_const_str_false; -extern const bcstring be_const_str_A4988_STP; -extern const bcstring be_const_str_SYMBOL_NEXT; +extern const bcstring be_const_str_decrypt; +extern const bcstring be_const_str_isrunning; +extern const bcstring be_const_str_lv_led; +extern const bcstring be_const_str_time_reached; +extern const bcstring be_const_str_event; extern const bcstring be_const_str_WEBCAM_XCLK; -extern const bcstring be_const_str_WEBCAM_PSRCS; -extern const bcstring be_const_str_scale_uint; -extern const bcstring be_const_str_do; -extern const bcstring be_const_str_OUTPUT_LO; -extern const bcstring be_const_str_SSPI_DC; -extern const bcstring be_const_str_import; -extern const bcstring be_const_str_push; -extern const bcstring be_const_str_cos; -extern const bcstring be_const_str_lv_tabview; -extern const bcstring be_const_str_set_timer; -extern const bcstring be_const_str_DEEPSLEEP; -extern const bcstring be_const_str_ILI9341_DC; -extern const bcstring be_const_str_yield; -extern const bcstring be_const_str_SDM630_RX; -extern const bcstring be_const_str_DI; -extern const bcstring be_const_str_SYMBOL_BLUETOOTH; -extern const bcstring be_const_str_lv_draw_label_dsc; -extern const bcstring be_const_str_update; -extern const bcstring be_const_str_INPUT; -extern const bcstring be_const_str_SYMBOL_NEW_LINE; -extern const bcstring be_const_str_ZIGBEE_RST; -extern const bcstring be_const_str_SYMBOL_SD_CARD; -extern const bcstring be_const_str_CC1101_GDO2; -extern const bcstring be_const_str_MGC3130_XFER; -extern const bcstring be_const_str__drivers; -extern const bcstring be_const_str_copy; -extern const bcstring be_const_str_detect; -extern const bcstring be_const_str_SR04_TRIG; -extern const bcstring be_const_str_TUYA_TX; -extern const bcstring be_const_str__cb; -extern const bcstring be_const_str_HALLEFFECT; -extern const bcstring be_const_str_RXD; -extern const bcstring be_const_str_imin; -extern const bcstring be_const_str_SYMBOL_VIDEO; -extern const bcstring be_const_str_SYMBOL_LIST; -extern const bcstring be_const_str_calldepth; -extern const bcstring be_const_str_AZ_TXD; -extern const bcstring be_const_str_DSB_OUT; -extern const bcstring be_const_str_end; -extern const bcstring be_const_str_SYMBOL_BATTERY_EMPTY; -extern const bcstring be_const_str_lv_gauge; -extern const bcstring be_const_str_for; -extern const bcstring be_const_str_BUZZER; -extern const bcstring be_const_str_member; -extern const bcstring be_const_str_SSPI_SCLK; -extern const bcstring be_const_str_lv_draw_mask_radius_param; -extern const bcstring be_const_str_range; -extern const bcstring be_const_str_issubclass; -extern const bcstring be_const_str_WEBCAM_HREF; -extern const bcstring be_const_str_bytes; -extern const bcstring be_const_str_lv_signal_cb; -extern const bcstring be_const_str_Driver; -extern const bcstring be_const_str_OPTION_A; -extern const bcstring be_const_str_SYMBOL_DUMMY; -extern const bcstring be_const_str_WEBCAM_HSD; -extern const bcstring be_const_str_IBEACON_RX; -extern const bcstring be_const_str_SYMBOL_WIFI; -extern const bcstring be_const_str_HM10_TX; -extern const bcstring be_const_str_BOILER_OT_RX; -extern const bcstring be_const_str_SM16716_CLK; -extern const bcstring be_const_str_SYMBOL_EJECT; -extern const bcstring be_const_str_item; -extern const bcstring be_const_str_SDS0X1_TX; -extern const bcstring be_const_str_deg; -extern const bcstring be_const_str_OPEN_DRAIN; -extern const bcstring be_const_str_SYMBOL_DOWNLOAD; -extern const bcstring be_const_str_SYMBOL_EDIT; -extern const bcstring be_const_str_geti; -extern const bcstring be_const_str_lv_label; -extern const bcstring be_const_str__rules; -extern const bcstring be_const_str_insert; -extern const bcstring be_const_str_register_button_encoder; -extern const bcstring be_const_str_web_add_config_button; -extern const bcstring be_const_str_true; -extern const bcstring be_const_str_SYMBOL_BULLET; -extern const bcstring be_const_str_SYMBOL_CLOSE; -extern const bcstring be_const_str_SYMBOL_CUT; -extern const bcstring be_const_str__request_from; -extern const bcstring be_const_str_lower; -extern const bcstring be_const_str_SYMBOL_UPLOAD; -extern const bcstring be_const_str_ctypes_bytes; -extern const bcstring be_const_str_lv_draw_mask_common_dsc; -extern const bcstring be_const_str_LE01MR_RX; -extern const bcstring be_const_str_web_add_main_button; -extern const bcstring be_const_str_floor; -extern const bcstring be_const_str_seg7_font; -extern const bcstring be_const_str_DCKI; -extern const bcstring be_const_str_I2C_SDA; +extern const bcstring be_const_str_arg_name; +extern const bcstring be_const_str_ADC_BUTTON_INV; extern const bcstring be_const_str_ILI9341_CS; -extern const bcstring be_const_str_lv_cb; +extern const bcstring be_const_str_SPI_DC; +extern const bcstring be_const_str_SYMBOL_EYE_OPEN; +extern const bcstring be_const_str_add_driver; +extern const bcstring be_const_str_MCP39F5_TX; +extern const bcstring be_const_str_MP3_DFR562; +extern const bcstring be_const_str_tanh; +extern const bcstring be_const_str_SSPI_MAX31865_CS1; +extern const bcstring be_const_str_lv_calendar; +extern const bcstring be_const_str_on; +extern const bcstring be_const_str_tag; +extern const bcstring be_const_str_for; +extern const bcstring be_const_str__available; +extern const bcstring be_const_str_assert; +extern const bcstring be_const_str_return; +extern const bcstring be_const_str_compile; +extern const bcstring be_const_str_NRF24_CS; +extern const bcstring be_const_str_resize; +extern const bcstring be_const_str_SYMBOL_LIST; +extern const bcstring be_const_str_register_button_encoder; +extern const bcstring be_const_str_true; +extern const bcstring be_const_str_A4988_ENA; +extern const bcstring be_const_str_I2S_OUT_SLCT; +extern const bcstring be_const_str_static; +extern const bcstring be_const_str_ETH_PHY_MDIO; +extern const bcstring be_const_str_MHZ_TXD; +extern const bcstring be_const_str_gamma10; +extern const bcstring be_const_str_RISING; +extern const bcstring be_const_str_lv_draw_mask_line_param; +extern const bcstring be_const_str_rand; +extern const bcstring be_const_str_Wire; +extern const bcstring be_const_str_lv_dropdown; +extern const bcstring be_const_str_setitem; +extern const bcstring be_const_str_CSE7761_RX; +extern const bcstring be_const_str_isinstance; +extern const bcstring be_const_str_CSE7766_RX; +extern const bcstring be_const_str_NEOPOOL_RX; +extern const bcstring be_const_str_SSD1331_DC; +extern const bcstring be_const_str_PZEM016_RX; +extern const bcstring be_const_str_SYMBOL_LEFT; +extern const bcstring be_const_str_SI7021; +extern const bcstring be_const_str_TM1638CLK; +extern const bcstring be_const_str_setmember; +extern const bcstring be_const_str_SYMBOL_UPLOAD; +extern const bcstring be_const_str_setrange; +extern const bcstring be_const_str_I2S_IN_CLK; +extern const bcstring be_const_str_SYMBOL_OK; +extern const bcstring be_const_str_get; +extern const bcstring be_const_str_OUTPUT_OPEN_DRAIN; +extern const bcstring be_const_str_PULLDOWN; +extern const bcstring be_const_str_SYMBOL_BELL; +extern const bcstring be_const_str_SYMBOL_BATTERY_1; +extern const bcstring be_const_str_SYMBOL_LOOP; +extern const bcstring be_const_str_atan; +extern const bcstring be_const_str_size; +extern const bcstring be_const_str_opt_add; +extern const bcstring be_const_str_lower; +extern const bcstring be_const_str_wire_scan; +extern const bcstring be_const_str_import; +extern const bcstring be_const_str_REL1_INV; +extern const bcstring be_const_str_lv_gauge; +extern const bcstring be_const_str_Tasmota; +extern const bcstring be_const_str_check_privileged_access; +extern const bcstring be_const_str_wire2; +extern const bcstring be_const_str_DDSU666_TX; +extern const bcstring be_const_str_collect; +extern const bcstring be_const_str_init; +extern const bcstring be_const_str_PWM1; +extern const bcstring be_const_str_ROT1B_NP; +extern const bcstring be_const_str_screenshot; +extern const bcstring be_const_str_DDS2382_RX; +extern const bcstring be_const_str_format; +extern const bcstring be_const_str_pi; +extern const bcstring be_const_str_RC522_RST; +extern const bcstring be_const_str_lv_draw_mask_angle_param_cfg; +extern const bcstring be_const_str_AS608_TX; +extern const bcstring be_const_str_SSPI_DC; +extern const bcstring be_const_str_traceback; +extern const bcstring be_const_str_dot_p1; +extern const bcstring be_const_str_SYMBOL_PASTE; +extern const bcstring be_const_str_char; +extern const bcstring be_const_str_ADC_LIGHT; +extern const bcstring be_const_str_deinit; +extern const bcstring be_const_str_digital_read; +extern const bcstring be_const_str_srand; +extern const bcstring be_const_str_DHT11_OUT; +extern const bcstring be_const_str_imin; +extern const bcstring be_const_str_toint; +extern const bcstring be_const_str_PMS5003_RX; +extern const bcstring be_const_str_break; +extern const bcstring be_const_str_LEDLNK; +extern const bcstring be_const_str_MGC3130_RESET; +extern const bcstring be_const_str_insert; +extern const bcstring be_const_str_IBEACON_TX; +extern const bcstring be_const_str_SYMBOL_POWER; +extern const bcstring be_const_str_SYMBOL_WIFI; +extern const bcstring be_const_str_PZEM0XX_TX; +extern const bcstring be_const_str_KEY1_PD; +extern const bcstring be_const_str_resp_cmnd_str; +extern const bcstring be_const_str_reverse; +extern const bcstring be_const_str_PN532_RXD; +extern const bcstring be_const_str_SYMBOL_SHUFFLE; +extern const bcstring be_const_str_false; +extern const bcstring be_const_str_TCP_TX; +extern const bcstring be_const_str_DYP_RX; +extern const bcstring be_const_str_continue; +extern const bcstring be_const_str_AudioFileSourceFS; +extern const bcstring be_const_str_AudioOutput; +extern const bcstring be_const_str_SYMBOL_MUTE; +extern const bcstring be_const_str_TM1638STB; +extern const bcstring be_const_str_BL0940_RX; +extern const bcstring be_const_str_BOILER_OT_RX; +extern const bcstring be_const_str_TUYA_RX; +extern const bcstring be_const_str_remove; +extern const bcstring be_const_str_web_send_decimal; +extern const bcstring be_const_str__read; +extern const bcstring be_const_str_CHANGE; +extern const bcstring be_const_str_SM2135_CLK; +extern const bcstring be_const_str_TCP_RX; +extern const bcstring be_const_str_codedump; +extern const bcstring be_const_str_lv_canvas; +extern const bcstring be_const_str_def; +extern const bcstring be_const_str_CNTR1_NP; +extern const bcstring be_const_str_GPS_TX; +extern const bcstring be_const_str_TASMOTACLIENT_RXD; +extern const bcstring be_const_str_classname; +extern const bcstring be_const_str_NRG_SEL_INV; diff --git a/lib/libesp32/Berry/generate/be_const_strtab_def.h b/lib/libesp32/Berry/generate/be_const_strtab_def.h index 3141a2641..aeed1bb30 100644 --- a/lib/libesp32/Berry/generate/be_const_strtab_def.h +++ b/lib/libesp32/Berry/generate/be_const_strtab_def.h @@ -1,949 +1,976 @@ -be_define_const_str(lv_style, "lv_style", 4151611549u, 0, 8, NULL); -be_define_const_str(ETH_PHY_MDIO, "ETH_PHY_MDIO", 3261871568u, 0, 12, &be_const_str_SYMBOL_PLUS); -be_define_const_str(SYMBOL_PLUS, "SYMBOL_PLUS", 2860093262u, 0, 11, &be_const_str_hex); -be_define_const_str(hex, "hex", 4273249610u, 0, 3, &be_const_str_setrange); -be_define_const_str(setrange, "setrange", 3794019032u, 0, 8, NULL); -be_define_const_str(bus, "bus", 1607822841u, 0, 3, &be_const_str_concat); -be_define_const_str(concat, "concat", 4124019837u, 0, 6, &be_const_str_raise); -be_define_const_str(raise, "raise", 1593437475u, 70, 5, NULL); -be_define_const_str(ROT1A, "ROT1A", 759599716u, 0, 5, &be_const_str_SPI_CLK); -be_define_const_str(SPI_CLK, "SPI_CLK", 3943233814u, 0, 7, &be_const_str_SYMBOL_MINUS); -be_define_const_str(SYMBOL_MINUS, "SYMBOL_MINUS", 1806749158u, 0, 12, &be_const_str_WEBCAM_PSCLK); -be_define_const_str(WEBCAM_PSCLK, "WEBCAM_PSCLK", 3150007456u, 0, 12, &be_const_str_top); -be_define_const_str(top, "top", 2802900028u, 0, 3, NULL); -be_define_const_str(EPAPER42_CS, "EPAPER42_CS", 3274717451u, 0, 11, &be_const_str_return); -be_define_const_str(return, "return", 2246981567u, 60, 6, NULL); -be_define_const_str(MCP39F5_RST, "MCP39F5_RST", 3657125652u, 0, 11, &be_const_str_OUTPUT_OPEN_DRAIN); -be_define_const_str(OUTPUT_OPEN_DRAIN, "OUTPUT_OPEN_DRAIN", 2147249436u, 0, 17, &be_const_str_write_bytes); -be_define_const_str(write_bytes, "write_bytes", 1227543792u, 0, 11, NULL); -be_define_const_str(SYMBOL_SETTINGS, "SYMBOL_SETTINGS", 339656335u, 0, 15, &be_const_str_call); -be_define_const_str(call, "call", 3018949801u, 0, 4, &be_const_str_lv_draw_mask_angle_param); -be_define_const_str(lv_draw_mask_angle_param, "lv_draw_mask_angle_param", 4192166041u, 0, 24, NULL); -be_define_const_str(pi, "pi", 1213090802u, 0, 2, NULL); -be_define_const_str(acos, "acos", 1006755615u, 0, 4, &be_const_str_atan); -be_define_const_str(atan, "atan", 108579519u, 0, 4, &be_const_str_content_flush); -be_define_const_str(content_flush, "content_flush", 214922475u, 0, 13, NULL); -be_define_const_str(SYMBOL_BACKSPACE, "SYMBOL_BACKSPACE", 1997168681u, 0, 16, &be_const_str_TM1638STB); -be_define_const_str(TM1638STB, "TM1638STB", 823674593u, 0, 9, NULL); -be_define_const_str(resp_cmnd, "resp_cmnd", 2869459626u, 0, 9, &be_const_str_web_add_management_button); -be_define_const_str(web_add_management_button, "web_add_management_button", 2738877186u, 0, 25, NULL); -be_define_const_str(NRG_SEL, "NRG_SEL", 1771358125u, 0, 7, NULL); -be_define_const_str(SYMBOL_OK, "SYMBOL_OK", 4033162940u, 0, 9, &be_const_str_Wire); -be_define_const_str(Wire, "Wire", 1938276536u, 0, 4, NULL); -be_define_const_str(SYMBOL_BATTERY_3, "SYMBOL_BATTERY_3", 662591301u, 0, 16, &be_const_str_init); -be_define_const_str(init, "init", 380752755u, 0, 4, &be_const_str_redirect); -be_define_const_str(redirect, "redirect", 389758641u, 0, 8, NULL); -be_define_const_str(ADC_TEMP, "ADC_TEMP", 3771053440u, 0, 8, &be_const_str__get_cb); -be_define_const_str(_get_cb, "_get_cb", 1448849122u, 0, 7, &be_const_str_finish); -be_define_const_str(finish, "finish", 1494643858u, 0, 6, NULL); -be_define_const_str(SPI_DC, "SPI_DC", 553259951u, 0, 6, NULL); -be_define_const_str(MIEL_HVAC_RX, "MIEL_HVAC_RX", 3720609648u, 0, 12, &be_const_str_NEOPOOL_TX); -be_define_const_str(NEOPOOL_TX, "NEOPOOL_TX", 2924925804u, 0, 10, &be_const_str_SSD1331_CS); -be_define_const_str(SSD1331_CS, "SSD1331_CS", 4191047928u, 0, 10, &be_const_str_TELEINFO_RX); -be_define_const_str(TELEINFO_RX, "TELEINFO_RX", 1195717356u, 0, 11, NULL); -be_define_const_str(SHELLY_DIMMER_RST_INV, "SHELLY_DIMMER_RST_INV", 2366759773u, 0, 21, NULL); -be_define_const_str(MAX7219CS, "MAX7219CS", 2593198244u, 0, 9, &be_const_str_pin_mode); -be_define_const_str(pin_mode, "pin_mode", 3258314030u, 0, 8, NULL); -be_define_const_str(SDM72_RX, "SDM72_RX", 766750035u, 0, 8, &be_const_str_SYMBOL_HOME); -be_define_const_str(SYMBOL_HOME, "SYMBOL_HOME", 730845525u, 0, 11, &be_const_str_TM1637CLK); -be_define_const_str(TM1637CLK, "TM1637CLK", 2797300857u, 0, 9, &be_const_str_char); -be_define_const_str(char, "char", 2823553821u, 0, 4, &be_const_str_resp_cmnd_done); -be_define_const_str(resp_cmnd_done, "resp_cmnd_done", 2601874875u, 0, 14, NULL); -be_define_const_str(ADC_LIGHT, "ADC_LIGHT", 3982461502u, 0, 9, &be_const_str_ZIGBEE_TX); -be_define_const_str(ZIGBEE_TX, "ZIGBEE_TX", 25119256u, 0, 9, NULL); -be_define_const_str(lv_dropdown, "lv_dropdown", 2797165301u, 0, 11, NULL); -be_define_const_str(A4988_DIR, "A4988_DIR", 2223595843u, 0, 9, &be_const_str_AS3935); -be_define_const_str(AS3935, "AS3935", 603621745u, 0, 6, &be_const_str_lv_sqrt_res); -be_define_const_str(lv_sqrt_res, "lv_sqrt_res", 2904473995u, 0, 11, NULL); -be_define_const_str(IEM3000_TX, "IEM3000_TX", 1185907310u, 0, 10, &be_const_str_cosh); -be_define_const_str(cosh, "cosh", 4099687964u, 0, 4, &be_const_str_web_sensor); -be_define_const_str(web_sensor, "web_sensor", 2900096972u, 0, 10, &be_const_str_continue); -be_define_const_str(continue, "continue", 2977070660u, 59, 8, NULL); -be_define_const_str(BS814_DAT, "BS814_DAT", 3620403837u, 0, 9, NULL); -be_define_const_str(opt_add, "+", 772578730u, 0, 1, &be_const_str_A4988_ENA); -be_define_const_str(A4988_ENA, "A4988_ENA", 1517502682u, 0, 9, &be_const_str_lv_point); -be_define_const_str(lv_point, "lv_point", 4120221790u, 0, 8, NULL); -be_define_const_str(delay, "delay", 1322381784u, 0, 5, &be_const_str_resp_cmnd_str); -be_define_const_str(resp_cmnd_str, "resp_cmnd_str", 737845590u, 0, 13, NULL); -be_define_const_str(iter, "iter", 3124256359u, 0, 4, NULL); -be_define_const_str(fromstring, "fromstring", 610302344u, 0, 10, &be_const_str_lv_event_cb); -be_define_const_str(lv_event_cb, "lv_event_cb", 2480731016u, 0, 11, NULL); -be_define_const_str(CNTR1_NP, "CNTR1_NP", 4288381648u, 0, 8, NULL); -be_define_const_str(tanh, "tanh", 153638352u, 0, 4, NULL); -be_define_const_str(lv_objmask, "lv_objmask", 1311221665u, 0, 10, NULL); -be_define_const_str(SOLAXX1_RX, "SOLAXX1_RX", 971867054u, 0, 10, NULL); -be_define_const_str(HRE_CLOCK, "HRE_CLOCK", 2870559111u, 0, 9, &be_const_str_MAX31855CS); -be_define_const_str(MAX31855CS, "MAX31855CS", 753620511u, 0, 10, &be_const_str_SDM630_TX); -be_define_const_str(SDM630_TX, "SDM630_TX", 696213075u, 0, 9, &be_const_str_every_second); -be_define_const_str(every_second, "every_second", 2075451465u, 0, 12, NULL); -be_define_const_str(SYMBOL_AUDIO, "SYMBOL_AUDIO", 3056537956u, 0, 12, NULL); -be_define_const_str(RC522_CS, "RC522_CS", 2639619996u, 0, 8, &be_const_str_def); -be_define_const_str(def, "def", 3310976652u, 55, 3, NULL); -be_define_const_str(REL1, "REL1", 3142397887u, 0, 4, &be_const_str_load_font); -be_define_const_str(load_font, "load_font", 1875840019u, 0, 9, &be_const_str_real); -be_define_const_str(real, "real", 3604983901u, 0, 4, &be_const_str_set); -be_define_const_str(set, "set", 3324446467u, 0, 3, NULL); -be_define_const_str(PZEM016_RX, "PZEM016_RX", 1004012055u, 0, 10, &be_const_str_SSPI_CS); -be_define_const_str(SSPI_CS, "SSPI_CS", 977784795u, 0, 7, NULL); -be_define_const_str(SYMBOL_TRASH, "SYMBOL_TRASH", 3169100368u, 0, 12, &be_const_str_wire); -be_define_const_str(wire, "wire", 4082753944u, 0, 4, NULL); -be_define_const_str(REL1_INV, "REL1_INV", 3733155371u, 0, 8, NULL); -be_define_const_str(FTC532, "FTC532", 3182343438u, 0, 6, &be_const_str_OUTPUT_HI); -be_define_const_str(OUTPUT_HI, "OUTPUT_HI", 3153592902u, 0, 9, &be_const_str_classof); -be_define_const_str(classof, "classof", 1796577762u, 0, 7, &be_const_str_web_send_decimal); -be_define_const_str(web_send_decimal, "web_send_decimal", 1407210204u, 0, 16, NULL); -be_define_const_str(opt_neq, "!=", 2428715011u, 0, 2, &be_const_str_LED1_INV); -be_define_const_str(LED1_INV, "LED1_INV", 2112045097u, 0, 8, &be_const_str_load); -be_define_const_str(load, "load", 3859241449u, 0, 4, NULL); -be_define_const_str(ADC_INPUT, "ADC_INPUT", 2207556878u, 0, 9, &be_const_str_SPI_CS); -be_define_const_str(SPI_CS, "SPI_CS", 553701236u, 0, 6, &be_const_str_WEBCAM_RESET); -be_define_const_str(WEBCAM_RESET, "WEBCAM_RESET", 2171221520u, 0, 12, &be_const_str_ceil); -be_define_const_str(ceil, "ceil", 1659167240u, 0, 4, &be_const_str_clear); -be_define_const_str(clear, "clear", 1550717474u, 0, 5, NULL); -be_define_const_str(cmd, "cmd", 4136785899u, 0, 3, &be_const_str_response_append); -be_define_const_str(response_append, "response_append", 450346371u, 0, 15, NULL); -be_define_const_str(lv_btn, "lv_btn", 1612829968u, 0, 6, &be_const_str_lv_draw_line_dsc); -be_define_const_str(lv_draw_line_dsc, "lv_draw_line_dsc", 2422805236u, 0, 16, NULL); -be_define_const_str(gc, "gc", 1042313471u, 0, 2, NULL); -be_define_const_str(WINDMETER_SPEED, "WINDMETER_SPEED", 1980822204u, 0, 15, &be_const_str_number); -be_define_const_str(number, "number", 467038368u, 0, 6, &be_const_str_write_bit); -be_define_const_str(write_bit, "write_bit", 2660990436u, 0, 9, NULL); -be_define_const_str(WEBCAM_SIOC, "WEBCAM_SIOC", 218815147u, 0, 11, NULL); -be_define_const_str(I2C_SCL, "I2C_SCL", 164217098u, 0, 7, &be_const_str_XPT2046_CS); -be_define_const_str(XPT2046_CS, "XPT2046_CS", 4049231042u, 0, 10, &be_const_str_lv_calendar); -be_define_const_str(lv_calendar, "lv_calendar", 3284396894u, 0, 11, NULL); -be_define_const_str(RISING, "RISING", 1256404539u, 0, 6, &be_const_str_arg); -be_define_const_str(arg, "arg", 1047474471u, 0, 3, NULL); -be_define_const_str(_read, "_read", 346717030u, 0, 5, &be_const_str_rand); -be_define_const_str(rand, "rand", 2711325910u, 0, 4, NULL); -be_define_const_str(SYMBOL_SHUFFLE, "SYMBOL_SHUFFLE", 1123310147u, 0, 14, NULL); -be_define_const_str(DDSU666_TX, "DDSU666_TX", 1880604150u, 0, 10, &be_const_str_web_add_button); -be_define_const_str(web_add_button, "web_add_button", 3537875058u, 0, 14, &be_const_str_except); -be_define_const_str(except, "except", 950914032u, 69, 6, NULL); -be_define_const_str(RFRECV, "RFRECV", 354742801u, 0, 6, NULL); -be_define_const_str(PZEM017_RX, "PZEM017_RX", 3227495894u, 0, 10, &be_const_str_RA8876_CS); -be_define_const_str(RA8876_CS, "RA8876_CS", 2529944108u, 0, 9, NULL); -be_define_const_str(KEY1_INV, "KEY1_INV", 263542563u, 0, 8, &be_const_str___iterator__); -be_define_const_str(__iterator__, "__iterator__", 3884039703u, 0, 12, &be_const_str_lv_draw_mask_map_param_cfg); -be_define_const_str(lv_draw_mask_map_param_cfg, "lv_draw_mask_map_param_cfg", 3822900597u, 0, 26, &be_const_str_module); -be_define_const_str(module, "module", 3617558685u, 0, 6, NULL); -be_define_const_str(ADC_BUTTON, "ADC_BUTTON", 3393454690u, 0, 10, NULL); -be_define_const_str(get_tasmota, "get_tasmota", 334356779u, 0, 11, &be_const_str_read24); -be_define_const_str(read24, "read24", 1808533811u, 0, 6, &be_const_str_start); -be_define_const_str(start, "start", 1697318111u, 0, 5, NULL); -be_define_const_str(MIEL_HVAC_TX, "MIEL_HVAC_TX", 567403014u, 0, 12, &be_const_str_SYMBOL_DRIVE); -be_define_const_str(SYMBOL_DRIVE, "SYMBOL_DRIVE", 567203502u, 0, 12, &be_const_str_SYMBOL_WARNING); -be_define_const_str(SYMBOL_WARNING, "SYMBOL_WARNING", 4119913686u, 0, 14, &be_const_str_gamma8); -be_define_const_str(gamma8, "gamma8", 3802843830u, 0, 6, &be_const_str_lv_draw_mask_line_param); -be_define_const_str(lv_draw_mask_line_param, "lv_draw_mask_line_param", 2692990704u, 0, 23, &be_const_str_memory); -be_define_const_str(memory, "memory", 2229924270u, 0, 6, NULL); -be_define_const_str(SPI_MOSI, "SPI_MOSI", 2494218614u, 0, 8, &be_const_str_digital_read); -be_define_const_str(digital_read, "digital_read", 3585496928u, 0, 12, &be_const_str_lv_design_cb); -be_define_const_str(lv_design_cb, "lv_design_cb", 3822640502u, 0, 12, NULL); -be_define_const_str(MD5, "MD5", 1935726387u, 0, 3, &be_const_str_get_option); -be_define_const_str(get_option, "get_option", 2123730033u, 0, 10, &be_const_str_lv_checkbox); -be_define_const_str(lv_checkbox, "lv_checkbox", 7454841u, 0, 11, NULL); -be_define_const_str(PMS5003_RX, "PMS5003_RX", 3934985650u, 0, 10, &be_const_str_SYMBOL_BATTERY_2); -be_define_const_str(SYMBOL_BATTERY_2, "SYMBOL_BATTERY_2", 645813682u, 0, 16, &be_const_str_read32); -be_define_const_str(read32, "read32", 1741276240u, 0, 6, NULL); -be_define_const_str(dump, "dump", 3663001223u, 0, 4, NULL); -be_define_const_str(SYMBOL_EYE_CLOSE, "SYMBOL_EYE_CLOSE", 404721792u, 0, 16, NULL); -be_define_const_str(SYMBOL_IMAGE, "SYMBOL_IMAGE", 815601151u, 0, 12, &be_const_str_abs); -be_define_const_str(abs, "abs", 709362235u, 0, 3, &be_const_str_traceback); -be_define_const_str(traceback, "traceback", 3385188109u, 0, 9, NULL); -be_define_const_str(HPMA_RX, "HPMA_RX", 3462528998u, 0, 7, &be_const_str_SM16716_DAT); -be_define_const_str(SM16716_DAT, "SM16716_DAT", 1905621806u, 0, 11, &be_const_str_SYMBOL_PAUSE); -be_define_const_str(SYMBOL_PAUSE, "SYMBOL_PAUSE", 641998172u, 0, 12, &be_const_str_attrdump); -be_define_const_str(attrdump, "attrdump", 1521571304u, 0, 8, &be_const_str_lv_draw_mask_fade_param); -be_define_const_str(lv_draw_mask_fade_param, "lv_draw_mask_fade_param", 2743309964u, 0, 23, NULL); -be_define_const_str(CC1101_GDO0, "CC1101_GDO0", 940611027u, 0, 11, NULL); -be_define_const_str(super, "super", 4152230356u, 0, 5, &be_const_str_if); -be_define_const_str(if, "if", 959999494u, 50, 2, NULL); -be_define_const_str(TCP_RX, "TCP_RX", 3904354751u, 0, 6, &be_const_str_keys); -be_define_const_str(keys, "keys", 4182378701u, 0, 4, &be_const_str_lv_led); -be_define_const_str(lv_led, "lv_led", 3192184733u, 0, 6, &be_const_str_time_dump); -be_define_const_str(time_dump, "time_dump", 3330410747u, 0, 9, NULL); -be_define_const_str(HPMA_TX, "HPMA_TX", 173233104u, 0, 7, &be_const_str_PN532_TXD); -be_define_const_str(PN532_TXD, "PN532_TXD", 3093418644u, 0, 9, &be_const_str_compile); -be_define_const_str(compile, "compile", 1000265118u, 0, 7, NULL); -be_define_const_str(TCP_TX, "TCP_TX", 2762594089u, 0, 6, &be_const_str_lv_gauge_format_cb); -be_define_const_str(lv_gauge_format_cb, "lv_gauge_format_cb", 4073149249u, 0, 18, NULL); -be_define_const_str(remove_rule, "remove_rule", 3456211328u, 0, 11, NULL); -be_define_const_str(KEY1_TC, "KEY1_TC", 25685109u, 0, 7, &be_const_str_TASMOTACLIENT_RST); -be_define_const_str(TASMOTACLIENT_RST, "TASMOTACLIENT_RST", 3326196213u, 0, 17, &be_const_str_tolower); -be_define_const_str(tolower, "tolower", 1042520049u, 0, 7, &be_const_str_type); -be_define_const_str(type, "type", 1361572173u, 0, 4, NULL); -be_define_const_str(lv_cont, "lv_cont", 1391686552u, 0, 7, NULL); -be_define_const_str(every_100ms, "every_100ms", 1546407804u, 0, 11, &be_const_str_lv_list); -be_define_const_str(lv_list, "lv_list", 2876551248u, 0, 7, NULL); -be_define_const_str(CSE7766_TX, "CSE7766_TX", 674624821u, 0, 10, &be_const_str__available); -be_define_const_str(_available, "_available", 1306196581u, 0, 10, &be_const_str_display); -be_define_const_str(display, "display", 1164572437u, 0, 7, &be_const_str_sin); -be_define_const_str(sin, "sin", 3761252941u, 0, 3, NULL); -be_define_const_str(SM2135_DAT, "SM2135_DAT", 2882726942u, 0, 10, &be_const_str_WEBCAM_SIOD); -be_define_const_str(WEBCAM_SIOD, "WEBCAM_SIOD", 302703242u, 0, 11, &be_const_str_publish); -be_define_const_str(publish, "publish", 264247304u, 0, 7, NULL); -be_define_const_str(input, "input", 4191711099u, 0, 5, &be_const_str_map); -be_define_const_str(map, "map", 3751997361u, 0, 3, NULL); -be_define_const_str(IRRECV, "IRRECV", 1743648982u, 0, 6, &be_const_str_SSD1351_CS); -be_define_const_str(SSD1351_CS, "SSD1351_CS", 488746042u, 0, 10, &be_const_str_SYMBOL_PLAY); -be_define_const_str(SYMBOL_PLAY, "SYMBOL_PLAY", 1750902100u, 0, 11, NULL); -be_define_const_str(MGC3130_RESET, "MGC3130_RESET", 405013121u, 0, 13, &be_const_str_SYMBOL_SAVE); -be_define_const_str(SYMBOL_SAVE, "SYMBOL_SAVE", 2439821015u, 0, 11, &be_const_str_lv_draw_mask_radius_param_cfg); -be_define_const_str(lv_draw_mask_radius_param_cfg, "lv_draw_mask_radius_param_cfg", 3889386773u, 0, 29, NULL); -be_define_const_str(resp_cmnd_failed, "resp_cmnd_failed", 2136281562u, 0, 16, NULL); -be_define_const_str(ADC_RANGE, "ADC_RANGE", 3467329543u, 0, 9, NULL); -be_define_const_str(PZEM0XX_TX, "PZEM0XX_TX", 944775704u, 0, 10, &be_const_str_SYMBOL_USB); -be_define_const_str(SYMBOL_USB, "SYMBOL_USB", 1962656552u, 0, 10, &be_const_str_int); -be_define_const_str(int, "int", 2515107422u, 0, 3, &be_const_str_time_str); -be_define_const_str(time_str, "time_str", 2613827612u, 0, 8, NULL); -be_define_const_str(LEDLNK_INV, "LEDLNK_INV", 3559015101u, 0, 10, &be_const_str_VL53L0X_XSHUT1); -be_define_const_str(VL53L0X_XSHUT1, "VL53L0X_XSHUT1", 2341134183u, 0, 14, &be_const_str_set_power); -be_define_const_str(set_power, "set_power", 549820893u, 0, 9, NULL); -be_define_const_str(_end_transmission, "_end_transmission", 3237480400u, 0, 17, NULL); -be_define_const_str(get, "get", 1410115415u, 0, 3, NULL); -be_define_const_str(SPI_MISO, "SPI_MISO", 150818010u, 0, 8, &be_const_str_print); -be_define_const_str(print, "print", 372738696u, 0, 5, NULL); -be_define_const_str(format, "format", 3114108242u, 0, 6, NULL); -be_define_const_str(MAX7219DIN, "MAX7219DIN", 380687049u, 0, 10, &be_const_str_lv_img); -be_define_const_str(lv_img, "lv_img", 2474052327u, 0, 6, NULL); -be_define_const_str(HM10_RX, "HM10_RX", 515085922u, 0, 7, &be_const_str_allocated); -be_define_const_str(allocated, "allocated", 429986098u, 0, 9, &be_const_str_while); -be_define_const_str(while, "while", 231090382u, 53, 5, NULL); -be_define_const_str(getbits, "getbits", 3094168979u, 0, 7, &be_const_str_lv_spinner); -be_define_const_str(lv_spinner, "lv_spinner", 3361501901u, 0, 10, &be_const_str_pow); -be_define_const_str(pow, "pow", 1479764693u, 0, 3, NULL); -be_define_const_str(A4988_MS1, "A4988_MS1", 1729976611u, 0, 9, &be_const_str_SYMBOL_KEYBOARD); -be_define_const_str(SYMBOL_KEYBOARD, "SYMBOL_KEYBOARD", 1621492879u, 0, 15, &be_const_str_lv_slider); -be_define_const_str(lv_slider, "lv_slider", 2274180781u, 0, 9, &be_const_str_read13); -be_define_const_str(read13, "read13", 12887293u, 0, 6, NULL); -be_define_const_str(NRF24_CS, "NRF24_CS", 555833194u, 0, 8, &be_const_str_PWM1); -be_define_const_str(PWM1, "PWM1", 1353352426u, 0, 4, &be_const_str_SWT1); -be_define_const_str(SWT1, "SWT1", 805224112u, 0, 4, NULL); -be_define_const_str(SSD1331_DC, "SSD1331_DC", 3386560859u, 0, 10, NULL); -be_define_const_str(PMS5003_TX, "PMS5003_TX", 3868169364u, 0, 10, &be_const_str_TM1638DIO); -be_define_const_str(TM1638DIO, "TM1638DIO", 1408212414u, 0, 9, &be_const_str__cmd); -be_define_const_str(_cmd, "_cmd", 3419822142u, 0, 4, &be_const_str_asin); -be_define_const_str(asin, "asin", 4272848550u, 0, 4, &be_const_str_read12); -be_define_const_str(read12, "read12", 4291076970u, 0, 6, &be_const_str_state); -be_define_const_str(state, "state", 2016490230u, 0, 5, NULL); -be_define_const_str(exec_cmd, "exec_cmd", 493567399u, 0, 8, NULL); -be_define_const_str(HLW_CF, "HLW_CF", 3982619486u, 0, 6, NULL); -be_define_const_str(SYMBOL_DIRECTORY, "SYMBOL_DIRECTORY", 1886053449u, 0, 16, &be_const_str_SYMBOL_PASTE); -be_define_const_str(SYMBOL_PASTE, "SYMBOL_PASTE", 2281577421u, 0, 12, &be_const_str_resolvecmnd); -be_define_const_str(resolvecmnd, "resolvecmnd", 993361485u, 0, 11, NULL); -be_define_const_str(ST7789_CS, "ST7789_CS", 2937305434u, 0, 9, NULL); -be_define_const_str(SYMBOL_BATTERY_FULL, "SYMBOL_BATTERY_FULL", 2638935545u, 0, 19, NULL); -be_define_const_str(log10, "log10", 2346846000u, 0, 5, NULL); -be_define_const_str(TXD, "TXD", 3614562079u, 0, 3, NULL); -be_define_const_str(SYMBOL_EYE_OPEN, "SYMBOL_EYE_OPEN", 3449311676u, 0, 15, &be_const_str__buffer); -be_define_const_str(_buffer, "_buffer", 2044888568u, 0, 7, NULL); -be_define_const_str(EXS_ENABLE, "EXS_ENABLE", 1896914313u, 0, 10, &be_const_str_HJL_CF); -be_define_const_str(HJL_CF, "HJL_CF", 786158487u, 0, 6, &be_const_str_lv_draw_mask_fade_param_cfg); -be_define_const_str(lv_draw_mask_fade_param_cfg, "lv_draw_mask_fade_param_cfg", 4158595197u, 0, 27, NULL); -be_define_const_str(PROJECTOR_CTRL_RX, "PROJECTOR_CTRL_RX", 1542762460u, 0, 17, NULL); -be_define_const_str(SBR_TX, "SBR_TX", 3419096015u, 0, 6, &be_const_str_sqrt); -be_define_const_str(sqrt, "sqrt", 2112764879u, 0, 4, NULL); -be_define_const_str(MAX31855DO, "MAX31855DO", 552730368u, 0, 10, &be_const_str_SYMBOL_DOWN); -be_define_const_str(SYMBOL_DOWN, "SYMBOL_DOWN", 1107513570u, 0, 11, &be_const_str_save_before_restart); -be_define_const_str(save_before_restart, "save_before_restart", 1253239338u, 0, 19, &be_const_str_write8); -be_define_const_str(write8, "write8", 3133991532u, 0, 6, NULL); -be_define_const_str(byte, "byte", 1683620383u, 0, 4, NULL); -be_define_const_str(write, "write", 3190202204u, 0, 5, NULL); -be_define_const_str(GPS_TX, "GPS_TX", 4228740808u, 0, 6, NULL); -be_define_const_str(ELECTRIQ_MOODL_TX, "ELECTRIQ_MOODL_TX", 31009247u, 0, 17, &be_const_str_SYMBOL_BATTERY_1); -be_define_const_str(SYMBOL_BATTERY_1, "SYMBOL_BATTERY_1", 629036063u, 0, 16, &be_const_str_WE517_RX); -be_define_const_str(WE517_RX, "WE517_RX", 4096577879u, 0, 8, &be_const_str_digital_write); -be_define_const_str(digital_write, "digital_write", 3435877979u, 0, 13, &be_const_str_lv_spinbox); -be_define_const_str(lv_spinbox, "lv_spinbox", 2666096729u, 0, 10, NULL); -be_define_const_str(lv_switch, "lv_switch", 3407171508u, 0, 9, &be_const_str_pin); -be_define_const_str(pin, "pin", 1866532500u, 0, 3, &be_const_str_pin_used); -be_define_const_str(pin_used, "pin_used", 4033854612u, 0, 8, NULL); -be_define_const_str(SAIR_RX, "SAIR_RX", 1273688713u, 0, 7, &be_const_str_SI7021); -be_define_const_str(SI7021, "SI7021", 864377911u, 0, 6, &be_const_str_WE517_TX); -be_define_const_str(WE517_TX, "WE517_TX", 2954817217u, 0, 8, &be_const_str_lv_obj); -be_define_const_str(lv_obj, "lv_obj", 4257833149u, 0, 6, NULL); -be_define_const_str(SSPI_MAX31865_CS1, "SSPI_MAX31865_CS1", 1256578724u, 0, 17, NULL); -be_define_const_str(DHT22, "DHT22", 215937903u, 0, 5, &be_const_str_arg_size); -be_define_const_str(arg_size, "arg_size", 3310243257u, 0, 8, &be_const_str_millis); -be_define_const_str(millis, "millis", 1214679063u, 0, 6, &be_const_str_remove); -be_define_const_str(remove, "remove", 3683784189u, 0, 6, NULL); -be_define_const_str(deinit, "deinit", 2345559592u, 0, 6, &be_const_str_wire2); -be_define_const_str(wire2, "wire2", 3229499038u, 0, 5, NULL); -be_define_const_str(SYMBOL_FILE, "SYMBOL_FILE", 237085260u, 0, 11, &be_const_str_lv_canvas); -be_define_const_str(lv_canvas, "lv_canvas", 142865412u, 0, 9, NULL); -be_define_const_str(ROT1A_NP, "ROT1A_NP", 2322706903u, 0, 8, &be_const_str_WEBCAM_DATA); -be_define_const_str(WEBCAM_DATA, "WEBCAM_DATA", 1476954421u, 0, 11, NULL); -be_define_const_str(IEM3000_RX, "IEM3000_RX", 1117811096u, 0, 10, &be_const_str_NEOPOOL_RX); -be_define_const_str(NEOPOOL_RX, "NEOPOOL_RX", 1917974474u, 0, 10, &be_const_str_OUTPUT); -be_define_const_str(OUTPUT, "OUTPUT", 1469629700u, 0, 6, &be_const_str_lv_msgbox); -be_define_const_str(lv_msgbox, "lv_msgbox", 689085206u, 0, 9, NULL); -be_define_const_str(has_arg, "has_arg", 424878688u, 0, 7, &be_const_str_lv_table); +be_define_const_str(OPTION_A, "OPTION_A", 1133299440u, 0, 8, &be_const_str_pin); +be_define_const_str(pin, "pin", 1866532500u, 0, 3, NULL); +be_define_const_str(BACKLIGHT, "BACKLIGHT", 3147761926u, 0, 9, &be_const_str_HIGH); +be_define_const_str(HIGH, "HIGH", 2066738941u, 0, 4, &be_const_str_SYMBOL_IMAGE); +be_define_const_str(SYMBOL_IMAGE, "SYMBOL_IMAGE", 815601151u, 0, 12, &be_const_str_content_stop); +be_define_const_str(content_stop, "content_stop", 658554751u, 0, 12, NULL); +be_define_const_str(int, "int", 2515107422u, 0, 3, &be_const_str_push); +be_define_const_str(push, "push", 2272264157u, 0, 4, NULL); +be_define_const_str(SR04_TRIG, "SR04_TRIG", 68671263u, 0, 9, &be_const_str_VL53L0X_XSHUT1); +be_define_const_str(VL53L0X_XSHUT1, "VL53L0X_XSHUT1", 2341134183u, 0, 14, &be_const_str_millis); +be_define_const_str(millis, "millis", 1214679063u, 0, 6, NULL); +be_define_const_str(LE01MR_RX, "LE01MR_RX", 1521590809u, 0, 9, &be_const_str_lv_indev); +be_define_const_str(lv_indev, "lv_indev", 225602374u, 0, 8, NULL); +be_define_const_str(RC522_CS, "RC522_CS", 2639619996u, 0, 8, &be_const_str_SYMBOL_REFRESH); +be_define_const_str(SYMBOL_REFRESH, "SYMBOL_REFRESH", 1266229761u, 0, 14, &be_const_str_redirect); +be_define_const_str(redirect, "redirect", 389758641u, 0, 8, &be_const_str_response_append); +be_define_const_str(response_append, "response_append", 450346371u, 0, 15, &be_const_str_else); +be_define_const_str(else, "else", 3183434736u, 52, 4, NULL); +be_define_const_str(ADE7953_IRQ, "ADE7953_IRQ", 2329185922u, 0, 11, &be_const_str_SWT1); +be_define_const_str(SWT1, "SWT1", 805224112u, 0, 4, &be_const_str_SYMBOL_BLUETOOTH); +be_define_const_str(SYMBOL_BLUETOOTH, "SYMBOL_BLUETOOTH", 679376572u, 0, 16, &be_const_str__get_cb); +be_define_const_str(_get_cb, "_get_cb", 1448849122u, 0, 7, NULL); +be_define_const_str(SSPI_MISO, "SSPI_MISO", 2485347173u, 0, 9, &be_const_str_SYMBOL_PREV); +be_define_const_str(SYMBOL_PREV, "SYMBOL_PREV", 2952615023u, 0, 11, NULL); +be_define_const_str(KEY1_TC, "KEY1_TC", 25685109u, 0, 7, NULL); +be_define_const_str(ADC_BUTTON, "ADC_BUTTON", 3393454690u, 0, 10, &be_const_str_lv_table); be_define_const_str(lv_table, "lv_table", 1675691020u, 0, 8, NULL); -be_define_const_str(SSPI_MOSI, "SSPI_MOSI", 3745917497u, 0, 9, NULL); -be_define_const_str(CSE7761_TX, "CSE7761_TX", 3354719142u, 0, 10, &be_const_str_P9813_DAT); -be_define_const_str(P9813_DAT, "P9813_DAT", 778577052u, 0, 9, &be_const_str_WEBCAM_PWDN); -be_define_const_str(WEBCAM_PWDN, "WEBCAM_PWDN", 2219597454u, 0, 11, &be_const_str_count); -be_define_const_str(count, "count", 967958004u, 0, 5, NULL); -be_define_const_str(LMT01, "LMT01", 2490623797u, 0, 5, &be_const_str_read8); -be_define_const_str(read8, "read8", 2802788167u, 0, 5, NULL); -be_define_const_str(PN532_RXD, "PN532_RXD", 1780093022u, 0, 9, &be_const_str_PZEM004_RX); -be_define_const_str(PZEM004_RX, "PZEM004_RX", 3411153194u, 0, 10, &be_const_str__begin_transmission); -be_define_const_str(_begin_transmission, "_begin_transmission", 2779461176u, 0, 19, &be_const_str_web_add_console_button); -be_define_const_str(web_add_console_button, "web_add_console_button", 3481436192u, 0, 22, &be_const_str_web_add_handler); -be_define_const_str(web_add_handler, "web_add_handler", 3990174962u, 0, 15, NULL); -be_define_const_str(INPUT_PULLDOWN, "INPUT_PULLDOWN", 1172232591u, 0, 14, NULL); -be_define_const_str(CSE7761_RX, "CSE7761_RX", 65423248u, 0, 10, &be_const_str_find); -be_define_const_str(find, "find", 3186656602u, 0, 4, &be_const_str_break); -be_define_const_str(break, "break", 3378807160u, 58, 5, NULL); -be_define_const_str(NRG_SEL_INV, "NRG_SEL_INV", 3567431069u, 0, 11, NULL); -be_define_const_str(ILI9488_CS, "ILI9488_CS", 2363112073u, 0, 10, &be_const_str_MCP39F5_RX); -be_define_const_str(MCP39F5_RX, "MCP39F5_RX", 190458217u, 0, 10, &be_const_str_ROT1B); -be_define_const_str(ROT1B, "ROT1B", 809932573u, 0, 5, NULL); -be_define_const_str(opt_call, "()", 685372826u, 0, 2, &be_const_str_SOLAXX1_TX); -be_define_const_str(SOLAXX1_TX, "SOLAXX1_TX", 903770840u, 0, 10, NULL); -be_define_const_str(SHELLY_DIMMER_BOOT0, "SHELLY_DIMMER_BOOT0", 2948777716u, 0, 19, &be_const_str_WEBCAM_VSYNC); -be_define_const_str(WEBCAM_VSYNC, "WEBCAM_VSYNC", 4032882166u, 0, 12, &be_const_str_tan); -be_define_const_str(tan, "tan", 2633446552u, 0, 3, &be_const_str_web_send); -be_define_const_str(web_send, "web_send", 2989941448u, 0, 8, NULL); -be_define_const_str(LED1, "LED1", 21005825u, 0, 4, NULL); -be_define_const_str(INPUT_PULLUP, "INPUT_PULLUP", 2912931654u, 0, 12, &be_const_str_chars_in_string); -be_define_const_str(chars_in_string, "chars_in_string", 3148785132u, 0, 15, &be_const_str_else); -be_define_const_str(else, "else", 3183434736u, 52, 4, &be_const_str_nil); -be_define_const_str(nil, "nil", 228849900u, 63, 3, NULL); -be_define_const_str(MAX31855CLK, "MAX31855CLK", 715977727u, 0, 11, NULL); -be_define_const_str(SYMBOL_GPS, "SYMBOL_GPS", 3044165570u, 0, 10, &be_const_str_lv_draw_mask_map_param); -be_define_const_str(lv_draw_mask_map_param, "lv_draw_mask_map_param", 1666886804u, 0, 22, NULL); -be_define_const_str(SWT1_NP, "SWT1_NP", 4033043739u, 0, 7, &be_const_str_log); -be_define_const_str(log, "log", 1062293841u, 0, 3, &be_const_str_read_bytes); -be_define_const_str(read_bytes, "read_bytes", 3576733173u, 0, 10, NULL); -be_define_const_str(dot_def, ".def", 4095748648u, 0, 4, &be_const_str_SYMBOL_CALL); -be_define_const_str(SYMBOL_CALL, "SYMBOL_CALL", 1444504366u, 0, 11, NULL); -be_define_const_str(DHT11, "DHT11", 367083569u, 0, 5, &be_const_str_NRG_CF1); -be_define_const_str(NRG_CF1, "NRG_CF1", 3292534757u, 0, 7, &be_const_str_SYMBOL_MUTE); -be_define_const_str(SYMBOL_MUTE, "SYMBOL_MUTE", 563116043u, 0, 11, NULL); -be_define_const_str(ETH_PHY_POWER, "ETH_PHY_POWER", 487529454u, 0, 13, NULL); -be_define_const_str(TFMINIPLUS_TX, "TFMINIPLUS_TX", 2527875337u, 0, 13, NULL); -be_define_const_str(EPAPER29_CS, "EPAPER29_CS", 3916373594u, 0, 11, &be_const_str_lv_chart); -be_define_const_str(lv_chart, "lv_chart", 2652494144u, 0, 8, &be_const_str_name); -be_define_const_str(name, "name", 2369371622u, 0, 4, NULL); -be_define_const_str(event, "event", 4264611999u, 0, 5, NULL); -be_define_const_str(ADC_JOY, "ADC_JOY", 1116943612u, 0, 7, &be_const_str_FALLING); -be_define_const_str(FALLING, "FALLING", 2851701064u, 0, 7, &be_const_str_remove_cmd); -be_define_const_str(remove_cmd, "remove_cmd", 3832315702u, 0, 10, NULL); -be_define_const_str(CSE7766_RX, "CSE7766_RX", 1546766819u, 0, 10, &be_const_str_DYP_RX); -be_define_const_str(DYP_RX, "DYP_RX", 2122310285u, 0, 6, &be_const_str_LEDLNK); -be_define_const_str(LEDLNK, "LEDLNK", 2862810701u, 0, 6, NULL); -be_define_const_str(IRSEND, "IRSEND", 184848336u, 0, 6, &be_const_str_lv_textarea); -be_define_const_str(lv_textarea, "lv_textarea", 2864635074u, 0, 11, NULL); -be_define_const_str(RFSEND, "RFSEND", 1862630731u, 0, 6, &be_const_str_SSD1351_DC); -be_define_const_str(SSD1351_DC, "SSD1351_DC", 84950353u, 0, 10, &be_const_str_SYMBOL_COPY); -be_define_const_str(SYMBOL_COPY, "SYMBOL_COPY", 4193681815u, 0, 11, &be_const_str_SYMBOL_UP); -be_define_const_str(SYMBOL_UP, "SYMBOL_UP", 3886401511u, 0, 9, NULL); -be_define_const_str(TX2X_TXD_BLACK, "TX2X_TXD_BLACK", 956526176u, 0, 14, &be_const_str_json_append); -be_define_const_str(json_append, "json_append", 3002019284u, 0, 11, NULL); -be_define_const_str(TUYA_RX, "TUYA_RX", 1609397679u, 0, 7, NULL); -be_define_const_str(HRE_DATA, "HRE_DATA", 1820377643u, 0, 8, NULL); -be_define_const_str(DDSU666_RX, "DDSU666_RX", 1812507936u, 0, 10, &be_const_str_reverse_gamma10); -be_define_const_str(reverse_gamma10, "reverse_gamma10", 739112262u, 0, 15, NULL); -be_define_const_str(SM16716_SEL, "SM16716_SEL", 142377379u, 0, 11, &be_const_str_TASMOTACLIENT_RST_INV); -be_define_const_str(TASMOTACLIENT_RST_INV, "TASMOTACLIENT_RST_INV", 2601785365u, 0, 21, &be_const_str_add_rule); -be_define_const_str(add_rule, "add_rule", 596540743u, 0, 8, &be_const_str_resize); -be_define_const_str(resize, "resize", 3514612129u, 0, 6, &be_const_str_resp_cmnd_error); -be_define_const_str(resp_cmnd_error, "resp_cmnd_error", 2404088863u, 0, 15, NULL); -be_define_const_str(ADC_BUTTON_INV, "ADC_BUTTON_INV", 2027625326u, 0, 14, &be_const_str_TASMOTACLIENT_TXD); -be_define_const_str(TASMOTACLIENT_TXD, "TASMOTACLIENT_TXD", 1386193940u, 0, 17, NULL); -be_define_const_str(MP3_DFR562, "MP3_DFR562", 2859952977u, 0, 10, &be_const_str_RC522_RST); -be_define_const_str(RC522_RST, "RC522_RST", 720511443u, 0, 9, &be_const_str_SYMBOL_LEFT); -be_define_const_str(SYMBOL_LEFT, "SYMBOL_LEFT", 1563517575u, 0, 11, NULL); -be_define_const_str(rad, "rad", 1358899048u, 0, 3, NULL); -be_define_const_str(ARIRFSEL, "ARIRFSEL", 233874443u, 0, 8, &be_const_str_MHZ_TXD); -be_define_const_str(MHZ_TXD, "MHZ_TXD", 3310158233u, 0, 7, &be_const_str_SAIR_TX); -be_define_const_str(SAIR_TX, "SAIR_TX", 268017311u, 0, 7, &be_const_str_sinh); -be_define_const_str(sinh, "sinh", 282220607u, 0, 4, NULL); -be_define_const_str(lv_group_focus_cb, "lv_group_focus_cb", 4288873836u, 0, 17, NULL); -be_define_const_str(SENSOR_END, "SENSOR_END", 3512542657u, 0, 10, &be_const_str_assert); -be_define_const_str(assert, "assert", 2774883451u, 0, 6, &be_const_str_reverse); -be_define_const_str(reverse, "reverse", 558918661u, 0, 7, NULL); -be_define_const_str(codedump, "codedump", 1786337906u, 0, 8, NULL); -be_define_const_str(CNTR1, "CNTR1", 510376965u, 0, 5, &be_const_str_lv_draw_mask_saved); -be_define_const_str(lv_draw_mask_saved, "lv_draw_mask_saved", 2063709159u, 0, 18, &be_const_str_read); -be_define_const_str(read, "read", 3470762949u, 0, 4, NULL); -be_define_const_str(DDS2382_TX, "DDS2382_TX", 1438117864u, 0, 10, &be_const_str_ROT1B_NP); -be_define_const_str(ROT1B_NP, "ROT1B_NP", 3710079736u, 0, 8, NULL); -be_define_const_str(SSPI_MISO, "SSPI_MISO", 2485347173u, 0, 9, &be_const_str___upper__); -be_define_const_str(__upper__, "__upper__", 3612202883u, 0, 9, NULL); -be_define_const_str(pop, "pop", 1362321360u, 0, 3, NULL); -be_define_const_str(SDCARD_CS, "SDCARD_CS", 3348952003u, 0, 9, &be_const_str__write); -be_define_const_str(_write, "_write", 2215462825u, 0, 6, &be_const_str_lv_draw_mask_line_param_cfg); -be_define_const_str(lv_draw_mask_line_param_cfg, "lv_draw_mask_line_param_cfg", 2154874825u, 0, 27, &be_const_str_setmember); -be_define_const_str(setmember, "setmember", 1432909441u, 0, 9, NULL); -be_define_const_str(I2C_Driver, "I2C_Driver", 1714501658u, 0, 10, &be_const_str_addr); -be_define_const_str(addr, "addr", 1087856498u, 0, 4, &be_const_str_find_key_i); -be_define_const_str(find_key_i, "find_key_i", 850136726u, 0, 10, NULL); -be_define_const_str(BOILER_OT_TX, "BOILER_OT_TX", 671743623u, 0, 12, &be_const_str_P9813_CLK); -be_define_const_str(P9813_CLK, "P9813_CLK", 2455391001u, 0, 9, &be_const_str_lv_area); +be_define_const_str(SM16716_DAT, "SM16716_DAT", 1905621806u, 0, 11, &be_const_str_SYMBOL_BACKSPACE); +be_define_const_str(SYMBOL_BACKSPACE, "SYMBOL_BACKSPACE", 1997168681u, 0, 16, &be_const_str_TX2X_TXD_BLACK); +be_define_const_str(TX2X_TXD_BLACK, "TX2X_TXD_BLACK", 956526176u, 0, 14, NULL); +be_define_const_str(CSE7761_TX, "CSE7761_TX", 3354719142u, 0, 10, &be_const_str_OUTPUT_HI); +be_define_const_str(OUTPUT_HI, "OUTPUT_HI", 3153592902u, 0, 9, &be_const_str_SYMBOL_DRIVE); +be_define_const_str(SYMBOL_DRIVE, "SYMBOL_DRIVE", 567203502u, 0, 12, NULL); +be_define_const_str(lv_tileview, "lv_tileview", 2419887973u, 0, 11, &be_const_str_read13); +be_define_const_str(read13, "read13", 12887293u, 0, 6, NULL); +be_define_const_str(EPAPER29_CS, "EPAPER29_CS", 3916373594u, 0, 11, &be_const_str_write); +be_define_const_str(write, "write", 3190202204u, 0, 5, NULL); +be_define_const_str(opt_connect, "..", 2748622605u, 0, 2, NULL); +be_define_const_str(, "", 2166136261u, 0, 0, NULL); +be_define_const_str(ELECTRIQ_MOODL_TX, "ELECTRIQ_MOODL_TX", 31009247u, 0, 17, NULL); +be_define_const_str(KEY1_INV, "KEY1_INV", 263542563u, 0, 8, &be_const_str_SSD1331_CS); +be_define_const_str(SSD1331_CS, "SSD1331_CS", 4191047928u, 0, 10, &be_const_str_TASMOTACLIENT_RST); +be_define_const_str(TASMOTACLIENT_RST, "TASMOTACLIENT_RST", 3326196213u, 0, 17, NULL); +be_define_const_str(add_cmd, "add_cmd", 3361630879u, 0, 7, NULL); +be_define_const_str(OLED_RESET, "OLED_RESET", 4048987655u, 0, 10, &be_const_str_SBR_TX); +be_define_const_str(SBR_TX, "SBR_TX", 3419096015u, 0, 6, &be_const_str_pin_mode); +be_define_const_str(pin_mode, "pin_mode", 3258314030u, 0, 8, NULL); +be_define_const_str(HRE_CLOCK, "HRE_CLOCK", 2870559111u, 0, 9, &be_const_str_MAX31855CS); +be_define_const_str(MAX31855CS, "MAX31855CS", 753620511u, 0, 10, &be_const_str_P9813_CLK); +be_define_const_str(P9813_CLK, "P9813_CLK", 2455391001u, 0, 9, &be_const_str_SYMBOL_WARNING); +be_define_const_str(SYMBOL_WARNING, "SYMBOL_WARNING", 4119913686u, 0, 14, &be_const_str_lv_area); be_define_const_str(lv_area, "lv_area", 2521150401u, 0, 7, &be_const_str_split); be_define_const_str(split, "split", 2276994531u, 0, 5, NULL); -be_define_const_str(CHANGE, "CHANGE", 4280911421u, 0, 6, &be_const_str_SM2135_CLK); -be_define_const_str(SM2135_CLK, "SM2135_CLK", 2383410011u, 0, 10, &be_const_str_ZEROCROSS); -be_define_const_str(ZEROCROSS, "ZEROCROSS", 1747596785u, 0, 9, &be_const_str_i2c_enabled); -be_define_const_str(i2c_enabled, "i2c_enabled", 218388101u, 0, 11, &be_const_str_lv_color); -be_define_const_str(lv_color, "lv_color", 1419148319u, 0, 8, &be_const_str_wire1); -be_define_const_str(wire1, "wire1", 3212721419u, 0, 5, NULL); -be_define_const_str(lv_draw_rect_dsc, "lv_draw_rect_dsc", 3246772488u, 0, 16, &be_const_str_seti); -be_define_const_str(seti, "seti", 1500556254u, 0, 4, NULL); -be_define_const_str(ST7789_DC, "ST7789_DC", 2533509745u, 0, 9, NULL); -be_define_const_str(var, "var", 2317739966u, 64, 3, NULL); -be_define_const_str(MCP39F5_TX, "MCP39F5_TX", 1332322047u, 0, 10, &be_const_str__ccmd); -be_define_const_str(_ccmd, "_ccmd", 2163421413u, 0, 5, NULL); -be_define_const_str(AS608_TX, "AS608_TX", 48630934u, 0, 8, &be_const_str_TM1638CLK); -be_define_const_str(TM1638CLK, "TM1638CLK", 3045182446u, 0, 9, NULL); -be_define_const_str(get_free_heap, "get_free_heap", 625069757u, 0, 13, &be_const_str_lv_keyboard); -be_define_const_str(lv_keyboard, "lv_keyboard", 197530229u, 0, 11, &be_const_str_elif); -be_define_const_str(elif, "elif", 3232090307u, 51, 4, NULL); -be_define_const_str(KEY1, "KEY1", 6715975u, 0, 4, &be_const_str_LE01MR_TX); -be_define_const_str(LE01MR_TX, "LE01MR_TX", 1589687023u, 0, 9, &be_const_str_lv_tileview); -be_define_const_str(lv_tileview, "lv_tileview", 2419887973u, 0, 11, &be_const_str_class); -be_define_const_str(class, "class", 2872970239u, 57, 5, NULL); -be_define_const_str(BUZZER_INV, "BUZZER_INV", 3274564335u, 0, 10, NULL); -be_define_const_str(lv_roller, "lv_roller", 661902064u, 0, 9, NULL); -be_define_const_str(ADC_CT_POWER, "ADC_CT_POWER", 3382284599u, 0, 12, NULL); -be_define_const_str(asstring, "asstring", 1298225088u, 0, 8, &be_const_str_lv_draw_mask_angle_param_cfg); -be_define_const_str(lv_draw_mask_angle_param_cfg, "lv_draw_mask_angle_param_cfg", 3599767368u, 0, 28, &be_const_str_save); -be_define_const_str(save, "save", 3439296072u, 0, 4, &be_const_str_size); -be_define_const_str(size, "size", 597743964u, 0, 4, NULL); -be_define_const_str(NONE, "NONE", 1932136219u, 0, 4, NULL); -be_define_const_str(exp, "exp", 1923516200u, 0, 3, &be_const_str_on); -be_define_const_str(on, "on", 1630810064u, 0, 2, NULL); -be_define_const_str(BL0940_RX, "BL0940_RX", 2908993179u, 0, 9, &be_const_str_WIEGAND_D0); -be_define_const_str(WIEGAND_D0, "WIEGAND_D0", 4192335759u, 0, 10, NULL); -be_define_const_str(check_privileged_access, "check_privileged_access", 3692933968u, 0, 23, &be_const_str_lv_indev); -be_define_const_str(lv_indev, "lv_indev", 225602374u, 0, 8, NULL); -be_define_const_str(opt_eq, "==", 2431966415u, 0, 2, &be_const_str_TFMINIPLUS_RX); -be_define_const_str(TFMINIPLUS_RX, "TFMINIPLUS_RX", 1522203935u, 0, 13, NULL); -be_define_const_str(PULLDOWN, "PULLDOWN", 1853074086u, 0, 8, NULL); -be_define_const_str(, "", 2166136261u, 0, 0, &be_const_str_arg_name); -be_define_const_str(arg_name, "arg_name", 1345046155u, 0, 8, &be_const_str_screenshot); -be_define_const_str(screenshot, "screenshot", 3894592561u, 0, 10, &be_const_str_setbits); -be_define_const_str(setbits, "setbits", 2762408167u, 0, 7, NULL); -be_define_const_str(SYMBOL_LOOP, "SYMBOL_LOOP", 2762053208u, 0, 11, NULL); -be_define_const_str(MHZ_RXD, "MHZ_RXD", 328619727u, 0, 7, &be_const_str_get_power); -be_define_const_str(get_power, "get_power", 3009799377u, 0, 9, &be_const_str_lv_font); -be_define_const_str(lv_font, "lv_font", 1550958453u, 0, 7, NULL); -be_define_const_str(BACKLIGHT, "BACKLIGHT", 3147761926u, 0, 9, &be_const_str_BS814_CLK); -be_define_const_str(BS814_CLK, "BS814_CLK", 3002713336u, 0, 9, NULL); -be_define_const_str(PULLUP, "PULLUP", 3417628531u, 0, 6, &be_const_str_TM1637DIO); -be_define_const_str(TM1637DIO, "TM1637DIO", 1574659381u, 0, 9, &be_const_str_lv_btnmatrix); -be_define_const_str(lv_btnmatrix, "lv_btnmatrix", 626248489u, 0, 12, NULL); -be_define_const_str(SR04_ECHO, "SR04_ECHO", 1906909592u, 0, 9, NULL); -be_define_const_str(ADE7953_IRQ, "ADE7953_IRQ", 2329185922u, 0, 11, &be_const_str_classname); -be_define_const_str(classname, "classname", 1998589948u, 0, 9, &be_const_str_str); -be_define_const_str(str, "str", 3259748752u, 0, 3, NULL); -be_define_const_str(SYMBOL_PREV, "SYMBOL_PREV", 2952615023u, 0, 11, &be_const_str_add_driver); -be_define_const_str(add_driver, "add_driver", 1654458371u, 0, 10, &be_const_str_content_button); -be_define_const_str(content_button, "content_button", 1956476087u, 0, 14, NULL); -be_define_const_str(HX711_DAT, "HX711_DAT", 2935118250u, 0, 9, NULL); -be_define_const_str(dot_p, ".p", 1171526419u, 0, 2, &be_const_str_content_stop); -be_define_const_str(content_stop, "content_stop", 658554751u, 0, 12, &be_const_str_exists); -be_define_const_str(exists, "exists", 1002329533u, 0, 6, NULL); -be_define_const_str(GPS_RX, "GPS_RX", 1075637342u, 0, 6, &be_const_str_HX711_SCK); -be_define_const_str(HX711_SCK, "HX711_SCK", 3785979404u, 0, 9, &be_const_str_RDM6300_RX); -be_define_const_str(RDM6300_RX, "RDM6300_RX", 1522345628u, 0, 10, NULL); -be_define_const_str(AZ_RXD, "AZ_RXD", 699914019u, 0, 6, NULL); -be_define_const_str(Tasmota, "Tasmota", 4047617668u, 0, 7, &be_const_str_ZIGBEE_RX); -be_define_const_str(ZIGBEE_RX, "ZIGBEE_RX", 93215470u, 0, 9, &be_const_str_imax); -be_define_const_str(imax, "imax", 3084515410u, 0, 4, &be_const_str_montserrat_font); -be_define_const_str(montserrat_font, "montserrat_font", 1819065874u, 0, 15, NULL); -be_define_const_str(srand, "srand", 465518633u, 0, 5, &be_const_str_time_reached); -be_define_const_str(time_reached, "time_reached", 2075136773u, 0, 12, &be_const_str_try_rule); -be_define_const_str(try_rule, "try_rule", 1986449405u, 0, 8, NULL); -be_define_const_str(LOW, "LOW", 3526092385u, 0, 3, &be_const_str_SDM120_TX); -be_define_const_str(SDM120_TX, "SDM120_TX", 2509332415u, 0, 9, &be_const_str_SYMBOL_BELL); -be_define_const_str(SYMBOL_BELL, "SYMBOL_BELL", 1736196487u, 0, 11, &be_const_str_tostring); -be_define_const_str(tostring, "tostring", 2299708645u, 0, 8, NULL); -be_define_const_str(DDS2382_RX, "DDS2382_RX", 432446462u, 0, 10, &be_const_str_HRXL_RX); -be_define_const_str(HRXL_RX, "HRXL_RX", 92702006u, 0, 7, &be_const_str_button_pressed); -be_define_const_str(button_pressed, "button_pressed", 1694209616u, 0, 14, &be_const_str_lv_arc); -be_define_const_str(lv_arc, "lv_arc", 4170125384u, 0, 6, NULL); -be_define_const_str(SDM120_RX, "SDM120_RX", 1367571753u, 0, 9, &be_const_str_SYMBOL_POWER); -be_define_const_str(SYMBOL_POWER, "SYMBOL_POWER", 1125993627u, 0, 12, &be_const_str_list); -be_define_const_str(list, "list", 217798785u, 0, 4, &be_const_str_lv_bar); -be_define_const_str(lv_bar, "lv_bar", 1582673229u, 0, 6, &be_const_str_lv_linemeter); -be_define_const_str(lv_linemeter, "lv_linemeter", 1413069363u, 0, 12, &be_const_str_lv_page); -be_define_const_str(lv_page, "lv_page", 2373170067u, 0, 7, &be_const_str_upper); -be_define_const_str(upper, "upper", 176974407u, 0, 5, NULL); -be_define_const_str(wire_scan, "wire_scan", 2671275880u, 0, 9, NULL); -be_define_const_str(SBR_RX, "SBR_RX", 3350999801u, 0, 6, &be_const_str_gamma10); -be_define_const_str(gamma10, "gamma10", 3472052483u, 0, 7, NULL); -be_define_const_str(PWM1_INV, "PWM1_INV", 3939021030u, 0, 8, &be_const_str_exec_rules); -be_define_const_str(exec_rules, "exec_rules", 1445221092u, 0, 10, NULL); -be_define_const_str(ETH_PHY_MDC, "ETH_PHY_MDC", 1519379581u, 0, 11, &be_const_str_content_send_style); +be_define_const_str(LED1_INV, "LED1_INV", 2112045097u, 0, 8, &be_const_str_SENSOR_END); +be_define_const_str(SENSOR_END, "SENSOR_END", 3512542657u, 0, 10, &be_const_str_TFMINIPLUS_TX); +be_define_const_str(TFMINIPLUS_TX, "TFMINIPLUS_TX", 2527875337u, 0, 13, &be_const_str_content_send_style); be_define_const_str(content_send_style, "content_send_style", 1087907647u, 0, 18, NULL); -be_define_const_str(run_deferred, "run_deferred", 371594696u, 0, 12, NULL); -be_define_const_str(SYMBOL_REFRESH, "SYMBOL_REFRESH", 1266229761u, 0, 14, NULL); -be_define_const_str(TASMOTACLIENT_RXD, "TASMOTACLIENT_RXD", 72868318u, 0, 17, &be_const_str_WS2812); -be_define_const_str(WS2812, "WS2812", 3539741218u, 0, 6, NULL); -be_define_const_str(PROJECTOR_CTRL_TX, "PROJECTOR_CTRL_TX", 535811130u, 0, 17, &be_const_str_lv_line); -be_define_const_str(lv_line, "lv_line", 2692732914u, 0, 7, NULL); -be_define_const_str(SYMBOL_VOLUME_MAX, "SYMBOL_VOLUME_MAX", 3582646093u, 0, 17, NULL); -be_define_const_str(MAX7219CLK, "MAX7219CLK", 963568838u, 0, 10, &be_const_str_RF_SENSOR); -be_define_const_str(RF_SENSOR, "RF_SENSOR", 2289628100u, 0, 9, NULL); -be_define_const_str(WEBCAM_PCLK, "WEBCAM_PCLK", 3813770649u, 0, 11, &be_const_str_lv_imgbtn); -be_define_const_str(lv_imgbtn, "lv_imgbtn", 2402844429u, 0, 9, NULL); +be_define_const_str(ADC_INPUT, "ADC_INPUT", 2207556878u, 0, 9, NULL); +be_define_const_str(GCM, "GCM", 3790320054u, 0, 3, &be_const_str_INPUT_PULLUP); +be_define_const_str(INPUT_PULLUP, "INPUT_PULLUP", 2912931654u, 0, 12, &be_const_str_read); +be_define_const_str(read, "read", 3470762949u, 0, 4, &be_const_str_seg7_font); +be_define_const_str(seg7_font, "seg7_font", 4099690689u, 0, 9, NULL); +be_define_const_str(LOW, "LOW", 3526092385u, 0, 3, &be_const_str_ST7789_DC); +be_define_const_str(ST7789_DC, "ST7789_DC", 2533509745u, 0, 9, &be_const_str_SYMBOL_SETTINGS); +be_define_const_str(SYMBOL_SETTINGS, "SYMBOL_SETTINGS", 339656335u, 0, 15, &be_const_str_TASMOTACLIENT_RST_INV); +be_define_const_str(TASMOTACLIENT_RST_INV, "TASMOTACLIENT_RST_INV", 2601785365u, 0, 21, &be_const_str_add); +be_define_const_str(add, "add", 993596020u, 0, 3, &be_const_str_read32); +be_define_const_str(read32, "read32", 1741276240u, 0, 6, NULL); +be_define_const_str(HRXL_RX, "HRXL_RX", 92702006u, 0, 7, &be_const_str_lv_msgbox); +be_define_const_str(lv_msgbox, "lv_msgbox", 689085206u, 0, 9, NULL); +be_define_const_str(SYMBOL_EYE_CLOSE, "SYMBOL_EYE_CLOSE", 404721792u, 0, 16, NULL); +be_define_const_str(AudioFileSource, "AudioFileSource", 2959980058u, 0, 15, &be_const_str_ILI9488_CS); +be_define_const_str(ILI9488_CS, "ILI9488_CS", 2363112073u, 0, 10, &be_const_str_SHELLY_DIMMER_RST_INV); +be_define_const_str(SHELLY_DIMMER_RST_INV, "SHELLY_DIMMER_RST_INV", 2366759773u, 0, 21, &be_const_str_SYMBOL_TRASH); +be_define_const_str(SYMBOL_TRASH, "SYMBOL_TRASH", 3169100368u, 0, 12, NULL); +be_define_const_str(attrdump, "attrdump", 1521571304u, 0, 8, &be_const_str_copy); +be_define_const_str(copy, "copy", 3848464964u, 0, 4, &be_const_str_lv_keyboard); +be_define_const_str(lv_keyboard, "lv_keyboard", 197530229u, 0, 11, &be_const_str_sqrt); +be_define_const_str(sqrt, "sqrt", 2112764879u, 0, 4, NULL); +be_define_const_str(I2S_IN_DATA, "I2S_IN_DATA", 4125971460u, 0, 11, &be_const_str_SDM72_RX); +be_define_const_str(SDM72_RX, "SDM72_RX", 766750035u, 0, 8, &be_const_str_SYMBOL_DOWN); +be_define_const_str(SYMBOL_DOWN, "SYMBOL_DOWN", 1107513570u, 0, 11, &be_const_str_gamma8); +be_define_const_str(gamma8, "gamma8", 3802843830u, 0, 6, NULL); +be_define_const_str(CSE7766_TX, "CSE7766_TX", 674624821u, 0, 10, &be_const_str_SHELLY_DIMMER_BOOT0); +be_define_const_str(SHELLY_DIMMER_BOOT0, "SHELLY_DIMMER_BOOT0", 2948777716u, 0, 19, &be_const_str_SYMBOL_AUDIO); +be_define_const_str(SYMBOL_AUDIO, "SYMBOL_AUDIO", 3056537956u, 0, 12, &be_const_str_try); be_define_const_str(try, "try", 2887626766u, 68, 3, NULL); -be_define_const_str(EPD_DATA, "EPD_DATA", 3799141097u, 0, 8, &be_const_str_cb_dispatch); -be_define_const_str(cb_dispatch, "cb_dispatch", 1741510499u, 0, 11, NULL); -be_define_const_str(ADC_PH, "ADC_PH", 3820290594u, 0, 6, &be_const_str_DHT11_OUT); -be_define_const_str(DHT11_OUT, "DHT11_OUT", 1645300734u, 0, 9, &be_const_str_SYMBOL_RIGHT); -be_define_const_str(SYMBOL_RIGHT, "SYMBOL_RIGHT", 2984010648u, 0, 12, NULL); -be_define_const_str(IBEACON_TX, "IBEACON_TX", 3471826977u, 0, 10, &be_const_str_gen_cb); -be_define_const_str(gen_cb, "gen_cb", 3245227551u, 0, 6, &be_const_str_open); +be_define_const_str(SM2135_DAT, "SM2135_DAT", 2882726942u, 0, 10, NULL); +be_define_const_str(get_option, "get_option", 2123730033u, 0, 10, &be_const_str_lv_win); +be_define_const_str(lv_win, "lv_win", 780927558u, 0, 6, NULL); +be_define_const_str(WEBCAM_HREF, "WEBCAM_HREF", 3161890024u, 0, 11, NULL); +be_define_const_str(IEM3000_TX, "IEM3000_TX", 1185907310u, 0, 10, &be_const_str_OUTPUT); +be_define_const_str(OUTPUT, "OUTPUT", 1469629700u, 0, 6, &be_const_str_SYMBOL_NEW_LINE); +be_define_const_str(SYMBOL_NEW_LINE, "SYMBOL_NEW_LINE", 2014334315u, 0, 15, NULL); +be_define_const_str(IRSEND, "IRSEND", 184848336u, 0, 6, &be_const_str_TELEINFO_RX); +be_define_const_str(TELEINFO_RX, "TELEINFO_RX", 1195717356u, 0, 11, NULL); +be_define_const_str(WE517_TX, "WE517_TX", 2954817217u, 0, 8, NULL); +be_define_const_str(I2C_SCL, "I2C_SCL", 164217098u, 0, 7, NULL); +be_define_const_str(WEBCAM_PWDN, "WEBCAM_PWDN", 2219597454u, 0, 11, &be_const_str_cos); +be_define_const_str(cos, "cos", 4220379804u, 0, 3, NULL); +be_define_const_str(NRG_SEL, "NRG_SEL", 1771358125u, 0, 7, &be_const_str_SDS0X1_RX); +be_define_const_str(SDS0X1_RX, "SDS0X1_RX", 1170717385u, 0, 9, &be_const_str_WIEGAND_D1); +be_define_const_str(WIEGAND_D1, "WIEGAND_D1", 4175558140u, 0, 10, &be_const_str_ZIGBEE_RX); +be_define_const_str(ZIGBEE_RX, "ZIGBEE_RX", 93215470u, 0, 9, NULL); +be_define_const_str(MD5, "MD5", 1935726387u, 0, 3, &be_const_str_reverse_gamma10); +be_define_const_str(reverse_gamma10, "reverse_gamma10", 739112262u, 0, 15, NULL); +be_define_const_str(add_rule, "add_rule", 596540743u, 0, 8, &be_const_str_finish); +be_define_const_str(finish, "finish", 1494643858u, 0, 6, &be_const_str_lv_btn); +be_define_const_str(lv_btn, "lv_btn", 1612829968u, 0, 6, &be_const_str_resp_cmnd_error); +be_define_const_str(resp_cmnd_error, "resp_cmnd_error", 2404088863u, 0, 15, NULL); +be_define_const_str(WE517_RX, "WE517_RX", 4096577879u, 0, 8, &be_const_str_WEBCAM_PSRCS); +be_define_const_str(WEBCAM_PSRCS, "WEBCAM_PSRCS", 624464864u, 0, 12, &be_const_str_digital_write); +be_define_const_str(digital_write, "digital_write", 3435877979u, 0, 13, &be_const_str_lv_draw_mask_map_param); +be_define_const_str(lv_draw_mask_map_param, "lv_draw_mask_map_param", 1666886804u, 0, 22, &be_const_str_lv_spinbox); +be_define_const_str(lv_spinbox, "lv_spinbox", 2666096729u, 0, 10, NULL); +be_define_const_str(SYMBOL_CALL, "SYMBOL_CALL", 1444504366u, 0, 11, NULL); +be_define_const_str(SYMBOL_PLUS, "SYMBOL_PLUS", 2860093262u, 0, 11, &be_const_str_elif); +be_define_const_str(elif, "elif", 3232090307u, 51, 4, NULL); +be_define_const_str(DHT22, "DHT22", 215937903u, 0, 5, &be_const_str_set_power); +be_define_const_str(set_power, "set_power", 549820893u, 0, 9, NULL); +be_define_const_str(ST7789_CS, "ST7789_CS", 2937305434u, 0, 9, &be_const_str_content_send); +be_define_const_str(content_send, "content_send", 1673733649u, 0, 12, &be_const_str_iter); +be_define_const_str(iter, "iter", 3124256359u, 0, 4, &be_const_str_load); +be_define_const_str(load, "load", 3859241449u, 0, 4, NULL); +be_define_const_str(LED1, "LED1", 21005825u, 0, 4, &be_const_str_SYMBOL_BATTERY_FULL); +be_define_const_str(SYMBOL_BATTERY_FULL, "SYMBOL_BATTERY_FULL", 2638935545u, 0, 19, NULL); +be_define_const_str(floor, "floor", 3102149661u, 0, 5, &be_const_str_lv_checkbox); +be_define_const_str(lv_checkbox, "lv_checkbox", 7454841u, 0, 11, NULL); +be_define_const_str(MAX31855CLK, "MAX31855CLK", 715977727u, 0, 11, &be_const_str_SYMBOL_BATTERY_2); +be_define_const_str(SYMBOL_BATTERY_2, "SYMBOL_BATTERY_2", 645813682u, 0, 16, &be_const_str_find); +be_define_const_str(find, "find", 3186656602u, 0, 4, NULL); +be_define_const_str(lv_point, "lv_point", 4120221790u, 0, 8, &be_const_str_end); +be_define_const_str(end, "end", 1787721130u, 56, 3, NULL); +be_define_const_str(read24, "read24", 1808533811u, 0, 6, NULL); +be_define_const_str(AudioGenerator, "AudioGenerator", 1839297342u, 0, 14, &be_const_str_P9813_DAT); +be_define_const_str(P9813_DAT, "P9813_DAT", 778577052u, 0, 9, &be_const_str_TM1637CLK); +be_define_const_str(TM1637CLK, "TM1637CLK", 2797300857u, 0, 9, &be_const_str__cb); +be_define_const_str(_cb, "_cb", 4043300367u, 0, 3, NULL); +be_define_const_str(ILI9341_DC, "ILI9341_DC", 28838624u, 0, 10, &be_const_str_RXD); +be_define_const_str(RXD, "RXD", 2311579049u, 0, 3, &be_const_str_SSPI_SCLK); +be_define_const_str(SSPI_SCLK, "SSPI_SCLK", 136688954u, 0, 9, &be_const_str_yield); +be_define_const_str(yield, "yield", 1821831854u, 0, 5, NULL); +be_define_const_str(WEBCAM_DATA, "WEBCAM_DATA", 1476954421u, 0, 11, &be_const_str_lv_draw_line_dsc); +be_define_const_str(lv_draw_line_dsc, "lv_draw_line_dsc", 2422805236u, 0, 16, NULL); +be_define_const_str(content_button, "content_button", 1956476087u, 0, 14, NULL); +be_define_const_str(EXS_ENABLE, "EXS_ENABLE", 1896914313u, 0, 10, &be_const_str_MIEL_HVAC_RX); +be_define_const_str(MIEL_HVAC_RX, "MIEL_HVAC_RX", 3720609648u, 0, 12, NULL); +be_define_const_str(lv_style, "lv_style", 4151611549u, 0, 8, NULL); +be_define_const_str(LMT01, "LMT01", 2490623797u, 0, 5, &be_const_str_read8); +be_define_const_str(read8, "read8", 2802788167u, 0, 5, NULL); +be_define_const_str(members, "members", 937576464u, 0, 7, NULL); +be_define_const_str(ADC_TEMP, "ADC_TEMP", 3771053440u, 0, 8, &be_const_str_DCKI); +be_define_const_str(DCKI, "DCKI", 3846847480u, 0, 4, NULL); +be_define_const_str(HJL_CF, "HJL_CF", 786158487u, 0, 6, &be_const_str_MHZ_RXD); +be_define_const_str(MHZ_RXD, "MHZ_RXD", 328619727u, 0, 7, &be_const_str__cmd); +be_define_const_str(_cmd, "_cmd", 3419822142u, 0, 4, &be_const_str_lv_page); +be_define_const_str(lv_page, "lv_page", 2373170067u, 0, 7, &be_const_str_resp_cmnd_failed); +be_define_const_str(resp_cmnd_failed, "resp_cmnd_failed", 2136281562u, 0, 16, &be_const_str_save); +be_define_const_str(save, "save", 3439296072u, 0, 4, NULL); +be_define_const_str(SAIR_RX, "SAIR_RX", 1273688713u, 0, 7, &be_const_str_allocated); +be_define_const_str(allocated, "allocated", 429986098u, 0, 9, &be_const_str_has_arg); +be_define_const_str(has_arg, "has_arg", 424878688u, 0, 7, &be_const_str_rad); +be_define_const_str(rad, "rad", 1358899048u, 0, 3, NULL); +be_define_const_str(HX711_SCK, "HX711_SCK", 3785979404u, 0, 9, &be_const_str_SOLAXX1_RX); +be_define_const_str(SOLAXX1_RX, "SOLAXX1_RX", 971867054u, 0, 10, NULL); +be_define_const_str(SDM630_TX, "SDM630_TX", 696213075u, 0, 9, &be_const_str_resp_cmnd_done); +be_define_const_str(resp_cmnd_done, "resp_cmnd_done", 2601874875u, 0, 14, NULL); +be_define_const_str(A4988_MS1, "A4988_MS1", 1729976611u, 0, 9, &be_const_str_ETH_PHY_MDC); +be_define_const_str(ETH_PHY_MDC, "ETH_PHY_MDC", 1519379581u, 0, 11, &be_const_str_KEY1_NP); +be_define_const_str(KEY1_NP, "KEY1_NP", 709918726u, 0, 7, &be_const_str_find_op); +be_define_const_str(find_op, "find_op", 3766713376u, 0, 7, &be_const_str_member); +be_define_const_str(member, "member", 719708611u, 0, 6, NULL); +be_define_const_str(SR04_ECHO, "SR04_ECHO", 1906909592u, 0, 9, &be_const_str_load_freetype_font); +be_define_const_str(load_freetype_font, "load_freetype_font", 2368447592u, 0, 18, NULL); +be_define_const_str(lv_draw_rect_dsc, "lv_draw_rect_dsc", 3246772488u, 0, 16, NULL); +be_define_const_str(FALLING, "FALLING", 2851701064u, 0, 7, &be_const_str_KEY1_INV_PD); +be_define_const_str(KEY1_INV_PD, "KEY1_INV_PD", 3828014584u, 0, 11, &be_const_str_TXD); +be_define_const_str(TXD, "TXD", 3614562079u, 0, 3, NULL); +be_define_const_str(MCP39F5_RX, "MCP39F5_RX", 190458217u, 0, 10, &be_const_str_WEBCAM_SIOC); +be_define_const_str(WEBCAM_SIOC, "WEBCAM_SIOC", 218815147u, 0, 11, &be_const_str_while); +be_define_const_str(while, "while", 231090382u, 53, 5, NULL); +be_define_const_str(RDM6300_RX, "RDM6300_RX", 1522345628u, 0, 10, &be_const_str_ctypes_bytes); +be_define_const_str(ctypes_bytes, "ctypes_bytes", 3879019703u, 0, 12, NULL); +be_define_const_str(AZ_RXD, "AZ_RXD", 699914019u, 0, 6, &be_const_str_SYMBOL_DIRECTORY); +be_define_const_str(SYMBOL_DIRECTORY, "SYMBOL_DIRECTORY", 1886053449u, 0, 16, NULL); +be_define_const_str(AS608_RX, "AS608_RX", 4275502016u, 0, 8, &be_const_str__begin_transmission); +be_define_const_str(_begin_transmission, "_begin_transmission", 2779461176u, 0, 19, &be_const_str_deg); +be_define_const_str(deg, "deg", 3327754271u, 0, 3, NULL); +be_define_const_str(SYMBOL_VOLUME_MID, "SYMBOL_VOLUME_MID", 158835057u, 0, 17, &be_const_str_chars_in_string); +be_define_const_str(chars_in_string, "chars_in_string", 3148785132u, 0, 15, &be_const_str_publish_result); +be_define_const_str(publish_result, "publish_result", 2013351252u, 0, 14, NULL); +be_define_const_str(lv_arc, "lv_arc", 4170125384u, 0, 6, NULL); +be_define_const_str(DSB_OUT, "DSB_OUT", 732335085u, 0, 7, &be_const_str_module); +be_define_const_str(module, "module", 3617558685u, 0, 6, &be_const_str_state); +be_define_const_str(state, "state", 2016490230u, 0, 5, NULL); +be_define_const_str(BS814_CLK, "BS814_CLK", 3002713336u, 0, 9, NULL); +be_define_const_str(HM10_TX, "HM10_TX", 1522037252u, 0, 7, &be_const_str_NRG_CF1); +be_define_const_str(NRG_CF1, "NRG_CF1", 3292534757u, 0, 7, NULL); +be_define_const_str(SM16716_CLK, "SM16716_CLK", 3037641483u, 0, 11, &be_const_str_lv_draw_mask_common_dsc); +be_define_const_str(lv_draw_mask_common_dsc, "lv_draw_mask_common_dsc", 1429224708u, 0, 23, NULL); +be_define_const_str(lv_group, "lv_group", 3852039019u, 0, 8, &be_const_str_montserrat_font); +be_define_const_str(montserrat_font, "montserrat_font", 1819065874u, 0, 15, NULL); +be_define_const_str(opt_eq, "==", 2431966415u, 0, 2, &be_const_str_ZEROCROSS); +be_define_const_str(ZEROCROSS, "ZEROCROSS", 1747596785u, 0, 9, NULL); +be_define_const_str(INPUT_PULLDOWN, "INPUT_PULLDOWN", 1172232591u, 0, 14, NULL); +be_define_const_str(REL1, "REL1", 3142397887u, 0, 4, &be_const_str_set); +be_define_const_str(set, "set", 3324446467u, 0, 3, NULL); +be_define_const_str(dump, "dump", 3663001223u, 0, 4, NULL); +be_define_const_str(MAX7219DIN, "MAX7219DIN", 380687049u, 0, 10, NULL); +be_define_const_str(CC1101_GDO2, "CC1101_GDO2", 974166265u, 0, 11, &be_const_str_IBEACON_RX); +be_define_const_str(IBEACON_RX, "IBEACON_RX", 2466155575u, 0, 10, &be_const_str__write); +be_define_const_str(_write, "_write", 2215462825u, 0, 6, NULL); +be_define_const_str(KEY1_INV_NP, "KEY1_INV_NP", 3160558586u, 0, 11, NULL); +be_define_const_str(SYMBOL_EJECT, "SYMBOL_EJECT", 873760647u, 0, 12, NULL); +be_define_const_str(top, "top", 2802900028u, 0, 3, NULL); +be_define_const_str(SPI_MOSI, "SPI_MOSI", 2494218614u, 0, 8, &be_const_str_lv_chart); +be_define_const_str(lv_chart, "lv_chart", 2652494144u, 0, 8, &be_const_str_publish); +be_define_const_str(publish, "publish", 264247304u, 0, 7, NULL); +be_define_const_str(BUZZER_INV, "BUZZER_INV", 3274564335u, 0, 10, &be_const_str_CNTR1); +be_define_const_str(CNTR1, "CNTR1", 510376965u, 0, 5, &be_const_str_SPI_MISO); +be_define_const_str(SPI_MISO, "SPI_MISO", 150818010u, 0, 8, &be_const_str_SYMBOL_DOWNLOAD); +be_define_const_str(SYMBOL_DOWNLOAD, "SYMBOL_DOWNLOAD", 2607324090u, 0, 15, NULL); +be_define_const_str(real, "real", 3604983901u, 0, 4, NULL); +be_define_const_str(I2S_OUT_CLK, "I2S_OUT_CLK", 2580200387u, 0, 11, &be_const_str_INPUT); +be_define_const_str(INPUT, "INPUT", 1638025307u, 0, 5, &be_const_str_lv_draw_img_dsc); +be_define_const_str(lv_draw_img_dsc, "lv_draw_img_dsc", 999847907u, 0, 15, &be_const_str_do); +be_define_const_str(do, "do", 1646057492u, 65, 2, NULL); +be_define_const_str(SYMBOL_DUMMY, "SYMBOL_DUMMY", 3621732138u, 0, 12, &be_const_str_type); +be_define_const_str(type, "type", 1361572173u, 0, 4, NULL); +be_define_const_str(_request_from, "_request_from", 3965148604u, 0, 13, NULL); +be_define_const_str(__lower__, "__lower__", 123855590u, 0, 9, &be_const_str_detect); +be_define_const_str(detect, "detect", 8884370u, 0, 6, NULL); +be_define_const_str(AudioGeneratorWAV, "AudioGeneratorWAV", 2746509368u, 0, 17, NULL); +be_define_const_str(HPMA_TX, "HPMA_TX", 173233104u, 0, 7, &be_const_str_input); +be_define_const_str(input, "input", 4191711099u, 0, 5, &be_const_str_issubclass); +be_define_const_str(issubclass, "issubclass", 4078395519u, 0, 10, NULL); +be_define_const_str(SYMBOL_PLAY, "SYMBOL_PLAY", 1750902100u, 0, 11, &be_const_str__rules); +be_define_const_str(_rules, "_rules", 4266217105u, 0, 6, &be_const_str_bytes); +be_define_const_str(bytes, "bytes", 1706151940u, 0, 5, &be_const_str_lv_sqrt_res); +be_define_const_str(lv_sqrt_res, "lv_sqrt_res", 2904473995u, 0, 11, &be_const_str_tostring); +be_define_const_str(tostring, "tostring", 2299708645u, 0, 8, NULL); +be_define_const_str(lv_draw_mask_map_param_cfg, "lv_draw_mask_map_param_cfg", 3822900597u, 0, 26, &be_const_str_lv_img); +be_define_const_str(lv_img, "lv_img", 2474052327u, 0, 6, &be_const_str_open); be_define_const_str(open, "open", 3546203337u, 0, 4, NULL); -be_define_const_str(OLED_RESET, "OLED_RESET", 4048987655u, 0, 10, &be_const_str_lv_cpicker); -be_define_const_str(lv_cpicker, "lv_cpicker", 1935129251u, 0, 10, NULL); +be_define_const_str(ADC_RANGE, "ADC_RANGE", 3467329543u, 0, 9, NULL); +be_define_const_str(INTERRUPT, "INTERRUPT", 3809502704u, 0, 9, &be_const_str_MAX7219CS); +be_define_const_str(MAX7219CS, "MAX7219CS", 2593198244u, 0, 9, NULL); +be_define_const_str(opt_neq, "!=", 2428715011u, 0, 2, &be_const_str_I2S_IN_SLCT); +be_define_const_str(I2S_IN_SLCT, "I2S_IN_SLCT", 706051516u, 0, 11, &be_const_str_PULLUP); +be_define_const_str(PULLUP, "PULLUP", 3417628531u, 0, 6, NULL); +be_define_const_str(EPD_DATA, "EPD_DATA", 3799141097u, 0, 8, &be_const_str_range); +be_define_const_str(range, "range", 4208725202u, 0, 5, NULL); +be_define_const_str(SWT1_PD, "SWT1_PD", 4166278953u, 0, 7, NULL); +be_define_const_str(lv_roller, "lv_roller", 661902064u, 0, 9, NULL); +be_define_const_str(log, "log", 1062293841u, 0, 3, NULL); +be_define_const_str(HM10_RX, "HM10_RX", 515085922u, 0, 7, &be_const_str_SYMBOL_BULLET); +be_define_const_str(SYMBOL_BULLET, "SYMBOL_BULLET", 587181862u, 0, 13, NULL); +be_define_const_str(I2C_Driver, "I2C_Driver", 1714501658u, 0, 10, NULL); +be_define_const_str(MIEL_HVAC_TX, "MIEL_HVAC_TX", 567403014u, 0, 12, &be_const_str_WEBCAM_PCLK); +be_define_const_str(WEBCAM_PCLK, "WEBCAM_PCLK", 3813770649u, 0, 11, &be_const_str_WIEGAND_D0); +be_define_const_str(WIEGAND_D0, "WIEGAND_D0", 4192335759u, 0, 10, &be_const_str_delay); +be_define_const_str(delay, "delay", 1322381784u, 0, 5, NULL); +be_define_const_str(imax, "imax", 3084515410u, 0, 4, NULL); +be_define_const_str(EPAPER42_CS, "EPAPER42_CS", 3274717451u, 0, 11, NULL); +be_define_const_str(SYMBOL_EDIT, "SYMBOL_EDIT", 1396182822u, 0, 11, &be_const_str_SYMBOL_STOP); +be_define_const_str(SYMBOL_STOP, "SYMBOL_STOP", 2836505202u, 0, 11, &be_const_str_write_bytes); +be_define_const_str(write_bytes, "write_bytes", 1227543792u, 0, 11, NULL); +be_define_const_str(A4988_DIR, "A4988_DIR", 2223595843u, 0, 9, NULL); +be_define_const_str(ADC_CT_POWER, "ADC_CT_POWER", 3382284599u, 0, 12, &be_const_str_cosh); +be_define_const_str(cosh, "cosh", 4099687964u, 0, 4, NULL); +be_define_const_str(RFSEND, "RFSEND", 1862630731u, 0, 6, NULL); +be_define_const_str(SYMBOL_PAUSE, "SYMBOL_PAUSE", 641998172u, 0, 12, &be_const_str_get_free_heap); +be_define_const_str(get_free_heap, "get_free_heap", 625069757u, 0, 13, &be_const_str_set_light); +be_define_const_str(set_light, "set_light", 3176076152u, 0, 9, &be_const_str_sinh); +be_define_const_str(sinh, "sinh", 282220607u, 0, 4, &be_const_str_time_str); +be_define_const_str(time_str, "time_str", 2613827612u, 0, 8, NULL); +be_define_const_str(BOILER_OT_TX, "BOILER_OT_TX", 671743623u, 0, 12, NULL); +be_define_const_str(ARIRFRCV, "ARIRFRCV", 1120816444u, 0, 8, &be_const_str_SYMBOL_KEYBOARD); +be_define_const_str(SYMBOL_KEYBOARD, "SYMBOL_KEYBOARD", 1621492879u, 0, 15, &be_const_str_lv_btnmatrix); +be_define_const_str(lv_btnmatrix, "lv_btnmatrix", 626248489u, 0, 12, &be_const_str_class); +be_define_const_str(class, "class", 2872970239u, 57, 5, &be_const_str_if); +be_define_const_str(if, "if", 959999494u, 50, 2, NULL); +be_define_const_str(TFMINIPLUS_RX, "TFMINIPLUS_RX", 1522203935u, 0, 13, &be_const_str_lv_draw_mask_radius_param); +be_define_const_str(lv_draw_mask_radius_param, "lv_draw_mask_radius_param", 3777679220u, 0, 25, NULL); +be_define_const_str(DDSU666_RX, "DDSU666_RX", 1812507936u, 0, 10, &be_const_str_SYMBOL_BATTERY_3); +be_define_const_str(SYMBOL_BATTERY_3, "SYMBOL_BATTERY_3", 662591301u, 0, 16, &be_const_str_lv_label); +be_define_const_str(lv_label, "lv_label", 4199664246u, 0, 8, &be_const_str_print); +be_define_const_str(print, "print", 372738696u, 0, 5, NULL); +be_define_const_str(lv_draw_label_dsc, "lv_draw_label_dsc", 265601842u, 0, 17, NULL); +be_define_const_str(remove_rule, "remove_rule", 3456211328u, 0, 11, NULL); +be_define_const_str(SWT1_NP, "SWT1_NP", 4033043739u, 0, 7, &be_const_str_SYMBOL_SD_CARD); +be_define_const_str(SYMBOL_SD_CARD, "SYMBOL_SD_CARD", 2542376484u, 0, 14, &be_const_str_WEBCAM_HSD); +be_define_const_str(WEBCAM_HSD, "WEBCAM_HSD", 2648502504u, 0, 10, &be_const_str_WINDMETER_SPEED); +be_define_const_str(WINDMETER_SPEED, "WINDMETER_SPEED", 1980822204u, 0, 15, &be_const_str_lv_bar); +be_define_const_str(lv_bar, "lv_bar", 1582673229u, 0, 6, &be_const_str_lv_line); +be_define_const_str(lv_line, "lv_line", 2692732914u, 0, 7, &be_const_str_tolower); +be_define_const_str(tolower, "tolower", 1042520049u, 0, 7, NULL); +be_define_const_str(lv_draw_mask_line_param_cfg, "lv_draw_mask_line_param_cfg", 2154874825u, 0, 27, &be_const_str_lv_objmask); +be_define_const_str(lv_objmask, "lv_objmask", 1311221665u, 0, 10, NULL); +be_define_const_str(HLW_CF, "HLW_CF", 3982619486u, 0, 6, &be_const_str_lv_cpicker); +be_define_const_str(lv_cpicker, "lv_cpicker", 1935129251u, 0, 10, &be_const_str_start); +be_define_const_str(start, "start", 1697318111u, 0, 5, NULL); +be_define_const_str(classof, "classof", 1796577762u, 0, 7, &be_const_str_concat); +be_define_const_str(concat, "concat", 4124019837u, 0, 6, &be_const_str_exec_rules); +be_define_const_str(exec_rules, "exec_rules", 1445221092u, 0, 10, &be_const_str_write8); +be_define_const_str(write8, "write8", 3133991532u, 0, 6, NULL); +be_define_const_str(LE01MR_TX, "LE01MR_TX", 1589687023u, 0, 9, NULL); +be_define_const_str(rtc, "rtc", 1070575216u, 0, 3, NULL); +be_define_const_str(_ccmd, "_ccmd", 2163421413u, 0, 5, &be_const_str_asstring); +be_define_const_str(asstring, "asstring", 1298225088u, 0, 8, &be_const_str_lv_linemeter); +be_define_const_str(lv_linemeter, "lv_linemeter", 1413069363u, 0, 12, &be_const_str_lv_switch); +be_define_const_str(lv_switch, "lv_switch", 3407171508u, 0, 9, &be_const_str_number); +be_define_const_str(number, "number", 467038368u, 0, 6, &be_const_str_read_bytes); +be_define_const_str(read_bytes, "read_bytes", 3576733173u, 0, 10, NULL); +be_define_const_str(dot_p, ".p", 1171526419u, 0, 2, NULL); +be_define_const_str(bus, "bus", 1607822841u, 0, 3, &be_const_str_lv_group_focus_cb); +be_define_const_str(lv_group_focus_cb, "lv_group_focus_cb", 4288873836u, 0, 17, NULL); +be_define_const_str(SDS0X1_TX, "SDS0X1_TX", 165045983u, 0, 9, NULL); +be_define_const_str(SDM72_TX, "SDM72_TX", 2042143269u, 0, 8, NULL); +be_define_const_str(AS3935, "AS3935", 603621745u, 0, 6, &be_const_str_SYMBOL_NEXT); +be_define_const_str(SYMBOL_NEXT, "SYMBOL_NEXT", 1102844455u, 0, 11, NULL); +be_define_const_str(BS814_DAT, "BS814_DAT", 3620403837u, 0, 9, &be_const_str_lv_draw_mask_fade_param_cfg); +be_define_const_str(lv_draw_mask_fade_param_cfg, "lv_draw_mask_fade_param_cfg", 4158595197u, 0, 27, &be_const_str_upper); +be_define_const_str(upper, "upper", 176974407u, 0, 5, NULL); +be_define_const_str(OUTPUT_LO, "OUTPUT_LO", 3724620328u, 0, 9, &be_const_str_ROT1B); +be_define_const_str(ROT1B, "ROT1B", 809932573u, 0, 5, &be_const_str_exists); +be_define_const_str(exists, "exists", 1002329533u, 0, 6, NULL); +be_define_const_str(lv_draw_mask_fade_param, "lv_draw_mask_fade_param", 2743309964u, 0, 23, NULL); +be_define_const_str(SYMBOL_HOME, "SYMBOL_HOME", 730845525u, 0, 11, &be_const_str_TUYA_TX); +be_define_const_str(TUYA_TX, "TUYA_TX", 1541301465u, 0, 7, &be_const_str_begin); +be_define_const_str(begin, "begin", 1748273790u, 0, 5, &be_const_str_encrypt); +be_define_const_str(encrypt, "encrypt", 2194327650u, 0, 7, &be_const_str_resolvecmnd); +be_define_const_str(resolvecmnd, "resolvecmnd", 993361485u, 0, 11, NULL); +be_define_const_str(WEBCAM_VSYNC, "WEBCAM_VSYNC", 4032882166u, 0, 12, &be_const_str_item); +be_define_const_str(item, "item", 2671260646u, 0, 4, &be_const_str_lv_slider); +be_define_const_str(lv_slider, "lv_slider", 2274180781u, 0, 9, &be_const_str_sin); +be_define_const_str(sin, "sin", 3761252941u, 0, 3, NULL); +be_define_const_str(HALLEFFECT, "HALLEFFECT", 3334305407u, 0, 10, &be_const_str_time_dump); +be_define_const_str(time_dump, "time_dump", 3330410747u, 0, 9, NULL); +be_define_const_str(OPEN_DRAIN, "OPEN_DRAIN", 677872608u, 0, 10, NULL); +be_define_const_str(A4988_STP, "A4988_STP", 1622172049u, 0, 9, &be_const_str_DDS2382_TX); +be_define_const_str(DDS2382_TX, "DDS2382_TX", 1438117864u, 0, 10, &be_const_str_lv_gauge_format_cb); +be_define_const_str(lv_gauge_format_cb, "lv_gauge_format_cb", 4073149249u, 0, 18, &be_const_str_lv_signal_cb); +be_define_const_str(lv_signal_cb, "lv_signal_cb", 3295792564u, 0, 12, &be_const_str_update); +be_define_const_str(update, "update", 672109684u, 0, 6, NULL); +be_define_const_str(SYMBOL_SAVE, "SYMBOL_SAVE", 2439821015u, 0, 11, NULL); +be_define_const_str(lv_cont, "lv_cont", 1391686552u, 0, 7, NULL); +be_define_const_str(ARIRFSEL, "ARIRFSEL", 233874443u, 0, 8, &be_const_str_HPMA_RX); +be_define_const_str(HPMA_RX, "HPMA_RX", 3462528998u, 0, 7, &be_const_str_I2S_OUT_DATA); +be_define_const_str(I2S_OUT_DATA, "I2S_OUT_DATA", 1176288293u, 0, 12, NULL); +be_define_const_str(ETH_PHY_POWER, "ETH_PHY_POWER", 487529454u, 0, 13, &be_const_str_count); +be_define_const_str(count, "count", 967958004u, 0, 5, &be_const_str_lv_imgbtn); +be_define_const_str(lv_imgbtn, "lv_imgbtn", 2402844429u, 0, 9, &be_const_str_wifi); +be_define_const_str(wifi, "wifi", 120087624u, 0, 4, NULL); +be_define_const_str(KEY1, "KEY1", 6715975u, 0, 4, &be_const_str__end_transmission); +be_define_const_str(_end_transmission, "_end_transmission", 3237480400u, 0, 17, NULL); +be_define_const_str(SYMBOL_CHARGE, "SYMBOL_CHARGE", 2106391946u, 0, 13, &be_const_str_i2c_enabled); +be_define_const_str(i2c_enabled, "i2c_enabled", 218388101u, 0, 11, &be_const_str_lv_event_cb); +be_define_const_str(lv_event_cb, "lv_event_cb", 2480731016u, 0, 11, NULL); +be_define_const_str(SYMBOL_VIDEO, "SYMBOL_VIDEO", 789726913u, 0, 12, NULL); +be_define_const_str(acos, "acos", 1006755615u, 0, 4, &be_const_str_asin); +be_define_const_str(asin, "asin", 4272848550u, 0, 4, &be_const_str_content_flush); +be_define_const_str(content_flush, "content_flush", 214922475u, 0, 13, &be_const_str_read12); +be_define_const_str(read12, "read12", 4291076970u, 0, 6, NULL); +be_define_const_str(SYMBOL_CLOSE, "SYMBOL_CLOSE", 2654402806u, 0, 12, &be_const_str_SYMBOL_UP); +be_define_const_str(SYMBOL_UP, "SYMBOL_UP", 3886401511u, 0, 9, NULL); +be_define_const_str(SSPI_MOSI, "SSPI_MOSI", 3745917497u, 0, 9, &be_const_str_SYMBOL_BATTERY_EMPTY); +be_define_const_str(SYMBOL_BATTERY_EMPTY, "SYMBOL_BATTERY_EMPTY", 3945064277u, 0, 20, NULL); +be_define_const_str(FTC532, "FTC532", 3182343438u, 0, 6, &be_const_str_MAX31855DO); +be_define_const_str(MAX31855DO, "MAX31855DO", 552730368u, 0, 10, NULL); +be_define_const_str(SPI_CLK, "SPI_CLK", 3943233814u, 0, 7, NULL); +be_define_const_str(ceil, "ceil", 1659167240u, 0, 4, &be_const_str_try_rule); +be_define_const_str(try_rule, "try_rule", 1986449405u, 0, 8, NULL); +be_define_const_str(IRRECV, "IRRECV", 1743648982u, 0, 6, &be_const_str_remove_cmd); +be_define_const_str(remove_cmd, "remove_cmd", 3832315702u, 0, 10, NULL); +be_define_const_str(RA8876_CS, "RA8876_CS", 2529944108u, 0, 9, &be_const_str_lv_cb); +be_define_const_str(lv_cb, "lv_cb", 1389787433u, 0, 5, &be_const_str_lv_draw_mask_radius_param_cfg); +be_define_const_str(lv_draw_mask_radius_param_cfg, "lv_draw_mask_radius_param_cfg", 3889386773u, 0, 29, NULL); +be_define_const_str(TM1638DIO, "TM1638DIO", 1408212414u, 0, 9, &be_const_str_lv_textarea); +be_define_const_str(lv_textarea, "lv_textarea", 2864635074u, 0, 11, NULL); +be_define_const_str(PROJECTOR_CTRL_RX, "PROJECTOR_CTRL_RX", 1542762460u, 0, 17, &be_const_str_SYMBOL_COPY); +be_define_const_str(SYMBOL_COPY, "SYMBOL_COPY", 4193681815u, 0, 11, &be_const_str_abs); +be_define_const_str(abs, "abs", 709362235u, 0, 3, NULL); +be_define_const_str(SAIR_TX, "SAIR_TX", 268017311u, 0, 7, &be_const_str_SBR_RX); +be_define_const_str(SBR_RX, "SBR_RX", 3350999801u, 0, 6, &be_const_str_lv_spinner); +be_define_const_str(lv_spinner, "lv_spinner", 3361501901u, 0, 10, NULL); +be_define_const_str(SYMBOL_MINUS, "SYMBOL_MINUS", 1806749158u, 0, 12, &be_const_str_byte); +be_define_const_str(byte, "byte", 1683620383u, 0, 4, &be_const_str_web_send); +be_define_const_str(web_send, "web_send", 2989941448u, 0, 8, NULL); +be_define_const_str(clear, "clear", 1550717474u, 0, 5, &be_const_str_content_start); +be_define_const_str(content_start, "content_start", 2937509069u, 0, 13, &be_const_str_wire1); +be_define_const_str(wire1, "wire1", 3212721419u, 0, 5, NULL); +be_define_const_str(SYMBOL_FILE, "SYMBOL_FILE", 237085260u, 0, 11, &be_const_str_nil); +be_define_const_str(nil, "nil", 228849900u, 63, 3, NULL); +be_define_const_str(RFRECV, "RFRECV", 354742801u, 0, 6, &be_const_str__timers); +be_define_const_str(_timers, "_timers", 2600100916u, 0, 7, &be_const_str_call); +be_define_const_str(call, "call", 3018949801u, 0, 4, &be_const_str_lv_draw_mask_angle_param); +be_define_const_str(lv_draw_mask_angle_param, "lv_draw_mask_angle_param", 4192166041u, 0, 24, NULL); +be_define_const_str(calldepth, "calldepth", 3122364302u, 0, 9, NULL); +be_define_const_str(SDM120_RX, "SDM120_RX", 1367571753u, 0, 9, &be_const_str_lv_font); +be_define_const_str(lv_font, "lv_font", 1550958453u, 0, 7, NULL); +be_define_const_str(exec_cmd, "exec_cmd", 493567399u, 0, 8, &be_const_str_lv_obj); +be_define_const_str(lv_obj, "lv_obj", 4257833149u, 0, 6, &be_const_str_wire); +be_define_const_str(wire, "wire", 4082753944u, 0, 4, &be_const_str_as); +be_define_const_str(as, "as", 1579491469u, 67, 2, NULL); +be_define_const_str(RF_SENSOR, "RF_SENSOR", 2289628100u, 0, 9, &be_const_str_exp); +be_define_const_str(exp, "exp", 1923516200u, 0, 3, NULL); +be_define_const_str(LEDLNK_INV, "LEDLNK_INV", 3559015101u, 0, 10, &be_const_str_resp_cmnd); +be_define_const_str(resp_cmnd, "resp_cmnd", 2869459626u, 0, 9, NULL); +be_define_const_str(dot_p2, ".p2", 232398067u, 0, 3, NULL); +be_define_const_str(HRE_DATA, "HRE_DATA", 1820377643u, 0, 8, NULL); +be_define_const_str(ADC_PH, "ADC_PH", 3820290594u, 0, 6, &be_const_str_PN532_TXD); +be_define_const_str(PN532_TXD, "PN532_TXD", 3093418644u, 0, 9, &be_const_str_SDM630_RX); +be_define_const_str(SDM630_RX, "SDM630_RX", 1971606309u, 0, 9, &be_const_str_cmd); +be_define_const_str(cmd, "cmd", 4136785899u, 0, 3, &be_const_str_lv_draw_mask_saved); +be_define_const_str(lv_draw_mask_saved, "lv_draw_mask_saved", 2063709159u, 0, 18, &be_const_str_seti); +be_define_const_str(seti, "seti", 1500556254u, 0, 4, NULL); +be_define_const_str(SDM120_TX, "SDM120_TX", 2509332415u, 0, 9, NULL); +be_define_const_str(IEM3000_RX, "IEM3000_RX", 1117811096u, 0, 10, &be_const_str_ZIGBEE_RST); +be_define_const_str(ZIGBEE_RST, "ZIGBEE_RST", 721588661u, 0, 10, &be_const_str_gc); +be_define_const_str(gc, "gc", 1042313471u, 0, 2, &be_const_str_var); +be_define_const_str(var, "var", 2317739966u, 64, 3, NULL); +be_define_const_str(get_power, "get_power", 3009799377u, 0, 9, &be_const_str_pin_used); +be_define_const_str(pin_used, "pin_used", 4033854612u, 0, 8, NULL); +be_define_const_str(dot_def, ".def", 4095748648u, 0, 4, &be_const_str_SDCARD_CS); +be_define_const_str(SDCARD_CS, "SDCARD_CS", 3348952003u, 0, 9, &be_const_str_SSD1351_DC); +be_define_const_str(SSD1351_DC, "SSD1351_DC", 84950353u, 0, 10, &be_const_str_SYMBOL_VOLUME_MAX); +be_define_const_str(SYMBOL_VOLUME_MAX, "SYMBOL_VOLUME_MAX", 3582646093u, 0, 17, NULL); +be_define_const_str(DHT11, "DHT11", 367083569u, 0, 5, &be_const_str_DSB); +be_define_const_str(DSB, "DSB", 98073254u, 0, 3, &be_const_str_getbits); +be_define_const_str(getbits, "getbits", 3094168979u, 0, 7, NULL); +be_define_const_str(PWM1_INV, "PWM1_INV", 3939021030u, 0, 8, &be_const_str_memory); +be_define_const_str(memory, "memory", 2229924270u, 0, 6, &be_const_str_raise); +be_define_const_str(raise, "raise", 1593437475u, 70, 5, NULL); +be_define_const_str(BUZZER, "BUZZER", 1550039611u, 0, 6, &be_const_str_ROT1A); +be_define_const_str(ROT1A, "ROT1A", 759599716u, 0, 5, &be_const_str_TM1637DIO); +be_define_const_str(TM1637DIO, "TM1637DIO", 1574659381u, 0, 9, &be_const_str_WEBCAM_PSCLK); +be_define_const_str(WEBCAM_PSCLK, "WEBCAM_PSCLK", 3150007456u, 0, 12, &be_const_str_ZIGBEE_TX); +be_define_const_str(ZIGBEE_TX, "ZIGBEE_TX", 25119256u, 0, 9, &be_const_str_super); +be_define_const_str(super, "super", 4152230356u, 0, 5, NULL); +be_define_const_str(WEBCAM_SIOD, "WEBCAM_SIOD", 302703242u, 0, 11, &be_const_str_lv_design_cb); +be_define_const_str(lv_design_cb, "lv_design_cb", 3822640502u, 0, 12, &be_const_str_name); +be_define_const_str(name, "name", 2369371622u, 0, 4, NULL); +be_define_const_str(SYMBOL_RIGHT, "SYMBOL_RIGHT", 2984010648u, 0, 12, NULL); +be_define_const_str(DI, "DI", 1070498734u, 0, 2, &be_const_str_SM16716_SEL); +be_define_const_str(SM16716_SEL, "SM16716_SEL", 142377379u, 0, 11, &be_const_str_load_font); +be_define_const_str(load_font, "load_font", 1875840019u, 0, 9, NULL); +be_define_const_str(SYMBOL_GPS, "SYMBOL_GPS", 3044165570u, 0, 10, &be_const_str_TASMOTACLIENT_TXD); +be_define_const_str(TASMOTACLIENT_TXD, "TASMOTACLIENT_TXD", 1386193940u, 0, 17, NULL); +be_define_const_str(gen_cb, "gen_cb", 3245227551u, 0, 6, &be_const_str_write_bit); +be_define_const_str(write_bit, "write_bit", 2660990436u, 0, 9, NULL); +be_define_const_str(MAX7219CLK, "MAX7219CLK", 963568838u, 0, 10, &be_const_str_addr); +be_define_const_str(addr, "addr", 1087856498u, 0, 4, &be_const_str_pow); +be_define_const_str(pow, "pow", 1479764693u, 0, 3, NULL); +be_define_const_str(loop, "loop", 3723446379u, 0, 4, NULL); +be_define_const_str(DEEPSLEEP, "DEEPSLEEP", 189922226u, 0, 9, &be_const_str_SPI_CS); +be_define_const_str(SPI_CS, "SPI_CS", 553701236u, 0, 6, &be_const_str_get_light); +be_define_const_str(get_light, "get_light", 381930476u, 0, 9, &be_const_str_keys); +be_define_const_str(keys, "keys", 4182378701u, 0, 4, &be_const_str_run_deferred); +be_define_const_str(run_deferred, "run_deferred", 371594696u, 0, 12, NULL); +be_define_const_str(MCP39F5_RST, "MCP39F5_RST", 3657125652u, 0, 11, &be_const_str_except); +be_define_const_str(except, "except", 950914032u, 69, 6, NULL); +be_define_const_str(ROT1A_NP, "ROT1A_NP", 2322706903u, 0, 8, &be_const_str_WS2812); +be_define_const_str(WS2812, "WS2812", 3539741218u, 0, 6, NULL); +be_define_const_str(PZEM017_RX, "PZEM017_RX", 3227495894u, 0, 10, &be_const_str_scale_uint); +be_define_const_str(scale_uint, "scale_uint", 3090811094u, 0, 10, NULL); +be_define_const_str(HX711_DAT, "HX711_DAT", 2935118250u, 0, 9, &be_const_str_PROJECTOR_CTRL_TX); +be_define_const_str(PROJECTOR_CTRL_TX, "PROJECTOR_CTRL_TX", 535811130u, 0, 17, &be_const_str_SSPI_CS); +be_define_const_str(SSPI_CS, "SSPI_CS", 977784795u, 0, 7, &be_const_str_list); +be_define_const_str(list, "list", 217798785u, 0, 4, &be_const_str_pop); +be_define_const_str(pop, "pop", 1362321360u, 0, 3, NULL); +be_define_const_str(MGC3130_XFER, "MGC3130_XFER", 4178219131u, 0, 12, NULL); +be_define_const_str(GPS_RX, "GPS_RX", 1075637342u, 0, 6, &be_const_str_SYMBOL_USB); +be_define_const_str(SYMBOL_USB, "SYMBOL_USB", 1962656552u, 0, 10, &be_const_str_XPT2046_CS); +be_define_const_str(XPT2046_CS, "XPT2046_CS", 4049231042u, 0, 10, &be_const_str_stop); +be_define_const_str(stop, "stop", 3411225317u, 0, 4, NULL); +be_define_const_str(lv_list, "lv_list", 2876551248u, 0, 7, NULL); +be_define_const_str(AudioOutputI2S, "AudioOutputI2S", 638031784u, 0, 14, NULL); +be_define_const_str(WEBCAM_RESET, "WEBCAM_RESET", 2171221520u, 0, 12, NULL); +be_define_const_str(TELEINFO_ENABLE, "TELEINFO_ENABLE", 1600974501u, 0, 15, &be_const_str_map); +be_define_const_str(map, "map", 3751997361u, 0, 3, NULL); +be_define_const_str(ADC_JOY, "ADC_JOY", 1116943612u, 0, 7, &be_const_str_I2C_SDA); +be_define_const_str(I2C_SDA, "I2C_SDA", 1052592262u, 0, 7, &be_const_str_SSD1351_CS); +be_define_const_str(SSD1351_CS, "SSD1351_CS", 488746042u, 0, 10, &be_const_str_setbits); +be_define_const_str(setbits, "setbits", 2762408167u, 0, 7, &be_const_str_str); +be_define_const_str(str, "str", 3259748752u, 0, 3, NULL); +be_define_const_str(__upper__, "__upper__", 3612202883u, 0, 9, &be_const_str__buffer); +be_define_const_str(_buffer, "_buffer", 2044888568u, 0, 7, NULL); +be_define_const_str(AZ_TXD, "AZ_TXD", 850268709u, 0, 6, &be_const_str_NEOPOOL_TX); +be_define_const_str(NEOPOOL_TX, "NEOPOOL_TX", 2924925804u, 0, 10, &be_const_str_PMS5003_TX); +be_define_const_str(PMS5003_TX, "PMS5003_TX", 3868169364u, 0, 10, NULL); +be_define_const_str(_drivers, "_drivers", 3260328985u, 0, 8, NULL); +be_define_const_str(opt_call, "()", 685372826u, 0, 2, &be_const_str_find_key_i); +be_define_const_str(find_key_i, "find_key_i", 850136726u, 0, 10, NULL); +be_define_const_str(CC1101_GDO0, "CC1101_GDO0", 940611027u, 0, 11, &be_const_str_arg_size); +be_define_const_str(arg_size, "arg_size", 3310243257u, 0, 8, NULL); +be_define_const_str(AudioGeneratorMP3, "AudioGeneratorMP3", 2199818488u, 0, 17, &be_const_str_set_timer); +be_define_const_str(set_timer, "set_timer", 2135414533u, 0, 9, NULL); +be_define_const_str(PZEM004_RX, "PZEM004_RX", 3411153194u, 0, 10, &be_const_str_cb_dispatch); +be_define_const_str(cb_dispatch, "cb_dispatch", 1741510499u, 0, 11, &be_const_str_fromstring); +be_define_const_str(fromstring, "fromstring", 610302344u, 0, 10, &be_const_str_lv_color); +be_define_const_str(lv_color, "lv_color", 1419148319u, 0, 8, NULL); +be_define_const_str(geti, "geti", 2381006490u, 0, 4, &be_const_str_log10); +be_define_const_str(log10, "log10", 2346846000u, 0, 5, NULL); +be_define_const_str(eth, "eth", 2191266556u, 0, 3, NULL); +be_define_const_str(__iterator__, "__iterator__", 3884039703u, 0, 12, NULL); +be_define_const_str(NONE, "NONE", 1932136219u, 0, 4, &be_const_str_SYMBOL_CUT); +be_define_const_str(SYMBOL_CUT, "SYMBOL_CUT", 3455112394u, 0, 10, &be_const_str_erase); +be_define_const_str(erase, "erase", 1010949589u, 0, 5, NULL); +be_define_const_str(SOLAXX1_TX, "SOLAXX1_TX", 903770840u, 0, 10, &be_const_str_hex); +be_define_const_str(hex, "hex", 4273249610u, 0, 3, NULL); +be_define_const_str(arg, "arg", 1047474471u, 0, 3, &be_const_str_lv_tabview); +be_define_const_str(lv_tabview, "lv_tabview", 2109024786u, 0, 10, &be_const_str_scan); be_define_const_str(scan, "scan", 3974641896u, 0, 4, &be_const_str_toupper); be_define_const_str(toupper, "toupper", 3691983576u, 0, 7, NULL); -be_define_const_str(SDS0X1_RX, "SDS0X1_RX", 1170717385u, 0, 9, &be_const_str_content_send); -be_define_const_str(content_send, "content_send", 1673733649u, 0, 12, &be_const_str_lv_group); -be_define_const_str(lv_group, "lv_group", 3852039019u, 0, 8, NULL); -be_define_const_str(AS608_RX, "AS608_RX", 4275502016u, 0, 8, &be_const_str_SYMBOL_CHARGE); -be_define_const_str(SYMBOL_CHARGE, "SYMBOL_CHARGE", 2106391946u, 0, 13, &be_const_str_get_light); -be_define_const_str(get_light, "get_light", 381930476u, 0, 9, &be_const_str_load_freetype_font); -be_define_const_str(load_freetype_font, "load_freetype_font", 2368447592u, 0, 18, &be_const_str_setitem); -be_define_const_str(setitem, "setitem", 1554834596u, 0, 7, NULL); -be_define_const_str(opt_connect, "..", 2748622605u, 0, 2, &be_const_str_SDM72_TX); -be_define_const_str(SDM72_TX, "SDM72_TX", 2042143269u, 0, 8, &be_const_str_SYMBOL_VOLUME_MID); -be_define_const_str(SYMBOL_VOLUME_MID, "SYMBOL_VOLUME_MID", 158835057u, 0, 17, &be_const_str_TELEINFO_ENABLE); -be_define_const_str(TELEINFO_ENABLE, "TELEINFO_ENABLE", 1600974501u, 0, 15, &be_const_str_collect); -be_define_const_str(collect, "collect", 2399039025u, 0, 7, NULL); -be_define_const_str(_timers, "_timers", 2600100916u, 0, 7, &be_const_str_add); -be_define_const_str(add, "add", 993596020u, 0, 3, &be_const_str_isinstance); -be_define_const_str(isinstance, "isinstance", 3669352738u, 0, 10, &be_const_str_rtc); -be_define_const_str(rtc, "rtc", 1070575216u, 0, 3, NULL); -be_define_const_str(lv_draw_img_dsc, "lv_draw_img_dsc", 999847907u, 0, 15, NULL); -be_define_const_str(HIGH, "HIGH", 2066738941u, 0, 4, &be_const_str_add_cmd); -be_define_const_str(add_cmd, "add_cmd", 3361630879u, 0, 7, &be_const_str_erase); -be_define_const_str(erase, "erase", 1010949589u, 0, 5, &be_const_str_as); -be_define_const_str(as, "as", 1579491469u, 67, 2, NULL); -be_define_const_str(DSB, "DSB", 98073254u, 0, 3, &be_const_str_KEY1_INV_NP); -be_define_const_str(KEY1_INV_NP, "KEY1_INV_NP", 3160558586u, 0, 11, &be_const_str___lower__); -be_define_const_str(__lower__, "__lower__", 123855590u, 0, 9, &be_const_str_set_light); -be_define_const_str(set_light, "set_light", 3176076152u, 0, 9, NULL); -be_define_const_str(ARIRFRCV, "ARIRFRCV", 1120816444u, 0, 8, &be_const_str_KEY1_NP); -be_define_const_str(KEY1_NP, "KEY1_NP", 709918726u, 0, 7, &be_const_str_WIEGAND_D1); -be_define_const_str(WIEGAND_D1, "WIEGAND_D1", 4175558140u, 0, 10, &be_const_str_find_op); -be_define_const_str(find_op, "find_op", 3766713376u, 0, 7, NULL); -be_define_const_str(NRF24_DC, "NRF24_DC", 688921313u, 0, 8, &be_const_str_content_start); -be_define_const_str(content_start, "content_start", 2937509069u, 0, 13, NULL); -be_define_const_str(SYMBOL_STOP, "SYMBOL_STOP", 2836505202u, 0, 11, &be_const_str_lv_win); -be_define_const_str(lv_win, "lv_win", 780927558u, 0, 6, &be_const_str_false); -be_define_const_str(false, "false", 184981848u, 62, 5, NULL); -be_define_const_str(A4988_STP, "A4988_STP", 1622172049u, 0, 9, &be_const_str_SYMBOL_NEXT); -be_define_const_str(SYMBOL_NEXT, "SYMBOL_NEXT", 1102844455u, 0, 11, &be_const_str_WEBCAM_XCLK); -be_define_const_str(WEBCAM_XCLK, "WEBCAM_XCLK", 536207425u, 0, 11, NULL); -be_define_const_str(WEBCAM_PSRCS, "WEBCAM_PSRCS", 624464864u, 0, 12, &be_const_str_scale_uint); -be_define_const_str(scale_uint, "scale_uint", 3090811094u, 0, 10, &be_const_str_do); -be_define_const_str(do, "do", 1646057492u, 65, 2, NULL); -be_define_const_str(OUTPUT_LO, "OUTPUT_LO", 3724620328u, 0, 9, &be_const_str_SSPI_DC); -be_define_const_str(SSPI_DC, "SSPI_DC", 1782271864u, 0, 7, &be_const_str_import); -be_define_const_str(import, "import", 288002260u, 66, 6, NULL); -be_define_const_str(push, "push", 2272264157u, 0, 4, NULL); -be_define_const_str(cos, "cos", 4220379804u, 0, 3, &be_const_str_lv_tabview); -be_define_const_str(lv_tabview, "lv_tabview", 2109024786u, 0, 10, NULL); -be_define_const_str(set_timer, "set_timer", 2135414533u, 0, 9, NULL); -be_define_const_str(DEEPSLEEP, "DEEPSLEEP", 189922226u, 0, 9, &be_const_str_ILI9341_DC); -be_define_const_str(ILI9341_DC, "ILI9341_DC", 28838624u, 0, 10, &be_const_str_yield); -be_define_const_str(yield, "yield", 1821831854u, 0, 5, NULL); -be_define_const_str(SDM630_RX, "SDM630_RX", 1971606309u, 0, 9, NULL); -be_define_const_str(DI, "DI", 1070498734u, 0, 2, &be_const_str_SYMBOL_BLUETOOTH); -be_define_const_str(SYMBOL_BLUETOOTH, "SYMBOL_BLUETOOTH", 679376572u, 0, 16, &be_const_str_lv_draw_label_dsc); -be_define_const_str(lv_draw_label_dsc, "lv_draw_label_dsc", 265601842u, 0, 17, &be_const_str_update); -be_define_const_str(update, "update", 672109684u, 0, 6, NULL); -be_define_const_str(INPUT, "INPUT", 1638025307u, 0, 5, &be_const_str_SYMBOL_NEW_LINE); -be_define_const_str(SYMBOL_NEW_LINE, "SYMBOL_NEW_LINE", 2014334315u, 0, 15, &be_const_str_ZIGBEE_RST); -be_define_const_str(ZIGBEE_RST, "ZIGBEE_RST", 721588661u, 0, 10, NULL); -be_define_const_str(SYMBOL_SD_CARD, "SYMBOL_SD_CARD", 2542376484u, 0, 14, NULL); -be_define_const_str(CC1101_GDO2, "CC1101_GDO2", 974166265u, 0, 11, &be_const_str_MGC3130_XFER); -be_define_const_str(MGC3130_XFER, "MGC3130_XFER", 4178219131u, 0, 12, &be_const_str__drivers); -be_define_const_str(_drivers, "_drivers", 3260328985u, 0, 8, NULL); -be_define_const_str(copy, "copy", 3848464964u, 0, 4, &be_const_str_detect); -be_define_const_str(detect, "detect", 8884370u, 0, 6, NULL); -be_define_const_str(SR04_TRIG, "SR04_TRIG", 68671263u, 0, 9, &be_const_str_TUYA_TX); -be_define_const_str(TUYA_TX, "TUYA_TX", 1541301465u, 0, 7, &be_const_str__cb); -be_define_const_str(_cb, "_cb", 4043300367u, 0, 3, NULL); -be_define_const_str(HALLEFFECT, "HALLEFFECT", 3334305407u, 0, 10, &be_const_str_RXD); -be_define_const_str(RXD, "RXD", 2311579049u, 0, 3, NULL); -be_define_const_str(imin, "imin", 2714127864u, 0, 4, NULL); -be_define_const_str(SYMBOL_VIDEO, "SYMBOL_VIDEO", 789726913u, 0, 12, NULL); -be_define_const_str(SYMBOL_LIST, "SYMBOL_LIST", 70793990u, 0, 11, &be_const_str_calldepth); -be_define_const_str(calldepth, "calldepth", 3122364302u, 0, 9, NULL); -be_define_const_str(AZ_TXD, "AZ_TXD", 850268709u, 0, 6, &be_const_str_DSB_OUT); -be_define_const_str(DSB_OUT, "DSB_OUT", 732335085u, 0, 7, NULL); -be_define_const_str(end, "end", 1787721130u, 56, 3, NULL); -be_define_const_str(SYMBOL_BATTERY_EMPTY, "SYMBOL_BATTERY_EMPTY", 3945064277u, 0, 20, &be_const_str_lv_gauge); -be_define_const_str(lv_gauge, "lv_gauge", 118613531u, 0, 8, NULL); +be_define_const_str(tan, "tan", 2633446552u, 0, 3, NULL); +be_define_const_str(NRF24_DC, "NRF24_DC", 688921313u, 0, 8, &be_const_str_decrypt); +be_define_const_str(decrypt, "decrypt", 2886974618u, 0, 7, &be_const_str_isrunning); +be_define_const_str(isrunning, "isrunning", 1688182268u, 0, 9, &be_const_str_lv_led); +be_define_const_str(lv_led, "lv_led", 3192184733u, 0, 6, &be_const_str_time_reached); +be_define_const_str(time_reached, "time_reached", 2075136773u, 0, 12, NULL); +be_define_const_str(event, "event", 4264611999u, 0, 5, NULL); +be_define_const_str(WEBCAM_XCLK, "WEBCAM_XCLK", 536207425u, 0, 11, &be_const_str_arg_name); +be_define_const_str(arg_name, "arg_name", 1345046155u, 0, 8, NULL); +be_define_const_str(ADC_BUTTON_INV, "ADC_BUTTON_INV", 2027625326u, 0, 14, &be_const_str_ILI9341_CS); +be_define_const_str(ILI9341_CS, "ILI9341_CS", 3519318851u, 0, 10, &be_const_str_SPI_DC); +be_define_const_str(SPI_DC, "SPI_DC", 553259951u, 0, 6, &be_const_str_SYMBOL_EYE_OPEN); +be_define_const_str(SYMBOL_EYE_OPEN, "SYMBOL_EYE_OPEN", 3449311676u, 0, 15, &be_const_str_add_driver); +be_define_const_str(add_driver, "add_driver", 1654458371u, 0, 10, NULL); +be_define_const_str(MCP39F5_TX, "MCP39F5_TX", 1332322047u, 0, 10, &be_const_str_MP3_DFR562); +be_define_const_str(MP3_DFR562, "MP3_DFR562", 2859952977u, 0, 10, &be_const_str_tanh); +be_define_const_str(tanh, "tanh", 153638352u, 0, 4, NULL); +be_define_const_str(SSPI_MAX31865_CS1, "SSPI_MAX31865_CS1", 1256578724u, 0, 17, &be_const_str_lv_calendar); +be_define_const_str(lv_calendar, "lv_calendar", 3284396894u, 0, 11, &be_const_str_on); +be_define_const_str(on, "on", 1630810064u, 0, 2, &be_const_str_tag); +be_define_const_str(tag, "tag", 2516003219u, 0, 3, NULL); be_define_const_str(for, "for", 2901640080u, 54, 3, NULL); -be_define_const_str(BUZZER, "BUZZER", 1550039611u, 0, 6, &be_const_str_member); -be_define_const_str(member, "member", 719708611u, 0, 6, NULL); -be_define_const_str(SSPI_SCLK, "SSPI_SCLK", 136688954u, 0, 9, &be_const_str_lv_draw_mask_radius_param); -be_define_const_str(lv_draw_mask_radius_param, "lv_draw_mask_radius_param", 3777679220u, 0, 25, &be_const_str_range); -be_define_const_str(range, "range", 4208725202u, 0, 5, NULL); -be_define_const_str(issubclass, "issubclass", 4078395519u, 0, 10, NULL); -be_define_const_str(WEBCAM_HREF, "WEBCAM_HREF", 3161890024u, 0, 11, &be_const_str_bytes); -be_define_const_str(bytes, "bytes", 1706151940u, 0, 5, &be_const_str_lv_signal_cb); -be_define_const_str(lv_signal_cb, "lv_signal_cb", 3295792564u, 0, 12, NULL); -be_define_const_str(Driver, "Driver", 3576386303u, 0, 6, NULL); -be_define_const_str(OPTION_A, "OPTION_A", 1133299440u, 0, 8, &be_const_str_SYMBOL_DUMMY); -be_define_const_str(SYMBOL_DUMMY, "SYMBOL_DUMMY", 3621732138u, 0, 12, &be_const_str_WEBCAM_HSD); -be_define_const_str(WEBCAM_HSD, "WEBCAM_HSD", 2648502504u, 0, 10, NULL); -be_define_const_str(IBEACON_RX, "IBEACON_RX", 2466155575u, 0, 10, &be_const_str_SYMBOL_WIFI); -be_define_const_str(SYMBOL_WIFI, "SYMBOL_WIFI", 682141303u, 0, 11, NULL); -be_define_const_str(HM10_TX, "HM10_TX", 1522037252u, 0, 7, NULL); -be_define_const_str(BOILER_OT_RX, "BOILER_OT_RX", 603647409u, 0, 12, &be_const_str_SM16716_CLK); -be_define_const_str(SM16716_CLK, "SM16716_CLK", 3037641483u, 0, 11, &be_const_str_SYMBOL_EJECT); -be_define_const_str(SYMBOL_EJECT, "SYMBOL_EJECT", 873760647u, 0, 12, NULL); -be_define_const_str(item, "item", 2671260646u, 0, 4, NULL); -be_define_const_str(SDS0X1_TX, "SDS0X1_TX", 165045983u, 0, 9, &be_const_str_deg); -be_define_const_str(deg, "deg", 3327754271u, 0, 3, NULL); -be_define_const_str(OPEN_DRAIN, "OPEN_DRAIN", 677872608u, 0, 10, &be_const_str_SYMBOL_DOWNLOAD); -be_define_const_str(SYMBOL_DOWNLOAD, "SYMBOL_DOWNLOAD", 2607324090u, 0, 15, &be_const_str_SYMBOL_EDIT); -be_define_const_str(SYMBOL_EDIT, "SYMBOL_EDIT", 1396182822u, 0, 11, &be_const_str_geti); -be_define_const_str(geti, "geti", 2381006490u, 0, 4, &be_const_str_lv_label); -be_define_const_str(lv_label, "lv_label", 4199664246u, 0, 8, NULL); -be_define_const_str(_rules, "_rules", 4266217105u, 0, 6, NULL); -be_define_const_str(insert, "insert", 3332609576u, 0, 6, &be_const_str_register_button_encoder); +be_define_const_str(_available, "_available", 1306196581u, 0, 10, &be_const_str_assert); +be_define_const_str(assert, "assert", 2774883451u, 0, 6, NULL); +be_define_const_str(return, "return", 2246981567u, 60, 6, NULL); +be_define_const_str(compile, "compile", 1000265118u, 0, 7, NULL); +be_define_const_str(NRF24_CS, "NRF24_CS", 555833194u, 0, 8, &be_const_str_resize); +be_define_const_str(resize, "resize", 3514612129u, 0, 6, NULL); +be_define_const_str(SYMBOL_LIST, "SYMBOL_LIST", 70793990u, 0, 11, &be_const_str_register_button_encoder); be_define_const_str(register_button_encoder, "register_button_encoder", 2811301550u, 0, 23, NULL); -be_define_const_str(web_add_config_button, "web_add_config_button", 639674325u, 0, 21, &be_const_str_true); be_define_const_str(true, "true", 1303515621u, 61, 4, NULL); -be_define_const_str(SYMBOL_BULLET, "SYMBOL_BULLET", 587181862u, 0, 13, &be_const_str_SYMBOL_CLOSE); -be_define_const_str(SYMBOL_CLOSE, "SYMBOL_CLOSE", 2654402806u, 0, 12, &be_const_str_SYMBOL_CUT); -be_define_const_str(SYMBOL_CUT, "SYMBOL_CUT", 3455112394u, 0, 10, &be_const_str__request_from); -be_define_const_str(_request_from, "_request_from", 3965148604u, 0, 13, &be_const_str_lower); -be_define_const_str(lower, "lower", 3038577850u, 0, 5, NULL); -be_define_const_str(SYMBOL_UPLOAD, "SYMBOL_UPLOAD", 3293679647u, 0, 13, &be_const_str_ctypes_bytes); -be_define_const_str(ctypes_bytes, "ctypes_bytes", 3879019703u, 0, 12, NULL); -be_define_const_str(lv_draw_mask_common_dsc, "lv_draw_mask_common_dsc", 1429224708u, 0, 23, NULL); -be_define_const_str(LE01MR_RX, "LE01MR_RX", 1521590809u, 0, 9, NULL); -be_define_const_str(web_add_main_button, "web_add_main_button", 3960367664u, 0, 19, NULL); -be_define_const_str(floor, "floor", 3102149661u, 0, 5, &be_const_str_seg7_font); -be_define_const_str(seg7_font, "seg7_font", 4099690689u, 0, 9, NULL); -be_define_const_str(DCKI, "DCKI", 3846847480u, 0, 4, &be_const_str_I2C_SDA); -be_define_const_str(I2C_SDA, "I2C_SDA", 1052592262u, 0, 7, NULL); -be_define_const_str(ILI9341_CS, "ILI9341_CS", 3519318851u, 0, 10, &be_const_str_lv_cb); -be_define_const_str(lv_cb, "lv_cb", 1389787433u, 0, 5, NULL); +be_define_const_str(A4988_ENA, "A4988_ENA", 1517502682u, 0, 9, &be_const_str_I2S_OUT_SLCT); +be_define_const_str(I2S_OUT_SLCT, "I2S_OUT_SLCT", 4037293837u, 0, 12, &be_const_str_static); +be_define_const_str(static, "static", 3532702267u, 71, 6, NULL); +be_define_const_str(ETH_PHY_MDIO, "ETH_PHY_MDIO", 3261871568u, 0, 12, &be_const_str_MHZ_TXD); +be_define_const_str(MHZ_TXD, "MHZ_TXD", 3310158233u, 0, 7, &be_const_str_gamma10); +be_define_const_str(gamma10, "gamma10", 3472052483u, 0, 7, NULL); +be_define_const_str(RISING, "RISING", 1256404539u, 0, 6, &be_const_str_lv_draw_mask_line_param); +be_define_const_str(lv_draw_mask_line_param, "lv_draw_mask_line_param", 2692990704u, 0, 23, NULL); +be_define_const_str(rand, "rand", 2711325910u, 0, 4, NULL); +be_define_const_str(Wire, "Wire", 1938276536u, 0, 4, &be_const_str_lv_dropdown); +be_define_const_str(lv_dropdown, "lv_dropdown", 2797165301u, 0, 11, &be_const_str_setitem); +be_define_const_str(setitem, "setitem", 1554834596u, 0, 7, NULL); +be_define_const_str(CSE7761_RX, "CSE7761_RX", 65423248u, 0, 10, &be_const_str_isinstance); +be_define_const_str(isinstance, "isinstance", 3669352738u, 0, 10, NULL); +be_define_const_str(CSE7766_RX, "CSE7766_RX", 1546766819u, 0, 10, &be_const_str_NEOPOOL_RX); +be_define_const_str(NEOPOOL_RX, "NEOPOOL_RX", 1917974474u, 0, 10, &be_const_str_SSD1331_DC); +be_define_const_str(SSD1331_DC, "SSD1331_DC", 3386560859u, 0, 10, NULL); +be_define_const_str(PZEM016_RX, "PZEM016_RX", 1004012055u, 0, 10, &be_const_str_SYMBOL_LEFT); +be_define_const_str(SYMBOL_LEFT, "SYMBOL_LEFT", 1563517575u, 0, 11, NULL); +be_define_const_str(SI7021, "SI7021", 864377911u, 0, 6, &be_const_str_TM1638CLK); +be_define_const_str(TM1638CLK, "TM1638CLK", 3045182446u, 0, 9, &be_const_str_setmember); +be_define_const_str(setmember, "setmember", 1432909441u, 0, 9, NULL); +be_define_const_str(SYMBOL_UPLOAD, "SYMBOL_UPLOAD", 3293679647u, 0, 13, &be_const_str_setrange); +be_define_const_str(setrange, "setrange", 3794019032u, 0, 8, NULL); +be_define_const_str(I2S_IN_CLK, "I2S_IN_CLK", 2996930120u, 0, 10, &be_const_str_SYMBOL_OK); +be_define_const_str(SYMBOL_OK, "SYMBOL_OK", 4033162940u, 0, 9, &be_const_str_get); +be_define_const_str(get, "get", 1410115415u, 0, 3, NULL); +be_define_const_str(OUTPUT_OPEN_DRAIN, "OUTPUT_OPEN_DRAIN", 2147249436u, 0, 17, &be_const_str_PULLDOWN); +be_define_const_str(PULLDOWN, "PULLDOWN", 1853074086u, 0, 8, NULL); +be_define_const_str(SYMBOL_BELL, "SYMBOL_BELL", 1736196487u, 0, 11, NULL); +be_define_const_str(SYMBOL_BATTERY_1, "SYMBOL_BATTERY_1", 629036063u, 0, 16, &be_const_str_SYMBOL_LOOP); +be_define_const_str(SYMBOL_LOOP, "SYMBOL_LOOP", 2762053208u, 0, 11, NULL); +be_define_const_str(atan, "atan", 108579519u, 0, 4, &be_const_str_size); +be_define_const_str(size, "size", 597743964u, 0, 4, NULL); +be_define_const_str(opt_add, "+", 772578730u, 0, 1, &be_const_str_lower); +be_define_const_str(lower, "lower", 3038577850u, 0, 5, &be_const_str_wire_scan); +be_define_const_str(wire_scan, "wire_scan", 2671275880u, 0, 9, &be_const_str_import); +be_define_const_str(import, "import", 288002260u, 66, 6, NULL); +be_define_const_str(REL1_INV, "REL1_INV", 3733155371u, 0, 8, &be_const_str_lv_gauge); +be_define_const_str(lv_gauge, "lv_gauge", 118613531u, 0, 8, NULL); +be_define_const_str(Tasmota, "Tasmota", 4047617668u, 0, 7, &be_const_str_check_privileged_access); +be_define_const_str(check_privileged_access, "check_privileged_access", 3692933968u, 0, 23, &be_const_str_wire2); +be_define_const_str(wire2, "wire2", 3229499038u, 0, 5, NULL); +be_define_const_str(DDSU666_TX, "DDSU666_TX", 1880604150u, 0, 10, &be_const_str_collect); +be_define_const_str(collect, "collect", 2399039025u, 0, 7, &be_const_str_init); +be_define_const_str(init, "init", 380752755u, 0, 4, NULL); +be_define_const_str(PWM1, "PWM1", 1353352426u, 0, 4, &be_const_str_ROT1B_NP); +be_define_const_str(ROT1B_NP, "ROT1B_NP", 3710079736u, 0, 8, &be_const_str_screenshot); +be_define_const_str(screenshot, "screenshot", 3894592561u, 0, 10, NULL); +be_define_const_str(DDS2382_RX, "DDS2382_RX", 432446462u, 0, 10, &be_const_str_format); +be_define_const_str(format, "format", 3114108242u, 0, 6, &be_const_str_pi); +be_define_const_str(pi, "pi", 1213090802u, 0, 2, NULL); +be_define_const_str(RC522_RST, "RC522_RST", 720511443u, 0, 9, &be_const_str_lv_draw_mask_angle_param_cfg); +be_define_const_str(lv_draw_mask_angle_param_cfg, "lv_draw_mask_angle_param_cfg", 3599767368u, 0, 28, NULL); +be_define_const_str(AS608_TX, "AS608_TX", 48630934u, 0, 8, &be_const_str_SSPI_DC); +be_define_const_str(SSPI_DC, "SSPI_DC", 1782271864u, 0, 7, &be_const_str_traceback); +be_define_const_str(traceback, "traceback", 3385188109u, 0, 9, NULL); +be_define_const_str(dot_p1, ".p1", 249175686u, 0, 3, &be_const_str_SYMBOL_PASTE); +be_define_const_str(SYMBOL_PASTE, "SYMBOL_PASTE", 2281577421u, 0, 12, &be_const_str_char); +be_define_const_str(char, "char", 2823553821u, 0, 4, NULL); +be_define_const_str(ADC_LIGHT, "ADC_LIGHT", 3982461502u, 0, 9, &be_const_str_deinit); +be_define_const_str(deinit, "deinit", 2345559592u, 0, 6, NULL); +be_define_const_str(digital_read, "digital_read", 3585496928u, 0, 12, &be_const_str_srand); +be_define_const_str(srand, "srand", 465518633u, 0, 5, NULL); +be_define_const_str(DHT11_OUT, "DHT11_OUT", 1645300734u, 0, 9, &be_const_str_imin); +be_define_const_str(imin, "imin", 2714127864u, 0, 4, &be_const_str_toint); +be_define_const_str(toint, "toint", 3613182909u, 0, 5, NULL); +be_define_const_str(PMS5003_RX, "PMS5003_RX", 3934985650u, 0, 10, &be_const_str_break); +be_define_const_str(break, "break", 3378807160u, 58, 5, NULL); +be_define_const_str(LEDLNK, "LEDLNK", 2862810701u, 0, 6, &be_const_str_MGC3130_RESET); +be_define_const_str(MGC3130_RESET, "MGC3130_RESET", 405013121u, 0, 13, &be_const_str_insert); +be_define_const_str(insert, "insert", 3332609576u, 0, 6, NULL); +be_define_const_str(IBEACON_TX, "IBEACON_TX", 3471826977u, 0, 10, &be_const_str_SYMBOL_POWER); +be_define_const_str(SYMBOL_POWER, "SYMBOL_POWER", 1125993627u, 0, 12, NULL); +be_define_const_str(SYMBOL_WIFI, "SYMBOL_WIFI", 682141303u, 0, 11, NULL); +be_define_const_str(PZEM0XX_TX, "PZEM0XX_TX", 944775704u, 0, 10, NULL); +be_define_const_str(KEY1_PD, "KEY1_PD", 3934075620u, 0, 7, &be_const_str_resp_cmnd_str); +be_define_const_str(resp_cmnd_str, "resp_cmnd_str", 737845590u, 0, 13, NULL); +be_define_const_str(reverse, "reverse", 558918661u, 0, 7, NULL); +be_define_const_str(PN532_RXD, "PN532_RXD", 1780093022u, 0, 9, &be_const_str_SYMBOL_SHUFFLE); +be_define_const_str(SYMBOL_SHUFFLE, "SYMBOL_SHUFFLE", 1123310147u, 0, 14, NULL); +be_define_const_str(false, "false", 184981848u, 62, 5, NULL); +be_define_const_str(TCP_TX, "TCP_TX", 2762594089u, 0, 6, NULL); +be_define_const_str(DYP_RX, "DYP_RX", 2122310285u, 0, 6, &be_const_str_continue); +be_define_const_str(continue, "continue", 2977070660u, 59, 8, NULL); +be_define_const_str(AudioFileSourceFS, "AudioFileSourceFS", 1839147653u, 0, 17, &be_const_str_AudioOutput); +be_define_const_str(AudioOutput, "AudioOutput", 3257792048u, 0, 11, &be_const_str_SYMBOL_MUTE); +be_define_const_str(SYMBOL_MUTE, "SYMBOL_MUTE", 563116043u, 0, 11, &be_const_str_TM1638STB); +be_define_const_str(TM1638STB, "TM1638STB", 823674593u, 0, 9, NULL); +be_define_const_str(BL0940_RX, "BL0940_RX", 2908993179u, 0, 9, &be_const_str_BOILER_OT_RX); +be_define_const_str(BOILER_OT_RX, "BOILER_OT_RX", 603647409u, 0, 12, &be_const_str_TUYA_RX); +be_define_const_str(TUYA_RX, "TUYA_RX", 1609397679u, 0, 7, &be_const_str_remove); +be_define_const_str(remove, "remove", 3683784189u, 0, 6, &be_const_str_web_send_decimal); +be_define_const_str(web_send_decimal, "web_send_decimal", 1407210204u, 0, 16, NULL); +be_define_const_str(_read, "_read", 346717030u, 0, 5, NULL); +be_define_const_str(CHANGE, "CHANGE", 4280911421u, 0, 6, &be_const_str_SM2135_CLK); +be_define_const_str(SM2135_CLK, "SM2135_CLK", 2383410011u, 0, 10, &be_const_str_TCP_RX); +be_define_const_str(TCP_RX, "TCP_RX", 3904354751u, 0, 6, &be_const_str_codedump); +be_define_const_str(codedump, "codedump", 1786337906u, 0, 8, NULL); +be_define_const_str(lv_canvas, "lv_canvas", 142865412u, 0, 9, &be_const_str_def); +be_define_const_str(def, "def", 3310976652u, 55, 3, NULL); +be_define_const_str(CNTR1_NP, "CNTR1_NP", 4288381648u, 0, 8, &be_const_str_GPS_TX); +be_define_const_str(GPS_TX, "GPS_TX", 4228740808u, 0, 6, &be_const_str_TASMOTACLIENT_RXD); +be_define_const_str(TASMOTACLIENT_RXD, "TASMOTACLIENT_RXD", 72868318u, 0, 17, &be_const_str_classname); +be_define_const_str(classname, "classname", 1998589948u, 0, 9, NULL); +be_define_const_str(NRG_SEL_INV, "NRG_SEL_INV", 3567431069u, 0, 11, NULL); static const bstring* const m_string_table[] = { - NULL, - (const bstring *)&be_const_str_lv_style, - (const bstring *)&be_const_str_ETH_PHY_MDIO, - (const bstring *)&be_const_str_bus, - (const bstring *)&be_const_str_ROT1A, - (const bstring *)&be_const_str_EPAPER42_CS, - (const bstring *)&be_const_str_MCP39F5_RST, - (const bstring *)&be_const_str_SYMBOL_SETTINGS, - (const bstring *)&be_const_str_pi, - (const bstring *)&be_const_str_acos, - NULL, - (const bstring *)&be_const_str_SYMBOL_BACKSPACE, - (const bstring *)&be_const_str_resp_cmnd, - (const bstring *)&be_const_str_NRG_SEL, - (const bstring *)&be_const_str_SYMBOL_OK, - (const bstring *)&be_const_str_SYMBOL_BATTERY_3, - (const bstring *)&be_const_str_ADC_TEMP, - (const bstring *)&be_const_str_SPI_DC, - (const bstring *)&be_const_str_MIEL_HVAC_RX, - (const bstring *)&be_const_str_SHELLY_DIMMER_RST_INV, - (const bstring *)&be_const_str_MAX7219CS, - (const bstring *)&be_const_str_SDM72_RX, - (const bstring *)&be_const_str_ADC_LIGHT, - (const bstring *)&be_const_str_lv_dropdown, - NULL, - (const bstring *)&be_const_str_A4988_DIR, - (const bstring *)&be_const_str_IEM3000_TX, - (const bstring *)&be_const_str_BS814_DAT, - (const bstring *)&be_const_str_opt_add, - NULL, - (const bstring *)&be_const_str_delay, - (const bstring *)&be_const_str_iter, - (const bstring *)&be_const_str_fromstring, - NULL, - (const bstring *)&be_const_str_CNTR1_NP, - NULL, - (const bstring *)&be_const_str_tanh, - (const bstring *)&be_const_str_lv_objmask, - (const bstring *)&be_const_str_SOLAXX1_RX, - (const bstring *)&be_const_str_HRE_CLOCK, - (const bstring *)&be_const_str_SYMBOL_AUDIO, + (const bstring *)&be_const_str_OPTION_A, + (const bstring *)&be_const_str_BACKLIGHT, + (const bstring *)&be_const_str_int, + (const bstring *)&be_const_str_SR04_TRIG, + (const bstring *)&be_const_str_LE01MR_RX, NULL, (const bstring *)&be_const_str_RC522_CS, - (const bstring *)&be_const_str_REL1, - NULL, - (const bstring *)&be_const_str_PZEM016_RX, - (const bstring *)&be_const_str_SYMBOL_TRASH, - (const bstring *)&be_const_str_REL1_INV, - (const bstring *)&be_const_str_FTC532, - (const bstring *)&be_const_str_opt_neq, - (const bstring *)&be_const_str_ADC_INPUT, - (const bstring *)&be_const_str_cmd, - (const bstring *)&be_const_str_lv_btn, - (const bstring *)&be_const_str_gc, - (const bstring *)&be_const_str_WINDMETER_SPEED, - (const bstring *)&be_const_str_WEBCAM_SIOC, - (const bstring *)&be_const_str_I2C_SCL, - (const bstring *)&be_const_str_RISING, - (const bstring *)&be_const_str__read, - (const bstring *)&be_const_str_SYMBOL_SHUFFLE, - (const bstring *)&be_const_str_DDSU666_TX, - (const bstring *)&be_const_str_RFRECV, - (const bstring *)&be_const_str_PZEM017_RX, - (const bstring *)&be_const_str_KEY1_INV, - (const bstring *)&be_const_str_ADC_BUTTON, - (const bstring *)&be_const_str_get_tasmota, - (const bstring *)&be_const_str_MIEL_HVAC_TX, - NULL, - (const bstring *)&be_const_str_SPI_MOSI, - (const bstring *)&be_const_str_MD5, - (const bstring *)&be_const_str_PMS5003_RX, - (const bstring *)&be_const_str_dump, - (const bstring *)&be_const_str_SYMBOL_EYE_CLOSE, - (const bstring *)&be_const_str_SYMBOL_IMAGE, - (const bstring *)&be_const_str_HPMA_RX, - (const bstring *)&be_const_str_CC1101_GDO0, - (const bstring *)&be_const_str_super, - (const bstring *)&be_const_str_TCP_RX, - (const bstring *)&be_const_str_HPMA_TX, - (const bstring *)&be_const_str_TCP_TX, - (const bstring *)&be_const_str_remove_rule, + (const bstring *)&be_const_str_ADE7953_IRQ, + (const bstring *)&be_const_str_SSPI_MISO, (const bstring *)&be_const_str_KEY1_TC, - (const bstring *)&be_const_str_lv_cont, - NULL, - (const bstring *)&be_const_str_every_100ms, + (const bstring *)&be_const_str_ADC_BUTTON, + (const bstring *)&be_const_str_SM16716_DAT, + (const bstring *)&be_const_str_CSE7761_TX, + (const bstring *)&be_const_str_lv_tileview, + (const bstring *)&be_const_str_EPAPER29_CS, + (const bstring *)&be_const_str_opt_connect, + (const bstring *)&be_const_str_, + (const bstring *)&be_const_str_ELECTRIQ_MOODL_TX, + (const bstring *)&be_const_str_KEY1_INV, + (const bstring *)&be_const_str_add_cmd, + (const bstring *)&be_const_str_OLED_RESET, + (const bstring *)&be_const_str_HRE_CLOCK, + (const bstring *)&be_const_str_LED1_INV, + (const bstring *)&be_const_str_ADC_INPUT, + (const bstring *)&be_const_str_GCM, + (const bstring *)&be_const_str_LOW, + (const bstring *)&be_const_str_HRXL_RX, + (const bstring *)&be_const_str_SYMBOL_EYE_CLOSE, + (const bstring *)&be_const_str_AudioFileSource, + (const bstring *)&be_const_str_attrdump, + (const bstring *)&be_const_str_I2S_IN_DATA, (const bstring *)&be_const_str_CSE7766_TX, (const bstring *)&be_const_str_SM2135_DAT, - (const bstring *)&be_const_str_input, - (const bstring *)&be_const_str_IRRECV, - (const bstring *)&be_const_str_MGC3130_RESET, - (const bstring *)&be_const_str_resp_cmnd_failed, - (const bstring *)&be_const_str_ADC_RANGE, - (const bstring *)&be_const_str_PZEM0XX_TX, - (const bstring *)&be_const_str_LEDLNK_INV, - (const bstring *)&be_const_str__end_transmission, - (const bstring *)&be_const_str_get, - (const bstring *)&be_const_str_SPI_MISO, + (const bstring *)&be_const_str_get_option, + (const bstring *)&be_const_str_WEBCAM_HREF, + (const bstring *)&be_const_str_IEM3000_TX, + (const bstring *)&be_const_str_IRSEND, + (const bstring *)&be_const_str_WE517_TX, + (const bstring *)&be_const_str_I2C_SCL, + (const bstring *)&be_const_str_WEBCAM_PWDN, + (const bstring *)&be_const_str_NRG_SEL, NULL, - (const bstring *)&be_const_str_format, - (const bstring *)&be_const_str_MAX7219DIN, - (const bstring *)&be_const_str_HM10_RX, - (const bstring *)&be_const_str_getbits, + (const bstring *)&be_const_str_MD5, + (const bstring *)&be_const_str_add_rule, + (const bstring *)&be_const_str_WE517_RX, NULL, - (const bstring *)&be_const_str_A4988_MS1, - NULL, - NULL, - (const bstring *)&be_const_str_NRF24_CS, - (const bstring *)&be_const_str_SSD1331_DC, - (const bstring *)&be_const_str_PMS5003_TX, - (const bstring *)&be_const_str_exec_cmd, - (const bstring *)&be_const_str_HLW_CF, - (const bstring *)&be_const_str_SYMBOL_DIRECTORY, - (const bstring *)&be_const_str_ST7789_CS, - (const bstring *)&be_const_str_SYMBOL_BATTERY_FULL, - (const bstring *)&be_const_str_log10, - (const bstring *)&be_const_str_TXD, - (const bstring *)&be_const_str_SYMBOL_EYE_OPEN, - (const bstring *)&be_const_str_EXS_ENABLE, - (const bstring *)&be_const_str_PROJECTOR_CTRL_RX, - (const bstring *)&be_const_str_SBR_TX, - (const bstring *)&be_const_str_MAX31855DO, - (const bstring *)&be_const_str_byte, - (const bstring *)&be_const_str_write, - NULL, - (const bstring *)&be_const_str_GPS_TX, - (const bstring *)&be_const_str_ELECTRIQ_MOODL_TX, - (const bstring *)&be_const_str_lv_switch, - (const bstring *)&be_const_str_SAIR_RX, - (const bstring *)&be_const_str_SSPI_MAX31865_CS1, + (const bstring *)&be_const_str_SYMBOL_CALL, + (const bstring *)&be_const_str_SYMBOL_PLUS, (const bstring *)&be_const_str_DHT22, - (const bstring *)&be_const_str_deinit, - NULL, - (const bstring *)&be_const_str_SYMBOL_FILE, - (const bstring *)&be_const_str_ROT1A_NP, - (const bstring *)&be_const_str_IEM3000_RX, - NULL, - (const bstring *)&be_const_str_has_arg, - (const bstring *)&be_const_str_SSPI_MOSI, - (const bstring *)&be_const_str_CSE7761_TX, - (const bstring *)&be_const_str_LMT01, - (const bstring *)&be_const_str_PN532_RXD, - (const bstring *)&be_const_str_INPUT_PULLDOWN, - (const bstring *)&be_const_str_CSE7761_RX, - (const bstring *)&be_const_str_NRG_SEL_INV, - NULL, - (const bstring *)&be_const_str_ILI9488_CS, - (const bstring *)&be_const_str_opt_call, - NULL, - (const bstring *)&be_const_str_SHELLY_DIMMER_BOOT0, + (const bstring *)&be_const_str_ST7789_CS, (const bstring *)&be_const_str_LED1, - (const bstring *)&be_const_str_INPUT_PULLUP, + (const bstring *)&be_const_str_floor, (const bstring *)&be_const_str_MAX31855CLK, - (const bstring *)&be_const_str_SYMBOL_GPS, + NULL, + NULL, + (const bstring *)&be_const_str_lv_point, + (const bstring *)&be_const_str_read24, + (const bstring *)&be_const_str_AudioGenerator, + NULL, + (const bstring *)&be_const_str_ILI9341_DC, + NULL, + (const bstring *)&be_const_str_WEBCAM_DATA, + (const bstring *)&be_const_str_content_button, + (const bstring *)&be_const_str_EXS_ENABLE, + (const bstring *)&be_const_str_lv_style, + NULL, + NULL, + (const bstring *)&be_const_str_LMT01, + NULL, + (const bstring *)&be_const_str_members, + (const bstring *)&be_const_str_ADC_TEMP, + NULL, + (const bstring *)&be_const_str_HJL_CF, + (const bstring *)&be_const_str_SAIR_RX, + (const bstring *)&be_const_str_HX711_SCK, + (const bstring *)&be_const_str_SDM630_TX, + (const bstring *)&be_const_str_A4988_MS1, + (const bstring *)&be_const_str_SR04_ECHO, + (const bstring *)&be_const_str_lv_draw_rect_dsc, + (const bstring *)&be_const_str_FALLING, + NULL, + NULL, + (const bstring *)&be_const_str_MCP39F5_RX, + (const bstring *)&be_const_str_RDM6300_RX, + (const bstring *)&be_const_str_AZ_RXD, + NULL, + (const bstring *)&be_const_str_AS608_RX, + (const bstring *)&be_const_str_SYMBOL_VOLUME_MID, + NULL, + (const bstring *)&be_const_str_lv_arc, + (const bstring *)&be_const_str_DSB_OUT, + (const bstring *)&be_const_str_BS814_CLK, + (const bstring *)&be_const_str_HM10_TX, + (const bstring *)&be_const_str_SM16716_CLK, + (const bstring *)&be_const_str_lv_group, + (const bstring *)&be_const_str_opt_eq, + (const bstring *)&be_const_str_INPUT_PULLDOWN, + (const bstring *)&be_const_str_REL1, + (const bstring *)&be_const_str_dump, + (const bstring *)&be_const_str_MAX7219DIN, + (const bstring *)&be_const_str_CC1101_GDO2, + (const bstring *)&be_const_str_KEY1_INV_NP, + (const bstring *)&be_const_str_SYMBOL_EJECT, + (const bstring *)&be_const_str_top, + (const bstring *)&be_const_str_SPI_MOSI, + (const bstring *)&be_const_str_BUZZER_INV, + (const bstring *)&be_const_str_real, + (const bstring *)&be_const_str_I2S_OUT_CLK, + (const bstring *)&be_const_str_SYMBOL_DUMMY, + (const bstring *)&be_const_str__request_from, + (const bstring *)&be_const_str___lower__, + NULL, + NULL, + (const bstring *)&be_const_str_AudioGeneratorWAV, + (const bstring *)&be_const_str_HPMA_TX, + (const bstring *)&be_const_str_SYMBOL_PLAY, + NULL, + (const bstring *)&be_const_str_lv_draw_mask_map_param_cfg, + (const bstring *)&be_const_str_ADC_RANGE, + (const bstring *)&be_const_str_INTERRUPT, + NULL, + (const bstring *)&be_const_str_opt_neq, + (const bstring *)&be_const_str_EPD_DATA, + (const bstring *)&be_const_str_SWT1_PD, + (const bstring *)&be_const_str_lv_roller, + NULL, + (const bstring *)&be_const_str_log, + (const bstring *)&be_const_str_HM10_RX, + (const bstring *)&be_const_str_I2C_Driver, + (const bstring *)&be_const_str_MIEL_HVAC_TX, + (const bstring *)&be_const_str_imax, + (const bstring *)&be_const_str_EPAPER42_CS, + (const bstring *)&be_const_str_SYMBOL_EDIT, + (const bstring *)&be_const_str_A4988_DIR, + (const bstring *)&be_const_str_ADC_CT_POWER, + NULL, + (const bstring *)&be_const_str_RFSEND, + (const bstring *)&be_const_str_SYMBOL_PAUSE, + (const bstring *)&be_const_str_BOILER_OT_TX, + (const bstring *)&be_const_str_ARIRFRCV, + (const bstring *)&be_const_str_TFMINIPLUS_RX, + (const bstring *)&be_const_str_DDSU666_RX, + (const bstring *)&be_const_str_lv_draw_label_dsc, + (const bstring *)&be_const_str_remove_rule, (const bstring *)&be_const_str_SWT1_NP, + (const bstring *)&be_const_str_lv_draw_mask_line_param_cfg, + (const bstring *)&be_const_str_HLW_CF, + (const bstring *)&be_const_str_classof, + (const bstring *)&be_const_str_LE01MR_TX, + NULL, + NULL, + (const bstring *)&be_const_str_rtc, + NULL, + (const bstring *)&be_const_str__ccmd, + (const bstring *)&be_const_str_dot_p, + NULL, + (const bstring *)&be_const_str_bus, + NULL, + (const bstring *)&be_const_str_SDS0X1_TX, + (const bstring *)&be_const_str_SDM72_TX, + (const bstring *)&be_const_str_AS3935, + NULL, + (const bstring *)&be_const_str_BS814_DAT, + (const bstring *)&be_const_str_OUTPUT_LO, + (const bstring *)&be_const_str_lv_draw_mask_fade_param, + (const bstring *)&be_const_str_SYMBOL_HOME, + (const bstring *)&be_const_str_WEBCAM_VSYNC, + (const bstring *)&be_const_str_HALLEFFECT, + (const bstring *)&be_const_str_OPEN_DRAIN, + (const bstring *)&be_const_str_A4988_STP, + (const bstring *)&be_const_str_SYMBOL_SAVE, + NULL, + (const bstring *)&be_const_str_lv_cont, + (const bstring *)&be_const_str_ARIRFSEL, + (const bstring *)&be_const_str_ETH_PHY_POWER, + (const bstring *)&be_const_str_KEY1, + (const bstring *)&be_const_str_SYMBOL_CHARGE, + NULL, + (const bstring *)&be_const_str_SYMBOL_VIDEO, + NULL, + (const bstring *)&be_const_str_acos, + (const bstring *)&be_const_str_SYMBOL_CLOSE, + (const bstring *)&be_const_str_SSPI_MOSI, + (const bstring *)&be_const_str_FTC532, + (const bstring *)&be_const_str_SPI_CLK, + (const bstring *)&be_const_str_ceil, + NULL, + (const bstring *)&be_const_str_IRRECV, + (const bstring *)&be_const_str_RA8876_CS, + (const bstring *)&be_const_str_TM1638DIO, + (const bstring *)&be_const_str_PROJECTOR_CTRL_RX, + (const bstring *)&be_const_str_SAIR_TX, + NULL, + (const bstring *)&be_const_str_SYMBOL_MINUS, + (const bstring *)&be_const_str_clear, + (const bstring *)&be_const_str_SYMBOL_FILE, + (const bstring *)&be_const_str_RFRECV, + (const bstring *)&be_const_str_calldepth, + (const bstring *)&be_const_str_SDM120_RX, + (const bstring *)&be_const_str_exec_cmd, + (const bstring *)&be_const_str_RF_SENSOR, + (const bstring *)&be_const_str_LEDLNK_INV, + (const bstring *)&be_const_str_dot_p2, + (const bstring *)&be_const_str_HRE_DATA, + (const bstring *)&be_const_str_ADC_PH, + (const bstring *)&be_const_str_SDM120_TX, + (const bstring *)&be_const_str_IEM3000_RX, + (const bstring *)&be_const_str_get_power, (const bstring *)&be_const_str_dot_def, (const bstring *)&be_const_str_DHT11, - (const bstring *)&be_const_str_ETH_PHY_POWER, - (const bstring *)&be_const_str_TFMINIPLUS_TX, - (const bstring *)&be_const_str_EPAPER29_CS, - (const bstring *)&be_const_str_event, - (const bstring *)&be_const_str_ADC_JOY, - (const bstring *)&be_const_str_CSE7766_RX, - (const bstring *)&be_const_str_IRSEND, - (const bstring *)&be_const_str_RFSEND, - (const bstring *)&be_const_str_TX2X_TXD_BLACK, - (const bstring *)&be_const_str_TUYA_RX, - NULL, - (const bstring *)&be_const_str_HRE_DATA, - (const bstring *)&be_const_str_DDSU666_RX, - (const bstring *)&be_const_str_SM16716_SEL, - (const bstring *)&be_const_str_ADC_BUTTON_INV, - (const bstring *)&be_const_str_MP3_DFR562, - (const bstring *)&be_const_str_rad, - (const bstring *)&be_const_str_ARIRFSEL, - (const bstring *)&be_const_str_lv_group_focus_cb, - (const bstring *)&be_const_str_SENSOR_END, - (const bstring *)&be_const_str_codedump, - (const bstring *)&be_const_str_CNTR1, - (const bstring *)&be_const_str_DDS2382_TX, - (const bstring *)&be_const_str_SSPI_MISO, - (const bstring *)&be_const_str_pop, - (const bstring *)&be_const_str_SDCARD_CS, - (const bstring *)&be_const_str_I2C_Driver, - (const bstring *)&be_const_str_BOILER_OT_TX, - NULL, - (const bstring *)&be_const_str_CHANGE, - (const bstring *)&be_const_str_lv_draw_rect_dsc, - (const bstring *)&be_const_str_ST7789_DC, - (const bstring *)&be_const_str_var, - (const bstring *)&be_const_str_MCP39F5_TX, - (const bstring *)&be_const_str_AS608_TX, - (const bstring *)&be_const_str_get_free_heap, - NULL, - (const bstring *)&be_const_str_KEY1, - NULL, - (const bstring *)&be_const_str_BUZZER_INV, - (const bstring *)&be_const_str_lv_roller, - (const bstring *)&be_const_str_ADC_CT_POWER, - (const bstring *)&be_const_str_asstring, - (const bstring *)&be_const_str_NONE, - (const bstring *)&be_const_str_exp, - (const bstring *)&be_const_str_BL0940_RX, - (const bstring *)&be_const_str_check_privileged_access, - (const bstring *)&be_const_str_opt_eq, - (const bstring *)&be_const_str_PULLDOWN, - (const bstring *)&be_const_str_, - (const bstring *)&be_const_str_SYMBOL_LOOP, - (const bstring *)&be_const_str_MHZ_RXD, - (const bstring *)&be_const_str_BACKLIGHT, - NULL, - NULL, - (const bstring *)&be_const_str_PULLUP, - (const bstring *)&be_const_str_SR04_ECHO, - NULL, - (const bstring *)&be_const_str_ADE7953_IRQ, - (const bstring *)&be_const_str_SYMBOL_PREV, - (const bstring *)&be_const_str_HX711_DAT, - (const bstring *)&be_const_str_dot_p, - (const bstring *)&be_const_str_GPS_RX, - (const bstring *)&be_const_str_AZ_RXD, - (const bstring *)&be_const_str_Tasmota, - (const bstring *)&be_const_str_srand, - NULL, - (const bstring *)&be_const_str_LOW, - (const bstring *)&be_const_str_DDS2382_RX, - (const bstring *)&be_const_str_SDM120_RX, - (const bstring *)&be_const_str_wire_scan, - (const bstring *)&be_const_str_SBR_RX, (const bstring *)&be_const_str_PWM1_INV, - (const bstring *)&be_const_str_ETH_PHY_MDC, - (const bstring *)&be_const_str_run_deferred, - (const bstring *)&be_const_str_SYMBOL_REFRESH, - (const bstring *)&be_const_str_TASMOTACLIENT_RXD, - NULL, - (const bstring *)&be_const_str_PROJECTOR_CTRL_TX, - (const bstring *)&be_const_str_SYMBOL_VOLUME_MAX, - (const bstring *)&be_const_str_MAX7219CLK, - (const bstring *)&be_const_str_WEBCAM_PCLK, - (const bstring *)&be_const_str_try, - (const bstring *)&be_const_str_EPD_DATA, - (const bstring *)&be_const_str_ADC_PH, - NULL, - NULL, - (const bstring *)&be_const_str_IBEACON_TX, - NULL, - (const bstring *)&be_const_str_OLED_RESET, - (const bstring *)&be_const_str_scan, - (const bstring *)&be_const_str_SDS0X1_RX, - (const bstring *)&be_const_str_AS608_RX, - (const bstring *)&be_const_str_opt_connect, - (const bstring *)&be_const_str__timers, - (const bstring *)&be_const_str_lv_draw_img_dsc, - NULL, - (const bstring *)&be_const_str_HIGH, - (const bstring *)&be_const_str_DSB, - NULL, - (const bstring *)&be_const_str_ARIRFRCV, - (const bstring *)&be_const_str_NRF24_DC, - (const bstring *)&be_const_str_SYMBOL_STOP, - (const bstring *)&be_const_str_A4988_STP, - (const bstring *)&be_const_str_WEBCAM_PSRCS, - NULL, - (const bstring *)&be_const_str_OUTPUT_LO, - (const bstring *)&be_const_str_push, - (const bstring *)&be_const_str_cos, - (const bstring *)&be_const_str_set_timer, - (const bstring *)&be_const_str_DEEPSLEEP, - (const bstring *)&be_const_str_SDM630_RX, - (const bstring *)&be_const_str_DI, - (const bstring *)&be_const_str_INPUT, - (const bstring *)&be_const_str_SYMBOL_SD_CARD, - (const bstring *)&be_const_str_CC1101_GDO2, - (const bstring *)&be_const_str_copy, - (const bstring *)&be_const_str_SR04_TRIG, - NULL, - (const bstring *)&be_const_str_HALLEFFECT, - (const bstring *)&be_const_str_imin, - (const bstring *)&be_const_str_SYMBOL_VIDEO, - (const bstring *)&be_const_str_SYMBOL_LIST, - (const bstring *)&be_const_str_AZ_TXD, - (const bstring *)&be_const_str_end, - (const bstring *)&be_const_str_SYMBOL_BATTERY_EMPTY, - (const bstring *)&be_const_str_for, (const bstring *)&be_const_str_BUZZER, - (const bstring *)&be_const_str_SSPI_SCLK, - (const bstring *)&be_const_str_issubclass, - (const bstring *)&be_const_str_WEBCAM_HREF, - (const bstring *)&be_const_str_Driver, - (const bstring *)&be_const_str_OPTION_A, - (const bstring *)&be_const_str_IBEACON_RX, - (const bstring *)&be_const_str_HM10_TX, - (const bstring *)&be_const_str_BOILER_OT_RX, - (const bstring *)&be_const_str_item, - (const bstring *)&be_const_str_SDS0X1_TX, - (const bstring *)&be_const_str_OPEN_DRAIN, - (const bstring *)&be_const_str__rules, - (const bstring *)&be_const_str_insert, - (const bstring *)&be_const_str_web_add_config_button, - (const bstring *)&be_const_str_SYMBOL_BULLET, + (const bstring *)&be_const_str_WEBCAM_SIOD, + (const bstring *)&be_const_str_SYMBOL_RIGHT, + (const bstring *)&be_const_str_DI, + (const bstring *)&be_const_str_SYMBOL_GPS, + (const bstring *)&be_const_str_gen_cb, + NULL, + (const bstring *)&be_const_str_MAX7219CLK, + (const bstring *)&be_const_str_loop, + NULL, + (const bstring *)&be_const_str_DEEPSLEEP, + (const bstring *)&be_const_str_MCP39F5_RST, + (const bstring *)&be_const_str_ROT1A_NP, + (const bstring *)&be_const_str_PZEM017_RX, + (const bstring *)&be_const_str_HX711_DAT, + (const bstring *)&be_const_str_MGC3130_XFER, + (const bstring *)&be_const_str_GPS_RX, + (const bstring *)&be_const_str_lv_list, + (const bstring *)&be_const_str_AudioOutputI2S, + (const bstring *)&be_const_str_WEBCAM_RESET, + (const bstring *)&be_const_str_TELEINFO_ENABLE, + (const bstring *)&be_const_str_ADC_JOY, + (const bstring *)&be_const_str___upper__, + (const bstring *)&be_const_str_AZ_TXD, + (const bstring *)&be_const_str__drivers, + (const bstring *)&be_const_str_opt_call, + (const bstring *)&be_const_str_CC1101_GDO0, + (const bstring *)&be_const_str_AudioGeneratorMP3, + (const bstring *)&be_const_str_PZEM004_RX, + (const bstring *)&be_const_str_geti, + (const bstring *)&be_const_str_eth, + NULL, + (const bstring *)&be_const_str___iterator__, + (const bstring *)&be_const_str_NONE, + (const bstring *)&be_const_str_SOLAXX1_TX, + (const bstring *)&be_const_str_arg, + (const bstring *)&be_const_str_tan, + (const bstring *)&be_const_str_NRF24_DC, + (const bstring *)&be_const_str_event, + (const bstring *)&be_const_str_WEBCAM_XCLK, + (const bstring *)&be_const_str_ADC_BUTTON_INV, + (const bstring *)&be_const_str_MCP39F5_TX, + NULL, + (const bstring *)&be_const_str_SSPI_MAX31865_CS1, + (const bstring *)&be_const_str_for, + (const bstring *)&be_const_str__available, + (const bstring *)&be_const_str_return, + (const bstring *)&be_const_str_compile, + (const bstring *)&be_const_str_NRF24_CS, + (const bstring *)&be_const_str_SYMBOL_LIST, + (const bstring *)&be_const_str_true, + (const bstring *)&be_const_str_A4988_ENA, + (const bstring *)&be_const_str_ETH_PHY_MDIO, + (const bstring *)&be_const_str_RISING, + (const bstring *)&be_const_str_rand, + (const bstring *)&be_const_str_Wire, + NULL, + (const bstring *)&be_const_str_CSE7761_RX, + (const bstring *)&be_const_str_CSE7766_RX, + (const bstring *)&be_const_str_PZEM016_RX, + (const bstring *)&be_const_str_SI7021, (const bstring *)&be_const_str_SYMBOL_UPLOAD, - (const bstring *)&be_const_str_lv_draw_mask_common_dsc, - (const bstring *)&be_const_str_LE01MR_RX, - (const bstring *)&be_const_str_web_add_main_button, - (const bstring *)&be_const_str_floor, - (const bstring *)&be_const_str_DCKI, - (const bstring *)&be_const_str_ILI9341_CS + NULL, + NULL, + (const bstring *)&be_const_str_I2S_IN_CLK, + (const bstring *)&be_const_str_OUTPUT_OPEN_DRAIN, + (const bstring *)&be_const_str_SYMBOL_BELL, + (const bstring *)&be_const_str_SYMBOL_BATTERY_1, + (const bstring *)&be_const_str_atan, + (const bstring *)&be_const_str_opt_add, + (const bstring *)&be_const_str_REL1_INV, + NULL, + (const bstring *)&be_const_str_Tasmota, + NULL, + (const bstring *)&be_const_str_DDSU666_TX, + (const bstring *)&be_const_str_PWM1, + (const bstring *)&be_const_str_DDS2382_RX, + (const bstring *)&be_const_str_RC522_RST, + (const bstring *)&be_const_str_AS608_TX, + NULL, + (const bstring *)&be_const_str_dot_p1, + (const bstring *)&be_const_str_ADC_LIGHT, + (const bstring *)&be_const_str_digital_read, + (const bstring *)&be_const_str_DHT11_OUT, + (const bstring *)&be_const_str_PMS5003_RX, + (const bstring *)&be_const_str_LEDLNK, + (const bstring *)&be_const_str_IBEACON_TX, + (const bstring *)&be_const_str_SYMBOL_WIFI, + (const bstring *)&be_const_str_PZEM0XX_TX, + (const bstring *)&be_const_str_KEY1_PD, + (const bstring *)&be_const_str_reverse, + (const bstring *)&be_const_str_PN532_RXD, + (const bstring *)&be_const_str_false, + (const bstring *)&be_const_str_TCP_TX, + (const bstring *)&be_const_str_DYP_RX, + NULL, + NULL, + (const bstring *)&be_const_str_AudioFileSourceFS, + (const bstring *)&be_const_str_BL0940_RX, + (const bstring *)&be_const_str__read, + (const bstring *)&be_const_str_CHANGE, + (const bstring *)&be_const_str_lv_canvas, + (const bstring *)&be_const_str_CNTR1_NP, + (const bstring *)&be_const_str_NRG_SEL_INV }; static const struct bconststrtab m_const_string_table = { - .size = 306, - .count = 613, + .size = 315, + .count = 630, .table = m_string_table }; diff --git a/lib/libesp32/Berry/generate/be_fixed_be_class_aes_gcm.h b/lib/libesp32/Berry/generate/be_fixed_be_class_aes_gcm.h new file mode 100644 index 000000000..593696b3f --- /dev/null +++ b/lib/libesp32/Berry/generate/be_fixed_be_class_aes_gcm.h @@ -0,0 +1,22 @@ +#include "be_constobj.h" + +static be_define_const_map_slots(be_class_aes_gcm_map) { + { be_const_key(encrypt, 4), be_const_func(m_aes_gcm_encryt) }, + { be_const_key(dot_p2, -1), be_const_index(0) }, + { be_const_key(decrypt, -1), be_const_func(m_aes_gcm_decryt) }, + { be_const_key(init, -1), be_const_func(m_aes_gcm_init) }, + { be_const_key(dot_p1, -1), be_const_index(1) }, + { be_const_key(tag, -1), be_const_func(m_aes_gcm_tag) }, +}; + +static be_define_const_map( + be_class_aes_gcm_map, + 6 +); + +BE_EXPORT_VARIABLE be_define_const_class( + be_class_aes_gcm, + 2, + NULL, + GCM +); diff --git a/lib/libesp32/Berry/generate/be_fixed_be_class_audio_file_source.h b/lib/libesp32/Berry/generate/be_fixed_be_class_audio_file_source.h new file mode 100644 index 000000000..c862ef474 --- /dev/null +++ b/lib/libesp32/Berry/generate/be_fixed_be_class_audio_file_source.h @@ -0,0 +1,17 @@ +#include "be_constobj.h" + +static be_define_const_map_slots(be_class_audio_file_source_map) { + { be_const_key(dot_p, -1), be_const_index(0) }, +}; + +static be_define_const_map( + be_class_audio_file_source_map, + 1 +); + +BE_EXPORT_VARIABLE be_define_const_class( + be_class_audio_file_source, + 1, + NULL, + AudioFileSource +); diff --git a/lib/libesp32/Berry/generate/be_fixed_be_class_audio_file_source_fs.h b/lib/libesp32/Berry/generate/be_fixed_be_class_audio_file_source_fs.h new file mode 100644 index 000000000..6605ba27e --- /dev/null +++ b/lib/libesp32/Berry/generate/be_fixed_be_class_audio_file_source_fs.h @@ -0,0 +1,18 @@ +#include "be_constobj.h" + +static be_define_const_map_slots(be_class_audio_file_source_fs_map) { + { be_const_key(deinit, -1), be_const_func(i2s_file_source_fs_deinit) }, + { be_const_key(init, -1), be_const_func(i2s_file_source_fs_init) }, +}; + +static be_define_const_map( + be_class_audio_file_source_fs_map, + 2 +); + +BE_EXPORT_VARIABLE be_define_const_class( + be_class_audio_file_source_fs, + 0, + (bclass *)&be_class_audio_file_source, + AudioFileSourceFS +); diff --git a/lib/libesp32/Berry/generate/be_fixed_be_class_audio_generator.h b/lib/libesp32/Berry/generate/be_fixed_be_class_audio_generator.h new file mode 100644 index 000000000..d6c5c9a6a --- /dev/null +++ b/lib/libesp32/Berry/generate/be_fixed_be_class_audio_generator.h @@ -0,0 +1,17 @@ +#include "be_constobj.h" + +static be_define_const_map_slots(be_class_audio_generator_map) { + { be_const_key(dot_p, -1), be_const_index(0) }, +}; + +static be_define_const_map( + be_class_audio_generator_map, + 1 +); + +BE_EXPORT_VARIABLE be_define_const_class( + be_class_audio_generator, + 1, + NULL, + AudioGenerator +); diff --git a/lib/libesp32/Berry/generate/be_fixed_be_class_audio_generator_mp3.h b/lib/libesp32/Berry/generate/be_fixed_be_class_audio_generator_mp3.h new file mode 100644 index 000000000..dbe5f0d4f --- /dev/null +++ b/lib/libesp32/Berry/generate/be_fixed_be_class_audio_generator_mp3.h @@ -0,0 +1,22 @@ +#include "be_constobj.h" + +static be_define_const_map_slots(be_class_audio_generator_mp3_map) { + { be_const_key(begin, -1), be_const_func(i2s_generator_mp3_begin) }, + { be_const_key(loop, -1), be_const_func(i2s_generator_mp3_loop) }, + { be_const_key(isrunning, -1), be_const_func(i2s_generator_mp3_isrunning) }, + { be_const_key(init, 1), be_const_func(i2s_generator_mp3_init) }, + { be_const_key(deinit, -1), be_const_func(i2s_generator_mp3_deinit) }, + { be_const_key(stop, -1), be_const_func(i2s_generator_mp3_stop) }, +}; + +static be_define_const_map( + be_class_audio_generator_mp3_map, + 6 +); + +BE_EXPORT_VARIABLE be_define_const_class( + be_class_audio_generator_mp3, + 0, + (bclass *)&be_class_audio_generator, + AudioGeneratorMP3 +); diff --git a/lib/libesp32/Berry/generate/be_fixed_be_class_audio_generator_wav.h b/lib/libesp32/Berry/generate/be_fixed_be_class_audio_generator_wav.h new file mode 100644 index 000000000..f08522407 --- /dev/null +++ b/lib/libesp32/Berry/generate/be_fixed_be_class_audio_generator_wav.h @@ -0,0 +1,22 @@ +#include "be_constobj.h" + +static be_define_const_map_slots(be_class_audio_generator_wav_map) { + { be_const_key(begin, -1), be_const_func(i2s_generator_wav_begin) }, + { be_const_key(loop, -1), be_const_func(i2s_generator_wav_loop) }, + { be_const_key(isrunning, -1), be_const_func(i2s_generator_wav_isrunning) }, + { be_const_key(init, 1), be_const_func(i2s_generator_wav_init) }, + { be_const_key(deinit, -1), be_const_func(i2s_generator_wav_deinit) }, + { be_const_key(stop, -1), be_const_func(i2s_generator_wav_stop) }, +}; + +static be_define_const_map( + be_class_audio_generator_wav_map, + 6 +); + +BE_EXPORT_VARIABLE be_define_const_class( + be_class_audio_generator_wav, + 0, + (bclass *)&be_class_audio_generator, + AudioGeneratorWAV +); diff --git a/lib/libesp32/Berry/generate/be_fixed_be_class_audio_output.h b/lib/libesp32/Berry/generate/be_fixed_be_class_audio_output.h new file mode 100644 index 000000000..cb9c6282d --- /dev/null +++ b/lib/libesp32/Berry/generate/be_fixed_be_class_audio_output.h @@ -0,0 +1,17 @@ +#include "be_constobj.h" + +static be_define_const_map_slots(be_class_audio_output_map) { + { be_const_key(dot_p, -1), be_const_index(0) }, +}; + +static be_define_const_map( + be_class_audio_output_map, + 1 +); + +BE_EXPORT_VARIABLE be_define_const_class( + be_class_audio_output, + 1, + NULL, + AudioOutput +); diff --git a/lib/libesp32/Berry/generate/be_fixed_be_class_audio_output_i2s.h b/lib/libesp32/Berry/generate/be_fixed_be_class_audio_output_i2s.h new file mode 100644 index 000000000..4e6b84e0d --- /dev/null +++ b/lib/libesp32/Berry/generate/be_fixed_be_class_audio_output_i2s.h @@ -0,0 +1,19 @@ +#include "be_constobj.h" + +static be_define_const_map_slots(be_class_audio_output_i2s_map) { + { be_const_key(init, -1), be_const_func(i2s_output_i2s_init) }, + { be_const_key(deinit, -1), be_const_func(i2s_output_i2s_deinit) }, + { be_const_key(stop, -1), be_const_func(i2s_output_i2s_stop) }, +}; + +static be_define_const_map( + be_class_audio_output_i2s_map, + 3 +); + +BE_EXPORT_VARIABLE be_define_const_class( + be_class_audio_output_i2s, + 0, + (bclass *)&be_class_audio_output, + AudioOutputI2S +); diff --git a/lib/libesp32/Berry/generate/be_fixed_be_class_bytes.h b/lib/libesp32/Berry/generate/be_fixed_be_class_bytes.h index 968d964fd..1ce30aa49 100644 --- a/lib/libesp32/Berry/generate/be_fixed_be_class_bytes.h +++ b/lib/libesp32/Berry/generate/be_fixed_be_class_bytes.h @@ -7,7 +7,7 @@ static be_define_const_map_slots(be_class_bytes_map) { { be_const_key(seti, -1), be_const_func(m_set) }, { be_const_key(setitem, -1), be_const_func(m_setitem) }, { be_const_key(item, 18), be_const_func(m_item) }, - { be_const_key(dot_p, 3), be_const_int(0) }, + { be_const_key(dot_p, 3), be_const_index(0) }, { be_const_key(geti, -1), be_const_func(m_geti) }, { be_const_key(opt_connect, -1), be_const_func(m_connect) }, { be_const_key(tostring, -1), be_const_func(m_tostring) }, diff --git a/lib/libesp32/Berry/generate/be_fixed_be_class_list.h b/lib/libesp32/Berry/generate/be_fixed_be_class_list.h index 98a52b494..6d94eb931 100644 --- a/lib/libesp32/Berry/generate/be_fixed_be_class_list.h +++ b/lib/libesp32/Berry/generate/be_fixed_be_class_list.h @@ -14,7 +14,7 @@ static be_define_const_map_slots(be_class_list_map) { { be_const_key(tostring, 3), be_const_func(m_tostring) }, { be_const_key(opt_eq, -1), be_const_func(m_equal) }, { be_const_key(init, -1), be_const_func(m_init) }, - { be_const_key(dot_p, 17), be_const_int(0) }, + { be_const_key(dot_p, 17), be_const_index(0) }, { be_const_key(setitem, -1), be_const_func(m_setitem) }, { be_const_key(opt_connect, 4), be_const_func(m_connect) }, { be_const_key(opt_neq, -1), be_const_func(m_nequal) }, diff --git a/lib/libesp32/Berry/generate/be_fixed_be_class_lv_arc.h b/lib/libesp32/Berry/generate/be_fixed_be_class_lv_arc.h index dfa8110f5..df2ec5f5f 100644 --- a/lib/libesp32/Berry/generate/be_fixed_be_class_lv_arc.h +++ b/lib/libesp32/Berry/generate/be_fixed_be_class_lv_arc.h @@ -3,7 +3,7 @@ static be_define_const_map_slots(be_class_lv_arc_map) { { be_const_key(init, 2), be_const_func(lvbe_arc_create) }, { be_const_key(tostring, -1), be_const_func(lvx_tostring) }, - { be_const_key(dot_p, -1), be_const_int(0) }, + { be_const_key(dot_p, -1), be_const_index(0) }, { be_const_key(member, 0), be_const_func(lvx_member) }, }; diff --git a/lib/libesp32/Berry/generate/be_fixed_be_class_lv_bar.h b/lib/libesp32/Berry/generate/be_fixed_be_class_lv_bar.h index 2d4336f44..0d178107a 100644 --- a/lib/libesp32/Berry/generate/be_fixed_be_class_lv_bar.h +++ b/lib/libesp32/Berry/generate/be_fixed_be_class_lv_bar.h @@ -3,7 +3,7 @@ static be_define_const_map_slots(be_class_lv_bar_map) { { be_const_key(init, 2), be_const_func(lvbe_bar_create) }, { be_const_key(tostring, -1), be_const_func(lvx_tostring) }, - { be_const_key(dot_p, -1), be_const_int(0) }, + { be_const_key(dot_p, -1), be_const_index(0) }, { be_const_key(member, 0), be_const_func(lvx_member) }, }; diff --git a/lib/libesp32/Berry/generate/be_fixed_be_class_lv_btn.h b/lib/libesp32/Berry/generate/be_fixed_be_class_lv_btn.h index cf8d80833..e11d63c37 100644 --- a/lib/libesp32/Berry/generate/be_fixed_be_class_lv_btn.h +++ b/lib/libesp32/Berry/generate/be_fixed_be_class_lv_btn.h @@ -3,7 +3,7 @@ static be_define_const_map_slots(be_class_lv_btn_map) { { be_const_key(init, 2), be_const_func(lvbe_btn_create) }, { be_const_key(tostring, -1), be_const_func(lvx_tostring) }, - { be_const_key(dot_p, -1), be_const_int(0) }, + { be_const_key(dot_p, -1), be_const_index(0) }, { be_const_key(member, 0), be_const_func(lvx_member) }, }; diff --git a/lib/libesp32/Berry/generate/be_fixed_be_class_lv_btnmatrix.h b/lib/libesp32/Berry/generate/be_fixed_be_class_lv_btnmatrix.h index ec4dc09e0..eaec83aa4 100644 --- a/lib/libesp32/Berry/generate/be_fixed_be_class_lv_btnmatrix.h +++ b/lib/libesp32/Berry/generate/be_fixed_be_class_lv_btnmatrix.h @@ -3,7 +3,7 @@ static be_define_const_map_slots(be_class_lv_btnmatrix_map) { { be_const_key(init, 2), be_const_func(lvbe_btnmatrix_create) }, { be_const_key(tostring, -1), be_const_func(lvx_tostring) }, - { be_const_key(dot_p, -1), be_const_int(0) }, + { be_const_key(dot_p, -1), be_const_index(0) }, { be_const_key(member, 0), be_const_func(lvx_member) }, }; diff --git a/lib/libesp32/Berry/generate/be_fixed_be_class_lv_calendar.h b/lib/libesp32/Berry/generate/be_fixed_be_class_lv_calendar.h index 593c30b69..7434f5004 100644 --- a/lib/libesp32/Berry/generate/be_fixed_be_class_lv_calendar.h +++ b/lib/libesp32/Berry/generate/be_fixed_be_class_lv_calendar.h @@ -3,7 +3,7 @@ static be_define_const_map_slots(be_class_lv_calendar_map) { { be_const_key(init, 2), be_const_func(lvbe_calendar_create) }, { be_const_key(tostring, -1), be_const_func(lvx_tostring) }, - { be_const_key(dot_p, -1), be_const_int(0) }, + { be_const_key(dot_p, -1), be_const_index(0) }, { be_const_key(member, 0), be_const_func(lvx_member) }, }; diff --git a/lib/libesp32/Berry/generate/be_fixed_be_class_lv_canvas.h b/lib/libesp32/Berry/generate/be_fixed_be_class_lv_canvas.h index 74607f0a4..7c0b03d35 100644 --- a/lib/libesp32/Berry/generate/be_fixed_be_class_lv_canvas.h +++ b/lib/libesp32/Berry/generate/be_fixed_be_class_lv_canvas.h @@ -3,7 +3,7 @@ static be_define_const_map_slots(be_class_lv_canvas_map) { { be_const_key(init, 2), be_const_func(lvbe_canvas_create) }, { be_const_key(tostring, -1), be_const_func(lvx_tostring) }, - { be_const_key(dot_p, -1), be_const_int(0) }, + { be_const_key(dot_p, -1), be_const_index(0) }, { be_const_key(member, 0), be_const_func(lvx_member) }, }; diff --git a/lib/libesp32/Berry/generate/be_fixed_be_class_lv_chart.h b/lib/libesp32/Berry/generate/be_fixed_be_class_lv_chart.h index 0ebc1f578..f71d24f42 100644 --- a/lib/libesp32/Berry/generate/be_fixed_be_class_lv_chart.h +++ b/lib/libesp32/Berry/generate/be_fixed_be_class_lv_chart.h @@ -3,7 +3,7 @@ static be_define_const_map_slots(be_class_lv_chart_map) { { be_const_key(init, 2), be_const_func(lvbe_chart_create) }, { be_const_key(tostring, -1), be_const_func(lvx_tostring) }, - { be_const_key(dot_p, -1), be_const_int(0) }, + { be_const_key(dot_p, -1), be_const_index(0) }, { be_const_key(member, 0), be_const_func(lvx_member) }, }; diff --git a/lib/libesp32/Berry/generate/be_fixed_be_class_lv_checkbox.h b/lib/libesp32/Berry/generate/be_fixed_be_class_lv_checkbox.h index f64be0ded..a73e60029 100644 --- a/lib/libesp32/Berry/generate/be_fixed_be_class_lv_checkbox.h +++ b/lib/libesp32/Berry/generate/be_fixed_be_class_lv_checkbox.h @@ -3,7 +3,7 @@ static be_define_const_map_slots(be_class_lv_checkbox_map) { { be_const_key(init, 2), be_const_func(lvbe_checkbox_create) }, { be_const_key(tostring, -1), be_const_func(lvx_tostring) }, - { be_const_key(dot_p, -1), be_const_int(0) }, + { be_const_key(dot_p, -1), be_const_index(0) }, { be_const_key(member, 0), be_const_func(lvx_member) }, }; diff --git a/lib/libesp32/Berry/generate/be_fixed_be_class_lv_color.h b/lib/libesp32/Berry/generate/be_fixed_be_class_lv_color.h index 252a6d6ab..e688d2573 100644 --- a/lib/libesp32/Berry/generate/be_fixed_be_class_lv_color.h +++ b/lib/libesp32/Berry/generate/be_fixed_be_class_lv_color.h @@ -3,12 +3,13 @@ static be_define_const_map_slots(be_class_lv_color_map) { { be_const_key(init, -1), be_const_func(lco_init) }, { be_const_key(tostring, 2), be_const_func(lco_tostring) }, - { be_const_key(dot_p, -1), be_const_int(0) }, + { be_const_key(toint, -1), be_const_func(lco_toint) }, + { be_const_key(dot_p, 0), be_const_index(0) }, }; static be_define_const_map( be_class_lv_color_map, - 3 + 4 ); BE_EXPORT_VARIABLE be_define_const_class( diff --git a/lib/libesp32/Berry/generate/be_fixed_be_class_lv_cont.h b/lib/libesp32/Berry/generate/be_fixed_be_class_lv_cont.h index 3ab5828ba..69e3e156d 100644 --- a/lib/libesp32/Berry/generate/be_fixed_be_class_lv_cont.h +++ b/lib/libesp32/Berry/generate/be_fixed_be_class_lv_cont.h @@ -3,7 +3,7 @@ static be_define_const_map_slots(be_class_lv_cont_map) { { be_const_key(init, 2), be_const_func(lvbe_cont_create) }, { be_const_key(tostring, -1), be_const_func(lvx_tostring) }, - { be_const_key(dot_p, -1), be_const_int(0) }, + { be_const_key(dot_p, -1), be_const_index(0) }, { be_const_key(member, 0), be_const_func(lvx_member) }, }; diff --git a/lib/libesp32/Berry/generate/be_fixed_be_class_lv_cpicker.h b/lib/libesp32/Berry/generate/be_fixed_be_class_lv_cpicker.h index 5a91a5708..cd1c2af01 100644 --- a/lib/libesp32/Berry/generate/be_fixed_be_class_lv_cpicker.h +++ b/lib/libesp32/Berry/generate/be_fixed_be_class_lv_cpicker.h @@ -3,7 +3,7 @@ static be_define_const_map_slots(be_class_lv_cpicker_map) { { be_const_key(init, 2), be_const_func(lvbe_cpicker_create) }, { be_const_key(tostring, -1), be_const_func(lvx_tostring) }, - { be_const_key(dot_p, -1), be_const_int(0) }, + { be_const_key(dot_p, -1), be_const_index(0) }, { be_const_key(member, 0), be_const_func(lvx_member) }, }; diff --git a/lib/libesp32/Berry/generate/be_fixed_be_class_lv_ctypes.h b/lib/libesp32/Berry/generate/be_fixed_be_class_lv_ctypes.h index 0f4672d54..c81a8a43e 100644 --- a/lib/libesp32/Berry/generate/be_fixed_be_class_lv_ctypes.h +++ b/lib/libesp32/Berry/generate/be_fixed_be_class_lv_ctypes.h @@ -1,7 +1,7 @@ #include "be_constobj.h" static be_define_const_map_slots(be_class_lv_ctypes_map) { - { be_const_key(dot_def, -1), be_const_int(0) }, + { be_const_key(dot_def, -1), be_const_index(0) }, { be_const_key(setmember, -1), be_const_func(be_ctypes_setmember) }, { be_const_key(init, -1), be_const_func(be_ctypes_init) }, { be_const_key(member, 2), be_const_func(be_ctypes_member) }, diff --git a/lib/libesp32/Berry/generate/be_fixed_be_class_lv_draw_line.h b/lib/libesp32/Berry/generate/be_fixed_be_class_lv_draw_line.h deleted file mode 100644 index 834966f29..000000000 --- a/lib/libesp32/Berry/generate/be_fixed_be_class_lv_draw_line.h +++ /dev/null @@ -1,20 +0,0 @@ -#include "be_constobj.h" - -static be_define_const_map_slots(be_class_lv_draw_line_map) { - { be_const_key(init, 2), be_const_func(lvbe_draw_line_create) }, - { be_const_key(tostring, -1), be_const_func(lvx_tostring) }, - { be_const_key(dot_p, -1), be_const_int(0) }, - { be_const_key(member, 0), be_const_func(lvx_member) }, -}; - -static be_define_const_map( - be_class_lv_draw_line_map, - 4 -); - -BE_EXPORT_VARIABLE be_define_const_class( - be_class_lv_draw_line, - 1, - NULL, - lv_draw_line -); diff --git a/lib/libesp32/Berry/generate/be_fixed_be_class_lv_dropdown.h b/lib/libesp32/Berry/generate/be_fixed_be_class_lv_dropdown.h index c36d9970e..ebe16e2f0 100644 --- a/lib/libesp32/Berry/generate/be_fixed_be_class_lv_dropdown.h +++ b/lib/libesp32/Berry/generate/be_fixed_be_class_lv_dropdown.h @@ -3,7 +3,7 @@ static be_define_const_map_slots(be_class_lv_dropdown_map) { { be_const_key(init, 2), be_const_func(lvbe_dropdown_create) }, { be_const_key(tostring, -1), be_const_func(lvx_tostring) }, - { be_const_key(dot_p, -1), be_const_int(0) }, + { be_const_key(dot_p, -1), be_const_index(0) }, { be_const_key(member, 0), be_const_func(lvx_member) }, }; diff --git a/lib/libesp32/Berry/generate/be_fixed_be_class_lv_font.h b/lib/libesp32/Berry/generate/be_fixed_be_class_lv_font.h index 47cf8975f..ee3fb3136 100644 --- a/lib/libesp32/Berry/generate/be_fixed_be_class_lv_font.h +++ b/lib/libesp32/Berry/generate/be_fixed_be_class_lv_font.h @@ -3,7 +3,7 @@ static be_define_const_map_slots(be_class_lv_font_map) { { be_const_key(init, -1), be_const_func(lvx_init) }, { be_const_key(tostring, 2), be_const_func(lvx_tostring) }, - { be_const_key(dot_p, -1), be_const_int(0) }, + { be_const_key(dot_p, -1), be_const_index(0) }, }; static be_define_const_map( diff --git a/lib/libesp32/Berry/generate/be_fixed_be_class_lv_gauge.h b/lib/libesp32/Berry/generate/be_fixed_be_class_lv_gauge.h index 2e84145b9..e0d014cc6 100644 --- a/lib/libesp32/Berry/generate/be_fixed_be_class_lv_gauge.h +++ b/lib/libesp32/Berry/generate/be_fixed_be_class_lv_gauge.h @@ -3,7 +3,7 @@ static be_define_const_map_slots(be_class_lv_gauge_map) { { be_const_key(init, 2), be_const_func(lvbe_gauge_create) }, { be_const_key(tostring, -1), be_const_func(lvx_tostring) }, - { be_const_key(dot_p, -1), be_const_int(0) }, + { be_const_key(dot_p, -1), be_const_index(0) }, { be_const_key(member, 0), be_const_func(lvx_member) }, }; diff --git a/lib/libesp32/Berry/generate/be_fixed_be_class_lv_group.h b/lib/libesp32/Berry/generate/be_fixed_be_class_lv_group.h index 46f29f0c1..393e4cad3 100644 --- a/lib/libesp32/Berry/generate/be_fixed_be_class_lv_group.h +++ b/lib/libesp32/Berry/generate/be_fixed_be_class_lv_group.h @@ -3,7 +3,7 @@ static be_define_const_map_slots(be_class_lv_group_map) { { be_const_key(init, 2), be_const_func(lvbe_group_create) }, { be_const_key(tostring, -1), be_const_func(lvx_tostring) }, - { be_const_key(dot_p, -1), be_const_int(0) }, + { be_const_key(dot_p, -1), be_const_index(0) }, { be_const_key(member, 0), be_const_func(lvx_member) }, }; diff --git a/lib/libesp32/Berry/generate/be_fixed_be_class_lv_img.h b/lib/libesp32/Berry/generate/be_fixed_be_class_lv_img.h index 6f04c933b..2536f53b5 100644 --- a/lib/libesp32/Berry/generate/be_fixed_be_class_lv_img.h +++ b/lib/libesp32/Berry/generate/be_fixed_be_class_lv_img.h @@ -3,7 +3,7 @@ static be_define_const_map_slots(be_class_lv_img_map) { { be_const_key(init, 2), be_const_func(lvbe_img_create) }, { be_const_key(tostring, -1), be_const_func(lvx_tostring) }, - { be_const_key(dot_p, -1), be_const_int(0) }, + { be_const_key(dot_p, -1), be_const_index(0) }, { be_const_key(member, 0), be_const_func(lvx_member) }, }; diff --git a/lib/libesp32/Berry/generate/be_fixed_be_class_lv_imgbtn.h b/lib/libesp32/Berry/generate/be_fixed_be_class_lv_imgbtn.h index 2270dfdff..aa272b8a9 100644 --- a/lib/libesp32/Berry/generate/be_fixed_be_class_lv_imgbtn.h +++ b/lib/libesp32/Berry/generate/be_fixed_be_class_lv_imgbtn.h @@ -3,7 +3,7 @@ static be_define_const_map_slots(be_class_lv_imgbtn_map) { { be_const_key(init, 2), be_const_func(lvbe_imgbtn_create) }, { be_const_key(tostring, -1), be_const_func(lvx_tostring) }, - { be_const_key(dot_p, -1), be_const_int(0) }, + { be_const_key(dot_p, -1), be_const_index(0) }, { be_const_key(member, 0), be_const_func(lvx_member) }, }; diff --git a/lib/libesp32/Berry/generate/be_fixed_be_class_lv_indev.h b/lib/libesp32/Berry/generate/be_fixed_be_class_lv_indev.h index 002804d30..ecda18431 100644 --- a/lib/libesp32/Berry/generate/be_fixed_be_class_lv_indev.h +++ b/lib/libesp32/Berry/generate/be_fixed_be_class_lv_indev.h @@ -3,7 +3,7 @@ static be_define_const_map_slots(be_class_lv_indev_map) { { be_const_key(init, 2), be_const_func(lv0_init) }, { be_const_key(tostring, -1), be_const_func(lvx_tostring) }, - { be_const_key(dot_p, -1), be_const_int(0) }, + { be_const_key(dot_p, -1), be_const_index(0) }, { be_const_key(member, 0), be_const_func(lvx_member) }, }; diff --git a/lib/libesp32/Berry/generate/be_fixed_be_class_lv_keyboard.h b/lib/libesp32/Berry/generate/be_fixed_be_class_lv_keyboard.h index 68d674421..293f8c091 100644 --- a/lib/libesp32/Berry/generate/be_fixed_be_class_lv_keyboard.h +++ b/lib/libesp32/Berry/generate/be_fixed_be_class_lv_keyboard.h @@ -3,7 +3,7 @@ static be_define_const_map_slots(be_class_lv_keyboard_map) { { be_const_key(init, 2), be_const_func(lvbe_keyboard_create) }, { be_const_key(tostring, -1), be_const_func(lvx_tostring) }, - { be_const_key(dot_p, -1), be_const_int(0) }, + { be_const_key(dot_p, -1), be_const_index(0) }, { be_const_key(member, 0), be_const_func(lvx_member) }, }; diff --git a/lib/libesp32/Berry/generate/be_fixed_be_class_lv_label.h b/lib/libesp32/Berry/generate/be_fixed_be_class_lv_label.h index 5bcfae692..b8cb81e58 100644 --- a/lib/libesp32/Berry/generate/be_fixed_be_class_lv_label.h +++ b/lib/libesp32/Berry/generate/be_fixed_be_class_lv_label.h @@ -3,7 +3,7 @@ static be_define_const_map_slots(be_class_lv_label_map) { { be_const_key(init, 2), be_const_func(lvbe_label_create) }, { be_const_key(tostring, -1), be_const_func(lvx_tostring) }, - { be_const_key(dot_p, -1), be_const_int(0) }, + { be_const_key(dot_p, -1), be_const_index(0) }, { be_const_key(member, 0), be_const_func(lvx_member) }, }; diff --git a/lib/libesp32/Berry/generate/be_fixed_be_class_lv_led.h b/lib/libesp32/Berry/generate/be_fixed_be_class_lv_led.h index 70bc6b820..a0f3b0b85 100644 --- a/lib/libesp32/Berry/generate/be_fixed_be_class_lv_led.h +++ b/lib/libesp32/Berry/generate/be_fixed_be_class_lv_led.h @@ -3,7 +3,7 @@ static be_define_const_map_slots(be_class_lv_led_map) { { be_const_key(init, 2), be_const_func(lvbe_led_create) }, { be_const_key(tostring, -1), be_const_func(lvx_tostring) }, - { be_const_key(dot_p, -1), be_const_int(0) }, + { be_const_key(dot_p, -1), be_const_index(0) }, { be_const_key(member, 0), be_const_func(lvx_member) }, }; diff --git a/lib/libesp32/Berry/generate/be_fixed_be_class_lv_line.h b/lib/libesp32/Berry/generate/be_fixed_be_class_lv_line.h index 7c32984a9..34dd43d2d 100644 --- a/lib/libesp32/Berry/generate/be_fixed_be_class_lv_line.h +++ b/lib/libesp32/Berry/generate/be_fixed_be_class_lv_line.h @@ -3,7 +3,7 @@ static be_define_const_map_slots(be_class_lv_line_map) { { be_const_key(init, 2), be_const_func(lvbe_line_create) }, { be_const_key(tostring, -1), be_const_func(lvx_tostring) }, - { be_const_key(dot_p, -1), be_const_int(0) }, + { be_const_key(dot_p, -1), be_const_index(0) }, { be_const_key(member, 0), be_const_func(lvx_member) }, }; diff --git a/lib/libesp32/Berry/generate/be_fixed_be_class_lv_linemeter.h b/lib/libesp32/Berry/generate/be_fixed_be_class_lv_linemeter.h index af20fbd2f..9242241d7 100644 --- a/lib/libesp32/Berry/generate/be_fixed_be_class_lv_linemeter.h +++ b/lib/libesp32/Berry/generate/be_fixed_be_class_lv_linemeter.h @@ -3,7 +3,7 @@ static be_define_const_map_slots(be_class_lv_linemeter_map) { { be_const_key(init, 2), be_const_func(lvbe_linemeter_create) }, { be_const_key(tostring, -1), be_const_func(lvx_tostring) }, - { be_const_key(dot_p, -1), be_const_int(0) }, + { be_const_key(dot_p, -1), be_const_index(0) }, { be_const_key(member, 0), be_const_func(lvx_member) }, }; diff --git a/lib/libesp32/Berry/generate/be_fixed_be_class_lv_list.h b/lib/libesp32/Berry/generate/be_fixed_be_class_lv_list.h index 56701ea96..630146d49 100644 --- a/lib/libesp32/Berry/generate/be_fixed_be_class_lv_list.h +++ b/lib/libesp32/Berry/generate/be_fixed_be_class_lv_list.h @@ -3,7 +3,7 @@ static be_define_const_map_slots(be_class_lv_list_map) { { be_const_key(init, 2), be_const_func(lvbe_list_create) }, { be_const_key(tostring, -1), be_const_func(lvx_tostring) }, - { be_const_key(dot_p, -1), be_const_int(0) }, + { be_const_key(dot_p, -1), be_const_index(0) }, { be_const_key(member, 0), be_const_func(lvx_member) }, }; diff --git a/lib/libesp32/Berry/generate/be_fixed_be_class_lv_msgbox.h b/lib/libesp32/Berry/generate/be_fixed_be_class_lv_msgbox.h index f60c95fdd..d922885c0 100644 --- a/lib/libesp32/Berry/generate/be_fixed_be_class_lv_msgbox.h +++ b/lib/libesp32/Berry/generate/be_fixed_be_class_lv_msgbox.h @@ -3,7 +3,7 @@ static be_define_const_map_slots(be_class_lv_msgbox_map) { { be_const_key(init, 2), be_const_func(lvbe_msgbox_create) }, { be_const_key(tostring, -1), be_const_func(lvx_tostring) }, - { be_const_key(dot_p, -1), be_const_int(0) }, + { be_const_key(dot_p, -1), be_const_index(0) }, { be_const_key(member, 0), be_const_func(lvx_member) }, }; diff --git a/lib/libesp32/Berry/generate/be_fixed_be_class_lv_obj.h b/lib/libesp32/Berry/generate/be_fixed_be_class_lv_obj.h index 5f5328325..a145b957a 100644 --- a/lib/libesp32/Berry/generate/be_fixed_be_class_lv_obj.h +++ b/lib/libesp32/Berry/generate/be_fixed_be_class_lv_obj.h @@ -3,7 +3,7 @@ static be_define_const_map_slots(be_class_lv_obj_map) { { be_const_key(init, 2), be_const_func(lvbe_obj_create) }, { be_const_key(tostring, -1), be_const_func(lvx_tostring) }, - { be_const_key(dot_p, -1), be_const_int(0) }, + { be_const_key(dot_p, -1), be_const_index(0) }, { be_const_key(member, 0), be_const_func(lvx_member) }, }; diff --git a/lib/libesp32/Berry/generate/be_fixed_be_class_lv_objmask.h b/lib/libesp32/Berry/generate/be_fixed_be_class_lv_objmask.h index e0d00517a..7bf87f4d7 100644 --- a/lib/libesp32/Berry/generate/be_fixed_be_class_lv_objmask.h +++ b/lib/libesp32/Berry/generate/be_fixed_be_class_lv_objmask.h @@ -3,7 +3,7 @@ static be_define_const_map_slots(be_class_lv_objmask_map) { { be_const_key(init, 2), be_const_func(lvbe_objmask_create) }, { be_const_key(tostring, -1), be_const_func(lvx_tostring) }, - { be_const_key(dot_p, -1), be_const_int(0) }, + { be_const_key(dot_p, -1), be_const_index(0) }, { be_const_key(member, 0), be_const_func(lvx_member) }, }; diff --git a/lib/libesp32/Berry/generate/be_fixed_be_class_lv_page.h b/lib/libesp32/Berry/generate/be_fixed_be_class_lv_page.h index a345946de..a8e711925 100644 --- a/lib/libesp32/Berry/generate/be_fixed_be_class_lv_page.h +++ b/lib/libesp32/Berry/generate/be_fixed_be_class_lv_page.h @@ -3,7 +3,7 @@ static be_define_const_map_slots(be_class_lv_page_map) { { be_const_key(init, 2), be_const_func(lvbe_page_create) }, { be_const_key(tostring, -1), be_const_func(lvx_tostring) }, - { be_const_key(dot_p, -1), be_const_int(0) }, + { be_const_key(dot_p, -1), be_const_index(0) }, { be_const_key(member, 0), be_const_func(lvx_member) }, }; diff --git a/lib/libesp32/Berry/generate/be_fixed_be_class_lv_roller.h b/lib/libesp32/Berry/generate/be_fixed_be_class_lv_roller.h index 82995edf2..8dc63062b 100644 --- a/lib/libesp32/Berry/generate/be_fixed_be_class_lv_roller.h +++ b/lib/libesp32/Berry/generate/be_fixed_be_class_lv_roller.h @@ -3,7 +3,7 @@ static be_define_const_map_slots(be_class_lv_roller_map) { { be_const_key(init, 2), be_const_func(lvbe_roller_create) }, { be_const_key(tostring, -1), be_const_func(lvx_tostring) }, - { be_const_key(dot_p, -1), be_const_int(0) }, + { be_const_key(dot_p, -1), be_const_index(0) }, { be_const_key(member, 0), be_const_func(lvx_member) }, }; diff --git a/lib/libesp32/Berry/generate/be_fixed_be_class_lv_slider.h b/lib/libesp32/Berry/generate/be_fixed_be_class_lv_slider.h index 10a0a7823..d37d39db0 100644 --- a/lib/libesp32/Berry/generate/be_fixed_be_class_lv_slider.h +++ b/lib/libesp32/Berry/generate/be_fixed_be_class_lv_slider.h @@ -3,7 +3,7 @@ static be_define_const_map_slots(be_class_lv_slider_map) { { be_const_key(init, 2), be_const_func(lvbe_slider_create) }, { be_const_key(tostring, -1), be_const_func(lvx_tostring) }, - { be_const_key(dot_p, -1), be_const_int(0) }, + { be_const_key(dot_p, -1), be_const_index(0) }, { be_const_key(member, 0), be_const_func(lvx_member) }, }; diff --git a/lib/libesp32/Berry/generate/be_fixed_be_class_lv_spinbox.h b/lib/libesp32/Berry/generate/be_fixed_be_class_lv_spinbox.h index 14129797d..6258e8832 100644 --- a/lib/libesp32/Berry/generate/be_fixed_be_class_lv_spinbox.h +++ b/lib/libesp32/Berry/generate/be_fixed_be_class_lv_spinbox.h @@ -3,7 +3,7 @@ static be_define_const_map_slots(be_class_lv_spinbox_map) { { be_const_key(init, 2), be_const_func(lvbe_spinbox_create) }, { be_const_key(tostring, -1), be_const_func(lvx_tostring) }, - { be_const_key(dot_p, -1), be_const_int(0) }, + { be_const_key(dot_p, -1), be_const_index(0) }, { be_const_key(member, 0), be_const_func(lvx_member) }, }; diff --git a/lib/libesp32/Berry/generate/be_fixed_be_class_lv_spinner.h b/lib/libesp32/Berry/generate/be_fixed_be_class_lv_spinner.h index 5f5e44912..b782385f1 100644 --- a/lib/libesp32/Berry/generate/be_fixed_be_class_lv_spinner.h +++ b/lib/libesp32/Berry/generate/be_fixed_be_class_lv_spinner.h @@ -3,7 +3,7 @@ static be_define_const_map_slots(be_class_lv_spinner_map) { { be_const_key(init, 2), be_const_func(lvbe_spinner_create) }, { be_const_key(tostring, -1), be_const_func(lvx_tostring) }, - { be_const_key(dot_p, -1), be_const_int(0) }, + { be_const_key(dot_p, -1), be_const_index(0) }, { be_const_key(member, 0), be_const_func(lvx_member) }, }; diff --git a/lib/libesp32/Berry/generate/be_fixed_be_class_lv_style.h b/lib/libesp32/Berry/generate/be_fixed_be_class_lv_style.h index 1ef46979f..789c6be38 100644 --- a/lib/libesp32/Berry/generate/be_fixed_be_class_lv_style.h +++ b/lib/libesp32/Berry/generate/be_fixed_be_class_lv_style.h @@ -3,7 +3,7 @@ static be_define_const_map_slots(be_class_lv_style_map) { { be_const_key(init, 2), be_const_func(lvs_init) }, { be_const_key(tostring, -1), be_const_func(lvs_tostring) }, - { be_const_key(dot_p, -1), be_const_int(0) }, + { be_const_key(dot_p, -1), be_const_index(0) }, { be_const_key(member, 0), be_const_func(lvx_member) }, }; diff --git a/lib/libesp32/Berry/generate/be_fixed_be_class_lv_switch.h b/lib/libesp32/Berry/generate/be_fixed_be_class_lv_switch.h index 335286fce..2033de3b4 100644 --- a/lib/libesp32/Berry/generate/be_fixed_be_class_lv_switch.h +++ b/lib/libesp32/Berry/generate/be_fixed_be_class_lv_switch.h @@ -3,7 +3,7 @@ static be_define_const_map_slots(be_class_lv_switch_map) { { be_const_key(init, 2), be_const_func(lvbe_switch_create) }, { be_const_key(tostring, -1), be_const_func(lvx_tostring) }, - { be_const_key(dot_p, -1), be_const_int(0) }, + { be_const_key(dot_p, -1), be_const_index(0) }, { be_const_key(member, 0), be_const_func(lvx_member) }, }; diff --git a/lib/libesp32/Berry/generate/be_fixed_be_class_lv_table.h b/lib/libesp32/Berry/generate/be_fixed_be_class_lv_table.h index 9ad524712..f351e768d 100644 --- a/lib/libesp32/Berry/generate/be_fixed_be_class_lv_table.h +++ b/lib/libesp32/Berry/generate/be_fixed_be_class_lv_table.h @@ -3,7 +3,7 @@ static be_define_const_map_slots(be_class_lv_table_map) { { be_const_key(init, 2), be_const_func(lvbe_table_create) }, { be_const_key(tostring, -1), be_const_func(lvx_tostring) }, - { be_const_key(dot_p, -1), be_const_int(0) }, + { be_const_key(dot_p, -1), be_const_index(0) }, { be_const_key(member, 0), be_const_func(lvx_member) }, }; diff --git a/lib/libesp32/Berry/generate/be_fixed_be_class_lv_tabview.h b/lib/libesp32/Berry/generate/be_fixed_be_class_lv_tabview.h index 1c29ebe88..514c2520e 100644 --- a/lib/libesp32/Berry/generate/be_fixed_be_class_lv_tabview.h +++ b/lib/libesp32/Berry/generate/be_fixed_be_class_lv_tabview.h @@ -3,7 +3,7 @@ static be_define_const_map_slots(be_class_lv_tabview_map) { { be_const_key(init, 2), be_const_func(lvbe_tabview_create) }, { be_const_key(tostring, -1), be_const_func(lvx_tostring) }, - { be_const_key(dot_p, -1), be_const_int(0) }, + { be_const_key(dot_p, -1), be_const_index(0) }, { be_const_key(member, 0), be_const_func(lvx_member) }, }; diff --git a/lib/libesp32/Berry/generate/be_fixed_be_class_lv_textarea.h b/lib/libesp32/Berry/generate/be_fixed_be_class_lv_textarea.h index 0284a9e59..25eeb27d7 100644 --- a/lib/libesp32/Berry/generate/be_fixed_be_class_lv_textarea.h +++ b/lib/libesp32/Berry/generate/be_fixed_be_class_lv_textarea.h @@ -3,7 +3,7 @@ static be_define_const_map_slots(be_class_lv_textarea_map) { { be_const_key(init, 2), be_const_func(lvbe_textarea_create) }, { be_const_key(tostring, -1), be_const_func(lvx_tostring) }, - { be_const_key(dot_p, -1), be_const_int(0) }, + { be_const_key(dot_p, -1), be_const_index(0) }, { be_const_key(member, 0), be_const_func(lvx_member) }, }; diff --git a/lib/libesp32/Berry/generate/be_fixed_be_class_lv_tileview.h b/lib/libesp32/Berry/generate/be_fixed_be_class_lv_tileview.h index 34111754a..04404de1f 100644 --- a/lib/libesp32/Berry/generate/be_fixed_be_class_lv_tileview.h +++ b/lib/libesp32/Berry/generate/be_fixed_be_class_lv_tileview.h @@ -3,7 +3,7 @@ static be_define_const_map_slots(be_class_lv_tileview_map) { { be_const_key(init, 2), be_const_func(lvbe_tileview_create) }, { be_const_key(tostring, -1), be_const_func(lvx_tostring) }, - { be_const_key(dot_p, -1), be_const_int(0) }, + { be_const_key(dot_p, -1), be_const_index(0) }, { be_const_key(member, 0), be_const_func(lvx_member) }, }; diff --git a/lib/libesp32/Berry/generate/be_fixed_be_class_lv_win.h b/lib/libesp32/Berry/generate/be_fixed_be_class_lv_win.h index 5d65d04e9..96e5c6970 100644 --- a/lib/libesp32/Berry/generate/be_fixed_be_class_lv_win.h +++ b/lib/libesp32/Berry/generate/be_fixed_be_class_lv_win.h @@ -3,7 +3,7 @@ static be_define_const_map_slots(be_class_lv_win_map) { { be_const_key(init, 2), be_const_func(lvbe_win_create) }, { be_const_key(tostring, -1), be_const_func(lvx_tostring) }, - { be_const_key(dot_p, -1), be_const_int(0) }, + { be_const_key(dot_p, -1), be_const_index(0) }, { be_const_key(member, 0), be_const_func(lvx_member) }, }; diff --git a/lib/libesp32/Berry/generate/be_fixed_be_class_map.h b/lib/libesp32/Berry/generate/be_fixed_be_class_map.h index 06c75a050..d9c033a8b 100644 --- a/lib/libesp32/Berry/generate/be_fixed_be_class_map.h +++ b/lib/libesp32/Berry/generate/be_fixed_be_class_map.h @@ -1,7 +1,7 @@ #include "be_constobj.h" static be_define_const_map_slots(be_class_map_map) { - { be_const_key(dot_p, 2), be_const_int(0) }, + { be_const_key(dot_p, 2), be_const_index(0) }, { be_const_key(insert, -1), be_const_func(m_insert) }, { be_const_key(remove, -1), be_const_func(m_remove) }, { be_const_key(tostring, -1), be_const_func(m_tostring) }, diff --git a/lib/libesp32/Berry/generate/be_fixed_be_class_md5.h b/lib/libesp32/Berry/generate/be_fixed_be_class_md5.h index 59979b2ad..34f7ae7e5 100644 --- a/lib/libesp32/Berry/generate/be_fixed_be_class_md5.h +++ b/lib/libesp32/Berry/generate/be_fixed_be_class_md5.h @@ -2,7 +2,7 @@ static be_define_const_map_slots(be_class_md5_map) { { be_const_key(update, -1), be_const_func(m_md5_update) }, - { be_const_key(dot_p, -1), be_const_int(0) }, + { be_const_key(dot_p, -1), be_const_index(0) }, { be_const_key(finish, -1), be_const_func(m_md5_finish) }, { be_const_key(init, 1), be_const_func(m_md5_init) }, }; diff --git a/lib/libesp32/Berry/generate/be_fixed_be_class_range.h b/lib/libesp32/Berry/generate/be_fixed_be_class_range.h index fc55c6304..cce2842eb 100644 --- a/lib/libesp32/Berry/generate/be_fixed_be_class_range.h +++ b/lib/libesp32/Berry/generate/be_fixed_be_class_range.h @@ -5,9 +5,9 @@ static be_define_const_map_slots(be_class_range_map) { { be_const_key(iter, -1), be_const_func(m_iter) }, { be_const_key(lower, -1), be_const_func(m_lower) }, { be_const_key(init, 4), be_const_func(m_init) }, - { be_const_key(__upper__, -1), be_const_int(0) }, + { be_const_key(__upper__, -1), be_const_index(0) }, { be_const_key(tostring, -1), be_const_func(m_tostring) }, - { be_const_key(__lower__, -1), be_const_int(1) }, + { be_const_key(__lower__, -1), be_const_index(1) }, { be_const_key(upper, 1), be_const_func(m_upper) }, }; diff --git a/lib/libesp32/Berry/generate/be_fixed_be_class_tasmota.h b/lib/libesp32/Berry/generate/be_fixed_be_class_tasmota.h index 34c41ed47..cd8f9f4b0 100644 --- a/lib/libesp32/Berry/generate/be_fixed_be_class_tasmota.h +++ b/lib/libesp32/Berry/generate/be_fixed_be_class_tasmota.h @@ -1,68 +1,71 @@ #include "be_constobj.h" static be_define_const_map_slots(be_class_tasmota_map) { - { be_const_key(millis, 52), be_const_func(l_millis) }, { be_const_key(gc, -1), be_const_closure(gc_closure) }, - { be_const_key(scale_uint, -1), be_const_func(l_scaleuint) }, - { 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(get_free_heap, -1), be_const_func(l_getFreeHeap) }, { be_const_key(_cmd, -1), be_const_func(l_cmd) }, - { be_const_key(web_send, 16), be_const_func(l_webSend) }, - { be_const_key(set_timer, -1), be_const_closure(set_timer_closure) }, - { be_const_key(_cb, -1), be_const_int(0) }, - { be_const_key(exec_cmd, -1), be_const_closure(exec_cmd_closure) }, - { be_const_key(i2c_enabled, 42), be_const_func(l_i2cenabled) }, - { be_const_key(cmd, -1), be_const_closure(cmd_closure) }, - { be_const_key(resp_cmnd_done, 28), be_const_func(l_respCmndDone) }, - { be_const_key(set_light, 1), be_const_closure(set_light_closure) }, + { be_const_key(event, -1), be_const_closure(event_closure) }, + { be_const_key(millis, -1), be_const_func(l_millis) }, + { be_const_key(eth, 23), be_const_func(l_eth) }, + { be_const_key(try_rule, -1), be_const_closure(try_rule_closure) }, + { be_const_key(resp_cmnd, -1), be_const_func(l_respCmnd) }, + { be_const_key(set_light, -1), be_const_closure(set_light_closure) }, + { be_const_key(remove_rule, -1), be_const_closure(remove_rule_closure) }, { be_const_key(get_light, -1), be_const_closure(get_light_closure) }, - { be_const_key(_rules, 50), be_const_int(1) }, + { be_const_key(_rules, -1), be_const_index(0) }, + { be_const_key(add_driver, 0), be_const_closure(add_driver_closure) }, + { be_const_key(save, 38), be_const_func(l_save) }, + { be_const_key(set_timer, -1), be_const_closure(set_timer_closure) }, + { be_const_key(yield, 48), be_const_func(l_yield) }, + { be_const_key(resp_cmnd_done, -1), be_const_func(l_respCmndDone) }, + { be_const_key(find_op, 4), be_const_closure(find_op_closure) }, + { be_const_key(get_free_heap, -1), be_const_func(l_getFreeHeap) }, + { be_const_key(remove_cmd, -1), be_const_closure(remove_cmd_closure) }, + { be_const_key(exec_cmd, 20), be_const_closure(exec_cmd_closure) }, + { be_const_key(add_cmd, -1), be_const_closure(add_cmd_closure) }, + { be_const_key(log, -1), be_const_func(l_logInfo) }, + { be_const_key(_get_cb, 18), be_const_func(l_get_cb) }, + { be_const_key(_timers, 35), be_const_index(1) }, + { be_const_key(wifi, 55), be_const_func(l_wifi) }, + { be_const_key(_drivers, 10), be_const_index(2) }, + { be_const_key(find_key_i, -1), be_const_closure(find_key_i_closure) }, + { be_const_key(_cb, -1), be_const_index(3) }, + { be_const_key(web_send, -1), be_const_func(l_webSend) }, + { be_const_key(resp_cmnd_error, -1), be_const_func(l_respCmndError) }, + { be_const_key(memory, 31), be_const_func(l_memory) }, + { be_const_key(resp_cmnd_str, -1), be_const_func(l_respCmndStr) }, + { be_const_key(time_str, 7), be_const_closure(time_str_closure) }, + { be_const_key(set_power, 34), be_const_func(l_setpower) }, + { be_const_key(get_option, 46), be_const_func(l_getoption) }, + { be_const_key(rtc, -1), be_const_func(l_rtc) }, + { be_const_key(response_append, -1), be_const_func(l_respAppend) }, + { be_const_key(publish_result, -1), be_const_func(l_publish_result) }, + { be_const_key(chars_in_string, 50), be_const_closure(chars_in_string_closure) }, + { be_const_key(cmd, 2), be_const_closure(cmd_closure) }, + { be_const_key(wire_scan, -1), be_const_closure(wire_scan_closure) }, + { be_const_key(i2c_enabled, -1), be_const_func(l_i2cenabled) }, + { be_const_key(resp_cmnd_failed, 1), be_const_func(l_respCmndFailed) }, + { be_const_key(add_rule, 29), be_const_closure(add_rule_closure) }, + { be_const_key(publish, -1), be_const_func(l_publish) }, + { be_const_key(resolvecmnd, -1), be_const_func(l_resolveCmnd) }, + { be_const_key(_ccmd, -1), be_const_index(4) }, + { be_const_key(time_dump, -1), be_const_func(l_time_dump) }, + { be_const_key(scale_uint, -1), be_const_func(l_scaleuint) }, + { be_const_key(load, -1), be_const_closure(load_closure) }, + { be_const_key(exec_rules, 37), be_const_closure(exec_rules_closure) }, + { be_const_key(gen_cb, 36), be_const_closure(gen_cb_closure) }, + { be_const_key(cb_dispatch, -1), be_const_closure(cb_dispatch_closure) }, { be_const_key(time_reached, -1), be_const_func(l_timereached) }, { be_const_key(web_send_decimal, -1), be_const_func(l_webSendDecimal) }, - { be_const_key(load, 22), be_const_closure(load_closure) }, - { be_const_key(yield, -1), be_const_func(l_yield) }, - { be_const_key(event, -1), be_const_closure(event_closure) }, - { be_const_key(add_cmd, 40), be_const_closure(add_cmd_closure) }, - { be_const_key(find_key_i, -1), be_const_closure(find_key_i_closure) }, - { be_const_key(delay, 43), be_const_func(l_delay) }, - { be_const_key(remove_cmd, -1), be_const_closure(remove_cmd_closure) }, - { be_const_key(remove_rule, 56), be_const_closure(remove_rule_closure) }, - { be_const_key(resolvecmnd, 29), be_const_func(l_resolveCmnd) }, - { be_const_key(get_option, -1), be_const_func(l_getoption) }, - { be_const_key(resp_cmnd_str, -1), be_const_func(l_respCmndStr) }, - { be_const_key(response_append, -1), be_const_func(l_respAppend) }, - { be_const_key(_timers, -1), be_const_int(2) }, - { be_const_key(try_rule, -1), be_const_closure(try_rule_closure) }, - { be_const_key(set_power, 45), be_const_func(l_setpower) }, - { be_const_key(resp_cmnd_error, -1), be_const_func(l_respCmndError) }, - { be_const_key(publish, -1), be_const_func(l_publish) }, - { be_const_key(_ccmd, 13), be_const_int(3) }, - { be_const_key(_get_cb, -1), be_const_func(l_get_cb) }, - { be_const_key(wire1, 15), be_const_int(4) }, - { be_const_key(gen_cb, 6), be_const_closure(gen_cb_closure) }, - { be_const_key(rtc, -1), be_const_func(l_rtc) }, - { be_const_key(time_dump, -1), be_const_func(l_time_dump) }, - { be_const_key(run_deferred, -1), be_const_closure(run_deferred_closure) }, - { be_const_key(memory, 47), be_const_func(l_memory) }, - { be_const_key(time_str, 53), be_const_closure(time_str_closure) }, - { be_const_key(save, -1), be_const_func(l_save) }, - { be_const_key(find_op, 25), be_const_closure(find_op_closure) }, - { be_const_key(chars_in_string, -1), be_const_closure(chars_in_string_closure) }, + { be_const_key(delay, 54), be_const_func(l_delay) }, + { be_const_key(run_deferred, 9), be_const_closure(run_deferred_closure) }, { be_const_key(get_power, -1), be_const_func(l_getpower) }, - { be_const_key(wire2, 8), be_const_int(5) }, - { be_const_key(wire_scan, 55), be_const_closure(wire_scan_closure) }, - { be_const_key(resp_cmnd_failed, -1), be_const_func(l_respCmndFailed) }, - { be_const_key(exec_rules, -1), be_const_closure(exec_rules_closure) }, - { be_const_key(cb_dispatch, -1), be_const_closure(cb_dispatch_closure) }, - { be_const_key(resp_cmnd, -1), be_const_func(l_respCmnd) }, - { be_const_key(_drivers, -1), be_const_int(6) }, - { be_const_key(add_driver, -1), be_const_closure(add_driver_closure) }, + { be_const_key(wire2, -1), be_const_index(5) }, + { be_const_key(wire1, 52), be_const_index(6) }, }; static be_define_const_map( be_class_tasmota_map, - 57 + 60 ); BE_EXPORT_VARIABLE be_define_const_class( diff --git a/lib/libesp32/Berry/generate/be_fixed_be_class_tasmota_driver.h b/lib/libesp32/Berry/generate/be_fixed_be_class_tasmota_driver.h deleted file mode 100644 index 2e7af22fc..000000000 --- a/lib/libesp32/Berry/generate/be_fixed_be_class_tasmota_driver.h +++ /dev/null @@ -1,31 +0,0 @@ -#include "be_constobj.h" - -static be_define_const_map_slots(be_class_tasmota_driver_map) { - { be_const_key(every_second, 1), be_const_int(0) }, - { be_const_key(web_add_config_button, -1), be_const_int(1) }, - { be_const_key(web_sensor, 5), be_const_int(2) }, - { be_const_key(web_add_button, 10), be_const_int(3) }, - { be_const_key(add_cmd, -1), be_const_closure(add_cmd_closure) }, - { be_const_key(web_add_console_button, 12), be_const_int(4) }, - { be_const_key(web_add_management_button, -1), be_const_int(5) }, - { be_const_key(display, -1), be_const_int(6) }, - { be_const_key(get_tasmota, 13), be_const_closure(get_tasmota_closure) }, - { be_const_key(every_100ms, -1), be_const_int(7) }, - { be_const_key(save_before_restart, -1), be_const_int(8) }, - { be_const_key(button_pressed, -1), be_const_int(9) }, - { be_const_key(web_add_handler, -1), be_const_int(10) }, - { be_const_key(web_add_main_button, -1), be_const_int(11) }, - { be_const_key(json_append, 8), be_const_int(12) }, -}; - -static be_define_const_map( - be_class_tasmota_driver_map, - 15 -); - -BE_EXPORT_VARIABLE be_define_const_class( - be_class_tasmota_driver, - 13, - NULL, - Driver -); diff --git a/lib/libesp32/Berry/generate/be_fixed_be_class_tasmota_i2c_driver.h b/lib/libesp32/Berry/generate/be_fixed_be_class_tasmota_i2c_driver.h index 0cb3f6fc5..b28ffdabd 100644 --- a/lib/libesp32/Berry/generate/be_fixed_be_class_tasmota_i2c_driver.h +++ b/lib/libesp32/Berry/generate/be_fixed_be_class_tasmota_i2c_driver.h @@ -3,13 +3,13 @@ static be_define_const_map_slots(be_class_tasmota_i2c_driver_map) { { be_const_key(read32, -1), be_const_closure(read32_closure) }, { be_const_key(write8, 6), be_const_closure(write8_closure) }, - { be_const_key(name, -1), be_const_int(0) }, - { be_const_key(addr, 10), be_const_int(1) }, + { be_const_key(name, -1), be_const_index(0) }, + { be_const_key(addr, 10), be_const_index(1) }, { be_const_key(read12, -1), be_const_closure(read12_closure) }, { be_const_key(write_bit, 8), be_const_closure(write_bit_closure) }, { be_const_key(read13, -1), be_const_closure(read13_closure) }, { be_const_key(read24, -1), be_const_closure(read24_closure) }, - { be_const_key(wire, -1), be_const_int(2) }, + { be_const_key(wire, -1), be_const_index(2) }, { be_const_key(init, -1), be_const_closure(init_closure) }, { be_const_key(read8, -1), be_const_closure(read8_closure) }, }; @@ -22,6 +22,6 @@ static be_define_const_map( BE_EXPORT_VARIABLE be_define_const_class( be_class_tasmota_i2c_driver, 3, - (bclass *)&be_class_tasmota_driver, + (bclass *)&be_class_Driver, I2C_Driver ); diff --git a/lib/libesp32/Berry/generate/be_fixed_be_class_tasmota_wire.h b/lib/libesp32/Berry/generate/be_fixed_be_class_tasmota_wire.h index d43d4aa8e..9c5543578 100644 --- a/lib/libesp32/Berry/generate/be_fixed_be_class_tasmota_wire.h +++ b/lib/libesp32/Berry/generate/be_fixed_be_class_tasmota_wire.h @@ -2,7 +2,7 @@ static be_define_const_map_slots(be_class_tasmota_wire_map) { { be_const_key(_end_transmission, 10), be_const_func(b_wire_endtransmission) }, - { be_const_key(bus, -1), be_const_int(0) }, + { be_const_key(bus, -1), be_const_index(0) }, { be_const_key(_read, 7), be_const_func(b_wire_read) }, { be_const_key(read, -1), be_const_func(b_wire_validread) }, { be_const_key(_request_from, -1), be_const_func(b_wire_requestfrom) }, diff --git a/lib/libesp32/Berry/generate/be_fixed_be_lvgl_cb.h b/lib/libesp32/Berry/generate/be_fixed_be_lvgl_cb.h index 7348587a9..a0ddbeb33 100644 --- a/lib/libesp32/Berry/generate/be_fixed_be_lvgl_cb.h +++ b/lib/libesp32/Berry/generate/be_fixed_be_lvgl_cb.h @@ -1,7 +1,7 @@ #include "be_constobj.h" static be_define_const_map_slots(be_lvgl_cb_map) { - { be_const_key(dot_p, -1), be_const_int(0) }, + { be_const_key(dot_p, -1), be_const_index(0) }, { be_const_key(tostring, 2), be_const_func(lvx_tostring) }, { be_const_key(call, -1), be_const_func(lv_cb_call) }, { be_const_key(init, 0), be_const_func(lv0_init) }, diff --git a/lib/libesp32/Berry/generate/be_fixed_gpio.h b/lib/libesp32/Berry/generate/be_fixed_gpio.h index 480e53d40..8638ff65e 100644 --- a/lib/libesp32/Berry/generate/be_fixed_gpio.h +++ b/lib/libesp32/Berry/generate/be_fixed_gpio.h @@ -1,269 +1,279 @@ #include "be_constobj.h" static be_define_const_map_slots(m_libgpio_map) { - { be_const_key(MAX31855CLK, -1), be_const_int(79) }, - { be_const_key(DHT11_OUT, 197), be_const_int(40) }, - { be_const_key(PZEM004_RX, 113), be_const_int(47) }, - { be_const_key(BS814_DAT, 115), be_const_int(215) }, - { be_const_key(ROT1B_NP, -1), be_const_int(212) }, - { be_const_key(WEBCAM_HREF, -1), be_const_int(161) }, - { be_const_key(SPI_CLK, 233), be_const_int(23) }, - { be_const_key(TCP_TX, -1), be_const_int(171) }, - { be_const_key(SM16716_DAT, 72), be_const_int(92) }, - { be_const_key(AZ_RXD, 136), be_const_int(77) }, - { be_const_key(PWM1, -1), be_const_int(13) }, - { be_const_key(EXS_ENABLE, -1), be_const_int(129) }, - { be_const_key(ETH_PHY_POWER, -1), be_const_int(173) }, - { be_const_key(HIGH, -1), be_const_int(1) }, - { be_const_key(ETH_PHY_MDIO, -1), be_const_int(175) }, - { be_const_key(MP3_DFR562, 11), be_const_int(67) }, - { be_const_key(HM10_RX, -1), be_const_int(138) }, - { be_const_key(SSPI_MOSI, -1), be_const_int(27) }, - { be_const_key(KEY1_INV_NP, -1), be_const_int(4) }, - { be_const_key(NONE, -1), be_const_int(0) }, - { be_const_key(DDS2382_RX, 18), be_const_int(123) }, - { be_const_key(DSB_OUT, -1), be_const_int(42) }, - { be_const_key(FTC532, -1), be_const_int(195) }, - { be_const_key(ARIRFSEL, 222), be_const_int(99) }, - { be_const_key(pin, -1), be_const_func(gp_pin) }, - { be_const_key(RFRECV, -1), be_const_int(36) }, - { be_const_key(HRXL_RX, -1), be_const_int(144) }, - { be_const_key(HRE_CLOCK, -1), be_const_int(106) }, - { be_const_key(AS608_RX, -1), be_const_int(188) }, - { be_const_key(SDS0X1_TX, -1), be_const_int(54) }, - { be_const_key(TM1637DIO, 112), be_const_int(223) }, - { be_const_key(ILI9488_CS, 138), be_const_int(201) }, - { be_const_key(WEBCAM_VSYNC, 184), be_const_int(160) }, - { be_const_key(TASMOTACLIENT_RST, 224), be_const_int(132) }, - { be_const_key(INPUT, 57), be_const_int(239) }, - { be_const_key(SBR_TX, -1), be_const_int(56) }, - { be_const_key(HPMA_TX, -1), be_const_int(135) }, - { be_const_key(MCP39F5_RX, 41), be_const_int(87) }, - { be_const_key(OUTPUT, 69), be_const_int(2) }, - { be_const_key(AZ_TXD, -1), be_const_int(76) }, { be_const_key(ADC_BUTTON, -1), be_const_int(150) }, - { be_const_key(ETH_PHY_MDC, -1), be_const_int(174) }, - { be_const_key(ZEROCROSS, -1), be_const_int(236) }, - { be_const_key(AS3935, 147), be_const_int(146) }, - { be_const_key(SSPI_MAX31865_CS1, -1), be_const_int(105) }, - { be_const_key(LEDLNK_INV, 56), be_const_int(18) }, - { be_const_key(RDM6300_RX, -1), be_const_int(113) }, - { be_const_key(TM1638STB, -1), be_const_int(66) }, - { be_const_key(SR04_TRIG, 166), be_const_int(58) }, - { be_const_key(CSE7761_RX, -1), be_const_int(229) }, - { be_const_key(HM10_TX, -1), be_const_int(139) }, - { be_const_key(SM16716_CLK, 111), be_const_int(91) }, - { be_const_key(ADC_TEMP, 120), be_const_int(148) }, - { be_const_key(NRG_SEL_INV, -1), be_const_int(82) }, - { be_const_key(OPEN_DRAIN, -1), be_const_int(16) }, - { be_const_key(ST7789_DC, 196), be_const_int(207) }, - { be_const_key(INPUT_PULLDOWN, 122), be_const_int(9) }, - { be_const_key(SM2135_CLK, 219), be_const_int(126) }, - { be_const_key(WEBCAM_PSCLK, 32), be_const_int(163) }, - { be_const_key(ADC_CT_POWER, 82), be_const_int(153) }, - { be_const_key(OUTPUT_OPEN_DRAIN, -1), be_const_int(18) }, - { be_const_key(CC1101_GDO2, -1), be_const_int(143) }, - { be_const_key(SM2135_DAT, 28), be_const_int(127) }, - { be_const_key(digital_write, -1), be_const_func(gp_digital_write) }, - { be_const_key(GPS_TX, 68), be_const_int(137) }, - { be_const_key(TFMINIPLUS_RX, -1), be_const_int(235) }, - { be_const_key(RC522_CS, -1), be_const_int(196) }, - { be_const_key(PMS5003_TX, -1), be_const_int(52) }, - { be_const_key(DDS2382_TX, -1), be_const_int(122) }, - { be_const_key(IEM3000_RX, 133), be_const_int(180) }, - { be_const_key(ZIGBEE_RX, -1), be_const_int(112) }, { be_const_key(ZIGBEE_RST, -1), be_const_int(181) }, - { be_const_key(HPMA_RX, -1), be_const_int(134) }, - { be_const_key(SDS0X1_RX, -1), be_const_int(55) }, - { be_const_key(WEBCAM_RESET, -1), be_const_int(155) }, - { be_const_key(CNTR1, 249), be_const_int(11) }, - { be_const_key(ADC_LIGHT, 231), be_const_int(149) }, - { be_const_key(HRE_DATA, 34), be_const_int(107) }, - { be_const_key(OUTPUT_HI, -1), be_const_int(120) }, - { be_const_key(LED1_INV, 176), be_const_int(10) }, - { be_const_key(LMT01, -1), be_const_int(178) }, - { be_const_key(DSB, -1), be_const_int(41) }, - { be_const_key(CSE7766_RX, -1), be_const_int(97) }, - { be_const_key(SBR_RX, -1), be_const_int(57) }, - { be_const_key(PROJECTOR_CTRL_TX, 148), be_const_int(224) }, - { be_const_key(DI, 211), be_const_int(94) }, - { be_const_key(PZEM0XX_TX, -1), be_const_int(46) }, - { be_const_key(SENSOR_END, -1), be_const_int(240) }, - { be_const_key(A4988_ENA, 97), be_const_int(118) }, - { be_const_key(WEBCAM_PSRCS, 46), be_const_int(165) }, - { be_const_key(ELECTRIQ_MOODL_TX, -1), be_const_int(145) }, - { be_const_key(WEBCAM_XCLK, -1), be_const_int(156) }, - { be_const_key(PN532_RXD, -1), be_const_int(90) }, - { be_const_key(BL0940_RX, 195), be_const_int(170) }, - { be_const_key(PMS5003_RX, -1), be_const_int(53) }, - { be_const_key(HALLEFFECT, -1), be_const_int(237) }, - { be_const_key(PWM1_INV, 172), be_const_int(14) }, - { be_const_key(TASMOTACLIENT_RXD, -1), be_const_int(131) }, - { be_const_key(WEBCAM_SIOD, 110), be_const_int(157) }, - { be_const_key(TM1637CLK, 33), be_const_int(222) }, - { be_const_key(IRRECV, -1), be_const_int(34) }, - { be_const_key(SPI_MOSI, -1), be_const_int(22) }, - { be_const_key(TELEINFO_RX, 182), be_const_int(176) }, - { be_const_key(TASMOTACLIENT_RST_INV, -1), be_const_int(133) }, - { be_const_key(PROJECTOR_CTRL_RX, -1), be_const_int(225) }, - { be_const_key(WIEGAND_D0, -1), be_const_int(216) }, - { be_const_key(ADE7953_IRQ, -1), be_const_int(108) }, - { be_const_key(SPI_DC, -1), be_const_int(25) }, - { be_const_key(IRSEND, -1), be_const_int(33) }, - { be_const_key(TFMINIPLUS_TX, 87), be_const_int(234) }, - { be_const_key(I2C_SCL, -1), be_const_int(19) }, - { be_const_key(MAX7219DIN, -1), be_const_int(232) }, - { be_const_key(ROT1A_NP, -1), be_const_int(211) }, - { be_const_key(PZEM017_RX, 156), be_const_int(49) }, - { be_const_key(WINDMETER_SPEED, -1), be_const_int(168) }, - { be_const_key(RC522_RST, -1), be_const_int(191) }, - { be_const_key(SR04_ECHO, 89), be_const_int(59) }, - { be_const_key(BOILER_OT_TX, -1), be_const_int(167) }, - { be_const_key(ZIGBEE_TX, 104), be_const_int(111) }, - { be_const_key(REL1_INV, -1), be_const_int(8) }, - { be_const_key(WS2812, -1), be_const_int(43) }, - { be_const_key(BUZZER, 0), be_const_int(15) }, - { be_const_key(CC1101_GDO0, -1), be_const_int(142) }, - { be_const_key(SWT1_NP, -1), be_const_int(6) }, - { be_const_key(SSPI_DC, 49), be_const_int(30) }, - { be_const_key(ADC_RANGE, 128), be_const_int(152) }, - { be_const_key(OPTION_A, 174), be_const_int(194) }, - { be_const_key(SHELLY_DIMMER_RST_INV, -1), be_const_int(190) }, - { be_const_key(MGC3130_XFER, -1), be_const_int(73) }, - { be_const_key(VL53L0X_XSHUT1, 140), be_const_int(230) }, - { be_const_key(SSD1351_CS, -1), be_const_int(204) }, - { be_const_key(LEDLNK, 63), be_const_int(17) }, - { be_const_key(P9813_DAT, 67), be_const_int(193) }, - { be_const_key(pin_mode, 218), be_const_func(gp_pin_mode) }, - { be_const_key(RF_SENSOR, -1), be_const_int(75) }, - { be_const_key(TELEINFO_ENABLE, -1), be_const_int(177) }, - { be_const_key(RISING, -1), be_const_int(1) }, - { be_const_key(DHT11, -1), be_const_int(37) }, - { be_const_key(SDCARD_CS, -1), be_const_int(210) }, - { be_const_key(ROT1B, 169), be_const_int(103) }, - { be_const_key(TUYA_RX, -1), be_const_int(72) }, - { be_const_key(SSPI_CS, -1), be_const_int(29) }, - { be_const_key(DCKI, -1), be_const_int(95) }, - { be_const_key(XPT2046_CS, -1), be_const_int(227) }, - { be_const_key(DDSU666_RX, -1), be_const_int(125) }, - { be_const_key(A4988_STP, -1), be_const_int(117) }, - { be_const_key(SOLAXX1_RX, -1), be_const_int(110) }, - { be_const_key(NRG_SEL, -1), be_const_int(81) }, - { be_const_key(HX711_DAT, -1), be_const_int(69) }, - { be_const_key(SSPI_MISO, -1), be_const_int(26) }, - { be_const_key(WEBCAM_HSD, -1), be_const_int(164) }, - { be_const_key(GPS_RX, -1), be_const_int(136) }, - { be_const_key(NEOPOOL_RX, -1), be_const_int(219) }, - { be_const_key(PZEM016_RX, -1), be_const_int(48) }, - { be_const_key(CSE7761_TX, -1), be_const_int(228) }, - { be_const_key(OLED_RESET, -1), be_const_int(32) }, - { be_const_key(ADC_INPUT, 101), be_const_int(147) }, - { be_const_key(LE01MR_TX, 80), be_const_int(141) }, - { be_const_key(EPAPER29_CS, 238), be_const_int(202) }, - { be_const_key(DHT22, -1), be_const_int(38) }, - { be_const_key(BACKLIGHT, -1), be_const_int(31) }, - { be_const_key(NRG_CF1, -1), be_const_int(83) }, - { be_const_key(MCP39F5_RST, 1), be_const_int(88) }, - { be_const_key(SDM120_TX, -1), be_const_int(60) }, - { be_const_key(HLW_CF, -1), be_const_int(84) }, - { be_const_key(BOILER_OT_RX, -1), be_const_int(166) }, - { be_const_key(TUYA_TX, -1), be_const_int(71) }, - { be_const_key(NRF24_DC, -1), be_const_int(198) }, - { be_const_key(TM1638DIO, -1), be_const_int(65) }, - { be_const_key(IBEACON_RX, 179), be_const_int(115) }, - { be_const_key(DEEPSLEEP, -1), be_const_int(128) }, - { be_const_key(HJL_CF, -1), be_const_int(85) }, - { be_const_key(DDSU666_TX, 154), be_const_int(124) }, - { be_const_key(MHZ_TXD, -1), be_const_int(44) }, - { be_const_key(MIEL_HVAC_TX, 22), be_const_int(183) }, - { be_const_key(BS814_CLK, 209), be_const_int(214) }, - { be_const_key(SM16716_SEL, -1), be_const_int(93) }, - { be_const_key(KEY1_TC, 48), be_const_int(169) }, - { be_const_key(SWT1, 5), be_const_int(5) }, - { be_const_key(WEBCAM_DATA, 217), be_const_int(159) }, - { be_const_key(PULLDOWN, -1), be_const_int(8) }, - { be_const_key(A4988_MS1, -1), be_const_int(119) }, - { be_const_key(pin_used, -1), be_const_func(gp_pin_used) }, - { be_const_key(IBEACON_TX, 220), be_const_int(114) }, - { be_const_key(NRF24_CS, -1), be_const_int(197) }, - { be_const_key(RXD, -1), be_const_int(101) }, - { be_const_key(NEOPOOL_TX, -1), be_const_int(218) }, - { be_const_key(WEBCAM_SIOC, -1), be_const_int(158) }, - { be_const_key(TASMOTACLIENT_TXD, -1), be_const_int(130) }, - { be_const_key(MAX31855CS, -1), be_const_int(78) }, - { be_const_key(TM1638CLK, -1), be_const_int(64) }, - { be_const_key(ILI9341_CS, -1), be_const_int(199) }, - { be_const_key(PN532_TXD, -1), be_const_int(89) }, - { be_const_key(LOW, -1), be_const_int(0) }, - { be_const_key(SOLAXX1_TX, -1), be_const_int(109) }, - { be_const_key(SDM72_RX, -1), be_const_int(221) }, - { be_const_key(PULLUP, -1), be_const_int(4) }, - { be_const_key(MIEL_HVAC_RX, -1), be_const_int(184) }, - { be_const_key(MAX31855DO, 216), be_const_int(80) }, - { be_const_key(REL1, -1), be_const_int(7) }, - { be_const_key(HX711_SCK, -1), be_const_int(68) }, - { be_const_key(WEBCAM_PCLK, -1), be_const_int(162) }, - { be_const_key(ARIRFRCV, 175), be_const_int(98) }, - { be_const_key(SAIR_TX, -1), be_const_int(50) }, - { be_const_key(digital_read, -1), be_const_func(gp_digital_read) }, - { be_const_key(LE01MR_RX, 125), be_const_int(140) }, - { be_const_key(TX2X_TXD_BLACK, -1), be_const_int(70) }, - { be_const_key(KEY1_INV, -1), be_const_int(3) }, - { be_const_key(ADC_JOY, -1), be_const_int(104) }, - { be_const_key(ST7789_CS, -1), be_const_int(206) }, - { be_const_key(SSD1331_CS, -1), be_const_int(208) }, - { be_const_key(FALLING, -1), be_const_int(2) }, - { be_const_key(SPI_CS, -1), be_const_int(24) }, - { be_const_key(BUZZER_INV, -1), be_const_int(16) }, - { be_const_key(RFSEND, -1), be_const_int(35) }, - { be_const_key(WE517_RX, -1), be_const_int(186) }, - { be_const_key(INPUT_PULLUP, -1), be_const_int(5) }, - { be_const_key(A4988_DIR, 223), be_const_int(116) }, - { be_const_key(SSPI_SCLK, -1), be_const_int(28) }, - { be_const_key(EPAPER42_CS, 252), be_const_int(203) }, - { be_const_key(SDM120_RX, -1), be_const_int(61) }, - { be_const_key(DYP_RX, -1), be_const_int(182) }, - { be_const_key(EPD_DATA, -1), be_const_int(238) }, - { be_const_key(TXD, -1), be_const_int(100) }, - { be_const_key(P9813_CLK, -1), be_const_int(192) }, + { be_const_key(SPI_CLK, 231), be_const_int(23) }, { be_const_key(MHZ_RXD, -1), be_const_int(45) }, - { be_const_key(WIEGAND_D1, -1), be_const_int(217) }, - { be_const_key(SSD1331_DC, 90), be_const_int(209) }, - { be_const_key(ADC_PH, -1), be_const_int(213) }, - { be_const_key(CSE7766_TX, -1), be_const_int(96) }, - { be_const_key(ADC_BUTTON_INV, 81), be_const_int(151) }, + { be_const_key(SDM72_RX, -1), be_const_int(221) }, + { be_const_key(A4988_MS1, -1), be_const_int(119) }, + { be_const_key(DEEPSLEEP, -1), be_const_int(128) }, + { be_const_key(WIEGAND_D1, 192), be_const_int(217) }, + { be_const_key(WEBCAM_HSD, -1), be_const_int(164) }, + { be_const_key(TM1637DIO, -1), be_const_int(223) }, + { be_const_key(KEY1_INV_NP, 252), be_const_int(4) }, + { be_const_key(IBEACON_RX, -1), be_const_int(115) }, + { be_const_key(OUTPUT_LO, 243), be_const_int(121) }, + { be_const_key(RISING, 87), be_const_int(1) }, + { be_const_key(WEBCAM_PWDN, 10), be_const_int(154) }, + { be_const_key(BOILER_OT_TX, 32), be_const_int(167) }, { be_const_key(CNTR1_NP, -1), be_const_int(12) }, - { be_const_key(OUTPUT_LO, 85), be_const_int(121) }, - { be_const_key(SHELLY_DIMMER_BOOT0, -1), be_const_int(189) }, - { be_const_key(WEBCAM_PWDN, -1), be_const_int(154) }, - { be_const_key(KEY1, 246), be_const_int(1) }, - { be_const_key(RA8876_CS, 204), be_const_int(205) }, - { be_const_key(SDM630_RX, 171), be_const_int(63) }, - { be_const_key(ILI9341_DC, -1), be_const_int(200) }, - { be_const_key(LED1, 257), be_const_int(9) }, - { be_const_key(SPI_MISO, -1), be_const_int(21) }, - { be_const_key(SSD1351_DC, 30), be_const_int(226) }, - { be_const_key(MAX7219CLK, -1), be_const_int(231) }, - { be_const_key(MCP39F5_TX, -1), be_const_int(86) }, - { be_const_key(ROT1A, -1), be_const_int(102) }, - { be_const_key(TCP_RX, 42), be_const_int(172) }, - { be_const_key(WE517_TX, -1), be_const_int(185) }, - { be_const_key(SAIR_RX, 214), be_const_int(51) }, - { be_const_key(IEM3000_TX, 143), be_const_int(179) }, - { be_const_key(SDM630_TX, -1), be_const_int(62) }, - { be_const_key(KEY1_NP, 251), be_const_int(2) }, - { be_const_key(I2C_SDA, -1), be_const_int(20) }, - { be_const_key(MGC3130_RESET, -1), be_const_int(74) }, - { be_const_key(SI7021, -1), be_const_int(39) }, - { be_const_key(MAX7219CS, 151), be_const_int(233) }, - { be_const_key(SDM72_TX, -1), be_const_int(220) }, - { be_const_key(AS608_TX, 6), be_const_int(187) }, + { be_const_key(MAX7219DIN, -1), be_const_int(232) }, + { be_const_key(I2C_SDA, 42), be_const_int(20) }, + { be_const_key(DCKI, 188), be_const_int(95) }, + { be_const_key(I2S_IN_CLK, -1), be_const_int(247) }, { be_const_key(CHANGE, -1), be_const_int(4) }, + { be_const_key(pin_used, -1), be_const_func(gp_pin_used) }, + { be_const_key(HALLEFFECT, -1), be_const_int(237) }, + { be_const_key(ADC_TEMP, 112), be_const_int(148) }, + { be_const_key(SSPI_MOSI, 254), be_const_int(27) }, + { be_const_key(TASMOTACLIENT_RST, -1), be_const_int(132) }, + { be_const_key(ZIGBEE_RX, -1), be_const_int(112) }, + { be_const_key(ROT1B_NP, 107), be_const_int(212) }, + { be_const_key(SSD1351_CS, 149), be_const_int(204) }, + { be_const_key(MAX7219CLK, -1), be_const_int(231) }, + { be_const_key(SSD1331_DC, -1), be_const_int(209) }, + { be_const_key(SR04_TRIG, -1), be_const_int(58) }, + { be_const_key(TCP_RX, 187), be_const_int(172) }, + { be_const_key(SM16716_DAT, 91), be_const_int(92) }, + { be_const_key(OLED_RESET, 264), be_const_int(32) }, + { be_const_key(RDM6300_RX, -1), be_const_int(113) }, + { be_const_key(LOW, -1), be_const_int(0) }, + { be_const_key(ADC_BUTTON_INV, 79), be_const_int(151) }, + { be_const_key(SM16716_CLK, 76), be_const_int(91) }, + { be_const_key(SSPI_DC, -1), be_const_int(30) }, + { be_const_key(TFMINIPLUS_RX, -1), be_const_int(235) }, + { be_const_key(TM1638CLK, -1), be_const_int(64) }, + { be_const_key(BL0940_RX, -1), be_const_int(170) }, + { be_const_key(WEBCAM_PSCLK, -1), be_const_int(163) }, + { be_const_key(RFRECV, -1), be_const_int(36) }, + { be_const_key(GPS_RX, 124), be_const_int(136) }, + { be_const_key(DSB_OUT, -1), be_const_int(42) }, + { be_const_key(HPMA_TX, -1), be_const_int(135) }, + { be_const_key(SHELLY_DIMMER_RST_INV, -1), be_const_int(190) }, + { be_const_key(SDM72_TX, -1), be_const_int(220) }, + { be_const_key(HJL_CF, -1), be_const_int(85) }, + { be_const_key(IEM3000_RX, 24), be_const_int(180) }, + { be_const_key(KEY1_NP, -1), be_const_int(2) }, + { be_const_key(DDS2382_RX, -1), be_const_int(123) }, + { be_const_key(INPUT_PULLDOWN, -1), be_const_int(9) }, + { be_const_key(SSPI_MISO, -1), be_const_int(26) }, + { be_const_key(DDS2382_TX, -1), be_const_int(122) }, + { be_const_key(SDM630_RX, -1), be_const_int(63) }, + { be_const_key(SDS0X1_TX, 63), be_const_int(54) }, + { be_const_key(HPMA_RX, -1), be_const_int(134) }, + { be_const_key(DYP_RX, -1), be_const_int(182) }, + { be_const_key(NRG_CF1, 138), be_const_int(83) }, + { be_const_key(REL1_INV, 169), be_const_int(8) }, + { be_const_key(MCP39F5_RST, 131), be_const_int(88) }, + { be_const_key(I2S_OUT_SLCT, 170), be_const_int(245) }, + { be_const_key(ADE7953_IRQ, -1), be_const_int(108) }, + { be_const_key(REL1, -1), be_const_int(7) }, + { be_const_key(SOLAXX1_TX, 154), be_const_int(109) }, + { be_const_key(CSE7766_RX, -1), be_const_int(97) }, + { be_const_key(PROJECTOR_CTRL_TX, 29), be_const_int(224) }, + { be_const_key(PULLUP, -1), be_const_int(4) }, + { be_const_key(SPI_DC, 90), be_const_int(25) }, + { be_const_key(IBEACON_TX, -1), be_const_int(114) }, + { be_const_key(IEM3000_TX, 157), be_const_int(179) }, + { be_const_key(WEBCAM_PSRCS, -1), be_const_int(165) }, + { be_const_key(ELECTRIQ_MOODL_TX, -1), be_const_int(145) }, + { be_const_key(LED1_INV, -1), be_const_int(10) }, + { be_const_key(TASMOTACLIENT_RXD, 109), be_const_int(131) }, + { be_const_key(PN532_RXD, -1), be_const_int(90) }, + { be_const_key(ROT1A, 197), be_const_int(102) }, + { be_const_key(PROJECTOR_CTRL_RX, -1), be_const_int(225) }, + { be_const_key(EPAPER29_CS, -1), be_const_int(202) }, + { be_const_key(VL53L0X_XSHUT1, -1), be_const_int(230) }, + { be_const_key(DDSU666_RX, 22), be_const_int(125) }, + { be_const_key(SSPI_CS, -1), be_const_int(29) }, + { be_const_key(BACKLIGHT, 60), be_const_int(31) }, + { be_const_key(CC1101_GDO0, 225), be_const_int(142) }, + { be_const_key(INTERRUPT, -1), be_const_int(249) }, + { be_const_key(MP3_DFR562, -1), be_const_int(67) }, + { be_const_key(ROT1A_NP, -1), be_const_int(211) }, + { be_const_key(PZEM017_RX, -1), be_const_int(49) }, + { be_const_key(RC522_CS, 81), be_const_int(196) }, + { be_const_key(TASMOTACLIENT_RST_INV, -1), be_const_int(133) }, + { be_const_key(ETH_PHY_MDIO, -1), be_const_int(175) }, + { be_const_key(WE517_RX, -1), be_const_int(186) }, + { be_const_key(LMT01, -1), be_const_int(178) }, + { be_const_key(ILI9488_CS, -1), be_const_int(201) }, + { be_const_key(I2C_SCL, 0), be_const_int(19) }, + { be_const_key(TM1638STB, -1), be_const_int(66) }, + { be_const_key(ETH_PHY_MDC, -1), be_const_int(174) }, + { be_const_key(WE517_TX, 96), be_const_int(185) }, + { be_const_key(IRSEND, -1), be_const_int(33) }, + { be_const_key(I2S_OUT_CLK, -1), be_const_int(244) }, + { be_const_key(SPI_CS, -1), be_const_int(24) }, + { be_const_key(SWT1, -1), be_const_int(5) }, + { be_const_key(HM10_RX, -1), be_const_int(138) }, + { be_const_key(WEBCAM_HREF, -1), be_const_int(161) }, + { be_const_key(OPEN_DRAIN, -1), be_const_int(16) }, + { be_const_key(AS608_TX, -1), be_const_int(187) }, + { be_const_key(SSPI_SCLK, -1), be_const_int(28) }, + { be_const_key(A4988_DIR, -1), be_const_int(116) }, + { be_const_key(SHELLY_DIMMER_BOOT0, -1), be_const_int(189) }, + { be_const_key(I2S_OUT_DATA, -1), be_const_int(243) }, + { be_const_key(MIEL_HVAC_TX, -1), be_const_int(183) }, + { be_const_key(WEBCAM_SIOC, 41), be_const_int(158) }, + { be_const_key(RF_SENSOR, 57), be_const_int(75) }, + { be_const_key(AZ_TXD, -1), be_const_int(76) }, + { be_const_key(A4988_ENA, -1), be_const_int(118) }, + { be_const_key(DHT22, -1), be_const_int(38) }, + { be_const_key(TASMOTACLIENT_TXD, -1), be_const_int(130) }, + { be_const_key(TELEINFO_ENABLE, 62), be_const_int(177) }, + { be_const_key(NRF24_CS, -1), be_const_int(197) }, + { be_const_key(HRE_CLOCK, -1), be_const_int(106) }, + { be_const_key(NEOPOOL_RX, 158), be_const_int(219) }, + { be_const_key(HIGH, 237), be_const_int(1) }, + { be_const_key(HLW_CF, 53), be_const_int(84) }, + { be_const_key(AZ_RXD, -1), be_const_int(77) }, + { be_const_key(HM10_TX, 167), be_const_int(139) }, + { be_const_key(LEDLNK, 155), be_const_int(17) }, + { be_const_key(PWM1, -1), be_const_int(13) }, + { be_const_key(BS814_CLK, -1), be_const_int(214) }, + { be_const_key(TFMINIPLUS_TX, 99), be_const_int(234) }, + { be_const_key(WEBCAM_PCLK, -1), be_const_int(162) }, + { be_const_key(DSB, -1), be_const_int(41) }, + { be_const_key(NONE, -1), be_const_int(0) }, + { be_const_key(pin, 19), be_const_func(gp_pin) }, + { be_const_key(PN532_TXD, -1), be_const_int(89) }, + { be_const_key(SENSOR_END, 222), be_const_int(250) }, + { be_const_key(SM2135_CLK, -1), be_const_int(126) }, + { be_const_key(TX2X_TXD_BLACK, -1), be_const_int(70) }, + { be_const_key(ZEROCROSS, -1), be_const_int(236) }, + { be_const_key(ADC_INPUT, -1), be_const_int(147) }, + { be_const_key(RC522_RST, -1), be_const_int(191) }, + { be_const_key(SSD1331_CS, -1), be_const_int(208) }, + { be_const_key(BS814_DAT, -1), be_const_int(215) }, + { be_const_key(PULLDOWN, -1), be_const_int(8) }, + { be_const_key(I2S_IN_SLCT, 105), be_const_int(248) }, + { be_const_key(OPTION_A, -1), be_const_int(194) }, + { be_const_key(DI, -1), be_const_int(94) }, + { be_const_key(PZEM004_RX, -1), be_const_int(47) }, + { be_const_key(SDCARD_CS, -1), be_const_int(210) }, + { be_const_key(ZIGBEE_TX, 94), be_const_int(111) }, + { be_const_key(ST7789_DC, 50), be_const_int(207) }, + { be_const_key(P9813_DAT, 214), be_const_int(193) }, + { be_const_key(EXS_ENABLE, 56), be_const_int(129) }, + { be_const_key(SSPI_MAX31865_CS1, 147), be_const_int(105) }, + { be_const_key(PMS5003_RX, -1), be_const_int(53) }, + { be_const_key(pin_mode, -1), be_const_func(gp_pin_mode) }, + { be_const_key(SAIR_TX, 4), be_const_int(50) }, + { be_const_key(CSE7761_RX, 102), be_const_int(229) }, + { be_const_key(SBR_RX, 47), be_const_int(57) }, + { be_const_key(SOLAXX1_RX, -1), be_const_int(110) }, + { be_const_key(KEY1, 5), be_const_int(1) }, + { be_const_key(GPS_TX, 227), be_const_int(137) }, + { be_const_key(EPD_DATA, -1), be_const_int(238) }, + { be_const_key(WS2812, -1), be_const_int(43) }, + { be_const_key(PZEM0XX_TX, -1), be_const_int(46) }, + { be_const_key(WINDMETER_SPEED, -1), be_const_int(168) }, + { be_const_key(TUYA_RX, 199), be_const_int(72) }, + { be_const_key(NRG_SEL, -1), be_const_int(81) }, + { be_const_key(PZEM016_RX, 13), be_const_int(48) }, + { be_const_key(KEY1_PD, -1), be_const_int(240) }, + { be_const_key(LE01MR_RX, -1), be_const_int(140) }, + { be_const_key(ADC_PH, -1), be_const_int(213) }, + { be_const_key(SDM120_TX, -1), be_const_int(60) }, + { be_const_key(HX711_DAT, -1), be_const_int(69) }, + { be_const_key(CNTR1, 132), be_const_int(11) }, + { be_const_key(PWM1_INV, 184), be_const_int(14) }, + { be_const_key(RFSEND, 182), be_const_int(35) }, + { be_const_key(RXD, 194), be_const_int(101) }, + { be_const_key(SDM120_RX, -1), be_const_int(61) }, + { be_const_key(SWT1_NP, -1), be_const_int(6) }, + { be_const_key(MAX31855CLK, -1), be_const_int(79) }, + { be_const_key(DDSU666_TX, -1), be_const_int(124) }, + { be_const_key(MHZ_TXD, -1), be_const_int(44) }, + { be_const_key(OUTPUT_HI, -1), be_const_int(120) }, + { be_const_key(SM16716_SEL, -1), be_const_int(93) }, + { be_const_key(KEY1_INV_PD, -1), be_const_int(241) }, + { be_const_key(BOILER_OT_RX, 9), be_const_int(166) }, + { be_const_key(WEBCAM_SIOD, 78), be_const_int(157) }, + { be_const_key(SI7021, -1), be_const_int(39) }, + { be_const_key(MIEL_HVAC_RX, -1), be_const_int(184) }, + { be_const_key(P9813_CLK, -1), be_const_int(192) }, + { be_const_key(NRG_SEL_INV, 232), be_const_int(82) }, + { be_const_key(INPUT, 85), be_const_int(239) }, + { be_const_key(AS608_RX, -1), be_const_int(188) }, + { be_const_key(SR04_ECHO, -1), be_const_int(59) }, + { be_const_key(CSE7761_TX, -1), be_const_int(228) }, + { be_const_key(digital_write, -1), be_const_func(gp_digital_write) }, + { be_const_key(MAX31855DO, -1), be_const_int(80) }, + { be_const_key(CC1101_GDO2, -1), be_const_int(143) }, + { be_const_key(ETH_PHY_POWER, -1), be_const_int(173) }, + { be_const_key(ILI9341_CS, -1), be_const_int(199) }, + { be_const_key(OUTPUT_OPEN_DRAIN, -1), be_const_int(18) }, + { be_const_key(TM1637CLK, -1), be_const_int(222) }, + { be_const_key(SPI_MISO, 176), be_const_int(21) }, + { be_const_key(KEY1_INV, -1), be_const_int(3) }, + { be_const_key(PMS5003_TX, 75), be_const_int(52) }, + { be_const_key(A4988_STP, -1), be_const_int(117) }, + { be_const_key(WEBCAM_VSYNC, -1), be_const_int(160) }, + { be_const_key(SWT1_PD, -1), be_const_int(242) }, + { be_const_key(AS3935, -1), be_const_int(146) }, + { be_const_key(CSE7766_TX, 100), be_const_int(96) }, + { be_const_key(NEOPOOL_TX, 148), be_const_int(218) }, + { be_const_key(ADC_RANGE, 72), be_const_int(152) }, + { be_const_key(ILI9341_DC, -1), be_const_int(200) }, + { be_const_key(DHT11, -1), be_const_int(37) }, + { be_const_key(SM2135_DAT, 238), be_const_int(127) }, + { be_const_key(MCP39F5_RX, 211), be_const_int(87) }, + { be_const_key(HX711_SCK, 7), be_const_int(68) }, + { be_const_key(SAIR_RX, -1), be_const_int(51) }, + { be_const_key(SDS0X1_RX, -1), be_const_int(55) }, + { be_const_key(ARIRFSEL, 266), be_const_int(99) }, + { be_const_key(WEBCAM_RESET, -1), be_const_int(155) }, + { be_const_key(BUZZER_INV, -1), be_const_int(16) }, + { be_const_key(DHT11_OUT, -1), be_const_int(40) }, + { be_const_key(FALLING, -1), be_const_int(2) }, + { be_const_key(MAX7219CS, -1), be_const_int(233) }, + { be_const_key(ARIRFRCV, -1), be_const_int(98) }, + { be_const_key(ADC_CT_POWER, -1), be_const_int(153) }, + { be_const_key(HRXL_RX, -1), be_const_int(144) }, + { be_const_key(WEBCAM_DATA, 58), be_const_int(159) }, + { be_const_key(TUYA_TX, -1), be_const_int(71) }, + { be_const_key(SPI_MOSI, -1), be_const_int(22) }, + { be_const_key(WIEGAND_D0, 33), be_const_int(216) }, + { be_const_key(digital_read, 137), be_const_func(gp_digital_read) }, + { be_const_key(ROT1B, -1), be_const_int(103) }, + { be_const_key(FTC532, -1), be_const_int(195) }, + { be_const_key(HRE_DATA, 35), be_const_int(107) }, + { be_const_key(I2S_IN_DATA, -1), be_const_int(246) }, + { be_const_key(TCP_TX, 26), be_const_int(171) }, + { be_const_key(ST7789_CS, -1), be_const_int(206) }, + { be_const_key(ADC_JOY, -1), be_const_int(104) }, + { be_const_key(OUTPUT, 229), be_const_int(2) }, + { be_const_key(NRF24_DC, -1), be_const_int(198) }, + { be_const_key(IRRECV, 27), be_const_int(34) }, + { be_const_key(MCP39F5_TX, 230), be_const_int(86) }, + { be_const_key(TELEINFO_RX, 52), be_const_int(176) }, + { be_const_key(SSD1351_DC, -1), be_const_int(226) }, + { be_const_key(TM1638DIO, -1), be_const_int(65) }, + { be_const_key(TXD, 139), be_const_int(100) }, + { be_const_key(XPT2046_CS, -1), be_const_int(227) }, + { be_const_key(LED1, 212), be_const_int(9) }, + { be_const_key(LEDLNK_INV, -1), be_const_int(18) }, + { be_const_key(SBR_TX, -1), be_const_int(56) }, + { be_const_key(RA8876_CS, -1), be_const_int(205) }, + { be_const_key(KEY1_TC, 180), be_const_int(169) }, + { be_const_key(INPUT_PULLUP, -1), be_const_int(5) }, + { be_const_key(EPAPER42_CS, -1), be_const_int(203) }, + { be_const_key(BUZZER, -1), be_const_int(15) }, + { be_const_key(WEBCAM_XCLK, -1), be_const_int(156) }, + { be_const_key(ADC_LIGHT, 134), be_const_int(149) }, + { be_const_key(SDM630_TX, 69), be_const_int(62) }, + { be_const_key(MGC3130_XFER, 260), be_const_int(73) }, + { be_const_key(MGC3130_RESET, 219), be_const_int(74) }, + { be_const_key(MAX31855CS, -1), be_const_int(78) }, + { be_const_key(LE01MR_TX, -1), be_const_int(141) }, }; static be_define_const_map( m_libgpio_map, - 258 + 268 ); static be_define_const_module( diff --git a/lib/libesp32/Berry/generate/be_fixed_introspect.h b/lib/libesp32/Berry/generate/be_fixed_introspect.h new file mode 100644 index 000000000..78b840ab6 --- /dev/null +++ b/lib/libesp32/Berry/generate/be_fixed_introspect.h @@ -0,0 +1,19 @@ +#include "be_constobj.h" + +static be_define_const_map_slots(m_libintrospect_map) { + { be_const_key(members, -1), be_const_func(m_attrlist) }, + { be_const_key(set, -1), be_const_func(m_setmember) }, + { be_const_key(get, -1), be_const_func(m_findmember) }, +}; + +static be_define_const_map( + m_libintrospect_map, + 3 +); + +static be_define_const_module( + m_libintrospect, + "introspect" +); + +BE_EXPORT_VARIABLE be_define_const_native_module(introspect, NULL); diff --git a/lib/libesp32/Berry/src/be_api.c b/lib/libesp32/Berry/src/be_api.c index 14236a5ce..28323c04c 100644 --- a/lib/libesp32/Berry/src/be_api.c +++ b/lib/libesp32/Berry/src/be_api.c @@ -36,7 +36,7 @@ static void class_init(bvm *vm, bclass *c, const bnfuncinfo *lib) if (lib->function) { /* method */ be_prim_method_bind(vm, c, s, lib->function); } else { - be_member_bind(vm, c, s); /* member */ + be_member_bind(vm, c, s, btrue); /* member */ } ++lib; } @@ -208,6 +208,12 @@ BERRY_API bbool be_isinstance(bvm *vm, int index) return var_isinstance(v); } +BERRY_API bbool be_ismodule(bvm *vm, int index) +{ + bvalue *v = be_indexof(vm, index); + return var_ismodule(v); +} + BERRY_API bbool be_islist(bvm *vm, int index) { bvalue *v = be_indexof(vm, index); @@ -643,6 +649,9 @@ static int ins_member(bvm *vm, int index, const char *k) if (var_isinstance(o)) { binstance *obj = var_toobj(o); type = be_instance_member(vm, obj, be_newstr(vm, k), top); + if (type == BE_NONE) { + type = BE_NIL; + } } return type; } diff --git a/lib/libesp32/Berry/src/be_bytecode.c b/lib/libesp32/Berry/src/be_bytecode.c index b8242d326..e6d69a0dd 100644 --- a/lib/libesp32/Berry/src/be_bytecode.c +++ b/lib/libesp32/Berry/src/be_bytecode.c @@ -129,7 +129,7 @@ static bstring** save_members(bvm *vm, void *fp, bclass *c, int nvar) } while ((node = be_map_next(members, &iter)) != NULL) { be_assert(var_isstr(&node->key)); - if (var_isint(&node->value)) { /* cache member name */ + if (var_isindex(&node->value)) { /* cache member name */ if (vars == NULL) { return NULL; /* should never be executed */ } @@ -405,7 +405,7 @@ static void load_class(bvm *vm, void *fp, bvalue *v) } for (count = 0; count < nvar; ++count) { /* load member-variable table */ bstring *name = cache_string(vm, fp); - be_member_bind(vm, c, name); + be_member_bind(vm, c, name, btrue); be_stackpop(vm, 1); /* pop the cached string */ } } diff --git a/lib/libesp32/Berry/src/be_byteslib.c b/lib/libesp32/Berry/src/be_byteslib.c index 5d18fdd0b..c171ccf02 100644 --- a/lib/libesp32/Berry/src/be_byteslib.c +++ b/lib/libesp32/Berry/src/be_byteslib.c @@ -372,7 +372,7 @@ static int m_fromstring(bvm *vm) int argc = be_top(vm); if (argc >= 2 && be_isstring(vm, 2)) { const char *s = be_tostring(vm, 2); - size_t len = strlen(s); + size_t len = be_strlen(vm, 2); buf_impl * buf = bytes_check_data(vm, 0); buf = bytes_resize(vm, buf, len); /* resize if needed */ if (len > buf->size) { len = buf->size; } /* avoid overflow */ @@ -753,6 +753,20 @@ BERRY_API const void *be_tobytes(bvm *vm, int rel_index, size_t *len) return NULL; } +BERRY_API bbool be_isbytes(bvm *vm, int rel_index) +{ + bbool ret = bfalse; + int index = be_absindex(vm, rel_index); + if (be_isinstance(vm, index)) { + be_getbuiltin(vm, "bytes"); + if (be_isderived(vm, index)) { + ret = btrue; + } + be_pop(vm, 1); + } + return ret; +} + /* Helper code to compile bytecode diff --git a/lib/libesp32/Berry/src/be_class.c b/lib/libesp32/Berry/src/be_class.c index ffb196372..720bba05c 100644 --- a/lib/libesp32/Berry/src/be_class.c +++ b/lib/libesp32/Berry/src/be_class.c @@ -53,18 +53,25 @@ int be_class_attribute(bvm *vm, bclass *c, bstring *attr) } } } - return BE_NIL; + return BE_NONE; } -void be_member_bind(bvm *vm, bclass *c, bstring *name) +void be_member_bind(bvm *vm, bclass *c, bstring *name, bbool var) { bvalue *attr; set_fixed(name); check_members(vm, c); attr = be_map_insertstr(vm, c->members, name, NULL); restore_fixed(name); - attr->v.i = c->nvar++; - attr->type = MT_VARIABLE; + if (var) { + /* this is an instance variable so we set it as MT_VARIABLE */ + attr->v.i = c->nvar++; + attr->type = MT_VARIABLE; + } else { + /* this is a static class constant, leave it as BE_NIL */ + attr->v.i = 0; + attr->type = BE_NIL; + } } void be_method_bind(bvm *vm, bclass *c, bstring *name, bproto *p) @@ -135,6 +142,23 @@ static binstance* instance_member(bvm *vm, return NULL; } +static bclass* class_member(bvm *vm, + bclass *obj, bstring *name, bvalue *dst) +{ + for (; obj; obj = obj->super) { + bmap *members = obj->members; + if (members) { + bvalue *v = be_map_findstr(vm, members, name); + if (v) { + *dst = *v; + return obj; + } + } + } + var_setnil(dst); + return NULL; +} + void be_class_upvalue_init(bvm *vm, bclass *c) { bmap *mbr = c->members; @@ -216,7 +240,24 @@ int be_instance_member(bvm *vm, binstance *obj, bstring *name, bvalue *dst) if (obj && type == MT_VARIABLE) { *dst = obj->members[dst->v.i]; } - return type; + if (obj) { + return type; + } else { + return BE_NONE; + } +} + +int be_class_member(bvm *vm, bclass *obj, bstring *name, bvalue *dst) +{ + int type; + be_assert(name != NULL); + obj = class_member(vm, obj, name, dst); + type = var_type(dst); + if (obj) { + return type; + } else { + return BE_NONE; + } } bbool be_instance_setmember(bvm *vm, binstance *o, bstring *name, bvalue *src) @@ -246,3 +287,15 @@ bbool be_instance_setmember(bvm *vm, binstance *o, bstring *name, bvalue *src) } return bfalse; } + +bbool be_class_setmember(bvm *vm, bclass *o, bstring *name, bvalue *src) +{ + bvalue v; + be_assert(name != NULL); + bclass * obj = class_member(vm, o, name, &v); + if (obj && !var_istype(&v, MT_VARIABLE)) { + be_map_insertstr(vm, obj->members, name, src); + return btrue; + } + return bfalse; +} diff --git a/lib/libesp32/Berry/src/be_class.h b/lib/libesp32/Berry/src/be_class.h index 3b9458013..3186afd66 100644 --- a/lib/libesp32/Berry/src/be_class.h +++ b/lib/libesp32/Berry/src/be_class.h @@ -10,7 +10,7 @@ #include "be_object.h" -#define MT_VARIABLE BE_INT +#define MT_VARIABLE BE_INDEX #define MT_METHOD BE_CLOSURE #define MT_PRIMMETHOD BE_NTVFUNC @@ -52,7 +52,7 @@ struct binstance { bclass* be_newclass(bvm *vm, bstring *name, bclass *super); void be_class_compress(bvm *vm, bclass *c); int be_class_attribute(bvm *vm, bclass *c, bstring *attr); -void be_member_bind(bvm *vm, bclass *c, bstring *name); +void be_member_bind(bvm *vm, bclass *c, bstring *name, bbool var); void be_method_bind(bvm *vm, bclass *c, bstring *name, bproto *p); 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); @@ -60,6 +60,8 @@ 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); int be_instance_member(bvm *vm, binstance *obj, bstring *name, bvalue *dst); +int be_class_member(bvm *vm, bclass *obj, bstring *name, bvalue *dst); bbool be_instance_setmember(bvm *vm, binstance *obj, bstring *name, bvalue *src); +bbool be_class_setmember(bvm *vm, bclass *obj, bstring *name, bvalue *src); #endif diff --git a/lib/libesp32/Berry/src/be_code.c b/lib/libesp32/Berry/src/be_code.c index 8d4a62b05..e4f238d5c 100644 --- a/lib/libesp32/Berry/src/be_code.c +++ b/lib/libesp32/Berry/src/be_code.c @@ -14,7 +14,6 @@ #include "be_var.h" #include "be_exec.h" #include "be_vm.h" -#include #define NOT_MASK (1 << 0) #define NOT_EXPR (1 << 1) @@ -376,6 +375,9 @@ static int var2reg(bfuncinfo *finfo, bexpdesc *e, int dst) case ETGLOBAL: codeABx(finfo, OP_GETGBL, dst, e->v.idx); break; + case ETNGLOBAL: + codeABC(finfo, OP_GETNGBL, dst, e->v.ss.idx, 0); + break; case ETUPVAL: codeABx(finfo, OP_GETUPV, dst, e->v.idx); break; @@ -552,6 +554,15 @@ int be_code_unop(bfuncinfo *finfo, int op, bexpdesc *e) return 0; } +static void setbgblvar(bfuncinfo *finfo, bopcode op, bexpdesc *e1, int src) +{ + if (isK(src)) { /* move const to register */ + code_move(finfo, finfo->freereg, src); + src = finfo->freereg; + } + codeABC(finfo, op, src, e1->v.idx, 0); +} + static void setsupvar(bfuncinfo *finfo, bopcode op, bexpdesc *e1, int src) { if (isK(src)) { /* move const to register */ @@ -589,6 +600,9 @@ int be_code_setvar(bfuncinfo *finfo, bexpdesc *e1, bexpdesc *e2) case ETGLOBAL: /* store to grobal R(A) -> G(Bx) */ setsupvar(finfo, OP_SETGBL, e1, src); break; + case ETNGLOBAL: /* store to grobal R(A) -> G(Bx) */ + setbgblvar(finfo, OP_SETNGBL, e1, src); + break; case ETUPVAL: setsupvar(finfo, OP_SETUPV, e1, src); break; @@ -711,6 +725,11 @@ static void package_suffix(bfuncinfo *finfo, bexpdesc *c, bexpdesc *k) c->v.ss.idx = key; } +int be_code_nglobal(bfuncinfo *finfo, bexpdesc *k) +{ + return exp2anyreg(finfo, k); +} + void be_code_member(bfuncinfo *finfo, bexpdesc *c, bexpdesc *k) { package_suffix(finfo, c, k); diff --git a/lib/libesp32/Berry/src/be_code.h b/lib/libesp32/Berry/src/be_code.h index 8dfc21501..f7fdb2d55 100644 --- a/lib/libesp32/Berry/src/be_code.h +++ b/lib/libesp32/Berry/src/be_code.h @@ -31,6 +31,7 @@ void be_code_closure(bfuncinfo *finfo, bexpdesc *e, int idx); void be_code_close(bfuncinfo *finfo, int isret); void be_code_class(bfuncinfo *finfo, bexpdesc *dst, bclass *c); void be_code_ret(bfuncinfo *finfo, bexpdesc *e); +int be_code_nglobal(bfuncinfo *finfo, bexpdesc *k); void be_code_member(bfuncinfo *finfo, bexpdesc *e1, bexpdesc *e2); void be_code_index(bfuncinfo *finfo, bexpdesc *c, bexpdesc *k); void be_code_setsuper(bfuncinfo *finfo, bexpdesc *c, bexpdesc *s); diff --git a/lib/libesp32/Berry/src/be_constobj.h b/lib/libesp32/Berry/src/be_constobj.h index 8efbb0e09..b1a5165ff 100644 --- a/lib/libesp32/Berry/src/be_constobj.h +++ b/lib/libesp32/Berry/src/be_constobj.h @@ -37,16 +37,36 @@ extern "C" { .type = BE_FUNCTION \ } +#define be_const_nil() { \ + .v.i = 0, \ + .type = BE_NIL \ +} + #define be_const_int(_val) { \ .v.i = (bint)(_val), \ .type = BE_INT \ } +#define be_const_index(_val) { \ + .v.i = (bint)(_val), \ + .type = BE_INDEX \ +} + #define be_const_real(_val) { \ .v.r = (breal)(_val), \ .type = BE_REAL \ } +#define be_const_real_hex(_val) { \ + .v.p = (void*)(_val), \ + .type = BE_REAL \ +} + +#define be_const_bool(_val) { \ + .v.b = (bbool)(_val), \ + .type = BE_BOOL \ +} + #define be_const_str(_str) { \ .v.s = (bstring*)(_str), \ .type = BE_STRING \ @@ -83,7 +103,7 @@ const bmap _name = { \ const bclass _name = { \ be_const_header(BE_CLASS), \ .nvar = _nvar, \ - .super = (bclass*)_super, \ + .super = _super, \ .members = (bmap*)&_name##_map, \ .name = (bstring*)&be_const_str_##_name_ \ } @@ -122,6 +142,39 @@ const bntvmodule be_native_module(_module) = { \ .init = _init \ } +/* defines needed for solidified classes */ +#define be_local_class(_name, _nvar, _super, _map, _cname) \ + const bclass be_class_##_name = { \ + be_const_header(BE_CLASS), \ + .nvar = _nvar, \ + .super = (bclass*)_super, \ + .members = (bmap*)_map, \ + .name = _cname \ +} + +#define be_nested_map(_size, _slots) \ + & (const bmap) { \ + be_const_header(BE_MAP), \ + .slots = _slots, \ + .lastfree = NULL, \ + .size = _size, \ + .count = _size \ + } + +#define be_nested_string(_str, _hash, _len) \ + { \ + { .s=(be_nested_const_str(_str, _hash, _len )) \ + }, \ + BE_STRING \ + } + +#define be_nested_key(_str, _hash, _len, _next) \ + { \ + { .s=(be_nested_const_str(_str, _hash, _len )) }, \ + BE_STRING, \ + (uint32_t)(_next) & 0xFFFFFF \ + } + #else #define be_const_key(_str, _next) { \ @@ -135,16 +188,36 @@ const bntvmodule be_native_module(_module) = { \ BE_FUNCTION \ } +#define be_const_nil() { \ + bvaldata(0), \ + BE_NIL \ +} + #define be_const_int(_val) { \ bvaldata(bint(_val)), \ BE_INT \ } +#define be_const_bool(_val) { \ + bvaldata(bbool(_val)), \ + BE_BOOL \ +} + +#define be_const_index(_val) { \ + bvaldata(bint(_val)), \ + BE_INDEX \ +} + #define be_const_real(_val) { \ bvaldata(breal(_val)), \ BE_REAL \ } +#define be_const_real_hex(_val) { \ + bvaldata((void*)(_val)), \ + BE_REAL \ +} + #define be_const_str(_string) { \ bvaldata(bstring(_string)), \ BE_STRING \ diff --git a/lib/libesp32/Berry/src/be_debug.c b/lib/libesp32/Berry/src/be_debug.c index f46446199..469e30b63 100644 --- a/lib/libesp32/Berry/src/be_debug.c +++ b/lib/libesp32/Berry/src/be_debug.c @@ -62,6 +62,9 @@ void be_print_inst(binstruction ins, int pc) case OP_OR: case OP_XOR: case OP_SHL: case OP_SHR: logbuf("%s\tR%d\tR%d\tR%d", opc2str(op), IGET_RA(ins), IGET_RKB(ins), IGET_RKC(ins)); break; + case OP_GETNGBL: case OP_SETNGBL: + logbuf("%s\tR%d\tR%d", opc2str(op), IGET_RA(ins), IGET_RKB(ins)); + break; case OP_GETGBL: case OP_SETGBL: logbuf("%s\tR%d\tG%d", opc2str(op), IGET_RA(ins), IGET_Bx(ins)); break; diff --git a/lib/libesp32/Berry/src/be_filelib.c b/lib/libesp32/Berry/src/be_filelib.c index 2a489555a..87691809b 100644 --- a/lib/libesp32/Berry/src/be_filelib.c +++ b/lib/libesp32/Berry/src/be_filelib.c @@ -16,10 +16,17 @@ static int i_write(bvm *vm) { be_getmember(vm, 1, ".p"); - if(be_iscomptr(vm, -1) && be_isstring(vm, 2)) { + if(be_iscomptr(vm, -1) && (be_isstring(vm, 2) || be_isbytes(vm, 2))) { void *fh = be_tocomptr(vm, -1); - const char *data = be_tostring(vm, 2); - be_fwrite(fh, data, be_strlen(vm, 2)); + size_t size = 0; + const char *data = NULL; + if (be_isstring(vm, 2)) { + data = be_tostring(vm, 2); + size = be_strlen(vm, 2); + } else { + data = be_tobytes(vm, 2, &size); + } + be_fwrite(fh, data, size); } be_return_nil(vm); } @@ -52,6 +59,43 @@ static int i_read(bvm *vm) be_return_nil(vm); } +static int i_readbytes(bvm *vm) +{ + int argc = be_top(vm); + be_getmember(vm, 1, ".p"); + if (be_iscomptr(vm, -1)) { + void *fh = be_tocomptr(vm, -1); + size_t size = readsize(vm, argc, fh); + if (size) { + /* avoid double allocation, using directly the internal buffer of bytes() */ + be_getbuiltin(vm, "bytes"); + be_pushint(vm, size); + be_call(vm, 1); /* call bytes() constructor with pre-sized buffer */ + be_pop(vm, 1); /* bytes() instance is at top */ + + be_getmember(vm, -1, "resize"); + be_pushvalue(vm, -2); + be_pushint(vm, size); + be_call(vm, 2); /* call b.resize(size) */ + be_pop(vm, 3); /* bytes() instance is at top */ + + char *buffer = (char*) be_tobytes(vm, -1, NULL); /* we get the address of the internam buffer of size 'size' */ + size = be_fread(fh, buffer, size); + + /* resize if something went wrong */ + be_getmember(vm, -1, "resize"); + be_pushvalue(vm, -2); + be_pushint(vm, size); + be_call(vm, 2); /* call b.resize(size) */ + be_pop(vm, 3); /* bytes() instance is at top */ + } else { + be_pushbytes(vm, NULL, 0); + } + be_return(vm); + } + be_return_nil(vm); +} + static int i_readline(bvm *vm) { be_getmember(vm, 1, ".p"); @@ -144,6 +188,7 @@ int be_nfunc_open(bvm *vm) { ".p", NULL }, { "write", i_write }, { "read", i_read }, + { "readbytes", i_readbytes }, { "readline", i_readline }, { "seek", i_seek }, { "tell", i_tell }, diff --git a/lib/libesp32/Berry/src/be_gc.c b/lib/libesp32/Berry/src/be_gc.c index fca6ad45d..8e6ac005e 100644 --- a/lib/libesp32/Berry/src/be_gc.c +++ b/lib/libesp32/Berry/src/be_gc.c @@ -339,12 +339,19 @@ static void free_lstring(bvm *vm, bgcobject *obj) } } +static void free_instance(bvm *vm, bgcobject *obj) +{ + binstance *o = cast_instance(obj); + int nvar = be_instance_member_count(o); + be_free(vm, obj, sizeof(binstance) + sizeof(bvalue) * (nvar - 1)); +} + static void free_object(bvm *vm, bgcobject *obj) { switch (obj->type) { case BE_STRING: free_lstring(vm, obj); break; /* long string */ case BE_CLASS: be_free(vm, obj, sizeof(bclass)); break; - case BE_INSTANCE: be_free(vm, obj, sizeof(binstance)); break; + case BE_INSTANCE: free_instance(vm, obj); break; case BE_MAP: be_map_delete(vm, cast_map(obj)); break; case BE_LIST: be_list_delete(vm, cast_list(obj)); break; case BE_CLOSURE: free_closure(vm, obj); break; diff --git a/lib/libesp32/Berry/src/be_introspectlib.c b/lib/libesp32/Berry/src/be_introspectlib.c new file mode 100644 index 000000000..fc9dac898 --- /dev/null +++ b/lib/libesp32/Berry/src/be_introspectlib.c @@ -0,0 +1,100 @@ +/******************************************************************** +** Copyright (c) 2018-2020 Guan Wenliang +** This file is part of the Berry default interpreter. +** skiars@qq.com, https://github.com/Skiars/berry +** See Copyright Notice in the LICENSE file or at +** https://github.com/Skiars/berry/blob/master/LICENSE +********************************************************************/ +#include "be_object.h" +#include "be_module.h" +#include "be_string.h" +#include "be_vector.h" +#include "be_class.h" +#include "be_debug.h" +#include "be_map.h" +#include "be_vm.h" +#include + +#if BE_USE_INTROSPECT_MODULE + +#define global(vm) ((vm)->gbldesc.global) +#define builtin(vm) ((vm)->gbldesc.builtin) + +static void dump_map_keys(bvm *vm, bmap *map) +{ + if (!map) { return; } /* protect agains potential null pointer */ + bmapnode *node; + bmapiter iter = be_map_iter(); + while ((node = be_map_next(map, &iter)) != NULL) { + if (var_isstr(&node->key)) { + bstring *s = var_tostr(&node->key); + be_pushstring(vm, str(s)); + be_data_push(vm, -2); + be_pop(vm, 1); + } + } +} + +static int m_attrlist(bvm *vm) +{ + int top = be_top(vm); + be_newobject(vm, "list"); + if (top >= 1) { + bvalue *v = be_indexof(vm, 1); + void *obj = var_toobj(v); + switch (var_type(v)) { + case BE_NIL: dump_map_keys(vm, global(vm).vtab); break; + case BE_MODULE: dump_map_keys(vm, ((bmodule*)obj)->table); break; + case BE_CLASS: dump_map_keys(vm, ((bclass*)obj)->members); break; + case BE_INSTANCE: dump_map_keys(vm, ((binstance*)obj)->_class->members); break; + default: break; + } + } else { /* if no parameter, then dump globals */ + dump_map_keys(vm, global(vm).vtab); + } + be_pop(vm, 1); + be_return(vm); +} + +static int m_findmember(bvm *vm) +{ + int top = be_top(vm); + if (top >= 2 && (be_isinstance(vm, 1) || be_ismodule(vm, 1) || be_isclass(vm, 1)) && be_isstring(vm, 2)) { + be_getmember(vm, 1, be_tostring(vm, 2)); + be_return(vm); + } + be_return_nil(vm); +} + +static int m_setmember(bvm *vm) +{ + int top = be_top(vm); + if (top >= 3 && (be_isinstance(vm, 1) || be_ismodule(vm, 1)) && be_isstring(vm, 2)) { + be_setmember(vm, 1, be_tostring(vm, 2)); + be_return(vm); + } + be_return_nil(vm); +} + +#if !BE_USE_PRECOMPILED_OBJECT +be_native_module_attr_table(introspect) { + be_native_module_function("members", m_attrlist), + + be_native_module_function("get", m_findmember), + be_native_module_function("set", m_setmember), +}; + +be_define_native_module(introspect, NULL); +#else +/* @const_object_info_begin +module introspect (scope: global, depend: BE_USE_INTROSPECT_MODULE) { + members, func(m_attrlist) + + get, func(m_findmember) + set, func(m_setmember) +} +@const_object_info_end */ +#include "../generate/be_fixed_introspect.h" +#endif + +#endif /* BE_USE_INTROSPECT_MODULE */ diff --git a/lib/libesp32/Berry/src/be_lexer.c b/lib/libesp32/Berry/src/be_lexer.c index af987113d..c4c736508 100644 --- a/lib/libesp32/Berry/src/be_lexer.c +++ b/lib/libesp32/Berry/src/be_lexer.c @@ -38,7 +38,7 @@ static const char* const kwords_tab[] = { ":", "?", "->", "if", "elif", "else", "while", "for", "def", "end", "class", "break", "continue", "return", "true", "false", "nil", "var", "do", - "import", "as", "try", "except", "raise" + "import", "as", "try", "except", "raise", "static" }; void be_lexerror(blexer *lexer, const char *msg) diff --git a/lib/libesp32/Berry/src/be_lexer.h b/lib/libesp32/Berry/src/be_lexer.h index 09090db6b..467070946 100644 --- a/lib/libesp32/Berry/src/be_lexer.h +++ b/lib/libesp32/Berry/src/be_lexer.h @@ -88,7 +88,8 @@ typedef enum { KeyAs, /* keyword as */ KeyTry, /* keyword try */ KeyExcept, /* keyword except */ - KeyRaise /* keyword raise */ + KeyRaise, /* keyword raise */ + KeyStatic /* keyword static */ } btokentype; struct blexerreader { diff --git a/lib/libesp32/Berry/src/be_object.c b/lib/libesp32/Berry/src/be_object.c index a0da81939..c34df0e9a 100644 --- a/lib/libesp32/Berry/src/be_object.c +++ b/lib/libesp32/Berry/src/be_object.c @@ -29,6 +29,7 @@ const char* be_vtype2str(bvalue *v) case BE_MAP: return "map"; case BE_INSTANCE: return "instance"; case BE_MODULE: return "module"; + case BE_INDEX: return "var"; default: return "invalid type"; } } diff --git a/lib/libesp32/Berry/src/be_object.h b/lib/libesp32/Berry/src/be_object.h index d465138ec..b98718c76 100644 --- a/lib/libesp32/Berry/src/be_object.h +++ b/lib/libesp32/Berry/src/be_object.h @@ -13,12 +13,13 @@ /* basic types, do not change value */ #define BE_NONE (-1) /* unknow type */ #define BE_COMPTR (-2) /* common pointer */ +#define BE_INDEX (-3) /* index for instance variable, previously BE_INT */ #define BE_NIL 0 #define BE_INT 1 #define BE_REAL 2 #define BE_BOOL 3 #define BE_FUNCTION 4 -#define BE_STRING 5 +#define BE_STRING 5 /* from this type can be gced, see BE_GCOBJECT */ #define BE_CLASS 6 #define BE_INSTANCE 7 #define BE_PROTO 8 @@ -207,6 +208,7 @@ typedef const char* (*breader)(void*, size_t*); #define var_islist(_v) var_istype(_v, BE_LIST) #define var_ismap(_v) var_istype(_v, BE_MAP) #define var_ismodule(_v) var_istype(_v, BE_MODULE) +#define var_isindex(_v) var_istype(_v, BE_INDEX) #define var_isnumber(_v) (var_isint(_v) || var_isreal(_v)) #define var_setnil(_v) var_settype(_v, BE_NIL) @@ -223,6 +225,7 @@ typedef const char* (*breader)(void*, size_t*); #define var_setlist(_v, _o) var_setobj(_v, BE_LIST, _o) #define var_setmap(_v, _o) var_setobj(_v, BE_MAP, _o) #define var_setmodule(_v, _o) var_setobj(_v, BE_MODULE, _o) +#define var_setindex(_v, _i) { var_settype(_v, BE_INDEX); (_v)->v.i = (_i); } #define var_setproto(_v, _o) var_setobj(_v, BE_PROTO, _o) #define var_tobool(_v) ((_v)->v.b) diff --git a/lib/libesp32/Berry/src/be_opcodes.h b/lib/libesp32/Berry/src/be_opcodes.h index 562bd4b31..f72049dbe 100644 --- a/lib/libesp32/Berry/src/be_opcodes.h +++ b/lib/libesp32/Berry/src/be_opcodes.h @@ -52,4 +52,6 @@ OPCODE(IMPORT), /* A, B, C | IF (A == C) import module name as RK(B) to OPCODE(EXBLK), /* A, Bx | ... */ OPCODE(CATCH), /* A, B, C | ... */ OPCODE(RAISE), /* A, B, C | ... */ -OPCODE(CLASS) /* Bx | init class in K[Bx] */ +OPCODE(CLASS), /* Bx | init class in K[Bx] */ +OPCODE(GETNGBL), /* A, B | R(A) <- GLOBAL[B] by name */ +OPCODE(SETNGBL) /* A, B | R(A) -> GLOBAL[B] by name */ diff --git a/lib/libesp32/Berry/src/be_parser.c b/lib/libesp32/Berry/src/be_parser.c index 62df59b85..c19f83e9a 100644 --- a/lib/libesp32/Berry/src/be_parser.c +++ b/lib/libesp32/Berry/src/be_parser.c @@ -446,10 +446,17 @@ static int singlevaraux(bvm *vm, bfuncinfo *finfo, bstring *s, bexpdesc *var) int res = singlevaraux(vm, finfo->prev, s, var); if (res == ETUPVAL || res == ETLOCAL) { idx = new_upval(vm, finfo, s, var); /* new upvalue */ - } else if (be_global_find(vm, s) >= 0) { - return ETGLOBAL; /* global variable */ } else { - return ETVOID; /* unknow (new variable or error) */ + idx = be_global_find(vm, s); + if (idx >= 0) { + if (idx < be_builtin_count(vm)) { + return ETGLOBAL; /* global variable */ + } else { + return comp_is_named_gbl(vm) ? ETNGLOBAL : ETGLOBAL; /* global variable */ + } + } else { + return ETVOID; /* unknow (new variable or error) */ + } } } init_exp(var, ETUPVAL, idx); @@ -460,6 +467,7 @@ static int singlevaraux(bvm *vm, bfuncinfo *finfo, bstring *s, bexpdesc *var) static void singlevar(bparser *parser, bexpdesc *var) { + bexpdesc key; bstring *varname = next_token(parser).u.s; int type = singlevaraux(parser->vm, parser->finfo, varname, var); switch (type) { @@ -471,6 +479,12 @@ static void singlevar(bparser *parser, bexpdesc *var) init_exp(var, ETGLOBAL, 0); var->v.idx = be_global_find(parser->vm, varname); break; + case ETNGLOBAL: + init_exp(&key, ETSTRING, 0); + key.v.s = varname; + init_exp(var, ETNGLOBAL, 0); + var->v.idx = be_code_nglobal(parser->finfo, &key); + break; default: break; } @@ -1208,7 +1222,7 @@ static void return_stmt(bparser *parser) static void check_class_attr(bparser *parser, bclass *c, bstring *attr) { - if (be_class_attribute(parser->vm, c, attr) != BE_NIL) { + if (be_class_attribute(parser->vm, c, attr) != BE_NONE) { push_error(parser, "redefinition of the attribute '%s'", str(attr)); } @@ -1221,11 +1235,11 @@ static void classvar_stmt(bparser *parser, bclass *c) scan_next_token(parser); /* skip 'var' */ if (match_id(parser, name) != NULL) { check_class_attr(parser, c, name); - be_member_bind(parser->vm, c, name); + be_member_bind(parser->vm, c, name, btrue); while (match_skip(parser, OptComma)) { /* ',' */ if (match_id(parser, name) != NULL) { check_class_attr(parser, c, name); - be_member_bind(parser->vm, c, name); + be_member_bind(parser->vm, c, name, btrue); } else { parser_error(parser, "class var error"); } @@ -1235,6 +1249,47 @@ static void classvar_stmt(bparser *parser, bclass *c) } } +static void class_static_assignment_expr(bparser *parser, bexpdesc *e, bstring *name) +{ + if (match_skip(parser, OptAssign)) { /* '=' */ + bexpdesc e1, e2; + /* parse the right expression */ + expr(parser, &e2); + + e1 = *e; /* copy the class description */ + bexpdesc key; /* build the member key */ + init_exp(&key, ETSTRING, 0); + key.v.s = name; + + be_code_member(parser->finfo, &e1, &key); /* compute member accessor */ + be_code_setvar(parser->finfo, &e1, &e2); /* set member */ + } +} + +static void classstatic_stmt(bparser *parser, bclass *c, bexpdesc *e) +{ + bstring *name; + /* 'static' ID ['=' expr] {',' ID ['=' expr] } */ + scan_next_token(parser); /* skip 'static' */ + if (match_id(parser, name) != NULL) { + check_class_attr(parser, c, name); + be_member_bind(parser->vm, c, name, bfalse); + class_static_assignment_expr(parser, e, name); + + while (match_skip(parser, OptComma)) { /* ',' */ + if (match_id(parser, name) != NULL) { + check_class_attr(parser, c, name); + be_member_bind(parser->vm, c, name, bfalse); + class_static_assignment_expr(parser, e, name); + } else { + parser_error(parser, "class static error"); + } + } + } else { + parser_error(parser, "class static error"); + } +} + static void classdef_stmt(bparser *parser, bclass *c) { bexpdesc e; @@ -1260,12 +1315,13 @@ static void class_inherit(bparser *parser, bexpdesc *e) } } -static void class_block(bparser *parser, bclass *c) +static void class_block(bparser *parser, bclass *c, bexpdesc *e) { /* { [;] } */ while (block_follow(parser)) { switch (next_type(parser)) { case KeyVar: classvar_stmt(parser, c); break; + case KeyStatic: classstatic_stmt(parser, c, e); break; case KeyDef: classdef_stmt(parser, c); break; case OptSemic: scan_next_token(parser); break; default: push_error(parser, @@ -1285,7 +1341,7 @@ static void class_stmt(bparser *parser) new_var(parser, name, &e); be_code_class(parser->finfo, &e, c); class_inherit(parser, &e); - class_block(parser, c); + class_block(parser, c, &e); be_class_compress(parser->vm, c); /* compress class size */ match_token(parser, KeyEnd); /* skip 'end' */ } else { diff --git a/lib/libesp32/Berry/src/be_parser.h b/lib/libesp32/Berry/src/be_parser.h index 47c9f6f48..7d06fdc23 100644 --- a/lib/libesp32/Berry/src/be_parser.h +++ b/lib/libesp32/Berry/src/be_parser.h @@ -25,7 +25,8 @@ typedef enum { ETUPVAL, ETMEMBER, ETINDEX, - ETREG + ETREG, + ETNGLOBAL } exptype_t; typedef struct { diff --git a/lib/libesp32/Berry/src/be_solidifylib.c b/lib/libesp32/Berry/src/be_solidifylib.c index 03523c9a8..473f74c0b 100644 --- a/lib/libesp32/Berry/src/be_solidifylib.c +++ b/lib/libesp32/Berry/src/be_solidifylib.c @@ -32,16 +32,57 @@ be_writestring(__lbuf); \ } while (0) -/* output only valid types for ktab, or NULL */ -static const char * m_type_ktab(int type) +static void m_solidify_bvalue(bvm *vm, bvalue * value) { - switch (type){ - case BE_NIL: return "BE_NIL"; - case BE_INT: return "BE_INT"; - case BE_REAL: return "BE_REAL"; - case BE_BOOL: return "BE_BOOL"; - case BE_STRING: return "BE_STRING"; - default: return NULL; + int type = var_type(value); + switch (type) { + case BE_NIL: + logfmt("be_const_nil()"); + break; + case BE_BOOL: + logfmt("be_const_bool(%i)", var_tobool(value)); + break; + case BE_INT: +#if BE_INTGER_TYPE == 2 + logfmt("be_const_int(%lli)", var_toint(value)); +#else + logfmt("be_const_int(%i)", var_toint(value)); +#endif + break; + case BE_INDEX: +#if BE_INTGER_TYPE == 2 + logfmt("be_const_index(%lli)", var_toint(value)); +#else + logfmt("be_const_index(%i)", var_toint(value)); +#endif + break; + case BE_REAL: +#if BE_USE_SINGLE_FLOAT + logfmt("be_const_real_hex(0x%08X)", (uint32_t) var_toobj(value)); +#else + logfmt("be_const_real_hex(0x%016llX)", (uint64_t) var_toobj(value)); +#endif + break; + case BE_STRING: + { + logfmt("be_nested_string(\""); + be_writestring(str(var_tostr(value))); + size_t len = strlen(str(var_tostr(value))); + if (len >= 255) { + be_raise(vm, "internal_error", "Strings greater than 255 chars not supported yet"); + } + logfmt("\", %i, %zu)", be_strhash(var_tostr(value)), len >= 255 ? 255 : len); + } + break; + case BE_CLOSURE: + logfmt("be_const_closure(%s_closure)", str(((bclosure*) var_toobj(value))->proto->name)); + break; + default: + { + char error[64]; + snprintf(error, sizeof(error), "Unsupported type in function constants: %i", type); + be_raise(vm, "internal_error", error); + } } } @@ -69,47 +110,26 @@ static void m_solidify_proto(bvm *vm, bproto *pr, const char * func_name, int bu logfmt("%*s%d, /* has sup protos */\n", indent, "", (pr->nproto > 0) ? 1 : 0); if (pr->nproto > 0) { + logfmt("%*s( &(const struct bproto*[%2d]) {\n", indent, "", pr->nproto); for (int32_t i = 0; i < pr->nproto; i++) { size_t sub_len = strlen(func_name) + 10; char sub_name[sub_len]; snprintf(sub_name, sizeof(sub_name), "%s_%d", func_name, i); - m_solidify_proto(vm, pr->ptab[i], sub_name, builtins, indent); + m_solidify_proto(vm, pr->ptab[i], sub_name, builtins, indent+2); logfmt(",\n"); } + logfmt("%*s}),\n", indent, ""); } else { logfmt("%*sNULL, /* no sub protos */\n", indent, ""); } logfmt("%*s%d, /* has constants */\n", indent, "", (pr->nconst > 0) ? 1 : 0); if (pr->nconst > 0) { - logfmt("%*s( &(const bvalue[%2d]) { /* upvals */\n", indent, "", pr->nconst); + logfmt("%*s( &(const bvalue[%2d]) { /* constants */\n", indent, "", pr->nconst); for (int k = 0; k < pr->nconst; k++) { - int type = pr->ktab[k].type; - const char *type_name = m_type_ktab(type); - if (type_name == NULL) { - char error[64]; - snprintf(error, sizeof(error), "Unsupported type in function constants: %i", type); - be_raise(vm, "internal_error", error); - } - if (type == BE_STRING) { - logfmt("%*s { { .s=be_nested_const_str(\"", indent, ""); - be_writestring(str(pr->ktab[k].v.s)); - size_t len = strlen(str(pr->ktab[k].v.s)); - if (len >= 255) { - be_raise(vm, "internal_error", "Strings greater than 255 chars not supported yet"); - } - logfmt("\", %i, %zu) }, %s},\n", be_strhash(pr->ktab[k].v.s), len >= 255 ? 255 : len, type_name); - } else if (type == BE_INT) { - logfmt("%*s { { .i=%" BE_INT_FMTLEN "i }, %s},\n", indent, "", pr->ktab[k].v.i, type_name); - } else if (type == BE_REAL) { - #if BE_USE_SINGLE_FLOAT - logfmt("%*s { { .p=(void*)0x%08X }, %s},\n", indent, "", (uint32_t) pr->ktab[k].v.p, type_name); - #else - logfmt("%*s { { .p=(void*)0x%016llX }, %s},\n", indent, "", (uint64_t) pr->ktab[k].v.p, type_name); - #endif - } else if (type == BE_BOOL) { - logfmt("%*s { { .b=%i }, %s},\n", indent, "", pr->ktab[k].v.b, type_name); - } + logfmt("%*s ", indent, ""); + m_solidify_bvalue(vm, &pr->ktab[k]); + logfmt(", /* R%d - K%d */\n", 256+k, k); } logfmt("%*s}),\n", indent, ""); } else { @@ -166,6 +186,78 @@ static void m_solidify_closure(bvm *vm, bclosure *cl, int builtins) logfmt("/*******************************************************************/\n\n"); } + +static void m_solidify_class(bvm *vm, bclass *cl, int builtins) +{ + const char * class_name = str(cl->name); + + /* iterate on members to dump closures */ + if (cl->members) { + bmapnode *node; + bmapiter iter = be_map_iter(); + while ((node = be_map_next(cl->members, &iter)) != NULL) { + if (var_isstr(&node->key) && var_isclosure(&node->value)) { + bclosure *f = var_toobj(&node->value); + m_solidify_closure(vm, f, builtins); + } + } + } + + + logfmt("\n"); + logfmt("/********************************************************************\n"); + logfmt("** Solidified class: %s\n", class_name); + logfmt("********************************************************************/\n"); + + if (cl->super) { + logfmt("extern const bclass be_class_%s;\n", str(cl->super->name)); + } + + logfmt("be_local_class(%s,\n", class_name); + logfmt(" %i,\n", cl->nvar); + if (cl->super) { + logfmt(" &be_class_%s,\n", str(cl->super->name)); + } else { + logfmt(" NULL,\n"); + } + + if (cl->members) { + logfmt(" be_nested_map(%i,\n", cl->members->count); + + logfmt(" ( (struct bmapnode*) &(const bmapnode[]) {\n"); + for (int i = 0; i < cl->members->count; i++) { + bmapnode * node = &cl->members->slots[i]; + if (node->key.type != BE_STRING) { + char error[64]; + snprintf(error, sizeof(error), "Unsupported type in key: %i", node->key.type); + be_raise(vm, "internal_error", error); + } + int key_next = node->key.next; + size_t len = strlen(str(node->key.v.s)); + if (0xFFFFFF == key_next) { + key_next = -1; /* more readable */ + } + logfmt(" { be_nested_key(\"%s\", %i, %zu, %i), ", str(node->key.v.s), be_strhash(node->key.v.s), len >= 255 ? 255 : len, key_next); + m_solidify_bvalue(vm, &node->value); + + logfmt(" },\n"); + } + logfmt(" })),\n"); + } else { + logfmt(" NULL,\n"); + } + + logfmt(" (be_nested_const_str(\"%s\", %i, %i))\n", class_name, be_strhash(cl->name), str_len(cl->name)); + logfmt(");\n"); + logfmt("/*******************************************************************/\n\n"); + + logfmt("void be_load_%s_class(bvm *vm) {\n", class_name); + logfmt(" be_pushntvclass(vm, &be_class_%s);\n", class_name); + logfmt(" be_setglobal(vm, \"%s\");\n", class_name); + logfmt(" be_pop(vm, 1);\n"); + logfmt("}\n"); +} + #define be_builtin_count(vm) \ be_vector_count(&(vm)->gbldesc.builtin.vlist) @@ -175,6 +267,8 @@ static int m_dump(bvm *vm) bvalue *v = be_indexof(vm, 1); if (var_isclosure(v)) { m_solidify_closure(vm, var_toobj(v), be_builtin_count(vm)); + } else if (var_isclass(v)) { + m_solidify_class(vm, var_toobj(v), be_builtin_count(vm)); } } be_return_nil(vm); diff --git a/lib/libesp32/Berry/src/be_strlib.c b/lib/libesp32/Berry/src/be_strlib.c index 67cb528c3..4bef42d10 100644 --- a/lib/libesp32/Berry/src/be_strlib.c +++ b/lib/libesp32/Berry/src/be_strlib.c @@ -80,6 +80,7 @@ static bstring* sim2str(bvm *vm, bvalue *v) case BE_BOOL: strcpy(sbuf, var_tobool(v) ? "true" : "false"); break; + case BE_INDEX: case BE_INT: sprintf(sbuf, BE_INT_FORMAT, var_toint(v)); break; diff --git a/lib/libesp32/Berry/src/be_vm.c b/lib/libesp32/Berry/src/be_vm.c index 97fee645c..ec30e8ce4 100644 --- a/lib/libesp32/Berry/src/be_vm.c +++ b/lib/libesp32/Berry/src/be_vm.c @@ -228,7 +228,8 @@ static bbool obj2bool(bvm *vm, bvalue *var) binstance *obj = var_toobj(var); bstring *tobool = str_literal(vm, "tobool"); /* get operator method */ - if (be_instance_member(vm, obj, tobool, vm->top)) { + int type = be_instance_member(vm, obj, tobool, vm->top); + if (type != BE_NONE && type != BE_NIL) { vm->top[1] = *var; /* move self to argv[0] */ be_dofunc(vm, vm->top, 1); /* call method 'tobool' */ /* check the return value */ @@ -273,7 +274,7 @@ static int obj_attribute(bvm *vm, bvalue *o, bvalue *c, bvalue *dst) bstring *attr = var_tostr(c); binstance *obj = var_toobj(o); int type = be_instance_member(vm, obj, attr, dst); - if (basetype(type) == BE_NIL) { /* if no method found, try virtual */ + if (type == BE_NONE) { /* if no method found, try virtual */ /* get method 'member' */ int type2 = be_instance_member(vm, obj, str_literal(vm, "member"), vm->top); if (basetype(type2) == BE_FUNCTION) { @@ -287,7 +288,7 @@ static int obj_attribute(bvm *vm, bvalue *o, bvalue *c, bvalue *dst) type = var_type(dst); } } - if (basetype(type) == BE_NIL) { + if (type == BE_NONE) { vm_error(vm, "attribute_error", "the '%s' object has no attribute '%s'", str(be_instance_name(obj)), str(attr)); @@ -295,6 +296,19 @@ static int obj_attribute(bvm *vm, bvalue *o, bvalue *c, bvalue *dst) return type; } +static int class_attribute(bvm *vm, bvalue *o, bvalue *c, bvalue *dst) +{ + bstring *attr = var_tostr(c); + bclass *obj = var_toobj(o); + int type = be_class_member(vm, obj, attr, dst); + if (type == BE_NONE || type == BE_INDEX) { + vm_error(vm, "attribute_error", + "the '%s' class has no static attribute '%s'", + str(obj->name), str(attr)); + } + return type; +} + static bbool object_eqop(bvm *vm, const char *op, bbool iseq, bvalue *a, bvalue *b) { @@ -421,6 +435,7 @@ BERRY_API bvm* be_vm_new(void) be_globalvar_init(vm); be_gc_setpause(vm, 1); be_loadlibs(vm); + vm->compopt = 0; #if BE_USE_OBSERVABILITY_HOOK vm->obshook = NULL; #endif @@ -486,6 +501,38 @@ newframe: /* a new call frame */ *v = *be_global_var(vm, idx); dispatch(); } + opcase(GETNGBL): { /* get Global by name */ + bvalue *v = RA(); + bvalue *b = RKB(); + if (var_isstr(b)) { + bstring *name = var_tostr(b); + int idx = be_global_find(vm, name); + if (idx > -1) { + *v = *be_global_var(vm, idx); + } else { + vm_error(vm, "attribute_error", "'%s' undeclared", str(name)); + } + } else { + vm_error(vm, "internal_error", "global name must be a string"); + } + dispatch(); + } + opcase(SETNGBL): { /* set Global by name */ + bvalue *v = RA(); + bvalue *b = RKB(); + if (var_isstr(b)) { + bstring *name = var_tostr(b); + int idx = be_global_find(vm, name); + if (idx > -1) { + *be_global_var(vm, idx) = *v; + } else { + vm_error(vm, "attribute_error", "'%s' undeclared", str(name)); + } + } else { + vm_error(vm, "internal_error", "global name must be a string"); + } + dispatch(); + } opcase(SETGBL): { bvalue *v = RA(); int idx = IGET_Bx(ins); @@ -741,6 +788,9 @@ newframe: /* a new call frame */ if (var_isinstance(b) && var_isstr(c)) { obj_attribute(vm, b, c, a); reg = vm->reg; + } else if (var_isclass(b) && var_isstr(c)) { + class_attribute(vm, b, c, a); + reg = vm->reg; } else if (var_ismodule(b) && var_isstr(c)) { bstring *attr = var_tostr(c); bmodule *module = var_toobj(b); @@ -833,6 +883,16 @@ newframe: /* a new call frame */ } dispatch(); } + if (var_isclass(a) && var_isstr(b)) { + bclass *obj = var_toobj(a); + bstring *attr = var_tostr(b); + if (!be_class_setmember(vm, obj, attr, c)) { + vm_error(vm, "attribute_error", + "class '%s' cannot assign to static attribute '%s'", + str(be_class_name(obj)), str(attr)); + } + dispatch(); + } if (var_ismodule(a) && var_isstr(b)) { bmodule *obj = var_toobj(a); bstring *attr = var_tostr(b); diff --git a/lib/libesp32/Berry/src/be_vm.h b/lib/libesp32/Berry/src/be_vm.h index e2df0b475..86926d421 100644 --- a/lib/libesp32/Berry/src/be_vm.h +++ b/lib/libesp32/Berry/src/be_vm.h @@ -10,6 +10,15 @@ #include "be_object.h" +#define comp_is_named_gbl(vm) ((vm)->compopt & (1<compopt |= (1<compopt &= ~(1< A.b) +assert_attribute_error(/-> A.d) + +a = A() +assert(a.b == 2) +assert(a.a == nil) +assert(a.c == nil) + +A.a = 1 +A.c = 3 +A.s = "foo" +A.r = 3.5 +assert(a.a == 1) +assert(a.c == 3) +assert(A.a == 1) +assert(A.c == 3) +import gc gc.collect() +assert(A.s == "foo") +assert(a.s == "foo") +assert(A.r == 3.5) +assert(a.r == 3.5) + +#- test valid or invalid methods and members -# + +def assert_attribute_error(c) + try + compile(c)() + assert(false, 'unexpected execution flow') + except .. as e, m + assert(e == 'attribute_error') + end +end + +class A + var a, g + static h + def init() self.a = 1 end + def f(x, y) return type(self) end +end +a=A() +a.g = def (x, y) return type(x) end +A.h = def (x, y) return type(x) end + +assert(type(a.g) == 'function') +assert(type(a.h) == 'function') + +assert_attribute_error("a.g(1,2)") +assert(a.h(1) == 'instance') +# A.h(1) - error diff --git a/lib/libesp32/Berry/tools/coc/hash_map.cpp b/lib/libesp32/Berry/tools/coc/hash_map.cpp index 988b8a03a..9d917a81c 100755 --- a/lib/libesp32/Berry/tools/coc/hash_map.cpp +++ b/lib/libesp32/Berry/tools/coc/hash_map.cpp @@ -128,7 +128,7 @@ hash_map::entry hash_map::entry_modify(entry entry, int *var_count) { entry.key = coc::escape_operator(entry.key); if (entry.value == "var") { - entry.value = "be_const_int(" + entry.value = "be_const_index(" + std::to_string(*var_count) + ")"; ++(*var_count); } else { diff --git a/lib/libesp32/Berry/tools/coc/str_build.cpp b/lib/libesp32/Berry/tools/coc/str_build.cpp index affd5016e..ebc44301e 100644 --- a/lib/libesp32/Berry/tools/coc/str_build.cpp +++ b/lib/libesp32/Berry/tools/coc/str_build.cpp @@ -46,7 +46,7 @@ void str_build::keywords() { "var", opif + 14 }, { "do", opif + 15 }, { "import", opif + 16 }, { "as", opif + 17 }, { "try", opif + 18 }, { "except", opif + 19 }, - { "raise", opif + 20 } + { "raise", opif + 20 }, { "static", opif + 21 } }; for (auto it : tab) { make_ceil(it.first, it.second); diff --git a/lib/libesp32/Berry/tools/plugins/vscode/skiars.berry-0.1.0/syntaxes/berry.json b/lib/libesp32/Berry/tools/plugins/vscode/skiars.berry-0.1.0/syntaxes/berry.json index 1cd1d7cfd..661d969a5 100755 --- a/lib/libesp32/Berry/tools/plugins/vscode/skiars.berry-0.1.0/syntaxes/berry.json +++ b/lib/libesp32/Berry/tools/plugins/vscode/skiars.berry-0.1.0/syntaxes/berry.json @@ -67,7 +67,7 @@ "keywords": { "patterns": [{ "name": "keyword.berry", - "match": "\\b(var|def|class|true|false|nil|self|super|import|as)\\b" + "match": "\\b(var|static|def|class|true|false|nil|self|super|import|as)\\b" }] }, "identifier": { diff --git a/lib/libesp32_div/ESP32-HomeKit/src/hap_platform_keystore.cpp b/lib/libesp32_div/ESP32-HomeKit/src/hap_platform_keystore.cpp index ec27c90c5..8e4656ea1 100755 --- a/lib/libesp32_div/ESP32-HomeKit/src/hap_platform_keystore.cpp +++ b/lib/libesp32_div/ESP32-HomeKit/src/hap_platform_keystore.cpp @@ -47,7 +47,7 @@ const char * hap_platform_keystore_get_factory_nvs_partition_name() { #ifdef HAP_USE_LITTLEFS -#include +#include extern FS *ffsp; diff --git a/pio-tools/gzip-firmware.py b/pio-tools/gzip-firmware.py index 14e030f20..fac23cf2d 100644 --- a/pio-tools/gzip-firmware.py +++ b/pio-tools/gzip-firmware.py @@ -6,11 +6,34 @@ import gzip platform = env.PioPlatform() board = env.BoardConfig() mcu = board.get("build.mcu", "esp32") + +OUTPUT_DIR = "build_output{}".format(os.path.sep) + +def map_gzip(source, target, env): + variant = str(target[0]).split(os.path.sep)[2] + + # create string with location and file names based on variant + bin_file = "{}map{}{}.map".format(OUTPUT_DIR, os.path.sep, variant) + + if os.path.isfile(bin_file): + gzip_file = "{}map{}{}.map.gz".format(OUTPUT_DIR, os.path.sep, variant) + + # check if new target map files exist and remove if necessary + if os.path.isfile(gzip_file): os.remove(gzip_file) + + # write gzip map file + with open(bin_file,"rb") as fp: + with gzip.open(gzip_file, "wb", compresslevel = 9) as f: + shutil.copyfileobj(fp, f) + + # remove map file + if os.path.isfile(bin_file): os.remove(bin_file) + +env.AddPostAction("$BUILD_DIR/${PROGNAME}.bin", [map_gzip]) + # gzip only for ESP8266 if env["PIOPLATFORM"] != "espressif32": - OUTPUT_DIR = "build_output{}".format(os.path.sep) - def bin_gzip(source, target, env): variant = str(target[0]).split(os.path.sep)[2] @@ -33,5 +56,5 @@ if env["PIOPLATFORM"] != "espressif32": print("\u001b[31;1m!!! Tasmota firmware size is too big with {} bytes. Max size is 995326 bytes !!! \u001b[0m".format(ORG_FIRMWARE_SIZE)) else: print("Compression reduced firmware size by {:.0f}% (was {} bytes, now {} bytes)".format((GZ_FIRMWARE_SIZE / ORG_FIRMWARE_SIZE) * 100, ORG_FIRMWARE_SIZE, GZ_FIRMWARE_SIZE)) - + env.AddPostAction("$BUILD_DIR/${PROGNAME}.bin", [bin_gzip]) diff --git a/pio-tools/name-firmware.py b/pio-tools/name-firmware.py index 1c79056de..ce6ee0339 100644 --- a/pio-tools/name-firmware.py +++ b/pio-tools/name-firmware.py @@ -1,4 +1,5 @@ Import('env') +Import('projenv') import os import shutil @@ -6,7 +7,7 @@ OUTPUT_DIR = "build_output{}".format(os.path.sep) def bin_map_copy(source, target, env): variant = str(target[0]).split(os.path.sep)[2] - + # check if output directories exist and create if necessary if not os.path.isdir(OUTPUT_DIR): os.mkdir(OUTPUT_DIR) @@ -27,8 +28,27 @@ def bin_map_copy(source, target, env): # copy firmware.bin to firmware/.bin shutil.copy(str(target[0]), bin_file) - # copy firmware.map to map/.map + # move firmware.map to map/.map if os.path.isfile("firmware.map"): shutil.move("firmware.map", map_file) + #map_new_loc = str(target[0]).split(os.path.sep)[0] + os.path.sep + str(target[0]).split(os.path.sep)[1] + os.path.sep + str(target[0]).split(os.path.sep)[2] + os.path.sep + "Tasmota.map" + # PIO env variables see: https://github.com/platformio/platformio-core/blob/develop/platformio/builder/main.py#L108:L128 + proj_build_dir = env["PROJECT_BUILD_DIR"] + #build_dir = env["BUILD_DIR"] + pio_env = env["PIOENV"] + proj_dir = env["PROJECT_DIR"] + map_name = str(proj_dir).split(os.path.sep)[-1] + map_new_loc = proj_build_dir + os.path.sep + pio_env + os.path.sep + map_name + ".map" + #print("proj_build_dir: {}".format(proj_build_dir)) + #print("pioenv: {}".format(pio_env)) + #print("build_dir: {}".format(build_dir)) + #print("map_name: {}".format(map_name)) + #print("proj_dir: {}".format(proj_dir)) + #print("map_new_loc: {}".format(map_new_loc)) + + # move Tasmota.map to map/.map + if os.path.isfile(map_new_loc): + shutil.move(map_new_loc, map_file) + env.AddPostAction("$BUILD_DIR/${PROGNAME}.bin", [bin_map_copy]) diff --git a/platformio_override_sample.ini b/platformio_override_sample.ini index c139513d9..a7406d0d9 100644 --- a/platformio_override_sample.ini +++ b/platformio_override_sample.ini @@ -150,7 +150,7 @@ lib_extra_dirs = ; *** Bear SSL and base64. Disable if you dont have SSL or TLS activated lib/lib_ssl ; *** Audio needs a lot of time to compile. Mostly not used functions. Recommended to disable -; lib/lib_audio + lib/lib_audio ; *** RF 433 stuff (not RF Bridge). Recommended to disable lib/lib_rf ; *** Mostly not used functions. Recommended to disable diff --git a/platformio_tasmota32.ini b/platformio_tasmota32.ini index 07c9d3974..ad2a50d08 100644 --- a/platformio_tasmota32.ini +++ b/platformio_tasmota32.ini @@ -26,8 +26,8 @@ build_flags = ${esp_defaults.build_flags} [core32] -platform = espressif32 @ 3.3.0 -platform_packages = framework-arduinoespressif32 @ https://github.com/tasmota/arduino-esp32/releases/download/1.0.7.1/tasmota-arduinoespressif32-release_v3.3.5.tar.gz +platform = espressif32 @ 3.3.1 +platform_packages = framework-arduinoespressif32 @ https://github.com/tasmota/arduino-esp32/releases/download/1.0.7.3/tasmota-arduinoespressif32-release_v3.3.5.tar.gz platformio/tool-mklittlefs @ ~1.203.200522 build_unflags = ${esp32_defaults.build_unflags} build_flags = ${esp32_defaults.build_flags} diff --git a/platformio_tasmota_cenv_sample.ini b/platformio_tasmota_cenv_sample.ini index 6911570f7..4b47e9383 100644 --- a/platformio_tasmota_cenv_sample.ini +++ b/platformio_tasmota_cenv_sample.ini @@ -6,36 +6,42 @@ ;build_flags = ${core_dev.build_flags} [core_dev] -; *** Esp8266 core for Arduino 3.0.1 -platform = espressif8266 @ 3.1.0 -platform_packages = -build_unflags = ${esp_defaults.build_unflags} +; *** Esp8266 core for Arduino 3.0.2 +platform = https://github.com/platformio/platform-espressif8266.git +platform_packages = +build_unflags = ${env.build_unflags} -Wswitch-unreachable -build_flags = ${esp82xx_defaults.build_flags} +build_flags = ${env.build_flags} ; *** 16k extra heap https://github.com/esp8266/Arduino/pull/7060 -D PIO_FRAMEWORK_ARDUINO_MMU_CACHE16_IRAM48_SECHEAP_SHARED -Wno-switch-unreachable +[env:tasmota-rangeextender] +build_flags = ${env.build_flags} + -D FIRMWARE_RANGE_EXTENDER + -D PIO_FRAMEWORK_ARDUINO_LWIP2_HIGHER_BANDWIDTH + -D USE_WIFI_RANGE_EXTENDER + -D USE_WIFI_RANGE_EXTENDER_NAPT ; *** Tasmota development core version ESP32 IDF3.3.5 / Currently none, same as default [env:tasmota32idf3] extends = env:tasmota32_base platform = espressif32 @ 3.3.0 -platform_packages = framework-arduinoespressif32 @ https://github.com/tasmota/arduino-esp32/releases/download/1.0.7.1/tasmota-arduinoespressif32-release_v3.3.5.tar.gz +platform_packages = framework-arduinoespressif32 @ https://github.com/tasmota/arduino-esp32/releases/download/1.0.7.3/tasmota-arduinoespressif32-release_v3.3.5.tar.gz platformio/tool-mklittlefs @ ~1.203.200522 -build_unflags = ${esp32_defaults.build_unflags} -build_flags = ${esp32_defaults.build_flags} +build_unflags = ${env:tasmota32_base.build_unflags} +build_flags = ${env:tasmota32_base.build_flags} ;-DESP32_STAGE=true ;*** EXPERIMENTAL Tasmota version for ESP32-S2 [env:tasmota32s2] extends = env:tasmota32_base board = esp32s2 -platform = https://github.com/platformio/platform-espressif32.git#feature/idf-master -platform_packages = framework-arduinoespressif32 @ https://github.com/Jason2866/esp32-arduino-lib-builder/releases/download/331/framework-arduinoespressif32-master-209a0d389.tar.gz +platform = https://github.com/platformio/platform-espressif32.git#feature/arduino-idf-master +platform_packages = framework-arduinoespressif32 @ https://github.com/Jason2866/esp32-arduino-lib-builder/releases/download/385/framework-arduinoespressif32-master-cd287c4d6.tar.gz platformio/tool-mklittlefs @ ~1.203.200522 -build_unflags = ${esp32_defaults.build_unflags} -build_flags = ${esp32_defaults.build_flags} -DFIRMWARE_LITE +build_unflags = ${env:tasmota32_base.build_unflags} +build_flags = ${env:tasmota32_base.build_flags} -DFIRMWARE_LITE lib_extra_dirs = lib/libesp32 lib/lib_basic lib_ignore = @@ -47,14 +53,14 @@ lib_ignore = [env:tasmota32c3] extends = env:tasmota32_base board = esp32c3 -platform = https://github.com/platformio/platform-espressif32.git#feature/idf-master -platform_packages = framework-arduinoespressif32 @ https://github.com/Jason2866/esp32-arduino-lib-builder/releases/download/331/framework-arduinoespressif32-master-209a0d389.tar.gz +platform = https://github.com/platformio/platform-espressif32.git#feature/arduino-idf-master +platform_packages = framework-arduinoespressif32 @ https://github.com/Jason2866/esp32-arduino-lib-builder/releases/download/385/framework-arduinoespressif32-master-cd287c4d6.tar.gz platformio/tool-mklittlefs @ ~1.203.200522 -build_unflags = ${esp32_defaults.build_unflags} +build_unflags = ${env:tasmota32_base.build_unflags} -Wswitch-unreachable -mtarget-align -DNDEBUG -build_flags = ${esp32_defaults.build_flags} +build_flags = ${env:tasmota32_base.build_flags} -Wno-switch-unreachable ;-DESP32_STAGE=true lib_extra_dirs = lib/libesp32 @@ -70,26 +76,57 @@ lib_ignore = ; *** EXPERIMENTAL Tasmota version for ESP32 IDF4.4. [env:tasmota32idf4] extends = env:tasmota32_base -platform = https://github.com/platformio/platform-espressif32.git#feature/idf-master -platform_packages = framework-arduinoespressif32 @ https://github.com/Jason2866/esp32-arduino-lib-builder/releases/download/331/framework-arduinoespressif32-master-209a0d389.tar.gz +platform = https://github.com/platformio/platform-espressif32.git#feature/arduino-idf-master +platform_packages = framework-arduinoespressif32 @ https://github.com/Jason2866/esp32-arduino-lib-builder/releases/download/385/framework-arduinoespressif32-master-cd287c4d6.tar.gz platformio/tool-mklittlefs @ ~1.203.200522 -build_unflags = ${esp32_defaults.build_unflags} +build_unflags = ${env:tasmota32_base.build_unflags} -Wswitch-unreachable -Wincompatible-pointer-types -build_flags = ${esp32_defaults.build_flags} +build_flags = ${env:tasmota32_base.build_flags} -Wno-switch-unreachable ;-DESP32_STAGE=true +[env:tasmota32-rangeextender] +extends = env:tasmota32idf4 +build_flags = ${env:tasmota32idf4.build_flags} + -D FIRMWARE_TASMOTA32 + -D USE_WIFI_RANGE_EXTENDER + -D USE_WIFI_RANGE_EXTENDER_NAPT + ; *** Debug version used for PlatformIO Home Project Inspection [env:tasmota-debug] build_type = debug -build_unflags = ${esp_defaults.build_unflags} -build_flags = ${esp82xx_defaults.build_flags} +build_unflags = ${env.build_unflags} +build_flags = ${env.build_flags} ; -Wstack-usage=300 [env:tasmota32-debug] extends = env:tasmota32_base build_type = debug -build_unflags = ${esp32_defaults.build_unflags} -build_flags = ${esp32_defaults.build_flags} +build_unflags = ${env:tasmota32_base.build_unflags} +build_flags = ${env:tasmota32_base.build_flags} ; -Wstack-usage=300 + +; *** JTAG Debug version, needs esp-prog or FT2232H or FT232H +[env:tasmota32-ocd] +;build_type = debug +extends = env:tasmota32_base +debug_tool = esp-prog +upload_protocol = esp-prog +debug_init_break = tbreak setup +build_unflags = ${env:tasmota32_base.build_unflags} +build_flags = ${env:tasmota32_base.build_flags} + +; *** JTAG Debug version, needs esp-prog or FT2232H or FT232H +[env:tasmota32solo1-ocd] +;build_type = debug +extends = env:tasmota32_base +platform_packages = framework-arduinoespressif32 @ https://github.com/tasmota/arduino-esp32/releases/download/1.0.7.3/tasmota-arduinoespressif32-solo1-release_v3.3.5.tar.gz + platformio/tool-esptoolpy @ ~1.30100 + platformio/tool-mklittlefs @ ~1.203.200522 +board = esp32_solo1_4M +debug_tool = esp-prog +upload_protocol = esp-prog +debug_init_break = tbreak setup +build_unflags = ${env:tasmota32_base.build_unflags} +build_flags = ${env:tasmota32_base.build_flags} diff --git a/platformio_tasmota_env32.ini b/platformio_tasmota_env32.ini index 9cba1dfd1..6145ec8ae 100644 --- a/platformio_tasmota_env32.ini +++ b/platformio_tasmota_env32.ini @@ -50,7 +50,7 @@ build_flags = ${env:tasmota32_base.build_flags} -DFIRMWARE_TASMOTA32 [env:tasmota32solo1] extends = env:tasmota32_base -platform_packages = framework-arduinoespressif32 @ https://github.com/tasmota/arduino-esp32/releases/download/1.0.7/tasmota-arduinoespressif32-solo1-release_v3.3.5.tar.gz +platform_packages = framework-arduinoespressif32 @ https://github.com/tasmota/arduino-esp32/releases/download/1.0.7.3/tasmota-arduinoespressif32-solo1-release_v3.3.5.tar.gz platformio/tool-esptoolpy @ ~1.30100 platformio/tool-mklittlefs @ ~1.203.200522 build_flags = ${env:tasmota32_base.build_flags} -DFIRMWARE_TASMOTA32 diff --git a/tasmota/berry/lvgl_examples/drawing_1.be b/tasmota/berry/lvgl_examples/drawing_1.be new file mode 100644 index 000000000..ccefbc731 --- /dev/null +++ b/tasmota/berry/lvgl_examples/drawing_1.be @@ -0,0 +1,67 @@ +#- LVGL Examples + - + - drawing example #1 from https://docs.lvgl.io/latest/en/html/overview/drawing.html +--# +lv.start() + +lv.scr_act().set_style_local_bg_color(lv.OBJ_PART_MAIN, lv.STATE_DEFAULT, lv_color(0xFF3333)) + +om = lv_objmask(lv.scr_act()) +om.set_size(200, 200) +om.align(0, lv.ALIGN_CENTER, 0, 0) +label = lv_label(om) +label.set_long_mode(lv.LABEL_LONG_BREAK) +label.set_align(lv.LABEL_ALIGN_CENTER) +label.set_width(180) +label.set_text("This label will be masked out. See how it works.") +label.align(0, lv.ALIGN_IN_TOP_MID, 0, 20) + +cont = lv_cont(om) +cont.set_size(180, 100) +cont.set_drag(true) +cont.align(0, lv.ALIGN_IN_BOTTOM_MID, 0, -10) + +btn = lv_btn(cont) +btn.align(0, lv.ALIGN_CENTER, 0, 0) +btn.set_style_local_value_str(lv.OBJ_PART_MAIN, lv.STATE_DEFAULT, "Button") + +lv.refr_now() +tasmota.delay(1000) + +a=lv_area() +r1 = lv_draw_mask_radius_param() + +a.x1 = 10 +a.y1 = 10 +a.x2 = 190 +a.y2 = 190 +lv.draw_mask_radius_init(r1, a, lv.RADIUS_CIRCLE, false) +om.add_mask(r1) + +lv.refr_now() +tasmota.delay(1000) + +a.x1 = 100 +a.y1 = 100 +a.x2 = 150 +a.y2 = 150 +lv.draw_mask_radius_init(r1, a, lv.RADIUS_CIRCLE, true) +om.add_mask(r1) + +lv.refr_now() +tasmota.delay(1000) + +l1 = lv_draw_mask_line_param() +lv.draw_mask_line_points_init(l1, 0, 0, 100, 200, lv.DRAW_MASK_LINE_SIDE_TOP) +om.add_mask(l1) + +lv.refr_now() +tasmota.delay(1000) + +f1= lv_draw_mask_fade_param() +a.x1 = 100 +a.y1 = 0 +a.x2 = 200 +a.y2 = 200 +lv.draw_mask_fade_init(f1, a, lv.OPA_TRANSP, 0, lv.OPA_COVER, 150) +om.add_mask(f1) \ No newline at end of file diff --git a/tasmota/berry/lvgl_examples/drawing_2.be b/tasmota/berry/lvgl_examples/drawing_2.be new file mode 100644 index 000000000..8903b389d --- /dev/null +++ b/tasmota/berry/lvgl_examples/drawing_2.be @@ -0,0 +1,58 @@ +#- LVGL Examples + - + - drawing example #2 from https://docs.lvgl.io/latest/en/html/overview/drawing.html +--# +lv.start() + +lv.scr_act().set_style_local_bg_color(lv.OBJ_PART_MAIN, lv.STATE_DEFAULT, lv_color(0xAAAAAA)) + +MASK_WIDTH=100 +MASK_HEIGHT=50 + +# Create the mask of a text by drawing it to a canvas +mask_map = bytes() +mask_map.resize(MASK_WIDTH * MASK_HEIGHT * 4) + +# Create a "8 bit alpha" canvas and clear it +canvas = lv_canvas(lv.scr_act()) +canvas.set_buffer(mask_map, MASK_WIDTH, MASK_HEIGHT, lv.IMG_CF_ALPHA_8BIT) +canvas.fill_bg(lv_color(lv.BLACK), lv.OPA_TRANSP) +canvas.fill_bg(lv_color(lv.BLACK), lv.OPA_50) + +# Draw a label to the canvas. The result "image" will be used as mask +label_dsc = lv_draw_label_dsc() +lv.draw_label_dsc_init(label_dsc) +label_dsc.color = lv_color(lv.WHITE) +canvas.draw_text(5, 5, MASK_WIDTH, label_dsc, "Text with gradient", lv.LABEL_ALIGN_CENTER) + +# The mask is read, the canvas is not required anymore +canvas.del() + +# Create an object mask which will use the created mask +om = lv_objmask(lv.scr_act()) +om.set_size(MASK_WIDTH, MASK_HEIGHT) +om.align(0, lv.ALIGN_CENTER, 0, 0) + +# Add the created mask map to the object mask +m = lv_draw_mask_map_param() +a = lv_area() +a.x1 = 0 +a.y1 = 0 +a.x2 = MASK_WIDTH - 1 +a.y2 = MASK_HEIGHT - 1 +lv.draw_mask_map_init(m, a, mask_map) +om.add_mask(m) + +# Create a style with gradient +style_bg = lv_style() +style_bg.set_bg_opa(lv.STATE_DEFAULT, lv.OPA_COVER) +style_bg.set_bg_color(lv.STATE_DEFAULT, lv_color(lv.RED)) +style_bg.set_bg_grad_color(lv.STATE_DEFAULT, lv_color(lv.BLUE)) +style_bg.set_bg_grad_dir(lv.STATE_DEFAULT, lv.GRAD_DIR_HOR) + +# Create and object with the gradient style on the object mask. +# The text will be masked from the gradient +bg = lv_obj(om) +bg.reset_style_list(lv.OBJ_PART_MAIN) +bg.add_style(lv.OBJ_PART_MAIN, style_bg) +bg.set_size(MASK_WIDTH, MASK_HEIGHT) diff --git a/tasmota/berry/lvgl_examples/lvgl_demo.be b/tasmota/berry/lvgl_examples/lvgl_demo.be new file mode 100644 index 000000000..b3ff41869 --- /dev/null +++ b/tasmota/berry/lvgl_examples/lvgl_demo.be @@ -0,0 +1,66 @@ +lv.start() + +hres = lv.get_hor_res() +vres = lv.get_ver_res() + +scr = lv.scr_act() +f20 = lv.montserrat_font(20) + +scr.set_style_local_bg_color(lv.OBJ_PART_MAIN, lv.STATE_DEFAULT, lv_color(0x0000A0)) +scr.set_style_local_bg_grad_color(lv.OBJ_PART_MAIN, lv.STATE_DEFAULT, lv_color(0x000000)) +scr.set_style_local_bg_grad_dir(lv.OBJ_PART_MAIN, lv.STATE_DEFAULT, lv.GRAD_DIR_VER) + +log = lv_label(scr) +if f20 != nil log.set_style_local_text_font(lv.OBJ_PART_MAIN, lv.STATE_DEFAULT, f20) end +log.set_long_mode(lv.LABEL_LONG_SROLL) +log.set_width(hres) +log.set_align(lv.LABEL_ALIGN_LEFT) +log.set_style_local_bg_color(lv.OBJ_PART_MAIN, lv.STATE_DEFAULT, lv_color(0xD00000)) +log.set_style_local_bg_opa(lv.OBJ_PART_MAIN, lv.STATE_DEFAULT, lv.OPA_COVER) +log.set_style_local_text_color(lv.OBJ_PART_MAIN, lv.STATE_DEFAULT, lv_color(0xFFFFFF)) +log.set_text("Welcome to Tasmota") + +tastyle = lv_style() +tastyle.set_bg_color(lv.STATE_DEFAULT, lv_color(0x1fa3ec)) +tastyle.set_border_color(lv.STATE_DEFAULT, lv_color(0x0000FF)) +tastyle.set_bg_color(lv.STATE_FOCUSED, lv_color(0x0000FF)) +tastyle.set_border_color(lv.STATE_FOCUSED, lv_color(0xFFFFFF)) +tastyle.set_text_color(lv.STATE_DEFAULT, lv_color(0xFFFFFF)) +tastyle.set_radius(lv.STATE_DEFAULT, 10) +tastyle.set_bg_opa(lv.STATE_DEFAULT, lv.OPA_COVER) +if f20 != nil tastyle.set_text_font(lv.STATE_DEFAULT, f20) end + +prev_btn = lv_btn(scr) +prev_btn.set_pos(20,vres-40) +prev_btn.set_size(80, 30) +prev_btn.add_style(lv.OBJ_PART_MAIN, tastyle) +prev_label = lv_label(prev_btn) +prev_label.set_text("<") + +next_btn = lv_btn(scr) +next_btn.set_pos(220,vres-40) +next_btn.set_size(80, 30) +next_btn.add_style(lv.OBJ_PART_MAIN, tastyle) +next_label = lv_label(next_btn) +next_label.set_text(">") + +home_btn = lv_btn(scr) +home_btn.set_pos(120,vres-40) +home_btn.set_size(80, 30) +home_btn.add_style(lv.OBJ_PART_MAIN, tastyle) +home_label = lv_label(home_btn) +home_label.set_text(lv.SYMBOL_OK) + + +log_height = log.get_height() + +# log.get_style_pad_right(lv.OBJ_PART_MAIN, lv.STATE_DEFAULT) +log.set_style_local_pad_right(lv.OBJ_PART_MAIN, lv.STATE_DEFAULT, log_height+1) + +bars = lv_wifi_bars(log) + +bars.set_style_local_bg_color(lv.OBJ_PART_MAIN, lv.STATE_DEFAULT, lv_color(lv.BLACK)) + +bars.set_height(log_height) +bars.set_width(log_height) +bars.set_x(log.get_width() - log_height) diff --git a/tasmota/berry/modules/ctypes.be b/tasmota/berry/modules/ctypes.be index 5898a4690..15ec12853 100644 --- a/tasmota/berry/modules/ctypes.be +++ b/tasmota/berry/modules/ctypes.be @@ -59,6 +59,13 @@ ctypes.bf_13 = 113 ctypes.bf_14 = 114 ctypes.bf_15 = 115 +def findinlist(l, x) + for i:0..size(l)-1 + if l[i] == x + return i + end + end +end #------------------------------------------------------------- #- 'get_bits' function @@ -151,34 +158,87 @@ end #- print the C types -#1 ctypes.print_types = def () + print("/********************************************************************") + print(" * Generated code, don't edit") + print(" *******************************************************************/") + print() print("enum {") - print(" ctypes_ptr = 0,") - print(" ctypes_uint = 1,") - print(" ctypes_int = 2,") - print(" ctypes_str = 3,") + print(" ctypes_i32 = 14,") + print(" ctypes_i16 = 12,") + print(" ctypes_i8 = 11,") + print(" ctypes_u32 = 4,") + print(" ctypes_u16 = 2,") + print(" ctypes_u8 = 1,") + print("") + print(" // big endian") + print(" ctypes_be_i32 = -14,") + print(" ctypes_be_i16 = -12,") + print(" ctypes_be_i8 = -11,") + print(" ctypes_be_u32 = -4,") + print(" ctypes_be_u16 = -2,") + print(" ctypes_be_u8 = -1,") + print() + print(" ctypes_bf = 0, //bif-field") print("};") print() print("typedef struct be_ctypes_structure_item_t {") - print(" const char * name;") - print(" uint16_t offset_bits;") - print(" uint16_t len_bits : 13;") - print(" uint16_t type : 3;") + print(" const char * name;") + print(" uint16_t offset_bytes;") + print(" uint8_t offset_bits : 3;") + print(" uint8_t len_bits : 5;") + print(" int8_t type : 5;") + print(" uint8_t mapping : 3;") print("} be_ctypes_structure_item_t;") print() print("typedef struct be_ctypes_structure_t {") - print(" uint16_t size_bytes; /* size in bytes */") - print(" uint16_t size_elt; /* number of elements */") - print(" const be_ctypes_structure_item_t * items;") + print(" uint16_t size_bytes; /* size in bytes */") + print(" uint16_t size_elt; /* number of elements */") + print(" const be_ctypes_structure_item_t * items;") print("} be_ctypes_structure_t;") print() + print("typedef struct be_ctypes_class_t {") + print(" const char * name;") + print(" const be_ctypes_structure_t * definitions;") + print("} be_ctypes_class_t;") + print("") + print("typedef struct be_ctypes_classes_t {") + print(" uint16_t size;") + print(" const char **instance_mapping; /* array of instance class names for automatic instanciation of class */") + print(" const be_ctypes_class_t * classes;") + print("} be_ctypes_classes_t;") + print() + print("BE_EXPORT_VARIABLE extern const bclass be_class_lv_ctypes;") + print() + print("void ctypes_register_class(bvm *vm, const bclass * ctypes_class, const be_ctypes_structure_t * definitions) {") + print(" be_pushntvclass(vm, ctypes_class);") + print(" be_setglobal(vm, str(ctypes_class->name));") + print(" be_pop(vm, 1);") + print("}") + print() + print("/********************************************************************/") end -global_classes = [] # track the list of all classes and +global_classes = [] # track the list of all classes and +global_mappings = [] # mapping to Berry classes, ex: lv_color + ctypes.print_classes = def () + # print mappings + if size(global_mappings) > 7 + raise "internal_error", "too many mappings, 7 max" + end + print("const char * be_ctypes_instance_mappings[] = {") + for n:global_mappings.iter() + print(string.format(" \"%s\",", n)) + end + print(" NULL") + print("};") + print() + ctypes.sort(global_classes) print("const be_ctypes_classes_t be_ctypes_classes[] = {") print(string.format(" %i,", size(global_classes))) + print(string.format(" be_ctypes_instance_mappings,")) print(string.format(" (const be_ctypes_class_t[%i]) {", size(global_classes))) for elt:global_classes @@ -207,6 +267,8 @@ ctypes.print_classes = def () end print("}") + print("/********************************************************************/") + print() end #------------------------------------------------------------- @@ -261,7 +323,7 @@ class structure ctypes.sort(names) for n:names var args = self.mapping[n] - print(string.format(" { \"%s\", %i, %i, %i, %i },", n, args[0], args[1], args[2], args[3])) + print(string.format(" { \"%s\", %i, %i, %i, %i, %i },", n, args[0], args[1], args[2], args[3], args[4])) end print("}};") print() @@ -285,14 +347,29 @@ class structure if isinstance(type_obj, ctypes.structure) # nested structure self.nested(name, type_obj) - elif type(type_obj) == 'int' + end + + var mapping_idx = 0 # mapping starts at 1 + if isinstance(type_obj, list) + # it may be a list to denote a mapping to an instance + var mapping_name = type_obj[1] + if findinlist(global_mappings, mapping_name) == nil + global_mappings.push(mapping_name) + end + mapping_idx = findinlist(global_mappings, mapping_name) + 1 + + type_obj = type_obj[0] # take the simple value of first element in the list + end + + if type(type_obj) == 'int' + # simple attibute # TODO check actual type if type_obj > ctypes.bf_0 # bit field - self.get_bitfield_closure(name, type_obj - ctypes.bf_0) + self.get_bitfield_closure(name, type_obj - ctypes.bf_0, mapping_idx) else # multi-bytes - self.get_int_closure(name, type_obj) + self.get_int_closure(name, type_obj, mapping_idx) end end end @@ -329,7 +406,7 @@ class structure # include nested for subname:type_obj.mapping.keys() var val = type_obj.mapping[subname] - self.mapping[name+"_"+subname] = [val[0] + offset, val[1], val[2], val[3]] + self.mapping[name+"_"+subname] = [val[0] + offset, val[1], val[2], val[3], val[4]] end # self.mapping[name] = [offset << 3, sub_size << 3] @@ -339,7 +416,7 @@ class structure self.cur_offset += sub_size end - def get_int_closure(name, type) # can be 1/2/4 + def get_int_closure(name, type, instance_mapping) # can be 1/2/4 #- abs size -# var size_in_bytes = type < 0 ? - type : type var signed = size_in_bytes > 10 @@ -349,7 +426,7 @@ class structure self.align(size_in_bytes) # force alignment var offset = self.cur_offset # prepare variable for capture in closure - self.mapping[name] = [offset, 0, 0, type] + self.mapping[name] = [offset, 0, 0, type, instance_mapping] #- add closures -# if signed @@ -363,10 +440,10 @@ class structure end - def get_bitfield_closure(name, size_in_bits) # can be 1..32 + def get_bitfield_closure(name, size_in_bits, instance_mapping) # can be 1..32 var cur_offset = self.cur_offset # prepare variable for capture in closure var bit_offset = self.bit_offset - self.mapping[name] = [cur_offset, bit_offset, size_in_bits, 0] + self.mapping[name] = [cur_offset, bit_offset, size_in_bits, 0, instance_mapping] self.get_closures[name] = def (b, p) return ctypes.get_bits(b, cur_offset + p, bit_offset, size_in_bits) end self.set_closures[name] = def (b, p, v) return ctypes.set_bits(b, cur_offset+ p, bit_offset, size_in_bits, v) end @@ -520,93 +597,3 @@ return ctypes 16777472 -# - -# def get_bits(b, offset_bytes, offset_bits, len_bits) -# if !isinstance(b, bytes) raise "value_error", "first argument must be of type 'bytes'" end -# if offset_bits < 0 || offset_bits > 7 raise "value_error", "offset_bits must be between 0 and 7" end -# if len_bits <= 0 || len_bits > 32 raise "value_error", "length in bits must be between 0 and 32" end -# var ret = 0 - -# var bit_shift = 0 # bit number to wrtie to - -# while (len_bits > 0) -# var block_bits = 8 - offset_bits # bit number to read in current block (block = byte) -# if block_bits > len_bits block_bits = len_bits end - -# var mask = ( (1<> offset_bits) << bit_shift) - -# # move the input window -# bit_shift += block_bits -# len_bits -= block_bits -# offset_bits = 0 # start at full next byte -# offset_bytes += 1 -# end - -# return ret -# end - -# Test - -# b=bytes("AAFF10") -# assert(get_bits(b, 0, 0, 1) == 0) -# assert(get_bits(b, 0, 1, 1) == 1) -# assert(get_bits(b, 0, 2, 1) == 0) -# assert(get_bits(b, 0, 3, 1) == 1) - -# assert(get_bits(b, 0, 0, 2) == 2) -# assert(get_bits(b, 0, 1, 2) == 1) -# assert(get_bits(b, 0, 2, 2) == 2) - -# assert(get_bits(b, 0, 0, 8) == 0xAA) -# assert(get_bits(b, 0, 0, 10) == 0x3AA) -# assert(get_bits(b, 0, 2, 8) == 0xEA) - -# assert(get_bits(b, 1, 0, 8) == 0xFF) -# assert(get_bits(b, 1, 0, 10) == 0x0FF) - -# assert(get_bits(b, 1, 0, 16) == 0x10FF) - - -# assert(get_bits(b, 1, 7, 4) == 0x01) -# assert(get_bits(b, 1, 7, 6) == 0x21) - -# def set_bits(b, offset_bytes, offset_bits, len_bits, val) -# if !isinstance(b, bytes) raise "value_error", "first argument must be of type 'bytes'" end -# if offset_bits < 0 || offset_bits > 7 raise "value_error", "offset_bits must be between 0 and 7" end -# if len_bits <= 0 || len_bits > 32 raise "value_error", "length in bits must be between 0 and 32" end - -# while (len_bits > 0) -# var block_bits = 8 - offset_bits # how many bits to write in the current block (block = byte) -# if block_bits > len_bits block_bits = len_bits end - -# var mask_val = (1<>= block_bits -# len_bits -= block_bits -# offset_bits = 0 # start at full next byte -# offset_bytes += 1 -# end -# return b -# end - -# b=bytes("00000000") - -# assert(set_bits(b,0,0,1,1) == bytes('01000000')) -# assert(set_bits(b,1,0,1,1) == bytes('01010000')) -# assert(set_bits(b,0,0,1,2) == bytes('00010000')) -# assert(set_bits(b,0,4,1,1) == bytes('10010000')) -# assert(set_bits(b,0,4,1,0) == bytes('00010000')) - -# b=bytes("FF000000") -# assert(set_bits(b,0,4,1,0) == bytes('EF000000')) -# assert(set_bits(b,0,4,1,1) == bytes('FF000000')) - -# b=bytes("00000000") -# assert(set_bits(b,2,6,1,-1) == bytes('00004000')) -# b=bytes("00000000") -# assert(set_bits(b,2,1,6,-1) == bytes('00007E00')) \ No newline at end of file diff --git a/tasmota/berry/modules/lvgl_ctypes.be b/tasmota/berry/modules/lvgl_ctypes.be index 61b3fdf7c..7238ad621 100644 --- a/tasmota/berry/modules/lvgl_ctypes.be +++ b/tasmota/berry/modules/lvgl_ctypes.be @@ -11,7 +11,7 @@ import ctypes ctypes.print_types() lv_style_int = ctypes.i16 -lv_color = ctypes.u16 # depends on colors +lv_color = [ctypes.u16, "lv_color"] # cast to the class instance, constructor is called with 2 args: (nil, value) lv_grad_dir = ctypes.u8 lv_opa = ctypes.u8 lv_blend_mode = ctypes.u8 diff --git a/tasmota/berry/modules/partition.be b/tasmota/berry/modules/partition.be index 818c4aa4e..364ad636d 100644 --- a/tasmota/berry/modules/partition.be +++ b/tasmota/berry/modules/partition.be @@ -160,6 +160,7 @@ class Partition_info end def tostring() + import string var type_s = "" var subtype_s = "" if self.type == 0 type_s = "app" diff --git a/tasmota/language/de_DE.h b/tasmota/language/de_DE.h index d93f1135a..388abd2f2 100644 --- a/tasmota/language/de_DE.h +++ b/tasmota/language/de_DE.h @@ -1,7 +1,7 @@ /* de-DE.h - localization for German - Germany for Tasmota - Copyright (C) 2021 VinceMasuka + Copyright (C) 2021 VinceMasuka and Jason2866 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 @@ -28,7 +28,7 @@ * Use online command StateText to translate ON, OFF, HOLD and TOGGLE. * Use online command Prefix to translate cmnd, stat and tele. * - * Updated until v9.3.1.3 + * Updated until v9.5.0.3 \*********************************************************************/ //#define LANGUAGE_MODULE_NAME // Enable to display "Module Generic" (ie Spanish), Disable to display "Generic Module" (ie English) @@ -198,8 +198,8 @@ #define D_WEIGHT "Gewicht" #define D_WARMLIGHT "warm" #define D_WEB_SERVER "Web-Server" -#define D_SOC "State of Charge" -#define D_SOH "State of Health" +#define D_SOC "Ladestatus" +#define D_SOH "Gesundheitsstatus" // tasmota.ino #define D_WARNING_MINIMAL_VERSION "ACHTUNG: Diese Version unterstützt keine persistenten Einstellungen" diff --git a/tasmota/language/es_ES.h b/tasmota/language/es_ES.h index cc5afd018..22ff7fe0e 100644 --- a/tasmota/language/es_ES.h +++ b/tasmota/language/es_ES.h @@ -1,5 +1,5 @@ /* - es-ES.h - localization for Spanish - Spain for Tasmota (International Spanish valid for all latinamerica) + es-ES.h - Tasmota localization for Spanish (International Spanish valid for all latinamerica) Copyright (C) 2021 Adrian Scillato @@ -28,7 +28,7 @@ * Use online command StateText to translate ON, OFF, HOLD and TOGGLE. * Use online command Prefix to translate cmnd, stat and tele. * - * Updated until v9.4.0.1 + * Updated until v9.5.0.3 \*********************************************************************/ #define LANGUAGE_MODULE_NAME // Enable to display "Module Generic" (ie Spanish), Disable to display "Generic Module" (ie English) @@ -194,7 +194,7 @@ #define D_UV_POWER "UV Power" #define D_VERSION "Versión" #define D_VOLTAGE "Tensión" -#define D_VOLUME "Volume" +#define D_VOLUME "Volumen" #define D_WEIGHT "Peso" #define D_WARMLIGHT "Cálida" #define D_WEB_SERVER "Servidor Web" diff --git a/tasmota/language/it_IT.h b/tasmota/language/it_IT.h index 021c2eacc..c0e748418 100644 --- a/tasmota/language/it_IT.h +++ b/tasmota/language/it_IT.h @@ -28,7 +28,7 @@ * Use online command StateText to translate ON, OFF, HOLD and TOGGLE. * Use online command Prefix to translate cmnd, stat and tele. * - * Updated until v9.4.0.1 - Last update 28.05.2021 + * Updated until v9.5.0.3 - Last update 19.07.2021 \*********************************************************************/ #define LANGUAGE_MODULE_NAME // Enable to display "Module Generic" (ie Spanish), Disable to display "Generic Module" (ie English) @@ -198,8 +198,8 @@ #define D_WEIGHT "Peso" #define D_WARMLIGHT "Calda" #define D_WEB_SERVER "Server web" -#define D_SOC "Stato di Carica" -#define D_SOH "State of Health" +#define D_SOC "Stato di carica" +#define D_SOH "State di salute" // tasmota.ino #define D_WARNING_MINIMAL_VERSION "ATTENZIONE Questa versione non supporta il salvataggio delle impostazioni" diff --git a/tasmota/language/pt_BR.h b/tasmota/language/pt_BR.h index 0233c77b3..156ce5a8e 100644 --- a/tasmota/language/pt_BR.h +++ b/tasmota/language/pt_BR.h @@ -28,7 +28,7 @@ * Use online command StateText to translate ON, OFF, HOLD and TOGGLE. * Use online command Prefix to translate cmnd, stat and tele. * - * Updated until v9.4.0.1 + * Updated until v9.5.0.3 \*********************************************************************/ #define LANGUAGE_MODULE_NAME // Enable to display "Module Generic" (ie Spanish), Disable to display "Generic Module" (ie English) @@ -198,8 +198,8 @@ #define D_WEIGHT "Peso" #define D_WARMLIGHT "Luz quente" #define D_WEB_SERVER "Servidor WEB" -#define D_SOC "State of Charge" -#define D_SOH "State of Health" +#define D_SOC "Estado de Carga" +#define D_SOH "Estado de Saúde" // tasmota.ino #define D_WARNING_MINIMAL_VERSION "AVISO: esta versão não supporta configurações persistentes" diff --git a/tasmota/language/pt_PT.h b/tasmota/language/pt_PT.h index df17497a6..2f467be6b 100644 --- a/tasmota/language/pt_PT.h +++ b/tasmota/language/pt_PT.h @@ -28,7 +28,7 @@ * Use online command StateText to translate ON, OFF, HOLD and TOGGLE. * Use online command Prefix to translate cmnd, stat and tele. * - * Updated until v9.4.0.1 + * Updated until v9.5.0.3 \*********************************************************************/ #define LANGUAGE_MODULE_NAME // Enable to display "Module Generic" (ie Spanish), Disable to display "Generic Module" (ie English) @@ -198,8 +198,8 @@ #define D_WEIGHT "Peso" #define D_WARMLIGHT "Luz Quente" #define D_WEB_SERVER "Servidor WEB" -#define D_SOC "State of Charge" -#define D_SOH "State of Health" +#define D_SOC "Estado de Carga" +#define D_SOH "Estado de Saúde" // tasmota.ino #define D_WARNING_MINIMAL_VERSION "AVISO esta versão não supporta configurações persistentes" diff --git a/tasmota/lvgl_berry/be_lv_c_mapping.h b/tasmota/lvgl_berry/be_lv_c_mapping.h index 2ffb0a49d..fe07625bf 100644 --- a/tasmota/lvgl_berry/be_lv_c_mapping.h +++ b/tasmota/lvgl_berry/be_lv_c_mapping.h @@ -13,15 +13,15 @@ extern "C" { #if BE_LV_WIDGET_IMG const lvbe_call_c_t lv_img_func[] = { { "buf_free", (void*) &lv_img_buf_free, "", "(lv_img_dsc)" }, - { "buf_get_img_size", (void*) &lv_img_buf_get_img_size, "i", "ii(lv_img_cf)" }, + { "buf_get_img_size", (void*) &lv_img_buf_get_img_size, "i", "iii" }, { "buf_get_px_alpha", (void*) &lv_img_buf_get_px_alpha, "i", "(lv_img_dsc)ii" }, { "buf_get_px_color", (void*) &lv_img_buf_get_px_color, "lv_color", "(lv_img_dsc)ii(lv_color)" }, { "buf_set_palette", (void*) &lv_img_buf_set_palette, "", "(lv_img_dsc)i(lv_color)" }, { "buf_set_px_alpha", (void*) &lv_img_buf_set_px_alpha, "", "(lv_img_dsc)iii" }, { "buf_set_px_color", (void*) &lv_img_buf_set_px_color, "", "(lv_img_dsc)ii(lv_color)" }, - { "cf_get_px_size", (void*) &lv_img_cf_get_px_size, "i", "(lv_img_cf)" }, - { "cf_has_alpha", (void*) &lv_img_cf_has_alpha, "b", "(lv_img_cf)" }, - { "cf_is_chroma_keyed", (void*) &lv_img_cf_is_chroma_keyed, "b", "(lv_img_cf)" }, + { "cf_get_px_size", (void*) &lv_img_cf_get_px_size, "i", "i" }, + { "cf_has_alpha", (void*) &lv_img_cf_has_alpha, "b", "i" }, + { "cf_is_chroma_keyed", (void*) &lv_img_cf_is_chroma_keyed, "b", "i" }, { "create", (void*) &lv_img_create, "+lv_img", "(lv_obj)(lv_obj)" }, { "get_angle", (void*) &lv_img_get_angle, "i", "(lv_obj)" }, { "get_antialias", (void*) &lv_img_get_antialias, "b", "(lv_obj)" }, @@ -612,7 +612,7 @@ const lvbe_call_c_t lv_canvas_func[] = { { "draw_text", (void*) &lv_canvas_draw_text, "", "(lv_obj)iii(lv_draw_label_dsc)si" }, { "fill_bg", (void*) &lv_canvas_fill_bg, "", "(lv_obj)(lv_color)i" }, { "get_px", (void*) &lv_canvas_get_px, "lv_color", "(lv_obj)ii" }, - { "set_buffer", (void*) &lv_canvas_set_buffer, "", "(lv_obj).ii(lv_img_cf)" }, + { "set_buffer", (void*) &lv_canvas_set_buffer, "", "(lv_obj).iii" }, { "set_palette", (void*) &lv_canvas_set_palette, "", "(lv_obj)i(lv_color)" }, { "set_px", (void*) &lv_canvas_set_px, "", "(lv_obj)ii(lv_color)" }, { "transform", (void*) &lv_canvas_transform, "", "(lv_obj)(lv_img_dsc)iiiiiib" }, @@ -927,9 +927,10 @@ const lvbe_call_c_t lv_msgbox_func[] = { /* `lv_objmask` methods */ #if BE_LV_WIDGET_OBJMASK const lvbe_call_c_t lv_objmask_func[] = { + { "add_mask", (void*) &lv_objmask_add_mask, ".", "(lv_obj)." }, { "create", (void*) &lv_objmask_create, "+lv_objmask", "(lv_obj)(lv_obj)" }, - { "remove_mask", (void*) &lv_objmask_remove_mask, "", "(lv_obj)(lv_objmask_mask)" }, - { "update_mask", (void*) &lv_objmask_update_mask, "", "(lv_obj)(lv_objmask_mask)." }, + { "remove_mask", (void*) &lv_objmask_remove_mask, "", "(lv_obj)." }, + { "update_mask", (void*) &lv_objmask_update_mask, "", "(lv_obj).." }, }; #endif // BE_LV_WIDGET_OBJMASK diff --git a/tasmota/my_user_config.h b/tasmota/my_user_config.h index 16df7aa0a..3e3004ab0 100644 --- a/tasmota/my_user_config.h +++ b/tasmota/my_user_config.h @@ -68,7 +68,8 @@ #define WIFI_IP_ADDRESS "0.0.0.0" // [IpAddress1] Set to 0.0.0.0 for using DHCP or enter a static IP address #define WIFI_GATEWAY "192.168.1.1" // [IpAddress2] If not using DHCP set Gateway IP address #define WIFI_SUBNETMASK "255.255.255.0" // [IpAddress3] If not using DHCP set Network mask -#define WIFI_DNS "192.168.1.1" // [IpAddress4] If not using DHCP set DNS IP address (might be equal to WIFI_GATEWAY) +#define WIFI_DNS "192.168.1.1" // [IpAddress4] If not using DHCP set DNS1 IP address (might be equal to WIFI_GATEWAY) +#define WIFI_DNS2 "0.0.0.0" // [IpAddress5] If not using DHCP set DNS2 IP address (might be equal to WIFI_GATEWAY) #define STA_SSID1 "" // [Ssid1] Wi-Fi SSID #define STA_PASS1 "" // [Password1] Wi-Fi password @@ -172,7 +173,8 @@ #define FRIENDLY_NAME "Tasmota" // [FriendlyName] Friendlyname up to 32 characters used by webpages and Alexa #define EMULATION EMUL_NONE // [Emulation] Select Belkin WeMo (single relay/light) or Hue Bridge emulation (multi relay/light) (EMUL_NONE, EMUL_WEMO or EMUL_HUE) #define EMULATION_HUE_1ST_GEN false // [Emulation] Force SetOption109 1 - if you only have Echo Dot 2nd gen devices -#define CORS_DOMAIN "" // [Cors] CORS Domain for preflight requests +//#define USE_CORS // [Cors] Enable CORS - Be aware that this feature is unsecure ATM (https://github.com/arendst/Tasmota/issues/6767) + #define CORS_DOMAIN "" // [Cors] CORS Domain for preflight requests // -- HTTP Options -------------------------------- #define GUI_SHOW_HOSTNAME false // [SetOption53] Show hostname and IP address in GUI main menu @@ -388,6 +390,16 @@ // -- OTA ----------------------------------------- //#define USE_ARDUINO_OTA // Add optional support for Arduino OTA (+13k code) +// -- Influxdb ------------------------------------ +//#define USE_INFLUXDB // Enable influxdb support (+5k code) +// #define INFLUXDB_STATE 0 // [Ifx] Influxdb initially Off (0) or On (1) +// #define INFLUXDB_VERSION 1 // Version of Influxdb 1 or 2 +// #define INFLUXDB_HOST "influxdb" // [IfxHost] Influxdb hostname or IP address +// #define INFLUXDB_PORT 8086 // [IfxPort] Influxdb port number +// #define INFLUXDB_ORG "" // [IfxUser, IfxOrg] Influxdb v1 username or v2 organisation +// #define INFLUXDB_TOKEN "" // [IfxPassword, IfxToken] Influxdb v1 password or v2 token +// #define INFLUXDB_BUCKET "db" // [IfxDatabase, IfxBucket] Influxdb v1 database or v2 bucket + // -- MQTT ---------------------------------------- #define MQTT_LWT_OFFLINE "Offline" // MQTT LWT offline topic message #define MQTT_LWT_ONLINE "Online" // MQTT LWT online topic message diff --git a/tasmota/settings.h b/tasmota/settings.h index 6ade9fc44..9fb21e886 100644 --- a/tasmota/settings.h +++ b/tasmota/settings.h @@ -157,7 +157,7 @@ typedef union { // Restricted by MISRA-C Rule 18.4 bu uint32_t zigbee_hide_bridge_topic : 1; // bit 11 (v9.3.1.1) - SetOption125 - (Zigbee) Hide bridge topic from zigbee topic (use with SetOption89) (1) uint32_t ds18x20_mean : 1; // bit 12 (v9.3.1.2) - SetOption126 - (DS18x20) Enable arithmetic mean over teleperiod for JSON temperature (1) uint32_t wifi_no_sleep : 1; // bit 13 (v9.5.0.2) - SetOption127 - (Wifi) Keep wifi in no-sleep mode, prevents some occasional unresponsiveness - uint32_t spare14 : 1; // bit 14 + uint32_t disable_referer_chk : 1; // bit 14 (v9.5.0.5) - SetOption128 - (Web) Allow access without referer check uint32_t spare15 : 1; // bit 15 uint32_t spare16 : 1; // bit 16 uint32_t spare17 : 1; // bit 17 @@ -245,11 +245,11 @@ typedef union { uint32_t telegram_send_enable : 1; // bit 0 (v9.4.0.3) - CMND_TMSTATE 0/1 - Enable Telegram send uint32_t telegram_recv_enable : 1; // bit 1 (v9.4.0.3) - CMND_TMSTATE 2/3 - Enable Telegram receive uint32_t telegram_echo_enable : 1; // bit 2 (v9.4.0.3) - CMND_TMSTATE 4/5 - Enable Telegram echo - uint32_t spare03 : 1; // bit 3 - uint32_t spare04 : 1; // bit 4 - uint32_t spare05 : 1; // bit 5 - uint32_t spare06 : 1; // bit 6 - uint32_t spare07 : 1; // bit 7 + uint32_t range_extender : 1; // bit 3 (v9.5.0.5) - CMND_RGXSTATE - Enable range extender + uint32_t range_extender_napt : 1; // bit 4 (v9.5.0.5) - CMND_RGXNAPT - Enable range extender NAPT + uint32_t sonoff_l1_music_sync : 1; // bit 5 (v9.5.0.5) - CMND_L1MUSICSYNC - Enable sync to music + uint32_t influxdb_default : 1; // bit 6 (v9.5.0.5) - Set influxdb initial defaults if 0 + uint32_t influxdb_state : 1; // bit 7 (v9.5.0.5) - CMND_IFX - Enable influxdb support uint32_t spare08 : 1; // bit 8 uint32_t spare09 : 1; // bit 9 uint32_t spare10 : 1; // bit 10 @@ -583,11 +583,9 @@ typedef struct { uint8_t switchmode[MAX_SWITCHES_SET]; // 4A9 uint8_t free_4c5[5]; // 4C5 - uint8_t ex_interlock[4]; // 4CA MAX_INTERLOCKS = MAX_RELAYS / 2 (Legacy) - uint8_t free_4ce[2]; // 4CE - + uint16_t influxdb_port; // 4CE power_t interlock[MAX_INTERLOCKS_SET]; // 4D0 MAX_INTERLOCKS = MAX_RELAYS / 2 uint8_t free_508[36]; // 508 @@ -598,10 +596,11 @@ typedef struct { uint8_t ina219_mode; // 531 uint16_t pulse_timer[MAX_PULSETIMERS]; // 532 uint16_t button_debounce; // 542 - uint32_t ipv4_address[4]; // 544 - unsigned long energy_kWhtotal; // 554 + uint32_t ipv4_address[5]; // 544 + uint32_t ipv4_rgx_address; // 558 + uint32_t ipv4_rgx_subnetmask; // 55C - uint8_t free_558[100]; // 558 + uint8_t free_560[92]; // 560 SysMBitfield1 flag2; // 5BC unsigned long pulse_counter[MAX_COUNTERS]; // 5C0 @@ -642,7 +641,6 @@ typedef struct { uint16_t baudrate; // 778 uint16_t sbaudrate; // 77A EnergyUsage energy_usage; // 77C - uint32_t sensors[2][4]; // 794 Disable individual (0) sensor drivers / (1) GUI sensor output uint32_t energy_kWhtotal_time; // 7B4 unsigned long weight_item; // 7B8 Weight of one item in gram * 10 @@ -653,9 +651,7 @@ typedef struct { unsigned long energy_frequency_calibration; // 7C8 Also used by HX711 to save last weight uint16_t web_refresh; // 7CC char script_pram[5][10]; // 7CE - char rules[MAX_RULE_SETS][MAX_RULE_SIZE]; // 800 Uses 512 bytes in v5.12.0m, 3 x 512 bytes in v5.14.0b - TuyaFnidDpidMap tuya_fnid_map[MAX_TUYA_FUNCTIONS]; // E00 32 bytes uint16_t ina226_r_shunt[4]; // E20 uint16_t ina226_i_fs[4]; // E28 @@ -691,9 +687,7 @@ typedef struct { uint8_t webserver; // ECD uint8_t weblog_level; // ECE uint8_t mqtt_fingerprint[2][20]; // ECF - - uint8_t ex_adc_param_type; // EF7 Free since 9.0.0.1 - + uint8_t influxdb_version; // EF7 SOBitfield4 flag4; // EF8 uint16_t mqtt_port; // EFC uint8_t serial_config; // EFE @@ -737,10 +731,11 @@ typedef struct { uint16_t shd_warmup_brightness; // F5C uint8_t shd_warmup_time; // F5E - uint8_t free_f5f[65]; // F5F - Decrement if adding new Setting variables just above and below + uint8_t free_f5f[61]; // F5F - Decrement if adding new Setting variables just above and below // Only 32 bit boundary variables below + unsigned long energy_kWhtotal; // F9C SBitfield1 sbflag1; // FA0 TeleinfoCfg teleinfo; // FA4 uint64_t rf_protocol_mask; // FA8 diff --git a/tasmota/settings.ino b/tasmota/settings.ino index 177df024b..30f1c0cda 100644 --- a/tasmota/settings.ino +++ b/tasmota/settings.ino @@ -859,6 +859,9 @@ void SettingsDefaultSet2(void) { ParseIPv4(&Settings->ipv4_address[1], PSTR(WIFI_GATEWAY)); ParseIPv4(&Settings->ipv4_address[2], PSTR(WIFI_SUBNETMASK)); ParseIPv4(&Settings->ipv4_address[3], PSTR(WIFI_DNS)); + ParseIPv4(&Settings->ipv4_address[4], PSTR(WIFI_DNS2)); + ParseIPv4(&Settings->ipv4_rgx_address, PSTR(WIFI_RGX_IP_ADDRESS)); + ParseIPv4(&Settings->ipv4_rgx_subnetmask, PSTR(WIFI_RGX_SUBNETMASK)); Settings->sta_config = WIFI_CONFIG_TOOL; // Settings->sta_active = 0; SettingsUpdateText(SET_STASSID1, PSTR(STA_SSID1)); @@ -866,6 +869,10 @@ void SettingsDefaultSet2(void) { SettingsUpdateText(SET_STAPWD1, PSTR(STA_PASS1)); SettingsUpdateText(SET_STAPWD2, PSTR(STA_PASS2)); SettingsUpdateText(SET_HOSTNAME, WIFI_HOSTNAME); + SettingsUpdateText(SET_RGX_SSID, PSTR(WIFI_RGX_SSID)); + SettingsUpdateText(SET_RGX_PASSWORD, PSTR(WIFI_RGX_PASSWORD)); + Settings->sbflag1.range_extender = WIFI_RGX_STATE; + Settings->sbflag1.range_extender_napt = WIFI_RGX_NAPT; // Syslog SettingsUpdateText(SET_SYSLOG_HOST, PSTR(SYS_LOG_HOST)); @@ -1327,7 +1334,7 @@ void SettingsDelta(void) { if (Settings->version < 0x09000002) { char parameters[32]; snprintf_P(parameters, sizeof(parameters), PSTR("%d,%d,%d,%d,%d"), - Settings->ex_adc_param_type, Settings->sensors[0][0], Settings->sensors[0][1], (int)Settings->sensors[0][2], Settings->mbflag2.data); + Settings->influxdb_version, Settings->sensors[0][0], Settings->sensors[0][1], (int)Settings->sensors[0][2], Settings->mbflag2.data); SettingsUpdateText(SET_ADC_PARAM1, parameters); } #endif // ESP8266 @@ -1376,6 +1383,18 @@ void SettingsDelta(void) { if (Settings->version < 0x09050003) { memset(&Settings->sensors, 0xFF, 16); // Enable all possible sensors } + if (Settings->version < 0x09050004) { + Settings->energy_kWhtotal = Settings->ipv4_address[4]; + ParseIPv4(&Settings->ipv4_address[4], PSTR(WIFI_DNS2)); + } + if (Settings->version < 0x09050005) { + Settings->sbflag1.range_extender = WIFI_RGX_STATE; + Settings->sbflag1.range_extender_napt = WIFI_RGX_NAPT; + ParseIPv4(&Settings->ipv4_rgx_address, PSTR(WIFI_RGX_IP_ADDRESS)); + ParseIPv4(&Settings->ipv4_rgx_subnetmask, PSTR(WIFI_RGX_SUBNETMASK)); + SettingsUpdateText(SET_RGX_SSID, PSTR(WIFI_RGX_SSID)); + SettingsUpdateText(SET_RGX_PASSWORD, PSTR(WIFI_RGX_PASSWORD)); + } Settings->version = VERSION; SettingsSave(1); diff --git a/tasmota/support.ino b/tasmota/support.ino index a7fb0975c..2e17c7915 100644 --- a/tasmota/support.ino +++ b/tasmota/support.ino @@ -523,6 +523,12 @@ bool StrCaseStr_P(const char* source, const char* search) { return (strstr(case_source, case_search) != nullptr); } +bool IsNumeric(const char* value) { + char *digit = (char*)value; + while (isdigit(*digit) || *digit == '.' || *digit == '-') { digit++; } + return (*digit == '\0'); +} + char* Trim(char* p) { if (*p != '\0') { @@ -964,7 +970,7 @@ const uint8_t sNumbers[] PROGMEM = { 0,0,0,0,0,0,0, 4,4, 255 }; -int GetStateNumber(char *state_text) +int GetStateNumber(const char *state_text) { char command[CMDSZ]; int state_number = GetCommandCode(command, sizeof(command), state_text, kOptions); @@ -1185,6 +1191,14 @@ char* ResponseGetTime(uint32_t format, char* time_str) return time_str; } +char* ResponseData(void) { +#ifdef MQTT_DATA_STRING + return (char*)TasmotaGlobal.mqtt_data.c_str(); +#else + return TasmotaGlobal.mqtt_data; +#endif +} + uint32_t ResponseSize(void) { #ifdef MQTT_DATA_STRING return MAX_LOGSZ; // Arbitratry max length satisfying full log entry @@ -1327,29 +1341,15 @@ int ResponseJsonEndEnd(void) } bool ResponseContains_P(const char* needle) { +/* #ifdef MQTT_DATA_STRING return (strstr_P(TasmotaGlobal.mqtt_data.c_str(), needle) != nullptr); #else return (strstr_P(TasmotaGlobal.mqtt_data, needle) != nullptr); #endif -} - -/* -uint32_t ResponseContains_P(const char* needle) { - const char *tmp; -#ifdef MQTT_DATA_STRING - tmp = TasmotaGlobal.mqtt_data.c_str(); -#else - tmp = TasmotaGlobal.mqtt_data; -#endif - uint32_t count = 0; - while (tmp = strstr_P(tmp, needle)) { - count++; - tmp++; - } - return count; -} */ + return (strstr_P(ResponseData(), needle) != nullptr); +} /*********************************************************************************************\ * GPIO Module and Template management diff --git a/tasmota/support_command.ino b/tasmota/support_command.ino index cad553579..c728c0fb4 100644 --- a/tasmota/support_command.ino +++ b/tasmota/support_command.ino @@ -432,7 +432,7 @@ void CmndStatusResponse(uint32_t index) { all_status = (const char*) nullptr; } else { if (0 == index) { all_status = ""; } - all_status += TasmotaGlobal.mqtt_data; + all_status += ResponseData(); } } else if (index < 99) { @@ -567,10 +567,10 @@ void CmndStatus(void) if ((0 == payload) || (5 == payload)) { Response_P(PSTR("{\"" D_CMND_STATUS D_STATUS5_NETWORK "\":{\"" D_CMND_HOSTNAME "\":\"%s\",\"" D_CMND_IPADDRESS "\":\"%_I\",\"" - D_JSON_GATEWAY "\":\"%_I\",\"" D_JSON_SUBNETMASK "\":\"%_I\",\"" D_JSON_DNSSERVER "\":\"%_I\",\"" + D_JSON_GATEWAY "\":\"%_I\",\"" D_JSON_SUBNETMASK "\":\"%_I\",\"" D_JSON_DNSSERVER "1\":\"%_I\",\"" D_JSON_DNSSERVER "2\":\"%_I\",\"" D_JSON_MAC "\":\"%s\",\"" D_CMND_WEBSERVER "\":%d,\"" D_CMND_WIFICONFIG "\":%d,\"" D_CMND_WIFIPOWER "\":%s}}"), NetworkHostname(), (uint32_t)NetworkAddress(), - Settings->ipv4_address[1], Settings->ipv4_address[2], Settings->ipv4_address[3], + Settings->ipv4_address[1], Settings->ipv4_address[2], Settings->ipv4_address[3], Settings->ipv4_address[4], NetworkMacAddress().c_str(), Settings->webserver, Settings->sta_config, WifiGetOutputPower().c_str()); CmndStatusResponse(5); } @@ -1642,12 +1642,12 @@ void CmndLogport(void) void CmndIpAddress(void) { - if ((XdrvMailbox.index > 0) && (XdrvMailbox.index <= 4)) { + if ((XdrvMailbox.index > 0) && (XdrvMailbox.index <= 5)) { char network_address[22]; ext_snprintf_P(network_address, sizeof(network_address), PSTR(" (%_I)"), (uint32_t)NetworkAddress()); if (!XdrvMailbox.usridx) { ResponseClear(); - for (uint32_t i = 0; i < 4; i++) { + for (uint32_t i = 0; i < 5; i++) { ResponseAppend_P(PSTR("%c\"%s%d\":\"%_I%s\""), (i)?',':'{', XdrvMailbox.command, i +1, Settings->ipv4_address[i], (0 == i)?network_address:""); } ResponseJsonEnd(); diff --git a/tasmota/support_features.ino b/tasmota/support_features.ino index 5bd902209..ec5bc7bdd 100644 --- a/tasmota/support_features.ino +++ b/tasmota/support_features.ino @@ -753,9 +753,15 @@ void ResponseAppendFeatures(void) #if defined(USE_SPI) && defined(USE_MCP2515) feature8 |= 0x00000100; // xsns_87_mcp2515.ino #endif -// feature8 |= 0x00000200; -// feature8 |= 0x00000400; -// feature8 |= 0x00000800; +#ifdef USE_TASMESH + feature8 |= 0x00000200; // xdrv_57_9_tasmesh.ino +#endif +#ifdef USE_WIFI_RANGE_EXTENDER + feature8 |= 0x00000400; // xdrv_58_range_extender.ino +#endif +#ifdef USE_INFLUXDB + feature8 |= 0x00000800; // xdrv_59_influxdb.ino +#endif // feature8 |= 0x00001000; // feature8 |= 0x00002000; diff --git a/tasmota/support_rotary.ino b/tasmota/support_rotary.ino index 951291357..e39913f73 100644 --- a/tasmota/support_rotary.ino +++ b/tasmota/support_rotary.ino @@ -47,7 +47,9 @@ #endif const uint8_t rotary_offset = 128; +#ifdef ESP8266 const int8_t rotary_state_pos[16] = { 0, 1, -1, 2, -1, 0, -2, 1, 1, -2, 0, -1, 2, -1, 1, 0 }; +#endif // ESP8266 struct ROTARY { uint8_t no_pullup_mask_a = 0; // Rotary A pull-up bitmask flags @@ -111,6 +113,13 @@ void IRAM_ATTR RotaryIsrArgMiDesk(void *arg) { uint32_t state = encoder->state & 3; if (digitalRead(encoder->pina)) { state |= 4; } if (digitalRead(encoder->pinb)) { state |= 8; } + +#ifdef ESP32 +// This fails intermittendly with panic (Cache disabled but cached memory region accessed) if not in DRAM +// https://docs.espressif.com/projects/esp-idf/en/latest/esp32/api-guides/memory-types.html + const static DRAM_ATTR int8_t rotary_state_pos[16] = { 0, 1, -1, 2, -1, 0, -2, 1, 1, -2, 0, -1, 2, -1, 1, 0 }; +#endif // ESP32 + encoder->position += rotary_state_pos[state]; encoder->state = (state >> 2); } @@ -144,13 +153,15 @@ void RotaryInitMaxSteps(void) { void RotaryInit(void) { Rotary.present = false; - Rotary.model = 1; + Rotary.model = !TasmotaGlobal.gpio_optiona.rotary_mi_desk; // Option_A5 #ifdef ESP8266 if (MI_DESK_LAMP == TasmotaGlobal.module_type) { Rotary.model = 0; } #endif // ESP8266 + AddLog(LOG_LEVEL_DEBUG, PSTR("ROT: Mode %d"), Rotary.model); + RotaryInitMaxSteps(); for (uint32_t index = 0; index < MAX_ROTARIES; index++) { diff --git a/tasmota/support_tasmota.ino b/tasmota/support_tasmota.ino index 621881439..22bb3a136 100644 --- a/tasmota/support_tasmota.ino +++ b/tasmota/support_tasmota.ino @@ -77,6 +77,13 @@ char* GetOtaUrl(char *otaurl, size_t otaurl_size) return otaurl; } +String ResolveToken(const char* input) { + String resolved = input; + resolved.replace(F("%hostname%"), TasmotaGlobal.hostname); + resolved.replace(F("%id%"), NetworkUniqueId()); + return resolved; +} + char* GetTopic_P(char *stopic, uint32_t prefix, char *topic, const char* subtopic) { /* prefix 0 = Cmnd @@ -120,8 +127,7 @@ char* GetTopic_P(char *stopic, uint32_t prefix, char *topic, const char* subtopi fulltopic.replace(FPSTR(MQTT_TOKEN_PREFIX), SettingsText(SET_MQTTPREFIX1 + prefix)); fulltopic.replace(FPSTR(MQTT_TOKEN_TOPIC), (const __FlashStringHelper *)topic); - fulltopic.replace(F("%hostname%"), TasmotaGlobal.hostname); - fulltopic.replace(F("%id%"), NetworkUniqueId()); + fulltopic = ResolveToken(fulltopic.c_str()); } fulltopic.replace(F("#"), ""); fulltopic.replace(F("//"), "/"); @@ -1844,6 +1850,10 @@ void GpioInit(void) pinMode(i, OUTPUT); digitalWrite(i, 0); } + +/* + // Until 20210726 + // Set any non-used GPIO to INPUT - Related to resetPins() in support_legacy_cores.ino // Doing it here solves relay toggles at restart. #if CONFIG_IDF_TARGET_ESP32C3 @@ -1859,6 +1869,16 @@ void GpioInit(void) } } #endif // CONFIG_IDF_TARGET_ESP32C3 +*/ +#ifdef ESP8266 + // Set any non-used GPIO to INPUT - Related to resetPins() in support_legacy_cores.ino + // Doing it here solves relay toggles at restart. + else if (((i < 6) || (i > 11)) && (GPIO_NONE == mpin)) { // Skip SPI flash interface + if (!((1 == i) || (3 == i))) { // Skip serial + pinMode(i, INPUT); + } + } +#endif // ESP8266 } // Digital input diff --git a/tasmota/support_wifi.ino b/tasmota/support_wifi.ino index 6f61f41ab..ff5f48d51 100644 --- a/tasmota/support_wifi.ino +++ b/tasmota/support_wifi.ino @@ -49,6 +49,7 @@ struct WIFI { uint8_t counter; uint8_t retry_init; uint8_t retry; + uint8_t max_retry; uint8_t status; uint8_t config_type = 0; uint8_t config_counter = 0; @@ -206,7 +207,7 @@ void WifiBegin(uint8_t flag, uint8_t channel) Settings->sta_active ^= 1; // Skip empty SSID } if (Settings->ipv4_address[0]) { - WiFi.config(Settings->ipv4_address[0], Settings->ipv4_address[1], Settings->ipv4_address[2], Settings->ipv4_address[3]); // Set static IP + WiFi.config(Settings->ipv4_address[0], Settings->ipv4_address[1], Settings->ipv4_address[2], Settings->ipv4_address[3], Settings->ipv4_address[4]); // Set static IP } WiFi.hostname(TasmotaGlobal.hostname); // ESP8266 needs this here (after WiFi.mode) @@ -388,12 +389,14 @@ void WifiCheckIp(void) WifiSetState(1); Wifi.counter = WIFI_CHECK_SEC; Wifi.retry = Wifi.retry_init; + Wifi.max_retry = 0; if (Wifi.status != WL_CONNECTED) { AddLog(LOG_LEVEL_INFO, PSTR(D_LOG_WIFI D_CONNECTED)); // AddLog(LOG_LEVEL_INFO, PSTR("Wifi: Set IP addresses")); Settings->ipv4_address[1] = (uint32_t)WiFi.gatewayIP(); Settings->ipv4_address[2] = (uint32_t)WiFi.subnetMask(); Settings->ipv4_address[3] = (uint32_t)WiFi.dnsIP(); + Settings->ipv4_address[4] = (uint32_t)WiFi.dnsIP(1); // Save current AP parameters for quick reconnect Settings->wifi_channel = WiFi.channel(); @@ -439,6 +442,10 @@ void WifiCheckIp(void) if (!Wifi.retry || ((Wifi.retry_init / 2) == Wifi.retry)) { AddLog(LOG_LEVEL_INFO, PSTR(D_LOG_WIFI D_CONNECT_FAILED_AP_TIMEOUT)); Settings->wifi_channel = 0; // Disable stored AP + Wifi.max_retry++; + if (100 == Wifi.max_retry) { // Restart after 100 * (WIFI_RETRY_OFFSET_SEC + MAC) / 2 seconds + TasmotaGlobal.restart_flag = 2; + } } else { if (!strlen(SettingsText(SET_STASSID1)) && !strlen(SettingsText(SET_STASSID2))) { Settings->wifi_channel = 0; // Disable stored AP @@ -584,6 +591,7 @@ void WifiConnect(void) Wifi.status = 0; Wifi.retry_init = WIFI_RETRY_OFFSET_SEC + (ESP_getChipId() & 0xF); // Add extra delay to stop overrun by simultanous re-connects Wifi.retry = Wifi.retry_init; + Wifi.max_retry = 0; Wifi.counter = 1; memcpy((void*) &Wifi.bssid, (void*) Settings->wifi_bssid, sizeof(Wifi.bssid)); @@ -707,6 +715,7 @@ void wifiKeepAlive(void) { void WifiPollNtp() { static uint8_t ntp_sync_minute = 0; + static uint32_t ntp_run_time = 0; if (TasmotaGlobal.global_state.network_down || Rtc.user_time_entry) { return; } @@ -715,17 +724,26 @@ void WifiPollNtp() { ntp_sync_minute = 1; // If sync prepare for a new cycle } // First try ASAP to sync. If fails try once every 60 seconds based on chip id - uint8_t offset = (TasmotaGlobal.uptime < 30) ? RtcTime.second : (((ESP_getChipId() & 0xF) * 3) + 3) ; + uint8_t offset = (TasmotaGlobal.uptime < 30) ? RtcTime.second + ntp_run_time : (((ESP_getChipId() & 0xF) * 3) + 3) ; + if ( (((offset == RtcTime.second) && ( (RtcTime.year < 2016) || // Never synced (ntp_sync_minute == uptime_minute))) || // Re-sync every hour TasmotaGlobal.ntp_force_sync ) ) { // Forced sync TasmotaGlobal.ntp_force_sync = false; + + AddLog(LOG_LEVEL_DEBUG_MORE, PSTR("NTP: Synch time...")); + ntp_run_time = millis(); uint32_t ntp_time = WifiGetNtp(); + ntp_run_time = (millis() - ntp_run_time) / 1000; +// AddLog(LOG_LEVEL_DEBUG, PSTR("NTP: Runtime %d"), ntp_run_time); + if (ntp_run_time < 5) { ntp_run_time = 0; } // DNS timeout is around 10s + if (ntp_time > START_VALID_TIME) { Rtc.utc_time = ntp_time; ntp_sync_minute = 60; // Sync so block further requests RtcSync(); + AddLog(LOG_LEVEL_DEBUG_MORE, PSTR("NTP: Synched")); } else { ntp_sync_minute++; // Try again in next minute } @@ -750,19 +768,23 @@ uint32_t WifiGetNtp(void) { ntp_server = fallback_ntp_server; } if (strlen(ntp_server)) { - resolved_ip = (WiFi.hostByName(ntp_server, time_server_ip) == 1); - if (255 == time_server_ip[0]) { resolved_ip = false; } + resolved_ip = (WiFi.hostByName(ntp_server, time_server_ip) == 1); // DNS timeout set to (ESP8266) 10s / (ESP32) 14s + if ((255 == time_server_ip[0]) || // No valid name resolved (255.255.255.255) + ((255 == time_server_ip[1]) && (255 == time_server_ip[2]) && (255 == time_server_ip[3]))) { // No valid name resolved (x.255.255.255) + resolved_ip = false; + } yield(); if (resolved_ip) { break; } +// AddLog(LOG_LEVEL_DEBUG, PSTR("NTP: Unable to resolve '%s'"), ntp_server); } ntp_server_id++; } if (!resolved_ip) { -// AddLog(LOG_LEVEL_DEBUG, PSTR("NTP: No server found")); + AddLog(LOG_LEVEL_DEBUG, PSTR("NTP: Unable to resolve IP address")); return 0; } -// AddLog(LOG_LEVEL_DEBUG, PSTR("NTP: Name %s, IP %_I"), ntp_server, (uint32_t)time_server_ip); +// AddLog(LOG_LEVEL_DEBUG, PSTR("NTP: Host %s IP %_I"), ntp_server, (uint32_t)time_server_ip); WiFiUDP udp; diff --git a/tasmota/tasmota.h b/tasmota/tasmota.h index 0fc1b662c..5a475cc9d 100644 --- a/tasmota/tasmota.h +++ b/tasmota/tasmota.h @@ -136,7 +136,7 @@ const uint32_t PWM_RANGE = 1023; // 255..1023 needs to be devisible b //const uint16_t PWM_FREQ = 910; // 100..1000 Hz led refresh (iTead value) const uint16_t PWM_FREQ = 977; // 100..4000 Hz led refresh #ifdef ESP32 -const uint16_t PWM_MAX = 50000; // [PWM_MAX] Maximum frequency for ESP32 - Default: 4000 +const uint16_t PWM_MAX = 50000; // [PWM_MAX] Maximum frequency for ESP32 - Default: 50000 #else const uint16_t PWM_MAX = 4000; // [PWM_MAX] Maximum frequency - Default: 4000 #endif @@ -368,6 +368,8 @@ enum SettingsTextIndex { SET_OTAURL, SET_SWITCH_TXT25, SET_SWITCH_TXT26, SET_SWITCH_TXT27, SET_SWITCH_TXT28, // MAX_SWITCHES_TXT #endif // ESP32 SET_SHD_PARAM, + SET_RGX_SSID, SET_RGX_PASSWORD, + SET_INFLUXDB_HOST, SET_INFLUXDB_PORT, SET_INFLUXDB_ORG, SET_INFLUXDB_TOKEN, SET_INFLUXDB_BUCKET, SET_MAX }; enum SpiInterfaces { SPI_NONE, SPI_MOSI, SPI_MISO, SPI_MOSI_MISO }; diff --git a/tasmota/tasmota.ino b/tasmota/tasmota.ino index 721770637..15a5cf519 100644 --- a/tasmota/tasmota.ino +++ b/tasmota/tasmota.ino @@ -1,5 +1,5 @@ /* - tasmota.ino - Tasmota firmware for iTead Sonoff, Wemos and NodeMCU hardware + tasmota.ino - Tasmota firmware for iTead Sonoff, Wemos, NodeMCU, ESP8266 and ESP32 hardwares Copyright (C) 2021 Theo Arends @@ -66,7 +66,7 @@ #endif // USE_SDCARD #endif // ESP8266 #ifdef ESP32 -#include +#include #ifdef USE_SDCARD #include #endif // USE_SDCARD @@ -380,6 +380,13 @@ void setup(void) { } else { snprintf_P(TasmotaGlobal.hostname, sizeof(TasmotaGlobal.hostname)-1, SettingsText(SET_HOSTNAME)); } + char *s = TasmotaGlobal.hostname; + while (*s) { + if (!(isalnum(*s) || ('.' == *s))) { *s = '-'; } // Valid hostname chars are A..Z, a..z, 0..9, . and - + if ((s == TasmotaGlobal.hostname) && ('-' == *s)) { *s = 'x'; } // First char cannot be a dash so replace by an x + s++; + } + snprintf_P(TasmotaGlobal.mqtt_topic, sizeof(TasmotaGlobal.mqtt_topic), ResolveToken(TasmotaGlobal.mqtt_topic).c_str()); RtcInit(); GpioInit(); @@ -398,7 +405,7 @@ void setup(void) { SetPowerOnState(); WifiConnect(); - AddLog(LOG_LEVEL_INFO, PSTR(D_PROJECT " %s %s " D_VERSION " %s%s-" ARDUINO_CORE_RELEASE "(%s)"), + AddLog(LOG_LEVEL_INFO, PSTR(D_PROJECT " %s - %s " D_VERSION " %s%s-" ARDUINO_CORE_RELEASE "(%s)"), PSTR(PROJECT), SettingsText(SET_DEVICENAME), TasmotaGlobal.version, TasmotaGlobal.image_name, GetBuildDateAndTime().c_str()); #ifdef FIRMWARE_MINIMAL AddLog(LOG_LEVEL_INFO, PSTR(D_WARNING_MINIMAL_VERSION)); diff --git a/tasmota/tasmota_configurations.h b/tasmota/tasmota_configurations.h index c77b2c03e..6530cdbc3 100644 --- a/tasmota/tasmota_configurations.h +++ b/tasmota/tasmota_configurations.h @@ -269,6 +269,7 @@ #undef USE_EMULATION_WEMO // Disable Belkin WeMo emulation for Alexa (+6k code, +2k mem common) #undef USE_DOMOTICZ // Disable Domoticz #undef USE_HOME_ASSISTANT // Disable Home Assistant +#define USE_TASMOTA_DISCOVERY // Enable Tasmota Discovery support (+2k code) // -- Optional modules ---------------------------- #undef ROTARY_V1 // Disable support for MI Desk Lamp @@ -486,6 +487,7 @@ #undef USE_ARDUINO_OTA // Disable support for Arduino OTA #define USE_DOMOTICZ // Enable Domoticz #undef USE_HOME_ASSISTANT // Disable Home Assistant +#define USE_TASMOTA_DISCOVERY // Enable Tasmota Discovery support (+2k code) #define UPGRADE_V8_MIN // do not support upgrading from version below 8.0.0 @@ -639,6 +641,7 @@ #undef USE_ARDUINO_OTA // Disable support for Arduino OTA #undef USE_DOMOTICZ // Disable Domoticz #undef USE_HOME_ASSISTANT // Disable Home Assistant +#define USE_TASMOTA_DISCOVERY // Enable Tasmota Discovery support (+2k code) #undef USE_MQTT_TLS // Disable TLS support won't work as the MQTTHost is not set #undef USE_KNX // Disable KNX IP Protocol Support //#undef USE_WEBSERVER // Disable Webserver diff --git a/tasmota/tasmota_globals.h b/tasmota/tasmota_globals.h index be3d67f96..52cd5b39f 100644 --- a/tasmota/tasmota_globals.h +++ b/tasmota/tasmota_globals.h @@ -156,6 +156,10 @@ String EthernetMacAddress(void); #endif // ESP32 +/*********************************************************************************************\ + * Fallback parameters +\*********************************************************************************************/ + #ifdef USE_PID #define USE_TIMEPROP #endif @@ -340,6 +344,25 @@ String EthernetMacAddress(void); #define STARTING_OFFSET 30 // NOVA SDS parameter used in settings #endif +#ifndef WIFI_RGX_STATE +#define WIFI_RGX_STATE 0 +#endif +#ifndef WIFI_RGX_NAPT +#define WIFI_RGX_NAPT 0 +#endif +#ifndef WIFI_RGX_SSID +#define WIFI_RGX_SSID "" +#endif +#ifndef WIFI_RGX_PASSWORD +#define WIFI_RGX_PASSWORD "" +#endif +#ifndef WIFI_RGX_IP_ADDRESS +#define WIFI_RGX_IP_ADDRESS "192.168.99.1" +#endif +#ifndef WIFI_RGX_SUBNETMASK +#define WIFI_RGX_SUBNETMASK "255.255.255.0" +#endif + /*********************************************************************************************\ * UserConfig related parameters \*********************************************************************************************/ diff --git a/tasmota/tasmota_template.h b/tasmota/tasmota_template.h index 6e0d6d33f..d30ce1472 100644 --- a/tasmota/tasmota_template.h +++ b/tasmota/tasmota_template.h @@ -177,7 +177,7 @@ enum ProgramSelectablePins { GPIO_USER, // User configurable needs to be 2047 GPIO_MAX }; -#define MAX_OPTIONS_A 4 // Increase if more bits are used from GpioOptionABits +#define MAX_OPTIONS_A 5 // Increase if more bits are used from GpioOptionABits typedef union { // Restricted by MISRA-C Rule 18.4 but so useful... uint32_t data; // Allow bit manipulation using SetOption @@ -186,7 +186,7 @@ typedef union { // Restricted by MISRA-C Rule 18.4 bu uint32_t dummy_energy : 1; // bit 1 (v9.3.1.2) - Option_A2 - (Energy) Enable dummy values uint32_t udisplay_driver : 1; // bit 2 (v9.3.1.2) - Option_A3 - (Display) Universal display driver uint32_t enable_ccloader : 1; // bit 3 (v9.4.0.5) - Option_A4 - (Zigbee) Enable CCLoader using Zigbee Rx/Tx/Rst Gpios - uint32_t spare04 : 1; // bit 4 + uint32_t rotary_mi_desk : 1; // bit 4 (v9.5.0.5) - Option_A5 - (Rotary) Enable Mi Desk emulation uint32_t spare05 : 1; // bit 5 uint32_t spare06 : 1; // bit 6 uint32_t spare07 : 1; // bit 7 diff --git a/tasmota/tasmota_version.h b/tasmota/tasmota_version.h index 0f02b3d91..51dc681e6 100644 --- a/tasmota/tasmota_version.h +++ b/tasmota/tasmota_version.h @@ -20,6 +20,6 @@ #ifndef _TASMOTA_VERSION_H_ #define _TASMOTA_VERSION_H_ -const uint32_t VERSION = 0x09050003; +const uint32_t VERSION = 0x09050006; #endif // _TASMOTA_VERSION_H_ diff --git a/tasmota/user_config_override_sample.h b/tasmota/user_config_override_sample.h index 3bfa1269f..896d050eb 100644 --- a/tasmota/user_config_override_sample.h +++ b/tasmota/user_config_override_sample.h @@ -79,7 +79,12 @@ Examples : #define WIFI_DNS MY_DNS // If not using DHCP set DNS IP address (might be equal to WIFI_GATEWAY) #endif -// !!! Remember that your changes GOES AT THE BOTTOM OF THIS FILE right before the last #endif !!! +#ifdef MY_DNS2 +#undef WIFI_DNS2 +#define WIFI_DNS2 MY_DNS2 // If not using DHCP set DNS IP address (might be equal to WIFI_GATEWAY) +#endif + +// !!! Remember that your changes GOES AT THE BOTTOM OF THIS FILE right before the last #endif !!! */ diff --git a/tasmota/xdrv_01_webserver.ino b/tasmota/xdrv_01_webserver.ino index 2705db6ab..04a403b3f 100644 --- a/tasmota/xdrv_01_webserver.ino +++ b/tasmota/xdrv_01_webserver.ino @@ -292,7 +292,10 @@ const char HTTP_FORM_WIFI_PART2[] PROGMEM = "

" D_AP2_SSID " (" STA_SSID2 ")

" "


" "

" D_HOSTNAME " (%s)

" - "

" D_CORS_DOMAIN "

"; +#ifdef USE_CORS + "

" D_CORS_DOMAIN "

" +#endif + ; const char HTTP_FORM_LOG1[] PROGMEM = "
 " D_LOGGING_PARAMETERS " " @@ -390,7 +393,8 @@ const char kLoggingLevels[] PROGMEM = D_NONE "|" D_ERROR "|" D_INFO "|" D_DEBUG const char kEmulationOptions[] PROGMEM = D_NONE "|" D_BELKIN_WEMO "|" D_HUE_BRIDGE; const char kUploadErrors[] PROGMEM = - D_UPLOAD_ERR_1 "|" D_UPLOAD_ERR_2 "|" D_UPLOAD_ERR_3 "|" D_UPLOAD_ERR_4 "|" D_UPLOAD_ERR_5 "|" D_UPLOAD_ERR_6 "|" D_UPLOAD_ERR_7 "|" D_UPLOAD_ERR_8 "|" D_UPLOAD_ERR_9; +// D_UPLOAD_ERR_1 "|" D_UPLOAD_ERR_2 "|" D_UPLOAD_ERR_3 "|" D_UPLOAD_ERR_4 "|" D_UPLOAD_ERR_5 "|" D_UPLOAD_ERR_6 "|" D_UPLOAD_ERR_7 "|" D_UPLOAD_ERR_8 "|" D_UPLOAD_ERR_9; + D_UPLOAD_ERR_1 "|" D_UPLOAD_ERR_2 "|" D_UPLOAD_ERR_3 "|" D_UPLOAD_ERR_4 "| |" D_UPLOAD_ERR_6 "|" D_UPLOAD_ERR_7 "|" D_UPLOAD_ERR_8 "|" D_UPLOAD_ERR_9; const uint16_t DNS_PORT = 53; enum HttpOptions {HTTP_OFF, HTTP_USER, HTTP_ADMIN, HTTP_MANAGER, HTTP_MANAGER_RESET_ONLY}; @@ -538,6 +542,11 @@ void StartWebserver(int type, IPAddress ipweb) if (!Web.state) { if (!Webserver) { Webserver = new ESP8266WebServer((HTTP_MANAGER == type || HTTP_MANAGER_RESET_ONLY == type) ? 80 : WEB_PORT); + + const char* headerkeys[] = { "Referer" }; + size_t headerkeyssize = sizeof(headerkeys) / sizeof(char*); + Webserver->collectHeaders(headerkeys, headerkeyssize); + // call `Webserver->on()` on each entry for (uint32_t i=0; irequestAuthentication(); return false; } - return true; + + if (!Settings->flag5.disable_referer_chk && !WifiIsInManagerMode()) { + String referer = Webserver->header(F("Referer")); // http://demo/? or http://192.168.2.153/? + if (referer.length()) { + referer.toUpperCase(); + String hostname = NetworkHostname(); + hostname.toUpperCase(); + if ((referer.indexOf(hostname) == 7) || (referer.indexOf(NetworkAddress().toString()) == 7)) { + return true; + } + } + AddLog(LOG_LEVEL_DEBUG, PSTR(D_LOG_HTTP "Referer denied")); + return false; + } else { + return true; + } } +#ifdef USE_CORS void HttpHeaderCors(void) { if (strlen(SettingsText(SET_CORS))) { Webserver->sendHeader(F("Access-Control-Allow-Origin"), SettingsText(SET_CORS)); } } +#endif void WSHeaderSend(void) { @@ -664,7 +690,9 @@ void WSHeaderSend(void) Webserver->sendHeader(F("Cache-Control"), F("no-cache, no-store, must-revalidate")); Webserver->sendHeader(F("Pragma"), F("no-cache")); Webserver->sendHeader(F("Expires"), F("-1")); +#ifdef USE_CORS HttpHeaderCors(); +#endif } /********************************************************************************************** @@ -1830,8 +1858,8 @@ void HandleWifiConfiguration(void) { if ( WIFI_TEST_FINISHED == Web.wifiTest ) { Web.wifiTest = WIFI_NOT_TESTING; - if (Web.wifi_test_AP_TIMEOUT) { - WebRestart(1); // Save credentials and Force Restart in STA only mode (11n-only routers) + if (Web.wifi_test_AP_TIMEOUT) { + WebRestart(1); // Save credentials and Force Restart in STA only mode (11n-only routers) } else { #if (RESTART_AFTER_INITIAL_WIFI_CONFIG) WebRestart(3); @@ -1992,7 +2020,11 @@ void HandleWifiConfiguration(void) { // As WIFI_HOSTNAME may contain %s-%04d it cannot be part of HTTP_FORM_WIFI where it will exception WSContentSend_P(PSTR(">

")); } else { +#ifdef USE_CORS WSContentSend_P(HTTP_FORM_WIFI_PART2, SettingsText(SET_STASSID2), WIFI_HOSTNAME, WIFI_HOSTNAME, SettingsText(SET_HOSTNAME), SettingsText(SET_CORS)); +#else + WSContentSend_P(HTTP_FORM_WIFI_PART2, SettingsText(SET_STASSID2), WIFI_HOSTNAME, WIFI_HOSTNAME, SettingsText(SET_HOSTNAME)); +#endif } WSContentSend_P(HTTP_FORM_END); @@ -2025,7 +2057,9 @@ void HandleWifiConfiguration(void) { void WifiSaveSettings(void) { String cmnd = F(D_CMND_BACKLOG "0 "); cmnd += AddWebCommand(PSTR(D_CMND_HOSTNAME), PSTR("h"), PSTR("1")); +#ifdef USE_CORS cmnd += AddWebCommand(PSTR(D_CMND_CORS), PSTR("c"), PSTR("1")); +#endif cmnd += AddWebCommand(PSTR(D_CMND_SSID "1"), PSTR("s1"), PSTR("1")); cmnd += AddWebCommand(PSTR(D_CMND_SSID "2"), PSTR("s2"), PSTR("1")); cmnd += AddWebCommand(PSTR(D_CMND_PASSWORD "3"), PSTR("p1"), PSTR("\"")); @@ -2101,11 +2135,7 @@ void HandleOtherConfiguration(void) { WSContentSendStyle(); TemplateJson(); -#ifdef MQTT_DATA_STRING - WSContentSend_P(HTTP_FORM_OTHER, TasmotaGlobal.mqtt_data.c_str(), (USER_MODULE == Settings->module) ? PSTR(" checked disabled") : "", -#else - WSContentSend_P(HTTP_FORM_OTHER, TasmotaGlobal.mqtt_data, (USER_MODULE == Settings->module) ? PSTR(" checked disabled") : "", -#endif + WSContentSend_P(HTTP_FORM_OTHER, ResponseData(), (USER_MODULE == Settings->module) ? PSTR(" checked disabled") : "", (Settings->flag.mqtt_enabled) ? PSTR(" checked") : "", // SetOption3 - Enable MQTT SettingsText(SET_FRIENDLYNAME1), SettingsText(SET_DEVICENAME)); @@ -2309,7 +2339,8 @@ void HandleInformation(void) if (!TasmotaGlobal.global_state.network_down) { WSContentSend_P(PSTR("}1" D_GATEWAY "}2%_I"), Settings->ipv4_address[1]); WSContentSend_P(PSTR("}1" D_SUBNET_MASK "}2%_I"), Settings->ipv4_address[2]); - WSContentSend_P(PSTR("}1" D_DNS_SERVER "}2%_I"), Settings->ipv4_address[3]); + WSContentSend_P(PSTR("}1" D_DNS_SERVER "1}2%_I"), Settings->ipv4_address[3]); + WSContentSend_P(PSTR("}1" D_DNS_SERVER "2}2%_I"), Settings->ipv4_address[4]); } if ((WiFi.getMode() >= WIFI_AP) && (static_cast(WiFi.softAPIP()) != 0)) { WSContentSend_P(PSTR("}1
}2
")); @@ -2722,7 +2753,8 @@ void HandleUploadLoop(void) { } #endif // USE_WEB_FW_UPGRADE else if (Update.write(upload.buf, upload.currentSize) != upload.currentSize) { - Web.upload_error = 5; // Upload buffer miscompare +// Web.upload_error = 5; // Upload buffer miscompare + Web.upload_error = 2; // Not enough space return; } if (upload.totalSize && !(upload.totalSize % 102400)) { @@ -2813,7 +2845,9 @@ void HandleUploadLoop(void) { void HandlePreflightRequest(void) { +#ifdef USE_CORS HttpHeaderCors(); +#endif Webserver->sendHeader(F("Access-Control-Allow-Methods"), F("GET, POST")); Webserver->sendHeader(F("Access-Control-Allow-Headers"), F("authorization")); WSSend(200, CT_HTML, ""); @@ -3102,7 +3136,11 @@ const char kWebCommands[] PROGMEM = "|" // No prefix D_CMND_SENDMAIL "|" #endif D_CMND_WEBSERVER "|" D_CMND_WEBPASSWORD "|" D_CMND_WEBLOG "|" D_CMND_WEBREFRESH "|" D_CMND_WEBSEND "|" D_CMND_WEBCOLOR "|" - D_CMND_WEBSENSOR "|" D_CMND_WEBBUTTON "|" D_CMND_CORS; + D_CMND_WEBSENSOR "|" D_CMND_WEBBUTTON +#ifdef USE_CORS + "|" D_CMND_CORS +#endif + ; void (* const WebCommand[])(void) PROGMEM = { #ifdef USE_EMULATION @@ -3112,7 +3150,11 @@ void (* const WebCommand[])(void) PROGMEM = { &CmndSendmail, #endif &CmndWebServer, &CmndWebPassword, &CmndWeblog, &CmndWebRefresh, &CmndWebSend, &CmndWebColor, - &CmndWebSensor, &CmndWebButton, &CmndCors }; + &CmndWebSensor, &CmndWebButton +#ifdef USE_CORS + , &CmndCors +#endif + }; /*********************************************************************************************\ * Commands @@ -3257,6 +3299,7 @@ void CmndWebButton(void) } } +#ifdef USE_CORS void CmndCors(void) { if (XdrvMailbox.data_len > 0) { @@ -3264,6 +3307,7 @@ void CmndCors(void) } ResponseCmndChar(SettingsText(SET_CORS)); } +#endif /*********************************************************************************************\ * Interface @@ -3329,7 +3373,7 @@ bool Xdrv01(uint8_t function) // // If it fails again, depending on the WIFICONFIG settings, the user will need to wait or will need to // push 6 times the button to enable Tasmota AP mode again. - if (Web.wifi_test_AP_TIMEOUT) { + if (Web.wifi_test_AP_TIMEOUT) { Web.wifiTest = WIFI_TEST_FINISHED; AddLog(LOG_LEVEL_INFO, PSTR(D_LOG_WIFI D_CMND_SSID "1 %s: " D_ATTEMPTING_CONNECTION), SettingsText(SET_STASSID1) ); if (MAX_WIFI_OPTION != Web.old_wificonfig) { diff --git a/tasmota/xdrv_02_9_mqtt.ino b/tasmota/xdrv_02_9_mqtt.ino index bbc37b29e..78f7c88c1 100644 --- a/tasmota/xdrv_02_9_mqtt.ino +++ b/tasmota/xdrv_02_9_mqtt.ino @@ -670,16 +670,12 @@ void MqttPublishPayload(const char* topic, const char* payload) { } void MqttPublish(const char* topic, bool retained) { - // Publish default TasmotaGlobal.mqtt_data string with optional retained -#ifdef MQTT_DATA_STRING - MqttPublishPayload(topic, TasmotaGlobal.mqtt_data.c_str(), 0, retained); -#else - MqttPublishPayload(topic, TasmotaGlobal.mqtt_data, 0, retained); -#endif + // Publish default ResponseData string with optional retained + MqttPublishPayload(topic, ResponseData(), 0, retained); } void MqttPublish(const char* topic) { - // Publish default TasmotaGlobal.mqtt_data string no retained + // Publish default ResponseData string no retained MqttPublish(topic, false); } @@ -750,40 +746,36 @@ void MqttPublishPayloadPrefixTopicRulesProcess_P(uint32_t prefix, const char* su } void MqttPublishPayloadPrefixTopicRulesProcess_P(uint32_t prefix, const char* subtopic, const char* payload) { - // Publish //> default TasmotaGlobal.mqtt_data string no retained + // Publish //> default ResponseData string no retained // then process rules MqttPublishPayloadPrefixTopicRulesProcess_P(prefix, subtopic, payload, false); } void MqttPublishPrefixTopic_P(uint32_t prefix, const char* subtopic, bool retained) { - // Publish //> default TasmotaGlobal.mqtt_data string with optional retained -#ifdef MQTT_DATA_STRING - MqttPublishPayloadPrefixTopic_P(prefix, subtopic, TasmotaGlobal.mqtt_data.c_str(), 0, retained); -#else - MqttPublishPayloadPrefixTopic_P(prefix, subtopic, TasmotaGlobal.mqtt_data, 0, retained); -#endif + // Publish //> default ResponseData string with optional retained + MqttPublishPayloadPrefixTopic_P(prefix, subtopic, ResponseData(), 0, retained); } void MqttPublishPrefixTopic_P(uint32_t prefix, const char* subtopic) { - // Publish //> default TasmotaGlobal.mqtt_data string no retained + // Publish //> default ResponseData string no retained MqttPublishPrefixTopic_P(prefix, subtopic, false); } void MqttPublishPrefixTopicRulesProcess_P(uint32_t prefix, const char* subtopic, bool retained) { - // Publish //> default TasmotaGlobal.mqtt_data string with optional retained + // Publish //> default ResponseData string with optional retained // then process rules MqttPublishPrefixTopic_P(prefix, subtopic, retained); XdrvRulesProcess(0); } void MqttPublishPrefixTopicRulesProcess_P(uint32_t prefix, const char* subtopic) { - // Publish //> default TasmotaGlobal.mqtt_data string no retained + // Publish //> default ResponseData string no retained // then process rules MqttPublishPrefixTopicRulesProcess_P(prefix, subtopic, false); } void MqttPublishTeleSensor(void) { - // Publish tele//SENSOR default TasmotaGlobal.mqtt_data string with optional retained + // Publish tele//SENSOR default ResponseData string with optional retained // then process rules MqttPublishPrefixTopicRulesProcess_P(TELE, PSTR(D_RSLT_SENSOR), Settings->flag.mqtt_sensor_retain); // CMND_SENSORRETAIN } @@ -817,6 +809,11 @@ void MqttPublishPowerState(uint32_t device) { Response_P(GetStateText(bitRead(TasmotaGlobal.power, device -1))); MqttPublish(stopic, Settings->flag.mqtt_power_retain); // CMND_POWERRETAIN } + +#ifdef USE_INFLUXDB + InfluxDbPublishPowerState(device); +#endif + #ifdef USE_SONOFF_IFAN } #endif // USE_SONOFF_IFAN @@ -858,6 +855,8 @@ void MqttDisconnected(int state) { } MqttClient.disconnect(); + // Check if this solves intermittent MQTT re-connection failures when broker is restarted + EspClient.stop(); AddLog(LOG_LEVEL_INFO, PSTR(D_LOG_MQTT D_CONNECT_FAILED_TO " %s:%d, rc %d. " D_RETRY_IN " %d " D_UNIT_SECOND), SettingsText(SET_MQTT_HOST), Settings->mqtt_port, state, Mqtt.retry_counter); TasmotaGlobal.rules_flag.mqtt_disconnected = 1; @@ -1072,17 +1071,9 @@ void MqttReconnect(void) { } String azureMqtt_userString = String(SettingsText(SET_MQTT_HOST)) + "/" + String(SettingsText(SET_MQTT_CLIENT)); + "/?api-version=2018-06-30"; -#ifdef MQTT_DATA_STRING - if (MqttClient.connect(TasmotaGlobal.mqtt_client, azureMqtt_userString.c_str(), azureMqtt_password.c_str(), stopic, 1, lwt_retain, TasmotaGlobal.mqtt_data.c_str(), MQTT_CLEAN_SESSION)) { + if (MqttClient.connect(TasmotaGlobal.mqtt_client, azureMqtt_userString.c_str(), azureMqtt_password.c_str(), stopic, 1, lwt_retain, ResponseData(), MQTT_CLEAN_SESSION)) { #else - if (MqttClient.connect(TasmotaGlobal.mqtt_client, azureMqtt_userString.c_str(), azureMqtt_password.c_str(), stopic, 1, lwt_retain, TasmotaGlobal.mqtt_data, MQTT_CLEAN_SESSION)) { -#endif -#else -#ifdef MQTT_DATA_STRING - if (MqttClient.connect(TasmotaGlobal.mqtt_client, mqtt_user, mqtt_pwd, stopic, 1, lwt_retain, TasmotaGlobal.mqtt_data.c_str(), MQTT_CLEAN_SESSION)) { -#else - if (MqttClient.connect(TasmotaGlobal.mqtt_client, mqtt_user, mqtt_pwd, stopic, 1, lwt_retain, TasmotaGlobal.mqtt_data, MQTT_CLEAN_SESSION)) { -#endif + if (MqttClient.connect(TasmotaGlobal.mqtt_client, mqtt_user, mqtt_pwd, stopic, 1, lwt_retain, ResponseData(), MQTT_CLEAN_SESSION)) { #endif // USE_MQTT_AZURE_IOT #ifdef USE_MQTT_TLS if (Mqtt.mqtt_tls) { diff --git a/tasmota/xdrv_04_light.ino b/tasmota/xdrv_04_light.ino index d453efbaf..ff344df17 100644 --- a/tasmota/xdrv_04_light.ino +++ b/tasmota/xdrv_04_light.ino @@ -2000,7 +2000,14 @@ void LightApplyPower(uint8_t new_color[LST_MAX], power_t power) { void LightSetOutputs(const uint16_t *cur_col_10) { // now apply the actual PWM values, adjusted and remapped 10-bits range if (TasmotaGlobal.light_type < LT_PWM6) { // only for direct PWM lights, not for Tuya, Armtronix... +#ifdef USE_PWM_DIMMER + uint16_t max_col = 0; +#endif // USE_PWM_DIMMER for (uint32_t i = 0; i < (Light.subtype - Light.pwm_offset); i++) { + uint16_t cur_col = cur_col_10[i + Light.pwm_offset]; +#ifdef USE_PWM_DIMMER + if (cur_col > max_col) max_col = cur_col; +#endif // USE_PWM_DIMMER if (PinUsed(GPIO_PWM1, i)) { //AddLog(LOG_LEVEL_DEBUG, PSTR(D_LOG_APPLICATION "Cur_Col%d 10 bits %d"), i, cur_col_10[i]); uint16_t cur_col = cur_col_10[i + Light.pwm_offset]; @@ -2010,12 +2017,12 @@ void LightSetOutputs(const uint16_t *cur_col_10) { if (!Settings->flag4.zerocross_dimmer) { analogWrite(Pin(GPIO_PWM1, i), bitRead(TasmotaGlobal.pwm_inverted, i) ? Settings->pwm_range - cur_col : cur_col); } -#ifdef USE_PWM_DIMMER - // Animate brightness LEDs to follow PWM dimmer brightness - if (PWM_DIMMER == TasmotaGlobal.module_type) PWMDimmerSetBrightnessLeds(change10to8(cur_col)); -#endif // USE_PWM_DIMMER } } +#ifdef USE_PWM_DIMMER + // Animate brightness LEDs to follow PWM dimmer brightness + if (PWM_DIMMER == TasmotaGlobal.module_type) PWMDimmerSetBrightnessLeds(change10to8(max_col)); +#endif // USE_PWM_DIMMER } // char msg[24]; // AddLog(LOG_LEVEL_DEBUG, PSTR("LGT: Channels %s"), ToHex_P((const unsigned char *)cur_col_10, 10, msg, sizeof(msg))); diff --git a/tasmota/xdrv_07_domoticz.ino b/tasmota/xdrv_07_domoticz.ino index 1f1dea37b..0342e6d89 100644 --- a/tasmota/xdrv_07_domoticz.ino +++ b/tasmota/xdrv_07_domoticz.ino @@ -526,6 +526,7 @@ void CmndDomoticzSend(void) { else if (3 == XdrvMailbox.index) { type = DZ_AIRQUALITY; } DomoticzSendData(type, index, data); } + ResponseCmndDone(); } } } diff --git a/tasmota/xdrv_10_rules.ino b/tasmota/xdrv_10_rules.ino index ffcc9fcf6..d2f323760 100644 --- a/tasmota/xdrv_10_rules.ino +++ b/tasmota/xdrv_10_rules.ino @@ -987,11 +987,7 @@ void RulesEvery100ms(void) { if (ResponseLength()) { ResponseJsonStart(); // {"INA219":{"Voltage":4.494,"Current":0.020,"Power":0.089} ResponseJsonEnd(); -#ifdef MQTT_DATA_STRING - RulesProcessEvent(TasmotaGlobal.mqtt_data.c_str()); -#else - RulesProcessEvent(TasmotaGlobal.mqtt_data); -#endif + RulesProcessEvent(ResponseData()); } } } diff --git a/tasmota/xdrv_10_scripter.ino b/tasmota/xdrv_10_scripter.ino index 4485ea6f7..f1083c823 100755 --- a/tasmota/xdrv_10_scripter.ino +++ b/tasmota/xdrv_10_scripter.ino @@ -2224,12 +2224,7 @@ chknext: if (!strncmp(vname, "fmt(", 4)) { lp = GetNumericArgument(lp + 4, OPER_EQU, &fvar, gv); if (!fvar) { -#ifdef ESP8266 LittleFS.format(); -#endif -#ifdef ESP32 - LITTLEFS.format(); -#endif } else { //SD.format(); } @@ -2408,11 +2403,7 @@ chknext: char rstring[SCRIPT_MAXSSIZE]; rstring[0] = 0; int8_t index = fvar; -#ifdef MQTT_DATA_STRING - char *wd = (char*)TasmotaGlobal.mqtt_data.c_str(); -#else - char *wd = TasmotaGlobal.mqtt_data; -#endif + char *wd = ResponseData(); strlcpy(rstring, wd, glob_script_mem.max_ssize); if (index) { if (strlen(wd) && index) { @@ -2437,11 +2428,7 @@ chknext: // preserve mqtt_data char *mqd = (char*)malloc(ResponseSize()+2); if (mqd) { -#ifdef MQTT_DATA_STRING - strlcpy(mqd, TasmotaGlobal.mqtt_data.c_str(), ResponseSize()); -#else - strlcpy(mqd, TasmotaGlobal.mqtt_data, ResponseSize()); -#endif + strlcpy(mqd, ResponseData(), ResponseSize()); wd = mqd; char *lwd = wd; while (index) { @@ -5012,11 +4999,7 @@ void ScripterEvery100ms(void) { if (ResponseLength()) { ResponseJsonStart(); ResponseJsonEnd(); -#ifdef MQTT_DATA_STRING - Run_Scripter(">T", 2, TasmotaGlobal.mqtt_data.c_str()); -#else - Run_Scripter(">T", 2, TasmotaGlobal.mqtt_data); -#endif + Run_Scripter(">T", 2, ResponseData()); } } if (bitRead(Settings->rule_enabled, 0)) { @@ -7710,6 +7693,7 @@ uint32_t scripter_create_task(uint32_t num, uint32_t time, uint32_t core, uint32 int32_t http_req(char *host, char *request) { + WiFiClient http_client; HTTPClient http; int32_t httpCode = 0; uint8_t mode = 0; @@ -7726,12 +7710,12 @@ int32_t http_req(char *host, char *request) { // GET strcat(hbuff, request); //AddLog(LOG_LEVEL_INFO, PSTR("HTTP GET %s"),hbuff); - http.begin(hbuff); + http.begin(http_client, hbuff); httpCode = http.GET(); } else { // POST //AddLog(LOG_LEVEL_INFO, PSTR("HTTP POST %s - %s"),hbuff, request); - http.begin(hbuff); + http.begin(http_client, hbuff); http.addHeader("Content-Type", "text/plain"); httpCode = http.POST(request); } @@ -7739,17 +7723,17 @@ int32_t http_req(char *host, char *request) { #ifdef USE_WEBSEND_RESPONSE #ifdef MQTT_DATA_STRING TasmotaGlobal.mqtt_data = http.getString(); - //AddLog(LOG_LEVEL_INFO, PSTR("HTTP RESULT %s"), TasmotaGlobal.mqtt_data.c_str()); - Run_Scripter(">E", 2, TasmotaGlobal.mqtt_data.c_str()); #else strlcpy(TasmotaGlobal.mqtt_data, http.getString().c_str(), ResponseSize()); - //AddLog(LOG_LEVEL_INFO, PSTR("HTTP RESULT %s"), TasmotaGlobal.mqtt_data); - Run_Scripter(">E", 2, TasmotaGlobal.mqtt_data); #endif + //AddLog(LOG_LEVEL_INFO, PSTR("HTTP RESULT %s"), ResponseData()); + Run_Scripter(">E", 2, ResponseData()); + glob_script_mem.glob_error = 0; #endif http.end(); + http_client.stop(); return httpCode; } @@ -8445,41 +8429,24 @@ bool Xdrv10(uint8_t function) break; case FUNC_RULES_PROCESS: if (bitRead(Settings->rule_enabled, 0)) { -#ifdef MQTT_DATA_STRING #ifdef USE_SCRIPT_STATUS - if (!strncmp_P(TasmotaGlobal.mqtt_data.c_str(), PSTR("{\"Status"), 8)) { - Run_Scripter(">U", 2, TasmotaGlobal.mqtt_data.c_str()); + if (!strncmp_P(ResponseData(), PSTR("{\"Status"), 8)) { + Run_Scripter(">U", 2, ResponseData()); } else { - Run_Scripter(">E", 2, TasmotaGlobal.mqtt_data.c_str()); + Run_Scripter(">E", 2, ResponseData()); } #else - Run_Scripter(">E", 2, TasmotaGlobal.mqtt_data.c_str()); + Run_Scripter(">E", 2, ResponseData()); #endif -#else // MQTT_DATA_STRING -#ifdef USE_SCRIPT_STATUS - if (!strncmp_P(TasmotaGlobal.mqtt_data, PSTR("{\"Status"), 8)) { - Run_Scripter(">U", 2, TasmotaGlobal.mqtt_data); - } else { - Run_Scripter(">E", 2, TasmotaGlobal.mqtt_data); - } -#else - Run_Scripter(">E", 2, TasmotaGlobal.mqtt_data); -#endif -#endif // MQTT_DATA_STRING + result = glob_script_mem.event_handeled; } break; case FUNC_TELEPERIOD_RULES_PROCESS: if (bitRead(Settings->rule_enabled, 0)) { -#ifdef MQTT_DATA_STRING - if (TasmotaGlobal.mqtt_data.length()) { - Run_Scripter(">T", 2, TasmotaGlobal.mqtt_data.c_str()); + if (ResponseLength()) { + Run_Scripter(">T", 2, ResponseData()); } -#else - if (TasmotaGlobal.mqtt_data[0]) { - Run_Scripter(">T", 2, TasmotaGlobal.mqtt_data); - } -#endif } break; #ifdef USE_WEBSERVER diff --git a/tasmota/xdrv_12_discovery.ino b/tasmota/xdrv_12_discovery.ino index f4ad21752..f6ab5a425 100644 --- a/tasmota/xdrv_12_discovery.ino +++ b/tasmota/xdrv_12_discovery.ino @@ -79,18 +79,24 @@ void TasDiscoverMessage(void) { PSTR(PUB_PREFIX), PSTR(PUB_PREFIX2)); - uint8_t lightidx = MAX_RELAYS + 1; // Will store the starting position of the lights - if (Light.subtype > LST_NONE) { - if (!light_controller.isCTRGBLinked()) { // One or two lights present - lightidx = TasmotaGlobal.devices_present - 2; + uint8_t light_idx = MAX_RELAYS + 1; // Will store the starting position of the lights + uint8_t light_subtype = 0; + bool light_controller_isCTRGBLinked = false; +#ifdef USE_LIGHT + light_subtype = Light.subtype; + if (light_subtype > LST_NONE) { + light_controller_isCTRGBLinked = light_controller.isCTRGBLinked(); + if (!light_controller_isCTRGBLinked) { // One or two lights present + light_idx = TasmotaGlobal.devices_present - 2; } else { - lightidx = TasmotaGlobal.devices_present - 1; + light_idx = TasmotaGlobal.devices_present - 1; } } if ((Light.device > 0) && Settings->flag3.pwm_multi_channels) { // How many relays are light devices? - lightidx = TasmotaGlobal.devices_present - Light.subtype; + light_idx = TasmotaGlobal.devices_present - light_subtype; } +#endif // USE_LIGHT uint16_t Relay[MAX_RELAYS] = { 0 }; // Base array to store the relay type uint16_t Shutter[MAX_RELAYS] = { 0 }; // Array to store a temp list for shutters @@ -114,7 +120,7 @@ void TasDiscoverMessage(void) { if (Shutter[i] != 0) { // Check if there are shutters present Relay[i] = 3; // Relay is a shutter } else { - if (i >= lightidx || (iFanMod && (0 == i))) { // First relay on Ifan controls the light + if (i >= light_idx || (iFanMod && (0 == i))) { // First relay on Ifan controls the light Relay[i] = 2; // Relay is a light } else { if (!iFanMod) { // Relays 2-4 for ifan are controlled by FANSPEED and don't need to be present if TasmotaGlobal.module_type = SONOFF_IFAN02 or SONOFF_IFAN03 @@ -182,8 +188,8 @@ void TasDiscoverMessage(void) { Settings->flag4.alexa_ct_range, Settings->flag5.mqtt_switches, Settings->flag5.fade_fixed_duration, - light_controller.isCTRGBLinked(), - Light.subtype); + light_controller_isCTRGBLinked, + light_subtype); for (uint32_t i = 0; i < MAX_SHUTTERS; i++) { #ifdef USE_SHUTTER diff --git a/tasmota/xdrv_12_home_assistant.ino b/tasmota/xdrv_12_home_assistant.ino index de806ca0b..ed5aeb89a 100644 --- a/tasmota/xdrv_12_home_assistant.ino +++ b/tasmota/xdrv_12_home_assistant.ino @@ -896,11 +896,7 @@ void HAssAnnounceSensors(void) TasmotaGlobal.tele_period = tele_period_save; size_t sensordata_len = ResponseLength(); char sensordata[sensordata_len+2]; // dynamically adjust the size -#ifdef MQTT_DATA_STRING - strcpy(sensordata, TasmotaGlobal.mqtt_data.c_str()); // we can use strcpy since the buffer has the right size -#else - strcpy(sensordata, TasmotaGlobal.mqtt_data); // we can use strcpy since the buffer has the right size -#endif + strcpy(sensordata, ResponseData()); // we can use strcpy since the buffer has the right size // ******************* JSON TEST ******************* // char sensordata[512]; diff --git a/tasmota/xdrv_13_display.ino b/tasmota/xdrv_13_display.ino index 7334d1ece..24f9cf567 100755 --- a/tasmota/xdrv_13_display.ino +++ b/tasmota/xdrv_13_display.ino @@ -1301,11 +1301,7 @@ void DisplayDTVarsTeleperiod(void) { if (jlen < DTV_JSON_SIZE) { char *json = (char*)malloc(jlen + 2); if (json) { -#ifdef MQTT_DATA_STRING - strlcpy(json, (char*)TasmotaGlobal.mqtt_data.c_str(), jlen + 1); -#else - strlcpy(json, TasmotaGlobal.mqtt_data, jlen + 1); -#endif + strlcpy(json, ResponseData(), jlen + 1); get_dt_vars(json); free(json); } @@ -1324,11 +1320,7 @@ void get_dt_mqtt(void) { ResponseJsonStart(); ResponseJsonEnd(); } -#ifdef MQTT_DATA_STRING - get_dt_vars((char*)TasmotaGlobal.mqtt_data.c_str()); -#else - get_dt_vars(TasmotaGlobal.mqtt_data); -#endif + get_dt_vars(ResponseData()); } void get_dt_vars(char *json) { @@ -1743,13 +1735,8 @@ void DisplayLocalSensor(void) { if ((Settings->display_mode &0x02) && (0 == TasmotaGlobal.tele_period)) { char no_topic[1] = { 0 }; -#ifdef MQTT_DATA_STRING -// DisplayAnalyzeJson(TasmotaGlobal.mqtt_topic, TasmotaGlobal.mqtt_data.c_str()); // Add local topic - DisplayAnalyzeJson(no_topic, TasmotaGlobal.mqtt_data.c_str()); // Discard any topic -#else -// DisplayAnalyzeJson(TasmotaGlobal.mqtt_topic, TasmotaGlobal.mqtt_data); // Add local topic - DisplayAnalyzeJson(no_topic, TasmotaGlobal.mqtt_data); // Discard any topic -#endif +// DisplayAnalyzeJson(TasmotaGlobal.mqtt_topic, ResponseData()); // Add local topic + DisplayAnalyzeJson(no_topic, ResponseData()); // Discard any topic } } diff --git a/tasmota/xdrv_16_tuyamcu.ino b/tasmota/xdrv_16_tuyamcu.ino index 1f1a5043f..53dcc770e 100644 --- a/tasmota/xdrv_16_tuyamcu.ino +++ b/tasmota/xdrv_16_tuyamcu.ino @@ -1227,11 +1227,7 @@ void TuyaSerialInput(void) if (Settings->flag3.tuya_serial_mqtt_publish) { // SetOption66 - Enable TuyaMcuReceived messages over Mqtt MqttPublishPrefixTopic_P(RESULT_OR_TELE, PSTR(D_JSON_TUYA_MCU_RECEIVED)); } else { -#ifdef MQTT_DATA_STRING - AddLog(LOG_LEVEL_DEBUG, TasmotaGlobal.mqtt_data.c_str()); -#else - AddLog(LOG_LEVEL_DEBUG, TasmotaGlobal.mqtt_data); -#endif + AddLog(LOG_LEVEL_DEBUG, ResponseData()); } XdrvRulesProcess(0); diff --git a/tasmota/xdrv_23_zigbee_5_converters.ino b/tasmota/xdrv_23_zigbee_5_converters.ino index cde68b16d..567e7dc0b 100644 --- a/tasmota/xdrv_23_zigbee_5_converters.ino +++ b/tasmota/xdrv_23_zigbee_5_converters.ino @@ -751,11 +751,7 @@ public: if (Settings->flag3.tuya_serial_mqtt_publish) { MqttPublishPrefixTopicRulesProcess_P(TELE, PSTR(D_RSLT_SENSOR)); } else { -#ifdef MQTT_DATA_STRING - AddLog(LOG_LEVEL_DEBUG, PSTR(D_LOG_ZIGBEE "%s"), TasmotaGlobal.mqtt_data.c_str()); -#else - AddLog(LOG_LEVEL_DEBUG, PSTR(D_LOG_ZIGBEE "%s"), TasmotaGlobal.mqtt_data); -#endif + AddLog(LOG_LEVEL_DEBUG, PSTR(D_LOG_ZIGBEE "%s"), ResponseData()); } } diff --git a/tasmota/xdrv_23_zigbee_8_parsers.ino b/tasmota/xdrv_23_zigbee_8_parsers.ino index c0a313aef..72b994a57 100644 --- a/tasmota/xdrv_23_zigbee_8_parsers.ino +++ b/tasmota/xdrv_23_zigbee_8_parsers.ino @@ -1577,11 +1577,7 @@ void Z_AutoConfigReportingForCluster(uint16_t shortaddr, uint16_t groupaddr, uin ResponseAppend_P(PSTR("}}")); if (buf.len() > 0) { -#ifdef MQTT_DATA_STRING - AddLog(LOG_LEVEL_INFO, PSTR(D_LOG_ZIGBEE "auto-bind `%s`"), TasmotaGlobal.mqtt_data.c_str()); -#else - AddLog(LOG_LEVEL_INFO, PSTR(D_LOG_ZIGBEE "auto-bind `%s`"), TasmotaGlobal.mqtt_data); -#endif + AddLog(LOG_LEVEL_INFO, PSTR(D_LOG_ZIGBEE "auto-bind `%s`"), ResponseData()); ZCLMessage zcl(buf.len()); // message is 4 bytes zcl.shortaddr = shortaddr; zcl.cluster = cluster; diff --git a/tasmota/xdrv_23_zigbee_9_serial.ino b/tasmota/xdrv_23_zigbee_9_serial.ino index fe606ccae..649f377a4 100644 --- a/tasmota/xdrv_23_zigbee_9_serial.ino +++ b/tasmota/xdrv_23_zigbee_9_serial.ino @@ -152,11 +152,7 @@ void ZigbeeInputLoop(void) { if (Settings->flag3.tuya_serial_mqtt_publish) { MqttPublishPrefixTopicRulesProcess_P(TELE, PSTR(D_RSLT_SENSOR)); } else { -#ifdef MQTT_DATA_STRING - AddLog(LOG_LEVEL_DEBUG, PSTR(D_LOG_ZIGBEE "%s"), TasmotaGlobal.mqtt_data.c_str()); -#else - AddLog(LOG_LEVEL_DEBUG, PSTR(D_LOG_ZIGBEE "%s"), TasmotaGlobal.mqtt_data); -#endif + AddLog(LOG_LEVEL_DEBUG, PSTR(D_LOG_ZIGBEE "%s"), ResponseData()); } // now process the message ZigbeeProcessInput(znp_buffer); @@ -601,11 +597,7 @@ void ZigbeeProcessInputEZSP(SBuffer &buf) { log_level = LOG_LEVEL_DEBUG; break; } -#ifdef MQTT_DATA_STRING - AddLog(log_level, PSTR(D_LOG_ZIGBEE "%s"), TasmotaGlobal.mqtt_data.c_str()); // TODO move to LOG_LEVEL_DEBUG when stable -#else - AddLog(log_level, PSTR(D_LOG_ZIGBEE "%s"), TasmotaGlobal.mqtt_data); // TODO move to LOG_LEVEL_DEBUG when stable -#endif + AddLog(log_level, PSTR(D_LOG_ZIGBEE "%s"), ResponseData()); // TODO move to LOG_LEVEL_DEBUG when stable } // Pass message to state machine diff --git a/tasmota/xdrv_24_buzzer.ino b/tasmota/xdrv_24_buzzer.ino index 3921589f3..377c2fee6 100644 --- a/tasmota/xdrv_24_buzzer.ino +++ b/tasmota/xdrv_24_buzzer.ino @@ -50,6 +50,9 @@ void BuzzerSet(uint32_t state) { if (Settings->flag4.buzzer_freq_mode) { // SetOption111 - Enable frequency output mode for buzzer static uint8_t last_state = 0; if (last_state != state) { +#ifdef ESP32 + analogAttach(Pin(GPIO_BUZZER), 7); +#endif // ESP32 // Set 50% duty cycle for frequency output // Set 0% (or 100% for inverted PWM) duty cycle which turns off frequency output either way analogWrite(Pin(GPIO_BUZZER), (state) ? Settings->pwm_range / 2 : 0); // set duty cycle for frequency output diff --git a/tasmota/xdrv_39_thermostat.ino b/tasmota/xdrv_39_thermostat.ino index 2078fd829..e45ef93f9 100644 --- a/tasmota/xdrv_39_thermostat.ino +++ b/tasmota/xdrv_39_thermostat.ino @@ -1328,7 +1328,7 @@ void ThermostatDebug(uint8_t ctr_output) #endif // DEBUG_THERMOSTAT void ThermostatGetLocalSensor(uint8_t ctr_output) { - String buf = TasmotaGlobal.mqtt_data; // copy the string into a new buffer that will be modified + String buf = ResponseData(); // copy the string into a new buffer that will be modified JsonParser parser((char*)buf.c_str()); JsonParserObject root = parser.getRootObject(); if (root) { diff --git a/tasmota/xdrv_41_tcp_bridge.ino b/tasmota/xdrv_41_tcp_bridge.ino index d250101d8..3d4d3bec5 100644 --- a/tasmota/xdrv_41_tcp_bridge.ino +++ b/tasmota/xdrv_41_tcp_bridge.ino @@ -35,6 +35,7 @@ WiFiServer *server_tcp = nullptr; WiFiClient client_tcp[TCP_BRIDGE_CONNECTIONS]; uint8_t client_next = 0; uint8_t *tcp_buf = nullptr; // data transfer buffer +IPAddress ip_filter; #include TasmotaSerial *TCPSerial = nullptr; @@ -60,12 +61,25 @@ void TCPLoop(void) // check for a new client connection if ((server_tcp) && (server_tcp->hasClient())) { + WiFiClient new_client = server_tcp->available(); + + AddLog(LOG_LEVEL_INFO, PSTR(D_LOG_TCP "Got connection from %s"), new_client.remoteIP().toString().c_str()); + // Check for IP filtering if it's enabled. + if (ip_filter) { + if (ip_filter != new_client.remoteIP()) { + AddLog(LOG_LEVEL_INFO, PSTR(D_LOG_TCP "Rejected due to filtering")); + new_client.stop(); + } else { + AddLog(LOG_LEVEL_INFO, PSTR(D_LOG_TCP "Allowed through filter")); + } + } + // find an empty slot uint32_t i; for (i=0; iavailable(); + client = new_client; break; } } @@ -73,7 +87,7 @@ void TCPLoop(void) i = client_next++ % nitems(client_tcp); WiFiClient &client = client_tcp[i]; client.stop(); - client = server_tcp->available(); + client = new_client; } } @@ -139,12 +153,21 @@ void TCPInit(void) { \*********************************************************************************************/ // -// Command `ZbConfig` +// Command `TCPStart` +// Params: port, // void CmndTCPStart(void) { if (!TCPSerial) { return; } + int32_t tcp_port = XdrvMailbox.payload; + if (ArgC() == 2) { + char sub_string[XdrvMailbox.data_len]; + ip_filter.fromString(ArgV(sub_string, 2)); + } else { + // Disable whitelist if previously set + ip_filter = (uint32_t)0; + } if (server_tcp) { AddLog(LOG_LEVEL_INFO, PSTR(D_LOG_TCP "Stopping TCP server")); @@ -159,6 +182,9 @@ void CmndTCPStart(void) { } if (tcp_port > 0) { AddLog(LOG_LEVEL_INFO, PSTR(D_LOG_TCP "Starting TCP server on port %d"), tcp_port); + if (ip_filter) { + AddLog(LOG_LEVEL_INFO, PSTR(D_LOG_TCP "Filtering %s"), ip_filter.toString().c_str()); + } server_tcp = new WiFiServer(tcp_port); server_tcp->begin(); // start TCP server server_tcp->setNoDelay(true); diff --git a/tasmota/xdrv_50_filesystem.ino b/tasmota/xdrv_50_filesystem.ino index 87d722474..d42cdda8d 100644 --- a/tasmota/xdrv_50_filesystem.ino +++ b/tasmota/xdrv_50_filesystem.ino @@ -109,8 +109,8 @@ void UfsInitOnce(void) { #ifdef ESP32 // try lfs first - ffsp = &LITTLEFS; - if (!LITTLEFS.begin(true)) { + ffsp = &LittleFS; + if (!LittleFS.begin(true)) { // ffat is second ffsp = &FFat; if (!FFat.begin(true)) { @@ -223,9 +223,9 @@ uint32_t UfsInfo(uint32_t sel, uint32_t type) { #endif // ESP8266 #ifdef ESP32 if (sel == 0) { - result = LITTLEFS.totalBytes(); + result = LittleFS.totalBytes(); } else { - result = LITTLEFS.totalBytes() - LITTLEFS.usedBytes(); + result = LittleFS.totalBytes() - LittleFS.usedBytes(); } #endif // ESP32 break; diff --git a/tasmota/xdrv_52_2_berry_native.ino b/tasmota/xdrv_52_2_berry_native.ino index 2f07aacca..e900ce6ac 100644 --- a/tasmota/xdrv_52_2_berry_native.ino +++ b/tasmota/xdrv_52_2_berry_native.ino @@ -209,6 +209,7 @@ extern "C" { extern "C" { typedef int32_t (*berry_callback_t)(int32_t v0, int32_t v1, int32_t v2, int32_t v3); + extern void BerryDumpErrorAndClear(bvm *vm, bool berry_console); int32_t call_berry_cb(int32_t num, int32_t v0, int32_t v1, int32_t v2, int32_t v3) { // call berry cb dispatcher @@ -227,7 +228,11 @@ extern "C" { be_pushint(berry.vm, v2); be_pushint(berry.vm, v3); - be_pcall(berry.vm, 6); // 5 arguments + ret = be_pcall(berry.vm, 6); // 5 arguments + if (ret != 0) { + BerryDumpErrorAndClear(berry.vm, false); // log in Tasmota console only + return 0; + } be_pop(berry.vm, 6); if (be_isint(berry.vm, -1) || be_isnil(berry.vm, -1)) { // sanity check @@ -381,8 +386,12 @@ int32_t lvbe_callback_x(uint32_t n, struct _lv_obj_t * obj, int32_t v1, int32_t be_pushint(berry.vm, v2); be_pushint(berry.vm, v3); be_pushint(berry.vm, v4); - be_pcall(berry.vm, 6); - int32_t ret = be_toint(berry.vm, -7); + int32_t ret = be_pcall(berry.vm, 6); + if (ret != 0) { + BerryDumpErrorAndClear(berry.vm, false); // log in Tasmota console only + return 0; + } + ret = be_toint(berry.vm, -7); be_pop(berry.vm, 7); // berry_log_P(">>>: Callback called out %d ret=%i", n, ret); return ret; diff --git a/tasmota/xdrv_52_3_berry_aes_gcm.ino b/tasmota/xdrv_52_3_berry_aes_gcm.ino new file mode 100644 index 000000000..ae0559794 --- /dev/null +++ b/tasmota/xdrv_52_3_berry_aes_gcm.ino @@ -0,0 +1,196 @@ +/* + xdrv_52_3_berry_md5.ino - Berry scripting language, Md5 class + + Copyright (C) 2021 Stephan Hadinger, Berry language by Guan Wenliang https://github.com/Skiars/berry + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +*/ + + +#ifdef USE_BERRY +#ifdef USE_ALEXA_AVS + +#include +#include "be_mem.h" + +/*********************************************************************************************\ + * AES class + * +\*********************************************************************************************/ +extern "C" { + + int free_br_obj(bvm* vm) { + int argc = be_top(vm); + if (argc > 0) { + void * obj = be_tocomptr(vm, 1); + if (obj != NULL) { be_os_free(obj); } + } + be_return_nil(vm); + } + + // `AES_GCM.init(secret_key:bytes(32), iv:bytes(12)) -> instance` + int32_t m_aes_gcm_init(struct bvm *vm); + int32_t m_aes_gcm_init(struct bvm *vm) { + int32_t argc = be_top(vm); // Get the number of arguments + if (argc >= 3 && be_isinstance(vm, 2) && be_isinstance(vm, 3)) { + do { + be_getglobal(vm, "bytes"); /* get the bytes class */ /* TODO eventually replace with be_getbuiltin */ + if (!be_isderived(vm, 2)) break; + size_t length = 0; + const void * bytes = be_tobytes(vm, 2, &length); + if (!bytes) break; + if (length != 32) { + be_raise(vm, "value_error", "Key size must be 32 bytes"); + } + + be_getglobal(vm, "bytes"); /* get the bytes class */ /* TODO eventually replace with be_getbuiltin */ + if (!be_isderived(vm, 3)) break; + size_t iv_length = 0; + const void * iv_bytes = be_tobytes(vm, 3, &iv_length); + if (!iv_bytes) break; + + // Initialize an AES CTR structure with the secret key + br_aes_small_ctr_keys * ctr_ctx = (br_aes_small_ctr_keys *) be_os_malloc(sizeof(br_aes_small_ctr_keys)); + if (!ctr_ctx) { be_throw(vm, BE_MALLOC_FAIL); } + br_aes_small_ctr_init(ctr_ctx, bytes, length); + be_newcomobj(vm, ctr_ctx, &free_br_obj); + be_setmember(vm, 1, ".p1"); + + // Initialize an AES GCM structure based on this CTR engine + br_gcm_context * gcm_ctx = (br_gcm_context *) be_os_malloc(sizeof(br_gcm_context)); + if (!gcm_ctx) { be_throw(vm, BE_MALLOC_FAIL); } + br_gcm_init(gcm_ctx, &ctr_ctx->vtable, &br_ghash_ctmul32); + be_newcomobj(vm, gcm_ctx, &free_br_obj); + be_setmember(vm, 1, ".p2"); + + // Reset GCM context with provided IV + br_gcm_reset(gcm_ctx, iv_bytes, iv_length); + + // We don't have any additional authenticated data so we flip instantly + br_gcm_flip(gcm_ctx); + + be_return_nil(vm); + // success + } while (0); + } + be_raise(vm, kTypeError, nullptr); + } + + int32_t m_aes_gcm_encryt(bvm *vm); + int32_t m_aes_gcm_decryt(bvm *vm); + int32_t m_aes_gcm_encrypt_or_decryt(bvm *vm, int encrypt) { + int32_t argc = be_top(vm); // Get the number of arguments + if (argc >= 2 && be_isinstance(vm, 2)) { + do { + be_getglobal(vm, "bytes"); /* get the bytes class */ /* TODO eventually replace with be_getbuiltin */ + if (!be_isderived(vm, 2)) break; + + // get GCM context + be_getmember(vm, 1, ".p2"); + br_gcm_context * gcm_ctx = (br_gcm_context *) be_tocomptr(vm, -1); + be_pop(vm, 1); + + // copy the input buffer + be_getmember(vm, 2, "copy"); // stack: bytes.copy() + be_pushvalue(vm, 2); // stack: bytes.copy(), bytes instance + be_call(vm, 1); // call copy with self parameter + be_pop(vm, 1); // stack: clone of input bytes + + size_t length = 0; + // we are changing bytes in place + void * bytes = (void*) be_tobytes(vm, -1, &length); + if (!bytes) break; + + br_gcm_run(gcm_ctx, encrypt, bytes, length); + + be_return(vm); + // success + } while (0); + } + be_raise(vm, kTypeError, nullptr); + } + int32_t m_aes_gcm_encryt(bvm *vm) { + return m_aes_gcm_encrypt_or_decryt(vm, 1); + } + int32_t m_aes_gcm_decryt(bvm *vm) { + return m_aes_gcm_encrypt_or_decryt(vm, 0); + } + + int32_t m_aes_gcm_tag(bvm *vm) { + do { + be_getglobal(vm, "bytes"); /* get the bytes class */ /* TODO eventually replace with be_getbuiltin */ + + // get GCM context + be_getmember(vm, 1, ".p2"); + br_gcm_context * gcm_ctx = (br_gcm_context *) be_tocomptr(vm, -1); + be_pop(vm, 1); + + // create a bytes buffer of 16 bytes + uint8_t tag[16] = {0}; + br_gcm_get_tag(gcm_ctx, tag); + be_pushbytes(vm, tag, sizeof(tag)); + + be_return(vm); + // success + } while (0); + be_raise(vm, kTypeError, nullptr); + } + +// // `Md5.update(content:bytes()) -> nil` +// // +// // Add raw bytes to the MD5 calculation +// int32_t m_md5_update(struct bvm *vm); +// int32_t m_md5_update(struct bvm *vm) { +// int32_t argc = be_top(vm); // Get the number of arguments +// if (argc >= 2 && be_isinstance(vm, 2)) { +// do { +// be_getglobal(vm, "bytes"); /* get the bytes class */ /* TODO eventually replace with be_getbuiltin */ +// if (!be_isderived(vm, 2)) break; +// size_t length = 0; +// const void * bytes = be_tobytes(vm, 2, &length); +// if (!bytes) break; + +// be_getmember(vm, 1, ".p"); +// struct MD5Context * ctx; +// ctx = (struct MD5Context *) be_tocomptr(vm, -1); +// if (!ctx) break; + +// if (length > 0) { +// MD5Update(ctx, (const uint8_t*) bytes, length); +// } +// be_return_nil(vm); +// // success +// } while (0); +// } +// be_raise(vm, kTypeError, nullptr); +// } + +// // `Md5.update(content:bytes()) -> nil` +// // +// // Add raw bytes to the MD5 calculation +// int32_t m_md5_finish(struct bvm *vm); +// int32_t m_md5_finish(struct bvm *vm) { +// be_getmember(vm, 1, ".p"); +// struct MD5Context * ctx; +// ctx = (struct MD5Context *) be_tocomptr(vm, -1); + +// uint8_t output[16]; +// MD5Final(output, ctx); +// be_pushbytes(vm, output, sizeof(output)); +// be_return(vm); +// } +} + +#endif // USE_ALEXA_AVS +#endif // USE_BERRY diff --git a/tasmota/xdrv_52_3_berry_audio.ino b/tasmota/xdrv_52_3_berry_audio.ino new file mode 100644 index 000000000..06957bced --- /dev/null +++ b/tasmota/xdrv_52_3_berry_audio.ino @@ -0,0 +1,265 @@ +/* + xdrv_52_3_berry_audio.ino - Berry scripting language, support for I2S audio + + Copyright (C) 2021 Stephan Hadinger, Berry language by Guan Wenliang https://github.com/Skiars/berry + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +*/ + + +#ifdef USE_BERRY + +#ifdef USE_I2S_AUDIO_BERRY + +// #include "AudioFileSourceSPIFFS.h" +// #include "AudioFileSourceID3.h" +#include "AudioOutputI2S.h" +#include "AudioGeneratorWAV.h" +#include "AudioGeneratorMP3.h" +#include "AudioFileSourceFS.h" + +#include + + +/*********************************************************************************************\ + * AudioOutput class + * +\*********************************************************************************************/ +extern "C" { + + // + // AudioOutputI2S(bclkPin: int, wclkPin: int, doutPin: int[, port:int, dmabuf:int, mode: int]) + // + int i2s_output_i2s_init(bvm *vm) { + int argc = be_top(vm); + if (argc > 3) { + int bclkPin = be_toint(vm, 2); + int wclkPin = be_toint(vm, 3); + int doutPin = be_toint(vm, 4); + int port = 0; + if (argc > 4) { + port = be_toint(vm, 5); + } + int dma_buf_count = 8; // number of dma buffers of 64 bytes + if (argc > 5) { + dma_buf_count = be_toint(vm, 6); + } + int mode = 0; // EXTERNAL_I2S + if (argc > 6) { + mode = be_toint(vm, 7); + } + // AudioOutputI2S(int port=0, int output_mode=EXTERNAL_I2S, int dma_buf_count = 8, int use_apll=APLL_DISABLE); + AudioOutputI2S * audio = new AudioOutputI2S(port, mode, dma_buf_count); + if (0 == mode) { + audio->SetPinout(bclkPin, wclkPin, doutPin); // return value has no useful information for us + } + be_pushcomptr(vm, (void*) audio); + be_setmember(vm, 1, ".p"); + be_return_nil(vm); + } + + be_raise(vm, kTypeError, nullptr); + } + + int i2s_output_i2s_deinit(bvm *vm) { + int argc = be_top(vm); + be_getmember(vm, 1, ".p"); + AudioOutputI2S * audio = (AudioOutputI2S *) be_tocomptr(vm, -1); + if (audio) { + delete audio; + // clear + be_pushcomptr(vm, (void*) NULL); + be_setmember(vm, 1, ".p"); + } + + be_return_nil(vm); + } + + int i2s_output_i2s_stop(bvm *vm) { + int argc = be_top(vm); + be_getmember(vm, 1, ".p"); + AudioOutputI2S * audio = (AudioOutputI2S *) be_tocomptr(vm, -1); + if (audio) { + audio->stop(); + } + be_return_nil(vm); + } + + // + // AudioGeneratorWAV() + // + int i2s_generator_wav_init(bvm *vm) { + AudioGeneratorWAV * wav = new AudioGeneratorWAV(); + be_pushcomptr(vm, (void*) wav); + be_setmember(vm, 1, ".p"); + be_return_nil(vm); + } + + AudioGeneratorWAV * i2s_generator_wav_get(bvm *vm) { + be_getmember(vm, 1, ".p"); + AudioGeneratorWAV * wav = (AudioGeneratorWAV *) be_tocomptr(vm, -1); + return wav; + } + + int i2s_generator_wav_deinit(bvm *vm) { + int argc = be_top(vm); + AudioGeneratorWAV * wav = i2s_generator_wav_get(vm); + if (wav) { + delete wav; + // clear + be_pushcomptr(vm, (void*) NULL); + be_setmember(vm, 1, ".p"); + } + + be_return_nil(vm); + } + + int i2s_generator_wav_begin(bvm *vm) { + int argc = be_top(vm); + if (argc > 2) { + AudioGeneratorWAV * wav = i2s_generator_wav_get(vm); + be_getmember(vm, 2, ".p"); + AudioFileSource * source = (AudioFileSource*) be_tocomptr(vm, -1); + be_getmember(vm, 3, ".p"); + AudioOutput * output = (AudioOutput*) be_tocomptr(vm, -1); + be_pop(vm, 2); + + bool ret = wav->begin(source, output); + be_pushbool(vm, ret); + be_return(vm); + } + be_return_nil(vm); + } + + int i2s_generator_wav_loop(bvm *vm) { + AudioGeneratorWAV * wav = i2s_generator_wav_get(vm); + bool ret = wav->loop(); + be_pushbool(vm, ret); + be_return(vm); + } + + int i2s_generator_wav_stop(bvm *vm) { + AudioGeneratorWAV * wav = i2s_generator_wav_get(vm); + bool ret = wav->stop(); + be_pushbool(vm, ret); + be_return(vm); + } + + int i2s_generator_wav_isrunning(bvm *vm) { + AudioGeneratorWAV * wav = i2s_generator_wav_get(vm); + bool ret = wav->isRunning(); + be_pushbool(vm, ret); + be_return(vm); + } + + // + // AudioGeneratorMP3() + // + int i2s_generator_mp3_init(bvm *vm) { + AudioGeneratorMP3 * mp3 = new AudioGeneratorMP3(); + be_pushcomptr(vm, (void*) mp3); + be_setmember(vm, 1, ".p"); + be_return_nil(vm); + } + + AudioGeneratorMP3 * i2s_generator_mp3_get(bvm *vm) { + be_getmember(vm, 1, ".p"); + AudioGeneratorMP3 * mp3 = (AudioGeneratorMP3 *) be_tocomptr(vm, -1); + return mp3; + } + + int i2s_generator_mp3_deinit(bvm *vm) { + int argc = be_top(vm); + AudioGeneratorMP3 * mp3 = i2s_generator_mp3_get(vm); + if (mp3) { + delete mp3; + // clear + be_pushcomptr(vm, (void*) NULL); + be_setmember(vm, 1, ".p"); + } + + be_return_nil(vm); + } + + int i2s_generator_mp3_begin(bvm *vm) { + int argc = be_top(vm); + if (argc > 2) { + AudioGeneratorMP3 * mp3 = i2s_generator_mp3_get(vm); + be_getmember(vm, 2, ".p"); + AudioFileSource * source = (AudioFileSource*) be_tocomptr(vm, -1); + be_getmember(vm, 3, ".p"); + AudioOutput * output = (AudioOutput*) be_tocomptr(vm, -1); + be_pop(vm, 2); + + bool ret = mp3->begin(source, output); + be_pushbool(vm, ret); + be_return(vm); + } + be_return_nil(vm); + } + + int i2s_generator_mp3_loop(bvm *vm) { + AudioGeneratorMP3 * mp3 = i2s_generator_mp3_get(vm); + bool ret = mp3->loop(); + be_pushbool(vm, ret); + be_return(vm); + } + + int i2s_generator_mp3_stop(bvm *vm) { + AudioGeneratorMP3 * mp3 = i2s_generator_mp3_get(vm); + bool ret = mp3->stop(); + be_pushbool(vm, ret); + be_return(vm); + } + + int i2s_generator_mp3_isrunning(bvm *vm) { + AudioGeneratorMP3 * mp3 = i2s_generator_mp3_get(vm); + bool ret = mp3->isRunning(); + be_pushbool(vm, ret); + be_return(vm); + } + + // File Source FS + // +#ifdef USE_UFILESYS + int i2s_file_source_fs_init(bvm *vm) { + int argc = be_top(vm); + if (argc > 1 && be_isstring(vm, 2)) { + const char * file_name = be_tostring(vm, 2); + AudioFileSourceFS * file_source = new AudioFileSourceFS(*ufsp, file_name); + be_pushcomptr(vm, (void*) file_source); + be_setmember(vm, 1, ".p"); + be_return_nil(vm); + } + be_raise(vm, kTypeError, nullptr); + } + + int i2s_file_source_fs_deinit(bvm *vm) { + int argc = be_top(vm); + be_getmember(vm, 1, ".p"); + AudioFileSourceFS * file_source = (AudioFileSourceFS *) be_tocomptr(vm, -1); + if (file_source) { + delete file_source; + // clear + be_pushcomptr(vm, (void*) NULL); + be_setmember(vm, 1, ".p"); + } + + be_return_nil(vm); + } +#endif // USE_UFILESYS +} + +#endif // USE_I2S_AUDIO_BERRY +#endif // USE_BERRY diff --git a/tasmota/xdrv_52_3_berry_lvgl.ino b/tasmota/xdrv_52_3_berry_lvgl.ino index 85e66aaba..2e6c302c3 100644 --- a/tasmota/xdrv_52_3_berry_lvgl.ino +++ b/tasmota/xdrv_52_3_berry_lvgl.ino @@ -226,8 +226,8 @@ extern void lv_ex_get_started_1(void); // - a callback, only 6 callbacks supported 0..5 // - '&1' callback 1 // -void be_check_arg_type(bvm *vm, int32_t argc, const char * arg_type, int32_t p[5]); -void be_check_arg_type(bvm *vm, int32_t argc, const char * arg_type, int32_t p[5]) { +void be_check_arg_type(bvm *vm, int32_t argc, const char * arg_type, int32_t p[8]); +void be_check_arg_type(bvm *vm, int32_t argc, const char * arg_type, int32_t p[8]) { bool arg_type_check = (arg_type != nullptr); // is type checking activated int32_t arg_idx = 0; // position in arg_type string char type_short_name[32]; @@ -278,7 +278,8 @@ void be_check_arg_type(bvm *vm, int32_t argc, const char * arg_type, int32_t p[5 } } -typedef int32_t (*fn_any_callable)(int32_t p0, int32_t p1, int32_t p2, int32_t p3, int32_t p4); +typedef int32_t (*fn_any_callable)(int32_t p0, int32_t p1, int32_t p2, int32_t p3, + int32_t p4, int32_t p5, int32_t p6, int32_t p7); extern "C" { void lv_init_set_member(bvm *vm, int index, void * ptr); @@ -303,7 +304,7 @@ extern "C" { if ((int32_t)obj2 == -1) { // special semantics if second ptr is -1, then just encapsulate obj = obj1; } else { // otherwise call the LVGL creator - obj = (lv_obj_t*) (*f)((int32_t)obj1, (int32_t)obj2, 0, 0, 0); + obj = (lv_obj_t*) (*f)((int32_t)obj1, (int32_t)obj2, 0, 0, 0, 0, 0, 0); } lv_init_set_member(vm, 1, obj); be_return_nil(vm); @@ -379,7 +380,7 @@ extern "C" { } int be_call_c_func(bvm *vm, void * func, const char * return_type, const char * arg_type) { - int32_t p[5] = {0,0,0,0,0}; + int32_t p[8] = {0,0,0,0,0,0,0,0}; int32_t argc = be_top(vm); // Get the number of arguments // check if we call a constructor @@ -391,7 +392,7 @@ extern "C" { fn_any_callable f = (fn_any_callable) func; be_check_arg_type(vm, argc, arg_type, p); // berry_log_C(">> be_call_c_func(%p) - %p,%p,%p,%p,%p - %s", f, p[0], p[1], p[2], p[3], p[4], return_type ? return_type : "NULL"); - int32_t ret = (*f)(p[0], p[1], p[2], p[3], p[4]); + int32_t ret = (*f)(p[0], p[1], p[2], p[3], p[4], p[5], p[6], p[7]); // AddLog(LOG_LEVEL_INFO, ">> be_call_c_func, ret = %p", ret); if ((return_type == nullptr) || (strlen(return_type) == 0)) { be_return_nil(vm); } // does not return else if (strlen(return_type) == 1) { @@ -438,18 +439,24 @@ extern "C" { return *col; } inline uint32_t lv_color_to_uint32(lv_color_t col) { - uint32_t *p = (uint32_t*) &col; + uint16_t *p = (uint16_t*) &col; return *p; } // lv_color + // First arg is a 24 bits RGB color + // If first arg is `nil` second arg is the native value of color int lco_init(bvm *vm) { int argc = be_top(vm); - uint32_t color = 0x0000; // default to black - if (argc > 1 && be_isint(vm, 2)) { - color = be_toint(vm, 2); + uint32_t color32 = 0x000000; // default to black + + if (argc > 1) { + color32 = be_toint(vm, 2); + } + lv_color_t lv_color = lv_color_hex(color32); + if (argc > 2 && be_toint(vm, 3) == -1) { + lv_color.full = be_toint(vm, 2); } - lv_color_t lv_color = lv_color_hex(color); be_pushint(vm, lv_color_to_uint32(lv_color)); be_setmember(vm, 1, ".p"); be_return_nil(vm); @@ -460,7 +467,7 @@ extern "C" { be_getmember(vm, 1, ".p"); uint32_t ntv_color = be_toint(vm, -1); lv_color = lv_color_from_uint32(ntv_color); - uint32_t color = lv_color_to32(lv_color); + uint32_t color = lv_color_to32(lv_color) & 0xFFFFFF; be_pop(vm, 1); // remove attribute char s[48]; snprintf(s, sizeof(s), "lv_color(0x%06x - native:0x%04x)", color, ntv_color); @@ -468,6 +475,14 @@ extern "C" { be_return(vm); } + int lco_toint(bvm *vm) { + lv_color_t lv_color = {}; + be_getmember(vm, 1, ".p"); + uint32_t ntv_color = be_toint(vm, -1); + be_pushint(vm, ntv_color); + be_return(vm); + } + /*********************************************************************************************\ * Support for lv diff --git a/tasmota/xdrv_52_3_berry_md5.ino b/tasmota/xdrv_52_3_berry_md5.ino index 4ae85d4b3..a4adee029 100644 --- a/tasmota/xdrv_52_3_berry_md5.ino +++ b/tasmota/xdrv_52_3_berry_md5.ino @@ -33,7 +33,8 @@ extern "C" { int free_ctx(bvm* vm) { int argc = be_top(vm); if (argc > 0) { - struct MD5Context * ctx = (struct MD5Context *) be_tocomptr(vm, 1); + be_getmember(vm, 1, ".p"); + struct MD5Context * ctx = (struct MD5Context *) be_tocomptr(vm, -1); if (ctx != NULL) { be_os_free(ctx); } diff --git a/tasmota/xdrv_52_3_berry_tasmota.ino b/tasmota/xdrv_52_3_berry_tasmota.ino index a35319ca7..72577ba2b 100644 --- a/tasmota/xdrv_52_3_berry_tasmota.ino +++ b/tasmota/xdrv_52_3_berry_tasmota.ino @@ -72,21 +72,47 @@ extern "C" { int32_t l_publish(struct bvm *vm); int32_t l_publish(struct bvm *vm) { int32_t top = be_top(vm); // Get the number of arguments - if (top >= 3 && be_isstring(vm, 2) && be_isstring(vm, 3)) { // 2 mandatory string arguments + if (top >= 3 && be_isstring(vm, 2) && (be_isstring(vm, 3) || be_isinstance(vm, 3))) { // 2 mandatory string arguments if (top == 3 || (top == 4 && be_isbool(vm, 4))) { // 3rd optional argument must be bool const char * topic = be_tostring(vm, 2); - const char * payload = be_tostring(vm, 3); + const char * payload = nullptr; + size_t payload_len = 0; + if (be_isstring(vm, 3)) { + payload = be_tostring(vm, 3); + payload_len = strlen(payload); + } else { + be_getglobal(vm, "bytes"); /* get the bytes class */ /* TODO eventually replace with be_getbuiltin */ + if (be_isderived(vm, 3)) { + payload = (const char *) be_tobytes(vm, 3, &payload_len); + } + } bool retain = false; if (top == 4) { retain = be_tobool(vm, 4); } - Response_P(payload); - MqttPublish(topic, retain); - be_return(vm); // Return + if (!payload) { be_raise(vm, "value_error", "Empty payload"); } + MqttPublishPayload(topic, payload, payload_len, retain); + be_return_nil(vm); // Return } } be_raise(vm, kTypeError, nullptr); } + + // Berry: `tasmota.publish_result(payload:string, subtopic:string) -> nil`` + // + int32_t l_publish_result(struct bvm *vm); + int32_t l_publish_result(struct bvm *vm) { + int32_t top = be_top(vm); // Get the number of arguments + if (top >= 3 && be_isstring(vm, 2) && be_isstring(vm, 3)) { // 2 mandatory string arguments + const char * payload = be_tostring(vm, 2); + const char * subtopic = be_tostring(vm, 3); + Response_P(PSTR("%s"), payload); + be_pop(vm, top); + MqttPublishPrefixTopicRulesProcess_P(RESULT_OR_TELE, subtopic); + be_return_nil(vm); // Return + } + be_raise(vm, kTypeError, nullptr); + } // Berry: `tasmota.cmd(command:string) -> string` // @@ -97,11 +123,7 @@ extern "C" { const char * command = be_tostring(vm, 2); be_pop(vm, 2); // clear the stack before calling, because of re-entrant call to Berry in a Rule ExecuteCommand(command, SRC_BERRY); -#ifdef MQTT_DATA_STRING - be_pushstring(vm, TasmotaGlobal.mqtt_data.c_str()); -#else - be_pushstring(vm, TasmotaGlobal.mqtt_data); -#endif + be_pushstring(vm, ResponseData()); be_return(vm); // Return } be_raise(vm, kTypeError, nullptr); @@ -168,7 +190,7 @@ extern "C" { be_raise(vm, kTypeError, nullptr); } - // Berry: tasmota.memory(timer:int) -> bool + // Berry: tasmota.memory() -> map // int32_t l_memory(struct bvm *vm); int32_t l_memory(struct bvm *vm) { @@ -191,6 +213,53 @@ extern "C" { be_raise(vm, kTypeError, nullptr); } + // Berry: tasmota.wifi() -> map + // + int32_t l_wifi(struct bvm *vm); + int32_t l_wifi(struct bvm *vm) { + int32_t top = be_top(vm); // Get the number of arguments + if (top == 1) { // no argument (instance only) + be_newobject(vm, "map"); + if (Settings->flag4.network_wifi) { + int32_t rssi = WiFi.RSSI(); + map_insert_int(vm, "rssi", rssi); + map_insert_int(vm, "quality", WifiGetRssiAsQuality(rssi)); +#if LWIP_IPV6 + String ipv6_addr = WifiGetIPv6(); + if (ipv6_addr != "") { + map_insert_str(vm, "ip6", ipv6_addr.c_str()); + } +#endif + if (static_cast(WiFi.localIP()) != 0) { + map_insert_str(vm, "mac", WiFi.macAddress().c_str()); + map_insert_str(vm, "ip", WiFi.localIP().toString().c_str()); + } + } + be_pop(vm, 1); + be_return(vm); + } + be_raise(vm, kTypeError, nullptr); + } + + // Berry: tasmota.eth() -> map + // + int32_t l_eth(struct bvm *vm); + int32_t l_eth(struct bvm *vm) { + int32_t top = be_top(vm); // Get the number of arguments + if (top == 1) { // no argument (instance only) + be_newobject(vm, "map"); +#ifdef USE_ETHERNET + if (static_cast(EthernetLocalIP()) != 0) { + map_insert_str(vm, "mac", EthernetMacAddress().c_str()); + map_insert_str(vm, "ip", EthernetLocalIP().toString().c_str()); + } +#endif + be_pop(vm, 1); + be_return(vm); + } + be_raise(vm, kTypeError, nullptr); + } + int32_t l_time_dump(bvm *vm) { int32_t top = be_top(vm); // Get the number of arguments if (top == 2 && be_isint(vm, 2)) { diff --git a/tasmota/xdrv_52_9_berry.ino b/tasmota/xdrv_52_9_berry.ino index 9abe75b65..47f31c34a 100644 --- a/tasmota/xdrv_52_9_berry.ino +++ b/tasmota/xdrv_52_9_berry.ino @@ -23,6 +23,7 @@ #define XDRV_52 52 #include +#include "be_vm.h" extern "C" { extern void be_load_custom_libs(bvm *vm); @@ -36,6 +37,8 @@ void (* const BerryCommand[])(void) PROGMEM = { CmndBrRun, }; +int32_t callBerryEventDispatcher(const char *type, const char *cmd, int32_t idx, const char *payload, uint32_t data_len = 0); + // // Sanity Check for be_top() // @@ -190,7 +193,8 @@ bool callMethodObjectWithArgs(const char * objname, const char * method, size_t // call the event dispatcher from Tasmota object -int32_t callBerryEventDispatcher(const char *type, const char *cmd, int32_t idx, const char *payload) { +// if data_len is non-zero, the event is also sent as raw `bytes()` object because the string may lose data +int32_t callBerryEventDispatcher(const char *type, const char *cmd, int32_t idx, const char *payload, uint32_t data_len) { int32_t ret = 0; bvm *vm = berry.vm; @@ -205,7 +209,13 @@ int32_t callBerryEventDispatcher(const char *type, const char *cmd, int32_t idx, be_pushstring(vm, cmd != nullptr ? cmd : ""); be_pushint(vm, idx); be_pushstring(vm, payload != nullptr ? payload : "{}"); // empty json - ret = be_pcall(vm, 5); // 5 arguments + if (data_len > 0) { + be_pushbytes(vm, payload, data_len); // if data_len is set, we also push raw bytes + ret = be_pcall(vm, 6); // 6 arguments + be_pop(vm, 1); + } else { + ret = be_pcall(vm, 5); // 5 arguments + } if (ret != 0) { BerryDumpErrorAndClear(vm, false); // log in Tasmota console only return ret; @@ -267,6 +277,7 @@ void BerryInit(void) { do { berry.vm = be_vm_new(); /* create a virtual machine instance */ be_set_obs_hook(berry.vm, &BerryObservability); + comp_set_named_gbl(berry.vm); be_load_custom_libs(berry.vm); // Register functions @@ -723,7 +734,7 @@ bool Xdrv52(uint8_t function) result = callBerryRule(); break; case FUNC_MQTT_DATA: - result = callBerryEventDispatcher(PSTR("mqtt_data"), XdrvMailbox.topic, 0, XdrvMailbox.data); + result = callBerryEventDispatcher(PSTR("mqtt_data"), XdrvMailbox.topic, 0, XdrvMailbox.data, XdrvMailbox.data_len); break; case FUNC_EVERY_50_MSECOND: callBerryEventDispatcher(PSTR("every_50ms"), nullptr, 0, nullptr); diff --git a/tasmota/xdrv_58_range_extender.ino b/tasmota/xdrv_58_range_extender.ino new file mode 100644 index 000000000..7fb999063 --- /dev/null +++ b/tasmota/xdrv_58_range_extender.ino @@ -0,0 +1,406 @@ +/* + xdrv_58_range_extender.ino - WiFi Range Extender for Tasmota + + Copyright (C) 2021 sillyfrog and Theo Arends + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +*/ + +#ifdef USE_WIFI_RANGE_EXTENDER +/********************************************************************************************* +To use this, add the following to your user_config_override.h +#define USE_WIFI_RANGE_EXTENDER + +Additionally, for the ESP8266, PIO_FRAMEWORK_ARDUINO_LWIP2_HIGHER_BANDWIDTH must be +set in your build options. +For example, in your platfromio_tasmota_cenv.ini, you will need an entry such as: +[env:tasmota-rangeextender] +build_flags = ${common.build_flags} + -D PIO_FRAMEWORK_ARDUINO_LWIP2_HIGHER_BANDWIDTH + +For the ESP32, the arduino-esp32 library must be at least version 2, with +CONFIG_LWIP_IP_FORWARD option set, and optionally CONFIG_LWIP_IPV4_NAPT. + +If you want to support NAPT (removing the need for routes on a core router): +#define USE_WIFI_RANGE_EXTENDER_NAPT + + +An example full static configuration: +#define USE_WIFI_RANGE_EXTENDER +#define USE_WIFI_RANGE_EXTENDER_NAPT +#define WIFI_RGX_STATE 1 +#define WIFI_RGX_NAPT 1 +#define WIFI_RGX_SSID "rangeextender" +#define WIFI_RGX_PASSWORD "securepassword" +#define WIFI_RGX_IP_ADDRESS "10.99.1.1" +#define WIFI_RGX_SUBNETMASK "255.255.255.0" + + +A full command to enable the Range Extender, including with NAPT could be: +Backlog RgxSSID rangeextender ; RgxPassword securepassword ; RgxAddress 192.168.123.1 ; RgxSubnet 255.255.255.0; RgxState 1 ; RgxNAPT 1 + +\*********************************************************************************************/ + +#define XDRV_58 58 + +// Memory usage at 512: Heap from 30136 to 17632: 12504 +// Memory usage at 128: Heap from 30136 to 26848: 3288 +#define NAPT 128 // IP_NAPT_MAX: 512 +#define NAPT_PORT 10 // IP_PORTMAP_MAX: 32 + +#warning **** USE_WIFI_RANGE_EXTENDER is enabled **** + +#ifdef ESP8266 +#if LWIP_FEATURES +// All good +#else +#error LWIP_FEATURES required, add "-D PIO_FRAMEWORK_ARDUINO_LWIP2_HIGHER_BANDWIDTH" to build_flags +#endif // LWIP_FEATURES +#endif // ESP8266 + +#ifdef ESP32 +#ifdef CONFIG_LWIP_IP_FORWARD +// All good +#else +#error CONFIG_LWIP_IP_FORWARD not set, arduino-esp32 v2 or later required with CONFIG_LWIP_IP_FORWARD support +#endif // CONFIG_LWIP_IP_FORWARD +#ifdef USE_WIFI_RANGE_EXTENDER_NAPT +#ifdef CONFIG_LWIP_IPV4_NAPT +// All good +#else +#error CONFIG_LWIP_IPV4_NAPT not set, arduino-esp32 v2 or later required with CONFIG_LWIP_IPV4_NAPT support +#endif // IP_NAPT +#endif // CONFIG_LWIP_IPV4_NAPT +#endif // ESP32 + +const char kDrvRgxCommands[] PROGMEM = "Rgx|" // Prefix + "State" + "|" D_CMND_SSID + "|" D_CMND_PASSWORD +#ifdef USE_WIFI_RANGE_EXTENDER_NAPT + "|" + "NAPT" +#endif // USE_WIFI_RANGE_EXTENDER_NAPT + "|" + "Address" + "|" + "Subnet"; + +void (*const DrvRgxCommand[])(void) PROGMEM = { + &CmndRgxState, + &CmndRgxSSID, + &CmndRgxPassword, +#ifdef USE_WIFI_RANGE_EXTENDER_NAPT + &CmndRgxNAPT, +#endif // USE_WIFI_RANGE_EXTENDER_NAPT + &CmndRgxAddresses, + &CmndRgxAddresses, +}; + +#ifdef USE_WIFI_RANGE_EXTENDER_NAPT +#ifdef ESP8266 +#include +#endif // ESP8266 +#endif // USE_WIFI_RANGE_EXTENDER_NAPT + +#include +#include +#ifdef ESP8266 +#include +#endif // ESP8266 +#ifdef ESP32 +#include "lwip/lwip_napt.h" +#include +#endif // ESP32 + +#define RGX_NOT_CONFIGURED 0 +#define RGX_FORCE_CONFIGURE 1 +#define RGX_CONFIGURED 2 +#define RGX_CONFIG_INCOMPLETE 3 +#define RGX_SETUP_NAPT 4 + +typedef struct +{ + uint8_t status = RGX_NOT_CONFIGURED; + uint16_t lastlinkcount = 0; +#ifdef USE_WIFI_RANGE_EXTENDER_NAPT + bool napt_enabled = false; +#endif // USE_WIFI_RANGE_EXTENDER_NAPT +} TRgxSettings; + +TRgxSettings RgxSettings; + +// Check the current configuration is complete, updating RgxSettings.status +void RgxCheckConfig(void) +{ + if ( + strlen(SettingsText(SET_RGX_SSID)) > 0 && + strlen(SettingsText(SET_RGX_PASSWORD)) >= 8 && + Settings->ipv4_rgx_address && + Settings->ipv4_rgx_subnetmask) + { + if (RgxSettings.status != RGX_FORCE_CONFIGURE) + { + RgxSettings.status = RGX_NOT_CONFIGURED; + } + } + else + { + RgxSettings.status = RGX_CONFIG_INCOMPLETE; + } +} + +void CmndRgxState(void) +{ + if ((XdrvMailbox.payload >= 0) && (XdrvMailbox.payload <= 1)) + { + if (Settings->sbflag1.range_extender != XdrvMailbox.payload) + { + Settings->sbflag1.range_extender = XdrvMailbox.payload; + if (0 == XdrvMailbox.payload) + { // Turn off + TasmotaGlobal.restart_flag = 2; + } + } + } + ResponseCmndStateText(Settings->sbflag1.range_extender); +} + +void CmndRgxAddresses(void) +{ + char network_address[22]; + ext_snprintf_P(network_address, sizeof(network_address), PSTR(" (%_I)"), (uint32_t)NetworkAddress()); + uint32_t ipv4_address; + if (ParseIPv4(&ipv4_address, XdrvMailbox.data)) + { + if (XdrvMailbox.command[3] == 'S') // Subnet + { + Settings->ipv4_rgx_subnetmask = ipv4_address; + } + else + { + Settings->ipv4_rgx_address = ipv4_address; + } + RgxSettings.status = RGX_FORCE_CONFIGURE; + } + ResponseRgxConfig(); +} + +void CmndRgxSSID(void) +{ + if (XdrvMailbox.data_len > 0) + { + SettingsUpdateText(SET_RGX_SSID, (SC_CLEAR == Shortcut()) ? "" : XdrvMailbox.data); + RgxSettings.status = RGX_FORCE_CONFIGURE; + } + ResponseRgxConfig(); +} + +void CmndRgxPassword(void) +{ + if (XdrvMailbox.data_len > 0) + { + SettingsUpdateText(SET_RGX_PASSWORD, (SC_CLEAR == Shortcut()) ? "" : XdrvMailbox.data); + RgxSettings.status = RGX_FORCE_CONFIGURE; + } + ResponseRgxConfig(); +} + +#ifdef USE_WIFI_RANGE_EXTENDER_NAPT +void CmndRgxNAPT(void) +{ + if ((XdrvMailbox.payload >= 0) && (XdrvMailbox.payload <= 1)) + { + if (Settings->sbflag1.range_extender_napt != XdrvMailbox.payload) + { + Settings->sbflag1.range_extender_napt = XdrvMailbox.payload; + if (0 == XdrvMailbox.payload) + { // Turn off + // ESP32 does not disable reliably, reboot to ensure a complete disable of NAPT + // rebooting also completely frees up the used RAM + TasmotaGlobal.restart_flag = 2; + } + else + { + RgxSettings.status = RGX_FORCE_CONFIGURE; + } + } + } + ResponseCmndStateText(Settings->sbflag1.range_extender_napt); +}; +#endif // USE_WIFI_RANGE_EXTENDER_NAPT + +void ResponseRgxConfig(void) +{ + RgxCheckConfig(); + Response_P(PSTR("{\"Rgx\":{\"Valid\":\"%s\",\"" D_CMND_SSID "\":\"%s\",\"" D_CMND_PASSWORD "\":\"%s\",\"" D_CMND_IPADDRESS "\":\"%_I\",\"" D_JSON_SUBNETMASK "\":\"%_I\"}"), + (RgxSettings.status == RGX_CONFIG_INCOMPLETE) ? "false" : "true", + EscapeJSONString(SettingsText(SET_RGX_SSID)).c_str(), + EscapeJSONString(SettingsText(SET_RGX_PASSWORD)).c_str(), + Settings->ipv4_rgx_address, + Settings->ipv4_rgx_subnetmask); +} + +void rngxSetup() +{ + // Check we have a complete config first + RgxCheckConfig(); + if (RgxSettings.status == RGX_CONFIG_INCOMPLETE) + { + AddLog(LOG_LEVEL_DEBUG, PSTR("RGX: Range Extender config incomplete")); + return; + } +#ifdef ESP8266 + dhcps_set_dns(0, WiFi.dnsIP(0)); + dhcps_set_dns(1, WiFi.dnsIP(1)); +#endif // ESP8266 +#ifdef ESP32 + esp_err_t err; + tcpip_adapter_dns_info_t ip_dns; + + err = tcpip_adapter_dhcps_stop(TCPIP_ADAPTER_IF_AP); + err = tcpip_adapter_get_dns_info(TCPIP_ADAPTER_IF_STA, ESP_NETIF_DNS_MAIN, &ip_dns); + err = tcpip_adapter_set_dns_info(TCPIP_ADAPTER_IF_AP, ESP_NETIF_DNS_MAIN, &ip_dns); + dhcps_offer_t opt_val = OFFER_DNS; // supply a dns server via dhcps + tcpip_adapter_dhcps_option(ESP_NETIF_OP_SET, ESP_NETIF_DOMAIN_NAME_SERVER, &opt_val, 1); + err = tcpip_adapter_dhcps_start(TCPIP_ADAPTER_IF_AP); +#endif // ESP32 + // WiFi.softAPConfig(EXTENDER_LOCAL_IP, EXTENDER_GATEWAY_IP, EXTENDER_SUBNET); + WiFi.softAPConfig(Settings->ipv4_rgx_address, Settings->ipv4_rgx_address, Settings->ipv4_rgx_subnetmask); + WiFi.softAP(SettingsText(SET_RGX_SSID), SettingsText(SET_RGX_PASSWORD)); + AddLog(LOG_LEVEL_INFO, PSTR("RGX: WiFi Extender AP Enabled with SSID: %s"), WiFi.softAPSSID().c_str()); + RgxSettings.status = RGX_SETUP_NAPT; + RgxSettings.lastlinkcount = Wifi.link_count; +} + +void rngxSetupNAPT(void) +{ + // A short delay is required for enabling NAPT to work on the ESP32, hence a dedicated + // function called a second later +#ifdef USE_WIFI_RANGE_EXTENDER_NAPT + if (Settings->sbflag1.range_extender_napt && !RgxSettings.napt_enabled) + { +#ifdef ESP8266 + // ip_napt_init can only be called once, however device will reboot when disabled + // so no need to limit calls to init separately. + err_t ret = ip_napt_init(NAPT, NAPT_PORT); + if (ret == ERR_OK) + { + AddLog(LOG_LEVEL_INFO, PSTR("RGX: NAPT initialization complete")); + err_t ret = ip_napt_enable_no(SOFTAP_IF, 1); + if (ret == ERR_OK) + { + AddLog(LOG_LEVEL_INFO, PSTR("RGX: NAPT Enabled")); + RgxSettings.napt_enabled = true; + } + } + else + { + AddLog(LOG_LEVEL_ERROR, PSTR("RGX: NAPT initialization failed! (%d)"), ret); + } + +#endif // ESP8266 +#ifdef ESP32 + ip_napt_enable(WiFi.softAPIP(), 1); + AddLog(LOG_LEVEL_INFO, PSTR("RGX: NAPT Enabled")); + RgxSettings.napt_enabled = true; +#endif // ESP32 + } + // This code path is no longer used as device will reboot to disable NAPT, maybe + // restored when working correctly on ESP32 + /* + else if (!Settings->sbflag1.range_extender_napt && RgxSettings.napt_enabled) + { +#ifdef ESP8266 + err_t ret = ip_napt_enable_no(SOFTAP_IF, 0); + if (ret == ERR_OK) + { + AddLog(LOG_LEVEL_INFO, "RGX: NAPT Disabled"); + RgxSettings.napt_enabled = false; + } +#endif // ESP8266 +#ifdef ESP32 + ip_napt_enable(WiFi.softAPIP(), 0); + AddLog(LOG_LEVEL_INFO, "RGX: NAPT Disabled, reboot maybe required"); +#endif // ESP32 + } + */ +#endif // USE_WIFI_RANGE_EXTENDER_NAPT + RgxSettings.status = RGX_CONFIGURED; +} + +/*********************************************************************************************\ + * Interface +\*********************************************************************************************/ + +bool Xdrv58(uint8_t function) +{ + bool result = false; + + if (FUNC_COMMAND == function) + { + result = DecodeCommand(kDrvRgxCommands, DrvRgxCommand); + } + else if (Settings->sbflag1.range_extender && !TasmotaGlobal.restart_flag) + { + switch (function) + { + case FUNC_PRE_INIT: + break; + case FUNC_EVERY_SECOND: + // AddLog(LOG_LEVEL_INFO, PSTR("RGX: XXX DEBUG: Wifi.status: %d, WiFi.getMode(): %d, RgxSettings.status: %d, link_count: %d"), Wifi.status, WiFi.getMode(), RgxSettings.status, Wifi.link_count); + if (RgxSettings.status == RGX_NOT_CONFIGURED && Wifi.status == WL_CONNECTED) + { + // Setup only if WiFi in STA only mode + if (WiFi.getMode() == WIFI_STA) + { + // Connecting for the first time, setup WiFi + rngxSetup(); + } + else + { + RgxSettings.status = RGX_CONFIGURED; + } + } + else if (RgxSettings.status == RGX_FORCE_CONFIGURE && Wifi.status == WL_CONNECTED) + { + rngxSetup(); + } + else if (RgxSettings.status == RGX_SETUP_NAPT) + { + // Call NAPT a second later as ESP32 requires short delay + rngxSetupNAPT(); + } + else if (RgxSettings.status == RGX_CONFIGURED) + { + if (Wifi.status != WL_CONNECTED) + { + // No longer connected, need to setup again + AddLog(LOG_LEVEL_INFO, PSTR("RGX: No longer connected, prepare to reconnect WiFi AP...")); + RgxSettings.status = RGX_NOT_CONFIGURED; + } + else if (RgxSettings.lastlinkcount != Wifi.link_count && WiFi.getMode() != WIFI_AP_STA) + { + // Assume WiFi has reconnected and been reconfigured, prepare to reconnect + AddLog(LOG_LEVEL_INFO, PSTR("RGX: Link count now: %d, WiFi.getMode(): %d, unconfigure..."), Wifi.link_count, WiFi.getMode()); + RgxSettings.status = RGX_NOT_CONFIGURED; + } + } + break; + } + } + return result; +} + +#endif // USE_WIFI_RANGE_EXTENDER \ No newline at end of file diff --git a/tasmota/xdrv_59_influxdb.ino b/tasmota/xdrv_59_influxdb.ino new file mode 100644 index 000000000..9bc7f5510 --- /dev/null +++ b/tasmota/xdrv_59_influxdb.ino @@ -0,0 +1,522 @@ +/* + xdrv_59_influxdb.ino - Influxdb support for Tasmota + + Copyright (C) 2021 Theo Arends + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . +*/ + +#ifdef USE_INFLUXDB +/*********************************************************************************************\ + * Influxdb support + * + * To save over 80k not supporting https this driver uses a subset of library + * https://github.com/tobiasschuerg/InfluxDB-Client-for-Arduino + * + * The text format for metrics, labels and values is documented at + * https://docs.influxdata.com/influxdb/v1.8/write_protocols/line_protocol_reference/ + * + * Supported commands: + * Ifx - Set Influxdb state off (0) or on (1) and show current state + * IfxHost - Set Influxdb host name or IP address + * IfxPort - Set Influxdb port + * IfxDatabase - Set Influxdb v1 and database name + * IfxUser - Set Influxdb v1 and userid + * IfxPassword - Set Influxdb v1 and password + * IfxBucket - Set Influxdb v2 and bucket name + * IfxOrg - Set Influxdb v2 and organization + * IfxToken - Set Influxdb v2 and token + * + * Set influxdb update interval with command teleperiod + * + * The following triggers result in automatic influxdb numeric feeds without appended time: + * - this driver initiated state message + * - this driver initiated teleperiod data + * - power commands +\*********************************************************************************************/ + +#define XDRV_59 59 + +#define INFLUXDB_INITIAL 7 // Initial number of seconds after wifi connect keeping in mind sensor initialization + +#ifndef INFLUXDB_STATE +#define INFLUXDB_STATE 0 // [Ifx] Influxdb initially Off (0) or On (1) +#endif +#ifndef INFLUXDB_VERSION +#define INFLUXDB_VERSION 1 // Version of Influxdb 1 or 2 +#endif +#ifndef INFLUXDB_HOST +#define INFLUXDB_HOST "influxdb" // [IfxHost] Influxdb hostname or IP address +#endif +#ifndef INFLUXDB_PORT +#define INFLUXDB_PORT 8086 // [IfxPort] Influxdb port number +#endif +#ifndef INFLUXDB_ORG +#define INFLUXDB_ORG "" // [IfxUser, IfxOrg] Influxdb v1 username or v2 organisation +#endif +#ifndef INFLUXDB_TOKEN +#define INFLUXDB_TOKEN "" // [IfxPassword, IfxToken] Influxdb v1 password or v2 token +#endif +#ifndef INFLUXDB_BUCKET +#define INFLUXDB_BUCKET "db" // [IfxDatabase, IfxBucket] Influxdb v1 database or v2 bucket +#endif + +static const char UninitializedMessage[] PROGMEM = "Unconfigured instance"; +// This cannot be put to PROGMEM due to the way how it is used +static const char RetryAfter[] = "Retry-After"; +static const char TransferEncoding[] = "Transfer-Encoding"; + +WiFiClient *IFDBwifiClient = nullptr; +HTTPClient *IFDBhttpClient = nullptr; + +struct { + String _serverUrl; // Connection info + String _writeUrl; // Cached full write url + String _lastErrorResponse; // Server reponse or library error message for last failed request + uint32_t _lastRequestTime = 0; // Last time in ms we made are a request to server + int interval = 0; + int _lastStatusCode = 0; // HTTP status code of last request to server + int _lastRetryAfter = 0; // Store retry timeout suggested by server after last request + bool _connectionReuse; // true if HTTP connection should be kept open. Usable for frequent writes. Default false + bool init = false; +} IFDB; + +/*********************************************************************************************\ + * Influxdb library function +\*********************************************************************************************/ + +String InfluxDbAuth(void) { + String auth = ""; + if (strlen(SettingsText(SET_INFLUXDB_ORG)) > 0 && strlen(SettingsText(SET_INFLUXDB_TOKEN)) > 0) { + auth = "&u="; + auth += UrlEncode(SettingsText(SET_INFLUXDB_ORG)); + auth += "&p="; + auth += UrlEncode(SettingsText(SET_INFLUXDB_TOKEN)); + } + return auth; +} + +bool InfluxDbParameterInit(void) { + if (strlen(SettingsText(SET_INFLUXDB_BUCKET)) == 0 || + (2 == Settings->influxdb_version && (strlen(SettingsText(SET_INFLUXDB_ORG)) == 0 || + strlen(SettingsText(SET_INFLUXDB_TOKEN)) == 0))) { + AddLog(LOG_LEVEL_DEBUG, PSTR("IFX: Invalid parameters")); + return false; + } + IFDB._serverUrl = "http://"; + IFDB._serverUrl += SettingsText(SET_INFLUXDB_HOST); + IFDB._serverUrl += ":"; + IFDB._serverUrl += Settings->influxdb_port; + + IFDB._writeUrl = IFDB._serverUrl; + if (2 == Settings->influxdb_version) { + IFDB._writeUrl += "/api/v2/write?org="; + IFDB._writeUrl += UrlEncode(SettingsText(SET_INFLUXDB_ORG)); + IFDB._writeUrl += "&bucket="; + IFDB._writeUrl += UrlEncode(SettingsText(SET_INFLUXDB_BUCKET)); + } else { + IFDB._writeUrl += "/write?db="; + IFDB._writeUrl += UrlEncode(SettingsText(SET_INFLUXDB_BUCKET)); + IFDB._writeUrl += InfluxDbAuth(); + } + AddLog(LOG_LEVEL_DEBUG, PSTR("IFX: Url %s"), IFDB._writeUrl.c_str()); + + return true; +} + +bool InfluxDbInit(void) { + IFDBwifiClient = new WiFiClient; + if (!IFDBhttpClient) { + IFDBhttpClient = new HTTPClient; + } + IFDBhttpClient->setReuse(IFDB._connectionReuse); + char server[32]; + snprintf_P(server, sizeof(server), PSTR("Tasmota/%s (%s)"), TasmotaGlobal.version, GetDeviceHardware().c_str()); + IFDBhttpClient->setUserAgent(server); + return true; +} + +void InfluxDbBeforeRequest() { + if (strlen(SettingsText(SET_INFLUXDB_TOKEN)) > 0) { + String auth_token = SettingsText(SET_INFLUXDB_TOKEN); + IFDBhttpClient->addHeader(F("Authorization"), "Token " + auth_token); + } + const char *headerKeys[] = { RetryAfter, TransferEncoding }; + IFDBhttpClient->collectHeaders(headerKeys, 2); +} + +void InfluxDbAfterRequest(int expectedStatusCode, bool modifyLastConnStatus) { + if (modifyLastConnStatus) { + IFDB._lastRequestTime = millis(); +// AddLog(LOG_LEVEL_DEBUG, PSTR("IFX: HTTP status code %d"), IFDB._lastStatusCode); + IFDB._lastRetryAfter = 0; + if (IFDB._lastStatusCode >= 429) { //retryable server errors + if (IFDBhttpClient->hasHeader(RetryAfter)) { + IFDB._lastRetryAfter = IFDBhttpClient->header(RetryAfter).toInt(); + AddLog(LOG_LEVEL_DEBUG, PSTR("IFX: Reply after %d"), IFDB._lastRetryAfter); + } + } + } + IFDB._lastErrorResponse = ""; + if (IFDB._lastStatusCode != expectedStatusCode) { + if (IFDB._lastStatusCode > 0) { + IFDB._lastErrorResponse = IFDBhttpClient->getString(); + AddLog(LOG_LEVEL_INFO, PSTR("IFX: %s"), IFDB._lastErrorResponse.c_str()); // {"error":"database not found: \"db\""} + } else { + IFDB._lastErrorResponse = IFDBhttpClient->errorToString(IFDB._lastStatusCode); + AddLog(LOG_LEVEL_INFO, PSTR("IFX: Error %s"), IFDB._lastErrorResponse.c_str()); + } + } +} + +bool InfluxDbValidateConnection(void) { + if (!IFDBwifiClient && !InfluxDbInit()) { + IFDB._lastStatusCode = 0; + IFDB._lastErrorResponse = FPSTR(UninitializedMessage); + return false; + } + // on version 1.x /ping will by default return status code 204, without verbose + String url = IFDB._serverUrl + (2 == Settings->influxdb_version ? "/health" : "/ping?verbose=true"); + if (1 == Settings->influxdb_version) { + url += InfluxDbAuth(); + } + // on version 1.8.9 /health works fine +// String url = IFDB._serverUrl + "/health"; + AddLog(LOG_LEVEL_INFO, PSTR("IFX: Validating connection to %s"), url.c_str()); + + if (!IFDBhttpClient->begin(*IFDBwifiClient, url)) { + AddLog(LOG_LEVEL_DEBUG, PSTR("IFX: Begin failed")); + return false; + } + IFDBhttpClient->addHeader(F("Accept"), F("application/json")); + + IFDB._lastStatusCode = IFDBhttpClient->GET(); + IFDB._lastErrorResponse = ""; + InfluxDbAfterRequest(200, false); + IFDBhttpClient->end(); + + return IFDB._lastStatusCode == 200; +} + +int InfluxDbPostData(const char *data) { + if (!IFDBwifiClient && !InfluxDbInit()) { + IFDB._lastStatusCode = 0; + IFDB._lastErrorResponse = FPSTR(UninitializedMessage); + return 0; + } + if (data) { + if (!IFDBhttpClient->begin(*IFDBwifiClient, IFDB._writeUrl)) { + AddLog(LOG_LEVEL_DEBUG, PSTR("IFX: Begin failed")); + return false; + } + + AddLog(LOG_LEVEL_DEBUG_MORE, PSTR("IFX: Sending\n%s"), data); + IFDBhttpClient->addHeader(F("Content-Type"), F("text/plain")); + InfluxDbBeforeRequest(); + IFDB._lastStatusCode = IFDBhttpClient->POST((uint8_t*)data, strlen(data)); + InfluxDbAfterRequest(204, true); + IFDBhttpClient->end(); + } + return IFDB._lastStatusCode; +} + +/*********************************************************************************************\ + * Data preparation +\*********************************************************************************************/ + +char* InfluxDbNumber(char* alternative, const char* source) { + // Test for valid numeric data ('-.0123456789') or ON, OFF etc. as defined in kOptions + if (source != nullptr) { + char* out = (char*)source; + // Convert special text as found in kOptions to a number + // Like "OFF" -> 0, "ON" -> 1, "TOGGLE" -> 2 + int number = GetStateNumber(source); + if (number >= 0) { + itoa(number, alternative, 10); + out = alternative; + } + if (IsNumeric(out)) { + return out; + } + } + return nullptr; +} + +void InfluxDbProcessJson(void) { + if (!IFDB.init) { return; } + +// AddLog(LOG_LEVEL_DEBUG, PSTR("IFX: JSON %s"), ResponseData()); + + String jsonStr = ResponseData(); + JsonParser parser((char *)jsonStr.c_str()); + JsonParserObject root = parser.getRootObject(); + if (root) { + char number[12]; // '1' to '255' + char linebuf[128]; // 'temperature,device=demo,sensor=ds18b20,id=01144A0CB2AA value=26.44\n' + char sensor[64]; // 'ds18b20' + char type[64]; // 'temperature' + char sensor_id[32]; // ',id=01144A0CB2AA' + sensor_id[0] = '\0'; + + String data = ""; // Multiple linebufs + + for (auto key1 : root) { + JsonParserToken value1 = key1.getValue(); + if (value1.isObject()) { + JsonParserObject Object2 = value1.getObject(); + for (auto key2 : Object2) { + JsonParserToken value2 = key2.getValue(); + if (value2.isObject()) { + JsonParserObject Object3 = value2.getObject(); + for (auto key3 : Object3) { + const char* value = InfluxDbNumber(number, key3.getValue().getStr()); + if (value != nullptr) { + // Level 3 + LowerCase(sensor, key2.getStr()); + LowerCase(type, key3.getStr()); + // temperature,device=tasmota1,sensor=DS18B20 value=24.44 + snprintf_P(linebuf, sizeof(linebuf), PSTR("%s,device=%s,sensor=%s value=%s\n"), + type, TasmotaGlobal.mqtt_topic, sensor, value); + data += linebuf; + } + } + } else { + // Level 2 + // { ... "ANALOG":{"Temperature":184.72},"DS18B20":{"Id":"01144A0CB2AA","Temperature":24.88},"HTU21":{"Temperature":25.32,"Humidity":49.2,"DewPoint":13.88},"Global":{"Temperature":24.88,"Humidity":49.2,"DewPoint":13.47}, ... } + bool isarray = value2.isArray(); + const char* value = InfluxDbNumber(number, (isarray) ? (value2.getArray())[0].getStr() : value2.getStr()); + if (value != nullptr) { + LowerCase(sensor, key1.getStr()); + LowerCase(type, key2.getStr()); + +// AddLog(LOG_LEVEL_DEBUG, PSTR("IFX2: sensor %s (%s), type %s (%s)"), key1.getStr(), sensor, key2.getStr(), type); + + if (strcmp(type, "id") == 0) { // Index for DS18B20 + snprintf_P(sensor_id, sizeof(sensor_id), PSTR(",id=%s"), value); + } else { + if (isarray) { + JsonParserArray arr = value2.getArray(); + uint32_t i = 0; + for (auto val : arr) { + i++; + // power1,device=shelly25,sensor=energy value=0.00 + // power2,device=shelly25,sensor=energy value=4.12 + snprintf_P(linebuf, sizeof(linebuf), PSTR("%s%d,device=%s,sensor=%s%s value=%s\n"), + type, i, TasmotaGlobal.mqtt_topic, sensor, sensor_id, val.getStr()); + data += linebuf; + } + } else { + // temperature,device=demo,sensor=ds18b20,id=01144A0CB2AA value=22.63 + snprintf_P(linebuf, sizeof(linebuf), PSTR("%s,device=%s,sensor=%s%s value=%s\n"), + type, TasmotaGlobal.mqtt_topic, sensor, sensor_id, value); + data += linebuf; + } + sensor_id[0] = '\0'; + } + } + } + } + } else { + // Level 1 + // {"Time":"2021-08-13T14:15:56","Switch1":"ON","Switch2":"OFF", ... "TempUnit":"C"} + const char* value = InfluxDbNumber(number, value1.getStr()); + if (value != nullptr) { + LowerCase(type, key1.getStr()); + // switch1,device=demo,sensor=device value=0 + // power1,device=demo,sensor=device value=1 + snprintf_P(linebuf, sizeof(linebuf), PSTR("%s,device=%s,sensor=device value=%s\n"), + type, TasmotaGlobal.mqtt_topic, value); + data += linebuf; + } + } + } + if (data.length() > 0 ) { +// AddLog(LOG_LEVEL_DEBUG, PSTR("IFX: Sensor data:\n%s"), data.c_str()); + InfluxDbPostData(data.c_str()); + } + } +} + +void InfluxDbPublishPowerState(uint32_t device) { + Response_P(PSTR("{\"power%d\":\"%d\"}"), device, bitRead(TasmotaGlobal.power, device -1)); + InfluxDbProcessJson(); +} + +void InfluxDbLoop(void) { + if (!TasmotaGlobal.global_state.network_down) { + IFDB.interval--; + if (IFDB.interval <= 0 || IFDB.interval > Settings->tele_period) { + IFDB.interval = Settings->tele_period; + if (!IFDB.init) { + if (InfluxDbParameterInit()) { + IFDB.init = InfluxDbValidateConnection(); + if (IFDB.init) { + IFDB.interval = INFLUXDB_INITIAL; + } + } + } else { + + // {"Time":"2021-08-14T17:19:33","Uptime":"0T00:24:09","UptimeSec":1449,"Heap":29,"SleepMode":"Dynamic","Sleep":50,"LoadAvg":19,"MqttCount":1,"POWER1":"ON","Wifi":{"AP":1,"SSId":"indebuurt_IoT","BSSId":"98:38:C9:CA:17:C1","Channel":11,"Mode":"11n","RSSI":100,"Signal":-44,"LinkCount":1,"Downtime":"0T00:00:03"}} + uint32_t backup = Settings->flag.device_index_enable; + Settings->flag.device_index_enable = 1; // Force indexes to power + ResponseClear(); + MqttShowState(); // Pull state data + Settings->flag.device_index_enable = backup; + InfluxDbProcessJson(); + + // {"Time":"2021-08-14T17:19:33","Switch1":"ON","Switch2":"OFF","ANALOG":{"Temperature":184.72},"DS18B20":{"Id":"01144A0CB2AA","Temperature":27.50},"HTU21":{"Temperature":28.23,"Humidity":39.7,"DewPoint":13.20},"Global":{"Temperature":27.50,"Humidity":39.7,"DewPoint":12.55},"TempUnit":"C"} + ResponseClear(); + if (MqttShowSensor()) { // Pull sensor data + InfluxDbProcessJson(); + }; + + } + } + } +} + +/*********************************************************************************************\ + * Commands +\*********************************************************************************************/ + +#define D_PRFX_INFLUXDB "Ifx" +#define D_CMND_INFLUXDBHOST "Host" +#define D_CMND_INFLUXDBPORT "Port" +#define D_CMND_INFLUXDBUSER "User" +#define D_CMND_INFLUXDBORG "Org" +#define D_CMND_INFLUXDBPASSWORD "Password" +#define D_CMND_INFLUXDBTOKEN "Token" +#define D_CMND_INFLUXDBDATABASE "Database" +#define D_CMND_INFLUXDBBUCKET "Bucket" + +const char kInfluxDbCommands[] PROGMEM = D_PRFX_INFLUXDB "|" // Prefix + "|" + D_CMND_INFLUXDBHOST "|" D_CMND_INFLUXDBPORT "|" + D_CMND_INFLUXDBUSER "|" D_CMND_INFLUXDBORG "|" + D_CMND_INFLUXDBPASSWORD "|" D_CMND_INFLUXDBTOKEN "|" + D_CMND_INFLUXDBDATABASE "|" D_CMND_INFLUXDBBUCKET; + +void (* const InfluxCommand[])(void) PROGMEM = { + &CmndInfluxDbState, + &CmndInfluxDbHost, &CmndInfluxDbPort, + &CmndInfluxDbUser, &CmndInfluxDbUser, + &CmndInfluxDbPassword, &CmndInfluxDbPassword, + &CmndInfluxDbDatabase, &CmndInfluxDbDatabase }; + +void InfluxDbReinit(void) { + IFDB.init = false; + IFDB.interval = 2; +} + +void CmndInfluxDbState(void) { + if ((XdrvMailbox.payload >= 0) && (XdrvMailbox.payload <= 1)) { + if (Settings->sbflag1.influxdb_state != XdrvMailbox.payload) { + Settings->sbflag1.influxdb_state = XdrvMailbox.payload; + InfluxDbReinit(); + } + } + Response_P(PSTR("{\"" D_PRFX_INFLUXDB "\":{\"State\":\"%s\",\"" D_CMND_INFLUXDBHOST "\":\"%s\",\"" D_CMND_INFLUXDBPORT "\":%d,\"Version\":%d"), + GetStateText(Settings->sbflag1.influxdb_state), SettingsText(SET_INFLUXDB_HOST), Settings->influxdb_port, Settings->influxdb_version); + if (1 == Settings->influxdb_version) { + ResponseAppend_P(PSTR(",\"" D_CMND_INFLUXDBDATABASE "\":\"%s\",\"" D_CMND_INFLUXDBUSER "\":\"%s\"}}"), + SettingsText(SET_INFLUXDB_BUCKET), SettingsText(SET_INFLUXDB_ORG)); + } else { + ResponseAppend_P(PSTR(",\"" D_CMND_INFLUXDBBUCKET "\":\"%s\",\"" D_CMND_INFLUXDBORG "\":\"%s\"}}"), + SettingsText(SET_INFLUXDB_BUCKET), SettingsText(SET_INFLUXDB_ORG)); + } +} + +void CmndInfluxDbHost(void) { + if (XdrvMailbox.data_len > 0) { + SettingsUpdateText(SET_INFLUXDB_HOST, (SC_CLEAR == Shortcut()) ? "" : (SC_DEFAULT == Shortcut()) ? PSTR(INFLUXDB_HOST) : XdrvMailbox.data); + InfluxDbReinit(); + } + ResponseCmndChar(SettingsText(SET_INFLUXDB_HOST)); +} + +void CmndInfluxDbPort(void) { + if ((XdrvMailbox.payload > 0) && (XdrvMailbox.payload < 65536)) { + Settings->influxdb_port = (1 == XdrvMailbox.payload) ? INFLUXDB_PORT : XdrvMailbox.payload; + InfluxDbReinit(); + } + ResponseCmndNumber(Settings->influxdb_port); +} + +void CmndInfluxDbUser(void) { + if (XdrvMailbox.data_len > 0) { + Settings->influxdb_version = (XdrvMailbox.command[3] == 'U') ? 1 : 2; // User or Org + SettingsUpdateText(SET_INFLUXDB_ORG, (SC_CLEAR == Shortcut()) ? "" : (SC_DEFAULT == Shortcut()) ? PSTR(INFLUXDB_ORG) : XdrvMailbox.data); + InfluxDbReinit(); + } + ResponseCmndChar(SettingsText(SET_INFLUXDB_ORG)); +} + +void CmndInfluxDbPassword(void) { + bool show_asterisk = (2 == XdrvMailbox.index); + if (XdrvMailbox.data_len > 0) { + Settings->influxdb_version = (XdrvMailbox.command[3] == 'P') ? 1 : 2; // Password or Token + SettingsUpdateText(SET_INFLUXDB_TOKEN, (SC_CLEAR == Shortcut()) ? "" : (SC_DEFAULT == Shortcut()) ? PSTR(INFLUXDB_TOKEN) : XdrvMailbox.data); + if (!show_asterisk) { + ResponseCmndChar(SettingsText(SET_INFLUXDB_TOKEN)); + } + InfluxDbReinit(); + } else { + show_asterisk = true; + } + if (show_asterisk) { + Response_P(S_JSON_COMMAND_ASTERISK, XdrvMailbox.command); + } +} + +void CmndInfluxDbDatabase(void) { + if (XdrvMailbox.data_len > 0) { + Settings->influxdb_version = (XdrvMailbox.command[3] == 'D') ? 1 : 2; // Database or Bucket + SettingsUpdateText(SET_INFLUXDB_BUCKET, (SC_CLEAR == Shortcut()) ? "" : (SC_DEFAULT == Shortcut()) ? PSTR(INFLUXDB_BUCKET) : XdrvMailbox.data); + InfluxDbReinit(); + } + ResponseCmndChar(SettingsText(SET_INFLUXDB_BUCKET)); +} + +/*********************************************************************************************\ + * Interface +\*********************************************************************************************/ + +bool Xdrv59(uint8_t function) { + bool result = false; + + if (FUNC_PRE_INIT == function) { + // Initial persistent settings executed only once + if (!Settings->sbflag1.influxdb_default) { + Settings->sbflag1.influxdb_state = INFLUXDB_STATE; + Settings->influxdb_version = INFLUXDB_VERSION; + Settings->influxdb_port = INFLUXDB_PORT; + SettingsUpdateText(SET_INFLUXDB_HOST, PSTR(INFLUXDB_HOST)); + SettingsUpdateText(SET_INFLUXDB_ORG, PSTR(INFLUXDB_ORG)); + SettingsUpdateText(SET_INFLUXDB_TOKEN, PSTR(INFLUXDB_TOKEN)); + SettingsUpdateText(SET_INFLUXDB_BUCKET, PSTR(INFLUXDB_BUCKET)); + Settings->sbflag1.influxdb_default = 1; + } + } else if (FUNC_COMMAND == function) { + result = DecodeCommand(kInfluxDbCommands, InfluxCommand); + } else if (Settings->sbflag1.influxdb_state) { + switch (function) { + case FUNC_EVERY_SECOND: + InfluxDbLoop(); + break; + } + } + return result; +} + +#endif // USE_INFLUXDB diff --git a/tasmota/xdrv_79_esp32_ble.ino b/tasmota/xdrv_79_esp32_ble.ino index b96338f75..9f4ed2e9c 100644 --- a/tasmota/xdrv_79_esp32_ble.ino +++ b/tasmota/xdrv_79_esp32_ble.ino @@ -3123,7 +3123,7 @@ static void BLEPostMQTTSeenDevices(int type) { int remains = 0; #ifdef MQTT_DATA_STRING ResponseTime_P(PSTR("")); - String response_time = TasmotaGlobal.mqtt_data; + String response_time = ResponseData(); int maxlen = 1024; char dest[maxlen]; diff --git a/tasmota/xdrv_82_esp32_ethernet.ino b/tasmota/xdrv_82_esp32_ethernet.ino index b8bb1373b..d276ad7fd 100644 --- a/tasmota/xdrv_82_esp32_ethernet.ino +++ b/tasmota/xdrv_82_esp32_ethernet.ino @@ -100,6 +100,7 @@ void EthernetEvent(WiFiEvent_t event) { Settings->ipv4_address[1] = (uint32_t)ETH.gatewayIP(); Settings->ipv4_address[2] = (uint32_t)ETH.subnetMask(); Settings->ipv4_address[3] = (uint32_t)ETH.dnsIP(); + Settings->ipv4_address[4] = (uint32_t)ETH.dnsIP(1); TasmotaGlobal.global_state.eth_down = 0; break; case SYSTEM_EVENT_ETH_DISCONNECTED: diff --git a/tasmota/xdrv_interface.ino b/tasmota/xdrv_interface.ino index f3825e0c7..e3c637231 100644 --- a/tasmota/xdrv_interface.ino +++ b/tasmota/xdrv_interface.ino @@ -945,119 +945,119 @@ const uint8_t kXdrvList[] = { #endif #ifdef XDRV_100 - Xdrv100, + XDRV_100, #endif #ifdef XDRV_101 - Xdrv101, + XDRV_101, #endif #ifdef XDRV_102 - Xdrv102, + XDRV_102, #endif #ifdef XDRV_103 - Xdrv103, + XDRV_103, #endif #ifdef XDRV_104 - Xdrv104, + XDRV_104, #endif #ifdef XDRV_105 - Xdrv105, + XDRV_105, #endif #ifdef XDRV_106 - Xdrv106, + XDRV_106, #endif #ifdef XDRV_107 - Xdrv107, + XDRV_107, #endif #ifdef XDRV_108 - Xdrv108, + XDRV_108, #endif #ifdef XDRV_109 - Xdrv109, + XDRV_109, #endif #ifdef XDRV_110 - Xdrv110, + XDRV_110, #endif #ifdef XDRV_111 - Xdrv111, + XDRV_111, #endif #ifdef XDRV_112 - Xdrv112, + XDRV_112, #endif #ifdef XDRV_113 - Xdrv113, + XDRV_113, #endif #ifdef XDRV_114 - Xdrv114, + XDRV_114, #endif #ifdef XDRV_115 - Xdrv115, + XDRV_115, #endif #ifdef XDRV_116 - Xdrv116, + XDRV_116, #endif #ifdef XDRV_117 - Xdrv117, + XDRV_117, #endif #ifdef XDRV_118 - Xdrv118, + XDRV_118, #endif #ifdef XDRV_119 - Xdrv119, + XDRV_119, #endif #ifdef XDRV_120 - Xdrv120, + XDRV_120, #endif #ifdef XDRV_121 - Xdrv121, + XDRV_121, #endif #ifdef XDRV_122 - Xdrv122, + XDRV_122, #endif #ifdef XDRV_123 - Xdrv123, + XDRV_123, #endif #ifdef XDRV_124 - Xdrv124, + XDRV_124, #endif #ifdef XDRV_125 - Xdrv125, + XDRV_125, #endif #ifdef XDRV_126 - Xdrv126, + XDRV_126, #endif #ifdef XDRV_127 - Xdrv127, + XDRV_127, #endif #ifdef XDRV_128 - Xdrv128 + XDRV_128 #endif }; @@ -1093,13 +1093,9 @@ bool XdrvRulesProcess(bool teleperiod, const char* event) { } bool XdrvRulesProcess(bool teleperiod) { -#ifdef MQTT_DATA_STRING - bool result = XdrvRulesProcess(teleperiod, TasmotaGlobal.mqtt_data.c_str()); - ResponseClear(); + bool result = XdrvRulesProcess(teleperiod, ResponseData()); + ResponseClear(); // Free heap space return result; -#else - return XdrvRulesProcess(teleperiod, TasmotaGlobal.mqtt_data); -#endif } #ifdef USE_DEBUG_DRIVER diff --git a/tasmota/xdsp_11_sevenseg.ino b/tasmota/xdsp_11_sevenseg.ino index d3de996e1..7f200e44a 100644 --- a/tasmota/xdsp_11_sevenseg.ino +++ b/tasmota/xdsp_11_sevenseg.ino @@ -76,7 +76,7 @@ void SevensegLog(void) int16_t valueDecimal = 0; double valueFloat = 0; uint8 fDigits = 0; - String jsonStr = TasmotaGlobal.mqtt_data; // Move from stack to heap to fix watchdogs (20180626) + String jsonStr = ResponseData(); // Move from stack to heap to fix watchdogs (20180626) JsonParser parser((char*)jsonStr.c_str()); JsonParserObject object_root = parser.getRootObject(); if (object_root) { diff --git a/tasmota/xlgt_05_sonoff_l1.ino b/tasmota/xlgt_05_sonoff_l1.ino index 2cd8cb779..f120bbd79 100644 --- a/tasmota/xlgt_05_sonoff_l1.ino +++ b/tasmota/xlgt_05_sonoff_l1.ino @@ -54,7 +54,6 @@ struct SNFL1 { uint8_t dimmer; uint8_t power; uint8_t old_music_sync = 0; - uint8_t music_sync = 0; uint8_t sensitive; uint8_t speed; } Snfl1; @@ -249,10 +248,10 @@ bool SnfL1SetChannels(void) { Snfl1.color[i] = scale_col[i]; } } - if (!power_changed && !dimmer_changed && !color_changed && (Snfl1.old_music_sync == Snfl1.music_sync)) { return true; } + if (!power_changed && !dimmer_changed && !color_changed && (Snfl1.old_music_sync == Settings->sbflag1.sonoff_l1_music_sync)) { return true; } uint32_t mode = SONOFF_L1_MODE_COLORFUL; - if (Snfl1.music_sync) { + if (Settings->sbflag1.sonoff_l1_music_sync) { mode = SONOFF_L1_MODE_SYNC_TO_MUSIC; } @@ -291,7 +290,6 @@ bool SnfL1ModuleSelected(void) { Snfl1.power = !Light.power; Snfl1.dimmer = !light_state.getDimmer(); - Snfl1.music_sync = 0; Snfl1.sensitive = 5; // 1..10 Snfl1.speed = 50; // 1..100 @@ -309,13 +307,13 @@ void CmndMusicSync(void) { // Format is L1MusicSync on/off/toggle, sensitivity, speed // sensitivity 1..10, speed 1..100 if (XdrvMailbox.data_len > 0) { - Snfl1.old_music_sync = Snfl1.music_sync; + Snfl1.old_music_sync = Settings->sbflag1.sonoff_l1_music_sync; uint32_t parm[3] = { 0 }; ParseParameters(3, parm); if (2 == parm[0]) { - Snfl1.music_sync ^= 1; // Toggle + Settings->sbflag1.sonoff_l1_music_sync ^= 1; // Toggle } else { - Snfl1.music_sync = parm[0] & 1; // On or Off + Settings->sbflag1.sonoff_l1_music_sync = parm[0] & 1; // On or Off } if ((parm[1] > 0) && (parm[1] < 11)) { Snfl1.sensitive = parm[1]; // 1..10 @@ -326,7 +324,7 @@ void CmndMusicSync(void) { SnfL1SetChannels(); } Response_P(PSTR("{\"%s\":{\"Mode\":\"%s\",\"Sensitive\":%d,\"Speed\":%d}}"), - XdrvMailbox.command, GetStateText(Snfl1.music_sync), Snfl1.sensitive, Snfl1.speed); + XdrvMailbox.command, GetStateText(Settings->sbflag1.sonoff_l1_music_sync), Snfl1.sensitive, Snfl1.speed); } /*********************************************************************************************\ diff --git a/tasmota/xnrg_07_ade7953.ino b/tasmota/xnrg_07_ade7953.ino index e52b248af..4f94b25ce 100644 --- a/tasmota/xnrg_07_ade7953.ino +++ b/tasmota/xnrg_07_ade7953.ino @@ -37,17 +37,30 @@ #define ADE7953_ADDR 0x38 +// 24-bit data registers const uint16_t Ade7953Registers[] { - 0x31B, // RMS current channel B (Relay 1) - 0x313, // Active power channel B - 0x311, // Apparent power channel B - 0x315, // Reactive power channel B - 0x31A, // RMS current channel A (Relay 2) - 0x312, // Active power channel A - 0x310, // Apparent power channel A - 0x314, // Reactive power channel A - 0x31C, // RMS voltage (Both relays) - 0x10E // 16-bit unsigned period register + 0x31B, // IRMSB - RMS current channel B (Relay 1) + 0x313, // BWATT - Active power channel B + 0x311, // BVA - Apparent power channel B + 0x315, // BVAR - Reactive power channel B + 0x31A, // IRMSA - RMS current channel A (Relay 2) + 0x312, // AWATT - Active power channel A + 0x310, // AVA - Apparent power channel A + 0x314, // AVAR - Reactive power channel A + 0x31C, // VRMS - RMS voltage (Both relays) + 0x10E, // Period - 16-bit unsigned period register + 0x301 // ACCMODE - Accumulation mode +}; + +// Active power +const uint16_t APSIGN[] { + 0x800, //Bit 10 (21 bits) in ACCMODE Register for channel A (0 - positive, 1 - negative) + 0x400 //Bit 11 (21 bits) in ACCMODE Register for channel B (0 - positive, 1 - negative) +}; +// Reactive power +const uint16_t VARSIGN[] { + 0x200, //Bit 12 (21 bits) in ACCMODE Register for channel A (0 - positive, 1 - negative) + 0x100 //Bit 13 (21 bits) in ACCMODE Register for channel B (0 - positive, 1 - negative) }; struct Ade7953 { @@ -120,13 +133,16 @@ void Ade7953Init(void) void Ade7953GetData(void) { + uint32_t acc_mode; int32_t reg[2][4]; for (uint32_t i = 0; i < sizeof(Ade7953Registers)/sizeof(uint16_t); i++) { int32_t value = Ade7953Read(Ade7953Registers[i]); if (8 == i) { Ade7953.voltage_rms = value; // RMS voltage (Both relays) } else if (9 == i) { - Ade7953.period = value; // period + Ade7953.period = value; // Period + } else if (10 == i) { + acc_mode = value; // Accumulation mode } else { reg[i >> 2][i &3] = value; } @@ -166,7 +182,13 @@ void Ade7953GetData(void) for (uint32_t channel = 0; channel < 2; channel++) { Energy.data_valid[channel] = 0; Energy.active_power[channel] = (float)Ade7953.active_power[channel] / (Settings->energy_power_calibration / 10); + if ((acc_mode & APSIGN[channel]) != 0) { + Energy.active_power[channel] = Energy.active_power[channel] * -1; + } Energy.reactive_power[channel] = (float)reactive_power[channel] / (Settings->energy_power_calibration / 10); + if ((acc_mode & VARSIGN[channel]) != 0) { + Energy.reactive_power[channel] = Energy.reactive_power[channel] * -1; + } Energy.apparent_power[channel] = (float)apparent_power[channel] / (Settings->energy_power_calibration / 10); if (0 == Energy.active_power[channel]) { Energy.current[channel] = 0; diff --git a/tasmota/xsns_53_sml.ino b/tasmota/xsns_53_sml.ino index cb7fa9497..184261771 100755 --- a/tasmota/xsns_53_sml.ino +++ b/tasmota/xsns_53_sml.ino @@ -456,7 +456,7 @@ const uint8_t meter[]= //0x77,0x07,0x01,0x00,0x01,0x08,0x01,0xff "1,77070101010801ff@1000," D_TPWRIN1 ",kWh," DJ_TPWRIN1 ",2|" // Verbrauch T1 //0x77,0x07,0x01,0x00,0x01,0x07,0x00,0xff -"1,77070100010700ff@1," D_TPWRCURR ",W," DJ_TPWRCURR ",0|" // Strom Gesamt +"1,77070100010700ff@1," D_TPWRCURR ",W," DJ_TPWRCURR ",0|" // Strom Gesamt //0x77,0x07,0x01,0x00,0x01,0x07,0x00,0xff "1,77070100150700ff@1," D_TPWRCURR1 ",W," DJ_TPWRCURR1 ",0|" // Strom L1 //0x77,0x07,0x01,0x00,0x01,0x07,0x00,0xff @@ -1438,6 +1438,13 @@ void SML_Decode(uint8_t index) { continue; } + // =d must handle dindex + if (*mp == '=' && *(mp + 1) == 'd') { + if (index != mindex) { + dindex++; + } + } + if (index!=mindex) goto nextsect; // start of serial source buffer diff --git a/tasmota/xsns_62_esp32_mi_ble.ino b/tasmota/xsns_62_esp32_mi_ble.ino index 039e0fb8c..f8011351f 100644 --- a/tasmota/xsns_62_esp32_mi_ble.ino +++ b/tasmota/xsns_62_esp32_mi_ble.ino @@ -2689,11 +2689,7 @@ void MI32ShowSomeSensors(){ } ResponseAppend_P(PSTR("}")); MqttPublishPrefixTopicRulesProcess_P(TELE, PSTR(D_RSLT_SENSOR), Settings->flag.mqtt_sensor_retain); -#ifdef MQTT_DATA_STRING - //AddLog(LOG_LEVEL_DEBUG,PSTR("M32: %s: show some %d %s"),D_CMND_MI32, MI32.mqttCurrentSlot, TasmotaGlobal.mqtt_data.c_str()); -#else - //AddLog(LOG_LEVEL_DEBUG,PSTR("M32: %s: show some %d %s"),D_CMND_MI32, MI32.mqttCurrentSlot, TasmotaGlobal.mqtt_data); -#endif + //AddLog(LOG_LEVEL_DEBUG,PSTR("M32: %s: show some %d %s"),D_CMND_MI32, MI32.mqttCurrentSlot, ResponseData()); #ifdef USE_HOME_ASSISTANT if(hass_mode==2){ @@ -2746,11 +2742,7 @@ void MI32ShowOneMISensor(){ id); MqttPublish(SensorTopic); -#ifdef MQTT_DATA_STRING - //AddLog(LOG_LEVEL_DEBUG,PSTR("M32: %s: show some %d %s"),D_CMND_MI32, MI32.mqttCurrentSlot, TasmotaGlobal.mqtt_data.c_str()); -#else - //AddLog(LOG_LEVEL_DEBUG,PSTR("M32: %s: show some %d %s"),D_CMND_MI32, MI32.mqttCurrentSlot, TasmotaGlobal.mqtt_data); -#endif + //AddLog(LOG_LEVEL_DEBUG,PSTR("M32: %s: show some %d %s"),D_CMND_MI32, MI32.mqttCurrentSlot, ResponseData()); } MI32.mqttCurrentSingleSlot++; } @@ -3006,11 +2998,7 @@ void MI32DiscoveryOneMISensor(){ //vTaskDelay(100/ portTICK_PERIOD_MS); } } // end if hass discovery -#ifdef MQTT_DATA_STRING - //AddLog(LOG_LEVEL_DEBUG,PSTR("M32: %s: show some %d %s"),D_CMND_MI32, MI32.mqttCurrentSlot, TasmotaGlobal.mqtt_data.c_str()); -#else - //AddLog(LOG_LEVEL_DEBUG,PSTR("M32: %s: show some %d %s"),D_CMND_MI32, MI32.mqttCurrentSlot, TasmotaGlobal.mqtt_data); -#endif + //AddLog(LOG_LEVEL_DEBUG,PSTR("M32: %s: show some %d %s"),D_CMND_MI32, MI32.mqttCurrentSlot, ResponseData()); #endif //USE_HOME_ASSISTANT } @@ -3088,11 +3076,7 @@ void MI32ShowTriggeredSensors(){ } else { MqttPublishPrefixTopic_P(STAT, PSTR(D_RSLT_SENSOR), Settings->flag.mqtt_sensor_retain); } -#ifdef MQTT_DATA_STRING - AddLog(LOG_LEVEL_DEBUG,PSTR("M32: %s: triggered %d %s"),D_CMND_MI32, sensor, TasmotaGlobal.mqtt_data.c_str()); -#else - AddLog(LOG_LEVEL_DEBUG,PSTR("M32: %s: triggered %d %s"),D_CMND_MI32, sensor, TasmotaGlobal.mqtt_data); -#endif + AddLog(LOG_LEVEL_DEBUG,PSTR("M32: %s: triggered %d %s"),D_CMND_MI32, sensor, ResponseData()); XdrvRulesProcess(0); } else { // else don't and clear diff --git a/tasmota/xsns_75_prometheus.ino b/tasmota/xsns_75_prometheus.ino index f15c569f6..1d38f7b03 100644 --- a/tasmota/xsns_75_prometheus.ino +++ b/tasmota/xsns_75_prometheus.ino @@ -22,10 +22,13 @@ * Prometheus support * * The text format for metrics, labels and values is documented at [1]. Only - * the UTF-8 text encoding is supported. + * the UTF-8 text encoding is supported. [2] describes how metrics and labels + * should be named. * * [1] * https://github.com/prometheus/docs/blob/master/content/docs/instrumenting/exposition_formats.md + * [2] + * https://github.com/prometheus/docs/blob/master/content/docs/practices/naming.md * \*********************************************************************************************/ @@ -74,14 +77,112 @@ String FormatMetricName(const char *metric) { return formatted; } -// Labels can be any sequence of UTF-8 characters, but backslash, double-quote -// and line feed must be escaped. -String FormatLabelValue(const char *value) { - String formatted = value; - formatted.replace("\\", "\\\\"); - formatted.replace("\"", "\\\""); - formatted.replace("\n", "\\n"); - return formatted; +const uint8_t + kPromMetricGauge = _BV(0), + kPromMetricCounter = _BV(1), + kPromMetricTypeMask = kPromMetricGauge | kPromMetricCounter; + +// Format and send a Prometheus metric to the client. Use flags to configure +// the type. Labels must be supplied in tuples of two character array pointers +// and terminated by nullptr. +void WritePromMetric(const char *name, uint8_t flags, const char *value, va_list labels) { + PGM_P const prefix = PSTR("tasmota_"); + PGM_P tmp; + String lval; + + switch (flags & kPromMetricTypeMask) { + case kPromMetricGauge: + tmp = PSTR("gauge"); + break; + case kPromMetricCounter: + tmp = PSTR("counter"); + break; + default: + tmp = nullptr; + break; + } + + if (tmp != nullptr) { + WSContentSend_P(PSTR("# TYPE %s%s %s\n"), prefix, name, tmp); + } + + WSContentSend_P(PSTR("%s%s{"), prefix, name); + + for (const char *sep = PSTR(""); ; sep = PSTR(",")) { + if ((tmp = va_arg(labels, PGM_P)) == nullptr) { + break; + } + + // A few label values are stored in PROGMEM. The _P functions, e.g. + // snprintf_P, support both program and heap/stack memory with the "%s" + // format on ESP8266/ESP32. Casting the pointer to __FlashStringHelper has + // the same effect with String::operator=. + if (!(lval = va_arg(labels, const __FlashStringHelper *))) { + break; + } + + // Labels can be any sequence of UTF-8 characters, but backslash, + // double-quote and line feed must be escaped. + lval.replace("\\", "\\\\"); + lval.replace("\"", "\\\""); + lval.replace("\n", "\\n"); + + WSContentSend_P(PSTR("%s%s=\"%s\""), sep, tmp, lval.c_str()); + } + + WSContentSend_P(PSTR("} %s\n"), value); +} + +void WritePromMetricInt32(const char *name, uint8_t flags, const int32_t value, ...) { + char str[16]; + + snprintf_P(str, sizeof(str), PSTR("%d"), value); + + va_list labels; + va_start(labels, value); + WritePromMetric(name, flags, str, labels); + va_end(labels); +} + +void WritePromMetricDec(const char *name, uint8_t flags, double number, unsigned char prec, ...) { + char value[FLOATSZ]; + + // Prometheus always requires "." as the decimal separator. + dtostrfd(number, prec, value); + + va_list labels; + va_start(labels, prec); + WritePromMetric(name, flags, value, labels); + va_end(labels); +} + +void WritePromMetricStr(const char *name, uint8_t flags, const char *value, ...) { + va_list labels; + va_start(labels, value); + WritePromMetric(name, flags, value, labels); + va_end(labels); +} + +// Sentinel value for unknown memory metrics, chosen to unlikely match actual +// values. +const uint32_t kPromMemoryUnknown = 0xFFFFFFFF - 1; + +// Write metrics providing information about used and available memory. +void WritePromMemoryMetrics(const char *type, uint32_t size, uint32_t avail, uint32_t max_alloc) { + if (size != kPromMemoryUnknown) { + WritePromMetricInt32(PSTR("memory_size_bytes"), kPromMetricGauge, size, + PSTR("memory"), type, nullptr); + } + + WritePromMetricInt32(PSTR("memory_free_bytes"), kPromMetricGauge, avail, + PSTR("memory"), type, nullptr); + + if (max_alloc != kPromMemoryUnknown) { + // The largest contiguous free memory block, useful for checking + // fragmentation. + WritePromMetricInt32(PSTR("memory_max_alloc_bytes"), kPromMetricGauge, max_alloc, + PSTR("memory"), type, nullptr); + } } void HandleMetrics(void) { @@ -91,68 +192,98 @@ void HandleMetrics(void) { WSContentBegin(200, CT_PLAIN); - char parameter[FLOATSZ]; + char namebuf[64]; // Pseudo-metric providing metadata about the running firmware version. - WSContentSend_P(PSTR("# TYPE tasmota_info gauge\ntasmota_info{version=\"%s\",image=\"%s\",build_timestamp=\"%s\",devicename=\"%s\"} 1\n"), - TasmotaGlobal.version, TasmotaGlobal.image_name, GetBuildDateAndTime().c_str(), FormatLabelValue(SettingsText(SET_DEVICENAME)).c_str()); - WSContentSend_P(PSTR("# TYPE tasmota_uptime_seconds gauge\ntasmota_uptime_seconds %d\n"), TasmotaGlobal.uptime); - WSContentSend_P(PSTR("# TYPE tasmota_boot_count counter\ntasmota_boot_count %d\n"), Settings->bootcount); - WSContentSend_P(PSTR("# TYPE tasmota_flash_writes_total counter\ntasmota_flash_writes_total %d\n"), Settings->save_flag); + WritePromMetricInt32(PSTR("info"), kPromMetricGauge, 1, + PSTR("version"), TasmotaGlobal.version, + PSTR("image"), TasmotaGlobal.image_name, + PSTR("build_timestamp"), GetBuildDateAndTime().c_str(), + PSTR("devicename"), SettingsText(SET_DEVICENAME), + nullptr); + WritePromMetricInt32(PSTR("uptime_seconds"), kPromMetricGauge, TasmotaGlobal.uptime, nullptr); + WritePromMetricInt32(PSTR("boot_count"), kPromMetricCounter, Settings->bootcount, nullptr); + WritePromMetricInt32(PSTR("flash_writes_total"), kPromMetricCounter, Settings->save_flag, nullptr); // Pseudo-metric providing metadata about the WiFi station. - WSContentSend_P(PSTR("# TYPE tasmota_wifi_station_info gauge\ntasmota_wifi_station_info{bssid=\"%s\",ssid=\"%s\"} 1\n"), WiFi.BSSIDstr().c_str(), WiFi.SSID().c_str()); + WritePromMetricInt32(PSTR("wifi_station_info"), kPromMetricGauge, 1, + PSTR("bssid"), WiFi.BSSIDstr().c_str(), + PSTR("ssid"), WiFi.SSID().c_str(), + nullptr); // Wi-Fi Signal strength - WSContentSend_P(PSTR("# TYPE tasmota_wifi_station_signal_dbm gauge\ntasmota_wifi_station_signal_dbm{mac_address=\"%s\"} %d\n"), WiFi.BSSIDstr().c_str(), WiFi.RSSI()); + WritePromMetricInt32(PSTR("wifi_station_signal_dbm"), kPromMetricGauge, WiFi.RSSI(), + PSTR("mac_address"), WiFi.BSSIDstr().c_str(), + nullptr); if (!isnan(TasmotaGlobal.temperature_celsius)) { - dtostrfd(TasmotaGlobal.temperature_celsius, Settings->flag2.temperature_resolution, parameter); - WSContentSend_P(PSTR("# TYPE tasmota_global_temperature_celsius gauge\ntasmota_global_temperature_celsius %s\n"), parameter); - } - if (TasmotaGlobal.humidity != 0) { - dtostrfd(TasmotaGlobal.humidity, Settings->flag2.humidity_resolution, parameter); - WSContentSend_P(PSTR("# TYPE tasmota_global_humidity gauge\ntasmota_global_humidity_percentage %s\n"), parameter); - } - if (TasmotaGlobal.pressure_hpa != 0) { - dtostrfd(TasmotaGlobal.pressure_hpa, Settings->flag2.pressure_resolution, parameter); - WSContentSend_P(PSTR("# TYPE tasmota_global_pressure_hpa gauge\ntasmota_global_pressure_hpa %s\n"), parameter); + WritePromMetricDec(PSTR("global_temperature_celsius"), kPromMetricGauge, + TasmotaGlobal.temperature_celsius, Settings->flag2.temperature_resolution, + nullptr); } - // Pseudo-metric providing metadata about the free memory. - #ifdef ESP32 - int32_t freeMaxMem = 100 - (int32_t)(ESP_getMaxAllocHeap() * 100 / ESP_getFreeHeap()); - WSContentSend_PD(PSTR("# TYPE tasmota_memory_bytes gauge\ntasmota_memory_bytes{memory=\"Ram\"} %d\n"), ESP_getFreeHeap()); - WSContentSend_PD(PSTR("# TYPE tasmota_memory_ratio gauge\ntasmota_memory_ratio{memory=\"Fragmentation\"} %d)"), freeMaxMem / 100); - if (UsePSRAM()) { - WSContentSend_P(PSTR("# TYPE tasmota_memory_bytes gauge\ntasmota_memory_bytes{memory=\"Psram\"} %d\n"), ESP.getFreePsram() ); - } - #else // ESP32 - WSContentSend_PD(PSTR("# TYPE tasmota_memory_bytes gauge\ntasmota_memory_bytes{memory=\"ram\"} %d\n"), ESP_getFreeHeap()); - #endif // ESP32 + if (TasmotaGlobal.humidity != 0) { + WritePromMetricDec(PSTR("global_humidity_percentage"), kPromMetricGauge, + TasmotaGlobal.humidity, Settings->flag2.humidity_resolution, + nullptr); + } + + if (TasmotaGlobal.pressure_hpa != 0) { + WritePromMetricDec(PSTR("global_pressure_hpa"), kPromMetricGauge, + TasmotaGlobal.pressure_hpa, Settings->flag2.pressure_resolution, + nullptr); + } + + WritePromMemoryMetrics(PSTR("heap"), +#ifdef ESP32 + ESP.getHeapSize(), +#else + kPromMemoryUnknown, +#endif + ESP_getFreeHeap(), +#ifdef ESP32 + ESP_getMaxAllocHeap() +#else + kPromMemoryUnknown +#endif + ); + +#ifdef ESP32 + if (UsePSRAM()) { + WritePromMemoryMetrics(PSTR("psram"), ESP.getPsramSize(), + ESP.getFreePsram(), ESP.getMaxAllocPsram()); + } +#endif #ifdef USE_ENERGY_SENSOR - dtostrfd(Energy.voltage[0], Settings->flag2.voltage_resolution, parameter); - WSContentSend_P(PSTR("# TYPE energy_voltage_volts gauge\nenergy_voltage_volts %s\n"), parameter); - dtostrfd(Energy.current[0], Settings->flag2.current_resolution, parameter); - WSContentSend_P(PSTR("# TYPE energy_current_amperes gauge\nenergy_current_amperes %s\n"), parameter); - dtostrfd(Energy.active_power[0], Settings->flag2.wattage_resolution, parameter); - WSContentSend_P(PSTR("# TYPE energy_power_active_watts gauge\nenergy_power_active_watts %s\n"), parameter); - dtostrfd(Energy.daily, Settings->flag2.energy_resolution, parameter); - WSContentSend_P(PSTR("# TYPE energy_power_kilowatts_daily counter\nenergy_power_kilowatts_daily %s\n"), parameter); - dtostrfd(Energy.total, Settings->flag2.energy_resolution, parameter); - WSContentSend_P(PSTR("# TYPE energy_power_kilowatts_total counter\nenergy_power_kilowatts_total %s\n"), parameter); + WritePromMetricDec(PSTR("energy_voltage_volts"), + kPromMetricGauge, + Energy.voltage[0], Settings->flag2.voltage_resolution, nullptr); + WritePromMetricDec(PSTR("energy_current_amperes"), + kPromMetricGauge, + Energy.current[0], Settings->flag2.current_resolution, nullptr); + WritePromMetricDec(PSTR("energy_power_active_watts"), + kPromMetricGauge, + Energy.active_power[0], Settings->flag2.wattage_resolution, nullptr); + WritePromMetricDec(PSTR("energy_power_kilowatts_daily"), + kPromMetricCounter, + Energy.daily, Settings->flag2.energy_resolution, nullptr); + WritePromMetricDec(PSTR("energy_power_kilowatts_total"), + kPromMetricCounter, + Energy.total, Settings->flag2.energy_resolution, nullptr); #endif for (uint32_t device = 0; device < TasmotaGlobal.devices_present; device++) { power_t mask = 1 << device; - WSContentSend_P(PSTR("# TYPE relay%d_state gauge\nrelay%d_state %d\n"), device+1, device+1, (TasmotaGlobal.power & mask)); + snprintf_P(namebuf, sizeof(namebuf), PSTR("relay%d_state"), device + 1); + WritePromMetricInt32(namebuf, kPromMetricGauge, + (TasmotaGlobal.power & mask), nullptr); } ResponseClear(); MqttShowSensor(); //Pull sensor data - String jsonStr = TasmotaGlobal.mqtt_data; + String jsonStr = ResponseData(); JsonParser parser((char *)jsonStr.c_str()); JsonParserObject root = parser.getRootObject(); if (root) { // did JSON parsing succeed? @@ -169,9 +300,12 @@ void HandleMetrics(void) { if (value != nullptr && isdigit(value[0])) { String sensor = FormatMetricName(key2.getStr()); String type = FormatMetricName(key3.getStr()); - const char *unit = UnitfromType(type.c_str()); //grab base unit corresponding to type - WSContentSend_P(PSTR("# TYPE tasmota_sensors_%s_%s gauge\ntasmota_sensors_%s_%s{sensor=\"%s\"} %s\n"), - type.c_str(), unit, type.c_str(), unit, sensor.c_str(), value); //build metric as "# TYPE tasmota_sensors_%type%_%unit% gauge\ntasmotasensors_%type%_%unit%{sensor=%sensor%"} %value%"" + + snprintf_P(namebuf, sizeof(namebuf), PSTR("sensors_%s_%s"), + type.c_str(), UnitfromType(type.c_str())); + WritePromMetricStr(namebuf, kPromMetricGauge, value, + PSTR("sensor"), sensor.c_str(), + nullptr); } } } else { @@ -179,14 +313,19 @@ void HandleMetrics(void) { if (value != nullptr && isdigit(value[0])) { String sensor = FormatMetricName(key1.getStr()); String type = FormatMetricName(key2.getStr()); - const char *unit = UnitfromType(type.c_str()); if (strcmp(type.c_str(), "totalstarttime") != 0) { // this metric causes Prometheus of fail + snprintf_P(namebuf, sizeof(namebuf), PSTR("sensors_%s_%s"), + type.c_str(), UnitfromType(type.c_str())); + if (strcmp(type.c_str(), "id") == 0) { // this metric is NaN, so convert it to a label, see Wi-Fi metrics above - WSContentSend_P(PSTR("# TYPE tasmota_sensors_%s_%s gauge\ntasmota_sensors_%s_%s{sensor=\"%s\",id=\"%s\"} 1\n"), - type.c_str(), unit, type.c_str(), unit, sensor.c_str(), value); + WritePromMetricInt32(namebuf, kPromMetricGauge, 1, + PSTR("sensor"), sensor.c_str(), + PSTR("id"), value, + nullptr); } else { - WSContentSend_P(PSTR("# TYPE tasmota_sensors_%s_%s gauge\ntasmota_sensors_%s_%s{sensor=\"%s\"} %s\n"), - type.c_str(), unit, type.c_str(), unit, sensor.c_str(), value); + WritePromMetricStr(namebuf, kPromMetricGauge, value, + PSTR("sensor"), sensor.c_str(), + nullptr); } } } @@ -195,8 +334,11 @@ void HandleMetrics(void) { } else { const char *value = value1.getStr(nullptr); String sensor = FormatMetricName(key1.getStr()); + if (value != nullptr && isdigit(value[0] && strcmp(sensor.c_str(), "time") != 0)) { //remove false 'time' metric - WSContentSend_P(PSTR("# TYPE tasmota_sensors_%s gauge\ntasmota_sensors{sensor=\"%s\"} %s\n"), sensor.c_str(), sensor.c_str(), value); + WritePromMetricStr(PSTR("sensors"), kPromMetricGauge, value, + PSTR("sensor"), sensor.c_str(), + nullptr); } } } diff --git a/tasmota/xsns_83_neopool.ino b/tasmota/xsns_83_neopool.ino index 395c9c1db..f2956e284 100644 --- a/tasmota/xsns_83_neopool.ino +++ b/tasmota/xsns_83_neopool.ino @@ -599,6 +599,18 @@ enum NeoPoolModbusCode { NEOPOOL_MODBUS_ERROR_DEADLOCK }; +// NeoPool value resolutions +typedef struct { + uint16_t ph : 2; + uint16_t cl : 2; + uint16_t ion : 2; +} NeoPoolResMBitfield; +NeoPoolResMBitfield neopool_resolution { + .ph = 1, + .cl = 1, + .ion = 1 +}; + #define D_NEOPOOL_NAME "NeoPool" @@ -651,11 +663,11 @@ const char kNeoPoolpHAlarms[] PROGMEM = #define D_STR_BIT "Bit" #endif // D_STR_BIT -#define NEOPOOL_FMT_PH "%1_f" -#define NEOPOOL_FMT_RX "%0_f" -#define NEOPOOL_FMT_CL "%1_f" +#define NEOPOOL_FMT_PH "%*_f" +#define NEOPOOL_FMT_RX "%d" +#define NEOPOOL_FMT_CL "%*_f" #define NEOPOOL_FMT_CD "%d" -#define NEOPOOL_FMT_ION "%1_f" +#define NEOPOOL_FMT_ION "%*_f" #define NEOPOOL_FMT_HIDRO "%*_f" #define D_NEOPOOL_UNIT_GPERH "g/h" @@ -697,7 +709,7 @@ const char HTTP_SNS_NEOPOOL_STATUS_ACTIVE[] PROGMEM = "filter:invert(1)"; * any other value of