mirror of https://github.com/rusefi/rusefi-1.git
auto-sync
This commit is contained in:
parent
a6b9ec0f93
commit
3805a20f90
|
@ -50,7 +50,7 @@
|
||||||
#define STM32_PWM_USE_TIM9 FALSE
|
#define STM32_PWM_USE_TIM9 FALSE
|
||||||
|
|
||||||
#define STM32_SPI_USE_SPI1 TRUE
|
#define STM32_SPI_USE_SPI1 TRUE
|
||||||
#define STM32_SPI_USE_SPI2 FALSE // external ADC
|
#define STM32_SPI_USE_SPI2 TRUE // external ADC
|
||||||
#define STM32_SPI_USE_SPI3 TRUE // potentiometer
|
#define STM32_SPI_USE_SPI3 TRUE // potentiometer
|
||||||
|
|
||||||
#define STM32_CAN_USE_CAN1 TRUE
|
#define STM32_CAN_USE_CAN1 TRUE
|
||||||
|
@ -130,25 +130,8 @@
|
||||||
*/
|
*/
|
||||||
#define EFI_CUSTOM_PANIC_METHOD TRUE
|
#define EFI_CUSTOM_PANIC_METHOD TRUE
|
||||||
|
|
||||||
/*
|
|
||||||
* 10 channel board is (from left to right):
|
|
||||||
* ADC 15 PC5 TPS
|
|
||||||
* ADC 14 PC4 MAP
|
|
||||||
* ADC 7 PA7 IAT
|
|
||||||
* ADC 6 PA6 CLT
|
|
||||||
* ADC 5 PA5 TIM2_CH1
|
|
||||||
* ADC 4 PA4
|
|
||||||
* ADC 3 PA3
|
|
||||||
* ADC 2 PA2
|
|
||||||
* ADC 1 PA1 vBatt
|
|
||||||
* ADC 0 PA0 MAF
|
|
||||||
*/
|
|
||||||
|
|
||||||
#define ADC_LOGIC_TPS_2 ADC_CHANNEL_IN0
|
|
||||||
|
|
||||||
#define ADC_CHANNEL_VREF ADC_CHANNEL_IN14
|
#define ADC_CHANNEL_VREF ADC_CHANNEL_IN14
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* currently ChibiOS uses only first and second channels of each timer for input capture
|
* currently ChibiOS uses only first and second channels of each timer for input capture
|
||||||
*
|
*
|
||||||
|
|
|
@ -75,7 +75,7 @@
|
||||||
|
|
||||||
#define EFI_MAX_31855 TRUE
|
#define EFI_MAX_31855 TRUE
|
||||||
|
|
||||||
#define EFI_HIP_9011 FALSE
|
#define EFI_HIP_9011 TRUE
|
||||||
|
|
||||||
#define EFI_INTERNAL_ADC TRUE
|
#define EFI_INTERNAL_ADC TRUE
|
||||||
|
|
||||||
|
|
|
@ -134,7 +134,7 @@ void printSensors(Engine *engine) {
|
||||||
reportSensorF("baro", getBaroPressure(), 2);
|
reportSensorF("baro", getBaroPressure(), 2);
|
||||||
|
|
||||||
reportSensorF("afr", getAfr(), 2);
|
reportSensorF("afr", getAfr(), 2);
|
||||||
reportSensorF("vref", getVRef(), 2);
|
reportSensorF("vref", getVRef(engineConfiguration), 2);
|
||||||
reportSensorF("vbatt", getVBatt(engineConfiguration), 2);
|
reportSensorF("vbatt", getVBatt(engineConfiguration), 2);
|
||||||
|
|
||||||
reportSensorF("TRG_0_DUTY", getTriggerDutyCycle(0), 2);
|
reportSensorF("TRG_0_DUTY", getTriggerDutyCycle(0), 2);
|
||||||
|
|
|
@ -105,6 +105,10 @@ case INJECTOR_10_OUTPUT:
|
||||||
return "INJECTOR_10_OUTPUT";
|
return "INJECTOR_10_OUTPUT";
|
||||||
case INJECTOR_6_OUTPUT:
|
case INJECTOR_6_OUTPUT:
|
||||||
return "INJECTOR_6_OUTPUT";
|
return "INJECTOR_6_OUTPUT";
|
||||||
|
case SPI_CS_HIP9011:
|
||||||
|
return "SPI_CS_HIP9011";
|
||||||
|
case HIP9011_INT_HOLD:
|
||||||
|
return "HIP9011_INT_HOLD";
|
||||||
case SPI_CS_1:
|
case SPI_CS_1:
|
||||||
return "SPI_CS_1";
|
return "SPI_CS_1";
|
||||||
case SPI_CS_3:
|
case SPI_CS_3:
|
||||||
|
|
|
@ -204,6 +204,7 @@ typedef struct {
|
||||||
unsigned int isSdCardEnabled : 1; // bit 3
|
unsigned int isSdCardEnabled : 1; // bit 3
|
||||||
unsigned int isFastAdcEnabled : 1; // bit 4
|
unsigned int isFastAdcEnabled : 1; // bit 4
|
||||||
unsigned int isEngineControlEnabled : 1; // bit 5
|
unsigned int isEngineControlEnabled : 1; // bit 5
|
||||||
|
unsigned int isHip9011Enabled : 1; // bit 6
|
||||||
|
|
||||||
brain_pin_e logicAnalyzerPins[LOGIC_ANALYZER_CHANNEL_COUNT];
|
brain_pin_e logicAnalyzerPins[LOGIC_ANALYZER_CHANNEL_COUNT];
|
||||||
/**
|
/**
|
||||||
|
@ -240,7 +241,9 @@ typedef struct {
|
||||||
|
|
||||||
short int fsioFrequency[LE_COMMAND_COUNT];
|
short int fsioFrequency[LE_COMMAND_COUNT];
|
||||||
|
|
||||||
int unusedbs[41];
|
brain_pin_e hip9011CsPin;
|
||||||
|
brain_pin_e hip9011IntHoldPin;
|
||||||
|
int unusedbs[39];
|
||||||
|
|
||||||
le_formula_t le_formulas[LE_COMMAND_COUNT];
|
le_formula_t le_formulas[LE_COMMAND_COUNT];
|
||||||
|
|
||||||
|
@ -518,7 +521,9 @@ typedef struct {
|
||||||
short int acIdleRpmBump;
|
short int acIdleRpmBump;
|
||||||
short int unusedShort;
|
short int unusedShort;
|
||||||
|
|
||||||
int unused3[88];
|
adc_channel_e vRefAdcChannel;
|
||||||
|
|
||||||
|
int unused3[87];
|
||||||
|
|
||||||
} engine_configuration_s;
|
} engine_configuration_s;
|
||||||
|
|
||||||
|
|
|
@ -131,6 +131,9 @@ typedef enum {
|
||||||
SPI_CS_3,
|
SPI_CS_3,
|
||||||
SPI_CS_4,
|
SPI_CS_4,
|
||||||
SPI_CS_SD_MODULE,
|
SPI_CS_SD_MODULE,
|
||||||
|
SPI_CS_HIP9011,
|
||||||
|
|
||||||
|
HIP9011_INT_HOLD,
|
||||||
|
|
||||||
MAIN_RELAY,
|
MAIN_RELAY,
|
||||||
|
|
||||||
|
|
|
@ -72,8 +72,8 @@ extern OutputPin outputs[IO_PIN_COUNT];
|
||||||
extern pin_output_mode_e *pinDefaultState[IO_PIN_COUNT];
|
extern pin_output_mode_e *pinDefaultState[IO_PIN_COUNT];
|
||||||
extern bool hasFirmwareErrorFlag;
|
extern bool hasFirmwareErrorFlag;
|
||||||
|
|
||||||
static LEElement * fsioLogics[LE_COMMAND_COUNT];
|
static LEElement * fsioLogics[LE_COMMAND_COUNT] CCM_OPTIONAL;
|
||||||
static SimplePwm fsioPwm[LE_COMMAND_COUNT];
|
static SimplePwm fsioPwm[LE_COMMAND_COUNT] CCM_OPTIONAL;
|
||||||
|
|
||||||
persistent_config_container_s persistentState CCM_OPTIONAL;
|
persistent_config_container_s persistentState CCM_OPTIONAL;
|
||||||
|
|
||||||
|
|
|
@ -15,9 +15,8 @@
|
||||||
|
|
||||||
extern engine_configuration_s *engineConfiguration;
|
extern engine_configuration_s *engineConfiguration;
|
||||||
|
|
||||||
float getVRef(void) {
|
float getVRef(engine_configuration_s *engineConfiguration) {
|
||||||
// return getAdcValue(ADC_CHANNEL_VREF);
|
return getVoltageDivided(engineConfiguration->vRefAdcChannel);
|
||||||
return getVoltageDivided((adc_channel_e)ADC_CHANNEL_VREF);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
float getVBatt(engine_configuration_s *engineConfiguration) {
|
float getVBatt(engine_configuration_s *engineConfiguration) {
|
||||||
|
|
|
@ -13,16 +13,7 @@
|
||||||
#include "main.h"
|
#include "main.h"
|
||||||
#include "engine_configuration.h"
|
#include "engine_configuration.h"
|
||||||
|
|
||||||
#ifdef __cplusplus
|
float getVRef(engine_configuration_s *engineConfiguration);
|
||||||
extern "C"
|
|
||||||
{
|
|
||||||
#endif /* __cplusplus */
|
|
||||||
|
|
||||||
float getVRef(void);
|
|
||||||
float getVBatt(engine_configuration_s *engineConfiguration);
|
float getVBatt(engine_configuration_s *engineConfiguration);
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
}
|
|
||||||
#endif /* __cplusplus */
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -18,6 +18,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "main.h"
|
#include "main.h"
|
||||||
|
#include "engine.h"
|
||||||
|
|
||||||
#if EFI_HIP_9011
|
#if EFI_HIP_9011
|
||||||
|
|
||||||
|
@ -64,7 +65,7 @@ static msg_t ivThread(int param) {
|
||||||
|
|
||||||
tx_buff[0] = HIP_ADVANCED_MODE;
|
tx_buff[0] = HIP_ADVANCED_MODE;
|
||||||
|
|
||||||
tx_buff[4] = 0xF8;// 0b11111000;
|
tx_buff[4] = 0xF8; // 0b11111000;
|
||||||
|
|
||||||
while (TRUE) {
|
while (TRUE) {
|
||||||
chThdSleepMilliseconds(10);
|
chThdSleepMilliseconds(10);
|
||||||
|
@ -82,7 +83,12 @@ static msg_t ivThread(int param) {
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
EXTERN_ENGINE
|
||||||
|
;
|
||||||
|
|
||||||
void initHip9011(void) {
|
void initHip9011(void) {
|
||||||
|
if (!boardConfiguration->isHip9011Enabled)
|
||||||
|
return;
|
||||||
initLogging(&logger, "HIP driver");
|
initLogging(&logger, "HIP driver");
|
||||||
|
|
||||||
print("Starting HIP9011/TPIC8101 driver\r\n");
|
print("Starting HIP9011/TPIC8101 driver\r\n");
|
||||||
|
|
|
@ -292,7 +292,7 @@ SPIDriver * getSpiDevice(spi_device_e spiDevice) {
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
#if STM32_SPI_USE_SPI2 || defined(__DOXYGEN__)
|
#if STM32_SPI_USE_SPI2 || defined(__DOXYGEN__)
|
||||||
if (spiDevic e== SPI_DEVICE_2) {
|
if (spiDevice == SPI_DEVICE_2) {
|
||||||
return &SPID2;
|
return &SPID2;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -265,5 +265,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 20141204;
|
return 20141205;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue