diff --git a/.github/workflows/Tasmota_build_devel.yml b/.github/workflows/Tasmota_build_devel.yml index fe3f995d1..2bfc5d806 100644 --- a/.github/workflows/Tasmota_build_devel.yml +++ b/.github/workflows/Tasmota_build_devel.yml @@ -9,1318 +9,74 @@ on: - '**.md' # Do no build if *.md files changes jobs: - - tasmota: - runs-on: ubuntu-latest - continue-on-error: true - steps: - - uses: actions/checkout@v2 - - name: Set up Python - uses: actions/setup-python@v1 - - name: Install dependencies - run: | - pip install -U platformio - - name: Run PlatformIO - run: | - platformio run -e tasmota - - uses: actions/upload-artifact@v2 - with: - name: firmware - path: ./build_output - - - tasmota-minimal: - runs-on: ubuntu-latest - continue-on-error: true - steps: - - uses: actions/checkout@v2 - - name: Set up Python - uses: actions/setup-python@v1 - - name: Install dependencies - run: | - pip install -U platformio - - name: Run PlatformIO - run: | - platformio run -e tasmota-minimal - - uses: actions/upload-artifact@v2 - with: - name: firmware - path: ./build_output - - - tasmota-lite: - runs-on: ubuntu-latest - continue-on-error: true - steps: - - uses: actions/checkout@v2 - - name: Set up Python - uses: actions/setup-python@v1 - - name: Install dependencies - run: | - pip install -U platformio - - name: Run PlatformIO - run: | - platformio run -e tasmota-lite - - uses: actions/upload-artifact@v2 - with: - name: firmware - path: ./build_output - - - tasmota-knx: - runs-on: ubuntu-latest - continue-on-error: true - steps: - - uses: actions/checkout@v2 - - name: Set up Python - uses: actions/setup-python@v1 - - name: Install dependencies - run: | - pip install -U platformio - - name: Run PlatformIO - run: | - platformio run -e tasmota-knx - - uses: actions/upload-artifact@v2 - with: - name: firmware - path: ./build_output - - - tasmota-sensors: - runs-on: ubuntu-latest - continue-on-error: true - steps: - - uses: actions/checkout@v2 - - name: Set up Python - uses: actions/setup-python@v1 - - name: Install dependencies - run: | - pip install -U platformio - - name: Run PlatformIO - run: | - platformio run -e tasmota-sensors - - uses: actions/upload-artifact@v2 - with: - name: firmware - path: ./build_output - - - tasmota-display: - runs-on: ubuntu-latest - continue-on-error: true - steps: - - uses: actions/checkout@v2 - - name: Set up Python - uses: actions/setup-python@v1 - - name: Install dependencies - run: | - pip install -U platformio - - name: Run PlatformIO - run: | - platformio run -e tasmota-display - - uses: actions/upload-artifact@v2 - with: - name: firmware - path: ./build_output - - - tasmota-ir: - runs-on: ubuntu-latest - continue-on-error: true - steps: - - uses: actions/checkout@v2 - - name: Set up Python - uses: actions/setup-python@v1 - - name: Install dependencies - run: | - pip install -U platformio - - name: Run PlatformIO - run: | - platformio run -e tasmota-ir - - uses: actions/upload-artifact@v2 - with: - name: firmware - path: ./build_output - - - tasmota-zbbridge: - runs-on: ubuntu-latest - continue-on-error: true - steps: - - uses: actions/checkout@v2 - - name: Set up Python - uses: actions/setup-python@v1 - - name: Install dependencies - run: | - pip install -U platformio - - name: Run PlatformIO - run: | - platformio run -e tasmota-zbbridge - - uses: actions/upload-artifact@v2 - with: - name: firmware - path: ./build_output - - - tasmota-zigbee: - runs-on: ubuntu-latest - continue-on-error: true - steps: - - uses: actions/checkout@v2 - - name: Set up Python - uses: actions/setup-python@v1 - - name: Install dependencies - run: | - pip install -U platformio - - name: Run PlatformIO - run: | - platformio run -e tasmota-zigbee - - uses: actions/upload-artifact@v2 - with: - name: firmware - path: ./build_output - - - tasmota-AF: - runs-on: ubuntu-latest - continue-on-error: true - steps: - - uses: actions/checkout@v2 - - name: Set up Python - uses: actions/setup-python@v1 - - name: Install dependencies - run: | - pip install -U platformio - - name: Run PlatformIO - run: | - platformio run -e tasmota-AF - - uses: actions/upload-artifact@v2 - with: - name: firmware - path: ./build_output - - - tasmota-BG: - runs-on: ubuntu-latest - continue-on-error: true - steps: - - uses: actions/checkout@v2 - - name: Set up Python - uses: actions/setup-python@v1 - - name: Install dependencies - run: | - pip install -U platformio - - name: Run PlatformIO - run: | - platformio run -e tasmota-BG - - uses: actions/upload-artifact@v2 - with: - name: firmware - path: ./build_output - - - tasmota-BR: - runs-on: ubuntu-latest - continue-on-error: true - steps: - - uses: actions/checkout@v2 - - name: Set up Python - uses: actions/setup-python@v1 - - name: Install dependencies - run: | - pip install -U platformio - - name: Run PlatformIO - run: | - platformio run -e tasmota-BR - - uses: actions/upload-artifact@v2 - with: - name: firmware - path: ./build_output - - - tasmota-CN: - runs-on: ubuntu-latest - continue-on-error: true - steps: - - uses: actions/checkout@v2 - - name: Set up Python - uses: actions/setup-python@v1 - - name: Install dependencies - run: | - pip install -U platformio - - name: Run PlatformIO - run: | - platformio run -e tasmota-CN - - uses: actions/upload-artifact@v2 - with: - name: firmware - path: ./build_output - - - tasmota-CZ: - runs-on: ubuntu-latest - continue-on-error: true - steps: - - uses: actions/checkout@v2 - - name: Set up Python - uses: actions/setup-python@v1 - - name: Install dependencies - run: | - pip install -U platformio - - name: Run PlatformIO - run: | - platformio run -e tasmota-CZ - - uses: actions/upload-artifact@v2 - with: - name: firmware - path: ./build_output - - - tasmota-DE: - runs-on: ubuntu-latest - continue-on-error: true - steps: - - uses: actions/checkout@v2 - - name: Set up Python - uses: actions/setup-python@v1 - - name: Install dependencies - run: | - pip install -U platformio - - name: Run PlatformIO - run: | - platformio run -e tasmota-DE - - uses: actions/upload-artifact@v2 - with: - name: firmware - path: ./build_output - - - tasmota-ES: - runs-on: ubuntu-latest - continue-on-error: true - steps: - - uses: actions/checkout@v2 - - name: Set up Python - uses: actions/setup-python@v1 - - name: Install dependencies - run: | - pip install -U platformio - - name: Run PlatformIO - run: | - platformio run -e tasmota-ES - - uses: actions/upload-artifact@v2 - with: - name: firmware - path: ./build_output - - - tasmota-FR: - runs-on: ubuntu-latest - continue-on-error: true - steps: - - uses: actions/checkout@v2 - - name: Set up Python - uses: actions/setup-python@v1 - - name: Install dependencies - run: | - pip install -U platformio - - name: Run PlatformIO - run: | - platformio run -e tasmota-FR - - uses: actions/upload-artifact@v2 - with: - name: firmware - path: ./build_output - - - tasmota-FY: - runs-on: ubuntu-latest - continue-on-error: true - steps: - - uses: actions/checkout@v2 - - name: Set up Python - uses: actions/setup-python@v1 - - name: Install dependencies - run: | - pip install -U platformio - - name: Run PlatformIO - run: | - platformio run -e tasmota-FY - - uses: actions/upload-artifact@v2 - with: - name: firmware - path: ./build_output - - - tasmota-GR: - runs-on: ubuntu-latest - continue-on-error: true - steps: - - uses: actions/checkout@v2 - - name: Set up Python - uses: actions/setup-python@v1 - - name: Install dependencies - run: | - pip install -U platformio - - name: Run PlatformIO - run: | - platformio run -e tasmota-GR - - uses: actions/upload-artifact@v2 - with: - name: firmware - path: ./build_output - - - tasmota-HE: - runs-on: ubuntu-latest - continue-on-error: true - steps: - - uses: actions/checkout@v2 - - name: Set up Python - uses: actions/setup-python@v1 - - name: Install dependencies - run: | - pip install -U platformio - - name: Run PlatformIO - run: | - platformio run -e tasmota-HE - - uses: actions/upload-artifact@v2 - with: - name: firmware - path: ./build_output - - - tasmota-HU: - runs-on: ubuntu-latest - continue-on-error: true - steps: - - uses: actions/checkout@v2 - - name: Set up Python - uses: actions/setup-python@v1 - - name: Install dependencies - run: | - pip install -U platformio - - name: Run PlatformIO - run: | - platformio run -e tasmota-HU - - uses: actions/upload-artifact@v2 - with: - name: firmware - path: ./build_output - - - tasmota-IT: - runs-on: ubuntu-latest - continue-on-error: true - steps: - - uses: actions/checkout@v2 - - name: Set up Python - uses: actions/setup-python@v1 - - name: Install dependencies - run: | - pip install -U platformio - - name: Run PlatformIO - run: | - platformio run -e tasmota-IT - - uses: actions/upload-artifact@v2 - with: - name: firmware - path: ./build_output - - - tasmota-KO: - runs-on: ubuntu-latest - continue-on-error: true - steps: - - uses: actions/checkout@v2 - - name: Set up Python - uses: actions/setup-python@v1 - - name: Install dependencies - run: | - pip install -U platformio - - name: Run PlatformIO - run: | - platformio run -e tasmota-KO - - uses: actions/upload-artifact@v2 - with: - name: firmware - path: ./build_output - - - tasmota-NL: - runs-on: ubuntu-latest - continue-on-error: true - steps: - - uses: actions/checkout@v2 - - name: Set up Python - uses: actions/setup-python@v1 - - name: Install dependencies - run: | - pip install -U platformio - - name: Run PlatformIO - run: | - platformio run -e tasmota-NL - - uses: actions/upload-artifact@v2 - with: - name: firmware - path: ./build_output - - - tasmota-PL: - runs-on: ubuntu-latest - continue-on-error: true - steps: - - uses: actions/checkout@v2 - - name: Set up Python - uses: actions/setup-python@v1 - - name: Install dependencies - run: | - pip install -U platformio - - name: Run PlatformIO - run: | - platformio run -e tasmota-PL - - uses: actions/upload-artifact@v2 - with: - name: firmware - path: ./build_output - - - tasmota-PT: - runs-on: ubuntu-latest - continue-on-error: true - steps: - - uses: actions/checkout@v2 - - name: Set up Python - uses: actions/setup-python@v1 - - name: Install dependencies - run: | - pip install -U platformio - - name: Run PlatformIO - run: | - platformio run -e tasmota-PT - - uses: actions/upload-artifact@v2 - with: - name: firmware - path: ./build_output - - - tasmota-RO: - runs-on: ubuntu-latest - continue-on-error: true - steps: - - uses: actions/checkout@v2 - - name: Set up Python - uses: actions/setup-python@v1 - - name: Install dependencies - run: | - pip install -U platformio - - name: Run PlatformIO - run: | - platformio run -e tasmota-RO - - uses: actions/upload-artifact@v2 - with: - name: firmware - path: ./build_output - - - tasmota-RU: - runs-on: ubuntu-latest - continue-on-error: true - steps: - - uses: actions/checkout@v2 - - name: Set up Python - uses: actions/setup-python@v1 - - name: Install dependencies - run: | - pip install -U platformio - - name: Run PlatformIO - run: | - platformio run -e tasmota-RU - - uses: actions/upload-artifact@v2 - with: - name: firmware - path: ./build_output - - - tasmota-SE: - runs-on: ubuntu-latest - continue-on-error: true - steps: - - uses: actions/checkout@v2 - - name: Set up Python - uses: actions/setup-python@v1 - - name: Install dependencies - run: | - pip install -U platformio - - name: Run PlatformIO - run: | - platformio run -e tasmota-SE - - uses: actions/upload-artifact@v2 - with: - name: firmware - path: ./build_output - - - tasmota-SK: - runs-on: ubuntu-latest - continue-on-error: true - steps: - - uses: actions/checkout@v2 - - name: Set up Python - uses: actions/setup-python@v1 - - name: Install dependencies - run: | - pip install -U platformio - - name: Run PlatformIO - run: | - platformio run -e tasmota-SK - - uses: actions/upload-artifact@v2 - with: - name: firmware - path: ./build_output - - - tasmota-TR: - runs-on: ubuntu-latest - continue-on-error: true - steps: - - uses: actions/checkout@v2 - - name: Set up Python - uses: actions/setup-python@v1 - - name: Install dependencies - run: | - pip install -U platformio - - name: Run PlatformIO - run: | - platformio run -e tasmota-TR - - uses: actions/upload-artifact@v2 - with: - name: firmware - path: ./build_output - - - tasmota-TW: - runs-on: ubuntu-latest - continue-on-error: true - steps: - - uses: actions/checkout@v2 - - name: Set up Python - uses: actions/setup-python@v1 - - name: Install dependencies - run: | - pip install -U platformio - - name: Run PlatformIO - run: | - platformio run -e tasmota-TW - - uses: actions/upload-artifact@v2 - with: - name: firmware - path: ./build_output - - - tasmota-UK: - runs-on: ubuntu-latest - continue-on-error: true - steps: - - uses: actions/checkout@v2 - - name: Set up Python - uses: actions/setup-python@v1 - - name: Install dependencies - run: | - pip install -U platformio - - name: Run PlatformIO - run: | - platformio run -e tasmota-UK - - uses: actions/upload-artifact@v2 - with: - name: firmware - path: ./build_output - - - tasmota-VN: - runs-on: ubuntu-latest - continue-on-error: true - steps: - - uses: actions/checkout@v2 - - name: Set up Python - uses: actions/setup-python@v1 - - name: Install dependencies - run: | - pip install -U platformio - - name: Run PlatformIO - run: | - platformio run -e tasmota-VN - - uses: actions/upload-artifact@v2 - with: - name: firmware - path: ./build_output - - - tasmota32: - runs-on: ubuntu-latest - continue-on-error: true - steps: - - uses: actions/checkout@v2 - - name: Set up Python - uses: actions/setup-python@v1 - - name: Install dependencies - run: | - pip install -U platformio - - name: Run PlatformIO - run: | - platformio run -e tasmota32 - - uses: actions/upload-artifact@v2 - with: - name: firmware - path: ./build_output - - - tasmota32solo1: - runs-on: ubuntu-latest - continue-on-error: true - steps: - - uses: actions/checkout@v2 - - name: Set up Python - uses: actions/setup-python@v1 - - name: Install dependencies - run: | - pip install -U platformio - - name: Run PlatformIO - run: | - platformio run -e tasmota32solo1 - - uses: actions/upload-artifact@v2 - with: - name: firmware - path: ./build_output - - - tasmota32-webcam: - runs-on: ubuntu-latest - continue-on-error: true - steps: - - uses: actions/checkout@v2 - - name: Set up Python - uses: actions/setup-python@v1 - - name: Install dependencies - run: | - pip install -U platformio - - name: Run PlatformIO - run: | - platformio run -e tasmota32-webcam - - uses: actions/upload-artifact@v2 - with: - name: firmware - path: ./build_output - - - tasmota32-odroidgo: - runs-on: ubuntu-latest - continue-on-error: true - steps: - - uses: actions/checkout@v2 - - name: Set up Python - uses: actions/setup-python@v1 - - name: Install dependencies - run: | - pip install -U platformio - - name: Run PlatformIO - run: | - platformio run -e tasmota32-odroidgo - - uses: actions/upload-artifact@v2 - with: - name: firmware - path: ./build_output - - - tasmota32-core2: - runs-on: ubuntu-latest - continue-on-error: true - steps: - - uses: actions/checkout@v2 - - name: Set up Python - uses: actions/setup-python@v1 - - name: Install dependencies - run: | - pip install -U platformio - - name: Run PlatformIO - run: | - platformio run -e tasmota32-core2 - - uses: actions/upload-artifact@v2 - with: - name: firmware - path: ./build_output - - - tasmota32-bluetooth: - runs-on: ubuntu-latest - continue-on-error: true - steps: - - uses: actions/checkout@v2 - - name: Set up Python - uses: actions/setup-python@v1 - - name: Install dependencies - run: | - pip install -U platformio - - name: Run PlatformIO - run: | - platformio run -e tasmota32-bluetooth - - uses: actions/upload-artifact@v2 - with: - name: firmware - path: ./build_output - - - tasmota32-display: - runs-on: ubuntu-latest - continue-on-error: true - steps: - - uses: actions/checkout@v2 - - name: Set up Python - uses: actions/setup-python@v1 - - name: Install dependencies - run: | - pip install -U platformio - - name: Run PlatformIO - run: | - platformio run -e tasmota32-display - - uses: actions/upload-artifact@v2 - with: - name: firmware - path: ./build_output - - - tasmota32-lvgl: - runs-on: ubuntu-latest - continue-on-error: true - steps: - - uses: actions/checkout@v2 - - name: Set up Python - uses: actions/setup-python@v1 - - name: Install dependencies - run: | - pip install -U platformio - - name: Run PlatformIO - run: | - platformio run -e tasmota32-lvgl - - uses: actions/upload-artifact@v2 - with: - name: firmware - path: ./build_output - - - tasmota32-ir: - runs-on: ubuntu-latest - continue-on-error: true - steps: - - uses: actions/checkout@v2 - - name: Set up Python - uses: actions/setup-python@v1 - - name: Install dependencies - run: | - pip install -U platformio - - name: Run PlatformIO - run: | - platformio run -e tasmota32-ir - - uses: actions/upload-artifact@v2 - with: - name: firmware - path: ./build_output - - tasmota32c3: - runs-on: ubuntu-latest - continue-on-error: true - steps: - - uses: actions/checkout@v2 - - name: Set up Python - uses: actions/setup-python@v1 - - name: Install dependencies - run: | - pip install -U platformio - - name: Run PlatformIO - run: | - platformio run -e tasmota32c3 - - uses: actions/upload-artifact@v2 - with: - name: firmware - path: ./build_output - - tasmota32-AF: - runs-on: ubuntu-latest - continue-on-error: true - steps: - - uses: actions/checkout@v2 - - name: Set up Python - uses: actions/setup-python@v1 - - name: Install dependencies - run: | - pip install -U platformio - - name: Run PlatformIO - run: | - platformio run -e tasmota32-AF - - uses: actions/upload-artifact@v2 - with: - name: firmware - path: ./build_output - - - tasmota32-BG: - runs-on: ubuntu-latest - continue-on-error: true - steps: - - uses: actions/checkout@v2 - - name: Set up Python - uses: actions/setup-python@v1 - - name: Install dependencies - run: | - pip install -U platformio - - name: Run PlatformIO - run: | - platformio run -e tasmota32-BG - - uses: actions/upload-artifact@v2 - with: - name: firmware - path: ./build_output - - - tasmota32-BR: - runs-on: ubuntu-latest - continue-on-error: true - steps: - - uses: actions/checkout@v2 - - name: Set up Python - uses: actions/setup-python@v1 - - name: Install dependencies - run: | - pip install -U platformio - - name: Run PlatformIO - run: | - platformio run -e tasmota32-BR - - uses: actions/upload-artifact@v2 - with: - name: firmware - path: ./build_output - - - tasmota32-CN: - runs-on: ubuntu-latest - continue-on-error: true - steps: - - uses: actions/checkout@v2 - - name: Set up Python - uses: actions/setup-python@v1 - - name: Install dependencies - run: | - pip install -U platformio - - name: Run PlatformIO - run: | - platformio run -e tasmota32-CN - - uses: actions/upload-artifact@v2 - with: - name: firmware - path: ./build_output - - - tasmota32-CZ: - runs-on: ubuntu-latest - continue-on-error: true - steps: - - uses: actions/checkout@v2 - - name: Set up Python - uses: actions/setup-python@v1 - - name: Install dependencies - run: | - pip install -U platformio - - name: Run PlatformIO - run: | - platformio run -e tasmota32-CZ - - uses: actions/upload-artifact@v2 - with: - name: firmware - path: ./build_output - - - tasmota32-DE: - runs-on: ubuntu-latest - continue-on-error: true - steps: - - uses: actions/checkout@v2 - - name: Set up Python - uses: actions/setup-python@v1 - - name: Install dependencies - run: | - pip install -U platformio - - name: Run PlatformIO - run: | - platformio run -e tasmota32-DE - - uses: actions/upload-artifact@v2 - with: - name: firmware - path: ./build_output - - - tasmota32-ES: - runs-on: ubuntu-latest - continue-on-error: true - steps: - - uses: actions/checkout@v2 - - name: Set up Python - uses: actions/setup-python@v1 - - name: Install dependencies - run: | - pip install -U platformio - - name: Run PlatformIO - run: | - platformio run -e tasmota32-ES - - uses: actions/upload-artifact@v2 - with: - name: firmware - path: ./build_output - - - tasmota32-FR: - runs-on: ubuntu-latest - continue-on-error: true - steps: - - uses: actions/checkout@v2 - - name: Set up Python - uses: actions/setup-python@v1 - - name: Install dependencies - run: | - pip install -U platformio - - name: Run PlatformIO - run: | - platformio run -e tasmota32-FR - - uses: actions/upload-artifact@v2 - with: - name: firmware - path: ./build_output - - - tasmota32-FY: - runs-on: ubuntu-latest - continue-on-error: true - steps: - - uses: actions/checkout@v2 - - name: Set up Python - uses: actions/setup-python@v1 - - name: Install dependencies - run: | - pip install -U platformio - - name: Run PlatformIO - run: | - platformio run -e tasmota32-FY - - uses: actions/upload-artifact@v2 - with: - name: firmware - path: ./build_output - - - tasmota32-GR: - runs-on: ubuntu-latest - continue-on-error: true - steps: - - uses: actions/checkout@v2 - - name: Set up Python - uses: actions/setup-python@v1 - - name: Install dependencies - run: | - pip install -U platformio - - name: Run PlatformIO - run: | - platformio run -e tasmota32-GR - - uses: actions/upload-artifact@v2 - with: - name: firmware - path: ./build_output - - - tasmota32-HE: - runs-on: ubuntu-latest - continue-on-error: true - steps: - - uses: actions/checkout@v2 - - name: Set up Python - uses: actions/setup-python@v1 - - name: Install dependencies - run: | - pip install -U platformio - - name: Run PlatformIO - run: | - platformio run -e tasmota32-HE - - uses: actions/upload-artifact@v2 - with: - name: firmware - path: ./build_output - - - tasmota32-HU: - runs-on: ubuntu-latest - continue-on-error: true - steps: - - uses: actions/checkout@v2 - - name: Set up Python - uses: actions/setup-python@v1 - - name: Install dependencies - run: | - pip install -U platformio - - name: Run PlatformIO - run: | - platformio run -e tasmota32-HU - - uses: actions/upload-artifact@v2 - with: - name: firmware - path: ./build_output - - - tasmota32-IT: - runs-on: ubuntu-latest - continue-on-error: true - steps: - - uses: actions/checkout@v2 - - name: Set up Python - uses: actions/setup-python@v1 - - name: Install dependencies - run: | - pip install -U platformio - - name: Run PlatformIO - run: | - platformio run -e tasmota32-IT - - uses: actions/upload-artifact@v2 - with: - name: firmware - path: ./build_output - - - tasmota32-KO: - runs-on: ubuntu-latest - continue-on-error: true - steps: - - uses: actions/checkout@v2 - - name: Set up Python - uses: actions/setup-python@v1 - - name: Install dependencies - run: | - pip install -U platformio - - name: Run PlatformIO - run: | - platformio run -e tasmota32-KO - - uses: actions/upload-artifact@v2 - with: - name: firmware - path: ./build_output - - - tasmota32-NL: - runs-on: ubuntu-latest - continue-on-error: true - steps: - - uses: actions/checkout@v2 - - name: Set up Python - uses: actions/setup-python@v1 - - name: Install dependencies - run: | - pip install -U platformio - - name: Run PlatformIO - run: | - platformio run -e tasmota32-NL - - uses: actions/upload-artifact@v2 - with: - name: firmware - path: ./build_output - - - tasmota32-PL: - runs-on: ubuntu-latest - continue-on-error: true - steps: - - uses: actions/checkout@v2 - - name: Set up Python - uses: actions/setup-python@v1 - - name: Install dependencies - run: | - pip install -U platformio - - name: Run PlatformIO - run: | - platformio run -e tasmota32-PL - - uses: actions/upload-artifact@v2 - with: - name: firmware - path: ./build_output - - - tasmota32-PT: - runs-on: ubuntu-latest - continue-on-error: true - steps: - - uses: actions/checkout@v2 - - name: Set up Python - uses: actions/setup-python@v1 - - name: Install dependencies - run: | - pip install -U platformio - - name: Run PlatformIO - run: | - platformio run -e tasmota32-PT - - uses: actions/upload-artifact@v2 - with: - name: firmware - path: ./build_output - - - tasmota32-RO: - runs-on: ubuntu-latest - continue-on-error: true - steps: - - uses: actions/checkout@v2 - - name: Set up Python - uses: actions/setup-python@v1 - - name: Install dependencies - run: | - pip install -U platformio - - name: Run PlatformIO - run: | - platformio run -e tasmota32-RO - - uses: actions/upload-artifact@v2 - with: - name: firmware - path: ./build_output - - - tasmota32-RU: - runs-on: ubuntu-latest - continue-on-error: true - steps: - - uses: actions/checkout@v2 - - name: Set up Python - uses: actions/setup-python@v1 - - name: Install dependencies - run: | - pip install -U platformio - - name: Run PlatformIO - run: | - platformio run -e tasmota32-RU - - uses: actions/upload-artifact@v2 - with: - name: firmware - path: ./build_output - - - tasmota32-SE: - runs-on: ubuntu-latest - continue-on-error: true - steps: - - uses: actions/checkout@v2 - - name: Set up Python - uses: actions/setup-python@v1 - - name: Install dependencies - run: | - pip install -U platformio - - name: Run PlatformIO - run: | - platformio run -e tasmota32-SE - - uses: actions/upload-artifact@v2 - with: - name: firmware - path: ./build_output - - - tasmota32-SK: - runs-on: ubuntu-latest - continue-on-error: true - steps: - - uses: actions/checkout@v2 - - name: Set up Python - uses: actions/setup-python@v1 - - name: Install dependencies - run: | - pip install -U platformio - - name: Run PlatformIO - run: | - platformio run -e tasmota32-SK - - uses: actions/upload-artifact@v2 - with: - name: firmware - path: ./build_output - - - tasmota32-TR: - runs-on: ubuntu-latest - continue-on-error: true - steps: - - uses: actions/checkout@v2 - - name: Set up Python - uses: actions/setup-python@v1 - - name: Install dependencies - run: | - pip install -U platformio - - name: Run PlatformIO - run: | - platformio run -e tasmota32-TR - - uses: actions/upload-artifact@v2 - with: - name: firmware - path: ./build_output - - - tasmota32-TW: - runs-on: ubuntu-latest - continue-on-error: true - steps: - - uses: actions/checkout@v2 - - name: Set up Python - uses: actions/setup-python@v1 - - name: Install dependencies - run: | - pip install -U platformio - - name: Run PlatformIO - run: | - platformio run -e tasmota32-TW - - uses: actions/upload-artifact@v2 - with: - name: firmware - path: ./build_output - - - tasmota32-UK: - runs-on: ubuntu-latest - continue-on-error: true - steps: - - uses: actions/checkout@v2 - - name: Set up Python - uses: actions/setup-python@v1 - - name: Install dependencies - run: | - pip install -U platformio - - name: Run PlatformIO - run: | - platformio run -e tasmota32-UK - - uses: actions/upload-artifact@v2 - with: - name: firmware - path: ./build_output - - - tasmota32-VN: - runs-on: ubuntu-latest - continue-on-error: true - steps: - - uses: actions/checkout@v2 - - name: Set up Python - uses: actions/setup-python@v1 - - name: Install dependencies - run: | - pip install -U platformio - - name: Run PlatformIO - run: | - platformio run -e tasmota32-VN - - uses: actions/upload-artifact@v2 - with: - name: firmware - path: ./build_output - + base-images: + runs-on: ubuntu-latest + if: github.repository == 'arendst/Tasmota' + continue-on-error: true + strategy: + matrix: + variant: + - tasmota + - tasmota-minimal + - tasmota-display + - tasmota-ir + - tasmota-knx + - tasmota-lite + - tasmota-sensors + - tasmota-zbbridge + - tasmota-zigbee + - tasmota32 + - tasmota32-webcam + - tasmota32-bluetooth + - tasmota32-core2 + - tasmota32-display + - tasmota32-ir + - tasmota32-lvgl + - tasmota32-odroidgo + - tasmota32c3 + - tasmota32solo1 + steps: + - uses: actions/checkout@v2 + with: + ref: development + - name: Set up Python + uses: actions/setup-python@v1 + - name: Install dependencies + run: | + pip install -U platformio + - name: Run PlatformIO + run: platformio run -e ${{ matrix.variant }} + - uses: actions/upload-artifact@v2 + with: + name: firmware + path: ./build_output + + language-images: + runs-on: ubuntu-latest + if: github.repository == 'arendst/Tasmota' + continue-on-error: true + strategy: + matrix: + variant: [ tasmota, tasmota32 ] + language: [ AF, BG, BR, CN, CZ, DE, ES, FR, FY, GR, HE, HU, IT, KO, NL, PL, PT, RO, RU, SE, SK, TR, TW, UK, VN ] + steps: + - uses: actions/checkout@v2 + with: + ref: development + - name: Set up Python + uses: actions/setup-python@v1 + - name: Install dependencies + run: | + pip install -U platformio + - name: Run PlatformIO + run: platformio run -e ${{ matrix.variant }}-${{ matrix.language }} + - uses: actions/upload-artifact@v2 + with: + name: firmware + path: ./build_output Upload: - needs: [tasmota-VN, tasmota32-VN, tasmota32-TW, tasmota32-TR] + needs: [base-images, language-images] runs-on: ubuntu-latest continue-on-error: true steps: diff --git a/.github/workflows/Tasmota_build_master.yml b/.github/workflows/Tasmota_build_master.yml index 4639fde5e..9ca6e1f6c 100644 --- a/.github/workflows/Tasmota_build_master.yml +++ b/.github/workflows/Tasmota_build_master.yml @@ -5,1320 +5,77 @@ on: branches: master paths-ignore: - '.github/**' # Ignore changes towards the .github directory + - '**.md' # Do no build if *.md files changes jobs: - - tasmota: - runs-on: ubuntu-latest - continue-on-error: true - steps: - - uses: actions/checkout@v2 - - name: Set up Python - uses: actions/setup-python@v1 - - name: Install dependencies - run: | - pip install -U platformio - - name: Run PlatformIO - run: | - platformio run -e tasmota - - uses: actions/upload-artifact@v2 - with: - name: firmware - path: ./build_output - - - tasmota-minimal: - runs-on: ubuntu-latest - continue-on-error: true - steps: - - uses: actions/checkout@v2 - - name: Set up Python - uses: actions/setup-python@v1 - - name: Install dependencies - run: | - pip install -U platformio - - name: Run PlatformIO - run: | - platformio run -e tasmota-minimal - - uses: actions/upload-artifact@v2 - with: - name: firmware - path: ./build_output - - - tasmota-lite: - runs-on: ubuntu-latest - continue-on-error: true - steps: - - uses: actions/checkout@v2 - - name: Set up Python - uses: actions/setup-python@v1 - - name: Install dependencies - run: | - pip install -U platformio - - name: Run PlatformIO - run: | - platformio run -e tasmota-lite - - uses: actions/upload-artifact@v2 - with: - name: firmware - path: ./build_output - - - tasmota-knx: - runs-on: ubuntu-latest - continue-on-error: true - steps: - - uses: actions/checkout@v2 - - name: Set up Python - uses: actions/setup-python@v1 - - name: Install dependencies - run: | - pip install -U platformio - - name: Run PlatformIO - run: | - platformio run -e tasmota-knx - - uses: actions/upload-artifact@v2 - with: - name: firmware - path: ./build_output - - - tasmota-sensors: - runs-on: ubuntu-latest - continue-on-error: true - steps: - - uses: actions/checkout@v2 - - name: Set up Python - uses: actions/setup-python@v1 - - name: Install dependencies - run: | - pip install -U platformio - - name: Run PlatformIO - run: | - platformio run -e tasmota-sensors - - uses: actions/upload-artifact@v2 - with: - name: firmware - path: ./build_output - - - tasmota-display: - runs-on: ubuntu-latest - continue-on-error: true - steps: - - uses: actions/checkout@v2 - - name: Set up Python - uses: actions/setup-python@v1 - - name: Install dependencies - run: | - pip install -U platformio - - name: Run PlatformIO - run: | - platformio run -e tasmota-display - - uses: actions/upload-artifact@v2 - with: - name: firmware - path: ./build_output - - - tasmota-ir: - runs-on: ubuntu-latest - continue-on-error: true - steps: - - uses: actions/checkout@v2 - - name: Set up Python - uses: actions/setup-python@v1 - - name: Install dependencies - run: | - pip install -U platformio - - name: Run PlatformIO - run: | - platformio run -e tasmota-ir - - uses: actions/upload-artifact@v2 - with: - name: firmware - path: ./build_output - - - tasmota-zbbridge: - runs-on: ubuntu-latest - continue-on-error: true - steps: - - uses: actions/checkout@v2 - - name: Set up Python - uses: actions/setup-python@v1 - - name: Install dependencies - run: | - pip install -U platformio - - name: Run PlatformIO - run: | - platformio run -e tasmota-zbbridge - - uses: actions/upload-artifact@v2 - with: - name: firmware - path: ./build_output - - - tasmota-zigbee: - runs-on: ubuntu-latest - continue-on-error: true - steps: - - uses: actions/checkout@v2 - - name: Set up Python - uses: actions/setup-python@v1 - - name: Install dependencies - run: | - pip install -U platformio - - name: Run PlatformIO - run: | - platformio run -e tasmota-zigbee - - uses: actions/upload-artifact@v2 - with: - name: firmware - path: ./build_output - - - tasmota-AF: - runs-on: ubuntu-latest - continue-on-error: true - steps: - - uses: actions/checkout@v2 - - name: Set up Python - uses: actions/setup-python@v1 - - name: Install dependencies - run: | - pip install -U platformio - - name: Run PlatformIO - run: | - platformio run -e tasmota-AF - - uses: actions/upload-artifact@v2 - with: - name: firmware - path: ./build_output - - - tasmota-BG: - runs-on: ubuntu-latest - continue-on-error: true - steps: - - uses: actions/checkout@v2 - - name: Set up Python - uses: actions/setup-python@v1 - - name: Install dependencies - run: | - pip install -U platformio - - name: Run PlatformIO - run: | - platformio run -e tasmota-BG - - uses: actions/upload-artifact@v2 - with: - name: firmware - path: ./build_output - - - tasmota-BR: - runs-on: ubuntu-latest - continue-on-error: true - steps: - - uses: actions/checkout@v2 - - name: Set up Python - uses: actions/setup-python@v1 - - name: Install dependencies - run: | - pip install -U platformio - - name: Run PlatformIO - run: | - platformio run -e tasmota-BR - - uses: actions/upload-artifact@v2 - with: - name: firmware - path: ./build_output - - - tasmota-CN: - runs-on: ubuntu-latest - continue-on-error: true - steps: - - uses: actions/checkout@v2 - - name: Set up Python - uses: actions/setup-python@v1 - - name: Install dependencies - run: | - pip install -U platformio - - name: Run PlatformIO - run: | - platformio run -e tasmota-CN - - uses: actions/upload-artifact@v2 - with: - name: firmware - path: ./build_output - - - tasmota-CZ: - runs-on: ubuntu-latest - continue-on-error: true - steps: - - uses: actions/checkout@v2 - - name: Set up Python - uses: actions/setup-python@v1 - - name: Install dependencies - run: | - pip install -U platformio - - name: Run PlatformIO - run: | - platformio run -e tasmota-CZ - - uses: actions/upload-artifact@v2 - with: - name: firmware - path: ./build_output - - - tasmota-DE: - runs-on: ubuntu-latest - continue-on-error: true - steps: - - uses: actions/checkout@v2 - - name: Set up Python - uses: actions/setup-python@v1 - - name: Install dependencies - run: | - pip install -U platformio - - name: Run PlatformIO - run: | - platformio run -e tasmota-DE - - uses: actions/upload-artifact@v2 - with: - name: firmware - path: ./build_output - - - tasmota-ES: - runs-on: ubuntu-latest - continue-on-error: true - steps: - - uses: actions/checkout@v2 - - name: Set up Python - uses: actions/setup-python@v1 - - name: Install dependencies - run: | - pip install -U platformio - - name: Run PlatformIO - run: | - platformio run -e tasmota-ES - - uses: actions/upload-artifact@v2 - with: - name: firmware - path: ./build_output - - - tasmota-FR: - runs-on: ubuntu-latest - continue-on-error: true - steps: - - uses: actions/checkout@v2 - - name: Set up Python - uses: actions/setup-python@v1 - - name: Install dependencies - run: | - pip install -U platformio - - name: Run PlatformIO - run: | - platformio run -e tasmota-FR - - uses: actions/upload-artifact@v2 - with: - name: firmware - path: ./build_output - - - tasmota-FY: - runs-on: ubuntu-latest - continue-on-error: true - steps: - - uses: actions/checkout@v2 - - name: Set up Python - uses: actions/setup-python@v1 - - name: Install dependencies - run: | - pip install -U platformio - - name: Run PlatformIO - run: | - platformio run -e tasmota-FY - - uses: actions/upload-artifact@v2 - with: - name: firmware - path: ./build_output - - - tasmota-GR: - runs-on: ubuntu-latest - continue-on-error: true - steps: - - uses: actions/checkout@v2 - - name: Set up Python - uses: actions/setup-python@v1 - - name: Install dependencies - run: | - pip install -U platformio - - name: Run PlatformIO - run: | - platformio run -e tasmota-GR - - uses: actions/upload-artifact@v2 - with: - name: firmware - path: ./build_output - - - tasmota-HE: - runs-on: ubuntu-latest - continue-on-error: true - steps: - - uses: actions/checkout@v2 - - name: Set up Python - uses: actions/setup-python@v1 - - name: Install dependencies - run: | - pip install -U platformio - - name: Run PlatformIO - run: | - platformio run -e tasmota-HE - - uses: actions/upload-artifact@v2 - with: - name: firmware - path: ./build_output - - - tasmota-HU: - runs-on: ubuntu-latest - continue-on-error: true - steps: - - uses: actions/checkout@v2 - - name: Set up Python - uses: actions/setup-python@v1 - - name: Install dependencies - run: | - pip install -U platformio - - name: Run PlatformIO - run: | - platformio run -e tasmota-HU - - uses: actions/upload-artifact@v2 - with: - name: firmware - path: ./build_output - - - tasmota-IT: - runs-on: ubuntu-latest - continue-on-error: true - steps: - - uses: actions/checkout@v2 - - name: Set up Python - uses: actions/setup-python@v1 - - name: Install dependencies - run: | - pip install -U platformio - - name: Run PlatformIO - run: | - platformio run -e tasmota-IT - - uses: actions/upload-artifact@v2 - with: - name: firmware - path: ./build_output - - - tasmota-KO: - runs-on: ubuntu-latest - continue-on-error: true - steps: - - uses: actions/checkout@v2 - - name: Set up Python - uses: actions/setup-python@v1 - - name: Install dependencies - run: | - pip install -U platformio - - name: Run PlatformIO - run: | - platformio run -e tasmota-KO - - uses: actions/upload-artifact@v2 - with: - name: firmware - path: ./build_output - - - tasmota-NL: - runs-on: ubuntu-latest - continue-on-error: true - steps: - - uses: actions/checkout@v2 - - name: Set up Python - uses: actions/setup-python@v1 - - name: Install dependencies - run: | - pip install -U platformio - - name: Run PlatformIO - run: | - platformio run -e tasmota-NL - - uses: actions/upload-artifact@v2 - with: - name: firmware - path: ./build_output - - - tasmota-PL: - runs-on: ubuntu-latest - continue-on-error: true - steps: - - uses: actions/checkout@v2 - - name: Set up Python - uses: actions/setup-python@v1 - - name: Install dependencies - run: | - pip install -U platformio - - name: Run PlatformIO - run: | - platformio run -e tasmota-PL - - uses: actions/upload-artifact@v2 - with: - name: firmware - path: ./build_output - - - tasmota-PT: - runs-on: ubuntu-latest - continue-on-error: true - steps: - - uses: actions/checkout@v2 - - name: Set up Python - uses: actions/setup-python@v1 - - name: Install dependencies - run: | - pip install -U platformio - - name: Run PlatformIO - run: | - platformio run -e tasmota-PT - - uses: actions/upload-artifact@v2 - with: - name: firmware - path: ./build_output - - - tasmota-RO: - runs-on: ubuntu-latest - continue-on-error: true - steps: - - uses: actions/checkout@v2 - - name: Set up Python - uses: actions/setup-python@v1 - - name: Install dependencies - run: | - pip install -U platformio - - name: Run PlatformIO - run: | - platformio run -e tasmota-RO - - uses: actions/upload-artifact@v2 - with: - name: firmware - path: ./build_output - - - tasmota-RU: - runs-on: ubuntu-latest - continue-on-error: true - steps: - - uses: actions/checkout@v2 - - name: Set up Python - uses: actions/setup-python@v1 - - name: Install dependencies - run: | - pip install -U platformio - - name: Run PlatformIO - run: | - platformio run -e tasmota-RU - - uses: actions/upload-artifact@v2 - with: - name: firmware - path: ./build_output - - - tasmota-SE: - runs-on: ubuntu-latest - continue-on-error: true - steps: - - uses: actions/checkout@v2 - - name: Set up Python - uses: actions/setup-python@v1 - - name: Install dependencies - run: | - pip install -U platformio - - name: Run PlatformIO - run: | - platformio run -e tasmota-SE - - uses: actions/upload-artifact@v2 - with: - name: firmware - path: ./build_output - - - tasmota-SK: - runs-on: ubuntu-latest - continue-on-error: true - steps: - - uses: actions/checkout@v2 - - name: Set up Python - uses: actions/setup-python@v1 - - name: Install dependencies - run: | - pip install -U platformio - - name: Run PlatformIO - run: | - platformio run -e tasmota-SK - - uses: actions/upload-artifact@v2 - with: - name: firmware - path: ./build_output - - - tasmota-TR: - runs-on: ubuntu-latest - continue-on-error: true - steps: - - uses: actions/checkout@v2 - - name: Set up Python - uses: actions/setup-python@v1 - - name: Install dependencies - run: | - pip install -U platformio - - name: Run PlatformIO - run: | - platformio run -e tasmota-TR - - uses: actions/upload-artifact@v2 - with: - name: firmware - path: ./build_output - - - tasmota-TW: - runs-on: ubuntu-latest - continue-on-error: true - steps: - - uses: actions/checkout@v2 - - name: Set up Python - uses: actions/setup-python@v1 - - name: Install dependencies - run: | - pip install -U platformio - - name: Run PlatformIO - run: | - platformio run -e tasmota-TW - - uses: actions/upload-artifact@v2 - with: - name: firmware - path: ./build_output - - - tasmota-UK: - runs-on: ubuntu-latest - continue-on-error: true - steps: - - uses: actions/checkout@v2 - - name: Set up Python - uses: actions/setup-python@v1 - - name: Install dependencies - run: | - pip install -U platformio - - name: Run PlatformIO - run: | - platformio run -e tasmota-UK - - uses: actions/upload-artifact@v2 - with: - name: firmware - path: ./build_output - - - tasmota-VN: - runs-on: ubuntu-latest - continue-on-error: true - steps: - - uses: actions/checkout@v2 - - name: Set up Python - uses: actions/setup-python@v1 - - name: Install dependencies - run: | - pip install -U platformio - - name: Run PlatformIO - run: | - platformio run -e tasmota-VN - - uses: actions/upload-artifact@v2 - with: - name: firmware - path: ./build_output - - - tasmota32: - runs-on: ubuntu-latest - continue-on-error: true - steps: - - uses: actions/checkout@v2 - - name: Set up Python - uses: actions/setup-python@v1 - - name: Install dependencies - run: | - pip install -U platformio - - name: Run PlatformIO - run: | - platformio run -e tasmota32 - - uses: actions/upload-artifact@v2 - with: - name: firmware - path: ./build_output - - - tasmota32solo1: - runs-on: ubuntu-latest - continue-on-error: true - steps: - - uses: actions/checkout@v2 - - name: Set up Python - uses: actions/setup-python@v1 - - name: Install dependencies - run: | - pip install -U platformio - - name: Run PlatformIO - run: | - platformio run -e tasmota32solo1 - - uses: actions/upload-artifact@v2 - with: - name: firmware - path: ./build_output - - - tasmota32-webcam: - runs-on: ubuntu-latest - continue-on-error: true - steps: - - uses: actions/checkout@v2 - - name: Set up Python - uses: actions/setup-python@v1 - - name: Install dependencies - run: | - pip install -U platformio - - name: Run PlatformIO - run: | - platformio run -e tasmota32-webcam - - uses: actions/upload-artifact@v2 - with: - name: firmware - path: ./build_output - - - tasmota32-odroidgo: - runs-on: ubuntu-latest - continue-on-error: true - steps: - - uses: actions/checkout@v2 - - name: Set up Python - uses: actions/setup-python@v1 - - name: Install dependencies - run: | - pip install -U platformio - - name: Run PlatformIO - run: | - platformio run -e tasmota32-odroidgo - - uses: actions/upload-artifact@v2 - with: - name: firmware - path: ./build_output - - - tasmota32-core2: - runs-on: ubuntu-latest - continue-on-error: true - steps: - - uses: actions/checkout@v2 - - name: Set up Python - uses: actions/setup-python@v1 - - name: Install dependencies - run: | - pip install -U platformio - - name: Run PlatformIO - run: | - platformio run -e tasmota32-core2 - - uses: actions/upload-artifact@v2 - with: - name: firmware - path: ./build_output - - - tasmota32-bluetooth: - runs-on: ubuntu-latest - continue-on-error: true - steps: - - uses: actions/checkout@v2 - - name: Set up Python - uses: actions/setup-python@v1 - - name: Install dependencies - run: | - pip install -U platformio - - name: Run PlatformIO - run: | - platformio run -e tasmota32-bluetooth - - uses: actions/upload-artifact@v2 - with: - name: firmware - path: ./build_output - - - tasmota32-display: - runs-on: ubuntu-latest - continue-on-error: true - steps: - - uses: actions/checkout@v2 - - name: Set up Python - uses: actions/setup-python@v1 - - name: Install dependencies - run: | - pip install -U platformio - - name: Run PlatformIO - run: | - platformio run -e tasmota32-display - - uses: actions/upload-artifact@v2 - with: - name: firmware - path: ./build_output - - - tasmota32-lvgl: - runs-on: ubuntu-latest - continue-on-error: true - steps: - - uses: actions/checkout@v2 - - name: Set up Python - uses: actions/setup-python@v1 - - name: Install dependencies - run: | - pip install -U platformio - - name: Run PlatformIO - run: | - platformio run -e tasmota32-lvgl - - uses: actions/upload-artifact@v2 - with: - name: firmware - path: ./build_output - - - tasmota32-ir: - runs-on: ubuntu-latest - continue-on-error: true - steps: - - uses: actions/checkout@v2 - - name: Set up Python - uses: actions/setup-python@v1 - - name: Install dependencies - run: | - pip install -U platformio - - name: Run PlatformIO - run: | - platformio run -e tasmota32-ir - - uses: actions/upload-artifact@v2 - with: - name: firmware - path: ./build_output - - tasmota32c3: - runs-on: ubuntu-latest - continue-on-error: true - steps: - - uses: actions/checkout@v2 - - name: Set up Python - uses: actions/setup-python@v1 - - name: Install dependencies - run: | - pip install -U platformio - - name: Run PlatformIO - run: | - platformio run -e tasmota32c3 - - uses: actions/upload-artifact@v2 - with: - name: firmware - path: ./build_output - - tasmota32-AF: - runs-on: ubuntu-latest - continue-on-error: true - steps: - - uses: actions/checkout@v2 - - name: Set up Python - uses: actions/setup-python@v1 - - name: Install dependencies - run: | - pip install -U platformio - - name: Run PlatformIO - run: | - platformio run -e tasmota32-AF - - uses: actions/upload-artifact@v2 - with: - name: firmware - path: ./build_output - - - tasmota32-BG: - runs-on: ubuntu-latest - continue-on-error: true - steps: - - uses: actions/checkout@v2 - - name: Set up Python - uses: actions/setup-python@v1 - - name: Install dependencies - run: | - pip install -U platformio - - name: Run PlatformIO - run: | - platformio run -e tasmota32-BG - - uses: actions/upload-artifact@v2 - with: - name: firmware - path: ./build_output - - - tasmota32-BR: - runs-on: ubuntu-latest - continue-on-error: true - steps: - - uses: actions/checkout@v2 - - name: Set up Python - uses: actions/setup-python@v1 - - name: Install dependencies - run: | - pip install -U platformio - - name: Run PlatformIO - run: | - platformio run -e tasmota32-BR - - uses: actions/upload-artifact@v2 - with: - name: firmware - path: ./build_output - - - tasmota32-CN: - runs-on: ubuntu-latest - continue-on-error: true - steps: - - uses: actions/checkout@v2 - - name: Set up Python - uses: actions/setup-python@v1 - - name: Install dependencies - run: | - pip install -U platformio - - name: Run PlatformIO - run: | - platformio run -e tasmota32-CN - - uses: actions/upload-artifact@v2 - with: - name: firmware - path: ./build_output - - - tasmota32-CZ: - runs-on: ubuntu-latest - continue-on-error: true - steps: - - uses: actions/checkout@v2 - - name: Set up Python - uses: actions/setup-python@v1 - - name: Install dependencies - run: | - pip install -U platformio - - name: Run PlatformIO - run: | - platformio run -e tasmota32-CZ - - uses: actions/upload-artifact@v2 - with: - name: firmware - path: ./build_output - - - tasmota32-DE: - runs-on: ubuntu-latest - continue-on-error: true - steps: - - uses: actions/checkout@v2 - - name: Set up Python - uses: actions/setup-python@v1 - - name: Install dependencies - run: | - pip install -U platformio - - name: Run PlatformIO - run: | - platformio run -e tasmota32-DE - - uses: actions/upload-artifact@v2 - with: - name: firmware - path: ./build_output - - - tasmota32-ES: - runs-on: ubuntu-latest - continue-on-error: true - steps: - - uses: actions/checkout@v2 - - name: Set up Python - uses: actions/setup-python@v1 - - name: Install dependencies - run: | - pip install -U platformio - - name: Run PlatformIO - run: | - platformio run -e tasmota32-ES - - uses: actions/upload-artifact@v2 - with: - name: firmware - path: ./build_output - - - tasmota32-FR: - runs-on: ubuntu-latest - continue-on-error: true - steps: - - uses: actions/checkout@v2 - - name: Set up Python - uses: actions/setup-python@v1 - - name: Install dependencies - run: | - pip install -U platformio - - name: Run PlatformIO - run: | - platformio run -e tasmota32-FR - - uses: actions/upload-artifact@v2 - with: - name: firmware - path: ./build_output - - - tasmota32-FY: - runs-on: ubuntu-latest - continue-on-error: true - steps: - - uses: actions/checkout@v2 - - name: Set up Python - uses: actions/setup-python@v1 - - name: Install dependencies - run: | - pip install -U platformio - - name: Run PlatformIO - run: | - platformio run -e tasmota32-FY - - uses: actions/upload-artifact@v2 - with: - name: firmware - path: ./build_output - - - tasmota32-GR: - runs-on: ubuntu-latest - continue-on-error: true - steps: - - uses: actions/checkout@v2 - - name: Set up Python - uses: actions/setup-python@v1 - - name: Install dependencies - run: | - pip install -U platformio - - name: Run PlatformIO - run: | - platformio run -e tasmota32-GR - - uses: actions/upload-artifact@v2 - with: - name: firmware - path: ./build_output - - - tasmota32-HE: - runs-on: ubuntu-latest - continue-on-error: true - steps: - - uses: actions/checkout@v2 - - name: Set up Python - uses: actions/setup-python@v1 - - name: Install dependencies - run: | - pip install -U platformio - - name: Run PlatformIO - run: | - platformio run -e tasmota32-HE - - uses: actions/upload-artifact@v2 - with: - name: firmware - path: ./build_output - - - tasmota32-HU: - runs-on: ubuntu-latest - continue-on-error: true - steps: - - uses: actions/checkout@v2 - - name: Set up Python - uses: actions/setup-python@v1 - - name: Install dependencies - run: | - pip install -U platformio - - name: Run PlatformIO - run: | - platformio run -e tasmota32-HU - - uses: actions/upload-artifact@v2 - with: - name: firmware - path: ./build_output - - - tasmota32-IT: - runs-on: ubuntu-latest - continue-on-error: true - steps: - - uses: actions/checkout@v2 - - name: Set up Python - uses: actions/setup-python@v1 - - name: Install dependencies - run: | - pip install -U platformio - - name: Run PlatformIO - run: | - platformio run -e tasmota32-IT - - uses: actions/upload-artifact@v2 - with: - name: firmware - path: ./build_output - - - tasmota32-KO: - runs-on: ubuntu-latest - continue-on-error: true - steps: - - uses: actions/checkout@v2 - - name: Set up Python - uses: actions/setup-python@v1 - - name: Install dependencies - run: | - pip install -U platformio - - name: Run PlatformIO - run: | - platformio run -e tasmota32-KO - - uses: actions/upload-artifact@v2 - with: - name: firmware - path: ./build_output - - - tasmota32-NL: - runs-on: ubuntu-latest - continue-on-error: true - steps: - - uses: actions/checkout@v2 - - name: Set up Python - uses: actions/setup-python@v1 - - name: Install dependencies - run: | - pip install -U platformio - - name: Run PlatformIO - run: | - platformio run -e tasmota32-NL - - uses: actions/upload-artifact@v2 - with: - name: firmware - path: ./build_output - - - tasmota32-PL: - runs-on: ubuntu-latest - continue-on-error: true - steps: - - uses: actions/checkout@v2 - - name: Set up Python - uses: actions/setup-python@v1 - - name: Install dependencies - run: | - pip install -U platformio - - name: Run PlatformIO - run: | - platformio run -e tasmota32-PL - - uses: actions/upload-artifact@v2 - with: - name: firmware - path: ./build_output - - - tasmota32-PT: - runs-on: ubuntu-latest - continue-on-error: true - steps: - - uses: actions/checkout@v2 - - name: Set up Python - uses: actions/setup-python@v1 - - name: Install dependencies - run: | - pip install -U platformio - - name: Run PlatformIO - run: | - platformio run -e tasmota32-PT - - uses: actions/upload-artifact@v2 - with: - name: firmware - path: ./build_output - - - tasmota32-RO: - runs-on: ubuntu-latest - continue-on-error: true - steps: - - uses: actions/checkout@v2 - - name: Set up Python - uses: actions/setup-python@v1 - - name: Install dependencies - run: | - pip install -U platformio - - name: Run PlatformIO - run: | - platformio run -e tasmota32-RO - - uses: actions/upload-artifact@v2 - with: - name: firmware - path: ./build_output - - - tasmota32-RU: - runs-on: ubuntu-latest - continue-on-error: true - steps: - - uses: actions/checkout@v2 - - name: Set up Python - uses: actions/setup-python@v1 - - name: Install dependencies - run: | - pip install -U platformio - - name: Run PlatformIO - run: | - platformio run -e tasmota32-RU - - uses: actions/upload-artifact@v2 - with: - name: firmware - path: ./build_output - - - tasmota32-SE: - runs-on: ubuntu-latest - continue-on-error: true - steps: - - uses: actions/checkout@v2 - - name: Set up Python - uses: actions/setup-python@v1 - - name: Install dependencies - run: | - pip install -U platformio - - name: Run PlatformIO - run: | - platformio run -e tasmota32-SE - - uses: actions/upload-artifact@v2 - with: - name: firmware - path: ./build_output - - - tasmota32-SK: - runs-on: ubuntu-latest - continue-on-error: true - steps: - - uses: actions/checkout@v2 - - name: Set up Python - uses: actions/setup-python@v1 - - name: Install dependencies - run: | - pip install -U platformio - - name: Run PlatformIO - run: | - platformio run -e tasmota32-SK - - uses: actions/upload-artifact@v2 - with: - name: firmware - path: ./build_output - - - tasmota32-TR: - runs-on: ubuntu-latest - continue-on-error: true - steps: - - uses: actions/checkout@v2 - - name: Set up Python - uses: actions/setup-python@v1 - - name: Install dependencies - run: | - pip install -U platformio - - name: Run PlatformIO - run: | - platformio run -e tasmota32-TR - - uses: actions/upload-artifact@v2 - with: - name: firmware - path: ./build_output - - - tasmota32-TW: - runs-on: ubuntu-latest - continue-on-error: true - steps: - - uses: actions/checkout@v2 - - name: Set up Python - uses: actions/setup-python@v1 - - name: Install dependencies - run: | - pip install -U platformio - - name: Run PlatformIO - run: | - platformio run -e tasmota32-TW - - uses: actions/upload-artifact@v2 - with: - name: firmware - path: ./build_output - - - tasmota32-UK: - runs-on: ubuntu-latest - continue-on-error: true - steps: - - uses: actions/checkout@v2 - - name: Set up Python - uses: actions/setup-python@v1 - - name: Install dependencies - run: | - pip install -U platformio - - name: Run PlatformIO - run: | - platformio run -e tasmota32-UK - - uses: actions/upload-artifact@v2 - with: - name: firmware - path: ./build_output - - - tasmota32-VN: - runs-on: ubuntu-latest - continue-on-error: true - steps: - - uses: actions/checkout@v2 - - name: Set up Python - uses: actions/setup-python@v1 - - name: Install dependencies - run: | - pip install -U platformio - - name: Run PlatformIO - run: | - platformio run -e tasmota32-VN - - uses: actions/upload-artifact@v2 - with: - name: firmware - path: ./build_output - + base-images: + runs-on: ubuntu-latest + if: github.repository == 'arendst/Tasmota' + continue-on-error: true + strategy: + matrix: + variant: + - tasmota + - tasmota-minimal + - tasmota-display + - tasmota-ir + - tasmota-knx + - tasmota-lite + - tasmota-sensors + - tasmota-zbbridge + - tasmota-zigbee + - tasmota32 + - tasmota32-webcam + - tasmota32-bluetooth + - tasmota32-core2 + - tasmota32-display + - tasmota32-ir + - tasmota32-lvgl + - tasmota32-odroidgo + - tasmota32c3 + - tasmota32solo1 + steps: + - uses: actions/checkout@v2 + with: + ref: master + - name: Set up Python + uses: actions/setup-python@v1 + - name: Install dependencies + run: | + pip install -U platformio + - name: Run PlatformIO + run: platformio run -e ${{ matrix.variant }} + - uses: actions/upload-artifact@v2 + with: + name: firmware + path: ./build_output + + language-images: + runs-on: ubuntu-latest + if: github.repository == 'arendst/Tasmota' + continue-on-error: true + strategy: + matrix: + variant: [ tasmota, tasmota32 ] + language: [ AF, BG, BR, CN, CZ, DE, ES, FR, FY, GR, HE, HU, IT, KO, NL, PL, PT, RO, RU, SE, SK, TR, TW, UK, VN ] + steps: + - uses: actions/checkout@v2 + with: + ref: master + - name: Set up Python + uses: actions/setup-python@v1 + - name: Install dependencies + run: | + pip install -U platformio + - name: Run PlatformIO + run: platformio run -e ${{ matrix.variant }}-${{ matrix.language }} + - uses: actions/upload-artifact@v2 + with: + name: firmware + path: ./build_output Upload: - needs: [tasmota-VN, tasmota32-VN, tasmota32-TW, tasmota32-TR] + needs: [base-images, language-images] runs-on: ubuntu-latest continue-on-error: true steps: diff --git a/.github/workflows/build_all_the_things.yml b/.github/workflows/build_all_the_things.yml index 2ffca53b7..cb41ae85e 100644 --- a/.github/workflows/build_all_the_things.yml +++ b/.github/workflows/build_all_the_things.yml @@ -18,6 +18,7 @@ on: jobs: base-images: runs-on: ubuntu-latest + if: github.repository == 'arendst/Tasmota' strategy: matrix: variant: @@ -59,6 +60,7 @@ jobs: language-images: runs-on: ubuntu-latest + if: github.repository == 'arendst/Tasmota' strategy: matrix: variant: [ tasmota ] diff --git a/lib/lib_audio/ESP8266Audio/src/AudioFileSourceICYStream.cpp b/lib/lib_audio/ESP8266Audio/src/AudioFileSourceICYStream.cpp index 63c84f328..bbc348d53 100644 --- a/lib/lib_audio/ESP8266Audio/src/AudioFileSourceICYStream.cpp +++ b/lib/lib_audio/ESP8266Audio/src/AudioFileSourceICYStream.cpp @@ -20,7 +20,9 @@ #if defined(ESP32) || defined(ESP8266) -#define _GNU_SOURCE +#ifndef _GNU_SOURCE + #define _GNU_SOURCE +#endif #include "AudioFileSourceICYStream.h" #include diff --git a/lib/lib_audio/ESP8266Audio/src/libflac/config.h b/lib/lib_audio/ESP8266Audio/src/libflac/config.h index cf6c07dfe..b0aebe44d 100644 --- a/lib/lib_audio/ESP8266Audio/src/libflac/config.h +++ b/lib/lib_audio/ESP8266Audio/src/libflac/config.h @@ -3,7 +3,9 @@ #ifdef DEBUG #undef NDEBUG #else - #define NDEBUG + #ifndef NDEBUG + #define NDEBUG + #endif #endif /* config.h. Generated from config.h.in by configure. */ diff --git a/lib/lib_display/Adafruit-GFX-Library-1.5.6-gemu-1.0/Adafruit_GFX.cpp b/lib/lib_display/Adafruit-GFX-Library-1.5.6-gemu-1.0/Adafruit_GFX.cpp index 5e88150cc..398dba0df 100644 --- a/lib/lib_display/Adafruit-GFX-Library-1.5.6-gemu-1.0/Adafruit_GFX.cpp +++ b/lib/lib_display/Adafruit-GFX-Library-1.5.6-gemu-1.0/Adafruit_GFX.cpp @@ -1610,10 +1610,12 @@ void Adafruit_GFX_Button::drawButton(boolean inverted) { text = _fillcolor; } + #if defined USE_UFILESYS if (_label[0]=='/') { draw_picture(_label, _x1, _y1, _w, _h, outline, inverted); _gfx->drawRect(_x1, _y1, _w, _h, text); } else { + #endif uint8_t r = min(_w, _h) / 4; // Corner radius _gfx->fillRoundRect(_x1, _y1, _w, _h, r, fill); _gfx->drawRoundRect(_x1, _y1, _w, _h, r, outline); @@ -1622,7 +1624,9 @@ void Adafruit_GFX_Button::drawButton(boolean inverted) { _gfx->setTextColor(text); _gfx->setTextSize(_textsize_x, _textsize_y); _gfx->print(_label); + #if defined USE_UFILESYS } + #endif } /**************************************************************************/ diff --git a/lib/libesp32/Berry/default/be_md5_lib.c b/lib/libesp32/Berry/default/be_md5_lib.c deleted file mode 100644 index 2c8dfd77b..000000000 --- a/lib/libesp32/Berry/default/be_md5_lib.c +++ /dev/null @@ -1,30 +0,0 @@ -/******************************************************************** - * Berry module `webserver` - * - * To use: `import webserver` - * - * Allows to respond to HTTP request - *******************************************************************/ -#include "be_constobj.h" - -extern int m_md5_init(bvm *vm); -extern int m_md5_update(bvm *vm); -extern int m_md5_finish(bvm *vm); - -#include "../generate/be_fixed_be_class_md5.h" - -void be_load_md5_lib(bvm *vm) { - be_pushntvclass(vm, &be_class_md5); - be_setglobal(vm, "MD5"); - be_pop(vm, 1); -} -/* @const_object_info_begin - -class be_class_md5 (scope: global, name: MD5) { - .p, var - - init, func(m_md5_init) - update, func(m_md5_update) - finish, func(m_md5_finish) -} -@const_object_info_end */ diff --git a/lib/libesp32/Berry/generate/be_fixed_be_class_tasmota.h b/lib/libesp32/Berry/generate/be_fixed_be_class_tasmota.h deleted file mode 100644 index dc2abcca8..000000000 --- a/lib/libesp32/Berry/generate/be_fixed_be_class_tasmota.h +++ /dev/null @@ -1,96 +0,0 @@ -#include "be_constobj.h" - -static be_define_const_map_slots(be_class_tasmota_map) { - { be_const_key(gc, -1), be_const_closure(Tasmota_gc_closure) }, - { be_const_key(read_sensors, 7), be_const_func(l_read_sensors) }, - { be_const_key(_get_cb, -1), be_const_func(l_get_cb) }, - { be_const_key(response_append, 50), be_const_func(l_respAppend) }, - { be_const_key(try_rule, 74), be_const_closure(Tasmota_try_rule_closure) }, - { be_const_key(eth, -1), be_const_func(l_eth) }, - { be_const_key(find_key_i, -1), be_const_closure(Tasmota_find_key_i_closure) }, - { be_const_key(exec_tele, 73), be_const_closure(Tasmota_exec_tele_closure) }, - { be_const_key(remove_driver, 28), be_const_closure(Tasmota_remove_driver_closure) }, - { be_const_key(load, -1), be_const_closure(Tasmota_load_closure) }, - { be_const_key(_settings_ptr, -1), be_const_comptr(&Settings) }, - { be_const_key(cmd_res, -1), be_const_var(0) }, - { be_const_key(time_str, 43), be_const_closure(Tasmota_time_str_closure) }, - { be_const_key(set_power, -1), be_const_func(l_setpower) }, - { be_const_key(yield, 20), be_const_func(l_yield) }, - { be_const_key(set_light, -1), be_const_closure(Tasmota_set_light_closure) }, - { be_const_key(find_op, 32), be_const_closure(Tasmota_find_op_closure) }, - { be_const_key(get_power, -1), be_const_func(l_getpower) }, - { be_const_key(add_rule, -1), be_const_closure(Tasmota_add_rule_closure) }, - { be_const_key(cb_dispatch, -1), be_const_closure(Tasmota_cb_dispatch_closure) }, - { be_const_key(global, -1), be_const_var(1) }, - { be_const_key(i2c_enabled, -1), be_const_func(l_i2cenabled) }, - { be_const_key(remove_cmd, 10), be_const_closure(Tasmota_remove_cmd_closure) }, - { be_const_key(millis, 18), be_const_func(l_millis) }, - { be_const_key(publish, 69), be_const_func(l_publish) }, - { be_const_key(_drivers, -1), be_const_var(2) }, - { be_const_key(resp_cmnd, -1), be_const_func(l_respCmnd) }, - { be_const_key(time_dump, -1), be_const_func(l_time_dump) }, - { be_const_key(web_send, -1), be_const_func(l_webSend) }, - { be_const_key(hs2rgb, -1), be_const_closure(Tasmota_hs2rgb_closure) }, - { be_const_key(memory, -1), be_const_func(l_memory) }, - { be_const_key(gen_cb, 0), be_const_closure(Tasmota_gen_cb_closure) }, - { be_const_key(rtc, -1), be_const_func(l_rtc) }, - { be_const_key(get_option, -1), be_const_func(l_getoption) }, - { be_const_key(add_cmd, -1), be_const_closure(Tasmota_add_cmd_closure) }, - { be_const_key(init, -1), be_const_closure(Tasmota_init_closure) }, - { be_const_key(_timers, -1), be_const_var(3) }, - { be_const_key(_global_addr, -1), be_const_comptr(&TasmotaGlobal) }, - { be_const_key(wd, -1), be_const_var(4) }, - { be_const_key(exec_cmd, -1), be_const_closure(Tasmota_exec_cmd_closure) }, - { be_const_key(wire_scan, -1), be_const_closure(Tasmota_wire_scan_closure) }, - { be_const_key(_global_def, 61), be_const_comptr(&be_tasmota_global_struct) }, - { be_const_key(resp_cmnd_failed, 11), be_const_func(l_respCmndFailed) }, - { be_const_key(chars_in_string, -1), be_const_closure(Tasmota_chars_in_string_closure) }, - { be_const_key(web_send_decimal, -1), be_const_func(l_webSendDecimal) }, - { be_const_key(_debug_present, 4), be_const_var(5) }, - { be_const_key(cmd, -1), be_const_closure(Tasmota_cmd_closure) }, - { be_const_key(_cb, -1), be_const_var(6) }, - { be_const_key(remove_rule, -1), be_const_closure(Tasmota_remove_rule_closure) }, - { be_const_key(run_deferred, -1), be_const_closure(Tasmota_run_deferred_closure) }, - { be_const_key(strftime, -1), be_const_func(l_strftime) }, - { be_const_key(add_driver, 3), be_const_closure(Tasmota_add_driver_closure) }, - { be_const_key(kv, 60), be_const_closure(Tasmota_kv_closure) }, - { be_const_key(set_timer, 58), be_const_closure(Tasmota_set_timer_closure) }, - { be_const_key(scale_uint, -1), be_const_func(l_scaleuint) }, - { be_const_key(remove_timer, -1), be_const_closure(Tasmota_remove_timer_closure) }, - { be_const_key(settings, 49), be_const_var(7) }, - { be_const_key(arch, -1), be_const_func(l_arch) }, - { be_const_key(_ccmd, 64), be_const_var(8) }, - { be_const_key(wire1, 46), be_const_var(9) }, - { be_const_key(exec_rules, 66), be_const_closure(Tasmota_exec_rules_closure) }, - { be_const_key(strptime, -1), be_const_func(l_strptime) }, - { be_const_key(_cmd, -1), be_const_func(l_cmd) }, - { be_const_key(resp_cmnd_error, -1), be_const_func(l_respCmndError) }, - { be_const_key(time_reached, -1), be_const_func(l_timereached) }, - { be_const_key(_rules, -1), be_const_var(10) }, - { be_const_key(publish_result, -1), be_const_func(l_publish_result) }, - { be_const_key(_settings_def, -1), be_const_comptr(&be_tasmota_settings_struct) }, - { be_const_key(get_switch, -1), be_const_func(l_getswitch) }, - { be_const_key(delay, 71), be_const_func(l_delay) }, - { be_const_key(resp_cmnd_str, -1), be_const_func(l_respCmndStr) }, - { be_const_key(wifi, -1), be_const_func(l_wifi) }, - { be_const_key(save, 15), be_const_func(l_save) }, - { be_const_key(log, 37), be_const_func(l_logInfo) }, - { be_const_key(resolvecmnd, -1), be_const_func(l_resolveCmnd) }, - { be_const_key(resp_cmnd_done, -1), be_const_func(l_respCmndDone) }, - { be_const_key(get_light, 5), be_const_closure(Tasmota_get_light_closure) }, - { be_const_key(get_free_heap, -1), be_const_func(l_getFreeHeap) }, - { be_const_key(wire2, -1), be_const_var(11) }, - { be_const_key(event, 34), be_const_closure(Tasmota_event_closure) }, -}; - -static be_define_const_map( - be_class_tasmota_map, - 80 -); - -BE_EXPORT_VARIABLE be_define_const_class( - be_class_tasmota, - 12, - NULL, - Tasmota -); diff --git a/lib/libesp32/Berry/LICENSE b/lib/libesp32/berry/LICENSE similarity index 100% rename from lib/libesp32/Berry/LICENSE rename to lib/libesp32/berry/LICENSE diff --git a/lib/libesp32/Berry/Makefile b/lib/libesp32/berry/Makefile similarity index 100% rename from lib/libesp32/Berry/Makefile rename to lib/libesp32/berry/Makefile diff --git a/lib/libesp32/Berry/README.md b/lib/libesp32/berry/README.md similarity index 100% rename from lib/libesp32/Berry/README.md rename to lib/libesp32/berry/README.md diff --git a/lib/libesp32/Berry/berry-logo.png b/lib/libesp32/berry/berry-logo.png similarity index 100% rename from lib/libesp32/Berry/berry-logo.png rename to lib/libesp32/berry/berry-logo.png diff --git a/lib/libesp32/Berry/default/be_animate_lib.c b/lib/libesp32/berry/default/be_animate_lib.c similarity index 100% rename from lib/libesp32/Berry/default/be_animate_lib.c rename to lib/libesp32/berry/default/be_animate_lib.c diff --git a/lib/libesp32/Berry/default/be_autoconf_lib.c b/lib/libesp32/berry/default/be_autoconf_lib.c similarity index 100% rename from lib/libesp32/Berry/default/be_autoconf_lib.c rename to lib/libesp32/berry/default/be_autoconf_lib.c diff --git a/lib/libesp32/Berry/default/be_crypto_lib.c b/lib/libesp32/berry/default/be_crypto_lib.c similarity index 100% rename from lib/libesp32/Berry/default/be_crypto_lib.c rename to lib/libesp32/berry/default/be_crypto_lib.c diff --git a/lib/libesp32/Berry/default/be_ctypes.c b/lib/libesp32/berry/default/be_ctypes.c similarity index 100% rename from lib/libesp32/Berry/default/be_ctypes.c rename to lib/libesp32/berry/default/be_ctypes.c diff --git a/lib/libesp32/Berry/default/be_display_lib.c b/lib/libesp32/berry/default/be_display_lib.c similarity index 100% rename from lib/libesp32/Berry/default/be_display_lib.c rename to lib/libesp32/berry/default/be_display_lib.c diff --git a/lib/libesp32/Berry/default/be_driverlib.c b/lib/libesp32/berry/default/be_driverlib.c similarity index 54% rename from lib/libesp32/Berry/default/be_driverlib.c rename to lib/libesp32/berry/default/be_driverlib.c index 45a611382..0d163f836 100644 --- a/lib/libesp32/Berry/default/be_driverlib.c +++ b/lib/libesp32/berry/default/be_driverlib.c @@ -6,57 +6,6 @@ *******************************************************************/ #include "be_constobj.h" -/******************************************************************** -** Solidified function: init -********************************************************************/ -be_local_closure(Driver_init, /* name */ - be_nested_proto( - 1, /* nstack */ - 1, /* argc */ - 0, /* varg */ - 0, /* has upvals */ - NULL, /* no upvals */ - 0, /* has sup protos */ - NULL, /* no sub protos */ - 0, /* has constants */ - NULL, /* no const */ - &be_const_str_init, - &be_const_str_solidified, - ( &(const binstruction[ 1]) { /* code */ - 0x80000000, // 0000 RET 0 - }) - ) -); -/*******************************************************************/ - - -/******************************************************************** -** Solidified function: get_tasmota -********************************************************************/ -be_local_closure(Driver_get_tasmota, /* name */ - be_nested_proto( - 2, /* nstack */ - 1, /* argc */ - 0, /* varg */ - 0, /* has upvals */ - NULL, /* no upvals */ - 0, /* has sup protos */ - NULL, /* no sub protos */ - 1, /* has constants */ - ( &(const bvalue[ 1]) { /* constants */ - /* K0 */ be_nested_str(tasmota), - }), - &be_const_str_get_tasmota, - &be_const_str_solidified, - ( &(const binstruction[ 2]) { /* code */ - 0xB8060000, // 0000 GETNGBL R1 K0 - 0x80040200, // 0001 RET 1 R1 - }) - ) -); -/*******************************************************************/ - - /******************************************************************** ** Solidified function: add_cmd ********************************************************************/ @@ -123,24 +72,22 @@ be_local_closure(Driver_add_cmd, /* name */ be_local_class(Driver, 13, NULL, - be_nested_map(16, + be_nested_map(14, ( (struct bmapnode*) &(const bmapnode[]) { - { be_const_key(web_add_main_button, 14), be_const_var(4) }, - { be_const_key(web_add_console_button, -1), be_const_var(7) }, - { be_const_key(web_add_management_button, 8), be_const_var(5) }, - { be_const_key(init, -1), be_const_closure(Driver_init_closure) }, - { be_const_key(json_append, -1), be_const_var(10) }, - { be_const_key(web_add_config_button, 7), be_const_var(6) }, - { be_const_key(every_100ms, -1), be_const_var(1) }, - { be_const_key(display, -1), be_const_var(12) }, - { be_const_key(web_add_button, 13), be_const_var(3) }, - { be_const_key(every_second, -1), be_const_var(0) }, - { be_const_key(save_before_restart, -1), be_const_var(8) }, - { be_const_key(get_tasmota, -1), be_const_closure(Driver_get_tasmota_closure) }, - { be_const_key(web_sensor, 6), be_const_var(9) }, - { be_const_key(web_add_handler, -1), be_const_var(2) }, - { be_const_key(button_pressed, 1), be_const_var(11) }, + { be_const_key(web_add_console_button, 6), be_const_var(7) }, + { be_const_key(web_add_config_button, -1), be_const_var(6) }, + { be_const_key(button_pressed, 9), be_const_var(11) }, + { be_const_key(every_second, 1), be_const_var(0) }, + { be_const_key(web_add_handler, 11), be_const_var(2) }, { be_const_key(add_cmd, -1), be_const_closure(Driver_add_cmd_closure) }, + { be_const_key(web_sensor, -1), be_const_var(9) }, + { be_const_key(display, -1), be_const_var(12) }, + { be_const_key(web_add_main_button, 2), be_const_var(4) }, + { be_const_key(save_before_restart, -1), be_const_var(8) }, + { be_const_key(web_add_management_button, 0), be_const_var(5) }, + { be_const_key(every_100ms, 13), be_const_var(1) }, + { be_const_key(json_append, -1), be_const_var(10) }, + { be_const_key(web_add_button, -1), be_const_var(3) }, })), be_str_literal("Driver") ); diff --git a/lib/libesp32/Berry/default/be_energy_ctypes_definitions.c b/lib/libesp32/berry/default/be_energy_ctypes_definitions.c similarity index 100% rename from lib/libesp32/Berry/default/be_energy_ctypes_definitions.c rename to lib/libesp32/berry/default/be_energy_ctypes_definitions.c diff --git a/lib/libesp32/Berry/default/be_energylib.c b/lib/libesp32/berry/default/be_energylib.c similarity index 100% rename from lib/libesp32/Berry/default/be_energylib.c rename to lib/libesp32/berry/default/be_energylib.c diff --git a/lib/libesp32/Berry/default/be_flash_lib.c b/lib/libesp32/berry/default/be_flash_lib.c similarity index 100% rename from lib/libesp32/Berry/default/be_flash_lib.c rename to lib/libesp32/berry/default/be_flash_lib.c diff --git a/lib/libesp32/Berry/default/be_gpio_lib.c b/lib/libesp32/berry/default/be_gpio_lib.c similarity index 100% rename from lib/libesp32/Berry/default/be_gpio_lib.c rename to lib/libesp32/berry/default/be_gpio_lib.c diff --git a/lib/libesp32/Berry/default/be_i2c_axp192_lib.c b/lib/libesp32/berry/default/be_i2c_axp192_lib.c similarity index 99% rename from lib/libesp32/Berry/default/be_i2c_axp192_lib.c rename to lib/libesp32/berry/default/be_i2c_axp192_lib.c index 4f9f02307..298e7b3a2 100644 --- a/lib/libesp32/Berry/default/be_i2c_axp192_lib.c +++ b/lib/libesp32/berry/default/be_i2c_axp192_lib.c @@ -712,7 +712,7 @@ be_local_closure(AXP192_web_sensor, /* name */ /* K4 */ be_nested_str(_X7Bs_X7DVBus_X20Current_X7Bm_X7D_X25_X2E1f_X20mA_X7Be_X7D), /* K5 */ be_nested_str(_X7Bs_X7DBatt_X20Voltage_X7Bm_X7D_X25_X2E3f_X20V_X7Be_X7D), /* K6 */ be_nested_str(_X7Bs_X7DBatt_X20Current_X7Bm_X7D_X25_X2E1f_X20mA_X7Be_X7D), - /* K7 */ be_nested_str(_X7Bs_X7DTemp_X20AXP_X7Bm_X7D_X25_X2E1f_X20_XB0C_X7Be_X7D), + /* K7 */ be_nested_str(_X7Bs_X7DTemp_X20AXP_X7Bm_X7D_X25_X2E1f_X20_X26deg_X3BC_X7Be_X7D), /* K8 */ be_nested_str(get_vbus_voltage), /* K9 */ be_nested_str(get_bat_voltage), /* K10 */ be_nested_str(get_bat_current), diff --git a/lib/libesp32/Berry/default/be_i2c_driverlib.c b/lib/libesp32/berry/default/be_i2c_driverlib.c similarity index 89% rename from lib/libesp32/Berry/default/be_i2c_driverlib.c rename to lib/libesp32/berry/default/be_i2c_driverlib.c index 45f829e19..a61321c12 100644 --- a/lib/libesp32/Berry/default/be_i2c_driverlib.c +++ b/lib/libesp32/berry/default/be_i2c_driverlib.c @@ -279,7 +279,7 @@ be_local_closure(I2C_Driver_read8, /* name */ ********************************************************************/ be_local_closure(I2C_Driver_init, /* name */ be_nested_proto( - 10, /* nstack */ + 9, /* nstack */ 4, /* argc */ 0, /* varg */ 0, /* has upvals */ @@ -288,7 +288,7 @@ be_local_closure(I2C_Driver_init, /* name */ NULL, /* no sub protos */ 1, /* has constants */ ( &(const bvalue[10]) { /* constants */ - /* K0 */ be_nested_str(get_tasmota), + /* K0 */ be_nested_str(tasmota), /* K1 */ be_nested_str(i2c_enabled), /* K2 */ be_nested_str(addr), /* K3 */ be_nested_str(wire), @@ -302,49 +302,49 @@ be_local_closure(I2C_Driver_init, /* name */ &be_const_str_init, &be_const_str_solidified, ( &(const binstruction[44]) { /* code */ - 0x8C100100, // 0000 GETMET R4 R0 K0 - 0x7C100200, // 0001 CALL R4 1 - 0x4C140000, // 0002 LDNIL R5 - 0x20140605, // 0003 NE R5 R3 R5 - 0x78160004, // 0004 JMPF R5 #000A - 0x8C140901, // 0005 GETMET R5 R4 K1 - 0x5C1C0600, // 0006 MOVE R7 R3 - 0x7C140400, // 0007 CALL R5 2 - 0x74160000, // 0008 JMPT R5 #000A - 0x80000A00, // 0009 RET 0 - 0x90020402, // 000A SETMBR R0 K2 R2 - 0x8C140904, // 000B GETMET R5 R4 K4 - 0x881C0102, // 000C GETMBR R7 R0 K2 - 0x7C140400, // 000D CALL R5 2 - 0x90020605, // 000E SETMBR R0 K3 R5 - 0x88140103, // 000F GETMBR R5 R0 K3 - 0x78160019, // 0010 JMPF R5 #002B - 0x60140004, // 0011 GETGBL R5 G4 - 0x5C180200, // 0012 MOVE R6 R1 - 0x7C140200, // 0013 CALL R5 1 - 0x1C140B05, // 0014 EQ R5 R5 K5 - 0x78160004, // 0015 JMPF R5 #001B - 0x5C140200, // 0016 MOVE R5 R1 - 0x5C180000, // 0017 MOVE R6 R0 - 0x7C140200, // 0018 CALL R5 1 - 0x90020C05, // 0019 SETMBR R0 K6 R5 + 0x4C100000, // 0000 LDNIL R4 + 0x20100604, // 0001 NE R4 R3 R4 + 0x78120005, // 0002 JMPF R4 #0009 + 0xB8120000, // 0003 GETNGBL R4 K0 + 0x8C100901, // 0004 GETMET R4 R4 K1 + 0x5C180600, // 0005 MOVE R6 R3 + 0x7C100400, // 0006 CALL R4 2 + 0x74120000, // 0007 JMPT R4 #0009 + 0x80000800, // 0008 RET 0 + 0x90020402, // 0009 SETMBR R0 K2 R2 + 0xB8120000, // 000A GETNGBL R4 K0 + 0x8C100904, // 000B GETMET R4 R4 K4 + 0x88180102, // 000C GETMBR R6 R0 K2 + 0x7C100400, // 000D CALL R4 2 + 0x90020604, // 000E SETMBR R0 K3 R4 + 0x88100103, // 000F GETMBR R4 R0 K3 + 0x78120019, // 0010 JMPF R4 #002B + 0x60100004, // 0011 GETGBL R4 G4 + 0x5C140200, // 0012 MOVE R5 R1 + 0x7C100200, // 0013 CALL R4 1 + 0x1C100905, // 0014 EQ R4 R4 K5 + 0x78120004, // 0015 JMPF R4 #001B + 0x5C100200, // 0016 MOVE R4 R1 + 0x5C140000, // 0017 MOVE R5 R0 + 0x7C100200, // 0018 CALL R4 1 + 0x90020C04, // 0019 SETMBR R0 K6 R4 0x70020000, // 001A JMP #001C 0x90020C01, // 001B SETMBR R0 K6 R1 - 0x88140106, // 001C GETMBR R5 R0 K6 - 0x4C180000, // 001D LDNIL R6 - 0x1C140A06, // 001E EQ R5 R5 R6 - 0x78160001, // 001F JMPF R5 #0022 - 0x4C140000, // 0020 LDNIL R5 - 0x90020605, // 0021 SETMBR R0 K3 R5 - 0x88140103, // 0022 GETMBR R5 R0 K3 - 0x78160006, // 0023 JMPF R5 #002B - 0x60140001, // 0024 GETGBL R5 G1 - 0x58180007, // 0025 LDCONST R6 K7 - 0x881C0106, // 0026 GETMBR R7 R0 K6 - 0x58200008, // 0027 LDCONST R8 K8 - 0x88240103, // 0028 GETMBR R9 R0 K3 - 0x88241309, // 0029 GETMBR R9 R9 K9 - 0x7C140800, // 002A CALL R5 4 + 0x88100106, // 001C GETMBR R4 R0 K6 + 0x4C140000, // 001D LDNIL R5 + 0x1C100805, // 001E EQ R4 R4 R5 + 0x78120001, // 001F JMPF R4 #0022 + 0x4C100000, // 0020 LDNIL R4 + 0x90020604, // 0021 SETMBR R0 K3 R4 + 0x88100103, // 0022 GETMBR R4 R0 K3 + 0x78120006, // 0023 JMPF R4 #002B + 0x60100001, // 0024 GETGBL R4 G1 + 0x58140007, // 0025 LDCONST R5 K7 + 0x88180106, // 0026 GETMBR R6 R0 K6 + 0x581C0008, // 0027 LDCONST R7 K8 + 0x88200103, // 0028 GETMBR R8 R0 K3 + 0x88201109, // 0029 GETMBR R8 R8 K9 + 0x7C100800, // 002A CALL R4 4 0x80000000, // 002B RET 0 }) ) diff --git a/lib/libesp32/Berry/default/be_i2s_audio_lib.c b/lib/libesp32/berry/default/be_i2s_audio_lib.c similarity index 100% rename from lib/libesp32/Berry/default/be_i2s_audio_lib.c rename to lib/libesp32/berry/default/be_i2s_audio_lib.c diff --git a/lib/libesp32/Berry/default/be_leds_animator_lib.c b/lib/libesp32/berry/default/be_leds_animator_lib.c similarity index 100% rename from lib/libesp32/Berry/default/be_leds_animator_lib.c rename to lib/libesp32/berry/default/be_leds_animator_lib.c diff --git a/lib/libesp32/Berry/default/be_leds_lib.c b/lib/libesp32/berry/default/be_leds_lib.c similarity index 100% rename from lib/libesp32/Berry/default/be_leds_lib.c rename to lib/libesp32/berry/default/be_leds_lib.c diff --git a/lib/libesp32/Berry/default/be_leds_ntv_lib.c b/lib/libesp32/berry/default/be_leds_ntv_lib.c similarity index 100% rename from lib/libesp32/Berry/default/be_leds_ntv_lib.c rename to lib/libesp32/berry/default/be_leds_ntv_lib.c diff --git a/lib/libesp32/Berry/default/be_light_lib.c b/lib/libesp32/berry/default/be_light_lib.c similarity index 100% rename from lib/libesp32/Berry/default/be_light_lib.c rename to lib/libesp32/berry/default/be_light_lib.c diff --git a/lib/libesp32/Berry/default/be_lvgl_clock_icon_lib.c b/lib/libesp32/berry/default/be_lvgl_clock_icon_lib.c similarity index 100% rename from lib/libesp32/Berry/default/be_lvgl_clock_icon_lib.c rename to lib/libesp32/berry/default/be_lvgl_clock_icon_lib.c diff --git a/lib/libesp32/Berry/default/be_lvgl_ctypes_definitions.c b/lib/libesp32/berry/default/be_lvgl_ctypes_definitions.c similarity index 100% rename from lib/libesp32/Berry/default/be_lvgl_ctypes_definitions.c rename to lib/libesp32/berry/default/be_lvgl_ctypes_definitions.c diff --git a/lib/libesp32/Berry/default/be_lvgl_glob_lib.c b/lib/libesp32/berry/default/be_lvgl_glob_lib.c similarity index 93% rename from lib/libesp32/Berry/default/be_lvgl_glob_lib.c rename to lib/libesp32/berry/default/be_lvgl_glob_lib.c index 01bd4ed1d..06827fc0e 100644 --- a/lib/libesp32/Berry/default/be_lvgl_glob_lib.c +++ b/lib/libesp32/berry/default/be_lvgl_glob_lib.c @@ -69,7 +69,7 @@ be_local_closure(LVGL_glob_widget_event_impl, /* name */ }), &be_const_str_widget_event_impl, &be_const_str_solidified, - ( &(const binstruction[30]) { /* code */ + ( &(const binstruction[28]) { /* code */ 0xA40E0000, // 0000 IMPORT R3 K0 0xB8120200, // 0001 GETNGBL R4 K1 0x8C100902, // 0002 GETMET R4 R4 K2 @@ -81,25 +81,23 @@ be_local_closure(LVGL_glob_widget_event_impl, /* name */ 0x7C140400, // 0008 CALL R5 2 0x88180B04, // 0009 GETMBR R6 R5 K4 0x8C1C0105, // 000A GETMET R7 R0 K5 - 0x60240009, // 000B GETGBL R9 G9 - 0x5C280C00, // 000C MOVE R10 R6 - 0x7C240200, // 000D CALL R9 1 - 0x7C1C0400, // 000E CALL R7 2 - 0x60200004, // 000F GETGBL R8 G4 - 0x5C240E00, // 0010 MOVE R9 R7 - 0x7C200200, // 0011 CALL R8 1 - 0x1C201106, // 0012 EQ R8 R8 K6 - 0x78220008, // 0013 JMPF R8 #001D - 0x8C200707, // 0014 GETMET R8 R3 K7 - 0x5C280E00, // 0015 MOVE R10 R7 - 0x582C0008, // 0016 LDCONST R11 K8 - 0x7C200600, // 0017 CALL R8 3 - 0x78220003, // 0018 JMPF R8 #001D - 0x8C200F08, // 0019 GETMET R8 R7 K8 - 0x5C280800, // 001A MOVE R10 R4 - 0x5C2C0A00, // 001B MOVE R11 R5 - 0x7C200600, // 001C CALL R8 3 - 0x80000000, // 001D RET 0 + 0x5C240C00, // 000B MOVE R9 R6 + 0x7C1C0400, // 000C CALL R7 2 + 0x60200004, // 000D GETGBL R8 G4 + 0x5C240E00, // 000E MOVE R9 R7 + 0x7C200200, // 000F CALL R8 1 + 0x1C201106, // 0010 EQ R8 R8 K6 + 0x78220008, // 0011 JMPF R8 #001B + 0x8C200707, // 0012 GETMET R8 R3 K7 + 0x5C280E00, // 0013 MOVE R10 R7 + 0x582C0008, // 0014 LDCONST R11 K8 + 0x7C200600, // 0015 CALL R8 3 + 0x78220003, // 0016 JMPF R8 #001B + 0x8C200F08, // 0017 GETMET R8 R7 K8 + 0x5C280800, // 0018 MOVE R10 R4 + 0x5C2C0A00, // 0019 MOVE R11 R5 + 0x7C200600, // 001A CALL R8 3 + 0x80000000, // 001B RET 0 }) ) ); @@ -130,7 +128,7 @@ be_local_closure(LVGL_glob_lvgl_event_dispatch, /* name */ }), &be_const_str_lvgl_event_dispatch, &be_const_str_solidified, - ( &(const binstruction[20]) { /* code */ + ( &(const binstruction[18]) { /* code */ 0xA40A0000, // 0000 IMPORT R2 K0 0xB80E0200, // 0001 GETNGBL R3 K1 0x8C0C0702, // 0002 GETMET R3 R3 K2 @@ -138,19 +136,17 @@ be_local_closure(LVGL_glob_lvgl_event_dispatch, /* name */ 0x5C1C0200, // 0004 MOVE R7 R1 0x7C140400, // 0005 CALL R5 2 0x7C0C0400, // 0006 CALL R3 2 - 0x60100009, // 0007 GETGBL R4 G9 - 0x88140704, // 0008 GETMBR R5 R3 K4 - 0x7C100200, // 0009 CALL R4 1 - 0x88140105, // 000A GETMBR R5 R0 K5 - 0x94140A04, // 000B GETIDX R5 R5 R4 - 0x8C180106, // 000C GETMET R6 R0 K6 - 0x5C200800, // 000D MOVE R8 R4 - 0x7C180400, // 000E CALL R6 2 - 0x5C1C0A00, // 000F MOVE R7 R5 - 0x5C200C00, // 0010 MOVE R8 R6 - 0x5C240600, // 0011 MOVE R9 R3 - 0x7C1C0400, // 0012 CALL R7 2 - 0x80000000, // 0013 RET 0 + 0x88100704, // 0007 GETMBR R4 R3 K4 + 0x88140105, // 0008 GETMBR R5 R0 K5 + 0x94140A04, // 0009 GETIDX R5 R5 R4 + 0x8C180106, // 000A GETMET R6 R0 K6 + 0x5C200800, // 000B MOVE R8 R4 + 0x7C180400, // 000C CALL R6 2 + 0x5C1C0A00, // 000D MOVE R7 R5 + 0x5C200C00, // 000E MOVE R8 R6 + 0x5C240600, // 000F MOVE R9 R3 + 0x7C1C0400, // 0010 CALL R7 2 + 0x80000000, // 0011 RET 0 }) ) ); @@ -229,7 +225,7 @@ be_local_closure(LVGL_glob_register_obj, /* name */ }), &be_const_str_register_obj, &be_const_str_solidified, - ( &(const binstruction[13]) { /* code */ + ( &(const binstruction[11]) { /* code */ 0x88080100, // 0000 GETMBR R2 R0 K0 0x4C0C0000, // 0001 LDNIL R3 0x1C080403, // 0002 EQ R2 R2 R3 @@ -237,12 +233,10 @@ be_local_closure(LVGL_glob_register_obj, /* name */ 0x60080013, // 0004 GETGBL R2 G19 0x7C080000, // 0005 CALL R2 0 0x90020002, // 0006 SETMBR R0 K0 R2 - 0x60080009, // 0007 GETGBL R2 G9 - 0x880C0301, // 0008 GETMBR R3 R1 K1 - 0x7C080200, // 0009 CALL R2 1 - 0x880C0100, // 000A GETMBR R3 R0 K0 - 0x980C0401, // 000B SETIDX R3 R2 R1 - 0x80000000, // 000C RET 0 + 0x88080301, // 0007 GETMBR R2 R1 K1 + 0x880C0100, // 0008 GETMBR R3 R0 K0 + 0x980C0401, // 0009 SETIDX R3 R2 R1 + 0x80000000, // 000A RET 0 }) ) ); @@ -798,23 +792,23 @@ be_local_class(LVGL_glob, NULL, be_nested_map(20, ( (struct bmapnode*) &(const bmapnode[]) { - { be_const_key(widget_ctor_cb, 9), be_const_var(4) }, + { be_const_key(widget_ctor_cb, 8), be_const_var(4) }, { be_const_key(get_object_from_ptr, 4), be_const_closure(LVGL_glob_get_object_from_ptr_closure) }, { be_const_key(cb_obj, 7), be_const_var(0) }, { be_const_key(widget_struct_by_class, -1), be_const_var(8) }, { be_const_key(widget_event_impl, -1), be_const_closure(LVGL_glob_widget_event_impl_closure) }, { be_const_key(widget_dtor_cb, 6), be_const_var(5) }, { be_const_key(cb_event_closure, -1), be_const_var(1) }, - { be_const_key(lvgl_event_dispatch, 16), be_const_closure(LVGL_glob_lvgl_event_dispatch_closure) }, - { be_const_key(widget_dtor_impl, -1), be_const_closure(LVGL_glob_widget_dtor_impl_closure) }, + { be_const_key(cb_do_nothing, 16), be_const_static_closure(LVGL_glob__anonymous__closure) }, { be_const_key(null_cb, -1), be_const_var(3) }, - { be_const_key(register_obj, 8), be_const_closure(LVGL_glob_register_obj_closure) }, + { be_const_key(register_obj, -1), be_const_closure(LVGL_glob_register_obj_closure) }, + { be_const_key(widget_dtor_impl, 9), be_const_closure(LVGL_glob_widget_dtor_impl_closure) }, { be_const_key(gen_cb, -1), be_const_closure(LVGL_glob_gen_cb_closure) }, - { be_const_key(widget_struct_default, -1), be_const_var(7) }, - { be_const_key(deregister_obj, 12), be_const_closure(LVGL_glob_deregister_obj_closure) }, + { be_const_key(deregister_obj, -1), be_const_closure(LVGL_glob_deregister_obj_closure) }, + { be_const_key(widget_struct_default, 12), be_const_var(7) }, { be_const_key(widget_event_cb, -1), be_const_var(6) }, { be_const_key(widget_cb, -1), be_const_closure(LVGL_glob_widget_cb_closure) }, - { be_const_key(cb_do_nothing, 3), be_const_closure(LVGL_glob__anonymous__closure) }, + { be_const_key(lvgl_event_dispatch, 3), be_const_closure(LVGL_glob_lvgl_event_dispatch_closure) }, { be_const_key(event_cb, -1), be_const_var(2) }, { be_const_key(create_custom_widget, -1), be_const_closure(LVGL_glob_create_custom_widget_closure) }, { be_const_key(widget_ctor_impl, -1), be_const_closure(LVGL_glob_widget_ctor_impl_closure) }, diff --git a/lib/libesp32/Berry/default/be_lvgl_module.c b/lib/libesp32/berry/default/be_lvgl_module.c similarity index 100% rename from lib/libesp32/Berry/default/be_lvgl_module.c rename to lib/libesp32/berry/default/be_lvgl_module.c diff --git a/lib/libesp32/Berry/default/be_lvgl_signal_arcs_lib.c b/lib/libesp32/berry/default/be_lvgl_signal_arcs_lib.c similarity index 100% rename from lib/libesp32/Berry/default/be_lvgl_signal_arcs_lib.c rename to lib/libesp32/berry/default/be_lvgl_signal_arcs_lib.c diff --git a/lib/libesp32/Berry/default/be_lvgl_signal_bars_lib.c b/lib/libesp32/berry/default/be_lvgl_signal_bars_lib.c similarity index 100% rename from lib/libesp32/Berry/default/be_lvgl_signal_bars_lib.c rename to lib/libesp32/berry/default/be_lvgl_signal_bars_lib.c diff --git a/lib/libesp32/Berry/default/be_lvgl_widgets_lib.c b/lib/libesp32/berry/default/be_lvgl_widgets_lib.c similarity index 100% rename from lib/libesp32/Berry/default/be_lvgl_widgets_lib.c rename to lib/libesp32/berry/default/be_lvgl_widgets_lib.c diff --git a/lib/libesp32/Berry/default/be_lvgl_wifi_arcs_icon_lib.c b/lib/libesp32/berry/default/be_lvgl_wifi_arcs_icon_lib.c similarity index 100% rename from lib/libesp32/Berry/default/be_lvgl_wifi_arcs_icon_lib.c rename to lib/libesp32/berry/default/be_lvgl_wifi_arcs_icon_lib.c diff --git a/lib/libesp32/Berry/default/be_lvgl_wifi_arcs_lib.c b/lib/libesp32/berry/default/be_lvgl_wifi_arcs_lib.c similarity index 100% rename from lib/libesp32/Berry/default/be_lvgl_wifi_arcs_lib.c rename to lib/libesp32/berry/default/be_lvgl_wifi_arcs_lib.c diff --git a/lib/libesp32/Berry/default/be_lvgl_wifi_bars_icon_lib.c b/lib/libesp32/berry/default/be_lvgl_wifi_bars_icon_lib.c similarity index 100% rename from lib/libesp32/Berry/default/be_lvgl_wifi_bars_icon_lib.c rename to lib/libesp32/berry/default/be_lvgl_wifi_bars_icon_lib.c diff --git a/lib/libesp32/Berry/default/be_lvgl_wifi_bars_lib.c b/lib/libesp32/berry/default/be_lvgl_wifi_bars_lib.c similarity index 100% rename from lib/libesp32/Berry/default/be_lvgl_wifi_bars_lib.c rename to lib/libesp32/berry/default/be_lvgl_wifi_bars_lib.c diff --git a/lib/libesp32/berry/default/be_md5_lib.c b/lib/libesp32/berry/default/be_md5_lib.c new file mode 100644 index 000000000..2db161a0b --- /dev/null +++ b/lib/libesp32/berry/default/be_md5_lib.c @@ -0,0 +1,100 @@ +/******************************************************************** + * Berry module `webserver` + * + * To use: `import webserver` + * + * Allows to respond to HTTP request + *******************************************************************/ +#include "be_constobj.h" +#include "be_mem.h" +#include "be_exec.h" +#include "esp_rom_md5.h" + +int free_ctx(bvm* vm) { + int argc = be_top(vm); + if (argc > 0) { + be_getmember(vm, 1, ".p"); + md5_context_t * ctx = (md5_context_t *) be_tocomptr(vm, -1); + if (ctx != NULL) { + be_os_free(ctx); + } + } + be_return_nil(vm); +} + +// `Md5.init() -> ` +int32_t m_md5_init(struct bvm *vm); +int32_t m_md5_init(struct bvm *vm) { + + md5_context_t * ctx = (md5_context_t *) be_os_malloc(sizeof(md5_context_t)); + if (!ctx) { + be_throw(vm, BE_MALLOC_FAIL); + } + esp_rom_md5_init(ctx); + + be_newcomobj(vm, ctx, &free_ctx); + be_setmember(vm, 1, ".p"); + be_return_nil(vm); +} + +// `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"); + md5_context_t * ctx; + ctx = (md5_context_t *) be_tocomptr(vm, -1); + if (!ctx) break; + + if (length > 0) { + esp_rom_md5_update(ctx, (const uint8_t*) bytes, length); + } + be_return_nil(vm); + // success + } while (0); + } + be_raise(vm, "value_error", NULL); +} + +// `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"); + md5_context_t * ctx; + ctx = (md5_context_t *) be_tocomptr(vm, -1); + + uint8_t output[16]; + esp_rom_md5_final(output, ctx); + be_pushbytes(vm, output, sizeof(output)); + be_return(vm); +} + +#include "../generate/be_fixed_be_class_md5.h" + +void be_load_md5_lib(bvm *vm) { + be_pushntvclass(vm, &be_class_md5); + be_setglobal(vm, "MD5"); + be_pop(vm, 1); +} +/* @const_object_info_begin + +class be_class_md5 (scope: global, name: MD5) { + .p, var + + init, func(m_md5_init) + update, func(m_md5_update) + finish, func(m_md5_finish) +} +@const_object_info_end */ diff --git a/lib/libesp32/Berry/default/be_modtab.c b/lib/libesp32/berry/default/be_modtab.c similarity index 97% rename from lib/libesp32/Berry/default/be_modtab.c rename to lib/libesp32/berry/default/be_modtab.c index 47db8b24e..934400bbb 100644 --- a/lib/libesp32/Berry/default/be_modtab.c +++ b/lib/libesp32/berry/default/be_modtab.c @@ -23,6 +23,10 @@ be_extern_native_module(solidify); be_extern_native_module(introspect); be_extern_native_module(strict); +/* Berry extensions */ +#include "be_mapping.h" +be_extern_native_module(cb); + /* Tasmota specific */ be_extern_native_module(python_compat); be_extern_native_module(re); @@ -85,6 +89,10 @@ BERRY_LOCAL const bntvmodule* const be_module_table[] = { #if BE_USE_STRICT_MODULE &be_native_module(strict), #endif + + /* Berry extensions */ + &be_native_module(cb), + /* user-defined modules register start */ &be_native_module(python_compat), diff --git a/lib/libesp32/Berry/default/be_onewire_lib.c b/lib/libesp32/berry/default/be_onewire_lib.c similarity index 100% rename from lib/libesp32/Berry/default/be_onewire_lib.c rename to lib/libesp32/berry/default/be_onewire_lib.c diff --git a/lib/libesp32/Berry/default/be_path_tasmota_lib.c b/lib/libesp32/berry/default/be_path_tasmota_lib.c similarity index 100% rename from lib/libesp32/Berry/default/be_path_tasmota_lib.c rename to lib/libesp32/berry/default/be_path_tasmota_lib.c diff --git a/lib/libesp32/Berry/default/be_persist_lib.c b/lib/libesp32/berry/default/be_persist_lib.c similarity index 100% rename from lib/libesp32/Berry/default/be_persist_lib.c rename to lib/libesp32/berry/default/be_persist_lib.c diff --git a/lib/libesp32/Berry/default/be_port.cpp b/lib/libesp32/berry/default/be_port.cpp similarity index 100% rename from lib/libesp32/Berry/default/be_port.cpp rename to lib/libesp32/berry/default/be_port.cpp diff --git a/lib/libesp32/Berry/default/be_python_compat.c b/lib/libesp32/berry/default/be_python_compat.c similarity index 100% rename from lib/libesp32/Berry/default/be_python_compat.c rename to lib/libesp32/berry/default/be_python_compat.c diff --git a/lib/libesp32/Berry/default/be_re_lib.c b/lib/libesp32/berry/default/be_re_lib.c similarity index 100% rename from lib/libesp32/Berry/default/be_re_lib.c rename to lib/libesp32/berry/default/be_re_lib.c diff --git a/lib/libesp32/Berry/default/be_serial_lib.c b/lib/libesp32/berry/default/be_serial_lib.c similarity index 100% rename from lib/libesp32/Berry/default/be_serial_lib.c rename to lib/libesp32/berry/default/be_serial_lib.c diff --git a/lib/libesp32/Berry/default/be_tapp_lib.c b/lib/libesp32/berry/default/be_tapp_lib.c similarity index 100% rename from lib/libesp32/Berry/default/be_tapp_lib.c rename to lib/libesp32/berry/default/be_tapp_lib.c diff --git a/lib/libesp32/Berry/default/be_tasmotalib.c b/lib/libesp32/berry/default/be_tasmotalib.c similarity index 95% rename from lib/libesp32/Berry/default/be_tasmotalib.c rename to lib/libesp32/berry/default/be_tasmotalib.c index e117bae70..6539b0de3 100644 --- a/lib/libesp32/Berry/default/be_tasmotalib.c +++ b/lib/libesp32/berry/default/be_tasmotalib.c @@ -16,7 +16,6 @@ extern int l_arch(bvm *vm); extern int l_publish(bvm *vm); extern int l_publish_result(bvm *vm); extern int l_cmd(bvm *vm); -extern int l_get_cb(bvm *vm); extern int l_getoption(bvm *vm); extern int l_millis(bvm *vm); extern int l_timereached(bvm *vm); @@ -384,7 +383,7 @@ be_local_closure(Tasmota_try_rule, /* name */ ********************************************************************/ be_local_closure(Tasmota_gen_cb, /* name */ be_nested_proto( - 7, /* nstack */ + 6, /* nstack */ 2, /* argc */ 0, /* varg */ 0, /* has upvals */ @@ -392,52 +391,18 @@ be_local_closure(Tasmota_gen_cb, /* name */ 0, /* has sup protos */ NULL, /* no sub protos */ 1, /* has constants */ - ( &(const bvalue[ 7]) { /* constants */ - /* K0 */ be_nested_str(_cb), - /* K1 */ be_const_int(0), - /* K2 */ be_nested_str(find), - /* K3 */ be_nested_str(_get_cb), - /* K4 */ be_nested_str(stop_iteration), - /* K5 */ be_nested_str(internal_error), - /* K6 */ be_nested_str(No_X20callback_X20available), + ( &(const bvalue[ 2]) { /* constants */ + /* K0 */ be_nested_str(cb), + /* K1 */ be_nested_str(gen_cb), }), &be_const_str_gen_cb, &be_const_str_solidified, - ( &(const binstruction[34]) { /* code */ - 0x88080100, // 0000 GETMBR R2 R0 K0 - 0x4C0C0000, // 0001 LDNIL R3 - 0x1C080403, // 0002 EQ R2 R2 R3 - 0x780A0002, // 0003 JMPF R2 #0007 - 0x60080013, // 0004 GETGBL R2 G19 - 0x7C080000, // 0005 CALL R2 0 - 0x90020002, // 0006 SETMBR R0 K0 R2 - 0x60080010, // 0007 GETGBL R2 G16 - 0x540E0012, // 0008 LDINT R3 19 - 0x400E0203, // 0009 CONNECT R3 K1 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 K0 - 0x8C100902, // 000F GETMET R4 R4 K2 - 0x5C180600, // 0010 MOVE R6 R3 - 0x7C100400, // 0011 CALL R4 2 - 0x4C140000, // 0012 LDNIL R5 - 0x1C100805, // 0013 EQ R4 R4 R5 - 0x78120006, // 0014 JMPF R4 #001C - 0x88100100, // 0015 GETMBR R4 R0 K0 - 0x98100601, // 0016 SETIDX R4 R3 R1 - 0x8C100103, // 0017 GETMET R4 R0 K3 - 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 K5 K6 - 0x80000000, // 0021 RET 0 + ( &(const binstruction[ 5]) { /* code */ + 0xA40A0000, // 0000 IMPORT R2 K0 + 0x8C0C0501, // 0001 GETMET R3 R2 K1 + 0x5C140200, // 0002 MOVE R5 R1 + 0x7C0C0400, // 0003 CALL R3 2 + 0x80040600, // 0004 RET 1 R3 }) ) ); @@ -1605,53 +1570,6 @@ be_local_closure(Tasmota_exec_rules, /* name */ /*******************************************************************/ -/******************************************************************** -** Solidified function: cb_dispatch -********************************************************************/ -be_local_closure(Tasmota_cb_dispatch, /* name */ - be_nested_proto( - 12, /* nstack */ - 6, /* argc */ - 0, /* varg */ - 0, /* has upvals */ - NULL, /* no upvals */ - 0, /* has sup protos */ - NULL, /* no sub protos */ - 1, /* has constants */ - ( &(const bvalue[ 3]) { /* constants */ - /* K0 */ be_nested_str(_cb), - /* K1 */ be_const_int(0), - /* K2 */ be_nested_str(find), - }), - &be_const_str_cb_dispatch, - &be_const_str_solidified, - ( &(const binstruction[20]) { /* code */ - 0x88180100, // 0000 GETMBR R6 R0 K0 - 0x4C1C0000, // 0001 LDNIL R7 - 0x1C180C07, // 0002 EQ R6 R6 R7 - 0x781A0000, // 0003 JMPF R6 #0005 - 0x80060200, // 0004 RET 1 K1 - 0x88180100, // 0005 GETMBR R6 R0 K0 - 0x8C180D02, // 0006 GETMET R6 R6 K2 - 0x5C200200, // 0007 MOVE R8 R1 - 0x7C180400, // 0008 CALL R6 2 - 0x4C1C0000, // 0009 LDNIL R7 - 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 K1 - }) - ) -); -/*******************************************************************/ - - /******************************************************************** ** Solidified function: hs2rgb ********************************************************************/ @@ -2072,7 +1990,6 @@ class be_class_tasmota (scope: global, name: Tasmota) { _timers, var _ccmd, var _drivers, var - _cb, var wire1, var wire2, var global, var @@ -2094,7 +2011,6 @@ class be_class_tasmota (scope: global, name: Tasmota) { 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) millis, func(l_millis) time_reached, func(l_timereached) @@ -2155,7 +2071,6 @@ class be_class_tasmota (scope: global, name: Tasmota) { hs2rgb, closure(Tasmota_hs2rgb_closure) - cb_dispatch, closure(Tasmota_cb_dispatch_closure) gen_cb, closure(Tasmota_gen_cb_closure) get_light, closure(Tasmota_get_light_closure) diff --git a/lib/libesp32/Berry/default/be_tcpclient_lib.c b/lib/libesp32/berry/default/be_tcpclient_lib.c similarity index 100% rename from lib/libesp32/Berry/default/be_tcpclient_lib.c rename to lib/libesp32/berry/default/be_tcpclient_lib.c diff --git a/lib/libesp32/Berry/default/be_timer_class.c b/lib/libesp32/berry/default/be_timer_class.c similarity index 100% rename from lib/libesp32/Berry/default/be_timer_class.c rename to lib/libesp32/berry/default/be_timer_class.c diff --git a/lib/libesp32/Berry/default/be_unishox_lib.c b/lib/libesp32/berry/default/be_unishox_lib.c similarity index 100% rename from lib/libesp32/Berry/default/be_unishox_lib.c rename to lib/libesp32/berry/default/be_unishox_lib.c diff --git a/lib/libesp32/Berry/default/be_webclient_lib.c b/lib/libesp32/berry/default/be_webclient_lib.c similarity index 100% rename from lib/libesp32/Berry/default/be_webclient_lib.c rename to lib/libesp32/berry/default/be_webclient_lib.c diff --git a/lib/libesp32/Berry/default/be_webserver_lib.c b/lib/libesp32/berry/default/be_webserver_lib.c similarity index 100% rename from lib/libesp32/Berry/default/be_webserver_lib.c rename to lib/libesp32/berry/default/be_webserver_lib.c diff --git a/lib/libesp32/Berry/default/be_wirelib.c b/lib/libesp32/berry/default/be_wirelib.c similarity index 100% rename from lib/libesp32/Berry/default/be_wirelib.c rename to lib/libesp32/berry/default/be_wirelib.c diff --git a/lib/libesp32/Berry/default/berry_conf.h b/lib/libesp32/berry/default/berry_conf.h similarity index 96% rename from lib/libesp32/Berry/default/berry_conf.h rename to lib/libesp32/berry/default/berry_conf.h index d2284ac31..607a9c612 100644 --- a/lib/libesp32/Berry/default/berry_conf.h +++ b/lib/libesp32/berry/default/berry_conf.h @@ -65,20 +65,14 @@ **/ #define BE_DEBUG_VAR_INFO 0 -/* Macro: BE_USE_OBSERVABILITY_HOOK - * Use the obshook function to report low-level actions. - * Default: 0 - **/ -#define BE_USE_OBSERVABILITY_HOOK 1 - -/* Macro: BE_USE_OBSERVABILITY_HOOK +/* Macro: BE_USE_PERF_COUNTERS * Use the obshook function to report low-level actions. * Default: 0 **/ #define BE_USE_PERF_COUNTERS 1 /* Macro: BE_VM_OBSERVABILITY_SAMPLING - * If BE_USE_OBSERVABILITY_HOOK == 1 and BE_USE_PERF_COUNTERS == 1 + * If BE_USE_PERF_COUNTERS == 1 * then the observability hook is called regularly in the VM loop * allowing to stop infinite loops or too-long running code. * The value is a power of 2. diff --git a/lib/libesp32/Berry/default/embedded/Animate.be b/lib/libesp32/berry/default/embedded/Animate.be similarity index 100% rename from lib/libesp32/Berry/default/embedded/Animate.be rename to lib/libesp32/berry/default/embedded/Animate.be diff --git a/lib/libesp32/Berry/default/embedded/Driver.be b/lib/libesp32/berry/default/embedded/Driver.be similarity index 88% rename from lib/libesp32/Berry/default/embedded/Driver.be rename to lib/libesp32/berry/default/embedded/Driver.be index d0782f024..bb365aa29 100644 --- a/lib/libesp32/Berry/default/embedded/Driver.be +++ b/lib/libesp32/berry/default/embedded/Driver.be @@ -16,13 +16,6 @@ class Driver 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 diff --git a/lib/libesp32/Berry/default/embedded/Tasmota.be b/lib/libesp32/berry/default/embedded/Tasmota.be similarity index 96% rename from lib/libesp32/Berry/default/embedded/Tasmota.be rename to lib/libesp32/berry/default/embedded/Tasmota.be index 3305d57ff..22752a47d 100644 --- a/lib/libesp32/Berry/default/embedded/Tasmota.be +++ b/lib/libesp32/berry/default/embedded/Tasmota.be @@ -21,7 +21,6 @@ class Tasmota var _timers var _ccmd var _drivers - var _cb var wire1 var wire2 var cmd_res # store the command result, nil if disables, true if capture enabled, contains return value @@ -520,28 +519,11 @@ class Tasmota end end - - #- dispatch callback number n, with parameters v0,v1,v2,v3 -# - def cb_dispatch(n,v0,v1,v2,v3) - if self._cb == nil return 0 end - var f = self._cb.find(n) - if f != nil - return f(v0,v1,v2,v3) - end - return 0 - end - #- generate a new C callback and record the associated Berry closure -# def gen_cb(f) - if self._cb == nil self._cb = {} end # create map if not already initialized - for i:0..19 - if self._cb.find(i) == nil - #- free slot -# - self._cb[i] = f - return self._get_cb(i) - end - end - raise "internal_error", "No callback available" + # DEPRECATED + import cb + return cb.gen_cb(f) end #- convert hue/sat to rgb -# diff --git a/lib/libesp32/Berry/default/embedded/Wire.be b/lib/libesp32/berry/default/embedded/Wire.be similarity index 100% rename from lib/libesp32/Berry/default/embedded/Wire.be rename to lib/libesp32/berry/default/embedded/Wire.be diff --git a/lib/libesp32/Berry/default/embedded/autoconf.be b/lib/libesp32/berry/default/embedded/autoconf.be similarity index 100% rename from lib/libesp32/Berry/default/embedded/autoconf.be rename to lib/libesp32/berry/default/embedded/autoconf.be diff --git a/lib/libesp32/Berry/default/embedded/i2c_axp192.be b/lib/libesp32/berry/default/embedded/i2c_axp192.be similarity index 99% rename from lib/libesp32/Berry/default/embedded/i2c_axp192.be rename to lib/libesp32/berry/default/embedded/i2c_axp192.be index 3d958334f..d762b0363 100644 --- a/lib/libesp32/Berry/default/embedded/i2c_axp192.be +++ b/lib/libesp32/berry/default/embedded/i2c_axp192.be @@ -153,7 +153,7 @@ class AXP192 : I2C_Driver "{s}Batt Voltage{m}%.3f V{e}".. "{s}Batt Current{m}%.1f mA{e}".. #"{s}Batt Power{m}%.3f{e}".. - "{s}Temp AXP{m}%.1f °C{e}", + "{s}Temp AXP{m}%.1f °C{e}", self.get_vbus_voltage(), self.get_vbus_voltage(), self.get_bat_voltage(), self.get_bat_current(), #self.get_bat_power(), diff --git a/lib/libesp32/Berry/default/embedded/i2c_driver.be b/lib/libesp32/berry/default/embedded/i2c_driver.be similarity index 97% rename from lib/libesp32/Berry/default/embedded/i2c_driver.be rename to lib/libesp32/berry/default/embedded/i2c_driver.be index a66afa5ad..816a4d9be 100644 --- a/lib/libesp32/Berry/default/embedded/i2c_driver.be +++ b/lib/libesp32/berry/default/embedded/i2c_driver.be @@ -29,8 +29,6 @@ class I2C_Driver - i2c_index : Tasmota I2C index, see `I2CDEVICES.md` (int) --# def init(name_or_detect, addr, i2c_index) - var tasmota = self.get_tasmota() #- retrieve the 'tasmota' singleton -# - #- check if the i2c index is disabled by Tasmota configuration -# if i2c_index != nil && !tasmota.i2c_enabled(i2c_index) return end diff --git a/lib/libesp32/Berry/default/embedded/leds.be b/lib/libesp32/berry/default/embedded/leds.be similarity index 100% rename from lib/libesp32/Berry/default/embedded/leds.be rename to lib/libesp32/berry/default/embedded/leds.be diff --git a/lib/libesp32/Berry/default/embedded/leds_animator.be b/lib/libesp32/berry/default/embedded/leds_animator.be similarity index 100% rename from lib/libesp32/Berry/default/embedded/leds_animator.be rename to lib/libesp32/berry/default/embedded/leds_animator.be diff --git a/lib/libesp32/Berry/default/embedded/lv_clock_icon.be b/lib/libesp32/berry/default/embedded/lv_clock_icon.be similarity index 100% rename from lib/libesp32/Berry/default/embedded/lv_clock_icon.be rename to lib/libesp32/berry/default/embedded/lv_clock_icon.be diff --git a/lib/libesp32/Berry/default/embedded/lv_signal_arcs.be b/lib/libesp32/berry/default/embedded/lv_signal_arcs.be similarity index 100% rename from lib/libesp32/Berry/default/embedded/lv_signal_arcs.be rename to lib/libesp32/berry/default/embedded/lv_signal_arcs.be diff --git a/lib/libesp32/Berry/default/embedded/lv_signal_bars.be b/lib/libesp32/berry/default/embedded/lv_signal_bars.be similarity index 100% rename from lib/libesp32/Berry/default/embedded/lv_signal_bars.be rename to lib/libesp32/berry/default/embedded/lv_signal_bars.be diff --git a/lib/libesp32/Berry/default/embedded/lvgl_glob.be b/lib/libesp32/berry/default/embedded/lvgl_glob.be similarity index 98% rename from lib/libesp32/Berry/default/embedded/lvgl_glob.be rename to lib/libesp32/berry/default/embedded/lvgl_glob.be index f7f6b8e84..04250ff54 100644 --- a/lib/libesp32/Berry/default/embedded/lvgl_glob.be +++ b/lib/libesp32/berry/default/embedded/lvgl_glob.be @@ -23,8 +23,7 @@ class LVGL_glob #- register an lv.lv_* object in the mapping -# def register_obj(obj) if self.cb_obj == nil self.cb_obj = {} end - var native_ptr = int(obj._p) - self.cb_obj[native_ptr] = obj + self.cb_obj[obj._p] = obj end def get_object_from_ptr(ptr) @@ -38,7 +37,7 @@ class LVGL_glob var event = lv.lv_event(introspect.toptr(event_ptr)) - var target = int(event.target) + var target = event.target var f = self.cb_event_closure[target] var obj = self.get_object_from_ptr(target) #print('>> lvgl_event_dispatch', f, obj, event) @@ -87,7 +86,7 @@ class LVGL_glob var cl = lv.lv_obj_class(cl_ptr) var event = lv.lv_event(e_ptr) var obj_ptr = event.target - var obj = self.get_object_from_ptr(int(obj_ptr)) + var obj = self.get_object_from_ptr(obj_ptr) if type(obj) == 'instance' && introspect.get(obj, 'widget_event') obj.widget_event(cl, event) end diff --git a/lib/libesp32/Berry/default/embedded/openhasp.be b/lib/libesp32/berry/default/embedded/openhasp.be similarity index 100% rename from lib/libesp32/Berry/default/embedded/openhasp.be rename to lib/libesp32/berry/default/embedded/openhasp.be diff --git a/lib/libesp32/Berry/default/embedded/openhasp/demo-all.jsonl b/lib/libesp32/berry/default/embedded/openhasp/demo-all.jsonl similarity index 100% rename from lib/libesp32/Berry/default/embedded/openhasp/demo-all.jsonl rename to lib/libesp32/berry/default/embedded/openhasp/demo-all.jsonl diff --git a/lib/libesp32/Berry/default/embedded/openhasp/demo1.jsonl b/lib/libesp32/berry/default/embedded/openhasp/demo1.jsonl similarity index 100% rename from lib/libesp32/Berry/default/embedded/openhasp/demo1.jsonl rename to lib/libesp32/berry/default/embedded/openhasp/demo1.jsonl diff --git a/lib/libesp32/Berry/default/embedded/openhasp/demo2.jsonl b/lib/libesp32/berry/default/embedded/openhasp/demo2.jsonl similarity index 100% rename from lib/libesp32/Berry/default/embedded/openhasp/demo2.jsonl rename to lib/libesp32/berry/default/embedded/openhasp/demo2.jsonl diff --git a/lib/libesp32/Berry/default/embedded/openhasp/demo3.jsonl b/lib/libesp32/berry/default/embedded/openhasp/demo3.jsonl similarity index 100% rename from lib/libesp32/Berry/default/embedded/openhasp/demo3.jsonl rename to lib/libesp32/berry/default/embedded/openhasp/demo3.jsonl diff --git a/lib/libesp32/Berry/default/embedded/persist.be b/lib/libesp32/berry/default/embedded/persist.be similarity index 100% rename from lib/libesp32/Berry/default/embedded/persist.be rename to lib/libesp32/berry/default/embedded/persist.be diff --git a/lib/libesp32/Berry/default/embedded/tapp.be b/lib/libesp32/berry/default/embedded/tapp.be similarity index 100% rename from lib/libesp32/Berry/default/embedded/tapp.be rename to lib/libesp32/berry/default/embedded/tapp.be diff --git a/lib/libesp32/Berry/default/embedded/test_crypto.be b/lib/libesp32/berry/default/embedded/test_crypto.be similarity index 100% rename from lib/libesp32/Berry/default/embedded/test_crypto.be rename to lib/libesp32/berry/default/embedded/test_crypto.be diff --git a/lib/libesp32/Berry/default/static_block.hpp b/lib/libesp32/berry/default/static_block.hpp similarity index 100% rename from lib/libesp32/Berry/default/static_block.hpp rename to lib/libesp32/berry/default/static_block.hpp diff --git a/lib/libesp32/Berry/examples/anon_func.be b/lib/libesp32/berry/examples/anon_func.be similarity index 100% rename from lib/libesp32/Berry/examples/anon_func.be rename to lib/libesp32/berry/examples/anon_func.be diff --git a/lib/libesp32/Berry/examples/bigloop.be b/lib/libesp32/berry/examples/bigloop.be similarity index 100% rename from lib/libesp32/Berry/examples/bigloop.be rename to lib/libesp32/berry/examples/bigloop.be diff --git a/lib/libesp32/Berry/examples/bintree.be b/lib/libesp32/berry/examples/bintree.be similarity index 100% rename from lib/libesp32/Berry/examples/bintree.be rename to lib/libesp32/berry/examples/bintree.be diff --git a/lib/libesp32/Berry/examples/calcpi.be b/lib/libesp32/berry/examples/calcpi.be similarity index 100% rename from lib/libesp32/Berry/examples/calcpi.be rename to lib/libesp32/berry/examples/calcpi.be diff --git a/lib/libesp32/Berry/examples/exception.be b/lib/libesp32/berry/examples/exception.be similarity index 100% rename from lib/libesp32/Berry/examples/exception.be rename to lib/libesp32/berry/examples/exception.be diff --git a/lib/libesp32/Berry/examples/fib_rec.be b/lib/libesp32/berry/examples/fib_rec.be similarity index 100% rename from lib/libesp32/Berry/examples/fib_rec.be rename to lib/libesp32/berry/examples/fib_rec.be diff --git a/lib/libesp32/Berry/examples/guess_number.be b/lib/libesp32/berry/examples/guess_number.be similarity index 100% rename from lib/libesp32/Berry/examples/guess_number.be rename to lib/libesp32/berry/examples/guess_number.be diff --git a/lib/libesp32/Berry/examples/json.be b/lib/libesp32/berry/examples/json.be similarity index 100% rename from lib/libesp32/Berry/examples/json.be rename to lib/libesp32/berry/examples/json.be diff --git a/lib/libesp32/Berry/examples/lambda.be b/lib/libesp32/berry/examples/lambda.be similarity index 100% rename from lib/libesp32/Berry/examples/lambda.be rename to lib/libesp32/berry/examples/lambda.be diff --git a/lib/libesp32/Berry/examples/listdir.be b/lib/libesp32/berry/examples/listdir.be similarity index 100% rename from lib/libesp32/Berry/examples/listdir.be rename to lib/libesp32/berry/examples/listdir.be diff --git a/lib/libesp32/Berry/examples/qsort.be b/lib/libesp32/berry/examples/qsort.be similarity index 100% rename from lib/libesp32/Berry/examples/qsort.be rename to lib/libesp32/berry/examples/qsort.be diff --git a/lib/libesp32/Berry/examples/repl.be b/lib/libesp32/berry/examples/repl.be similarity index 100% rename from lib/libesp32/Berry/examples/repl.be rename to lib/libesp32/berry/examples/repl.be diff --git a/lib/libesp32/Berry/examples/string.be b/lib/libesp32/berry/examples/string.be similarity index 100% rename from lib/libesp32/Berry/examples/string.be rename to lib/libesp32/berry/examples/string.be diff --git a/lib/libesp32/Berry/examples/strmod.be b/lib/libesp32/berry/examples/strmod.be similarity index 100% rename from lib/libesp32/Berry/examples/strmod.be rename to lib/libesp32/berry/examples/strmod.be diff --git a/lib/libesp32/berry/gen.sh b/lib/libesp32/berry/gen.sh new file mode 100755 index 000000000..303a62c95 --- /dev/null +++ b/lib/libesp32/berry/gen.sh @@ -0,0 +1,2 @@ +#!/bin/bash +python3 tools/pycoc/main.py -o generate src default ../berry_mapping/src -c default/berry_conf.h diff --git a/lib/libesp32/Berry/generate/be_const_strtab.h b/lib/libesp32/berry/generate/be_const_strtab.h similarity index 99% rename from lib/libesp32/Berry/generate/be_const_strtab.h rename to lib/libesp32/berry/generate/be_const_strtab.h index 9692c8508..cdf680ea3 100644 --- a/lib/libesp32/Berry/generate/be_const_strtab.h +++ b/lib/libesp32/berry/generate/be_const_strtab.h @@ -48,7 +48,6 @@ extern const bcstring be_const_str_I2C_X3A; extern const bcstring be_const_str_LVG_X3A_X20call_X20to_X20unsupported_X20callback; extern const bcstring be_const_str_Leds; extern const bcstring be_const_str_MD5; -extern const bcstring be_const_str_No_X20callback_X20available; extern const bcstring be_const_str_None; extern const bcstring be_const_str_OPTION_A; extern const bcstring be_const_str_OneWire; @@ -163,7 +162,7 @@ extern const bcstring be_const_str__X7B; extern const bcstring be_const_str__X7B_X7D; extern const bcstring be_const_str__X7Bs_X7DBatt_X20Current_X7Bm_X7D_X25_X2E1f_X20mA_X7Be_X7D; extern const bcstring be_const_str__X7Bs_X7DBatt_X20Voltage_X7Bm_X7D_X25_X2E3f_X20V_X7Be_X7D; -extern const bcstring be_const_str__X7Bs_X7DTemp_X20AXP_X7Bm_X7D_X25_X2E1f_X20_XB0C_X7Be_X7D; +extern const bcstring be_const_str__X7Bs_X7DTemp_X20AXP_X7Bm_X7D_X25_X2E1f_X20_X26deg_X3BC_X7Be_X7D; extern const bcstring be_const_str__X7Bs_X7DVBus_X20Current_X7Bm_X7D_X25_X2E1f_X20mA_X7Be_X7D; extern const bcstring be_const_str__X7Bs_X7DVBus_X20Voltage_X7Bm_X7D_X25_X2E3f_X20V_X7Be_X7D; extern const bcstring be_const_str__X7D; @@ -175,7 +174,6 @@ extern const bcstring be_const_str__archive; extern const bcstring be_const_str__available; extern const bcstring be_const_str__begin_transmission; extern const bcstring be_const_str__buffer; -extern const bcstring be_const_str__cb; extern const bcstring be_const_str__ccmd; extern const bcstring be_const_str__class; extern const bcstring be_const_str__cmd; @@ -187,7 +185,6 @@ extern const bcstring be_const_str__end_transmission; extern const bcstring be_const_str__energy; extern const bcstring be_const_str__error; extern const bcstring be_const_str__filename; -extern const bcstring be_const_str__get_cb; extern const bcstring be_const_str__global_addr; extern const bcstring be_const_str__global_def; extern const bcstring be_const_str__lvgl; @@ -250,7 +247,7 @@ extern const bcstring be_const_str_call; extern const bcstring be_const_str_call_native; extern const bcstring be_const_str_calldepth; extern const bcstring be_const_str_can_show; -extern const bcstring be_const_str_cb_dispatch; +extern const bcstring be_const_str_cb; extern const bcstring be_const_str_cb_do_nothing; extern const bcstring be_const_str_cb_event_closure; extern const bcstring be_const_str_cb_obj; @@ -384,6 +381,7 @@ extern const bcstring be_const_str_get_bat_power; extern const bcstring be_const_str_get_bat_voltage; extern const bcstring be_const_str_get_battery_chargin_status; extern const bcstring be_const_str_get_bri; +extern const bcstring be_const_str_get_cb_list; extern const bcstring be_const_str_get_coords; extern const bcstring be_const_str_get_current_module_name; extern const bcstring be_const_str_get_current_module_path; @@ -402,7 +400,6 @@ extern const bcstring be_const_str_get_style_bg_color; extern const bcstring be_const_str_get_style_line_color; extern const bcstring be_const_str_get_style_pad_right; extern const bcstring be_const_str_get_switch; -extern const bcstring be_const_str_get_tasmota; extern const bcstring be_const_str_get_temp; extern const bcstring be_const_str_get_vbus_current; extern const bcstring be_const_str_get_vbus_voltage; @@ -556,7 +553,6 @@ extern const bcstring be_const_str_readline; extern const bcstring be_const_str_real; extern const bcstring be_const_str_reapply; extern const bcstring be_const_str_redirect; -extern const bcstring be_const_str_reduce; extern const bcstring be_const_str_refr_size; extern const bcstring be_const_str_register_obj; extern const bcstring be_const_str_remove; diff --git a/lib/libesp32/Berry/generate/be_const_strtab_def.h b/lib/libesp32/berry/generate/be_const_strtab_def.h similarity index 61% rename from lib/libesp32/Berry/generate/be_const_strtab_def.h rename to lib/libesp32/berry/generate/be_const_strtab_def.h index 44676a35e..cd2198905 100644 --- a/lib/libesp32/Berry/generate/be_const_strtab_def.h +++ b/lib/libesp32/berry/generate/be_const_strtab_def.h @@ -1,720 +1,716 @@ -be_define_const_str(, "", 2166136261u, 0, 0, &be_const_str_True); -be_define_const_str(_X0A, "\n", 252472541u, 0, 1, &be_const_str_i2c_enabled); -be_define_const_str(_X20, " ", 621580159u, 0, 1, &be_const_str_add_cmd); -be_define_const_str(_X21_X3D, "!=", 2428715011u, 0, 2, &be_const_str__X23autoexec_X2Ebe); -be_define_const_str(_X21_X3D_X3D, "!==", 559817114u, 0, 3, &be_const_str__X2Ew); -be_define_const_str(_X23, "#", 638357778u, 0, 1, &be_const_str_No_X20callback_X20available); -be_define_const_str(_X23autoexec_X2Ebat, "#autoexec.bat", 3382890497u, 0, 13, NULL); -be_define_const_str(_X23autoexec_X2Ebe, "#autoexec.be", 1181757091u, 0, 12, &be_const_str_assert); -be_define_const_str(_X23display_X2Eini, "#display.ini", 182218220u, 0, 12, &be_const_str_code); -be_define_const_str(_X23init_X2Ebat, "#init.bat", 3297595077u, 0, 9, &be_const_str__X2502d_X25s_X2502d); -be_define_const_str(_X23preinit_X2Ebe, "#preinit.be", 687035716u, 0, 11, &be_const_str__timers); -be_define_const_str(_X2502d_X25s_X2502d, "%02d%s%02d", 1587999717u, 0, 10, &be_const_str__X3D_X3C_X3E_X21); -be_define_const_str(_X2504d_X2D_X2502d_X2D_X2502dT_X2502d_X3A_X2502d_X3A_X2502d, "%04d-%02d-%02dT%02d:%02d:%02d", 3425528601u, 0, 29, &be_const_str_get_object_from_ptr); -be_define_const_str(_X25s_X2Eautoconf, "%s.autoconf", 3560383524u, 0, 11, &be_const_str_RES_OK); -be_define_const_str(_X26lt_X3BError_X3A_X20apply_X20new_X20or_X20remove_X26gt_X3B, "<Error: apply new or remove>", 2855507949u, 0, 34, &be_const_str_hs2rgb); -be_define_const_str(_X26lt_X3BNone_X26gt_X3B, "<None>", 2602165498u, 0, 12, &be_const_str__X2Fac); -be_define_const_str(_X28_X29, "()", 685372826u, 0, 2, NULL); -be_define_const_str(_X2B, "+", 772578730u, 0, 1, &be_const_str_lower); -be_define_const_str(_X2C, ",", 688690635u, 0, 1, &be_const_str_SERIAL_7O1); -be_define_const_str(_X2D_X2D_X3A_X2D_X2D, "--:--", 1370615441u, 0, 5, &be_const_str__X3Cp_X3ECurrent_X20configuration_X3A_X20_X3C_X2Fp_X3E_X3Cp_X3E_X3Cb_X3E_X25s_X3C_X2Fb_X3E_X3C_X2Fp_X3E); -be_define_const_str(_X2E, ".", 722245873u, 0, 1, &be_const_str_search); -be_define_const_str(_X2E_X2E, "..", 2748622605u, 0, 2, &be_const_str__debug_present); -be_define_const_str(_X2Eautoconf, ".autoconf", 2524679088u, 0, 9, &be_const_str_false); -be_define_const_str(_X2Ebe, ".be", 1325797348u, 0, 3, &be_const_str_Tasmota); -be_define_const_str(_X2Ebec, ".bec", 3985273221u, 0, 4, &be_const_str_CFG_X3A_X20downloading_X20_X27_X25s_X27); -be_define_const_str(_X2Elen, ".len", 850842136u, 0, 4, &be_const_str__X3Cselect_X20name_X3D_X27zip_X27_X3E); -be_define_const_str(_X2Ep, ".p", 1171526419u, 0, 2, NULL); -be_define_const_str(_X2Ep1, ".p1", 249175686u, 0, 3, &be_const_str__t); -be_define_const_str(_X2Ep2, ".p2", 232398067u, 0, 3, &be_const_str_BRY_X3A_X20could_X20not_X20save_X20compiled_X20file_X20_X25s_X20_X28_X25s_X29); -be_define_const_str(_X2Esize, ".size", 1965188224u, 0, 5, &be_const_str_is_first_time); -be_define_const_str(_X2Etapp, ".tapp", 1363391594u, 0, 5, &be_const_str__X7B); -be_define_const_str(_X2Ew, ".w", 1255414514u, 0, 2, &be_const_str_clear); -be_define_const_str(_X2F, "/", 705468254u, 0, 1, &be_const_str_SERIAL_7O2); -be_define_const_str(_X2F_X2Eautoconf, "/.autoconf", 2212074393u, 0, 10, &be_const_str_CFG_X3A_X20exception_X20_X27_X25s_X27_X20_X2D_X20_X27_X25s_X27); -be_define_const_str(_X2F_X3Frst_X3D, "/?rst=", 580074707u, 0, 6, &be_const_str_SERIAL_7N2); -be_define_const_str(_X2Fac, "/ac", 3904651978u, 0, 3, &be_const_str_WS2812); -be_define_const_str(_X3A, ":", 1057798253u, 0, 1, &be_const_str_AudioFileSourceFS); -be_define_const_str(_X3C, "<", 957132539u, 0, 1, &be_const_str_digital_write); -be_define_const_str(_X3C_X2Fform_X3E_X3C_X2Fp_X3E, "

