Skip to content

Commit

Permalink
Update to embedded-hal:1.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
emeric-martineau committed Mar 5, 2024
1 parent a8aeefb commit 1b87e93
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 8 deletions.
4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "jsy_mk_194"
version = "1.0.1"
version = "1.0.2"
authors = ["Emeric Martineau <[email protected]>"]
edition = "2021"
resolver = "2"
Expand All @@ -13,4 +13,4 @@ readme = "README.md"
repository = "https://github.com/emeric-martineau/jsy_mk_194"

[dependencies]
embedded-hal = "0.2.7"
embedded-hal = "1.0.0"
6 changes: 3 additions & 3 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
//! | 15 | negative kwh2 | 55, 56, 57, 58 |
//! | 16 | crc | 59, 60 |
//!
use embedded_hal::blocking::delay::DelayMs;
use embedded_hal::delay::DelayNs;

pub mod error;
#[cfg(test)]
Expand Down Expand Up @@ -219,7 +219,7 @@ impl Channel {
pub struct JsyMk194<U, D>
where
U: Uart,
D: DelayMs<u16>,
D: DelayNs,
{
uart: U,
delay: D,
Expand All @@ -235,7 +235,7 @@ where
impl<U, D> JsyMk194<U, D>
where
U: Uart,
D: DelayMs<u16>,
D: DelayNs,
{
/// Create a new struct of JsyMk194.
pub fn new(uart: U, delay: D) -> Self {
Expand Down
10 changes: 7 additions & 3 deletions src/tests/mod.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use embedded_hal::blocking::delay::DelayMs;
use embedded_hal::delay::DelayNs;

/// When put this data in segment_read, Uart.read() return Ok
const READ_DATA_OK: [u8; crate::READ_DATA_SIZE] = [
Expand Down Expand Up @@ -82,8 +82,12 @@ impl crate::Uart for UartTestImpl {

struct DelayTestImpl {}

impl DelayMs<u16> for DelayTestImpl {
fn delay_ms(&mut self, _ms: u16) {
impl DelayNs for DelayTestImpl {
fn delay_ms(&mut self, _ms: u32) {
// Do nothing
}

fn delay_ns(&mut self, _ns: u32) {
// Do nothing
}
}
Expand Down

0 comments on commit 1b87e93

Please sign in to comment.