Skip to content

Commit

Permalink
Merge pull request #5 from designer2k2/bring_all_values
Browse files Browse the repository at this point in the history
Bring all values
  • Loading branch information
designer2k2 authored Sep 15, 2022
2 parents beb19cd + 341d407 commit 9928240
Show file tree
Hide file tree
Showing 5 changed files with 34 additions and 21 deletions.
16 changes: 7 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -115,12 +115,9 @@ struct emu_data_t {
float Batt; //V
float IgnAngle; //deg
float pulseWidth; //ms
float scondarypulseWidth; //ms
uint16_t Egt1; //C
uint16_t Egt2; //C
float knockLevel; //V
float dwellTime; //ms
float wboAFR; //AFR
int8_t gear; //
uint8_t Baro; //kPa
float analogIn1; //V
Expand All @@ -129,21 +126,15 @@ struct emu_data_t {
float analogIn4; //V
float analogIn5; //V
float analogIn6; //V
float injDC; //%
int8_t emuTemp; //C
float oilPressure; //Bar
uint8_t oilTemperature; //C
float fuelPressure; //Bar
int16_t CLT; //C
float flexFuelEthanolContent; //%
int8_t ffTemp; //C
float wboLambda; //λ
uint16_t vssSpeed; //km/h
uint16_t deltaFPR; //kPa
uint8_t fuelLevel; //%
uint8_t tablesSet; //
float lambdaTarget; //λ
float afrTarget; //AFR
uint16_t cel; //
float LambdaCorrection; //%
uint8_t flags1; //Flags 1
Expand All @@ -155,6 +146,13 @@ struct emu_data_t {
uint16_t boostTarget; //kPa
uint8_t pwm2; //%
float fuel_used; //L
uint8_t DSGmode; //DSG mode
float DBWpos; //%
float DBWtarget; //%
uint16_t TCdrpmRaw; //
uint16_t TCdrpm; //
uint8_t TCtorqueReduction; //%
uint8_t PitLimitTorqueReduction; //%
};
```
Expand Down
2 changes: 1 addition & 1 deletion library.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"type": "git",
"url": "https://github.com/designer2k2/EMUcan"
},
"version": "1.0.6",
"version": "1.0.7",
"license": "GPL-3.0-only",
"frameworks": "arduino",
"platforms": "*",
Expand Down
2 changes: 1 addition & 1 deletion library.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name=EMUcan
version=1.0.6
version=1.0.7
author=Stephan M. <[email protected]>
maintainer=Stephan M. <[email protected]>
sentence=ECUMaster EMU CAN Stream Reader Arduino Library
Expand Down
17 changes: 17 additions & 0 deletions src/EMUcan.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,21 @@ bool EMUcan::decodeEmuFrame(struct can_frame *msg) {
//7 ETHANOL %
emu_data.flexFuelEthanolContent = msg->data[7];
}
//Base +5:
if (msg->can_id == _EMUbase + 5) {
//0 DBW Pos 0.5%
emu_data.DBWpos = msg->data[0] * 0.5;
//1 DBW Target 0.5%
emu_data.DBWtarget = msg->data[1] * 0.5;
//2-3 TC DRPM RAW 16bit 1/bit
emu_data.TCdrpmRaw = ((msg->data[3] << 8) + msg->data[2]);
//4-5 TC DRPM 16bit 1/bit
emu_data.TCdrpm = ((msg->data[5] << 8) + msg->data[4]);
//6 TC Torque reduction %
emu_data.TCtorqueReduction = msg->data[6];
//7 Pit Limit Torque reduction %
emu_data.PitLimitTorqueReduction = msg->data[7];
}
//Base +6:
if (msg->can_id == _EMUbase + 6) {
//AIN in 16Bit unsigned 0.0048828125 V/bit
Expand All @@ -169,6 +184,8 @@ bool EMUcan::decodeEmuFrame(struct can_frame *msg) {
emu_data.boostTarget = ((msg->data[1] << 8) + msg->data[0]);
//2 PWM#1 DC 1%/bit
emu_data.pwm1 = msg->data[2];
//3 DSG mode 2=P 3=R 4=N 5=D 6=S 7=M 15=fault
emu_data.DSGmode = msg->data[3];
if (msg->can_dlc == 8) {
//4 Lambda target 8bit 0.01%/bit
emu_data.lambdaTarget = msg->data[4] * 0.01;
Expand Down
18 changes: 8 additions & 10 deletions src/EMUcan.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@

#include <mcp2515.h>

#define EMUCAN_LIB_VERSION (F("1.0.6"))
#define EMUCAN_LIB_VERSION (F("1.0.7"))

// Available data
struct emu_data_t {
Expand All @@ -37,12 +37,9 @@ struct emu_data_t {
float Batt; //V
float IgnAngle; //deg
float pulseWidth; //ms
float scondarypulseWidth; //ms
uint16_t Egt1; //C
uint16_t Egt2; //C
float knockLevel; //V
float dwellTime; //ms
float wboAFR; //AFR
int8_t gear; //
uint8_t Baro; //kPa
float analogIn1; //V
Expand All @@ -51,21 +48,15 @@ struct emu_data_t {
float analogIn4; //V
float analogIn5; //V
float analogIn6; //V
float injDC; //%
int8_t emuTemp; //C
float oilPressure; //Bar
uint8_t oilTemperature; //C
float fuelPressure; //Bar
int16_t CLT; //C
float flexFuelEthanolContent; //%
int8_t ffTemp; //C
float wboLambda; //λ
uint16_t vssSpeed; //km/h
uint16_t deltaFPR; //kPa
uint8_t fuelLevel; //%
uint8_t tablesSet; //
float lambdaTarget; //λ
float afrTarget; //AFR
uint16_t cel; //
float LambdaCorrection; //%
uint8_t flags1; //Flags 1
Expand All @@ -77,6 +68,13 @@ struct emu_data_t {
uint16_t boostTarget; //kPa
uint8_t pwm2; //%
float fuel_used; //L
uint8_t DSGmode; //DSG mode
float DBWpos; //%
float DBWtarget; //%
uint16_t TCdrpmRaw; //
uint16_t TCdrpm; //
uint8_t TCtorqueReduction; //%
uint8_t PitLimitTorqueReduction; //%
};

enum EMUcan_STATUS {
Expand Down

0 comments on commit 9928240

Please sign in to comment.