auto-sync

This commit is contained in:
rusEfi 2015-01-27 15:04:15 -06:00
parent 875ad53938
commit 5d6cfde4d8
6 changed files with 476 additions and 478 deletions

View File

@ -11,27 +11,14 @@
#include "efifeatures.h"
#include "crc.h"
#include "sensor_types.h"
#include "can_header.h"
#include "rusefi_enums.h"
#include "global.h"
#include "rusefi_types.h"
#include "engine_configuration_generated_structures.h"
#define MOCK_UNDEFINED -1
#define INJECTION_PIN_COUNT 12
#define IGNITION_PIN_COUNT 12
#define MAX31855_CS_COUNT 8
#define JOYSTICK_PIN_COUNT 5
#define FUEL_RPM_COUNT 16
#define FUEL_LOAD_COUNT 16
#define LE_COMMAND_LENGTH 200
#define LE_COMMAND_COUNT 16
typedef char le_formula_t[LE_COMMAND_LENGTH];
#define CLT_CURVE_SIZE 16
#define IAT_CURVE_SIZE 16
@ -51,410 +38,15 @@ typedef struct {
ignition_table_t map;
} full_i_table_s;
typedef brain_pin_e egt_cs_array_t[MAX31855_CS_COUNT];
#define DWELL_CURVE_SIZE 8
typedef enum {
AC_OFF = 0,
/**
* You would use this value if you want to see a detailed graph of your trigger events
*/
AC_TRIGGER = 1, AC_MAP = 2,
Internal_ForceMyEnumIntSize_analog_chart = ENUM_32_BITS,
} analog_chart_e;
typedef enum {
/**
* This is the default mode in which ECU controls timing dynamically
*/
TM_DYNAMIC = 0,
/**
* Fixed timing is useful while you are playing with a timing gun - you need to have fixed
* timing if you want to install your distributor at some specific angle
*/
TM_FIXED = 1,
Internal_ForceMyEnumIntSize_timing_mode = ENUM_32_BITS,
} timing_mode_e;
typedef enum {
CD_OFF = 0,
CD_USE_CAN1 = 1,
CD_USE_CAN2 = 2,
Internal_ForceMyEnumIntSize_can_device_mode = ENUM_32_BITS,
} can_device_mode_e;
#define DWELL_COUNT 8
#define CRANKING_CURVE_SIZE 8
#define HW_MAX_ADC_INDEX 16
// WARNING: by default, our small enums are ONE BYTE. this one is made 4-byte with the 'ENUM_32_BITS' hack
typedef struct {
/**
* offset 0
*/
brain_pin_e idleValvePin;
/**
* offset 4
*/
pin_output_mode_e idleValvePinMode;
/**
* offset 8
*/
brain_pin_e fuelPumpPin;
/**
* offset 12
*/
pin_output_mode_e fuelPumpPinMode;
/**
* offset 16
*/
brain_pin_e injectionPins[INJECTION_PIN_COUNT];
/**
* offset 64
*/
pin_output_mode_e injectionPinMode;
/**
* offset 68
*/
brain_pin_e ignitionPins[IGNITION_PIN_COUNT];
/**
* offset 116
*/
pin_output_mode_e ignitionPinMode;
/**
* offset 120
*/
brain_pin_e malfunctionIndicatorPin;
/**
* offset 124
*/
pin_output_mode_e malfunctionIndicatorPinMode;
/**
* offset 128
*/
brain_pin_e fanPin;
/**
* offset 132
*/
pin_output_mode_e fanPinMode;
/**
* offset 136
*/
brain_pin_e electronicThrottlePin1;
/**
* offset 140
*/
pin_output_mode_e electronicThrottlePin1Mode;
/**
* some cars have a switch to indicate that clutch pedal is all the way down
* offset 144
*/
brain_pin_e clutchDownPin;
/**
* offset 148
*/
pin_input_mode_e clutchDownPinMode;
/**
* offset 152
*/
brain_pin_e alternatorControlPin;
/**
* offset 156
*/
pin_output_mode_e alternatorControlPinMode;
/**
* offset 160
*/
brain_pin_e HD44780_rs;
/**
* offset 164
*/
brain_pin_e HD44780_e;
/**
* offset 168
*/
brain_pin_e HD44780_db4;
/**
* offset 172
*/
brain_pin_e HD44780_db5;
/**
* offset 176
*/
brain_pin_e HD44780_db6;
/**
* offset 180
*/
brain_pin_e HD44780_db7;
/**
* offset 184
*/
brain_pin_e gps_rx_pin;
/**
* offset 188
*/
brain_pin_e gps_tx_pin;
/**
* offset 192
*/
int idleSolenoidFrequency;
/**
* offset 196
*/
int triggerSimulatorFrequency;
/**
* Digital Potentiometer is used by stock ECU stimulation code
* offset 200
*/
spi_device_e digitalPotentiometerSpiDevice;
/**
* offset 204
*/
brain_pin_e digitalPotentiometerChipSelect[DIGIPOT_COUNT];
/**
* offset 220
*/
adc_channel_mode_e adcHwChannelEnabled[HW_MAX_ADC_INDEX];
/**
* offset 284
*/
brain_pin_e triggerInputPins[3];
/**
* offset 296
*/
brain_pin_e mainRelayPin;
/**
* offset 300
*/
int idleThreadPeriod;
/**
* offset 304
*/
int consoleLoopPeriod;
/**
* offset 308
*/
int lcdThreadPeriod;
/**
* offset 312
*/
int tunerStudioThreadPeriod;
/**
* offset 316
*/
int generalPeriodicThreadPeriod;
/**
* offset 320
*/
uint32_t tunerStudioSerialSpeed;
/**
* offset 324
*/
brain_pin_e boardTestModeJumperPin;
/**
* offset 328
*/
can_device_mode_e canDeviceMode;
/**
* offset 332
*/
brain_pin_e canTxPin;
/**
* offset 336
*/
brain_pin_e canRxPin;
/**
* offset 340
*/
brain_pin_e triggerSimulatorPins[TRIGGER_SIMULATOR_PIN_COUNT];
/**
* offset 352
*/
pin_output_mode_e triggerSimulatorPinModes[TRIGGER_SIMULATOR_PIN_COUNT];
/**
* offset 364
*/
brain_pin_e o2heaterPin;
/**
* offset 368
*/
pin_output_mode_e o2heaterPinModeTodO;
/** offset 372 bit 0 */
uint32_t is_enabled_spi_1 : 1;
/** offset 372 bit 1 */
uint32_t is_enabled_spi_2 : 1;
/** offset 372 bit 2 */
uint32_t is_enabled_spi_3 : 1;
/** offset 372 bit 3 */
uint32_t isSdCardEnabled : 1;
/** offset 372 bit 4 */
uint32_t isFastAdcEnabled : 1;
/** offset 372 bit 5 */
uint32_t isEngineControlEnabled : 1;
/** offset 372 bit 6 */
uint32_t isHip9011Enabled : 1;
/**
* offset 376
*/
brain_pin_e logicAnalyzerPins[LOGIC_ANALYZER_CHANNEL_COUNT];
/**
* default or inverted input
* offset 392
*/
uint8_t logicAnalyzerMode[LOGIC_ANALYZER_CHANNEL_COUNT];
/**
* offset 396
*/
int unrealisticRpmThreashold;
/**
* offset 400
*/
pin_output_mode_e mainRelayPinMode;
/**
* offset 404
*/
egt_cs_array_t max31855_cs;
/**
* offset 408
*/
spi_device_e max31855spiDevice;
/**
* offset 412
*/
brain_pin_e fsioPins[LE_COMMAND_COUNT];
/**
* offset 476
*/
pin_output_mode_e gpioPinModes[LE_COMMAND_COUNT];
/**
* offset 540
*/
brain_pin_e joystickPins[JOYSTICK_PIN_COUNT];
/**
* This pin is used for debugging - snap a logic analyzer on it and see if it's ever high
* offset 560
*/
brain_pin_e triggerErrorPin;
/**
* offset 564
*/
pin_output_mode_e triggerErrorPinMode;
/**
* value between 0 and 1
* offset 568
*/
float idleSolenoidPwm;
/**
* offset 572
*/
brain_pin_e acRelayPin;
/**
* offset 576
*/
pin_output_mode_e acRelayPinMode;
/**
* offset 580
*/
int16_t fsioFrequency[LE_COMMAND_COUNT];
/**
* offset 612
*/
brain_pin_e hip9011CsPin;
/**
* offset 616
*/
brain_pin_e hip9011IntHoldPin;
/**
* offset 620
*/
brain_pin_e hip9011OutPin;
/**
* offset 624
*/
float fsio_setting[LE_COMMAND_COUNT];
/**
* offset 688
*/
brain_pin_e spi1mosiPin;
/**
* offset 692
*/
brain_pin_e spi1misoPin;
/**
* offset 696
*/
brain_pin_e spi1sckPin;
/**
* offset 700
*/
brain_pin_e spi2mosiPin;
/**
* offset 704
*/
brain_pin_e spi2misoPin;
/**
* offset 708
*/
brain_pin_e spi2sckPin;
/**
* offset 712
*/
brain_pin_e spi3mosiPin;
/**
* offset 716
*/
brain_pin_e spi3misoPin;
/**
* offset 720
*/
brain_pin_e spi3sckPin;
/**
* offset 724
*/
float hip9011Gain;
/**
* offset 728
*/
brain_pin_e joystickCenterPin;
/**
* offset 732
*/
brain_pin_e joystickAPin;
/**
* offset 736
*/
brain_pin_e joystickBPin;
/**
* offset 740
*/
brain_pin_e joystickCPin;
/**
* offset 744
*/
brain_pin_e joystickDPin;
/**
* offset 748
*/
analog_chart_e analogChartMode;
/**
* offset 752
*/
int unusedbs[6];
/**
* offset 776
*/
le_formula_t le_formulas[LE_COMMAND_COUNT];
/** total size 3976*/
} board_configuration_s;
// 19010105 decimal
#define HEADER_MAGIC_NUMBER 0x1221239

