+\r
+// Mifare Memory Structure: up to 32 Sectors with 4 blocks each (1k and 2k cards),\r
+// plus evtl. 8 sectors with 16 blocks each (4k cards)\r
+uint8_t NumBlocksPerSector(uint8_t sectorNo) \r
+{\r
+ if (sectorNo < 32) \r
+ return 4;\r
+ else\r
+ return 16;\r
+}\r
+\r
+uint8_t FirstBlockOfSector(uint8_t sectorNo) \r
+{\r
+ if (sectorNo < 32)\r
+ return sectorNo * 4;\r
+ else\r
+ return 32*4 + (sectorNo - 32) * 16;\r
+ \r
+}\r
+\r
+\r