From b345cc08654a18891fa7a635c103ab888918478d Mon Sep 17 00:00:00 2001 From: Astro Date: Sat, 21 Mar 2020 00:22:38 +0100 Subject: [PATCH] use embedded_hal through stm32f4xx_hal instead of direct dependency this will aid maintainability. --- Cargo.lock | 1 - Cargo.toml | 1 - src/ad5680.rs | 8 ++++---- src/ad7172/adc.rs | 6 ++++-- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 681acb4..8df73bd 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -355,7 +355,6 @@ dependencies = [ "cortex-m", "cortex-m-log", "cortex-m-rt", - "embedded-hal", "hash2hwaddr", "log", "nom", diff --git a/Cargo.toml b/Cargo.toml index 3211541..57848f1 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -21,7 +21,6 @@ bare-metal = "0.2" cortex-m = "0.6" cortex-m-rt = { version = "0.6", features = ["device"] } cortex-m-log = { version = "0.6", features = ["log-integration"] } -embedded-hal = "0.2" # TODO: pending https://github.com/stm32-rs/stm32f4xx-hal/pull/125 stm32f4xx-hal = { git = "https://github.com/thalesfragoso/stm32f4xx-hal", branch = "pwm-impl", features = ["rt", "stm32f427"] } stm32-eth = { version = "0.1.2", features = ["smoltcp-phy"], git = "https://github.com/stm32-rs/stm32-eth.git" } diff --git a/src/ad5680.rs b/src/ad5680.rs index 53936ff..d214d09 100644 --- a/src/ad5680.rs +++ b/src/ad5680.rs @@ -1,8 +1,8 @@ -use embedded_hal::{ - blocking::spi::Transfer, - digital::v2::OutputPin, -}; use stm32f4xx_hal::{ + hal::{ + blocking::spi::Transfer, + digital::v2::OutputPin, + }, time::MegaHertz, spi, }; diff --git a/src/ad7172/adc.rs b/src/ad7172/adc.rs index 890bcc4..353d63c 100644 --- a/src/ad7172/adc.rs +++ b/src/ad7172/adc.rs @@ -1,7 +1,9 @@ use core::fmt; -use embedded_hal::digital::v2::OutputPin; -use embedded_hal::blocking::spi::Transfer; use log::{info, warn}; +use stm32f4xx_hal::hal::{ + blocking::spi::Transfer, + digital::v2::OutputPin, +}; use super::{ regs::{self, Register, RegisterData}, checksum::{ChecksumMode, Checksum},