fazjaxton/CAN — pull request #1 by kaesees (2012-05-01 10:01:50+00:00)
Title: Modification to CanMessage::send to use the 3 TX buffers we have instead of always using buffer 0

Modifies CanMessage::send to use the 3 TX buffers we have in a round-robin fashion, rather than always using buffer zero. Since the call is non-blocking, if we try to send multiple messages in rapid succession without doing this the second, third etc concurrent requests will fail silently. With this update, we can handle up to 3 concurrent TX requests, and any more than that will fail silently; it might make sense in the future to provide a blocking version of the function that should always succeed.

There might also be an argument for about whether the state (namely, the 'current' buffer) should reside in CanMessage::send() itself or client code (the latter by modifying send() to take an argument for which buffer to use, perhaps defaulting to 0).