//***************************************************************************** // // This function will write a block to a device opened by the // USBDMSCStorageOpen() call. // // /param pvDrive is the pointer that was returned from a call to // USBDMSCStorageOpen(). // /param pucData is the buffer that data will be used for writing. // /param ulNumBlocks is the number of blocks to write. // // This function is use to write blocks to a physical device from the buffer // pointed to by the /e pucData buffer. If the number of blocks is greater than // one then the block address will increment and write to the next block until // /e ulNumBlocks * Block Size bytes have been written. // // /return Returns the number of bytes that were written to the device. // //***************************************************************************** unsigned int USBDMSCStorageWrite(void * pvDrive, unsigned char *pucData, unsigned int ulSector, unsigned int ulNumBlocks) { //ASSERT(pvDrive != 0); //disk_write(ulSector, pucData, ulNumBlocks); unsigned int status = CPUIntStatus(); CPUirqe(); if(drv_rw_func.drv_w_func) drv_rw_func.drv_w_func(drv_rw_func.DriveStruct, pucData, ulSector, ulNumBlocks); if(status & 0x80) CPUirqd(); return(ulNumBlocks * 512); }
/** * \brief Returns the status of the interrupts FIQ and IRQ. * * \param None * * \return Status of interrupt as in CPSR. * * Note: This function call shall be done only in previleged mode of ARM **/ unsigned int IntMasterStatusGet(void) { return CPUIntStatus(); }