Some teensy fixes

This commit is contained in:
Josh Stewart 2017-04-15 08:42:33 +10:00
parent ac37fafc84
commit e399eb1df6
2 changed files with 33 additions and 13 deletions

View File

@ -236,7 +236,7 @@ struct config1 {
byte unused1; //Cold cranking pulsewidth modifier. This is added to the fuel pulsewidth when cranking under a certain temp threshold (ms)
byte unused2; //Warm cranking pulsewidth modifier. This is added to the fuel pulsewidth when cranking (ms)
byte asePct; //Afterstart enrichment (%)
byte asePct; //Afterstart enrichment (%)
byte aseCount; //Afterstart enrichment cycles. This is the number of ignition cycles that the afterstart enrichment % lasts for
byte wueValues[10]; //Warm up enrichment array (10 bytes)
byte crankingPct; //Cranking enrichment
@ -249,18 +249,18 @@ struct config1 {
byte taeTime;
//Display config bits
byte displayType : 3;
byte displayType : 3; //21
byte display1 : 3;
byte display2 : 2;
byte display3 : 3;
byte display3 : 3; //22
byte display4 : 2;
byte display5 : 3;
byte displayB1 : 4;
byte displayB1 : 4; //23
byte displayB2 : 4;
byte reqFuel;
byte reqFuel; //24
byte divider;
byte injTiming : 1;
byte multiplyMAP : 1;
@ -318,8 +318,11 @@ struct config1 {
byte iacCLmaxDuty;
byte boostMinDuty;
};
#if defined(CORE_AVR)
};
#else
} __attribute__((__packed__)); //The 32 bi systems require all structs to be fully packed
#endif
//Page 2 of the config - See the ini file for further reference
//This mostly covers off variables that are required for ignition
@ -378,8 +381,11 @@ struct config2 {
byte ignBypassPin : 6; //Pin the ignition bypass is activated on
byte ignBypassHiLo : 1; //Whether this should be active high or low.
};
#if defined(CORE_AVR)
};
#else
} __attribute__((__packed__)); //The 32 bi systems require all structs to be fully packed
#endif
//Page 3 of the config - See the ini file for further reference
//This mostly covers off variables that are required for AFR targets and closed loop
@ -442,8 +448,11 @@ struct config3 {
byte flatSRetard;
byte flatSArm;
};
#if defined(CORE_AVR)
};
#else
} __attribute__((__packed__)); //The 32 bit systems require all structs to be fully packed
#endif
//Page 4 of the config mostly deals with idle control
@ -474,7 +483,11 @@ struct config4 {
byte fanHyster; // Fan hysteresis
byte fanFreq; // Fan PWM frequency
byte fanPWMBins[4]; //Temperature Bins for the PWM fan control
};
#if defined(CORE_AVR)
};
#else
} __attribute__((__packed__)); //The 32 bit systems require all structs to be fully packed
#endif
//Page 10 of the config mostly deals with CANBUS control
//See ini file for further info (Config Page 10 in the ini)
@ -607,7 +620,11 @@ struct config10 {
byte unused10_125;
byte unused10_126;
byte unused10_127;
};
#if defined(CORE_AVR)
};
#else
} __attribute__((__packed__)); //The 32 bit systems require all structs to be fully packed
#endif
byte pinInjector1; //Output pin injector 1

View File

@ -24,6 +24,8 @@ void initialiseIdle()
#elif defined (CORE_TEENSY)
if(configPage4.iacAlgorithm == IAC_ALGORITHM_PWM_OL || configPage4.iacAlgorithm == IAC_ALGORITHM_PWM_CL)
{
//FlexTimer 2 is used for idle
FTM2_MODE |= FTM_MODE_WPDIS; // Write Protection Disable
FTM2_MODE |= FTM_MODE_FTMEN; //Flex Timer module enable
@ -74,6 +76,7 @@ void initialiseIdle()
// enable IRQ Interrupt
NVIC_ENABLE_IRQ(IRQ_FTM2);
}
#elif defined(MCU_STM32F103RB)