This is the mail archive of the ecos-discuss@sources.redhat.com mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Problem about installing the eCOS interrupt handler


Hi all:
   I am using ARME7T board at the moment. I have tried to install external
INT0 in eCOS program but I encounter some strange problem so could anybody
have a look of it for me? Thank you very much! Following are the source
code:


// external IRQ0 handler
cyg_uint32 EXT_IRQ0_handler(cyg_vector_t vector, cyg_addrword_t data)
{
	// do something

	cyg_interrupt_acknowledge(vector);
	return CYG_ISR_HANDLED;
}

// main function
void cyg_user_start(void)
{
	cyg_handle_t ext_IRQ0_H;
	cyg_interrupt intr;

	// value for storing
	unsigned long cpuval;

	cyg_interrupt_enable();
	cpuval = *IOPMODE;
	cpuval = *IOPCON;
	//  when I check the cpuval it shows 0x00 for *IOPCON ( Step by step in
Insight)


	cyg_interrupt_configure(CYGNUM_HAL_INTERRUPT_EXT0,1,0);
	cpuval = *IOPCON;
	// when I check the cpuval it shows 0x00 for *IOPCON



	// create the interrupt and attach it
	cyg_interrupt_create(CYGNUM_HAL_INTERRUPT_EXT0, 0, 0, &EXT_IRQ0_handler,
                       NULL, &ext_IRQ0_H, &intr);
	cpuval = *IOPCON;
	// when I check the cpuval it shows 0x00 for *IOPCON


	// attach the interrupt
	cyg_interrupt_attach(ext_IRQ0_H);
	cpuval = *IOPMODE;
	cpuval = *IOPCON;
	//  *IOPCON still 0x00

	cyg_interrupt_unmask(CYGNUM_HAL_INTERRUPT_EXT0);
}

each time I call the interrupt setting function the *IOPCON seems to be the
same as before. always 0x00, no change?

Thanks !


Mr Huang Qiang
Postgraduate Student
Room318 B-Block
Department Of Electrical Engineering And Electronics
University Of Liverpool
Brownlow Hill
Liverpool L69,3GJ
UK

Personal website at: http://www.liv.ac.uk/~jameshq


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]