auto-sync
This commit is contained in:
parent
bbcb62d6bf
commit
e061a454a2
|
@ -29,5 +29,5 @@ void setGy6139qmbDefaultEngineConfiguration(engine_configuration_s *engineConfig
|
||||||
engineConfiguration->trigger.customTotalToothCount = 1;
|
engineConfiguration->trigger.customTotalToothCount = 1;
|
||||||
engineConfiguration->trigger.customSkippedToothCount = 0;
|
engineConfiguration->trigger.customSkippedToothCount = 0;
|
||||||
engineConfiguration->trigger.customIsSynchronizationNeeded = false;
|
engineConfiguration->trigger.customIsSynchronizationNeeded = false;
|
||||||
//todo engineConfiguration2->triggerShape.needSecondTriggerInput = false;
|
engineConfiguration->needSecondTriggerInput = false;
|
||||||
}
|
}
|
||||||
|
|
|
@ -13,6 +13,20 @@
|
||||||
|
|
||||||
void setSachs(engine_configuration_s *engineConfiguration) {
|
void setSachs(engine_configuration_s *engineConfiguration) {
|
||||||
engineConfiguration->displacement = 0.1; // 100cc
|
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->hasIatSensor = false;
|
||||||
engineConfiguration->hasMapSensor = false;
|
engineConfiguration->hasMapSensor = false;
|
||||||
|
|
|
@ -30,8 +30,6 @@ AdcDevice::AdcDevice(ADCConversionGroup* hwConfig) {
|
||||||
memset(internalAdcIndexByHardwareIndex, 0xFFFFFFFF, sizeof(internalAdcIndexByHardwareIndex));
|
memset(internalAdcIndexByHardwareIndex, 0xFFFFFFFF, sizeof(internalAdcIndexByHardwareIndex));
|
||||||
}
|
}
|
||||||
|
|
||||||
#define ADC_NUMBER_CHANNELS_FAST 1
|
|
||||||
|
|
||||||
// todo: migrate from hardware timer to software ADC conversion triggering
|
// 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: 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 (?)
|
// todo: adcStartConversionI requires OS lock. currently slow ADC is 10Hz (?)
|
||||||
|
@ -117,9 +115,10 @@ ADC_TwoSamplingDelay_5Cycles, // cr1
|
||||||
ADC_CR2_SWSTART, // cr2
|
ADC_CR2_SWSTART, // cr2
|
||||||
|
|
||||||
0, // sample times for channels 10...18
|
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_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, // Conversion group sequence 7...12
|
||||||
0
|
0
|
||||||
|
@ -382,8 +381,10 @@ void AdcDevice::addChannel(adc_channel_e hwChannel) {
|
||||||
hardwareIndexByIndernalAdcIndex[logicChannel] = hwChannel;
|
hardwareIndexByIndernalAdcIndex[logicChannel] = hwChannel;
|
||||||
if (logicChannel < 6) {
|
if (logicChannel < 6) {
|
||||||
hwConfig->sqr3 += (hwChannel) << (5 * logicChannel);
|
hwConfig->sqr3 += (hwChannel) << (5 * logicChannel);
|
||||||
} else {
|
} else if (logicChannel < 12) {
|
||||||
hwConfig->sqr2 += (hwChannel) << (5 * (logicChannel - 6));
|
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
|
// todo: support for more then 12 channels? not sure how needed it would be
|
||||||
|
|
||||||
|
|
|
@ -260,5 +260,5 @@ int getRusEfiVersion(void) {
|
||||||
return 1; // this is here to make the compiler happy about the unused array
|
return 1; // this is here to make the compiler happy about the unused array
|
||||||
if (UNUSED_CCM_SIZE == 0)
|
if (UNUSED_CCM_SIZE == 0)
|
||||||
return 1; // this is here to make the compiler happy about the unused array
|
return 1; // this is here to make the compiler happy about the unused array
|
||||||
return 20150126;
|
return 20150127;
|
||||||
}
|
}
|
||||||
|
|
|
@ -143,7 +143,7 @@ int main(void) {
|
||||||
testMenuTree();
|
testMenuTree();
|
||||||
|
|
||||||
// resizeMap();
|
// resizeMap();
|
||||||
printf("Success 20150101\r\n");
|
printf("Success 20150127\r\n");
|
||||||
return EXIT_SUCCESS;
|
return EXIT_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -534,6 +534,7 @@ void testTriggerDecoder(void) {
|
||||||
testTriggerDecoder3("citroen", CITROEN_TU3JP, 0, 0.4833, 0.0, 2.9994);
|
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);
|
testTriggerDecoder3("neon NGC", DODGE_NEON_2003, 5, 0.4861, 0.0, CHRYSLER_NGC_GAP);
|
||||||
|
testTriggerDecoder2("sachs", SACHS, 0, 0.5000, 0.000);
|
||||||
|
|
||||||
testMazda323();
|
testMazda323();
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue