This commit is contained in:
Josh Stewart 2020-07-29 13:09:56 +10:00
commit a0fceef008
5 changed files with 11 additions and 5 deletions

View File

@ -3964,7 +3964,8 @@ cmdVSSratio6 = "E\x99\x06"
indicator = { softlimitOn }, "Soft Limit OFF","Soft Limiter", white, black, red, black
indicator = { hardLimitOn }, "Hard Limit OFF","Hard Limiter", white, black, red, black
indicator = { boostCutOut }, "Ign Cut OFF", "Ign Cut (Boost)", white, black, red, black
indicator = { sync }, "No Sync", "Sync", white, black, green, black
indicator = { sync }, "No Sync", "Full Sync", white, black, green, black
indicator = { halfSync }, "No or Full Sync", "Half Sync", white, black, yellow, black
indicator = { resetLockOn }, "Reset Lock OFF","Reset Lock ON", red, black, green, black
indicator = { bootloaderCaps > 0 }, "Std. Boot", "Custom Boot", white, black, white, black
indicator = { nitrousOn }, "Nitrous Off", "Nitrous On", white, black, red, black
@ -4078,7 +4079,7 @@ cmdVSSratio6 = "E\x99\x06"
nitrousOn = bits, U08, 83, [1:1]
fuel2Active = bits, U08, 83, [2:2]
vssRefresh = bits, U08, 83, [3:3]
unused81_4 = bits, U08, 83, [4:4]
halfSync = bits, U08, 83, [4:4]
nSquirts = bits, U08, 83, [5:7]
engineProtectStatus = scalar, U08, 84, "bits", 1.000, 0.000
engineProtectRPM = bits, U08, 84, [0:0]

View File

@ -389,6 +389,7 @@ void triggerPri_missingTooth()
{
//This occurs when we're at tooth #1, but haven't seen all the other teeth. This indicates a signal issue so we flag lost sync so this will attempt to resync on the next revolution.
currentStatus.hasSync = false;
BIT_CLEAR(currentStatus.status3, BIT_STATUS3_HALFSYNC); //No sync at all, so also clear HalfSync bit.
currentStatus.syncLossCounter++;
}
//This is to handle a special case on startup where sync can be obtained and the system immediately thinks the revs have jumped:
@ -414,10 +415,12 @@ void triggerPri_missingTooth()
if( (secondaryToothCount > 0) || (configPage4.TrigSpeed == CAM_SPEED) )
{
currentStatus.hasSync = true;
BIT_CLEAR(currentStatus.status3, BIT_STATUS3_HALFSYNC); //the engine is fully synced so clear the Half Sync bit
if(configPage4.trigPatternSec == SEC_TRIGGER_SINGLE) { secondaryToothCount = 0; } //Reset the secondary tooth counter to prevent it overflowing
}
else if(currentStatus.hasSync != true) { BIT_SET(currentStatus.status3, BIT_STATUS3_HALFSYNC); } //If there is primary trigger but no secondary we only have half sync.
}
else { currentStatus.hasSync = true; } //If nothing is using sequential, we have sync
else { currentStatus.hasSync = true; BIT_CLEAR(currentStatus.status3, BIT_STATUS3_HALFSYNC); } //If nothing is using sequential, we have sync and also clear half sync bit
triggerFilterTime = 0; //This is used to prevent a condition where serious intermitent signals (Eg someone furiously plugging the sensor wire in and out) can leave the filter in an unrecoverable state
toothLastMinusOneToothTime = toothLastToothTime;

View File

@ -169,7 +169,7 @@
#define BIT_STATUS3_NITROUS 1
#define BIT_STATUS3_FUEL2_ACTIVE 2
#define BIT_STATUS3_VSS_REFRESH 3
#define BIT_STATUS3_UNUSED4 4
#define BIT_STATUS3_HALFSYNC 4 //shows if there is only sync from primary trigger, but not from secondary.
#define BIT_STATUS3_NSQUIRTS1 5
#define BIT_STATUS3_NSQUIRTS2 6
#define BIT_STATUS3_NSQUIRTS3 7

View File

@ -325,6 +325,7 @@ void initialiseAll()
//These assignments are based on the Arduino Mega AND VARY BETWEEN BOARDS. Please confirm the board you are using and update acordingly.
currentStatus.RPM = 0;
currentStatus.hasSync = false;
BIT_CLEAR(currentStatus.status3, BIT_STATUS3_HALFSYNC);
currentStatus.runSecs = 0;
currentStatus.secl = 0;
currentStatus.startRevolutions = 0;
@ -1745,7 +1746,7 @@ void setPinMapping(byte boardID)
#endif
break;
case 31:
case 31:
//Pin mappings for the BMW PnP PCBs by pazi88. This is an AVR only module. At least for now
pinInjector1 = 8; //Output pin injector 1
pinInjector2 = 9; //Output pin injector 2

View File

@ -168,6 +168,7 @@ void loop()
toothLastSecToothTime = 0;
//toothLastMinusOneToothTime = 0;
currentStatus.hasSync = false;
BIT_CLEAR(currentStatus.status3, BIT_STATUS3_HALFSYNC);
currentStatus.runSecs = 0; //Reset the counter for number of seconds running.
currentStatus.startRevolutions = 0;
toothSystemCount = 0;