Merge branch 'master' of https://github.com/noisymime/speeduino into resetcontrol-inifix

This commit is contained in:
Murray 2018-02-15 19:37:43 -06:00
commit ed372efe0f
6 changed files with 15 additions and 19 deletions

View File

@ -4,7 +4,7 @@ fi
for i in speeduino/speeduino/*.ino; do
#cppcheck --xml --include=${i%.*}.h --include=speeduino/speeduino/globals.h $i > /dev/null
cppcheck --dump --suppress=syntaxError:speeduino/speeduino/src/PID_v1/PID_v1.h --include=${i%.*}.h --include=speeduino/speeduino/globals.h $i > /dev/null
cppcheck --force --dump --suppress=syntaxError:speeduino/speeduino/src/PID_v1/PID_v1.h --include=${i%.*}.h --include=speeduino/speeduino/globals.h $i > /dev/null
done
mv speeduino/speeduino/*.dump ./
rm ./utils.*.dump

View File

@ -546,7 +546,7 @@
<constant digits="0" name="vvtFreq" units="Hz">300.0</constant>
<constant digits="0" name="idleFreq" units="Hz">160.0</constant>
<constant name="launchPin">"Board Default"</constant>
<constant name="launchEnable">"Yes"</constant>
<constant name="launchEnable">"No"</constant>
<constant name="launchHiLo">"LOW"</constant>
<constant digits="0" name="lnchSoftLim" units="rpm">2500.0</constant>
<constant digits="0" name="lnchRetard" units="deg">-15.0</constant>
@ -628,9 +628,9 @@
</constant>
<constant cols="1" digits="0" name="iacCrankBins" rows="4" units="C">
-40.0
-40.0
-40.0
-40.0
0.0
40.0
80.0
</constant>
<constant name="iacAlgorithm">"None"</constant>
<constant name="iacStepTime">"1"</constant>
@ -647,9 +647,9 @@
<constant digits="0" name="fanFreq" units="Hz">0.0</constant>
<constant cols="1" digits="0" name="fanPWMBins" rows="4" units="C">
-40.0
-40.0
-40.0
-40.0
0.0
40.0
80.0
</constant>
</page>
<page number="6" size="240">

View File

@ -376,8 +376,6 @@ void triggerSec_DualWheel()
if(currentStatus.hasSync == false)
{
toothLastToothTime = micros();
//CONFIRM THE BELOW! IT DOESN'T LOOK RIGHT (toothOneTime??)
//toothLastMinusOneToothTime = (toothOneTime - 6000000) / configPage4.triggerTeeth; //Fixes RPM at 10rpm until a full revolution has taken place
toothLastMinusOneToothTime = micros() - (6000000 / configPage4.triggerTeeth); //Fixes RPM at 10rpm until a full revolution has taken place
toothCurrentCount = configPage4.triggerTeeth;
@ -1027,7 +1025,6 @@ void triggerSetup_24X()
MAX_STALL_TIME = (3333UL * triggerToothAngle); //Minimum 50rpm. (3333uS is the time per degree at 50rpm)
if(initialisationComplete == false) { toothCurrentCount = 25; toothLastToothTime = micros(); } //Set a startup value here to avoid filter errors when starting. This MUST have the initi check to prevent the fuel pump just staying on all the time
//We set the initial tooth value to be something that should never be reached. This indicates no sync
secondDerivEnabled = false;
decoderIsSequential = true;
}
@ -1087,7 +1084,7 @@ int getCrankAngle_24X(int timePerDegree)
interrupts();
int crankAngle;
if (toothCurrentCount == 0) { crankAngle = 0 + configPage4.triggerAngle; } //This is the special case to handle when the 'last tooth' seen was the cam tooth. 0 is the angle at which the crank tooth goes high (Within 360 degrees).
if (tempToothCurrentCount == 0) { crankAngle = 0 + configPage4.triggerAngle; } //This is the special case to handle when the 'last tooth' seen was the cam tooth. 0 is the angle at which the crank tooth goes high (Within 360 degrees).
else { crankAngle = toothAngles[(tempToothCurrentCount - 1)] + configPage4.triggerAngle;} //Perform a lookup of the fixed toothAngles array to find what the angle of the last tooth passed was.
//Estimate the number of degrees travelled since the last tooth}
@ -1096,7 +1093,7 @@ int getCrankAngle_24X(int timePerDegree)
else { crankAngle += ldiv(elapsedTime, timePerDegree).quot; }
//Sequential check (simply sets whether we're on the first or 2nd revoltuion of the cycle)
if (tempRevolutionOne) { crankAngle += 360; }
if (tempRevolutionOne == 1) { crankAngle += 360; }
if (crankAngle >= 720) { crankAngle -= 720; }
if (crankAngle > CRANK_ANGLE_MAX) { crankAngle -= CRANK_ANGLE_MAX; }
@ -1134,7 +1131,7 @@ void triggerSetup_Jeep2000()
toothAngles[11] = 474;
MAX_STALL_TIME = (3333UL * 60); //Minimum 50rpm. (3333uS is the time per degree at 50rpm). Largest gap between teeth is 60 degrees.
toothCurrentCount = 13; //We set the initial tooth value to be something that should never be reached. This indicates no sync
if(initialisationComplete == false) { toothCurrentCount = 13; toothLastToothTime = micros(); } //Set a startup value here to avoid filter errors when starting. This MUST have the initi check to prevent the fuel pump just staying on all the time
secondDerivEnabled = false;
decoderIsSequential = false;
}

View File

@ -20,7 +20,6 @@
#define word(h, l) ((h << 8) | l) //word() function not defined for this platform in the main library
#if defined (STM32F1) || defined(__STM32F1__)
#define BOARD_DIGITAL_GPIO_PINS 34
#undef BOARD_NR_GPIO_PINS //This is declared as 49 in .../framework-arduinoststm32/STM32F1/variants/generic_stm32f103r8/board/board.h
#define BOARD_NR_GPIO_PINS 34
#define LED_BUILTIN 33
#elif defined(ARDUINO_BLACK_F407VE) || defined(STM32F4)
@ -41,8 +40,6 @@
#define portInputRegister(port) (volatile byte *)( &(port->IDR) )
#else //libmaple core aka STM32DUINO
//These are defined in STM32F1/variants/generic_stm32f103c/variant.h but return a non byte* value
#undef portOutputRegister
#undef portInputRegister
#define portOutputRegister(port) (volatile byte *)( &(port->regs->ODR) )
#define portInputRegister(port) (volatile byte *)( &(port->regs->IDR) )
#endif

View File

@ -64,7 +64,7 @@ int table2D_getValue(struct table2D *fromTable, int X_in)
int xMax = 0;
//Check whether the X input is the same as last time this ran
if(X_in == fromTable->lastInput && fromTable->cacheTime == currentStatus.secl)
if( (X_in == fromTable->lastInput) && (fromTable->cacheTime == currentStatus.secl) )
{
returnValue = fromTable->lastOutput;
valueFound = true;

View File

@ -102,7 +102,9 @@ void doUpdates()
for (uint8_t x = 1; x < 6; x++)
{
uint8_t pct = x * 20;
configPage10.flexBoostBins[x] = configPage10.flexFuelBins[x] = configPage10.flexAdvBins[x] = pct;
configPage10.flexBoostBins[x] = pct;
configPage10.flexFuelBins[x] = pct;
configPage10.flexAdvBins[x] = pct;
int16_t boostAdder = (((configPage2.unused2_2 - (int8_t)configPage2.unused2_1) * pct) / 100) + (int8_t)configPage2.unused2_1;
configPage10.flexBoostAdj[x] = boostAdder;