Logic change from some of the MISRA work
This commit is contained in:
parent
4ba2fbf52c
commit
780c9ab2ee
|
@ -1137,10 +1137,10 @@ void commandButtons()
|
|||
BIT_SET(currentStatus.testOutputs, 1);
|
||||
break;
|
||||
case 513: // cmd group is for injector1 on actions
|
||||
if( BIT_CHECK(currentStatus.testOutputs, 1) == 1 ){ digitalWrite(pinInjector1, HIGH); }
|
||||
if( BIT_CHECK(currentStatus.testOutputs, 1) ){ digitalWrite(pinInjector1, HIGH); }
|
||||
break;
|
||||
case 514: // cmd group is for injector1 off actions
|
||||
if( BIT_CHECK(currentStatus.testOutputs, 1) == 1 ){digitalWrite(pinInjector1, LOW);}
|
||||
if( BIT_CHECK(currentStatus.testOutputs, 1) ){digitalWrite(pinInjector1, LOW);}
|
||||
break;
|
||||
case 515: // cmd group is for injector1 50% dc actions
|
||||
//for (byte dcloop = 0; dcloop < 11; dcloop++)
|
||||
|
@ -1152,64 +1152,64 @@ void commandButtons()
|
|||
//}
|
||||
break;
|
||||
case 516: // cmd group is for injector2 on actions
|
||||
if( BIT_CHECK(currentStatus.testOutputs, 1) == 1){ digitalWrite(pinInjector2, HIGH); }
|
||||
if( BIT_CHECK(currentStatus.testOutputs, 1) ){ digitalWrite(pinInjector2, HIGH); }
|
||||
break;
|
||||
case 517: // cmd group is for injector2 off actions
|
||||
if( BIT_CHECK(currentStatus.testOutputs, 1) == 1 ){ digitalWrite(pinInjector2, LOW); }
|
||||
if( BIT_CHECK(currentStatus.testOutputs, 1) ){ digitalWrite(pinInjector2, LOW); }
|
||||
break;
|
||||
case 518: // cmd group is for injector2 50%dc actions
|
||||
|
||||
break;
|
||||
case 519: // cmd group is for injector3 on actions
|
||||
if( BIT_CHECK(currentStatus.testOutputs, 1) == 1 ) { digitalWrite(pinInjector3, HIGH); }
|
||||
if( BIT_CHECK(currentStatus.testOutputs, 1) ) { digitalWrite(pinInjector3, HIGH); }
|
||||
break;
|
||||
case 520: // cmd group is for injector3 off actions
|
||||
if( BIT_CHECK(currentStatus.testOutputs, 1) == 1 ) { digitalWrite(pinInjector3, LOW); }
|
||||
if( BIT_CHECK(currentStatus.testOutputs, 1) ) { digitalWrite(pinInjector3, LOW); }
|
||||
break;
|
||||
case 521: // cmd group is for injector3 50%dc actions
|
||||
|
||||
break;
|
||||
case 522: // cmd group is for injector4 on actions
|
||||
if( BIT_CHECK(currentStatus.testOutputs, 1) == 1 ){ digitalWrite(pinInjector4, HIGH); }
|
||||
if( BIT_CHECK(currentStatus.testOutputs, 1) ){ digitalWrite(pinInjector4, HIGH); }
|
||||
break;
|
||||
case 523: // cmd group is for injector4 off actions
|
||||
if( BIT_CHECK(currentStatus.testOutputs, 1) == 1 ){ digitalWrite(pinInjector4, LOW); }
|
||||
if( BIT_CHECK(currentStatus.testOutputs, 1) ){ digitalWrite(pinInjector4, LOW); }
|
||||
break;
|
||||
case 524: // cmd group is for injector4 50% dc actions
|
||||
|
||||
break;
|
||||
case 769: // cmd group is for spark1 on actions
|
||||
if( BIT_CHECK(currentStatus.testOutputs, 1) == 1 ) { digitalWrite(pinCoil1, HIGH); }
|
||||
if( BIT_CHECK(currentStatus.testOutputs, 1) ) { digitalWrite(pinCoil1, HIGH); }
|
||||
break;
|
||||
case 770: // cmd group is for spark1 off actions
|
||||
if( BIT_CHECK(currentStatus.testOutputs, 1) == 1 ) { digitalWrite(pinCoil1, LOW); }
|
||||
if( BIT_CHECK(currentStatus.testOutputs, 1) ) { digitalWrite(pinCoil1, LOW); }
|
||||
break;
|
||||
case 771: // cmd group is for spark1 50%dc actions
|
||||
|
||||
break;
|
||||
case 772: // cmd group is for spark2 on actions
|
||||
if( BIT_CHECK(currentStatus.testOutputs, 1) == 1 ) { digitalWrite(pinCoil2, HIGH); }
|
||||
if( BIT_CHECK(currentStatus.testOutputs, 1) ) { digitalWrite(pinCoil2, HIGH); }
|
||||
break;
|
||||
case 773: // cmd group is for spark2 off actions
|
||||
if( BIT_CHECK(currentStatus.testOutputs, 1) == 1 ) { digitalWrite(pinCoil2, LOW); }
|
||||
if( BIT_CHECK(currentStatus.testOutputs, 1) ) { digitalWrite(pinCoil2, LOW); }
|
||||
break;
|
||||
case 774: // cmd group is for spark2 50%dc actions
|
||||
|
||||
break;
|
||||
case 775: // cmd group is for spark3 on actions
|
||||
if( BIT_CHECK(currentStatus.testOutputs, 1) == 1 ) { digitalWrite(pinCoil3, HIGH); }
|
||||
if( BIT_CHECK(currentStatus.testOutputs, 1) ) { digitalWrite(pinCoil3, HIGH); }
|
||||
break;
|
||||
case 776: // cmd group is for spark3 off actions
|
||||
if( BIT_CHECK(currentStatus.testOutputs, 1) == 1 ) { digitalWrite(pinCoil3, LOW); }
|
||||
if( BIT_CHECK(currentStatus.testOutputs, 1) ) { digitalWrite(pinCoil3, LOW); }
|
||||
break;
|
||||
case 777: // cmd group is for spark3 50%dc actions
|
||||
|
||||
break;
|
||||
case 778: // cmd group is for spark4 on actions
|
||||
if( BIT_CHECK(currentStatus.testOutputs, 1) == 1 ) { digitalWrite(pinCoil4, HIGH); }
|
||||
if( BIT_CHECK(currentStatus.testOutputs, 1) ) { digitalWrite(pinCoil4, HIGH); }
|
||||
break;
|
||||
case 779: // cmd group is for spark4 off actions
|
||||
if( BIT_CHECK(currentStatus.testOutputs, 1) == 1 ) { digitalWrite(pinCoil4, LOW); }
|
||||
if( BIT_CHECK(currentStatus.testOutputs, 1) ) { digitalWrite(pinCoil4, LOW); }
|
||||
break;
|
||||
case 780: // cmd group is for spark4 50%dc actions
|
||||
|
||||
|
|
|
@ -112,7 +112,7 @@ Additional fuel % to be added when the engine is cranking
|
|||
static inline byte correctionCranking()
|
||||
{
|
||||
byte crankingValue = 100;
|
||||
if ( BIT_CHECK(currentStatus.engine, BIT_ENGINE_CRANK) == 1 ) { crankingValue = 100 + configPage1.crankingPct; }
|
||||
if ( BIT_CHECK(currentStatus.engine, BIT_ENGINE_CRANK) ) { crankingValue = 100 + configPage1.crankingPct; }
|
||||
return crankingValue;
|
||||
}
|
||||
|
||||
|
@ -149,7 +149,7 @@ static inline byte correctionAccel()
|
|||
{
|
||||
byte accelValue = 100;
|
||||
//First, check whether the accel. enrichment is already running
|
||||
if( BIT_CHECK(currentStatus.engine, BIT_ENGINE_ACC) == 1 )
|
||||
if( BIT_CHECK(currentStatus.engine, BIT_ENGINE_ACC) )
|
||||
{
|
||||
//If it is currently running, check whether it should still be running or whether it's reached it's end time
|
||||
if( currentLoopTime >= currentStatus.TAEEndTime )
|
||||
|
@ -198,7 +198,7 @@ This function always returns either 100 or 0
|
|||
static inline byte correctionFloodClear()
|
||||
{
|
||||
byte floodValue = 100;
|
||||
if( BIT_CHECK(currentStatus.engine, BIT_ENGINE_CRANK) == 1)
|
||||
if( BIT_CHECK(currentStatus.engine, BIT_ENGINE_CRANK) )
|
||||
{
|
||||
//Engine is currently cranking, check what the TPS is
|
||||
if(currentStatus.TPS >= configPage2.floodClear)
|
||||
|
@ -385,7 +385,7 @@ static inline int8_t correctionFixedTiming(int8_t advance)
|
|||
static inline int8_t correctionCrankingFixedTiming(int8_t advance)
|
||||
{
|
||||
byte ignCrankFixValue = advance;
|
||||
if ( BIT_CHECK(currentStatus.engine, BIT_ENGINE_CRANK) == 1 ) { ignCrankFixValue = configPage2.CrankAng; } //Use the fixed cranking ignition angle
|
||||
if ( BIT_CHECK(currentStatus.engine, BIT_ENGINE_CRANK) ) { ignCrankFixValue = configPage2.CrankAng; } //Use the fixed cranking ignition angle
|
||||
return ignCrankFixValue;
|
||||
}
|
||||
|
||||
|
|
|
@ -23,7 +23,7 @@
|
|||
//Handy bitsetting macros
|
||||
#define BIT_SET(a,b) ((a) |= (1<<(b)))
|
||||
#define BIT_CLEAR(a,b) ((a) &= ~(1<<(b)))
|
||||
#define BIT_CHECK(var,pos) ((var) & (1<<(pos)))
|
||||
#define BIT_CHECK(var,pos) !!((var) & (1<<(pos)))
|
||||
|
||||
#define MS_IN_MINUTE 60000
|
||||
#define US_IN_MINUTE 60000000
|
||||
|
|
Loading…
Reference in New Issue