From 18061e094e96ad0bfd926d7dff2a6bbebaf3c3ba Mon Sep 17 00:00:00 2001 From: Paul van Tilburg Date: Wed, 20 Mar 2019 10:30:57 +0100 Subject: [PATCH] CLean up Cargo.toml and the code a bit (more 2018 editionish) --- Cargo.toml | 7 +++++-- src/main.rs | 20 ++++++++++---------- 2 files changed, 15 insertions(+), 12 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 337ea69..cddf1d5 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,15 +1,18 @@ [package] +edition = "2018" name = "stm32f4disc-demo" version = "0.1.0" +categories = ["embedded", "no-std"] +description = "Some STM32F4DISCOVERY board demo application" +license = "0BSD" authors = ["Paul van Tilburg "] -edition = "2018" +readme = "README.md" [dependencies] cortex-m = "0.5.8" cortex-m-rt = "0.6.5" cortex-m-semihosting = "0.3.2" heapless = "0.4.2" -panic-halt = "0.2.0" panic-semihosting = "0.5.1" [dependencies.cortex-m-rtfm] diff --git a/src/main.rs b/src/main.rs index f2df6f2..cf8cfb7 100644 --- a/src/main.rs +++ b/src/main.rs @@ -8,21 +8,21 @@ #![no_main] #![no_std] -extern crate panic_semihosting; - mod led_ring; use crate::led_ring::{Led, LedRing}; use core::fmt::Write; use cortex_m_semihosting::hprintln; -use hal::block; -use hal::gpio::{Alternate, Edge, ExtiPin, Floating, Input, Output, PushPull, AF5}; -use hal::prelude::*; -use hal::serial::{self, config::Config as SerialConfig, Serial}; -use hal::spi::{Mode, Phase, Polarity, Spi}; -use hal::stm32::{EXTI, SPI1, USART2}; -use heapless::consts::U8; -use heapless::Vec; +use hal::{ + block, + gpio::{Alternate, Edge, ExtiPin, Floating, Input, Output, PushPull, AF5}, + prelude::*, + serial::{self, config::Config as SerialConfig, Serial}, + spi::{Mode, Phase, Polarity, Spi}, + stm32::{EXTI, SPI1, USART2}, +}; +use heapless::{consts::U8, Vec}; +use panic_semihosting as _; use rtfm::app; type Accelerometer = hal::spi::Spi;