Christian Meusel 8fc7e6d35d
Add basic driver for LEDC (#43)
* Add basic LEDC driver

This driver allows to configure timers and channels but does not provide
advanced features like fading

* Added missing impl_channels.

* Use non-raw types for LEDC hw "handle" markers

This makes Timer and Channel Sync again.

* Add missing config and deps for dev building examples

* Add simple example for LEDC driver

* Channel changed to hold Timer as Borrow<>, to allow Arc etc.

* Provide unstable options from config.toml

This allows to build and run examples of this crate with cargo-espflash
1.2.0 which does not support passing unstable options.

* Provide ESP_IDF_SDKCONFIG_DEFAULTS from config.toml

This requires only to specify the target for a build explicitly.

* Use main task stack size from rust-esp32-std-demo

* Add multi-threaded example for LEDC

* Clean up ledc example and formatting

* Add note on running examples from this repository

* Fix build for ULP HAL

This LEDC interface is not available there.

* Build examples in CI too

* Use core types for no_std build of ledc

* Init channel config and hpoint with Default

This makes the initialization compatible with ESP IDF 4.3 and 4.4 where
the new field 'flag' has been added. As the default for hpoint was
previously zero, omitting it allows to use ..Default::default() in the
struct initialization in both cases.

* Install ldproxy in CI for building examples

It gets installed just before building examples because this takes its
time and should not delay other builds.

Co-authored-by: yunta <maciej.blomberg@mikoton.com>
2022-02-05 18:57:46 +02:00

44 lines
2.0 KiB
YAML

name: CI
on:
push:
branches:
- master
pull_request:
schedule:
- cron: '50 4 * * *'
jobs:
compile:
name: Compile
runs-on: ubuntu-latest
steps:
- name: Setup | Checkout
uses: actions/checkout@v2
- name: Setup | Rust
uses: actions-rs/toolchain@v1
with:
toolchain: nightly
components: rustfmt, clippy
- name: Setup | Std
run: rustup component add rust-src --toolchain nightly-x86_64-unknown-linux-gnu
- name: Setup | Default to nightly
run: rustup default nightly
- name: Build | Fmt Check
run: cargo fmt -- --check
- name: Build | Clippy
run: export ESP_IDF_SDKCONFIG_DEFAULTS=$(pwd)/.github/configs/sdkconfig.defaults; cargo clippy --no-deps --target riscv32imc-esp-espidf -Zbuild-std=std,panic_abort -Zbuild-std-features=panic_immediate_abort -- -Dwarnings
- name: Build | Compile
run: export ESP_IDF_SDKCONFIG_DEFAULTS=$(pwd)/.github/configs/sdkconfig.defaults; cargo build --target riscv32imc-esp-espidf -Zbuild-std=std,panic_abort -Zbuild-std-features=panic_immediate_abort
- name: Build | RISCV-ULP-HAL feature
run: cargo build --features riscv-ulp-hal --no-default-features --target riscv32imc-unknown-none-elf -Zbuild-std=core,panic_abort -Zbuild-std-features=panic_immediate_abort
- name: Build | Compile Native ESP-IDF V4.4 no_std
run: export ESP_IDF_VERSION=release/v4.4; export ESP_IDF_SDKCONFIG_DEFAULTS=$(pwd)/.github/configs/sdkconfig.defaults; cargo build --features esp-idf-sys/native --no-default-features --target riscv32imc-esp-espidf -Zbuild-std=std,panic_abort -Zbuild-std-features=panic_immediate_abort
- name: Setup | ldproxy
uses: actions-rs/install@v0.1
with:
crate: ldproxy
version: latest
- name: Build | Examples
run: export ESP_IDF_SDKCONFIG_DEFAULTS=$(pwd)/.github/configs/sdkconfig.defaults; cargo build --examples --target riscv32imc-esp-espidf -Zbuild-std=std,panic_abort -Zbuild-std-features=panic_immediate_abort