mirror of https://github.com/rusefi/rusefi.git
only: more hellen power management
This commit is contained in:
parent
a6c112144f
commit
644cba8d55
|
@ -45,8 +45,6 @@ void onBoardStandBy() {
|
||||||
hellenBoardStandBy();
|
hellenBoardStandBy();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
void setBoardConfigOverrides() {
|
void setBoardConfigOverrides() {
|
||||||
setHellenMegaEnPin();
|
setHellenMegaEnPin();
|
||||||
setHellenVbatt();
|
setHellenVbatt();
|
||||||
|
|
|
@ -43,12 +43,20 @@ void setHellen64Can() {
|
||||||
|
|
||||||
static OutputPin megaEn;
|
static OutputPin megaEn;
|
||||||
|
|
||||||
|
void hellenEnableEn() {
|
||||||
|
megaEn.setValue(1);
|
||||||
|
}
|
||||||
|
|
||||||
|
void hellenDisableEn() {
|
||||||
|
megaEn.setValue(0);
|
||||||
|
}
|
||||||
|
|
||||||
void setHellenEnPin(Gpio pin) {
|
void setHellenEnPin(Gpio pin) {
|
||||||
static bool initialized = false;
|
static bool initialized = false;
|
||||||
if (!initialized) {
|
if (!initialized) {
|
||||||
initialized = true;
|
initialized = true;
|
||||||
megaEn.initPin("EN", pin);
|
megaEn.initPin("EN", pin);
|
||||||
megaEn.setValue(1);
|
hellenEnableEn();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -63,7 +71,7 @@ void setHellen64MegaEnPin() {
|
||||||
|
|
||||||
void hellenBoardStandBy() {
|
void hellenBoardStandBy() {
|
||||||
// we need to turn 'megaEn' and pause for a bit to make sure that WBO is off and does not wake main firmware right away
|
// we need to turn 'megaEn' and pause for a bit to make sure that WBO is off and does not wake main firmware right away
|
||||||
megaEn.setValue(0);
|
hellenDisableEn();
|
||||||
// todo: 200ms is totally random what's the science for this sleep duration?
|
// todo: 200ms is totally random what's the science for this sleep duration?
|
||||||
chThdSleepMilliseconds(200);
|
chThdSleepMilliseconds(200);
|
||||||
}
|
}
|
||||||
|
|
|
@ -16,6 +16,9 @@ void hellenWbo();
|
||||||
void setHellenMegaEnPin();
|
void setHellenMegaEnPin();
|
||||||
void setHellenEnPin(Gpio pin);
|
void setHellenEnPin(Gpio pin);
|
||||||
void setHellen64MegaEnPin();
|
void setHellen64MegaEnPin();
|
||||||
|
void hellenEnableEn();
|
||||||
|
void hellenDisableEn();
|
||||||
|
|
||||||
void hellenBoardStandBy();
|
void hellenBoardStandBy();
|
||||||
void hellenMegaAccelerometerPreInitCS2Pin();
|
void hellenMegaAccelerometerPreInitCS2Pin();
|
||||||
void configureHellenCanTerminator();
|
void configureHellenCanTerminator();
|
||||||
|
|
Loading…
Reference in New Issue