From d184ba2f510bc780a9f066c5cceed524b9ae6f00 Mon Sep 17 00:00:00 2001 From: Yorick de Wid Date: Thu, 21 Mar 2024 16:56:14 +0100 Subject: [PATCH] Update version and J1939 address in m-ecu crate --- Cargo.lock | 2 +- m-ecu/Cargo.toml | 2 +- m-ecu/src/main.rs | 28 +--------------------------- 3 files changed, 3 insertions(+), 29 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 0c48abc..9d71c91 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -242,7 +242,7 @@ dependencies = [ [[package]] name = "m-ecu" -version = "0.5.2" +version = "0.5.5" dependencies = [ "cortex-m-rtic", "stm32h7xx-hal", diff --git a/m-ecu/Cargo.toml b/m-ecu/Cargo.toml index a0159c9..47b77bc 100644 --- a/m-ecu/Cargo.toml +++ b/m-ecu/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "m-ecu" -version = "0.5.2" +version = "0.5.5" edition = "2021" [dependencies] diff --git a/m-ecu/src/main.rs b/m-ecu/src/main.rs index 7919b27..9367e5f 100644 --- a/m-ecu/src/main.rs +++ b/m-ecu/src/main.rs @@ -28,7 +28,7 @@ const FDCAN_CLOCK: Hertz = Hertz::MHz(32); const USART_CLOCK: Hertz = Hertz::MHz(48); /// J1939 network address. -const J1939_ADDRESS: u8 = 0x0; +const J1939_ADDRESS: u8 = 0x12; /// J1939 name manufacturer code. /// const J1939_NAME_MANUFACTURER_CODE: u16 = 0x717; @@ -387,14 +387,6 @@ mod app { ); if let Some(rpm) = message.rpm { - // if rpm < 700 { - // ctx.local.pwm0.set_duty(0); - // ctx.local.pwm0.enable(); - - // ctx.local.pwm1.set_duty(0); - // ctx.local.pwm1.enable(); - // } else - let duty = match rpm { ..=1049 => 24_500, 1050..=1549 => 22_500, @@ -402,24 +394,6 @@ mod app { }; ctx.local.pwm0.set_duty(duty); - - // if rpm < 1050 { - // let value = 24_500; - - // ctx.local.pwm0.set_duty(value); - // ctx.local.pwm0.enable(); - - // ctx.local.pwm1.set_duty(0); - // ctx.local.pwm1.enable(); - // } else if rpm < 1550 { - // let value = 22_500; - - // ctx.local.pwm0.set_duty(value); - // ctx.local.pwm0.enable(); - - // ctx.local.pwm1.set_duty(0); - // ctx.local.pwm1.enable(); - // } } } // PGN::TorqueSpeedControl1 => {