This commit is contained in:
parent
8a0e0ff1b3
commit
52544462ec
|
@ -43,6 +43,8 @@
|
|||
#include "HIP9011.h"
|
||||
#endif
|
||||
|
||||
#include "mems.h"
|
||||
|
||||
#include "custom_engine.h"
|
||||
#include "engine_template.h"
|
||||
#include "acura_rsx.h"
|
||||
|
@ -933,6 +935,11 @@ void setDefaultConfiguration(DECLARE_ENGINE_PARAMETER_SIGNATURE) {
|
|||
boardConfiguration->spi1misoPin = GPIOB_4;
|
||||
boardConfiguration->spi1sckPin = GPIOB_3; // please note that this pin is also SWO/SWD - Single Wire debug Output
|
||||
|
||||
#if EFI_MEMS || defined(__DOXYGEN__)
|
||||
// this would override some values from above
|
||||
initMemsPins(PASS_ENGINE_PARAMETER_SIGNATURE);
|
||||
#endif
|
||||
|
||||
boardConfiguration->spi2mosiPin = GPIOB_15;
|
||||
boardConfiguration->spi2misoPin = GPIOB_14;
|
||||
boardConfiguration->spi2sckPin = GPIOB_13;
|
||||
|
|
|
@ -15,6 +15,7 @@
|
|||
|
||||
#include "mems.h"
|
||||
#include "lis302dl.h"
|
||||
#include "hardware.h"
|
||||
|
||||
EXTERN_ENGINE;
|
||||
|
||||
|
@ -26,11 +27,16 @@ void initMemsPins(DECLARE_ENGINE_PARAMETER_SIGNATURE) {
|
|||
#if EFI_MEMS || defined(__DOXYGEN__)
|
||||
|
||||
static SPIDriver *spip = &SPID1; // todo: make this configurable
|
||||
static spi_device_e device = SPI_DEVICE_1;
|
||||
static OutputPin memsCs;
|
||||
|
||||
void initMems(DECLARE_ENGINE_PARAMETER_SIGNATURE) {
|
||||
if (engineConfiguration->LIS302DLCsPin == GPIOA_0)
|
||||
return; // temporary code to handle old configurations
|
||||
if (engineConfiguration->LIS302DLCsPin == GPIO_UNASSIGNED)
|
||||
return; // not used
|
||||
|
||||
engineConfiguration->LIS302DLCsPin = GPIOE_3; // temporary code
|
||||
turnOnSpi(device);
|
||||
|
||||
memsCs.initPin("LIS302 CS", engineConfiguration->LIS302DLCsPin);
|
||||
|
||||
|
|
Loading…
Reference in New Issue