mirror of https://github.com/FOME-Tech/fome-fw.git
main relay bench test uses a timer
This commit is contained in:
parent
632c493c4f
commit
e6442f06f0
|
@ -406,10 +406,7 @@ todo: move to shutdown_controller.cpp
|
|||
}
|
||||
|
||||
bool Engine::isInMainRelayBench() {
|
||||
if (mainRelayBenchStartNt == 0) {
|
||||
return false;
|
||||
}
|
||||
return (getTimeNowNt() - mainRelayBenchStartNt) < NT_PER_SECOND;
|
||||
return mainRelayBenchTimer.hasElapsedSec(1);
|
||||
}
|
||||
|
||||
bool Engine::isInShutdownMode() const {
|
||||
|
|
|
@ -303,7 +303,7 @@ public:
|
|||
|
||||
|
||||
SensorsState sensors;
|
||||
efitick_t mainRelayBenchStartNt;
|
||||
Timer mainRelayBenchTimer;
|
||||
|
||||
|
||||
void preCalculate();
|
||||
|
|
|
@ -245,9 +245,9 @@ void acRelayBench(void) {
|
|||
pinbench(1000.0, 100.0, 1, enginePins.acRelay);
|
||||
}
|
||||
|
||||
static void mainRelayBench(void) {
|
||||
static void mainRelayBench() {
|
||||
// main relay is usually "ON" via FSIO thus bench testing that one is pretty unusual
|
||||
engine->mainRelayBenchStartNt = getTimeNowNt();
|
||||
engine->mainRelayBenchTimer.reset();
|
||||
}
|
||||
|
||||
static void hpfpValveBench(void) {
|
||||
|
|
Loading…
Reference in New Issue