mirror of
https://github.com/stevenhowes/MX5-Arduino.git
synced 2026-05-27 00:03:37 +01:00
Add rpm based dwell (as well as data for voltage based dwell)
This commit is contained in:
@@ -72,11 +72,11 @@ void cas_process()
|
||||
if((cylinder_next_fire == 1) || (cylinder_next_fire == 4))
|
||||
{
|
||||
task_coil1_fire = micros() + (usec_per_degree * (180 + ignition_offset - table_ignition[rpm_current_index + (map_current_index << 4)]));
|
||||
task_coil1_charge = task_coil1_fire - (coil_dwell + table_dwell[battery_voltage_index]);
|
||||
task_coil1_charge = task_coil1_fire - (coil_dwell + table_dwell_voltage[battery_voltage_index] + table_dwell_rpm[rpm_current_index]);
|
||||
}else if((cylinder_next_fire == 2) || (cylinder_next_fire == 3))
|
||||
{
|
||||
task_coil2_fire = micros() + (usec_per_degree * (180 + ignition_offset - table_ignition[rpm_current_index + (map_current_index << 4)]));
|
||||
task_coil2_charge = task_coil2_fire - (coil_dwell + table_dwell[battery_voltage_index]);
|
||||
task_coil2_charge = task_coil2_fire - (coil_dwell + table_dwell_voltage[battery_voltage_index] + table_dwell_rpm[rpm_current_index]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -47,9 +47,18 @@ byte table_ignition[] = {
|
||||
// X = Voltage 7-16
|
||||
// Index = [battery_voltage_index]
|
||||
// Value = additional dwell in usec
|
||||
const int table_dwell[] = {
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0
|
||||
const int table_dwell_voltage[] = {
|
||||
2000, 2000, 2000, 2000, 1000, 0, 0, 0, 0, 0
|
||||
};
|
||||
|
||||
// X = RPM 0 - 7200
|
||||
// Index = [rpm_current_index]
|
||||
// Value = additional dwell in usec
|
||||
const int table_dwell_rpm[] = {
|
||||
3000, 2000, 2000, 1000, 0, 0, 0, 0, 0, 0, 0, -1000, -1000, -1000, -2000, -2000,
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user