auto-sync
This commit is contained in:
parent
ad996a1a48
commit
df79a226ea
|
@ -61,7 +61,9 @@ void setBmwE34(engine_configuration_s *engineConfiguration) {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This saves a couple of ticks in trigger emulation methods
|
* This saves a couple of ticks in trigger emulation methods
|
||||||
|
* TODO: add some smart logic to detect unneeded trigger simulation pins?
|
||||||
|
* TODO: but probably not worth it
|
||||||
*/
|
*/
|
||||||
bc->triggerSimulatorPins[1] = GPIOD_2;
|
bc->triggerSimulatorPins[1] = GPIO_UNASSIGNED;
|
||||||
bc->triggerSimulatorPins[2] = GPIOD_3;
|
bc->triggerSimulatorPins[2] = GPIO_UNASSIGNED;
|
||||||
}
|
}
|
||||||
|
|
|
@ -21,6 +21,8 @@ static Logging logger;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This method controls the actual hardware pins
|
* This method controls the actual hardware pins
|
||||||
|
*
|
||||||
|
* This method takes ~350 ticks.
|
||||||
*/
|
*/
|
||||||
void applyPinState(PwmConfig *state, int stateIndex) {
|
void applyPinState(PwmConfig *state, int stateIndex) {
|
||||||
efiAssertVoid(stateIndex < PWM_PHASE_MAX_COUNT, "invalid stateIndex");
|
efiAssertVoid(stateIndex < PWM_PHASE_MAX_COUNT, "invalid stateIndex");
|
||||||
|
@ -32,8 +34,7 @@ void applyPinState(PwmConfig *state, int stateIndex) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void startSimplePwm(PwmConfig *state, const char *msg, io_pin_e ioPin,
|
void startSimplePwm(PwmConfig *state, const char *msg, io_pin_e ioPin, float frequency, float dutyCycle) {
|
||||||
float frequency, float dutyCycle) {
|
|
||||||
efiAssertVoid(dutyCycle >= 0 && dutyCycle <= 1, "dutyCycle");
|
efiAssertVoid(dutyCycle >= 0 && dutyCycle <= 1, "dutyCycle");
|
||||||
|
|
||||||
float switchTimes[] = { dutyCycle, 1 };
|
float switchTimes[] = { dutyCycle, 1 };
|
||||||
|
@ -47,8 +48,8 @@ void startSimplePwm(PwmConfig *state, const char *msg, io_pin_e ioPin,
|
||||||
weComplexInit(msg, state, 2, switchTimes, 1, pinStates, NULL, applyPinState);
|
weComplexInit(msg, state, 2, switchTimes, 1, pinStates, NULL, applyPinState);
|
||||||
}
|
}
|
||||||
|
|
||||||
void startSimplePwmExt(PwmConfig *state, const char *msg, brain_pin_e brainPin, io_pin_e ioPin,
|
void startSimplePwmExt(PwmConfig *state, const char *msg, brain_pin_e brainPin, io_pin_e ioPin, float frequency,
|
||||||
float frequency, float dutyCycle) {
|
float dutyCycle) {
|
||||||
|
|
||||||
GPIO_TypeDef * port = getHwPort(brainPin);
|
GPIO_TypeDef * port = getHwPort(brainPin);
|
||||||
int pin = getHwPin(brainPin);
|
int pin = getHwPin(brainPin);
|
||||||
|
|
|
@ -1,10 +1,8 @@
|
||||||
package com.rusefi.waves;
|
package com.rusefi.waves;
|
||||||
|
|
||||||
import com.rusefi.io.tcp.TcpConnector;
|
|
||||||
|
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
|
|
||||||
import static com.rusefi.io.tcp.TcpConnector.*;
|
import static com.rusefi.io.tcp.TcpConnector.parseIntWithReason;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 1/11/14.
|
* 1/11/14.
|
||||||
|
@ -19,7 +17,7 @@ public class RevolutionLog {
|
||||||
}
|
}
|
||||||
|
|
||||||
public static RevolutionLog parseRevolutions(CharSequence revolutions) {
|
public static RevolutionLog parseRevolutions(CharSequence revolutions) {
|
||||||
TreeMap<Integer, Integer> time2rpm = new TreeMap<Integer, Integer>();
|
TreeMap<Integer, Integer> time2rpm = new TreeMap<>();
|
||||||
if (revolutions == null)
|
if (revolutions == null)
|
||||||
return new RevolutionLog(time2rpm);
|
return new RevolutionLog(time2rpm);
|
||||||
|
|
||||||
|
@ -46,7 +44,7 @@ public class RevolutionLog {
|
||||||
if (entry == null) {
|
if (entry == null) {
|
||||||
if (tryNextRevolution && time2rpm.size() >= 2) {
|
if (tryNextRevolution && time2rpm.size() >= 2) {
|
||||||
// we are here if the value is below the first revolution point
|
// we are here if the value is below the first revolution point
|
||||||
List<Map.Entry<Integer, Integer>> element = new ArrayList<Map.Entry<Integer, Integer>>(time2rpm.entrySet());
|
List<Map.Entry<Integer, Integer>> element = new ArrayList<>(time2rpm.entrySet());
|
||||||
Map.Entry<Integer, Integer> first = element.get(0);
|
Map.Entry<Integer, Integer> first = element.get(0);
|
||||||
Map.Entry<Integer, Integer> second = element.get(1);
|
Map.Entry<Integer, Integer> second = element.get(1);
|
||||||
|
|
||||||
|
|
|
@ -22,7 +22,7 @@ public class WaveChartParser {
|
||||||
|
|
||||||
String[] array = value.split(DELI);
|
String[] array = value.split(DELI);
|
||||||
|
|
||||||
Map<String, StringBuilder> map = new HashMap<String, StringBuilder>();
|
Map<String, StringBuilder> map = new HashMap<>();
|
||||||
|
|
||||||
int index = 0;
|
int index = 0;
|
||||||
while (index + 2 < array.length) {
|
while (index + 2 < array.length) {
|
||||||
|
|
Loading…
Reference in New Issue