", 3546571739u, 0, 11, &be_const_str_LVG_X3A_X20call_X20to_X20unsupported_X20callback); -be_define_const_str(_X3C_X2Fselect_X3E_X3Cp_X3E_X3C_X2Fp_X3E, "

", 1863865923u, 0, 16, &be_const_str_rule); -be_define_const_str(_X3C_X3D, "<=", 2499223986u, 0, 2, &be_const_str_set_chg_current); -be_define_const_str(_X3Cbutton_X20name_X3D_X27reapply_X27_X20class_X3D_X27button_X20bgrn_X27_X3ERe_X2Dapply_X20current_X20configuration_X3C_X2Fbutton_X3E, "", 3147934216u, 0, 82, &be_const_str_find_op); -be_define_const_str(_X3Cbutton_X20name_X3D_X27zipapply_X27_X20class_X3D_X27button_X20bgrn_X27_X3EApply_X20configuration_X3C_X2Fbutton_X3E, "", 1205771629u, 0, 72, NULL); -be_define_const_str(_X3Cfieldset_X3E_X3Cstyle_X3E_X2Ebdis_X7Bbackground_X3A_X23888_X3B_X7D_X2Ebdis_X3Ahover_X7Bbackground_X3A_X23888_X3B_X7D_X3C_X2Fstyle_X3E, "
", 842307168u, 0, 77, &be_const_str_get_current_module_path); -be_define_const_str(_X3Cinstance_X3A_X20_X25s_X28_X25s_X2C_X20_X25s_X2C_X20_X25s_X29, "Choose a device configuration:
", 1336654704u, 0, 49, &be_const_str_delay); -be_define_const_str(_X3Clambda_X3E, "", 607256038u, 0, 8, &be_const_str__X3Cp_X3E_X3Cform_X20id_X3Dreapply_X20style_X3D_X27display_X3A_X20block_X3B_X27_X20action_X3D_X27_X2Fac_X27_X20method_X3D_X27post_X27_X20); -be_define_const_str(_X3Clegend_X3E_X3Cb_X20title_X3D_X27Autoconfiguration_X27_X3E_X26nbsp_X3BCurrent_X20auto_X2Dconfiguration_X3C_X2Fb_X3E_X3C_X2Flegend_X3E, " Current auto-configuration", 4212500780u, 0, 82, &be_const_str_CFG_X3A_X20could_X20not_X20run_X20_X25s_X20_X28_X25s_X20_X2D_X20_X25s_X29); -be_define_const_str(_X3Clegend_X3E_X3Cb_X20title_X3D_X27New_X20autoconf_X27_X3E_X26nbsp_X3BSelect_X20new_X20auto_X2Dconfiguration_X3C_X2Fb_X3E_X3C_X2Flegend_X3E, " Select new auto-configuration", 1926223891u, 0, 80, &be_const_str_CFG_X3A_X20multiple_X20autoconf_X20files_X20found_X2C_X20aborting_X20_X28_X27_X25s_X27_X20_X2B_X20_X27_X25s_X27_X29); -be_define_const_str(_X3Coption_X20value_X3D_X27_X25s_X27_X3E_X25s_X3C_X2Foption_X3E, "", 510303524u, 0, 30, &be_const_str_write); -be_define_const_str(_X3Coption_X20value_X3D_X27reset_X27_X3E_X26lt_X3BRemove_X20autoconf_X26gt_X3B_X3C_X2Foption_X3E, "", 3994619755u, 0, 54, &be_const_str_None); -be_define_const_str(_X3Cp_X20style_X3D_X27width_X3A340px_X3B_X27_X3E_X3Cb_X3EException_X3A_X3C_X2Fb_X3E_X3Cbr_X3E_X27_X25s_X27_X3Cbr_X3E_X25s_X3C_X2Fp_X3E, "

