CLean up Cargo.toml and the code a bit (more 2018 editionish)

This commit is contained in:
Paul van Tilburg 2019-03-20 10:30:57 +01:00
parent 85317dcbd6
commit 18061e094e
2 changed files with 15 additions and 12 deletions

View File

@ -1,15 +1,18 @@
[package] [package]
edition = "2018"
name = "stm32f4disc-demo" name = "stm32f4disc-demo"
version = "0.1.0" version = "0.1.0"
categories = ["embedded", "no-std"]
description = "Some STM32F4DISCOVERY board demo application"
license = "0BSD"
authors = ["Paul van Tilburg <paul@luon.net>"] authors = ["Paul van Tilburg <paul@luon.net>"]
edition = "2018" readme = "README.md"
[dependencies] [dependencies]
cortex-m = "0.5.8" cortex-m = "0.5.8"
cortex-m-rt = "0.6.5" cortex-m-rt = "0.6.5"
cortex-m-semihosting = "0.3.2" cortex-m-semihosting = "0.3.2"
heapless = "0.4.2" heapless = "0.4.2"
panic-halt = "0.2.0"
panic-semihosting = "0.5.1" panic-semihosting = "0.5.1"
[dependencies.cortex-m-rtfm] [dependencies.cortex-m-rtfm]

View File

@ -8,21 +8,21 @@
#![no_main] #![no_main]
#![no_std] #![no_std]
extern crate panic_semihosting;
mod led_ring; mod led_ring;
use crate::led_ring::{Led, LedRing}; use crate::led_ring::{Led, LedRing};
use core::fmt::Write; use core::fmt::Write;
use cortex_m_semihosting::hprintln; use cortex_m_semihosting::hprintln;
use hal::block; use hal::{
use hal::gpio::{Alternate, Edge, ExtiPin, Floating, Input, Output, PushPull, AF5}; block,
use hal::prelude::*; gpio::{Alternate, Edge, ExtiPin, Floating, Input, Output, PushPull, AF5},
use hal::serial::{self, config::Config as SerialConfig, Serial}; prelude::*,
use hal::spi::{Mode, Phase, Polarity, Spi}; serial::{self, config::Config as SerialConfig, Serial},
use hal::stm32::{EXTI, SPI1, USART2}; spi::{Mode, Phase, Polarity, Spi},
use heapless::consts::U8; stm32::{EXTI, SPI1, USART2},
use heapless::Vec; };
use heapless::{consts::U8, Vec};
use panic_semihosting as _;
use rtfm::app; use rtfm::app;
type Accelerometer = hal::spi::Spi<SPI1, (Spi1Sck, Spi1Miso, Spi1Mosi)>; type Accelerometer = hal::spi::Spi<SPI1, (Spi1Sck, Spi1Miso, Spi1Mosi)>;