From 06ef5e65c7234543f08be66f1a10c284e2cdd68f Mon Sep 17 00:00:00 2001 From: Michael Buesch Date: Fri, 9 Sep 2022 19:23:30 +0200 Subject: [PATCH] Small fixes --- README.md | 2 +- macros/Cargo.toml | 2 +- src/interrupt.rs | 16 +++++++++------- src/lib.rs | 1 + 4 files changed, 12 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index 9ba4b32..2473c02 100644 --- a/README.md +++ b/README.md @@ -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"] ``` diff --git a/macros/Cargo.toml b/macros/Cargo.toml index 3b9d4bd..5ed0fd7 100644 --- a/macros/Cargo.toml +++ b/macros/Cargo.toml @@ -3,7 +3,7 @@ name = "avr-device-macros" version = "0.4.0" authors = ["Rahix "] -edition = "2018" +edition = "2021" description = "Attribute macros for re-export in `avr-device`" license = "MIT OR Apache-2.0" repository = "https://github.com/Rahix/avr-device" diff --git a/src/interrupt.rs b/src/interrupt.rs index 7c03964..d5fcd17 100644 --- a/src/interrupt.rs +++ b/src/interrupt.rs @@ -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> = 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}; diff --git a/src/lib.rs b/src/lib.rs index 7c99a39..5c2511a 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -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. -- 2.49.0