Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 6 additions & 12 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,17 +19,11 @@ jobs:
- name: Format
run: cargo fmt --check

- name: Clippy std
run: cargo clippy --features std --tests -- -D warnings
- name: Clippy embassy
run: cargo clippy --features embassy -- -D warnings
- name: Clippy embedded_hal
run: |
cargo clippy --features embedded_hal -- -D warnings
cargo clippy --features embedded_hal_old -- -D warnings
- name: Clippy wasm
run: cargo clippy --features wasm -- -D warnings
- name: Clippy default
- name: Clippy common
run: cargo clippy --features std,wasm,embassy,embedded_hal --tests -- -D warnings
- name: Clippy embedded_hal_old
run: cargo clippy --features embedded_hal_old -- -D warnings
- name: Clippy no default
run: cargo clippy --no-default-features -- -D warnings

- name: Install dependencies
Expand All @@ -45,7 +39,7 @@ jobs:
run: cargo clippy -- -D warnings
- name: Build example wasm
working-directory: examples/wasm
run: cargo build --target wasm32-unknown-unknown --release
run: cargo build --target wasm32-unknown-unknown

- name: Tests
run: cargo test tests --features std
7 changes: 6 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
{
"rust-analyzer.cargo.features": ["std"]
"rust-analyzer.cargo.features": [
"std",
"embedded_hal",
"wasm",
"embassy"
]
}
8 changes: 4 additions & 4 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "button-driver"
version = "0.2.4"
version = "0.2.5"
edition = "2021"
authors = ["maxwase", "Max T <max.vvase@gmail.com>"]
description = "Advanced button handling crate"
Expand All @@ -12,15 +12,15 @@ readme = "README.md"
exclude = [".*"]

[package.metadata.docs.rs]
features = ["std"]
features = ["std", "embassy", "embedded_hal", "wasm"]

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
embassy-time = { version = "0.5.0", optional = true }
embedded-hal-old = { package = "embedded-hal", version = "0.2.7", optional = true }
embedded-hal = { version = "1.0.0", optional = true }
js-sys = { version = "0.3", optional = true }
js-sys = { version = "0.3", default-features = false, optional = true }

[dev-dependencies]
parking_lot = "0.12.4"
Expand All @@ -32,4 +32,4 @@ embedded_hal_old = ["dep:embedded-hal-old", "embedded-hal-old/unproven"]
esp = ["dep:embedded-hal"]
embedded_hal = ["dep:embedded-hal"]
std = []
wasm = ["dep:js-sys", "std"]
wasm = ["dep:js-sys"]
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@ Button driver
[![doc](https://img.shields.io/docsrs/button-driver?style=for-the-badge)](https://docs.rs/button-driver/latest/)

This crate is a button driver for embedded Rust projects.
It offers various usage scenarios, supports ESP, `embedded_hal`, `embassy` and `no_std` targets.
It offers various usage scenarios, supports ESP, `embedded_hal`, `embassy`, `wasm` and `no_std` targets.

This crate aims to be as flexible as possible to support various HALs and use-cases.

## Examples

For more examples consider looking into the [examples](https://github.com/maxwase/button-driver/tree/master/examples) folder.
You can easily flash them using `cargo run` command!
You can easily flash/run them using `cargo run` command! Use `trunk serve` to run the wasm example.

For **ESP32C3** with std:

Expand Down
56 changes: 28 additions & 28 deletions examples/stm32-embassy/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

30 changes: 15 additions & 15 deletions examples/stm32/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading