File tree Expand file tree Collapse file tree 5 files changed +18
-6
lines changed
Expand file tree Collapse file tree 5 files changed +18
-6
lines changed Original file line number Diff line number Diff 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
286288This 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
Original file line number Diff line number Diff line change 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" : " *" ,
Original file line number Diff line number Diff line change 11name =EMUcan
2- version =1.0.4
2+ version =1.0.5
33author =Stephan M. <designer2k2@gmail.com>
44maintainer =Stephan M. <designer2k2@gmail.com>
55sentence =ECUMaster EMU CAN Stream Reader Arduino Library
Original file line number Diff line number Diff 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}
Original file line number Diff line number Diff line change 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
3232struct 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
8082enum EMUcan_STATUS {
You can’t perform that action at this time.
0 commit comments