wideband/firmware/fault.cpp

27 lines
412 B
C++
Raw Normal View History

#include "wideband_config.h"
2020-12-10 18:32:41 -08:00
#include "fault.h"
2022-01-01 21:10:55 -08:00
using namespace wbo;
static Fault currentFault[AFR_CHANNELS];
2020-12-10 18:32:41 -08:00
void SetFault(int ch, Fault fault)
2020-12-10 18:32:41 -08:00
{
currentFault[ch] = fault;
2020-12-10 18:32:41 -08:00
}
Fault GetCurrentFault(int ch)
2020-12-10 18:32:41 -08:00
{
return currentFault[ch];
2020-12-10 18:32:41 -08:00
}
bool HasFault()
2020-12-10 18:32:41 -08:00
{
bool fault = false;
for (int ch = 0; ch < AFR_CHANNELS; ch++)
fault |= (GetCurrentFault(ch) != Fault::None);
return fault;
2020-12-10 18:32:41 -08:00
}