When using a SEEED XAIO SAMD21, the "2's complement" of a 16-bit integer (i.e., negative number) is not working correctly. The sample code below works for a 32-bit long, but only works properly for a 16-bit integer on a NANO, but not the XAIO. I suspect the XIAO is not handling integers correctly. Ultimately I need to send negative numbers over I2C thus the desire to use 2's complement.
long longData = 0xFFFFFFFF; // intention is this means -1
Serial.println(longData); // prints -1 on XIAO and NANO; Good!
int intData = 0xFFFF; // intention is this means -1
Serial.println(intData); // prints -1 on NANO, but 65535 on XAIO; Bad!
The fact that the XAIO prints 65535 for the integer example above is problematic since integers are defined as -32768 to 32767. I also suspect (maybe?) I should explicitly include a library that makes the XAIO handle integers like the NANO?