/* Set peer UART flow control state. Pause/resume transmit accordingly. Only for manual software flow control.  */
Ecode_t UARTDRV_FlowControlSetPeerStatus(UARTDRV_Handle_t handle, UARTDRV_FlowControlState_t state)
/* Set peer UART flow control state. Pause/resume transmit accordingly. Only for manual software flow control.  */
Ecode_t UARTDRV_FlowControlSetPeerStatus(UARTDRV_Handle_t handle, UARTDRV_FlowControlState_t state)
{
  if ( (handle->fcType != uartdrvFlowControlSw) ||
       (state == uartdrvFlowControlAuto) )
  {
    return ECODE_EMDRV_UARTDRV_ILLEGAL_OPERATION;
  }
  if (handle->fcPeerState != state)
  {
    handle->fcPeerState = state;
    if (state == uartdrvFlowControlOn)
    {
      UARTDRV_ResumeTransmit(handle);
    }
    else if (state == uartdrvFlowControlOff)
    {
      UARTDRV_PauseTransmit(handle);
    }
  }
  return ECODE_EMDRV_UARTDRV_OK;
}