AT90USB1287: checking RWAL bit while reading/writeing packet

1 post / 0 new
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I wonder if it is realy necessary to check the RWAL bit before reading/writeing each byte in a packet?

Say i do the data moving in the endpoint interrupt hander and i know the packet size by reading BYCT (respectively when writeing a packet i know the number of bytes left before reaching the configurated endpoint size), i do, so far, not see any reason why RWAL should be cleared by the USB hardware during packet data moving.

I first thought that i have to wait for RWAL to be set by hardware before reading/writing the next byte but what i have seen in other USB stack implementations is that they do not wait for it to be set in a loop but use it as an additional exit condition for the copy loop (additionally to a variable that counts down the number of available bytes).