Exception:
'%s'
%s

", 4252565082u, 0, 59, &be_const_str_classof); -be_define_const_str(_X3Cp_X3E_X3C_X2Fp_X3E_X3C_X2Ffieldset_X3E_X3Cp_X3E_X3C_X2Fp_X3E, "

", 2052843416u, 0, 25, &be_const_str_button_pressed); -be_define_const_str(_X3Cp_X3E_X3Cform_X20id_X3Dac_X20action_X3D_X27ac_X27_X20style_X3D_X27display_X3A_X20block_X3B_X27_X20method_X3D_X27get_X27_X3E_X3Cbutton_X3E_X26_X23129668_X3B_X20Auto_X2Dconfiguration_X3C_X2Fbutton_X3E_X3C_X2Fform_X3E_X3C_X2Fp_X3E, "

", 452285201u, 0, 120, NULL); -be_define_const_str(_X3Cp_X3E_X3Cform_X20id_X3Dreapply_X20style_X3D_X27display_X3A_X20block_X3B_X27_X20action_X3D_X27_X2Fac_X27_X20method_X3D_X27post_X27_X20, "

 (This feature requires an internet connection)

", 2719266486u, 0, 74, NULL); -be_define_const_str(_X3Cp_X3ECurrent_X20configuration_X3A_X20_X3C_X2Fp_X3E_X3Cp_X3E_X3Cb_X3E_X25s_X3C_X2Fb_X3E_X3C_X2Fp_X3E, "

