$Id: ChangeLog,v 1.141 2011-12-30 15:25:45 jsmcortina Exp $
MS2/Extra ChangeLog
-------------------
OK, so there's three years of changes missing....

2009-02-28
First 3.0 alpha (called 1.0.3 at that point)

2009-03-13
This is the new alpha version of the sequential code with all of the updates from the beta 2.1.0 20090311. This code also has all the wheel modes enabled and all the options of the beta code except for the rotary options. These will come in a later version soon. 
---3.0.3a---

2009-04-26

---3.0.3b---

2009-05-07

This release includes all the latest updates from the beta 2.1.0 20090413. It also includes all the features and options that were left out of the previous release. This means that this release should be the same as the beta 2.1.0 release with the same features and behaviour and have the sequential injection option in addition. 

Correction of the afr target bug

---3.0.3c---

2009-06-11
The latest release for the Alpha 3.0.3 contains all the code updates from the RC2 and RC3 versions of 2.1.0. Refer to the posts on those releases for the code updates. In addition there are 2 changes specific to the sequential code:

1- The use of the cranking pulse width % has been corrected in the code so that it is no longer necessary to put a value 2 or 4 times higher than what is required for the non-sequential code.

2- A bug was present that omitted injection pulses when 2 pulses started overlapping on the same injector channel. This only affected semi-sequential (non-siamese) when duty cycle was approaching 100% and sequential Siamese modes when timing and duty cycle was causing overlap. This is now corrected but overlapping pulses will still affect timing (and pulse width of the outer cylinders for the sequential siamese mode).

---3.0.3d---

2009-06-27
- Ken's change for staging which prevents unwanted activation when a parameter like TPS becomes negative.

- Addition of a hybrid mode for the sequential siamese mode. This mode allows the injection to go from the full sequential dual pulses to a single pulse for both cylinders. This allows the optimal use of the injection window by removing the closing and opening of the second pulse therefore using the entire open valve duration (of both cylinders) for fuel injection. There is an activation RPM where the single pulse will start when RPM is going up and an RPM hysteresis used when the RPM goes below (activation RPM-hysteresis RPM) when going down. Changing these RPM values require a power cycle to take effect.

