Add engine RPM to CAN RX data

This commit is contained in:
Ashcon Mohseninia 2022-08-03 21:19:03 +01:00
parent ddcc4b76cb
commit 7b510512de
17 changed files with 122 additions and 1 deletions

BIN
case_models/case_v1.blend Normal file

Binary file not shown.

BIN
case_models/case_v1.blend1 Normal file

Binary file not shown.

BIN
case_models/v1.FCStd Normal file

Binary file not shown.

BIN
case_models/v1.FCStd1 Normal file

Binary file not shown.

BIN
case_models/v2.FCStd Normal file

Binary file not shown.

BIN
case_models/v2.FCStd1 Normal file

Binary file not shown.

8
config_app/.idea/.gitignore vendored Normal file
View File

@ -0,0 +1,8 @@
# Default ignored files
/shelf/
/workspace.xml
# Editor-based HTTP Client requests
/httpRequests/
# Datasource local storage ignored files
/dataSources/
/dataSources.local.xml

View File

@ -0,0 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<module type="CPP_MODULE" version="4">
<component name="NewModuleRootManager">
<content url="file://$MODULE_DIR$">
<sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" />
<excludeFolder url="file://$MODULE_DIR$/target" />
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
</module>

View File

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://$PROJECT_DIR$/.idea/config_app.iml" filepath="$PROJECT_DIR$/.idea/config_app.iml" />
</modules>
</component>
</project>

6
config_app/.idea/vcs.xml Normal file
View File

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="$PROJECT_DIR$/.." vcs="Git" />
</component>
</project>

48
config_app/.vscode/launch.json vendored Normal file
View File

@ -0,0 +1,48 @@
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"type": "lldb",
"request": "launch",
"name": "Debug executable 'config_app'",
"cargo": {
"args": [
"build",
"--bin=config_app",
"--package=config_app"
],
"filter": {
"name": "config_app",
"kind": "bin"
}
},
"args": [],
"cwd": "${workspaceFolder}",
"env": {
"RUST_LOG": "ecu_diagnostic"
}
},
{
"type": "lldb",
"request": "launch",
"name": "Debug unit tests in executable 'config_app'",
"cargo": {
"args": [
"test",
"--no-run",
"--bin=config_app",
"--package=config_app"
],
"filter": {
"name": "config_app",
"kind": "bin"
}
},
"args": [],
"cwd": "${workspaceFolder}"
}
]
}

19
config_app/.vscode/tasks.json vendored Normal file
View File

@ -0,0 +1,19 @@
{
// See https://go.microsoft.com/fwlink/?LinkId=733558
// for the documentation about the tasks.json format
"version": "2.0.0",
"tasks": [
{
"label": "cargo run",
"type": "shell",
"command": "~/.cargo/bin/cargo", // note: full path to the cargo
"args": [
"run",
],
"group": {
"kind": "build",
"isDefault": true
}
}
]
}

Binary file not shown.

1
config_app/debug_crash.sh Executable file
View File

@ -0,0 +1 @@
~/.platformio/packages/toolchain-xtensa-esp32/bin/xtensa-esp32-elf-gdb $1/.pio/build/esp-wrover-kit/firmware.elf dump.elf

BIN
config_app/dump.elf Normal file

Binary file not shown.

15
config_app/note Normal file
View File

@ -0,0 +1,15 @@
EspLogMessage { lvl: Info, timestamp: 121, tag: " esp_image", msg: "segment 0: paddr=00010020 vaddr=3f400020 size=10400h ( 66560) map" }
EspLogMessage { lvl: Info, timestamp: 128, tag: " esp_image", msg: "segment 1: paddr=00020428 vaddr=3ffbdb60 size=04a74h ( 19060) load" }
EspLogMessage { lvl: Info, timestamp: 137, tag: " esp_image", msg: "segment 2: paddr=00024ea4 vaddr=40080000 size=0b174h ( 45428) load" }
EspLogMessage { lvl: Info, timestamp: 147, tag: " esp_image", msg: "segment 3: paddr=00030020 vaddr=400d0020 size=33764h (210788) map" }
EspLogMessage { lvl: Info, timestamp: 151, tag: " esp_image", msg: "segment 4: paddr=0006378c vaddr=4008b174 size=07990h ( 31120) load" }
EspLogMessage { lvl: Info, timestamp: 161, tag: " esp_image", msg: "segment 5: paddr=0006b124 vaddr=50000000 size=00010h ( 16) load" }
EspLogMessage { lvl: Info, timestamp: 88887, tag: " esp_image", msg: "segment 0: paddr=00110020 vaddr=3f400020 size=0fd88h ( 64904) map" }
EspLogMessage { lvl: Info, timestamp: 88903, tag: " esp_image", msg: "segment 1: paddr=0011fdb0 vaddr=3ffbdb60 size=00268h ( 616) " }
EspLogMessage { lvl: Info, timestamp: 88909, tag: " esp_image", msg: "segment 2: paddr=00120020 vaddr=400d0020 size=32f58h (208728) map" }
EspLogMessage { lvl: Info, timestamp: 88948, tag: " esp_image", msg: "segment 3: paddr=00152f80 vaddr=3ffbddc8 size=04184h ( 16772) " }
EspLogMessage { lvl: Info, timestamp: 88956, tag: " esp_image", msg: "segment 4: paddr=0015710c vaddr=40080000 size=12aach ( 76460) " }
EspLogMessage { lvl: Info, timestamp: 88974, tag: " esp_image", msg: "segment 5: paddr=00169bc0 vaddr=50000000 size=00010h ( 16) " }
EspLogMessage { lvl: Error, timestamp: 88980, tag: " FLASHER", msg: "Set boot partition failed! ESP_ERR_OTA_VALIDATE_FAILED" }

View File

@ -343,7 +343,8 @@ pub struct DataCanDump {
pub right_rear_rpm: u16,
pub shift_profile_pressed: u8,
pub selector_position: ShifterPosition,
pub paddle_position: PaddlePosition
pub paddle_position: PaddlePosition,
pub engine_rpm: u16
}
impl DataCanDump {
@ -353,6 +354,10 @@ impl DataCanDump {
ui.label(if self.pedal_position() == u8::MAX { make_text("Signal not available", true) } else { make_text(format!("{:.1} %", self.pedal_position() as f32 / 250.0 * 100.0), false) });
ui.end_row();
ui.label("Engine RPM");
ui.label(if self.engine_rpm() == u16::MAX { make_text("Signal not available", true) } else { make_text(format!("{} RPM", self.engine_rpm() as f32), false) });
ui.end_row();
ui.label("Engine minimum torque");
ui.label(if self.min_torque_ms() == u16::MAX { make_text("Signal not available", true) } else { make_text(format!("{:.1} Nm", self.min_torque_ms() as f32 / 4.0 - 500.0), false) });
ui.end_row();