Remove unused big-endian conversion and update little-endian handling in main.c

This commit is contained in:
2025-05-18 13:40:53 +02:00
parent b308f80a11
commit 9676a8de3f
3 changed files with 2 additions and 4 deletions
-4
View File
@@ -153,11 +153,7 @@ int main(void)
printf("%02x ", buff[i]);
}
printf("\r\n");
// Převod načtených 4 bajtů z bloku (např. buff[0]..buff[3]) na 32bitové číslo (big-endian)
uint32_t value = (buff[0] << 24) | (buff[1] << 16) | (buff[2] << 8) | buff[3];
printf("Cislo z bloku (big-endian): %lu\r\n", value);
// Pokud je číslo v little-endian (často u Mifare), použij:
uint32_t value_le = (buff[3] << 24) | (buff[2] << 16) | (buff[1] << 8) | buff[0];
printf("Cislo z bloku (little-endian): %lu\r\n", value_le);
while (PN532_ReadPassiveTarget(&pn532, uid, PN532_MIFARE_ISO14443A, 100) != PN532_STATUS_ERROR)
Binary file not shown.
+2
View File
@@ -57,3 +57,5 @@
69 122 1747565636652999025 LightTAM_RFID_Reader.elf c8e9f02884fc4525
1 70 1747565924660429326 CMakeFiles/LightTAM_RFID_Reader.dir/Core/Src/main.c.obj c2dc3f2732657e0d
70 121 1747565924709764097 LightTAM_RFID_Reader.elf c8e9f02884fc4525
1 68 1747567554030959967 CMakeFiles/LightTAM_RFID_Reader.dir/Core/Src/main.c.obj c2dc3f2732657e0d
68 118 1747567554080514089 LightTAM_RFID_Reader.elf c8e9f02884fc4525