Current configuration:

%s

", 4115655761u, 0, 46, &be_const_str_exec_tele); -be_define_const_str(_X3Cselect_X20name_X3D_X27zip_X27_X3E, "

", 1863865923u, 0, 16, NULL); +be_define_const_str(_X3C_X3D, "<=", 2499223986u, 0, 2, &be_const_str_remove_rule); +be_define_const_str(_X3Cbutton_X20name_X3D_X27reapply_X27_X20class_X3D_X27button_X20bgrn_X27_X3ERe_X2Dapply_X20current_X20configuration_X3C_X2Fbutton_X3E, "", 3147934216u, 0, 82, &be_const_str___lower__); +be_define_const_str(_X3Cbutton_X20name_X3D_X27zipapply_X27_X20class_X3D_X27button_X20bgrn_X27_X3EApply_X20configuration_X3C_X2Fbutton_X3E, "", 1205771629u, 0, 72, &be_const_str_content_send_style); +be_define_const_str(_X3Cfieldset_X3E_X3Cstyle_X3E_X2Ebdis_X7Bbackground_X3A_X23888_X3B_X7D_X2Ebdis_X3Ahover_X7Bbackground_X3A_X23888_X3B_X7D_X3C_X2Fstyle_X3E, "
", 842307168u, 0, 77, &be_const_str_bri); +be_define_const_str(_X3Cinstance_X3A_X20_X25s_X28_X25s_X2C_X20_X25s_X2C_X20_X25s_X29, "Choose a device configuration:
", 1336654704u, 0, 49, &be_const_str_cosh); +be_define_const_str(_X3Clambda_X3E, "", 607256038u, 0, 8, &be_const_str_item); +be_define_const_str(_X3Clegend_X3E_X3Cb_X20title_X3D_X27Autoconfiguration_X27_X3E_X26nbsp_X3BCurrent_X20auto_X2Dconfiguration_X3C_X2Fb_X3E_X3C_X2Flegend_X3E, " Current auto-configuration", 4212500780u, 0, 82, &be_const_str_AXP192); +be_define_const_str(_X3Clegend_X3E_X3Cb_X20title_X3D_X27New_X20autoconf_X27_X3E_X26nbsp_X3BSelect_X20new_X20auto_X2Dconfiguration_X3C_X2Fb_X3E_X3C_X2Flegend_X3E, " Select new auto-configuration", 1926223891u, 0, 80, &be_const_str_internal_error); +be_define_const_str(_X3Coption_X20value_X3D_X27_X25s_X27_X3E_X25s_X3C_X2Foption_X3E, "", 510303524u, 0, 30, &be_const_str_enabled); +be_define_const_str(_X3Coption_X20value_X3D_X27reset_X27_X3E_X26lt_X3BRemove_X20autoconf_X26gt_X3B_X3C_X2Foption_X3E, "", 3994619755u, 0, 54, &be_const_str_widget_cb); +be_define_const_str(_X3Cp_X20style_X3D_X27width_X3A340px_X3B_X27_X3E_X3Cb_X3EException_X3A_X3C_X2Fb_X3E_X3Cbr_X3E_X27_X25s_X27_X3Cbr_X3E_X25s_X3C_X2Fp_X3E, "

