浏览代码

Fix gd25120c rd_uid command

Alex Voinea 3 年之前
父节点
当前提交
07bf4bbe48
共有 1 个文件被更改,包括 2 次插入2 次删除
  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();