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

Re: AT91SAM7S USB corruption


There is an error in the rx-endpoint-interrupt-handling:

In the "usbs_at91_endpoint_dsr (cyg_uint8 epn)" replace:

   pep->buffer_size = (cyg_uint32) * ppbegin - (cyg_uint32) pep->buffer;
   if (pep->buffer_size && pep->complete_fn) {
     if (!pep->halted) {
       (*pep->complete_fn) (pep->complete_data, pep->buffer_size);
     } else {
       (*pep->complete_fn) (pep->complete_data, -EAGAIN);
     }
   }
   usbs_at91_endpoint_interrupt_enable (epn, false);

with this:

   pep->buffer_size = (cyg_uint32) * ppbegin - (cyg_uint32) pep->buffer;
     if (!pep->halted) {
       (*pep->complete_fn) (pep->complete_data, pep->buffer_size);
     } else {
       (*pep->complete_fn) (pep->complete_data, -EAGAIN);
     }
   usbs_at91_endpoint_interrupt_enable (epn, false);

I will sometime make a diff...

Regards
Oliver


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


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