2022-09-06 16:53:11 -07:00
|
|
|
#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;
|
|
|
|
|
2022-09-06 16:53:11 -07:00
|
|
|
static Fault currentFault[AFR_CHANNELS];
|
2020-12-10 18:32:41 -08:00
|
|
|
|
2022-08-29 17:19:30 -07:00
|
|
|
void SetFault(int ch, Fault fault)
|
2020-12-10 18:32:41 -08:00
|
|
|
{
|
2022-09-06 16:53:11 -07:00
|
|
|
currentFault[ch] = fault;
|
2020-12-10 18:32:41 -08:00
|
|
|
}
|
|
|
|
|
2022-09-06 16:53:11 -07:00
|
|
|
Fault GetCurrentFault(int ch)
|
2020-12-10 18:32:41 -08:00
|
|
|
{
|
2022-09-06 16:53:11 -07:00
|
|
|
return currentFault[ch];
|
2020-12-10 18:32:41 -08:00
|
|
|
}
|
|
|
|
|
2022-09-06 16:53:11 -07:00
|
|
|
bool HasFault()
|
2020-12-10 18:32:41 -08:00
|
|
|
{
|
2022-09-06 16:53:11 -07: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
|
|
|
}
|