auto-sync

This commit is contained in:
rusEfi 2015-01-27 17:04:01 -06:00
parent 6cd39875c9
commit 700c291b0b
6 changed files with 23 additions and 7 deletions

View File

@ -29,5 +29,5 @@ void setGy6139qmbDefaultEngineConfiguration(engine_configuration_s *engineConfig
engineConfiguration->trigger.customTotalToothCount = 1;
engineConfiguration->trigger.customSkippedToothCount = 0;
engineConfiguration->trigger.customIsSynchronizationNeeded = false;
//todo engineConfiguration2->triggerShape.needSecondTriggerInput = false;
engineConfiguration->needSecondTriggerInput = false;
}

View File

@ -13,6 +13,20 @@
void setSachs(engine_configuration_s *engineConfiguration) {
engineConfiguration->displacement = 0.1; // 100cc
engineConfiguration->cylindersCount = 1;
engineConfiguration->engineCycle = 360;
engineConfiguration->firingOrder = FO_ONE_CYLINDER;
/**
* We treat the trigger as 1/0 toothed wheel
*/
engineConfiguration->trigger.type = TT_TOOTHED_WHEEL;
engineConfiguration->trigger.customTotalToothCount = 1;
engineConfiguration->trigger.customSkippedToothCount = 0;
engineConfiguration->trigger.customIsSynchronizationNeeded = false;
engineConfiguration->needSecondTriggerInput = false;
engineConfiguration->hasIatSensor = false;
engineConfiguration->hasMapSensor = false;

View File

@ -30,8 +30,6 @@ AdcDevice::AdcDevice(ADCConversionGroup* hwConfig) {
memset(internalAdcIndexByHardwareIndex, 0xFFFFFFFF, sizeof(internalAdcIndexByHardwareIndex));
}
#define ADC_NUMBER_CHANNELS_FAST 1
// todo: migrate from hardware timer to software ADC conversion triggering
// todo: I guess we would have to use ChibiOS timer and not our own timer because
// todo: adcStartConversionI requires OS lock. currently slow ADC is 10Hz (?)
@ -117,9 +115,10 @@ ADC_TwoSamplingDelay_5Cycles, // cr1
ADC_CR2_SWSTART, // cr2
0, // sample times for channels 10...18
// todo: IS SOMETHING MISSING HERE?
ADC_SMPR2_SMP_AN0(MY_SAMPLING_FAST), // In this field must be specified the sample times for channels 0...9
ADC_SQR1_NUM_CH(ADC_NUMBER_CHANNELS_FAST), // Conversion group sequence 13...16 + sequence length
0, // Conversion group sequence 13...16 + sequence length
0, // Conversion group sequence 7...12
0
@ -382,8 +381,10 @@ void AdcDevice::addChannel(adc_channel_e hwChannel) {
hardwareIndexByIndernalAdcIndex[logicChannel] = hwChannel;
if (logicChannel < 6) {
hwConfig->sqr3 += (hwChannel) << (5 * logicChannel);
} else {
} else if (logicChannel < 12) {
hwConfig->sqr2 += (hwChannel) << (5 * (logicChannel - 6));
} else {
hwConfig->sqr1 += (hwChannel) << (5 * (logicChannel - 12));
}
// todo: support for more then 12 channels? not sure how needed it would be

View File

@ -260,5 +260,5 @@ int getRusEfiVersion(void) {
return 1; // this is here to make the compiler happy about the unused array
if (UNUSED_CCM_SIZE == 0)
return 1; // this is here to make the compiler happy about the unused array
return 20150126;
return 20150127;
}

View File

@ -143,7 +143,7 @@ int main(void) {
testMenuTree();
// resizeMap();
printf("Success 20150101\r\n");
printf("Success 20150127\r\n");
return EXIT_SUCCESS;
}

View File

@ -534,6 +534,7 @@ void testTriggerDecoder(void) {
testTriggerDecoder3("citroen", CITROEN_TU3JP, 0, 0.4833, 0.0, 2.9994);
testTriggerDecoder3("neon NGC", DODGE_NEON_2003, 5, 0.4861, 0.0, CHRYSLER_NGC_GAP);
testTriggerDecoder2("sachs", SACHS, 0, 0.5000, 0.000);
testMazda323();