Also, since there is a need to change both the fueling and the injection timing when going to the single pulse mode, there is now a third injection timing value and timing table. The fueling for the single pulse mode is done by using the Fuel VE Table 3 in the Extended menu. This means that this table can no longer be used to switch table in the sequential siamese mode (but it's still available in the other sequential/semi-sequential modes).

To disable this hybrid mode and run purely in dual pulse mode, the activation RPM is set to a value higher than the engine's usable range (for example 15000RPM).

The code has been updated to include Ken's fix for the rotary trailing code.
Also, a bug was fixed for the priming pulse. The priming pulse was only fired for injector channels 1 and 2.
And staging was fixed. It was broken for sequential/semi-sequential when another fix was included.

VE trim tables now centered around 100% instead of 0%, i.e., 100% means no trim. The values can be from 87.6% to 112.4% (+-12.4%).

---3.0.3e---

2009-08-20
---3.0.3f---

2009-08-22
---3.0.3g---

2009-09-07
---3.0.3h---

2009-09-12
---3.0.3i---

2009-10-28 JSM
Stacking soft registers when assembler ISR call C functions, fixes major bug. (Backport from MS3)
Add config error to prevent trigger angle/offset with trigger wheel or EDIS. Grey menu.
Change CAN passthrough to use "MS3 fix", removing other method.
Extend CAN protocol to allow 32 tables

2009-10-31 KWC
Merge back MAF (untested) and ITB mode (tested) to ms2/extra.

2009-11-4 KWC
Merge back adding eaeload and afrload to outpc, and small idle code fix.

2009-11-06 JSM
Made ign_in a FAR subroutine
Backport MS3 changes to:
-distributor
-trigger return
-twin trigger
-1,2,3 cyl rpm / squirts calcs
Fix rotary (was broken)
Minimal testing

2009-11-07 JSM
Ported 6/7 COP from MS3
Ported NGC 2.2/2.4 alternate cam from MS3
Limited testing on scope.

---3.0.3l---

2009-11-10 JB
Corrected ms2extra_structs.inc to align flash5 variables correctly
(post release)
Added text38 section to DOS makefile 

2009-11-10 KWC
Make closed loop idle lockout settings less prone to false triggering.

---3.0.3m---

2009-11-12 JSM
Backported Nissan QR25DE from MS3

2009-11-17 KWC
More CL idle fixes. Make rpmdot a part of outpc and make it calculate smoothly.

---3.0.3n---

2009-11-21 JSM
Backport 'spkmode' variable from MS3.
Add dedicated crank/cam logger modes for capturing new wheels.
init changes to use _CAM_ flags.
Changed check for no. triggers

2009-11-23 JSM
Fix EDIS rpm
Allow stepper motor with Microsquirt for module

2009-12-05 JSM
Fix near-360 tooth #1 angle problem
Fix 0x60 bitmask for rising/falling
Add 'every cylinder' 2nd trigger mode.

2009-12-05 JB
Corrected assignment of temp_pw to pair channels 1 with 3 and 2 with 4
Removed unwanted sync for Subaru 6/7 mode when using cam information
Added missing sync flag updates
Corrected EAE computation when using sequential and staged injection
Moved pw_calcx computations to have all 4 done at the same time. Removed unneeded DISABLE_INTERRUPTS (16-bit values)

---3.0.3q---

2009-12-21 JSM
Backport syncfirst improvements from MS3.
Fix logic error introduced with 'every cylinder' 2nd trigger mode.
Move log buffer clear to sub to free space in main()

2009-12-27 JSM
Backport LS1 mode from MS3
Make tooth logger work as expected with double edged crank triggering

2009-12-28 JSM
LS1 tweak (tested on COP/Seq engine)
Add automatic polarity noise filter.
Actually enable normal crank polarity check.
Get trigger wizard working with EDIS.
RC51 changes

---3.0.3r---

2010-01-02 JSM
RC51 / FSC600 wheel changes

2010-01-17 JSM
ASE bugfix

2010-01-19 JSM
Make syncfirst changes conditional on rpm to prevent high rpm sync failure

2010-01-23 JSM
Fix 60-2+cam ancient trigger bug.
Fix getting stuck in cranking mode.
Use ENGINE_ defines.
Remove copyini and other Megatune-isms. Single ini file.
Fix for incorrect trigger teeth on V2 oddfire w/s.
syncfirst was not working correctly with V2 evenfire w/s (no_triggers==1)

2010-01-26 JSM
Dual+missing with odd-fire or 5cyl could generate invalid trigger teeth.
Comment WCOP feature.

2010-01-27 JSM
Add YZF1000 wheel mode
conf error bugfix from MS3
32 tooth wheel support

2010-02-04 JSM
Fully removed WCOP
Calc rpm from tooth time before first rpm period.

2010-02-11 JSM
Re-arrange EDIS rpm calcs to use lag and to calc rpmdot
Backported sliding windows rpmdot from MS3
Added CRC32 checking of ram page

2010-02-14 KWC
Port cycle_deg changes to ms2 to see if that helps the injector issues
being reported.

2010-02-15 JSM
Added support for CRC32 via CAN
Moved flash11 to unbanked flash and delete _3a lookup function.
Support flash11 tuning via CAN (was missing)

2010-02-16 JSM
Spare ports initial values

2010-02-20 JSM
IAW-Weber-Marelli mode should now work in wasted spark / COP

2010-02-22 KWC
Fix hang when using sequential fuel.

2010-03-01 JSM
High rpm resync broke map sampling. Simple code error.

2010-03-01 JB
Updated ini for injector advance limits to -360 to 720 degrees from -360 to 360 degrees.
Corrected blip in injector pulse when scheduling beginning of pulse
Updated default remote CAN offset

2010-03-02 JB
Moved gpioport to the end of realtime data to keep 16-bit data aligned on even word for CAN transfer

2010-03-04 KWC
Merge Rob's interpolation work. Saves ~100-300 usec off mainloop time, and
appears to be at least as accurate if not more accurate.

2010-03-08 JSM
Tooth/trigger logger fixes.

2010-03-11 JB
Added support for remote flex fuel input using PWM input
Added support for remote knock input

2010-03-12 JB
Added support for additional injectors when not using sequential injection
Made sure that PWM not used when using additional injectors
Added injector test output for channels 3 and 4

2010-03-18 JSM
Moved inj isrs to TEXT3 to allow code to compile for me.

2010-03-23 JSM
Add test and config error for broken CAN transceiver.

2010-03-26 JSM
Twin trigger. 2nd output polarity was inverted. Rotary dwell overflow was broken.
Get config error pump output working and reduce 'flash' rate.
Test mode now works if twin trigger used on stim with rpm input.

2010-03-28 JB
Added the possibility of using the remote CAN data as a slave (not actively polling the CAN bus)

2010-03-29 JSM
Noisefilter high rpm resync fix backport from MS3. (untested)

2010-04-09 JB
Added a mechanism to prevent rescheduling the same injector channel in one engine cycle/rev

---3.0.3s---

2010-04-12 JB
Added condition to cover single cylinder when masking forced injection

---3.0.3t---

2010-04-15 JSM
Update Makefile.DOS for interp.s and crc32.s

2010-04-17 JB
Updated clt and mat inc files to extend range beyond 215F
Marked 'md95' issue as fixed in TODO

2010-04-29 JSM
Backport Nissan QR25DE wheel tweaks.

2010-05-06 KWC
Merge back fixes for PWM and IAC crank->run taper from ms3.

2010-05-16 KWC
Merge back fixes for CL idle getting stuck when RPM goes above max RPM.

2010-05-18 KWC
Somehow page9 got too big. Fix it (And probably a whole bunch of odd issues
along with it).

2010-05-20 KWC
Backport type B PID change from ms3 for boost control. Should track
changes in target better now.

2010-05-23 KWC
Backport overrun lower RPM limit from ms3.

2010-05-25 JSM
'divider' calc was broken for EDIS. (Due to partial backport from MS3.)
MAF did not work. flagbyte6 cleared at end of init. maflookup was broken

2010-05-25 JB
Added error message if trying to use sequential/semi-sequential with EDIS or basic trigger
Disabled sequential menu items when EDIS or basic trigger selected

2010-06-03 JB
Added remote port option for EGO1

2010-06-08 KWC
Make MAF lookup cause VE not to be looked up.

2010-06-11 JSM
Re-wrote trigger calculator for wheel decoder (and dizzy). Limited bench testing.

2010-06-14 JB
Fixed broken VE trim by moving it into the correct fuel computation section

2010-07-06 JSM
ini tweaks for MT compat.
Fix afrtgt scaling in ini

2010-09-25 JSM
Backport some serial changes from MS3 (Ken had made a start)
- error checking / config error messages
- outpc transmit is interrupt driven again
Applied NB EGO changes

2010-10-01 JSM
ini tweaks
Spark retard uchar to allow up to 25.5 deg retard
Set SPK3 table to all zeros

2010-10-03 JSM
Copied downloader from 2.1.0e
---3.0.3v ---

2010-10-05 JSM
Backport ign_wheel fixes for dual+missing and -2 from MS3

2010-10-09 JB
Fixed broken VE trim for channels 3 and 4 by moving code to correct fuel computation section

2010-10-23 JSM
Fix 'a 00 06' for Megaview
Scale pulsewidths for Megaview
Support temperature units for Megaview
Fix 'c' serial command
---3.0.3w ---

2010-10-24 JSM
Fix Megaview maths

2010-10-25 JSM
Add MAF calibration option to ini

2010-10-29 JSM
Fix CAN passthrough and CRC check.
Update Makefiles to use new compiler.
SCI tweaks
---3.0.3x ---

2010-10-31 JSM
LS1 15 deg offset from MS3

2010-11-06 JSM
Mainloop page change
Test mode no double burn

2010-11-08 JSM
Change phase on QR25DE
Fix rotary trailing spark cut
Stop spark cut indicator flashing

2010-11-09 JSM
MAP sampling - minimum over X events
MAPdot code from MS3

2010-11-20 JSM
GPIO trans adjuster variables. Table 7, offset 622.

2010-11-21 JSM
NGC4 (36-1+1) adjust by 360 deg and check cam is there

2010-12-02 JSM
ign_in jump table from robs

2010-12-08 JSM
Add 4 and 6 cyl Toyota DLI spark outputs
pageActivate code changes, but won't be used.
Comment pageActivate from ini - causing serial problems

---3.0.3y ---

2010-12-11 JSM
cam polarity check was only being run when comp logging
Wording change in download-MS2-firmware.bat

--- RC1 ---

2010-12-21 JSM
36-2-2-2 outputs swapped if not rotary

2010-12-26 JSM
Added battV calibration dialogue to ini

2010-12-29 KWC
Add pwmidle shift code.

2011-01-05 JB
The staged bits checks were not all checking the correct bits

-- 3.1.0 --

2011-01-27 JSM
Oddfire dizzy and fuel-only weren't working correctly.
egoV was broken (applied same fixed as applied to egoV2 long ago)

2011-02-10 JSM
Renix cam support and 66-2-2-2

-- 3.1.1 --

2011-03-16 KWC
Clean up mariob's PID idle ideas and commit them.

2011-03-20 JB
Added loading of tble_idx in chknewpage for call from CAN isr for pages 4,5,... : read from these tables from a CAN device was broken

2011-05-01 JB
Added check for conflict between spare output ports and spark outputs

2011-05-26 JSM
ini rewording. Open Time -> Dead Time

2011-05-31 JSM
Added 4cyl support to RC51 mode (RC46)
Oddfire averaging tweak - always over 4 periods
Change phase on RC46

2011-06-19 JSM
mafmap was 10x out in code and also 10x in ini file
Re-do tble_idx for CAN change. Use MS3 code.
Port dwellq code from MS3.
Fix bug in Twin Trigger for dwell at same point as trigger.

2011-06-20 JSM
Validate MAP sample angles.

2011-06-21 KWC
Do EGO, Idle, Boost x 100 changes
Fix D term on idle.

2011-06-22 JSM
Use _correct_ config error no. for MAP angle check and fix base data.

2011-07-04 JSM
Distributor dwellq fix, same as MS3

2011-07-10 KWC
Fix simple EGO

2011-08-04 JSM
Mark as 'beta'. No code changes.

-- 3.1.2 --

2011-08-15 JSM
CAN passthrough still wasn't working correctly.

2011-08-18 JSM
Inj test mode serial incoherency workaround
Test mode dialogue improvements

2011-08-28 JB
Changed the injector dead time (open time) computation from linear to non-linear: multiply correction by 13.2/batt voltage

2011-09-28 JB
Prevented timing update to next injector to fire to avoid missed or doubled pulses
Changed minimum time for scheduling an event from 110 to 150 (spark and injection)

2011-09-29 JSM
ini and base data tweaks to clean up errors reported in TS.
Update battery voltage during test mode

-- 3.1.3 --

2011-09-30 JB
Removed the timing update restriction: caused wheel modes with many teeth to not update pulse width

2011-10-01 JB
No code change, just updated signature to 3.1.3a
Corrected ini for limits on spare output offset

2011-10-12 JB
Corrected a few places where the minimum time for scheduling was missed in previous version

2011-10-15 JB
Corrected issue when duty cycle greater than 100% minus one tooth.

2011-10-16 JB
Covered cases for semi-sequential and duty cycle > 100%

2011-10-23 JB
Corrected fuel cut bug with injector channel 3
Changed pulse width check to start injecting from 0 to 100 to avoid timer overrun and huge pulse width

-- 3.1.4 --

2011-10-26 JB
Major redesign of the sequential injection code: use software timer and 0.128ms rtc ISR to start injection

2011-10-30 JSM
6/7 mode tweak

2011-11-12 JSM
Add LICENSE files.

-- 3.2.0 --

2011-11-20 JSM
Rail all (inc. realtime) baro to limits

2011-11-24 JB
Set correct tooth number to 6/7 mode tweak

2011-12-02 JSM
Allow Microsquirt to change spkA due to logic-only new Microsquirt.

2011-12-05 JSM
Fix Basic Trigger spark cut.

2011-12-08 JSM
Add 'deadman' to MAP sampling to detect impossible events and allow engine operation.
Allow MAP window to span trigger.
Tweak indicators, so green=ok, red=problem, get rid of '-'

2011-12-09 JSM
Add boost bar,psig,vac gauges

-- 3.2.1 --

2011-12-21 JSM
Clarify global vs. local 'divider' variable. s19 unchanged

2011-12-22 JSM
Change spkA output names for Microsquirt. Signature not changed.

2011-12-23 JSM
ini tweaks

-- 3.2.1 release --

