mirror of https://github.com/rusefi/wideband.git
fault: keep fault state for each AFR channel (#139)
Co-authored-by: Andrey Gusakov <dron0gus@gmail.com>
This commit is contained in:
parent
268f8ddae7
commit
1647a944cf
|
@ -1,20 +1,26 @@
|
|||
#include "wideband_config.h"
|
||||
#include "fault.h"
|
||||
|
||||
using namespace wbo;
|
||||
|
||||
static Fault currentFault = Fault::None;
|
||||
static Fault currentFault[AFR_CHANNELS];
|
||||
|
||||
void SetFault(int ch, Fault fault)
|
||||
{
|
||||
currentFault = fault;
|
||||
}
|
||||
|
||||
bool HasFault()
|
||||
{
|
||||
return currentFault != Fault::None;
|
||||
currentFault[ch] = fault;
|
||||
}
|
||||
|
||||
Fault GetCurrentFault(int ch)
|
||||
{
|
||||
return currentFault;
|
||||
return currentFault[ch];
|
||||
}
|
||||
|
||||
bool HasFault()
|
||||
{
|
||||
bool fault = false;
|
||||
|
||||
for (int ch = 0; ch < AFR_CHANNELS; ch++)
|
||||
fault |= (GetCurrentFault(ch) != Fault::None);
|
||||
|
||||
return fault;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue