Skip to content

Commit

Permalink
Merge pull request #2 from JadKHaddad/ar_checks
Browse files Browse the repository at this point in the history
Arithmetic checks can be enabled/disabled with a cargo feature: `disable-arithmetic-checks`
  • Loading branch information
JadKHaddad authored May 3, 2024
2 parents 0ecea75 + 39616f0 commit 8d56b81
Show file tree
Hide file tree
Showing 8 changed files with 506 additions and 120 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/target
191 changes: 191 additions & 0 deletions Cargo.lock

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

5 changes: 5 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
[workspace]
members = ["bmp180"]
exclude = ["examples/esp32", "examples/blue-pill"]
resolver = "2"
default-members = ["bmp180"]
1 change: 1 addition & 0 deletions Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ The following features are available:
- `impl-debug`: implements `core::fmt::Debug` for structs and enums.
- `impl-defmt-format`: implements `defmt::Format` for structs and enums.
- `fuzz`: enables the `fuzz` module for fuzz testing.
- `disable-arithmetic-checks`: disables arithmetic checks.
- `i-know-what-i-am-doing`: allows you to split an initialized device into its parts and put it back together.
Useful when you want to release the I2C bus and use it for something else.
This is not recommended though, you can use [`embedded-hal-bus`](https://crates.io/crates/embedded-hal-bus)
Expand Down
1 change: 1 addition & 0 deletions bmp180/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ readme = "../README.md"
default = ["async", "impl-debug"]
async = ["dep:embedded-hal-async"]
blocking = ["dep:embedded-hal"]
disable-arithmetic-checks = []
log = ["dep:log"]
defmt = ["dep:defmt"]
i-know-what-i-am-doing = []
Expand Down
4 changes: 2 additions & 2 deletions bmp180/fuzz/fuzz_targets/init_update.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ fuzz_target!(|data: &[u8]| {
let mut bmp180 = UninitBMP180::builder(fuzz_i2c, FuzzDelay {})
.build()
.initialize()
.unwrap();
.expect("Could not initialize BMP180");

bmp180.update().unwrap();
bmp180.update().ok();
});
Loading

0 comments on commit 8d56b81

Please sign in to comment.