<html><head><meta http-equiv="Content-Type" content="text/html charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div><br></div><div>A while ago, Michael Balzer suggested to me that it would be best to have one firmware supporting all cars. I agreed, but at the time, flash space was tight in the v1 hardware and I was concerned we would run out of flash. So, we implemented two separate builds.</div><div><br></div><div>Now that the v2 hardware is out, I think that is much less of an issue than it was, as the v2 hardware has 50% more flash (taking away the baseline code, that at least triples the amount of free flash we have) - there should be plenty of space to support the cars that need it for the forceable future.</div><div><br></div><div><div>In the coming few months, as the Volt/Ampera and Renault Twizy code becomes usable and usable by end-users (rather than developers), it would be much easier to be providing modules pre-flashed with a single version of firmware supporting all the cars.</div></div><div><br></div><div>As the work on Twizy and Volt/Ampera is now progressing so fast, I think it best to make the change now rather than later. What I suggest is:</div><div><br></div><div><ol class="MailOutline"><li>We leave the current car modules basically as they are: can_teslaroadster, can_voltampera, and can_twizy.<br><br></li><li>We leave the v1 firmware build basically as it is - just using can_teslaroadster. All the v2 hardware users are Tesla Roadster users.<br><br></li><li>We move the 'shared' interrupt code (can_int_service, high_isr) out of the car_* modules into a can_canbus module.<br><br></li><li>We create a mechanism for car_* modules to register themselves at startup.<br><br></li><li>We create an eeprom parameter to define the vehicle type, and a switch at startup to hook the module supporting the currently defined car. It might be interesting in future to create a car_autodetect module to auto-detect the vehicle type from can bus traffic, but for the moment I think a manual parameter is acceptable.<br><br></li><li>The existing V2_T2, V2_VA and V2_RT build configurations would disappear and be replaced with a single V2 firmware that would include all three car_* modules.</li></ol></div><div><br></div><div>I'm not sure of the exact mechanism for [4] and [5], but it should not be too hard to do. I really want to avoid having a single list of the cars anywhere. I'd much rather just have the existence of code in the can_* modules cause the code to be included.</div><div><br></div><div><div>Does this sound sensible to everyone? Any better suggestions, or comments?</div></div><div><br></div><div>Regards, Mark.</div><div><br></div></body></html>