Example #1
0
/*---------------------------------------------------------------------------*/
static void MMCSDXferSetup(mmcsdCtrlInfo *ctrl, unsigned char rwFlag, void *ptr,
                             unsigned int blkSize, unsigned int nBlks)
{
#if defined(DEBUG)
//  UARTprintf("%s(ctrl=%p,rwFlag=%d,ptr=%p,blkSize=%d,nBlks=%d)\r\n", __FUNCTION__,
//             ctrl, rwFlag, ptr, blkSize, nBlks);
	syslog(LOG_ERROR, "%s(ctrl=%p,rwFlag=%d,ptr=%p,blkSize=%d,", __FUNCTION__, ctrl, rwFlag, ptr, blkSize);
	syslog(LOG_ERROR, "    nBlks=%d)", nBlks);
#endif

#if defined(DEBUG) && 0
	syslog(LOG_ERROR, "%s(): clr_flg(MMCSD_ISR_FLGPTN_XFERCOMP | MMCSD_ISR_FLGPTN_DATATIMEOUT | MMCSD_ISR_FLGPTN_DATACRCERR | MMCSD_ISR_FLGPTN_DMACOMP)", __FUNCTION__);
#endif
	ER ercd = clr_flg(MMCSD_ISR_FLG, ~(MMCSD_ISR_FLGPTN_XFERCOMP | MMCSD_ISR_FLGPTN_DATATIMEOUT | MMCSD_ISR_FLGPTN_DATACRCERR | MMCSD_ISR_FLGPTN_DMACOMP));
	assert(ercd == E_OK);
//  dmaIsRunning = 1;
//  xferCompFlag = 0;
//  dataTimeout  = 0;
//  dataCRCError = 0;

  if (rwFlag == 1)
  {
    MMCSDRxDmaConfig(ptr, blkSize, nBlks);
  }
  else
  {
    MMCSDTxDmaConfig(ptr, blkSize, nBlks);
  }

  ctrl->dmaEnable = 1;

  MMCSDBlkLenSet(ctrl->memBase, blkSize);
}
Example #2
0
/*---------------------------------------------------------------------------*/
static void MMCSDXferSetup(mmcsdCtrlInfo *ctrl, unsigned char rwFlag, void *ptr,
                             unsigned int blkSize, unsigned int nBlks)
{
#if defined(DEBUG)
//  UARTprintf("%s(ctrl=%p,rwFlag=%d,ptr=%p,blkSize=%d,nBlks=%d)\r\n", __FUNCTION__,
//             ctrl, rwFlag, ptr, blkSize, nBlks);
	syslog(LOG_ERROR, "%s(ctrl=%p,rwFlag=%d,ptr=%p,blkSize=%d,", __FUNCTION__, ctrl, rwFlag, ptr, blkSize);
	syslog(LOG_ERROR, "    nBlks=%d)", nBlks);
#endif

  dmaIsRunning = 1;
  xferCompFlag = 0;
  dataTimeout  = 0;
  dataCRCError = 0;
  shadow_mmcst0 = 0;

  if (rwFlag == 1)
  {
    MMCSDRxDmaConfig(ptr, blkSize, nBlks);
  }
  else
  {
    MMCSDTxDmaConfig(ptr, blkSize, nBlks);
  }

  ctrl->dmaEnable = 1;

  MMCSDBlkLenSet(ctrl->memBase, blkSize);
}