Hallo, eine kurze Frage zu einem Bit-Shift:
1 | uint32_t FirmwareByteAnzahl; |
2 | FirmwareByteAnzahl = (uint8_t)0x80; |
3 | FirmwareByteAnzahl |= ((uint8_t)0x80 << 8) & 0xFF00; |
4 | FirmwareByteAnzahl |= ((uint8_t)0 << 16) & 0xFF0000; |
Ohne die UND Operatoren kommt:
1 | 11111111 11111111 10000000 10000000 |
heraus. Wieso sind die letzten beiden Bytes 0xFF ?