View File

@ -1,3 +1,5 @@
#include "rusefi_types.h"
typedef struct {
/**
* offset 0
@ -17,55 +19,6 @@ typedef struct {
/** total size 8*/
} cranking_parameters_s;
/**
* @brief Thermistor curve parameters
*/
typedef struct {
/**
* these values are in Celcuus
* offset 0
*/
float tempC_1;
/**
* offset 4
*/
float tempC_2;
/**
* offset 8
*/
float tempC_3;
/**
* offset 12
*/
float resistance_1;
/**
* offset 16
*/
float resistance_2;
/**
* offset 20
*/
float resistance_3;
/**
* offset 24
*/
float bias_resistor;
/**
* offset 28
*/
float s_h_a;
/**
* offset 32
*/
float s_h_b;
/**
* offset 36
*/
float s_h_c;
/** total size 40*/
} ThermistorConf;
typedef struct {
/**
* kPa value at zero volts
@ -178,3 +131,362 @@ typedef struct {
/** total size 20*/
} afr_sensor_s;
typedef struct {
/**
* offset 0
*/
brain_pin_e idleValvePin;
/**
* offset 4
*/
pin_output_mode_e idleValvePinMode;
/**
* offset 8
*/
brain_pin_e fuelPumpPin;
/**
* offset 12
*/
pin_output_mode_e fuelPumpPinMode;
/**
* offset 16
*/
brain_pin_e injectionPins[INJECTION_PIN_COUNT];
/**
* offset 64
*/
pin_output_mode_e injectionPinMode;
/**
* offset 68
*/
brain_pin_e ignitionPins[IGNITION_PIN_COUNT];
/**
* offset 116
*/
pin_output_mode_e ignitionPinMode;
/**
* offset 120
*/
brain_pin_e malfunctionIndicatorPin;
/**
* offset 124
*/
pin_output_mode_e malfunctionIndicatorPinMode;
/**
* offset 128
*/
brain_pin_e fanPin;
/**
* offset 132
*/
pin_output_mode_e fanPinMode;
/**
* offset 136
*/
brain_pin_e electronicThrottlePin1;
/**
* offset 140
*/
pin_output_mode_e electronicThrottlePin1Mode;
/**
* some cars have a switch to indicate that clutch pedal is all the way down
* offset 144
*/
brain_pin_e clutchDownPin;
/**
* offset 148
*/
pin_input_mode_e clutchDownPinMode;
/**
* offset 152
*/
brain_pin_e alternatorControlPin;
/**
* offset 156
*/
pin_output_mode_e alternatorControlPinMode;
/**
* offset 160
*/
brain_pin_e HD44780_rs;
/**
* offset 164
*/
brain_pin_e HD44780_e;
/**
* offset 168
*/
brain_pin_e HD44780_db4;
/**
* offset 172
*/
brain_pin_e HD44780_db5;
/**
* offset 176
*/
brain_pin_e HD44780_db6;
/**
* offset 180
*/
brain_pin_e HD44780_db7;
/**
* offset 184
*/
brain_pin_e gps_rx_pin;
/**
* offset 188
*/
brain_pin_e gps_tx_pin;
/**
* offset 192
*/
int idleSolenoidFrequency;
/**
* offset 196
*/
int triggerSimulatorFrequency;
/**
* Digital Potentiometer is used by stock ECU stimulation code
* offset 200
*/
spi_device_e digitalPotentiometerSpiDevice;
/**
* offset 204
*/
brain_pin_e digitalPotentiometerChipSelect[DIGIPOT_COUNT];
/**
* offset 220
*/
adc_channel_mode_e adcHwChannelEnabled[HW_MAX_ADC_INDEX];
/**
* offset 284
*/
brain_pin_e triggerInputPins[3];
/**
* offset 296
*/
brain_pin_e mainRelayPin;
/**
* offset 300
*/
int idleThreadPeriod;
/**
* offset 304
*/
int consoleLoopPeriod;
/**
* offset 308
*/
int lcdThreadPeriod;
/**
* offset 312
*/
int tunerStudioThreadPeriod;
/**
* offset 316
*/
int generalPeriodicThreadPeriod;
/**
* offset 320
*/
uint32_t tunerStudioSerialSpeed;
/**
* offset 324
*/
brain_pin_e boardTestModeJumperPin;
/**
* offset 328
*/
can_device_mode_e canDeviceMode;
/**
* offset 332
*/
brain_pin_e canTxPin;
/**
* offset 336
*/
brain_pin_e canRxPin;
/**
* offset 340
*/
brain_pin_e triggerSimulatorPins[TRIGGER_SIMULATOR_PIN_COUNT];
/**
* offset 352
*/
pin_output_mode_e triggerSimulatorPinModes[TRIGGER_SIMULATOR_PIN_COUNT];
/**
* offset 364
*/
brain_pin_e o2heaterPin;
/**
* offset 368
*/
pin_output_mode_e o2heaterPinModeTodO;
/** offset 372 bit 0 */
uint32_t is_enabled_spi_1 : 1;
/** offset 372 bit 1 */
uint32_t is_enabled_spi_2 : 1;
/** offset 372 bit 2 */
uint32_t is_enabled_spi_3 : 1;
/** offset 372 bit 3 */
uint32_t isSdCardEnabled : 1;
/** offset 372 bit 4 */
uint32_t isFastAdcEnabled : 1;
/** offset 372 bit 5 */
uint32_t isEngineControlEnabled : 1;
/** offset 372 bit 6 */
uint32_t isHip9011Enabled : 1;
/**
* offset 376
*/
brain_pin_e logicAnalyzerPins[LOGIC_ANALYZER_CHANNEL_COUNT];
/**
* default or inverted input
* offset 392
*/
uint8_t logicAnalyzerMode[LOGIC_ANALYZER_CHANNEL_COUNT];
/**
* offset 396
*/
int unrealisticRpmThreashold;
/**
* offset 400
*/
pin_output_mode_e mainRelayPinMode;
/**
* offset 404
*/
egt_cs_array_t max31855_cs;
/**
* offset 408
*/
spi_device_e max31855spiDevice;
/**
* offset 412
*/
brain_pin_e fsioPins[LE_COMMAND_COUNT];
/**
* offset 476
*/
pin_output_mode_e gpioPinModes[LE_COMMAND_COUNT];
/**
* offset 540
*/
brain_pin_e joystickPins[JOYSTICK_PIN_COUNT];
/**
* This pin is used for debugging - snap a logic analyzer on it and see if it's ever high
* offset 560
*/
brain_pin_e triggerErrorPin;
/**
* offset 564
*/
pin_output_mode_e triggerErrorPinMode;
/**
* value between 0 and 1
* offset 568
*/
float idleSolenoidPwm;
/**
* offset 572
*/
brain_pin_e acRelayPin;
/**
* offset 576
*/
pin_output_mode_e acRelayPinMode;
/**
* offset 580
*/
int16_t fsioFrequency[LE_COMMAND_COUNT];
/**
* offset 612
*/
brain_pin_e hip9011CsPin;
/**
* offset 616
*/
brain_pin_e hip9011IntHoldPin;
/**
* offset 620
*/
brain_pin_e hip9011OutPin;
/**
* offset 624
*/
float fsio_setting[LE_COMMAND_COUNT];
/**
* offset 688
*/
brain_pin_e spi1mosiPin;
/**
* offset 692
*/
brain_pin_e spi1misoPin;
/**
* offset 696
*/
brain_pin_e spi1sckPin;
/**
* offset 700
*/
brain_pin_e spi2mosiPin;
/**
* offset 704
*/
brain_pin_e spi2misoPin;
/**
* offset 708
*/
brain_pin_e spi2sckPin;
/**
* offset 712
*/
brain_pin_e spi3mosiPin;
/**
* offset 716
*/
brain_pin_e spi3misoPin;
/**
* offset 720
*/
brain_pin_e spi3sckPin;
/**
* offset 724
*/
float hip9011Gain;
/**
* offset 728
*/
brain_pin_e joystickCenterPin;
/**
* offset 732
*/
brain_pin_e joystickAPin;
/**
* offset 736
*/
brain_pin_e joystickBPin;
/**
* offset 740
*/
brain_pin_e joystickCPin;
/**
* offset 744
*/
brain_pin_e joystickDPin;
/**
* offset 748
*/
analog_chart_e analogChartMode;
/**
* offset 752
*/
int unusedbs[6];
/**
* offset 776
*/
le_formula_t le_formulas[LE_COMMAND_COUNT];
/** total size 3976*/
} board_configuration_s;