Exception:
'%s'
%s

", 4252565082u, 0, 59, &be_const_str_EVENT_DRAW_MAIN); +be_define_const_str(_X3Cp_X3E_X3C_X2Fp_X3E_X3C_X2Ffieldset_X3E_X3Cp_X3E_X3C_X2Fp_X3E, "

", 2052843416u, 0, 25, &be_const_str_allocated); +be_define_const_str(_X3Cp_X3E_X3Cform_X20id_X3Dac_X20action_X3D_X27ac_X27_X20style_X3D_X27display_X3A_X20block_X3B_X27_X20method_X3D_X27get_X27_X3E_X3Cbutton_X3E_X26_X23129668_X3B_X20Auto_X2Dconfiguration_X3C_X2Fbutton_X3E_X3C_X2Fform_X3E_X3C_X2Fp_X3E, "

", 452285201u, 0, 120, &be_const_str_CFG_X3A_X20Exception_X3E_X20_X27_X25s_X27_X20_X2D_X20_X25s); +be_define_const_str(_X3Cp_X3E_X3Cform_X20id_X3Dreapply_X20style_X3D_X27display_X3A_X20block_X3B_X27_X20action_X3D_X27_X2Fac_X27_X20method_X3D_X27post_X27_X20, "

 (This feature requires an internet connection)

