adafruit/Adafruit_nRF8001 — pull request #8 by PaulStoffregen (2014-11-14 05:27:46+00:00)
Title: Fixes for 32 bit ARM compatibility

These changes fix problems on 32 bit ARM. I tested with Teensy 3.1, Arduino Uno, and Teensy 2.0. One customer also verified it works. :-)

The packed attribute is needed on all the event structs. The library collects incoming bytes into a buffer, then casts a pointer to the buffer to these structs. On 8 bit AVR, all structs are automatically packed, so this has no effect on AVR. On 32 bit platforms, the compiler defaults to aligning 16 and 32 bit data types to 2 and 4 byte boundaries. The packed attribute is needed to make the code work the same as AVR.

The other minor change is 2 delays added. They're only compiled for ARM chips. I didn't want to take any chance of altering how the library works on AVR.