View File

@ -28,33 +28,23 @@
typedef enum {
CUSTOM_ENGINE = 0,
AUDI_AAN = 1,
#if EFI_SUPPORT_DODGE_NEON
/**
* 1995 Dodge Neon
* http://rusefi.com/forum/viewtopic.php?t=360
*/
DODGE_NEON_1995 = 2,
#endif /* EFI_SUPPORT_DODGE_NEON */
#if EFI_SUPPORT_FORD_ASPIRE
/**
* 1996 1.3 Ford Aspire
* http://rusefi.com/forum/viewtopic.php?t=375
*/
FORD_ASPIRE_1996 = 3,
#endif /* EFI_SUPPORT_FORD_ASPIRE */
#if EFI_SUPPORT_FORD_FIESTA
/**
* 36-1 toothed wheel engine
* http://rusefi.com/forum/viewtopic.php?t=282
*/
FORD_FIESTA = 4,
#endif /* EFI_SUPPORT_FORD_FIESTA */
#if EFI_SUPPORT_NISSAN_PRIMERA
NISSAN_PRIMERA = 5,
#endif /* EFI_SUPPORT_NISSAN_PRIMERA */
HONDA_ACCORD_CD = 6,
FORD_INLINE_6_1995 = 7,
/**
* one cylinder engine
@ -520,4 +510,36 @@ typedef enum {
Force_4b_cranking_map_type = ENUM_32_BITS,
} air_pressure_sensor_type_e;
typedef enum {
CD_OFF = 0,
CD_USE_CAN1 = 1,
CD_USE_CAN2 = 2,
Internal_ForceMyEnumIntSize_can_device_mode = ENUM_32_BITS,
} can_device_mode_e;
typedef enum {
AC_OFF = 0,
/**
* You would use this value if you want to see a detailed graph of your trigger events
*/
AC_TRIGGER = 1, AC_MAP = 2,
Internal_ForceMyEnumIntSize_analog_chart = ENUM_32_BITS,
} analog_chart_e;
typedef enum {
/**
* This is the default mode in which ECU controls timing dynamically
*/
TM_DYNAMIC = 0,
/**
* Fixed timing is useful while you are playing with a timing gun - you need to have fixed
* timing if you want to install your distributor at some specific angle
*/
TM_FIXED = 1,
Internal_ForceMyEnumIntSize_timing_mode = ENUM_32_BITS,
} timing_mode_e;
#endif /* RUSEFI_ENUMS_H_ */

