Merge pull request #137 from Autohome2/teesyrevab

Teensy rev ab
This commit is contained in:
Josh Stewart 2018-04-12 09:23:40 +10:00 committed by GitHub
commit 4c68c15ce5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 107 additions and 4 deletions

View File

@ -167,7 +167,7 @@ page = 2
aseCount = scalar, U08, 3, "s", 1.0, 0.0, 0.0, 255, 0
wueRates = array, U08, 4, [10], "%", 1.0, 0.0, 0.0, 255, 0
crankingPct = scalar, U08, 14, "%", 1.0, 0.0, 0.0, 255, 0
pinLayout = bits, U08, 15, [0:7], "Speeduino v0.1", "Speeduino v0.2", "Speeduino v0.3", "Speeduino v0.4", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "NA6 MX5 PNP", "Turtana PCB", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "Plazomat I/O 0.1", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "Daz V6 Shield 0.1", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "NO2C", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID"
pinLayout = bits, U08, 15, [0:7], "Speeduino v0.1", "Speeduino v0.2", "Speeduino v0.3", "Speeduino v0.4", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "NA6 MX5 PNP", "Turtana PCB", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "Plazomat I/O 0.1", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "Daz V6 Shield 0.1", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "NO2C", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "dvjcodec Teensy RevA", "dvjcodec Teensy RevB", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID"
tachoPin = bits, U08, 16, [0:5], "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"
tachoDiv = bits, U08, 16, [6:7], "Normal", "Half", "INVALID", "INVALID"
unused2-17 = scalar, U08, 17, "ms", 0.1, 0.0, 0.0, 25.5, 1

View File

@ -40,6 +40,7 @@ uint16_t MAPcurRev; //Tracks which revolution we're sampling on
static inline void instanteneousMAPReading() __attribute__((always_inline));
static inline void readMAP() __attribute__((always_inline));
void readTPS();
void readO2_2();
void flexPulse();

View File

