Skip to content

Commit

Permalink
Small documentation fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
mbuesch committed Sep 9, 2022
1 parent 0e19ff0 commit 63863d0
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 8 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Auto-generated wrappers around registers for AVR microcontrollers.
Add the following to `Cargo.toml`:
```toml
[dependencies.avr-device]
version = "0.3.4"
version = "0.4.0"
features = ["atmega32u4"]
```

Expand Down
16 changes: 9 additions & 7 deletions src/interrupt.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,16 @@
//! // Use RefCell, if the wrapped type is not Copy or if you need a reference to it for other reasons.
//! static MYGLOBAL: Mutex<Cell<u16>> = Mutex::new(Cell::new(0));
//!
//! avr_device::interrupt::free(|cs| {
//! // Interrupts are disabled here
//! fn my_fun() {
//! avr_device::interrupt::free(|cs| {
//! // Interrupts are disabled here
//!
//! // Acquire mutex to global variable.
//! let myglobal_ref = MYGLOBAL.borrow(&cs);
//! // Write to the global variable.
//! myglobal_ref.set(42);
//! });
//! // Acquire mutex to global variable.
//! let myglobal_ref = MYGLOBAL.borrow(cs);
//! // Write to the global variable.
//! myglobal_ref.set(42);
//! });
//! }
//! ```
pub use bare_metal::{CriticalSection, Mutex};
Expand Down
1 change: 1 addition & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,7 @@
//! * Device selection: To enable your device, select the crate feature that matches your device.
//! For a full list of supported devices, see the list at the beginning of this documentation.
//! * To enable the crate's runtime environment, use the `rt` feature.
//! * To enable `ufmt` formatting (e.g. `uDebug`), use the `ufmt` feature.
#![no_std]
#![cfg_attr(target_arch = "avr", feature(asm_experimental_arch))] // for experimental AVR asm! macro.
Expand Down

0 comments on commit 63863d0

Please sign in to comment.