Add settings to select pins for fuel pump and fan

This commit is contained in:
Josh Stewart 2016-12-21 13:21:27 +11:00
parent 0a1a390a98
commit 48712c12fa
3 changed files with 25 additions and 25 deletions

View File

@ -274,6 +274,7 @@ struct config2 {
byte TrigPattern : 4;
byte TrigEdgeSec : 1;
byte fuelPumpPin : 5;
byte unused4_6b : 7;
byte unused4_7;
@ -401,8 +402,8 @@ struct config4 {
byte iacStepHyster; //Hysteresis temperature (*10). Eg 2.2C = 22
byte fanInv : 1; // Fan output inversion bit
byte fanEnable : 2; // Fan enable bit. 0=Off, 1=On/Off, 2=PWM
byte unused : 5;
byte fanEnable : 1; // Fan enable bit. 0=Off, 1=On/Off
byte fanPin : 5;
byte fanSP; // Cooling fan start temperature
byte fanHyster; // Fan hysteresis
byte fanFreq; // Fan PWM frequency

View File

@ -242,19 +242,14 @@ page = 4
FixAng = scalar, U08, 2, "Deg", 1, 0, 0, 80, 0
CrankAng = scalar, U08, 3, "Deg", 1, 0, -10, 80, 0
TrigAngMul = scalar, U08, 4, "", 1, 0, 0, 88, 0 ; Multiplier for tooth counts that don't evenly divide into 360
TrigEdge = bits, U08, 5[0:0], "Leading", "Trailing"
TrigSpeed = bits, U08, 5[1:1], "Crank Speed", "Cam Speed"
IgInv = bits, U08, 5[2:2], "Going Low", "Going High"
oddfire = bits, U08, 5[3:3], "No", "Yes"
TrigPattern= bits, U08, 5[4:7], "Missing Tooth", "Basic Distributor", "Dual Wheel", "GM 7X", "4G63 / Miata", "GM 24X", "Jeep 2000", "Audi 135", "Honda D17", "Miata 99-05", "Mazda AU", "Non-360 Dual", "INVALID", "INVALID", "INVALID", "INVALID"
TrigEdgeSec= bits, U08, 6[0:0], "Leading", "Trailing"
unused4-6b = bits, U08, 6[1:1], "No", "Yes"
unused4-6c = bits, U08, 6[2:2], "No", "Yes"
unused4-6d = bits, U08, 6[3:3], "No", "Yes"
unused4-6e = bits, U08, 6[4:4], "No", "Yes"
unused4-6f = bits, U08, 6[5:5], "No", "Yes"
unused4-6g = bits, U08, 6[6:6], "No", "Yes"
unused4-6h = bits, U08, 6[7:7], "No", "Yes"
TrigEdge = bits, U08, 5,[0:0], "Leading", "Trailing"
TrigSpeed = bits, U08, 5,[1:1], "Crank Speed", "Cam Speed"
IgInv = bits, U08, 5,[2:2], "Going Low", "Going High"
oddfire = bits, U08, 5,[3:3], "No", "Yes"
TrigPattern= bits, U08, 5,[4:7], "Missing Tooth", "Basic Distributor", "Dual Wheel", "GM 7X", "4G63 / Miata", "GM 24X", "Jeep 2000", "Audi 135", "Honda D17", "Miata 99-05", "Mazda AU", "Non-360 Dual", "INVALID", "INVALID", "INVALID", "INVALID"
TrigEdgeSec= bits, U08, 6,[0:0], "Leading", "Trailing"
fuelPumpPin= bits , U08, 6,[1:6], "Board Default", "1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19", "20", "21", "22", "23", "24", "25", "26", "27", "28", "29", "30", "31", "32", "33", "34", "35", "36", "37", "38", "39", "40", "41", "42", "43", "44", "45", "46", "47", "48", "49", "50", "51", "52", "53", "54", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID"
unused4-6h = bits, U08, 6,[7:7], "No", "Yes"
unused4-7 = scalar, U08, 7, "ADC", 1, 0, 0, 255, 0
IdleAdvRPM = scalar, U08, 8, "RPM", 100, 0, 0, 1200, 0
#if CELSIUS
@ -442,12 +437,8 @@ page = 7
; Begin fan control vairables
fanInv = bits, U08, 56, [0:0], "No", "Yes"
fanEnable = bits, U08, 56, [1:2], "Off", "On/Off", "INVALID", "INVALID"
unused7-55b = bits, U08, 56, [3:3], "No", "Yes"
unused7-55c = bits, U08, 56, [4:4], "No", "Yes"
unused7-55d = bits, U08, 56, [5:5], "No", "Yes"
unused7-55e = bits, U08, 56, [6:6], "No", "Yes"
unused7-55f = bits, U08, 56, [7:7], "No", "Yes"
fanEnable = bits, U08, 56, [1:1], "Off", "On/Off"
fanPin = bits , U08, 56, [2:7], "Board Default", "1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19", "20", "21", "22", "23", "24", "25", "26", "27", "28", "29", "30", "31", "32", "33", "34", "35", "36", "37", "38", "39", "40", "41", "42", "43", "44", "45", "46", "47", "48", "49", "50", "51", "52", "53", "54", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID"
#if CELSIUS
fanSP = scalar, U08, 57, "C", 1.0, -40, -40, 215.0, 0
fanHyster = scalar, U08, 58, "C", 1.0, -40, -40, 215.0, 0
@ -570,6 +561,8 @@ page = 9
defaultValue = flexFuelHigh, 163
defaultValue = flexAdvLow, 0
defaultValue = flexAdvHigh, 13
defaultValue = fuelPumpPin, 0
defaultValue = fanPin, 0
[Menu]
@ -646,6 +639,7 @@ menuDialog = main
menu = "&Accessories"
subMenu = fanSettings, "Thermo Fan"
subMenu = LaunchControl, "Launch Control"
subMenu = fuelpump, "Fuel Pump"
subMenu = std_separator
subMenu = boostSettings, "Boost Control"
subMenu = boostTbl, "Boost target", 8, { boostEnabled }
@ -913,10 +907,11 @@ menuDialog = main
field = "PID Derivative", egoKD, { egoType && (egoAlgorithm == 2) }
dialog = fanSettings,"Fan Settings",7
field = "Fan Mode", fanEnable
field = "Fan Output Inverted", fanInv
field = "Fan temperature SP", fanSP
field = "Fan hysteresis", fanHyster
field = "Fan Mode", fanEnable
field = "Fan output pin", fanPin, { fanEnable }
field = "Fan Output Inverted", fanInv , { fanEnable }
field = "Fan temperature SP", fanSP, { fanEnable }
field = "Fan hysteresis", fanHyster, { fanEnable }
dialog = stepper_idle, "Stepper Idle"
field = "Step time (ms)", iacStepTime, { iacAlgorithm == 4 || iacAlgorithm == 5 }
@ -942,6 +937,8 @@ menuDialog = main
panel = stepper_idle
panel = closedloop_idle
dialog = fuelpump, "Fuel pump"
field = "Fuel pump pin", fuelPumpPin
dialog = crankPW, "Cranking Pulsewidths (ms)"
field = "Cranking RPM (Max)", crankRPM

View File

@ -329,6 +329,8 @@ void setPinMapping(byte boardID)
if(configPage3.launchPin != 0) { pinLaunch = configPage3.launchPin; }
if(configPage2.ignBypassPin != 0) { pinIgnBypass = configPage2.ignBypassPin; }
if(configPage1.tachoPin != 0) { pinTachOut = configPage1.tachoPin; }
if(configPage2.fuelPumpPin != 0) { pinFuelPump = configPage2.fuelPumpPin; }
if(configPage4.fanPin != 0) { pinFan = configPage4.fanPin; }
//Finally, set the relevant pin modes for outputs
pinMode(pinCoil1, OUTPUT);