#define ADDR 0x50
OK
#define ADDR 0xD0
Fehler: warning: large integer implicitly truncated to unsigned type
1 | I2C_FORMAT_7_BIT_ADDRESS(SlaveAddress, ADDR, I2C_WRITE);
|
Nun gut 0x50 ist irgendwas kleineres hingegen 0xD0 setzt das 7. Bit und
somit ein sign bit.
Wie ist hier der korrekte Weg damit es nicht zu dieser Warnung kommt?
0xD0u habe ich bereits probiert :-)
1 | typedef union
|
2 | {
|
3 | // Access to the 8-bit format with the 7-bit address and the read/write
|
4 | // direction defined.
|
5 | UINT8 byte;
|
6 |
|
7 | struct
|
8 | {
|
9 | // The read/write bit of the I2C address.
|
10 | UINT8 rw : 1;
|
11 |
|
12 | // The 7-bit slave address.
|
13 | UINT8 address : 7;
|
14 | };
|
15 |
|
16 | } I2C_7_BIT_ADDRESS;
|