This is the mail archive of the ecos-discuss@sourceware.cygnus.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]

USB program for EDB7212 developpement board !


Good morning,

I 'm developing on a cirrus EDB7212 board and can't found a USB sample, the
only that I have is the cirrus USB sample, but don't work
under eCos (interrupt captured with vsr).

my problem is, the ISR and DSR aren't called anyway.

can any one help me to found USB interrupt routine or as any writing one !!!

many thanks
best regards

I have writing a little program for capturing the USB interrupt like this,
but don't work, why ? :

static cyg_interrupt USB_interrupt;
static cyg_handle_t  USB_interrupt_handle;
static cyg_sem_t  USB_sem;


static int USB_isr(cyg_vector_t vector, cyg_addrword_t data,
HAL_SavedRegisters *regs)
{
 cyg_interrupt_acknowledge(CYGNUM_HAL_INTERRUPT_EINT1);
 return CYG_ISR_CALL_DSR;
}


static void USB_dsr(cyg_vector_t vector, cyg_ucount32 count, cyg_addrword_t
data)
{
 cyg_semaphore_post(&USB_sem);
}


int main( int argc, char *argv[] )
{
 lcd_on(4);
 lcd_clear();

 int i=0;

 cyg_interrupt_create(CYGNUM_HAL_INTERRUPT_EINT1,
   0,    // Priority - what goes here?
   0,    //  Data item passed to interrupt handler
   (cyg_ISR_t *)USB_isr,
   (cyg_DSR_t *)USB_dsr,
   &USB_interrupt_handle,
   &USB_interrupt);

 cyg_semaphore_init(&USB_sem, 0);

 cyg_interrupt_attach(USB_interrupt_handle);

 //
 // Enable the interrupts for the bulk endpoints.
 //

 USBWriteCommand(USB_COMMAND_SET_DMA);
 USBWriteData(USB_DMA_ENDP4_INT_ENABLE | USB_DMA_ENDP5_INT_ENABLE);

 //
 // Configure the PDIUSBD12 and enable the SoftConnect pull-up.
 //
 USBWriteCommand(USB_COMMAND_SET_MODE);
 USBWriteData(USB_CONFIG1_NO_LAZY_CLOCK | USB_CONFIG1_CLOCK_RUNNING |
                 USB_CONFIG1_SOFT_CONNECT);
 USBWriteData(USB_CONFIG2_SET_TO_ONE | USB_CONFIG2_CLOCK_4M);

 while ( TRUE ) {
  cyg_semaphore_wait(&USB_sem);
  lcd_printf("%d ",i++);
 }
 return 0;
}




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