/* Checks if a bus off or bus heavy situation occurred.  */
static bool LeafLightIsBusError(void)
/* Checks if a bus off or bus heavy situation occurred.  */
static bool LeafLightIsBusError(void)
{
  bool result = false;
  uint32_t statusFlags;
  if (leafLightCanHandle >= 0)
  {
    if (LeafLightLibFuncReadStatus(leafLightCanHandle, &statusFlags) == canOK)
    {
      if ((statusFlags & (canSTAT_BUS_OFF | canSTAT_ERROR_PASSIVE)) != 0)
      {
        result = true;
      }
    }
  }
  return result;
}