auto-sync

This commit is contained in:
rusEfi 2014-12-05 11:03:16 -06:00
parent a6b9ec0f93
commit 3805a20f90
12 changed files with 31 additions and 40 deletions

View File

@ -50,7 +50,7 @@
#define STM32_PWM_USE_TIM9 FALSE
#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_CAN_USE_CAN1 TRUE
@ -130,25 +130,8 @@
*/
#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
/**
* currently ChibiOS uses only first and second channels of each timer for input capture
*

View File

@ -75,7 +75,7 @@
#define EFI_MAX_31855 TRUE
#define EFI_HIP_9011 FALSE
#define EFI_HIP_9011 TRUE
#define EFI_INTERNAL_ADC TRUE

View File

@ -134,7 +134,7 @@ void printSensors(Engine *engine) {
reportSensorF("baro", getBaroPressure(), 2);
reportSensorF("afr", getAfr(), 2);
reportSensorF("vref", getVRef(), 2);
reportSensorF("vref", getVRef(engineConfiguration), 2);
reportSensorF("vbatt", getVBatt(engineConfiguration), 2);
reportSensorF("TRG_0_DUTY", getTriggerDutyCycle(0), 2);

View File

@ -105,6 +105,10 @@ case INJECTOR_10_OUTPUT:
return "INJECTOR_10_OUTPUT";
case 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:
return "SPI_CS_1";
case SPI_CS_3:

View File

@ -204,6 +204,7 @@ typedef struct {
unsigned int isSdCardEnabled : 1; // bit 3
unsigned int isFastAdcEnabled : 1; // bit 4
unsigned int isEngineControlEnabled : 1; // bit 5
unsigned int isHip9011Enabled : 1; // bit 6
brain_pin_e logicAnalyzerPins[LOGIC_ANALYZER_CHANNEL_COUNT];
/**
@ -240,7 +241,9 @@ typedef struct {
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];
@ -518,7 +521,9 @@ typedef struct {
short int acIdleRpmBump;
short int unusedShort;
int unused3[88];
adc_channel_e vRefAdcChannel;
int unused3[87];
} engine_configuration_s;

View File

@ -131,6 +131,9 @@ typedef enum {
SPI_CS_3,
SPI_CS_4,
SPI_CS_SD_MODULE,
SPI_CS_HIP9011,
HIP9011_INT_HOLD,
MAIN_RELAY,

View File

@ -72,8 +72,8 @@ extern OutputPin outputs[IO_PIN_COUNT];
extern pin_output_mode_e *pinDefaultState[IO_PIN_COUNT];
extern bool hasFirmwareErrorFlag;
static LEElement * fsioLogics[LE_COMMAND_COUNT];
static SimplePwm fsioPwm[LE_COMMAND_COUNT];
static LEElement * fsioLogics[LE_COMMAND_COUNT] CCM_OPTIONAL;
static SimplePwm fsioPwm[LE_COMMAND_COUNT] CCM_OPTIONAL;
persistent_config_container_s persistentState CCM_OPTIONAL;

View File

@ -15,9 +15,8 @@
extern engine_configuration_s *engineConfiguration;
float getVRef(void) {
// return getAdcValue(ADC_CHANNEL_VREF);
return getVoltageDivided((adc_channel_e)ADC_CHANNEL_VREF);
float getVRef(engine_configuration_s *engineConfiguration) {
return getVoltageDivided(engineConfiguration->vRefAdcChannel);
}
float getVBatt(engine_configuration_s *engineConfiguration) {

View File

@ -13,16 +13,7 @@
#include "main.h"
#include "engine_configuration.h"
#ifdef __cplusplus
extern "C"
{
#endif /* __cplusplus */
float getVRef(void);
float getVRef(engine_configuration_s *engineConfiguration);
float getVBatt(engine_configuration_s *engineConfiguration);
#ifdef __cplusplus
}
#endif /* __cplusplus */
#endif

View File

@ -18,6 +18,7 @@
*/
#include "main.h"
#include "engine.h"
#if EFI_HIP_9011
@ -64,7 +65,7 @@ static msg_t ivThread(int param) {
tx_buff[0] = HIP_ADVANCED_MODE;
tx_buff[4] = 0xF8;// 0b11111000;
tx_buff[4] = 0xF8; // 0b11111000;
while (TRUE) {
chThdSleepMilliseconds(10);
@ -82,7 +83,12 @@ static msg_t ivThread(int param) {
#endif
}
EXTERN_ENGINE
;
void initHip9011(void) {
if (!boardConfiguration->isHip9011Enabled)
return;
initLogging(&logger, "HIP driver");
print("Starting HIP9011/TPIC8101 driver\r\n");

View File

@ -292,7 +292,7 @@ SPIDriver * getSpiDevice(spi_device_e spiDevice) {
}
#endif
#if STM32_SPI_USE_SPI2 || defined(__DOXYGEN__)
if (spiDevic e== SPI_DEVICE_2) {
if (spiDevice == SPI_DEVICE_2) {
return &SPID2;
}
#endif

View File

@ -265,5 +265,5 @@ int getRusEfiVersion(void) {
return 1; // this is here to make the compiler happy about the unused array
if (UNUSED_CCM_SIZE == 0)
return 1; // this is here to make the compiler happy about the unused array
return 20141204;
return 20141205;
}