Browse Source

Fix gd25120c rd_uid command

Alex Voinea 3 years ago
parent
commit
07bf4bbe48
1 changed files with 2 additions and 2 deletions
  1. 2 2
      Firmware/xflash.c

+ 2 - 2
Firmware/xflash.c

@@ -159,8 +159,8 @@ void xflash_rd_uid(uint8_t* uid)
 	_CS_LOW();
 	_SPI_TX(_CMD_RD_UID);                // send command 0x4b
 	uint8_t cnt = 4;                     // 4 dummy bytes
-	while (cnt--)                        // receive dummy bytes
-		_SPI_RX();
+	while (cnt--)                        // transmit dummy bytes
+		_SPI_TX(0x00);
 	cnt = 8;                             // 8 bytes UID
 	while (cnt--)                        // receive UID
 		uid[7 - cnt] = _SPI_RX();