@ -245,11 +245,20 @@ void readO2()
currentStatus.O2 = o2CalibrationTable[currentStatus.O2ADC];
}
void readO2_2()
{
//Second O2 currently disabled as its not being used
//Get the current O2 value.
//currentStatus.O2_2ADC = map(analogRead(pinO2_2), 0, 1023, 0, 511);
//currentStatus.O2_2ADC = ADC_FILTER(tempReading, ADCFILTER_O2, currentStatus.O2_2ADC);
//currentStatus.O2_2 = o2CalibrationTable[currentStatus.O2_2ADC];
unsigned int tempReading;
#if defined(ANALOG_ISR)
tempReading = fastMap1023toX(AnChannel[pinO2_2-A0], 511); //Get the current O2 value.
#else
tempReading = analogRead(pinO2_2);
tempReading = fastMap1023toX(analogRead(pinO2_2), 511); //Get the current O2 value.
#endif
currentStatus.O2_2ADC = ADC_FILTER(tempReading, ADCFILTER_O2, currentStatus.O2_2ADC);
currentStatus.O2_2 = o2CalibrationTable[currentStatus.O2_2ADC];
}
void readBat()
{

View File

@ -873,6 +873,7 @@ void loop()
readCLT();
readIAT();
readO2();
readO2_2();
readBat();
if(eepromWritesPending == true) { writeAllConfig(); } //Check for any outstanding EEPROM writes.

View File

@ -518,6 +518,98 @@ void setPinMapping(byte boardID)
pinSpareLOut3 = 36; //low current output spare3 - ONLY WITH DB
pinResetControl = 26; //Reset control output
break;
#if defined(CORE_TEENSY)
case 50:
//Pin mappings as per the teensy rev A shield
pinInjector1 = 2; //Output pin injector 1 is on
pinInjector2 = 10; //Output pin injector 2 is on
pinInjector3 = 6; //Output pin injector 3 is on - NOT USED
pinInjector4 = 9; //Output pin injector 4 is on - NOT USED
//pinInjector5 = 13; //Placeholder only - NOT USED
pinCoil1 = 29; //Pin for coil 1
pinCoil2 = 30; //Pin for coil 2
pinCoil3 = 31; //Pin for coil 3 - ONLY WITH DB2
pinCoil4 = 32; //Pin for coil 4 - ONLY WITH DB2
//pinCoil5 = 46; //Placeholder only - NOT USED
pinTrigger = 23; //The CAS pin
pinTrigger2 = 36; //The Cam Sensor pin
pinTPS = 16; //TPS input pin
pinMAP = 17; //MAP sensor pin
pinIAT = 14; //IAT sensor pin
pinCLT = 15; //CLT sensor pin
pinO2 = A22; //O2 sensor pin
pinO2_2 = A21; //O2 sensor pin (second sensor)
pinBat = 18; //Battery reference voltage pin
//pinBaro = A6; //Baro sensor pin - ONLY WITH DB
//pinSpareTemp1 = A7; //spare Analog input 1 - ONLY WITH DB
//pinDisplayReset = 48; // OLED reset pin - NOT USED
pinTachOut = 20; //Tacho output pin
pinIdle1 = 5; //Single wire idle control
//pinIdle2 = 47; //2 wire idle control - NOT USED
pinBoost = 11; //Boost control
//pinVVT_1 = 6; //Default VVT output
pinFuelPump = 38; //Fuel pump output
pinStepperDir = 34; //Direction pin for DRV8825 driver
pinStepperStep = 35; //Step pin for DRV8825 driver
pinStepperEnable = 33; //Enable pin for DRV8825 driver
pinLaunch = 26; //Can be overwritten below
//pinFlex = 20; // Flex sensor (Must be external interrupt enabled) - ONLY WITH DB
pinFan = 37; //Pin for the fan output - ONLY WITH DB
//pinSpareLOut1 = 32; //low current output spare1 - ONLY WITH DB
//pinSpareLOut2 = 34; //low current output spare2 - ONLY WITH DB
//pinSpareLOut3 = 36; //low current output spare3 - ONLY WITH DB
//pinResetControl = 26; //Reset control output
pinSpareHOut1 = 8; // high current output spare1
pinSpareHOut2 = 7; // high current output spare2
pinSpareLOut1 = 21; //low current output spare1
break;
case 51:
//Pin mappings as per the teensy revB board shield
pinInjector1 = 2; //Output pin injector 1 is on
pinInjector2 = 10; //Output pin injector 2 is on
pinInjector3 = 6; //Output pin injector 3 is on - NOT USED
pinInjector4 = 9; //Output pin injector 4 is on - NOT USED
//pinInjector5 = 13; //Placeholder only - NOT USED
pinCoil1 = 29; //Pin for coil 1
pinCoil2 = 30; //Pin for coil 2
pinCoil3 = 31; //Pin for coil 3 - ONLY WITH DB2
pinCoil4 = 32; //Pin for coil 4 - ONLY WITH DB2
//pinCoil5 = 46; //Placeholder only - NOT USED
pinTrigger = 23; //The CAS pin
pinTrigger2 = 36; //The Cam Sensor pin
pinTPS = 16; //TPS input pin
pinMAP = 17; //MAP sensor pin
pinIAT = 14; //IAT sensor pin
pinCLT = 15; //CLT sensor pin
pinO2 = A22; //O2 sensor pin
pinO2_2 = A21; //O2 sensor pin (second sensor)
pinBat = 18; //Battery reference voltage pin
//pinBaro = A6; //Baro sensor pin - ONLY WITH DB
//pinSpareTemp1 = A7; //spare Analog input 1 - ONLY WITH DB
//pinDisplayReset = 48; // OLED reset pin - NOT USED
pinTachOut = 20; //Tacho output pin
pinIdle1 = 5; //Single wire idle control
//pinIdle2 = 47; //2 wire idle control - NOT USED
pinBoost = 11; //Boost control
//pinVVT_1 = 6; //Default VVT output
pinFuelPump = 38; //Fuel pump output
pinStepperDir = 34; //Direction pin for DRV8825 driver
pinStepperStep = 35; //Step pin for DRV8825 driver
pinStepperEnable = 33; //Enable pin for DRV8825 driver
pinLaunch = 26; //Can be overwritten below
//pinFlex = 20; // Flex sensor (Must be external interrupt enabled) - ONLY WITH DB
pinFan = 37; //Pin for the fan output - ONLY WITH DB
//pinSpareLOut1 = 32; //low current output spare1 - ONLY WITH DB
//pinSpareLOut2 = 34; //low current output spare2 - ONLY WITH DB
//pinSpareLOut3 = 36; //low current output spare3 - ONLY WITH DB
//pinResetControl = 26; //Reset control output
pinSpareHOut1 = 8; // high current output spare1
pinSpareHOut2 = 7; // high current output spare2
pinSpareLOut1 = 21; //low current output spare1
break;
#endif
default:
#ifndef SMALL_FLASH_MODE //No support for bluepill here anyway