View File

@ -8,6 +8,7 @@
#define CONTROLLERS_ALGO_RUSEFI_TYPES_H_
#include <stdint.h>
#include "rusefi_enums.h"
/**
* integer time in milliseconds
@ -36,4 +37,81 @@ typedef float percent_t;
typedef void (*Void)(void);
#define INJECTION_PIN_COUNT 12
#define IGNITION_PIN_COUNT 12
#define MAX31855_CS_COUNT 8
#define JOYSTICK_PIN_COUNT 5
#define FUEL_RPM_COUNT 16
#define FUEL_LOAD_COUNT 16
#define LE_COMMAND_LENGTH 200
#define LE_COMMAND_COUNT 16
typedef char le_formula_t[LE_COMMAND_LENGTH];
#define HW_MAX_ADC_INDEX 16
typedef brain_pin_e egt_cs_array_t[MAX31855_CS_COUNT];
#define MAP_ANGLE_SIZE 8
#define MAP_WINDOW_SIZE 8
/**
* @brief Thermistor curve parameters
*/
typedef struct {
/**
* these values are in Celcuus
* offset 0
*/
float tempC_1;
/**
* offset 4
*/
float tempC_2;
/**
* offset 8
*/
float tempC_3;
/**
* offset 12
*/
float resistance_1;
/**
* offset 16
*/
float resistance_2;
/**
* offset 20
*/
float resistance_3;
/**
* offset 24
*/
float bias_resistor;
/**
* offset 28
*/
float s_h_a;
/**
* offset 32
*/
float s_h_b;
/**
* offset 36
*/
float s_h_c;
/** total size 40*/
} ThermistorConf;
typedef struct {
ThermistorConf *config;
adc_channel_e channel;
} Thermistor;
#endif /* CONTROLLERS_ALGO_RUSEFI_TYPES_H_ */

View File

@ -1,6 +1,8 @@
#ifndef MAP_H_
#define MAP_H_
#include "engine_configuration.h"
#ifdef __cplusplus
extern "C"
{

View File

@ -8,15 +8,7 @@
#ifndef THERMISTOR_TYPES_H_
#define THERMISTOR_TYPES_H_
#define MAP_ANGLE_SIZE 8
#define MAP_WINDOW_SIZE 8
#include "rusefi_enums.h"
#include "engine_configuration_generated_structures.h"
typedef struct {
ThermistorConf *config;
adc_channel_e channel;
} Thermistor;
#include "sensor_types.h"
#endif /* THERMISTOR_TYPES_H_ */