|
= |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| static Void uartIntrHandler(Uart_ChanObj *chanHandle) |
|
static Void uartIntrHandler(Uart_ChanObj *chanHandle) |
| { |
|
{ |
| UInt32 xfer = 0; |
|
UInt32 xfer = 0; |
| IOM_Packet *ioPacket = NULL; |
|
IOM_Packet *ioPacket = NULL; |
| Uart_Object *instHandle = NULL; |
|
Uart_Object *instHandle = NULL; |
| #ifdef BIOS_PWRM_ENABLE |
|
#ifdef BIOS_PWRM_ENABLE |
| Power_Status status = Power_SOK; |
|
Power_Status status = Power_SOK; |
| UInt32 count = 0x00; |
|
UInt32 count = 0x00; |
| #endif |
|
#endif |
| |
|
|
| assert(NULL != chanHandle); |
|
assert(NULL != chanHandle); |
| instHandle = (Uart_Object*)(chanHandle->devHandle); |
|
instHandle = (Uart_Object*)(chanHandle->devHandle); |
| assert(NULL != instHandle); |
|
assert(NULL != instHandle); |
| |
|
|
| |
|
|
| if (Uart_OpMode_INTERRUPT == instHandle->opMode) |
|
if (Uart_OpMode_INTERRUPT == instHandle->opMode) |
| { |
|
{ |
| EventCombiner_enableEvent(instHandle->deviceInfo.cpuEventNumber); |
|
EventCombiner_enableEvent(instHandle->deviceInfo.cpuEventNumber); |
| } |
|
} |
| |
|
|
| ioPacket = chanHandle->activeIOP; |
|
ioPacket = chanHandle->activeIOP; |
| |
|
|
| if (NULL != ioPacket) |
|
if (NULL != ioPacket) |
| { |
|
{ |
| xfer = uartXfer(chanHandle, |
|
xfer = uartXfer(chanHandle, |
| chanHandle->activeBuf, |
|
chanHandle->activeBuf, |
| chanHandle->bytesRemaining); |
|
chanHandle->bytesRemaining); |
| |
|
|
| chanHandle->bytesRemaining -= xfer; |
|
chanHandle->bytesRemaining -= xfer; |
| chanHandle->activeBuf += xfer; |
|
chanHandle->activeBuf += xfer; |
| |
|
|
| if (Uart_INPUT == chanHandle->mode) |
|
if (Uart_INPUT == chanHandle->mode) |
| { |
|
{ |
| instHandle->stats.rxBytes += xfer; |
|
instHandle->stats.rxBytes += xfer; |
| |
|
|
|
|
|
|
|
|
| |
-+ |
if (0 != chanHandle->bytesRemaining) |
| |
|
{ |
| uartIntrEnable(instHandle, (UInt32)Uart_Intr_RHR); |
= |
uartIntrEnable(instHandle, (UInt32)Uart_Intr_RHR); |
| |
-+ |
} |
| } |
= |
} |
| else |
|
else |
| { |
|
{ |
| instHandle->stats.txBytes += xfer; |
|
instHandle->stats.txBytes += xfer; |
| |
|
|
|
|
|
|
|
|
| |
-+ |
if (0 != chanHandle->bytesRemaining) |
| |
|
{ |
| uartIntrEnable(instHandle, (UInt32)Uart_Intr_THR); |
= |
uartIntrEnable(instHandle, (UInt32)Uart_Intr_THR); |
| |
-+ |
} |
| } |
= |
} |
| |
|
|
|
|
|
| |
|
|
| } |
|
} |