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]
Other format: [Raw text]

eb40a Interrupt, TC


Well , finally I got two timers running, with the conf I want, Now I need to capture the interrupts that my configuration is generating, as long as the TC_SR says the events that I have programed had passed but not attended.

I have set the ISR and DSR like this:

cyg_uint32 interrupt_TC1_isr(
              cyg_vector_t vector,
              cyg_addrword_t data) //Based  on eCos book, pag 48
{
 cyg_interrupt_mask(vector);
 cyg_interrupt_acknowledge(vector);
 return(CYG_ISR_HANDLED | CYG_ISR_CALL_DSR);

}
void interrupt_TC1_dsr(
             cyg_vector_t vector,
             cyg_ucount32 count,
             cyg_addrword_t data)
{
 HAL_IO_REGISTER REGISTER;
 cyg_semaphore_post(&TC1_data_ready);
 REGISTER=TC_BASE+TC_CHANNEL1+TC_RA;
 HAL_READ_UINT16(REGISTER,TC1_PERIOD);
 REGISTER=TC_BASE+TC_CHANNEL1+TC_RB;
 HAL_READ_UINT16(REGISTER,TC1_HIGH);
 cyg_interrupt_unmask(vector);
}

And I have created in the CYG_USER_START

cyg_interrupt_enable();
 cyg_interrupt_create(
              intTC1_vector,
              intTC1_priority,
              0,
              &interrupt_TC1_isr,
              &interrupt_TC1_dsr,
              &intTC1_handle,
              &intTC1);
 cyg_interrupt_attach(intTC1_handle);
 cyg_interrupt_unmask(intTC1_vector);

 cyg_semaphore_init(&TC1_data_ready,TC1_data_ready_counter);
 cyg_semaphore_init(&TC1_trans,TC1_trans_counter);
 cyg_semaphore_init(&TC1_end_trans,TC1_ent_trans_counter);

Im using two other threads to capture and transmit the data I get from here, still the Interrupt Isn't captured, and the program keeps waiting for the semaphore signal.

Thanks you all.

Carlos Perilla.



--
Before posting, please read the FAQ: http://sources.redhat.com/fom/ecos
and search the list archive: http://sources.redhat.com/ml/ecos-discuss


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