Пример #1
0
int main(void) {

	CPUirqd();

	MmuInit();

	printf("config timer\n");

	IntControllerInit();

	LedInitRegister();
	LedInit2();
	LedInit3();

	TimerConfiguration(Timer_TIMER2, 1000, SchedulerRunNextProcess);

	SchedulerStartProcess(&switchLED2ON);
	SchedulerStartProcess(&switchLED2OFF);
	SchedulerStartProcess(&switchLED3ON);
	SchedulerStartProcess(&switchLED3OFF);

	printf("end config start interrupt\n");
	CPUirqe();

	TimerEnable(Timer_TIMER2);

	while (1) {
		volatile int i = 0;

		for (i = 0; i < 1000000; i++) {
		}
	}
}
Пример #2
0
//*****************************************************************************
//
// 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);
}
Пример #3
0
/**
 * \brief  Enables the processor IRQ only in CPSR. Makes the processor to 
 *         respond to IRQs.  This does not affect the set of interrupts 
 *         enabled/disabled in the AINTC.
 *
 * \param    None
 *
 * \return   None
 *
 *  Note: This function call shall be done only in previleged mode of ARM
 **/
void IntMasterIRQEnable(void)
{
    /* Enable IRQ in CPSR.*/
    CPUirqe();

}