/* Checks if a bus off or bus heavy situation occurred.  */
static bool CanUsbIsBusError(void)
/* Checks if a bus off or bus heavy situation occurred.  */
static bool CanUsbIsBusError(void)
{
  bool result = false;
  int32_t status;
  if (canUsbCanHandle != 0)
  {
    status = CanUsbLibFuncStatus(canUsbCanHandle);
    if ((status & CANSTATUS_BUS_ERROR) != 0)
    {
      result = true;
      (void)CanUsbCloseChannel();
      (void)CanUsbOpenChannel();
    }
  }
  return result;
}