", 2719266486u, 0, 74, &be_const_str_str); +be_define_const_str(_X3Cp_X3ECurrent_X20configuration_X3A_X20_X3C_X2Fp_X3E_X3Cp_X3E_X3Cb_X3E_X25s_X3C_X2Fb_X3E_X3C_X2Fp_X3E, "

Current configuration:

%s

", 4115655761u, 0, 46, &be_const_str_gc); +be_define_const_str(_X3Cselect_X20name_X3D_X27zip_X27_X3E, ""; const char SCRIPT_MSG_PULLDOWNa[] PROGMEM = - "
"; const char SCRIPT_MSG_PULLDOWNb[] PROGMEM = ""; const char SCRIPT_MSG_PULLDOWNc[] PROGMEM = @@ -7255,6 +7431,10 @@ const char SCRIPT_MSG_PULLDOWNc[] PROGMEM = const char SCRIPT_MSG_TEXTINP[] PROGMEM = "
"; +const char SCRIPT_MSG_TEXTINP_U[] PROGMEM = + "
"; + + const char SCRIPT_MSG_NUMINP[] PROGMEM = "
"; @@ -7502,6 +7682,21 @@ void ScriptWebShow(char mc) { optflg = 0; } // check for input elements + // prescan for html tags + /* + restart: + //if (*lp == 0 || *lp == SCRIPT_EOL) + if (*lin == '<') { + char *cp = strchr(lin, '>'); + if (cp) { + char svd = *(cp + 1); + *(cp + 1) = 0; + WSContentSend_PD("%s", lin); + *(cp + 1) = svd; + lin = cp + 1; + } + }*/ + if (!strncmp(lin, "sl(", 3)) { // insert slider sl(min max var left mid right) char *lp = lin; @@ -7576,6 +7771,28 @@ void ScriptWebShow(char mc) { while (*lp) { SCRIPT_SKIP_SPACES lp = GetStringArgument(lp, OPER_EQU, pulabel, 0); + if (index == 1 && pulabel[0] == '#') { + // number range + char *cp = &pulabel[1]; + uint8_t from = strtol(cp, &cp, 10); + uint8_t to = from; + if (*cp == '-') { + cp++; + to = strtol(cp, &cp, 10); + } + for (uint32_t cnt = from; cnt <= to; cnt++) { + sprintf(pulabel, "%d", cnt); + if (val == index) { + cp = (char*)"selected"; + } else { + cp = (char*)""; + } + WSContentSend_PD(SCRIPT_MSG_PULLDOWNb, cp, index, pulabel); + index++; + } + break; + } + char *cp; if (val == index) { cp = (char*)"selected"; @@ -7654,11 +7871,26 @@ void ScriptWebShow(char mc) { SCRIPT_SKIP_SPACES char label[SCRIPT_MAXSSIZE]; lp = GetStringArgument(lp, OPER_EQU, label, 0); - char vname[16]; ScriptGetVarname(vname, slp, sizeof(vname)); - - WSContentSend_PD(SCRIPT_MSG_TEXTINP, label, str, vname); + SCRIPT_SKIP_SPACES + if (*lp != ')') { + char type[SCRIPT_MAXSSIZE]; + lp = GetStringArgument(lp, OPER_EQU, type, 0); + SCRIPT_SKIP_SPACES + // also requires min max values + char min[SCRIPT_MAXSSIZE]; + lp = GetStringArgument(lp, OPER_EQU, min, 0); + SCRIPT_SKIP_SPACES + char max[SCRIPT_MAXSSIZE]; + lp = GetStringArgument(lp, OPER_EQU, max, 0); + SCRIPT_SKIP_SPACES + WSContentSend_PD(SCRIPT_MSG_TEXTINP_U, label, type, str, min, max, vname); + } else { + WSContentSend_PD(SCRIPT_MSG_TEXTINP, label, str, vname); + } + lp++; + //goto restart; } else if (!strncmp(lin, "nm(", 3)) { char *lp = lin; @@ -8210,11 +8442,17 @@ int32_t url2file(uint8_t fref, char *url) { WiFiClient http_client; HTTPClient http; int32_t httpCode = 0; - char hbuff[128]; - strcpy(hbuff, "http://"); - strcat(hbuff, url); - http.begin(http_client, UrlEncode(hbuff)); - httpCode = http.GET(); + String weburl = "http://"+UrlEncode(url); + for (uint32_t retry = 0; retry < 15; retry++) { + http.begin(http_client, weburl); + httpCode = http.GET(); + if (httpCode > 0) { + break; + } + } + if (httpCode < 0) { + AddLog(LOG_LEVEL_INFO,PSTR("HTTP error %d = %s"), httpCode, http.errorToString(httpCode).c_str()); + } if (httpCode == HTTP_CODE_OK || httpCode == HTTP_CODE_MOVED_PERMANENTLY) { WiFiClient *stream = http.getStreamPtr(); int32_t len = http.getSize(); diff --git a/tasmota/xdrv_16_tuyamcu.ino b/tasmota/xdrv_16_tuyamcu.ino index 250c28b21..5750839c5 100644 --- a/tasmota/xdrv_16_tuyamcu.ino +++ b/tasmota/xdrv_16_tuyamcu.ino @@ -1442,15 +1442,31 @@ void TuyaSensorsShow(bool json) #endif // USE_WEBSERVER } } - #ifdef USE_WEBSERVER +#ifdef USE_WEBSERVER if (AsModuleTuyaMS()) { WSContentSend_P(PSTR("{s}" D_JSON_IRHVAC_MODE "{m}%d{e}"), Tuya.ModeSet); } - #endif // USE_WEBSERVER +#endif // USE_WEBSERVER if (RootName) { ResponseJsonEnd();} } +#ifdef USE_WEBSERVER + +void TuyaAddButton(void) { + if (AsModuleTuyaMS()) { + WSContentSend_P(HTTP_TABLE100); + WSContentSend_P(PSTR("
")); + char stemp[33]; + snprintf_P(stemp, sizeof(stemp), PSTR("" D_JSON_IRHVAC_MODE "")); + WSContentSend_P(HTTP_DEVICE_CONTROL, 26, TasmotaGlobal.devices_present + 1, + (strlen(SettingsText(SET_BUTTON1 + TasmotaGlobal.devices_present))) ? SettingsText(SET_BUTTON1 + TasmotaGlobal.devices_present) : stemp, ""); + WSContentSend_P(PSTR("")); + } +} + +#endif // USE_WEBSERVER + /*********************************************************************************************\ * Interface \*********************************************************************************************/ @@ -1507,6 +1523,9 @@ bool Xdrv16(uint8_t function) TuyaSensorsShow(1); break; #ifdef USE_WEBSERVER + case FUNC_WEB_ADD_MAIN_BUTTON: + TuyaAddButton(); + break; case FUNC_WEB_SENSOR: TuyaSensorsShow(0); break; diff --git a/tasmota/xdrv_50_filesystem.ino b/tasmota/xdrv_50_filesystem.ino index 8a0ed1d16..7150fbd85 100644 --- a/tasmota/xdrv_50_filesystem.ino +++ b/tasmota/xdrv_50_filesystem.ino @@ -294,7 +294,23 @@ bool TfsSaveFile(const char *fname, const uint8_t *buf, uint32_t len) { return false; } - file.write(buf, len); +// This will timeout on ESP32-webcam +// file.write(buf, len); + + uint32_t count = len / 512; + uint32_t chunk = len / count; + for (uint32_t i = 0; i < count; i++) { + file.write(buf + (i * chunk), chunk); + // do actually wait a little to allow ESP32 tasks to tick + // fixes task timeout in ESP32Solo1 style unicore code and webcam. + delay(10); + OsWatchLoop(); + } + uint32_t left = len % count; + if (left) { + file.write(buf + (count * chunk), left); + } + file.close(); return true; } diff --git a/tasmota/xdrv_52_0_berry_struct.ino b/tasmota/xdrv_52_0_berry_struct.ino index fe09b3c84..760358ab0 100644 --- a/tasmota/xdrv_52_0_berry_struct.ino +++ b/tasmota/xdrv_52_0_berry_struct.ino @@ -23,6 +23,7 @@ #include #include +#include "be_mapping.h" #include "re1.5.h" /*********************************************************************************************\ diff --git a/tasmota/xdrv_52_1_berry_native.ino b/tasmota/xdrv_52_1_berry_native.ino index 970d26c48..2bf1f152e 100644 --- a/tasmota/xdrv_52_1_berry_native.ino +++ b/tasmota/xdrv_52_1_berry_native.ino @@ -45,8 +45,11 @@ extern "C" { * Responds to virtual constants \*********************************************************************************************/ extern "C" { - // Clear all elements on the stack - void be_pop_all(bvm *vm) { + #include "be_vm.h" + // Call error handler and pop all from stack + void be_error_pop_all(bvm *vm); + void be_error_pop_all(bvm *vm) { + if (vm->obshook != NULL) (*vm->obshook)(vm, BE_OBS_PCALL_ERROR); be_pop(vm, be_top(vm)); // clear Berry stack } @@ -267,113 +270,6 @@ extern "C" { * Warning, the following expect all parameters to be 32 bits wide \*********************************************************************************************/ -extern "C" { - - /*********************************************************************************************\ - * Callback structures - * - * We allow 4 parameters, or 3 if method (first arg is `self`) - * This could be extended if needed - \*********************************************************************************************/ - 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); - - /*********************************************************************************************\ - * Callback structures - * - * We allow 4 parameters, or 3 if method (first arg is `self`) - * This could be extended if needed - \*********************************************************************************************/ - int32_t call_berry_cb(int32_t num, int32_t v0, int32_t v1, int32_t v2, int32_t v3) { - // call berry cb dispatcher - int32_t ret = 0; - // get the 'tasmota' object (global) and call 'cb_dispatch' - be_getglobal(berry.vm, PSTR("tasmota")); - if (!be_isnil(berry.vm, -1)) { - be_getmethod(berry.vm, -1, PSTR("cb_dispatch")); - - if (!be_isnil(berry.vm, -1)) { - be_pushvalue(berry.vm, -2); // add instance as first arg - // push all args as ints (may be revised) - be_pushint(berry.vm, num); - be_pushint(berry.vm, v0); - be_pushint(berry.vm, v1); - be_pushint(berry.vm, v2); - be_pushint(berry.vm, v3); - - ret = be_pcall(berry.vm, 6); // 5 arguments - if (ret != 0) { - BerryDumpErrorAndClear(berry.vm, false); // log in Tasmota console only - be_pop_all(berry.vm); // clear Berry stack - return 0; - } - be_pop(berry.vm, 6); - - if (be_isint(berry.vm, -1) || be_isnil(berry.vm, -1)) { // sanity check - if (be_isint(berry.vm, -1)) { - ret = be_toint(berry.vm, -1); - } - // All good, we can proceed - be_pop(berry.vm, 2); // remove tasmota instance and result - return ret; - } - } - be_pop(berry.vm, 1); - } - be_pop(berry.vm, 1); - AddLog(LOG_LEVEL_ERROR, PSTR(D_LOG_BERRY "can't call 'tasmota.cb_dispatch'")); - return 0; - } - - #define BERRY_CB(n) int32_t berry_cb_##n(int32_t v0, int32_t v1, int32_t v2, int32_t v3) { return call_berry_cb(n, v0, v1, v2, v3); } - // list the callbacks - BERRY_CB(0); - BERRY_CB(1); - BERRY_CB(2); - BERRY_CB(3); - BERRY_CB(4); - BERRY_CB(5); - BERRY_CB(6); - BERRY_CB(7); - BERRY_CB(8); - BERRY_CB(9); - BERRY_CB(10); - BERRY_CB(11); - BERRY_CB(12); - BERRY_CB(13); - BERRY_CB(14); - BERRY_CB(15); - BERRY_CB(16); - BERRY_CB(17); - BERRY_CB(18); - BERRY_CB(19); - - // array of callbacks - berry_callback_t berry_callback_array[] { - berry_cb_0, - berry_cb_1, - berry_cb_2, - berry_cb_3, - berry_cb_4, - berry_cb_5, - berry_cb_6, - berry_cb_7, - berry_cb_8, - berry_cb_9, - berry_cb_10, - berry_cb_11, - berry_cb_12, - berry_cb_13, - berry_cb_14, - berry_cb_15, - berry_cb_16, - berry_cb_17, - berry_cb_18, - berry_cb_19, - }; -} - /*********************************************************************************************\ * Automatically parse Berry stack and call the C function accordingly * @@ -416,7 +312,7 @@ extern "C" { // read a single value at stack position idx, convert to int. // if object instance, get `_p` member and convert it recursively -int32_t be_convert_single_elt(bvm *vm, int32_t idx, const char * arg_type = nullptr, int32_t lv_obj_cb = 0) { +int32_t be_convert_single_elt(bvm *vm, int32_t idx, const char * arg_type = nullptr, void * lv_obj_cb = nullptr) { int32_t ret = 0; char provided_type = 0; idx = be_absindex(vm, idx); // make sure we have an absolute index @@ -436,7 +332,7 @@ int32_t be_convert_single_elt(bvm *vm, int32_t idx, const char * arg_type = null be_pushstring(vm, arg_type); be_pushvalue(vm, idx); be_pushvalue(vm, 1); - be_pushint(vm, lv_obj_cb); + be_pushcomptr(vm, lv_obj_cb); be_call(vm, 5); const void * func = be_tocomptr(vm, -6); be_pop(vm, 6); diff --git a/tasmota/xdrv_52_3_berry_lvgl.ino b/tasmota/xdrv_52_3_berry_lvgl.ino index 39e7737ed..f0cba617a 100644 --- a/tasmota/xdrv_52_3_berry_lvgl.ino +++ b/tasmota/xdrv_52_3_berry_lvgl.ino @@ -162,7 +162,7 @@ void be_check_arg_type(bvm *vm, int32_t arg_start, int32_t argc, const char * ar } } // AddLog(LOG_LEVEL_INFO, ">> be_call_c_func arg %i, type %s", i, arg_type_check ? type_short_name : ""); - p[i] = be_convert_single_elt(vm, i + arg_start, arg_type_check ? type_short_name : nullptr, p[0]); + p[i] = be_convert_single_elt(vm, i + arg_start, arg_type_check ? type_short_name : nullptr, (void*) p[0]); } // check if we are missing arguments diff --git a/tasmota/xdrv_52_3_berry_md5.ino b/tasmota/xdrv_52_3_berry_md5.ino deleted file mode 100644 index a4adee029..000000000 --- a/tasmota/xdrv_52_3_berry_md5.ino +++ /dev/null @@ -1,105 +0,0 @@ -/* - 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 - -#include -#include "MD5Builder.h" -#include "be_mem.h" - -/*********************************************************************************************\ - * Md5 class - * -\*********************************************************************************************/ -extern "C" { - - int free_ctx(bvm* vm) { - int argc = be_top(vm); - if (argc > 0) { - be_getmember(vm, 1, ".p"); - struct MD5Context * ctx = (struct MD5Context *) be_tocomptr(vm, -1); - if (ctx != NULL) { - be_os_free(ctx); - } - } - be_return_nil(vm); - } - - // `Md5.init() -> ` - int32_t m_md5_init(struct bvm *vm); - int32_t m_md5_init(struct bvm *vm) { - - struct MD5Context * ctx = (struct MD5Context *) be_os_malloc(sizeof(struct MD5Context)); - if (!ctx) { - be_throw(vm, BE_MALLOC_FAIL); - } - MD5Init(ctx); - - be_newcomobj(vm, ctx, &free_ctx); - be_setmember(vm, 1, ".p"); - be_return_nil(vm); - } - - // `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_BERRY diff --git a/tasmota/xdrv_52_3_berry_tasmota.ino b/tasmota/xdrv_52_3_berry_tasmota.ino index cfc847e7a..a9d0ad734 100644 --- a/tasmota/xdrv_52_3_berry_tasmota.ino +++ b/tasmota/xdrv_52_3_berry_tasmota.ino @@ -26,25 +26,25 @@ const uint32_t BERRY_MAX_LOGS = 16; // max number of print output recorded when outside of REPL, used to avoid infinite grow of logs const uint32_t BERRY_MAX_REPL_LOGS = 1024; // max number of print output recorded when inside REPL -/*********************************************************************************************\ - * Return C callback from index - * -\*********************************************************************************************/ -extern "C" { - int32_t l_get_cb(struct bvm *vm); - int32_t l_get_cb(struct bvm *vm) { - int32_t argc = be_top(vm); // Get the number of arguments - if (argc >= 2 && be_isint(vm, 2)) { - int32_t idx = be_toint(vm, 2); - if (idx >= 0 && idx < ARRAY_SIZE(berry_callback_array)) { - const berry_callback_t c_ptr = berry_callback_array[idx]; - be_pushcomptr(vm, (void*) c_ptr); - be_return(vm); - } - } - be_raise(vm, kTypeError, nullptr); - } -} +// /*********************************************************************************************\ +// * Return C callback from index +// * +// \*********************************************************************************************/ +// extern "C" { +// extern int32_t be_cb__get_cb(struct bvm *vm); +// int32_t be_cb__get_cb(struct bvm *vm) { +// int32_t argc = be_top(vm); // Get the number of arguments +// if (argc >= 2 && be_isint(vm, 2)) { +// int32_t idx = be_toint(vm, 2); +// if (idx >= 0 && idx < ARRAY_SIZE(berry_callback_array)) { +// const berry_callback_t c_ptr = berry_callback_array[idx]; +// be_pushcomptr(vm, (void*) c_ptr); +// be_return(vm); +// } +// } +// be_raise(vm, kTypeError, nullptr); +// } +// } /*********************************************************************************************\ * Native functions mapped to Berry functions diff --git a/tasmota/xdrv_52_9_berry.ino b/tasmota/xdrv_52_9_berry.ino index 84a4f698c..b48281fde 100644 --- a/tasmota/xdrv_52_9_berry.ino +++ b/tasmota/xdrv_52_9_berry.ino @@ -110,24 +110,6 @@ size_t callBerryGC(void) { return callBerryEventDispatcher(PSTR("gc"), nullptr, 0, nullptr); } -void BerryDumpErrorAndClear(bvm *vm, bool berry_console); -void BerryDumpErrorAndClear(bvm *vm, bool berry_console) { - int32_t top = be_top(vm); - // check if we have two strings for an Exception - if (top >= 2 && be_isstring(vm, -1) && be_isstring(vm, -2)) { - if (berry_console) { - berry_log_C(PSTR(D_LOG_BERRY "Exception> '%s' - %s"), be_tostring(berry.vm, -2), be_tostring(berry.vm, -1)); - be_tracestack(vm); - top = be_top(vm); // update top after dump - } else { - AddLog(LOG_LEVEL_ERROR, PSTR(D_LOG_BERRY "Exception> '%s' - %s"), be_tostring(berry.vm, -2), be_tostring(berry.vm, -1)); - be_tracestack(vm); - } - } else { - be_dumpstack(vm); - } -} - // void callBerryMqttData(void) { // AddLog(LOG_LEVEL_INFO, D_LOG_BERRY "callBerryMqttData"); // if (nullptr == berry.vm) { return; } @@ -150,53 +132,6 @@ void BerryDumpErrorAndClear(bvm *vm, bool berry_console) { // checkBeTop(); // } -/* -// Call a method of a global object, with n args -// Before: stack must containt n args -// After: stack contains return value or nil if something wrong (args removes) -// returns true is successful, false if object or method not found -bool callMethodObjectWithArgs(const char * objname, const char * method, size_t argc) { - if (nullptr == berry.vm) { return false; } - int32_t top = be_top(berry.vm); - // stacks contains n x arg - be_getglobal(berry.vm, objname); - // stacks contains n x arg + object - if (!be_isnil(berry.vm, -1)) { - be_getmethod(berry.vm, -1, method); - // stacks contains n x arg + object + method - if (!be_isnil(berry.vm, -1)) { - // reshuffle the entire stack since we want: method + object + n x arg - be_pushvalue(berry.vm, -1); // add instance as first arg - // stacks contains n x arg + object + method + method - be_pushvalue(berry.vm, -3); // add instance as first arg - // stacks contains n x arg + object + method + method + object - // now move args 2 slots up to make room for method and object - for (uint32_t i = 1; i <= argc; i++) { - be_moveto(berry.vm, -4 - i, -2 - i); - } - // stacks contains free + free + n x arg + method + object - be_moveto(berry.vm, -2, -4 - argc); - be_moveto(berry.vm, -1, -3 - argc); - // stacks contains method + object + n x arg + method + object - be_pop(berry.vm, 2); - // stacks contains method + object + n x arg - be_pcall(berry.vm, argc + 1); - // stacks contains return_val + object + n x arg - be_pop(berry.vm, argc + 1); - // stacks contains return_val - return true; - } - be_pop(berry.vm, 1); // remove method - // stacks contains n x arg + object - } - // stacks contains n x arg + object - be_pop(berry.vm, argc + 1); // clear stack - be_pushnil(berry.vm); // put nil object - return false; -} -*/ - - // call the event dispatcher from Tasmota object // 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) { @@ -224,8 +159,7 @@ int32_t callBerryEventDispatcher(const char *type, const char *cmd, int32_t idx, } BrTimeoutReset(); if (ret != 0) { - BerryDumpErrorAndClear(vm, false); // log in Tasmota console only - be_pop_all(berry.vm); // clear Berry stack + be_error_pop_all(berry.vm); // clear Berry stack return ret; } be_pop(vm, 5); @@ -252,6 +186,17 @@ void BerryObservability(bvm *vm, int event...) { static uint32_t gc_time = 0; switch (event) { + case BE_OBS_PCALL_ERROR: // error after be_pcall + { + int32_t top = be_top(vm); + // check if we have two strings for an Exception + if (top >= 2 && be_isstring(vm, -1) && be_isstring(vm, -2)) { + berry_log_C(PSTR(D_LOG_BERRY "Exception> '%s' - %s"), be_tostring(berry.vm, -2), be_tostring(berry.vm, -1)); + be_tracestack(vm); + } else { + be_dumpstack(vm); + } + } case BE_OBS_GC_START: { gc_time = millis(); @@ -331,21 +276,18 @@ void BerryInit(void) { ret_code1 = be_loadstring(berry.vm, berry_prog); if (ret_code1 != 0) { - BerryDumpErrorAndClear(berry.vm, false); - be_pop_all(berry.vm); // clear Berry stack + be_error_pop_all(berry.vm); // clear Berry stack break; } // AddLog(LOG_LEVEL_DEBUG, PSTR(D_LOG_BERRY "Berry code loaded, RAM used=%u"), be_gc_memcount(berry.vm)); ret_code2 = be_pcall(berry.vm, 0); if (ret_code1 != 0) { - BerryDumpErrorAndClear(berry.vm, false); - be_pop_all(berry.vm); // clear Berry stack + be_error_pop_all(berry.vm); // clear Berry stack break; } // AddLog(LOG_LEVEL_DEBUG, PSTR(D_LOG_BERRY "Berry code ran, RAM used=%u"), be_gc_memcount(berry.vm)); if (be_top(berry.vm) > 1) { - BerryDumpErrorAndClear(berry.vm, false); - be_pop_all(berry.vm); // clear Berry stack + be_error_pop_all(berry.vm); // clear Berry stack } else { be_pop(berry.vm, 1); } @@ -389,8 +331,7 @@ void BrLoad(const char * script_name) { BrTimeoutStart(); if (be_pcall(berry.vm, 1) != 0) { - BerryDumpErrorAndClear(berry.vm, false); - be_pop_all(berry.vm); // clear Berry stack + be_error_pop_all(berry.vm); // clear Berry stack return; } BrTimeoutReset(); @@ -495,8 +436,7 @@ void BrREPLRun(char * cmd) { } } if (BE_EXCEPTION == ret_code) { - BerryDumpErrorAndClear(berry.vm, true); - be_pop_all(berry.vm); // clear Berry stack + be_error_pop_all(berry.vm); // clear Berry stack // be_dumpstack(berry.vm); // char exception_s[120]; // ext_snprintf_P(exception_s, sizeof(exception_s), PSTR("%s: %s"), be_tostring(berry.vm, -2), be_tostring(berry.vm, -1)); diff --git a/tasmota/xdrv_81_esp32_webcam.ino b/tasmota/xdrv_81_esp32_webcam.ino index dca8ec936..273885049 100644 --- a/tasmota/xdrv_81_esp32_webcam.ino +++ b/tasmota/xdrv_81_esp32_webcam.ino @@ -876,6 +876,10 @@ void WcStreamControl() { WcSetup(Settings->webcam_config.resolution); } +bool WcStreamActive(void) { + return (Wc.stream_active); +} + /*********************************************************************************************/ diff --git a/tasmota/xlgt_07_lsc_mcsl.ino b/tasmota/xlgt_07_lsc_mcsl.ino index 9e8ec00e6..d7c9bbfd2 100644 --- a/tasmota/xlgt_07_lsc_mcsl.ino +++ b/tasmota/xlgt_07_lsc_mcsl.ino @@ -17,6 +17,8 @@ along with this program. If not, see . */ +#define USE_LSC_MCSL_GUI + #ifdef USE_LIGHT #ifdef USE_LSC_MCSL /*********************************************************************************************\ @@ -27,6 +29,17 @@ * Template: * {"NAME":"LSC MC Lights","GPIO":[0,0,0,0,544,32,0,0,3840,0,3872,0,0,0],"FLAG":0,"BASE":18} * + * Webbutton: + * {"WebButton1":"On / Off", + * "WebButton2":"Bright", + * "WebButton3":"Slow", + * "WebButton4":"Star", + * "WebButton5":"Flower", + * "WebButton6":"Marquee", + * "WebButton7":"Fireworks", + * "WebButton8":"Meteor", + * "WebButton9":"Stream"} + * * NL: Action LSC Multi color smart lights * * Button usage: @@ -232,6 +245,51 @@ void LscMcModuleSelected(void) { // AddLog(LOG_LEVEL_DEBUG, PSTR("LGT: LSC Multi Color Found")); } +#ifdef USE_WEBSERVER +#ifdef USE_LSC_MCSL_GUI + +void LscMcAddFuctionButtons(void) { + uint32_t rows = 1; + uint32_t cols = 8; + for (uint32_t i = 0; i < 8; i++) { + if (strlen(SettingsText(SET_BUTTON1 + i +1))) { + rows <<= 1; + cols >>= 1; + break; + } + } + WSContentSend_P(HTTP_TABLE100); + WSContentSend_P(PSTR("")); + char number[4]; + uint32_t idx = 0; + for (uint32_t i = 0; i < rows; i++) { + if (idx > 0) { WSContentSend_P(PSTR("")); } + for (uint32_t j = 0; j < cols; j++) { + idx++; + WSContentSend_P(PSTR(""), // &lsc is related to WebGetArg("lsc", tmp, sizeof(tmp)); + 100 / cols, + idx -1, + (strlen(SettingsText(SET_BUTTON1 + idx))) ? SettingsText(SET_BUTTON1 + idx) : itoa(idx, number, 10)); + } + } + WSContentSend_P(PSTR("")); +} + +void LscMcWebGetArg(void) { + char tmp[8]; // WebGetArg numbers only + WebGetArg(PSTR("lsc"), tmp, sizeof(tmp)); // 0 - 7 functions + if (strlen(tmp)) { + uint32_t function = atoi(tmp); + char command[20]; + snprintf_P(command, sizeof(command), PSTR(D_CMND_DIMMER " %d"), (function * (100 / 8)) + ((100 / 8) / 2)); + ExecuteWebCommand(command); + } +} + +#endif // USE_LSC_MCSL_GUI +#endif // USE_WEBSERVER + + /*********************************************************************************************\ * Interface \*********************************************************************************************/ @@ -247,6 +305,16 @@ bool Xlgt07(uint8_t function) case FUNC_BUTTON_MULTI_PRESSED: result = LscMcMultiButtonPressed(); break; +#ifdef USE_WEBSERVER +#ifdef USE_LSC_MCSL_GUI + case FUNC_WEB_ADD_MAIN_BUTTON: + LscMcAddFuctionButtons(); + break; + case FUNC_WEB_GET_ARG: + LscMcWebGetArg(); + break; +#endif // USE_LSC_MCSL_GUI +#endif // USE_WEBSERVER case FUNC_MODULE_INIT: LscMcModuleSelected(); break; diff --git a/tasmota/xsns_53_sml.ino b/tasmota/xsns_53_sml.ino index d001af112..7a184a4bb 100755 --- a/tasmota/xsns_53_sml.ino +++ b/tasmota/xsns_53_sml.ino @@ -79,7 +79,7 @@ #define DJ_COUNTER "Count" struct METER_DESC { - uint8_t srcpin; + int8_t srcpin; uint8_t type; uint16_t flag; int32_t params; @@ -499,9 +499,7 @@ uint16_t meter_spos[MAX_METERS]; #ifdef ESP8266 TasmotaSerial *meter_ss[MAX_METERS]; #endif // ESP8266 -#ifdef ESP32 -HardwareSerial *meter_ss[MAX_METERS]; -#endif // ESP32 + // serial buffers, may be made larger depending on telegram lenght #ifndef SML_BSIZ @@ -592,6 +590,229 @@ double sml_median(struct SML_MEDIAN_FILTER* mf, double in) { } #endif + +// ESP32 software serial read only +#ifdef ESP32 +#ifdef USE_ESP32_SW_SERIAL + +#ifndef ESP32_SWS_BUFFER_SIZE +#define ESP32_SWS_BUFFER_SIZE 256 +#endif + + +class SML_ESP32_SERIAL : public Stream { +public: + SML_ESP32_SERIAL(uint32_t uart_index); + virtual ~SML_ESP32_SERIAL(); + bool begin(uint32_t speed, uint32_t smode, int32_t recpin, int32_t trxpin); + int32_t peek(void); + int32_t read(void) override; + size_t write(uint8_t byte) override; + int32_t available(void) override; + void flush(void) override; + void setRxBufferSize(uint32_t size); + void updateBaudRate(uint32_t baud); + void rxRead(void); + using Print::write; +private: + // Member variables + void setbaud(uint32_t speed); + uint32_t uart_index; + int8_t m_rx_pin; + int8_t m_tx_pin; + uint32_t cfgmode; + uint32_t ss_byte; + uint32_t ss_bstart; + uint32_t ss_index; + uint32_t m_bit_time; + uint32_t m_in_pos; + uint32_t m_out_pos; + uint16_t serial_buffer_size; + bool m_valid; + uint8_t *m_buffer; + HardwareSerial *hws; +}; + + +void IRAM_ATTR sml_callRxRead(void *self) { ((SML_ESP32_SERIAL*)self)->rxRead(); }; + +SML_ESP32_SERIAL::SML_ESP32_SERIAL(uint32_t index) { + uart_index = index; + m_valid = true; +} + +SML_ESP32_SERIAL::~SML_ESP32_SERIAL(void) { + if (hws) { + hws->end(); + } else { + detachInterrupt(m_rx_pin); + if (m_buffer) { + free(m_buffer); + } + } +} + +void SML_ESP32_SERIAL::setbaud(uint32_t speed) { + m_bit_time = ESP.getCpuFreqMHz() * 1000000 / speed; +} + + +bool SML_ESP32_SERIAL::begin(uint32_t speed, uint32_t smode, int32_t recpin, int32_t trxpin) { + if (!m_valid) { return false; } + + m_buffer = 0; + if (recpin < 0) { + setbaud(speed); + m_rx_pin = -recpin; + serial_buffer_size = ESP32_SWS_BUFFER_SIZE; + m_buffer = (uint8_t*)malloc(serial_buffer_size); + if (m_buffer == NULL) return false; + pinMode(m_rx_pin, INPUT); + attachInterruptArg(m_rx_pin, sml_callRxRead, this, CHANGE); + m_in_pos = m_out_pos = 0; + hws = nullptr; + } else { + cfgmode = smode; + m_rx_pin = recpin; + m_tx_pin = trxpin; + hws = new HardwareSerial(uart_index); + if (hws) { + hws->begin(speed, cfgmode, m_rx_pin, m_tx_pin); + } + } + return true; +} + +void SML_ESP32_SERIAL::flush(void) { + if (hws) { + hws->flush(); + } else { + m_in_pos = m_out_pos = 0; + } +} + +int32_t SML_ESP32_SERIAL::peek(void) { + if (hws) { + return hws->peek(); + } else { + if (m_in_pos == m_out_pos) return -1; + return m_buffer[m_out_pos]; + } +} + +int32_t SML_ESP32_SERIAL::read(void) { + if (hws) { + return hws->read(); + } else { + if (m_in_pos == m_out_pos) return -1; + uint32_t ch = m_buffer[m_out_pos]; + m_out_pos = (m_out_pos +1) % serial_buffer_size; + return ch; + } +} + +int32_t SML_ESP32_SERIAL::available(void) { + if (hws) { + return hws->available(); + } else { + int avail = m_in_pos - m_out_pos; + if (avail < 0) avail += serial_buffer_size; + return avail; + } +} + +size_t SML_ESP32_SERIAL::write(uint8_t byte) { + if (hws) { + return hws->write(byte); + } + return 0; +} + +void SML_ESP32_SERIAL::setRxBufferSize(uint32_t size) { + if (hws) { + hws->setRxBufferSize(size); + } else { + if (m_buffer) { + free(m_buffer); + } + serial_buffer_size = size; + m_buffer = (uint8_t*)malloc(size); + } +} +void SML_ESP32_SERIAL::updateBaudRate(uint32_t baud) { + if (hws) { + hws->updateBaudRate(baud); + } else { + setbaud(baud); + } +} + +// no wait mode only 8N1 (or 7X1, obis only, ignoring parity) +void IRAM_ATTR SML_ESP32_SERIAL::rxRead(void) { + uint32_t diff; + uint32_t level; + +#define SML_LASTBIT 9 + + level = digitalRead(m_rx_pin); + + if (!level && !ss_index) { + // start condition + ss_bstart = ESP.getCycleCount() - (m_bit_time / 4); + ss_byte = 0; + ss_index++; + } else { + // now any bit changes go here + // calc bit number + diff = (ESP.getCycleCount() - ss_bstart) / m_bit_time; + + if (!level && diff > SML_LASTBIT) { + // start bit of next byte, store and restart + // leave irq at change + for (uint32_t i = ss_index; i <= SML_LASTBIT; i++) { + ss_byte |= (1 << i); + } + uint32_t next = (m_in_pos + 1) % serial_buffer_size; + if (next != (uint32_t)m_out_pos) { + m_buffer[m_in_pos] = ss_byte >> 1; + m_in_pos = next; + } + + ss_bstart = ESP.getCycleCount() - (m_bit_time / 4); + ss_byte = 0; + ss_index = 1; + return; + } + if (diff >= SML_LASTBIT) { + // bit zero was 0, + uint32_t next = (m_in_pos + 1) % serial_buffer_size; + if (next != (uint32_t)m_out_pos) { + m_buffer[m_in_pos] = ss_byte >> 1; + m_in_pos = next; + } + ss_byte = 0; + ss_index = 0; + } else { + // shift in + for (uint32_t i = ss_index; i < diff; i++) { + if (!level) ss_byte |= (1 << i); + } + ss_index = diff; + } + } +} +#endif // USE_ESP32_SW_SERIAL +#endif // ESP32 + +#ifdef ESP32 +#ifndef USE_ESP32_SW_SERIAL +HardwareSerial *meter_ss[MAX_METERS]; +#else +SML_ESP32_SERIAL *meter_ss[MAX_METERS]; +#endif +#endif // ESP32 + + #ifdef ANALOG_OPTO_SENSOR // sensor over ADS1115 with i2c Bus uint8_t ads1115_up; @@ -1398,12 +1619,12 @@ void sml_shift_in(uint32_t meters,uint32_t shard) { void SML_Poll(void) { uint32_t meters; - for (meters=0; metersavailable()) { - sml_shift_in(meters,0); + sml_shift_in(meters, 0); } } } @@ -2311,7 +2532,7 @@ void SML_Init(void) { uint8_t *tp = 0; uint16_t index = 0; uint8_t section = 0; - uint8_t srcpin = 0; + int8_t srcpin = 0; uint8_t dec_line = 0; char *lp = glob_script_mem.scriptptr; sml_send_blocks = 0; @@ -2348,7 +2569,7 @@ void SML_Init(void) { } index--; srcpin = strtol(lp,&lp,10); - if (Gpio_used(srcpin)) { + if (Gpio_used(abs(srcpin))) { AddLog(LOG_LEVEL_INFO, PSTR("gpio rx double define!")); dddef_exit: if (script_meter) free(script_meter); @@ -2481,7 +2702,6 @@ dddef_exit: if (*lp == SCRIPT_EOL) lp--; goto next_line; } - #ifdef SML_REPLACE_VARS char dstbuf[SML_SRCBSIZE*2]; Replace_Cmd_Vars(lp, 1, dstbuf,sizeof(dstbuf)); @@ -2570,13 +2790,13 @@ init10: uint8_t cindex=0; // preloud counters for (byte i = 0; i < MAX_COUNTERS; i++) { - RtcSettings.pulse_counter[i]=Settings->pulse_counter[i]; + RtcSettings.pulse_counter[i] = Settings->pulse_counter[i]; sml_counters[i].sml_cnt_last_ts=millis(); } - uint32_t uart_index=2; - for (uint8_t meters=0; meters= 0) { + if (uart_index == 0) { ClaimSerial(); } + uart_index--; + if (uart_index < 0) uart_index = 0; + } +#else meter_ss[meters] = new HardwareSerial(uart_index); - if (uart_index==0) { ClaimSerial(); } + if (uart_index == 0) { ClaimSerial(); } uart_index--; - if (uart_index<0) uart_index=0; + if (uart_index < 0) uart_index = 0; meter_ss[meters]->setRxBufferSize(TMSBSIZ); +#endif // USE_ESP32_SW_SERIAL + #endif // ESP32 -#endif +#endif // SPECIAL_SS SerialConfig smode = SERIAL_8N1; @@ -2664,10 +2895,10 @@ init10: #endif // ESP8266 #ifdef ESP32 meter_ss[meters]->begin(meter_desc_p[meters].params, smode, meter_desc_p[meters].srcpin, meter_desc_p[meters].trxpin); + //meter_ss[meters]->setRxBufferSize(TMSBSIZ); #endif // ESP32 } } - } @@ -2685,7 +2916,7 @@ uint32_t sml_getv(uint32_t sel) { return sel; } uint32_t SML_SetBaud(uint32_t meter, uint32_t br) { - if (meter<1 || meter>meters_used) return 0; + if (meter < 1 || meter > meters_used) return 0; meter--; if (!meter_ss[meter]) return 0; #ifdef ESP8266 @@ -3095,7 +3326,9 @@ bool Xsns53(byte function) { case FUNC_LOOP: SML_Counter_Poll(); if (dump2log) Dump2log(); - else SML_Poll(); + else { + SML_Poll(); + } break; // case FUNC_EVERY_50_MSECOND: // if (dump2log) Dump2log(); diff --git a/tasmota/xsns_90_hrg15.ino b/tasmota/xsns_90_hrg15.ino index f7ba63721..46c17b28a 100644 --- a/tasmota/xsns_90_hrg15.ino +++ b/tasmota/xsns_90_hrg15.ino @@ -53,8 +53,7 @@ struct RG15 { float rate = 0.0f; } Rg15; -void Rg15Init(void) -{ +void Rg15Init(void) { Rg15.ready = 0; if (PinUsed(GPIO_HRG15_RX) && PinUsed(GPIO_HRG15_TX)) { HydreonSerial = new TasmotaSerial(Pin(GPIO_HRG15_RX), Pin(GPIO_HRG15_TX)); @@ -92,8 +91,7 @@ bool Rg15Poll(void) { while (HydreonSerial->available()) { Rg15ReadLine(rg15_buffer); - AddLog(LOG_LEVEL_DEBUG_MORE,PSTR("%s:" D_JSON_SERIALRECEIVED " = %s"),"HRG", rg15_buffer); - + AddLog(LOG_LEVEL_DEBUG_MORE, PSTR("HRG: Received '%s'"), rg15_buffer); Rg15Process(rg15_buffer); } @@ -102,11 +100,11 @@ bool Rg15Poll(void) { return true; } -bool Rg15ReadLine(char* buffer) -{ +bool Rg15ReadLine(char* buffer) { char c; uint8_t i = 0; uint32_t cmillis = millis(); + buffer[0] = '\0'; while (1) { if (HydreonSerial->available()) { @@ -121,8 +119,7 @@ bool Rg15ReadLine(char* buffer) return false; } } - - buffer[i-2] = '\0'; + if (i > 1) { buffer[i-2] = '\0'; } return true; } @@ -163,14 +160,14 @@ bool Rg15Command(void) { HydreonSerial->flush(); if (send[0] == 'k' || send[0] == 'K' || send[0] == 'o' || send[0] == 'O') { - ResponseCmndDone(); - return serviced; + ResponseCmndDone(); + return serviced; } char rg15_buffer[255]; if (Rg15ReadLine(rg15_buffer)) { - Response_P(PSTR("{\"" D_JSON_SERIALRECEIVED "\":%s\"}"), rg15_buffer); - Rg15Process(rg15_buffer); + Response_P(PSTR("{\"" D_JSON_SERIALRECEIVED "\":\"%s\"}"), rg15_buffer); + Rg15Process(rg15_buffer); } } @@ -184,7 +181,7 @@ void Rg15Show(bool json) } if (json) { - ResponseAppend_P(PSTR(",\"" RG15_NAME "\":{\"" D_JSON_ACTIVE "\":%2_f, \"" D_JSON_EVENT "\":%2_f, \"" D_JSON_TOTAL "\":%2_f, \"" D_JSON_FLOWRATE "\":%2_f}"), &Rg15.acc, &Rg15.event, &Rg15.total, &Rg15.rate); + ResponseAppend_P(PSTR(",\"" RG15_NAME "\":{\"" D_JSON_ACTIVE "\":%2_f,\"" D_JSON_EVENT "\":%2_f,\"" D_JSON_TOTAL "\":%2_f,\"" D_JSON_FLOWRATE "\":%2_f}"), &Rg15.acc, &Rg15.event, &Rg15.total, &Rg15.rate); #ifdef USE_WEBSERVER } else { WSContentSend_PD(HTTP_RG15, &Rg15.acc, &Rg15.event, &Rg15.total, &Rg15.rate);