public inbox for ecos-discuss@sourceware.org
 help / color / mirror / Atom feed
From: Carlos Perilla <transfers@phaber.com>
To: ecos <ecos-discuss@sources.redhat.com>
Subject: [ECOS] eb40a Interrupt, TC
Date: Tue, 21 Oct 2003 18:07:00 -0000	[thread overview]
Message-ID: <3F9575D1.6030509@phaber.com> (raw)

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

             reply	other threads:[~2003-10-21 18:07 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-10-21 18:07 Carlos Perilla [this message]
2003-10-23 14:34 ` Nick Garnett

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3F9575D1.6030509@phaber.com \
    --to=transfers@phaber.com \
    --cc=ecos-discuss@sources.redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).