diff --git a/CHANGELOG.md b/CHANGELOG.md index 927ccd0f..847973d6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,11 @@ This project adheres to [Semantic Versioning](http://semver.org/). ## [Unreleased] +## [v0.2.4] - 2018-10-32 + +### Fixed + - Updated examples and bumped dependancies. + ## [v0.2.3] - 2018-10-06 ### Fixed @@ -49,7 +54,8 @@ This project adheres to [Semantic Versioning](http://semver.org/). - Initial release -[Unreleased]: https://github.com/mabezdev/stm32l432xx-hal/compare/v0.2.3...HEAD +[Unreleased]: https://github.com/mabezdev/stm32l432xx-hal/compare/v0.2.4...HEAD +[v0.2.4]: https://github.com/mabezdev/stm32l432xx-hal/compare/v0.2.3...v0.2.4 [v0.2.3]: https://github.com/mabezdev/stm32l432xx-hal/compare/v0.2.2...v0.2.3 [v0.2.2]: https://github.com/mabezdev/stm32l432xx-hal/compare/v0.2.1...v0.2.2 [v0.2.1]: https://github.com/mabezdev/stm32l432xx-hal/compare/v0.2.0...v0.2.1 diff --git a/Cargo.toml b/Cargo.toml index cee24abd..6d620639 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "stm32l432xx-hal" -version = "0.2.3" +version = "0.2.4" authors = ["Scott Mabin "] description = "Hardware abstraction layer for the stm32l432xx chips" keywords = ["no-std", "stm32l432xx", "stm32l432kc", "embedded", "embedded-hal"] @@ -15,7 +15,7 @@ exclude = [ ] [dependencies] -cortex-m = "0.5.2" +cortex-m = "0.5.7" nb = "0.1.1" [dependencies.cast] @@ -31,13 +31,13 @@ version = "0.2.1" features = ["unproven"] [dependencies.stm32l4] -version = "0.2.1" +version = "0.3.2" features = ["stm32l4x2", "rt"] [dev-dependencies] -panic-semihosting = "0.3.0" -cortex-m-semihosting = "0.3.0" -cortex-m-rt = "0.5.1" +panic-semihosting = "0.5.0" +cortex-m-semihosting = "0.3.1" +cortex-m-rt = "0.6.5" [profile.dev] incremental = false diff --git a/examples/blinky.rs b/examples/blinky.rs index 5a1aef78..4fed9a98 100644 --- a/examples/blinky.rs +++ b/examples/blinky.rs @@ -23,8 +23,7 @@ use rt::ExceptionFrame; use core::fmt::Write; use sh::hio; -entry!(main); - +#[entry] fn main() -> ! { let mut hstdout = hio::hstdout().unwrap(); @@ -61,14 +60,7 @@ fn main() -> ! { } } -exception!(HardFault, hard_fault); - -fn hard_fault(ef: &ExceptionFrame) -> ! { +#[exception] +fn HardFault(ef: &ExceptionFrame) -> ! { panic!("{:#?}", ef); -} - -exception!(*, default_handler); - -fn default_handler(irqn: i16) { - panic!("Unhandled exception (IRQn = {})", irqn); -} +} \ No newline at end of file diff --git a/examples/pll_config.rs b/examples/pll_config.rs index bc7e1c76..0a936f81 100644 --- a/examples/pll_config.rs +++ b/examples/pll_config.rs @@ -24,8 +24,7 @@ use hal::stm32l4::stm32l4x2; use hal::rcc::PllConfig; use rt::ExceptionFrame; -entry!(main); - +#[entry] fn main() -> ! { let p = stm32l4x2::Peripherals::take().unwrap(); @@ -75,14 +74,7 @@ fn main() -> ! { loop {} } -exception!(HardFault, hard_fault); - -fn hard_fault(ef: &ExceptionFrame) -> ! { +#[exception] +fn HardFault(ef: &ExceptionFrame) -> ! { panic!("{:#?}", ef); } - -exception!(*, default_handler); - -fn default_handler(irqn: i16) { - panic!("Unhandled exception (IRQn = {})", irqn); -} diff --git a/examples/rtc.rs b/examples/rtc.rs index e80ea560..a2ddfe3d 100644 --- a/examples/rtc.rs +++ b/examples/rtc.rs @@ -25,8 +25,7 @@ use rt::ExceptionFrame; use core::fmt::Write; use sh::hio; -entry!(main); - +#[entry] fn main() -> ! { let mut hstdout = hio::hstdout().unwrap(); @@ -66,14 +65,7 @@ fn main() -> ! { loop {} } -exception!(HardFault, hard_fault); - -fn hard_fault(ef: &ExceptionFrame) -> ! { +#[exception] +fn HardFault(ef: &ExceptionFrame) -> ! { panic!("{:#?}", ef); -} - -exception!(*, default_handler); - -fn default_handler(irqn: i16) { - panic!("Unhandled exception (IRQn = {})", irqn); -} +} \ No newline at end of file diff --git a/examples/serial.rs b/examples/serial.rs index bc1c4e8d..1e577c29 100644 --- a/examples/serial.rs +++ b/examples/serial.rs @@ -23,8 +23,7 @@ use hal::serial::Serial; use hal::stm32l4::stm32l4x2; use rt::ExceptionFrame; -entry!(main); - +#[entry] fn main() -> ! { let p = stm32l4x2::Peripherals::take().unwrap(); @@ -67,14 +66,7 @@ fn main() -> ! { loop {} } -exception!(HardFault, hard_fault); - -fn hard_fault(ef: &ExceptionFrame) -> ! { +#[exception] +fn HardFault(ef: &ExceptionFrame) -> ! { panic!("{:#?}", ef); } - -exception!(*, default_handler); - -fn default_handler(irqn: i16) { - panic!("Unhandled exception (IRQn = {})", irqn); -} diff --git a/examples/serial_dma.rs b/examples/serial_dma.rs index 8575ffb4..50fd89e8 100644 --- a/examples/serial_dma.rs +++ b/examples/serial_dma.rs @@ -25,8 +25,7 @@ use hal::serial::Serial; use hal::stm32l4::stm32l4x2; use rt::ExceptionFrame; -entry!(main); - +#[entry] fn main() -> ! { let p = stm32l4x2::Peripherals::take().unwrap(); @@ -90,14 +89,7 @@ fn main() -> ! { loop {} } -exception!(HardFault, hard_fault); - -fn hard_fault(ef: &ExceptionFrame) -> ! { +#[exception] +fn HardFault(ef: &ExceptionFrame) -> ! { panic!("{:#?}", ef); } - -exception!(*, default_handler); - -fn default_handler(irqn: i16) { - panic!("Unhandled exception (IRQn = {})", irqn); -} diff --git a/examples/serial_dma_partial_peek.rs b/examples/serial_dma_partial_peek.rs index c9b5081b..0f5f1319 100644 --- a/examples/serial_dma_partial_peek.rs +++ b/examples/serial_dma_partial_peek.rs @@ -25,8 +25,7 @@ use hal::stm32l4::stm32l4x2; use rt::ExceptionFrame; use hal::delay::Delay; -entry!(main); - +#[entry] fn main() -> ! { let p = stm32l4x2::Peripherals::take().unwrap(); let cp = cortex_m::Peripherals::take().unwrap(); @@ -82,14 +81,7 @@ fn main() -> ! { loop {} } -exception!(HardFault, hard_fault); - -fn hard_fault(ef: &ExceptionFrame) -> ! { +#[exception] +fn HardFault(ef: &ExceptionFrame) -> ! { panic!("{:#?}", ef); } - -exception!(*, default_handler); - -fn default_handler(irqn: i16) { - panic!("Unhandled exception (IRQn = {})", irqn); -} diff --git a/examples/serial_vcom.rs b/examples/serial_vcom.rs index ba40dd3a..79d698e8 100644 --- a/examples/serial_vcom.rs +++ b/examples/serial_vcom.rs @@ -22,8 +22,7 @@ use hal::serial::Serial; use hal::stm32l4::stm32l4x2; use rt::ExceptionFrame; -entry!(main); - +#[entry] fn main() -> ! { let p = stm32l4x2::Peripherals::take().unwrap(); @@ -71,14 +70,7 @@ fn main() -> ! { loop {} } -exception!(HardFault, hard_fault); - -fn hard_fault(ef: &ExceptionFrame) -> ! { +#[exception] +fn HardFault(ef: &ExceptionFrame) -> ! { panic!("{:#?}", ef); } - -exception!(*, default_handler); - -fn default_handler(irqn: i16) { - panic!("Unhandled exception (IRQn = {})", irqn); -} diff --git a/examples/spi_write.rs b/examples/spi_write.rs index 7bc99eb5..afca0acd 100644 --- a/examples/spi_write.rs +++ b/examples/spi_write.rs @@ -24,8 +24,7 @@ pub const MODE: Mode = Mode { polarity: Polarity::IdleLow, }; -entry!(main); - +#[entry] fn main() -> ! { let p = stm32l4x2::Peripherals::take().unwrap(); @@ -82,14 +81,7 @@ fn main() -> ! { loop {} } -exception!(HardFault, hard_fault); - -fn hard_fault(ef: &ExceptionFrame) -> ! { +#[exception] +fn HardFault(ef: &ExceptionFrame) -> ! { panic!("{:#?}", ef); } - -exception!(*, default_handler); - -fn default_handler(irqn: i16) { - panic!("Unhandled exception (IRQn = {})", irqn); -} diff --git a/examples/touch.rs b/examples/touch.rs index 8598e699..bc3b36f1 100644 --- a/examples/touch.rs +++ b/examples/touch.rs @@ -19,8 +19,7 @@ use hal::stm32l4::stm32l4x2; use hal::tsc::Tsc; use rt::ExceptionFrame; -entry!(main); - +#[entry] fn main() -> ! { let p = stm32l4x2::Peripherals::take().unwrap(); // let cp = cortex_m::Peripherals::take().unwrap(); @@ -62,14 +61,7 @@ fn main() -> ! { } } -exception!(HardFault, hard_fault); - -fn hard_fault(ef: &ExceptionFrame) -> ! { +#[exception] +fn HardFault(ef: &ExceptionFrame) -> ! { panic!("{:#?}", ef); } - -exception!(*, default_handler); - -fn default_handler(irqn: i16) { - panic!("Unhandled exception (IRQn = {})", irqn); -} diff --git a/src/serial.rs b/src/serial.rs index ef859cb5..e7aa49ef 100644 --- a/src/serial.rs +++ b/src/serial.rs @@ -241,10 +241,10 @@ macro_rules! hal { { { let buffer: &[u8] = &buffer[0]; - chan.cmar().write(|w| unsafe { + chan.cmar().write(|w| { w.ma().bits(buffer.as_ptr() as usize as u32) }); - chan.cndtr().write(|w| unsafe{ + chan.cndtr().write(|w|{ w.ndt().bits((buffer.len() * 2) as u16) }); chan.cpar().write(|w| unsafe { @@ -252,7 +252,7 @@ macro_rules! hal { }); // Tell DMA to request from serial - chan.cselr().write(|w| unsafe { + chan.cselr().write(|w| { w.$dmacsr().bits(0010) });