<html><head><meta http-equiv="Content-Type" content="text/html charset=windows-1252"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;">Hi mark,<div><br></div><div>i did this in "vehicle_voltampera.c:" in 2.2.7</div><div><br></div><div><div>else if (id == 0x7e9)</div><div>    {</div><div>    switch (pid)</div><div>      {</div><div>      case 0x2487:  //Distance Traveled on Battery Energy This Drive Cycle</div><div>          edrive_distance = KM2MI((can_databuffer[5] + ((unsigned int)can_databuffer[4] << 8)) / 100); // German Volt Report im KM</div><div>          if ((edrive_distance > va_drive_distance_bat_max) && (car_chargestate == 4)) va_drive_distance_bat_max = edrive_distance;</div><div>        break;</div><div>      }</div><div>    }</div><div><br></div><div>cause the return value is placed on 2 Bytes.</div><div>I think it is necessary to implement a parameter how much return byte expected.</div><div><br></div><div>Bye</div><div>Michael</div><div><br></div><div><br></div><div><div>Am 02.11.2013 um 14:14 schrieb Mark Webb-Johnson <<a href="mailto:mark@webb-johnson.net">mark@webb-johnson.net</a>>:</div><br class="Apple-interchange-newline"><blockquote type="cite"><meta http-equiv="Content-Type" content="text/html charset=windows-1252"><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;">I just committed a change to all vehicle modules, to change the api for the poll0() and poll1() functions.<div><br></div><div><blockquote style="margin: 0 0 0 40px; border: none; padding: 0px;"><font face="Andale Mono">1aaa0a3 Move can bus low level register access to vehicle.c, out of individual vehicle modules</font></blockquote></div><div><br></div><div>The new API sets up:</div><div><br></div><div><blockquote style="margin: 0 0 0 40px; border: none; padding: 0px;"><div><font face="Andale Mono">unsigned int   can_id;                    // ID of can message</font></div><div><font face="Andale Mono">unsigned char  can_filter;                // CAN filter</font></div><div><font face="Andale Mono">unsigned char  can_datalength;            // The number of valid bytes in the can_databuffer</font></div><div><font face="Andale Mono">unsigned char  can_databuffer[8];         // CAN message bytes</font></div></blockquote></div><div><br></div><div>prior to the calls to poll0() and poll1(). So, the individual vehicle modules no longer need to (and no longer are able to) access the low-level CAN bus registers in any way.</div><div><br></div><div>I tried to move all the vehicle modules to the new mechanism, but there seemed to be significant differences in the way each module did things. Hopefully the work I did was ok and hasn’t broken anything, but please check your respective modules to make sure they still work.</div><div><br></div><div>Overall, we’ve saved about 500-to-600 bytes of flash doing this.</div><div><br></div><div>I’ve labelled this 2.6.1, as it has the capacity to break things.</div><div><br></div><div>Regards, Mark.</div><div><br></div></div>_______________________________________________<br>OvmsDev mailing list<br><a href="mailto:OvmsDev@lists.teslaclub.hk">OvmsDev@lists.teslaclub.hk</a><br>http://lists.teslaclub.hk/mailman/listinfo/ovmsdev<br></blockquote></div><br></div></body></html>