/** * * This is the Error handler callback function and this function increments the * the error counter so that the main thread knows the number of errors. * * @param InstancePtr is a pointer to Instance of AXI FIFO device. * * @param Pending is a bitmask of the pending interrupts. * * @return None. * * @note None. * ******************************************************************************/ static void FifoErrorHandler(XLlFifo *InstancePtr, u32 Pending) { if (Pending & XLLF_INT_RPURE_MASK) { XLlFifo_RxReset(InstancePtr); } else if (Pending & XLLF_INT_RPORE_MASK) { XLlFifo_RxReset(InstancePtr); } else if(Pending & XLLF_INT_RPUE_MASK) { XLlFifo_RxReset(InstancePtr); } else if (Pending & XLLF_INT_TPOE_MASK) { XLlFifo_TxReset(InstancePtr); } else if (Pending & XLLF_INT_TSE_MASK) { } Error++; }
static void fifo_error_handler(xaxiemacif_s *xaxiemacif, u32_t pending_intr) { XLlFifo *llfifo = &xaxiemacif->axififo; if (pending_intr & XLLF_INT_RPURE_MASK) { print("llfifo: Rx under-read error"); } if (pending_intr & XLLF_INT_RPORE_MASK) { print("llfifo: Rx over-read error"); } if (pending_intr & XLLF_INT_RPUE_MASK) { print("llfifo: Rx fifo empty"); } if (pending_intr & XLLF_INT_TPOE_MASK) { print("llfifo: Tx fifo overrun"); } if (pending_intr & XLLF_INT_TSE_MASK) { print("llfifo: Tx length mismatch"); } /* Reset the tx or rx side of the fifo as needed */ if (pending_intr & XLLF_INT_RXERROR_MASK) { XLlFifo_IntClear(llfifo, XLLF_INT_RRC_MASK); XLlFifo_RxReset(llfifo); } if (pending_intr & XLLF_INT_TXERROR_MASK) { XLlFifo_IntClear(llfifo, XLLF_INT_TRC_MASK); XLlFifo_TxReset(llfifo); } }