only:accelerometer refactoring & docs
This commit is contained in:
parent
9369776eb7
commit
30c903e9ca
|
@ -89,7 +89,7 @@ void setBoardConfigOverrides() {
|
|||
// rev.D uses SPI1 pins for CAN2, but rev.E and later uses mega-module meaning SPI1 for SD-card
|
||||
if (isMegaModuleRevision()) {
|
||||
setHellenSdCardSpi1();
|
||||
configureHellenMegaAccCS2Pin();
|
||||
hellenMegaAccelerometerPreInitCS2Pin();
|
||||
setHellenMegaEnPin();
|
||||
} else {
|
||||
setHellenEnPin(Gpio::H144_OUT_IO3);
|
||||
|
|
|
@ -138,7 +138,7 @@ void setBoardConfigOverrides() {
|
|||
setHellenMegaEnPin();
|
||||
// rev G and newer uses hellen mega-module
|
||||
setHellenSdCardSpi1();
|
||||
configureHellenMegaAccCS2Pin();
|
||||
hellenMegaAccelerometerPreInitCS2Pin();
|
||||
}
|
||||
|
||||
setDefaultHellenAtPullUps();
|
||||
|
|
|
@ -48,7 +48,7 @@ void setBoardConfigOverrides() {
|
|||
setHellenVbatt();
|
||||
|
||||
setHellenSdCardSpi1();
|
||||
configureHellenMegaAccCS2Pin();
|
||||
hellenMegaAccelerometerPreInitCS2Pin();
|
||||
configureHellenCanTerminator();
|
||||
setHellenCan();
|
||||
|
||||
|
|
|
@ -52,7 +52,7 @@ void setBoardConfigOverrides() {
|
|||
setHellenVbatt();
|
||||
|
||||
setHellenSdCardSpi1();
|
||||
configureHellenMegaAccCS2Pin();
|
||||
hellenMegaAccelerometerPreInitCS2Pin();
|
||||
configureHellenCanTerminator();
|
||||
|
||||
setDefaultHellenAtPullUps();
|
||||
|
|
|
@ -57,9 +57,14 @@ void hellenBoardStandBy() {
|
|||
}
|
||||
|
||||
/**
|
||||
* dirty hack
|
||||
* We need to make sure that accelerometer device which physically exists does not conflict with SD card
|
||||
* in case of shared SPI.
|
||||
* We reply on specific order of execution here:
|
||||
* 1) accelerometer pre-initialization into safe CS pin state
|
||||
* 2) SD card initialization
|
||||
* 3) accelerometer main initialization if accelerometer feature is desired
|
||||
*/
|
||||
void configureHellenMegaAccCS2Pin() {
|
||||
void hellenMegaAccelerometerPreInitCS2Pin() {
|
||||
static bool initialized = false;
|
||||
static OutputPin cs2pin;
|
||||
if (!initialized) {
|
||||
|
|
|
@ -54,7 +54,7 @@ void setBoardConfigOverrides() {
|
|||
setHellenVbatt();
|
||||
|
||||
setHellenSdCardSpi1();
|
||||
configureHellenMegaAccCS2Pin();
|
||||
hellenMegaAccelerometerPreInitCS2Pin();
|
||||
|
||||
engineConfiguration->vrThreshold[0].pin = Gpio::MM100_OUT_PWM6;
|
||||
|
||||
|
|
|
@ -17,7 +17,7 @@ void setHellenMegaEnPin();
|
|||
void setHellenEnPin(Gpio pin);
|
||||
void setHellen64MegaEnPin();
|
||||
void hellenBoardStandBy();
|
||||
void configureHellenMegaAccCS2Pin();
|
||||
void hellenMegaAccelerometerPreInitCS2Pin();
|
||||
void configureHellenCanTerminator();
|
||||
|
||||
void setHellenCan();
|
||||
|
|
|
@ -223,7 +223,7 @@ void initAccelerometer() {
|
|||
return;
|
||||
}
|
||||
|
||||
/* Commented until we have configureHellenMegaAccCS2Pin() */
|
||||
/* Commented until we have hellenMegaAccelerometerPreInitCS2Pin() */
|
||||
#ifndef HW_HELLEN
|
||||
chipSelect.initPin("SPI Acc", engineConfiguration->accelerometerCsPin);
|
||||
#endif
|
||||
|
|
Loading…
Reference in New Issue