Bug fix and small improvement for local aux input channels (#398)

* Add config error indicator

* Fixes and naming change

* Fixes

* Change to fix conflicting error bit flag in init

* Updating IO flag setting

Co-authored-by: Pasi Kemppainen <pazi88@users.noreply.github.com>
Co-authored-by: Josh Stewart <josh@noisymime.org>
This commit is contained in:
Pasi Kemppainen 2020-08-18 07:51:32 +03:00 committed by GitHub
parent 8e9b680be6
commit c2558fa4a1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 8 additions and 4 deletions

View File

@ -4433,6 +4433,7 @@ cmdVSSratio6 = "E\x99\x06"
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
indicator = { IOError }, "I/O Ok", "I/O Error!", white, black, red, black
;Engine Protection status indicators
indicator = { engineProtectStatus}, "Engine Protect OFF", "Engine Protect ON", white, black, red, black
indicator = { engineProtectRPM }, "Rev Limiter Off", "Rev Limiter ON", white, black, red, black
@ -4557,7 +4558,8 @@ cmdVSSratio6 = "E\x99\x06"
engineProtectMAP = bits, U08, 84, [1:1]
engineProtectOil = bits, U08, 84, [2:2]
engineProtectAFR = bits, U08, 84, [3:3]
engineProtectOth = bits, U08, 84, [4:7] ; Unused for now
engineProtectOth = bits, U08, 84, [4:6] ; Unused for now
IOError = bits, U08, 84, [7:7]
unused1 = scalar, U08, 84, "ADC",1.000, 0.000
fuelLoad = scalar, S16, 85, { bitStringValue( algorithmUnits , algorithm ) }, 1.000, 0.000
ignLoad = scalar, S16, 87, { bitStringValue( algorithmUnits , ignAlgorithm ) }, 1.000, 0.000

View File

@ -241,6 +241,7 @@
#define PROTECT_CUT_IGN 1
#define PROTECT_CUT_FUEL 2
#define PROTECT_CUT_BOTH 3
#define PROTECT_IO_ERROR 7
#define AE_MODE_TPS 0
#define AE_MODE_MAP 1
@ -495,8 +496,8 @@ extern volatile byte LOOP_TIMER;
#define pinIsInjector(pin) ( ((pin) == pinInjector1) || ((pin) == pinInjector2) || ((pin) == pinInjector3) || ((pin) == pinInjector4) || ((pin) == pinInjector5) || ((pin) == pinInjector6) || ((pin) == pinInjector7) || ((pin) == pinInjector8) )
#define pinIsIgnition(pin) ( ((pin) == pinCoil1) || ((pin) == pinCoil2) || ((pin) == pinCoil3) || ((pin) == pinCoil4) || ((pin) == pinCoil5) || ((pin) == pinCoil6) || ((pin) == pinCoil7) || ((pin) == pinCoil8) )
#define pinIsSensor(pin) ( ((pin) == pinCLT) || ((pin) == pinIAT) || ((pin) == pinMAP) || ((pin) == pinTPS) || ((pin) == pinO2) || ((pin) == pinBat) )
#define pinIsUsed(pin) ( pinIsInjector((pin)) || pinIsIgnition((pin)) || pinIsSensor((pin)) )
#define pinIsOutput(pin) ( ((pin) == pinFuelPump) || ((pin) == pinFan) || ((pin) == pinVVT_1) || ((pin) == pinVVT_2) || ((pin) == pinBoost) || ((pin) == pinIdle1) || ((pin) == pinIdle2) || ((pin) == pinTachOut) )
#define pinIsUsed(pin) ( pinIsInjector((pin)) || pinIsIgnition((pin)) || pinIsSensor((pin)) || pinIsOutput((pin)) )
//The status struct contains the current values for all 'live' variables
//In current version this is 64 bytes

View File

@ -265,6 +265,7 @@ void initialiseAll()
initialiseFan();
initialiseAuxPWM();
initialiseCorrections();
BIT_CLEAR(currentStatus.engineProtectStatus, PROTECT_IO_ERROR); //Clear the I/O error bit. The bit will be set in initialiseADC() if there is problem in there.
initialiseADC();
initialiseProgrammableIO();

View File

@ -76,7 +76,7 @@ void initialiseADC()
if( pinIsUsed(pinNumber) )
{
//Do nothing here as the pin is already in use.
//Need some method of reporting this back to the user
BIT_SET(currentStatus.engineProtectStatus, PROTECT_IO_ERROR); //Tell user that there is problem by lighting up the I/O error indicator
}
else
{
@ -94,7 +94,7 @@ void initialiseADC()
if( pinIsUsed(pinNumber) )
{
//Do nothing here as the pin is already in use.
//Need some method of reporting this back to the user
BIT_SET(currentStatus.engineProtectStatus, PROTECT_IO_ERROR); //Tell user that there is problem by lighting up the I/O error indicator
}
else
{