Skip to content

Commit 113c9ac

Browse files
authored
Merge pull request #2 from designer2k2/new_values
Since 2.143 there are new values in the CAN stream: - Target Lambda - PWM2 - Fuel used
2 parents bca4caa + e924082 commit 113c9ac

File tree

5 files changed

+18
-6
lines changed

5 files changed

+18
-6
lines changed

README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,8 @@ struct emu_data_t {
153153
uint8_t outflags4; //Outflags 4
154154
uint8_t pwm1; //%
155155
uint16_t boostTarget; //kPa
156+
uint8_t pwm2; //%
157+
float fuel_used; //L
156158
};
157159
```
158160
@@ -285,7 +287,7 @@ void specialframefunction(const struct can_frame *frame) {
285287
286288
This Library is tested on Arduino Nano with a MCP2515 shield at 8Mhz.
287289
288-
The EMU Black was running Software Version 2.127.
290+
The EMU Black was running Software Version 2.154.
289291
290292
## Different Versions
291293

library.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
"type": "git",
1212
"url": "https://github.com/designer2k2/EMUcan"
1313
},
14-
"version": "1.0.4",
14+
"version": "1.0.5",
1515
"license": "GPL-3.0-only",
1616
"frameworks": "arduino",
1717
"platforms": "*",

library.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name=EMUcan
2-
version=1.0.4
2+
version=1.0.5
33
author=Stephan M. <designer2k2@gmail.com>
44
maintainer=Stephan M. <designer2k2@gmail.com>
55
sentence=ECUMaster EMU CAN Stream Reader Arduino Library

src/EMUcan.cpp

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -165,10 +165,18 @@ bool EMUcan::decodeEmuFrame(struct can_frame *msg) {
165165
}
166166
//Base +7:
167167
if (msg->can_id == _EMUbase + 7) {
168-
//Boost target 16bit 0-600 kPa
168+
//0-1 Boost target 16bit 0-600 kPa
169169
emu_data.boostTarget = ((msg->data[1] << 8) + msg->data[0]);
170-
//PWM#1 DC 1%/bit
170+
//2 PWM#1 DC 1%/bit
171171
emu_data.pwm1 = msg->data[2];
172+
if (msg->can_dlc == 8) {
173+
//4 Lambda target 8bit 0.01%/bit
174+
emu_data.lambdaTarget = msg->buf[4] / 100.0;
175+
//5 PWM#2 DC 1%/bit
176+
emu_data.pwm2 = msg->buf[5];
177+
//6-7 Fuel used 16bit 0.01L/bit
178+
emu_data.fuel_used = ((msg->buf[7] << 8) + msg->buf[6]) / 100.0;
179+
}
172180
}
173181
return true;
174182
}

src/EMUcan.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626

2727
#include <mcp2515.h>
2828

29-
#define EMUCAN_LIB_VERSION (F("1.0.4"))
29+
#define EMUCAN_LIB_VERSION (F("1.0.5"))
3030

3131
// Available data
3232
struct emu_data_t {
@@ -75,6 +75,8 @@ struct emu_data_t {
7575
uint8_t outflags4; //Outflags 4
7676
uint8_t pwm1; //%
7777
uint16_t boostTarget; //kPa
78+
uint8_t pwm2; //%
79+
float fuel_used; //L
7880
};
7981

8082
enum EMUcan_STATUS {

0 commit comments

Comments
 (0)