瀏覽代碼

Use 0xFF (not 'ff') for byte transfer

Scott Lahteine 4 年之前
父節點
當前提交
f72c559824
共有 2 個文件被更改,包括 4 次插入6 次删除
  1. 2
    2
      Marlin/src/HAL/STM32F1/HAL_SPI.cpp
  2. 2
    4
      Marlin/src/libs/W25Qxx.cpp

+ 2
- 2
Marlin/src/HAL/STM32F1/HAL_SPI.cpp 查看文件

@@ -110,7 +110,7 @@ void spiInit(uint8_t spiRate) {
110 110
  * @details
111 111
  */
112 112
 uint8_t spiRec() {
113
-  uint8_t returnByte = SPI.transfer(ff);
113
+  uint8_t returnByte = SPI.transfer(0xFF);
114 114
   return returnByte;
115 115
 }
116 116
 
@@ -154,7 +154,7 @@ void spiSendBlock(uint8_t token, const uint8_t* buf) {
154 154
 #if ENABLED(SPI_EEPROM)
155 155
 
156 156
 // Read single byte from specified SPI channel
157
-uint8_t spiRec(uint32_t chan) { return SPI.transfer(ff); }
157
+uint8_t spiRec(uint32_t chan) { return SPI.transfer(0xFF); }
158 158
 
159 159
 // Write single byte to specified SPI channel
160 160
 void spiSend(uint32_t chan, byte b) { SPI.send(b); }

+ 2
- 4
Marlin/src/libs/W25Qxx.cpp 查看文件

@@ -80,16 +80,14 @@ void W25QXXFlash::init(uint8_t spiRate) {
80 80
  * @brief  Receive a single byte from the SPI port.
81 81
  *
82 82
  * @return Byte received
83
- *
84
- * @details
85 83
  */
86 84
 uint8_t W25QXXFlash::spi_flash_Rec() {
87
-  uint8_t returnByte = SPI.transfer(ff);
85
+  const uint8_t returnByte = SPI.transfer(0xFF);
88 86
   return returnByte;
89 87
 }
90 88
 
91 89
 uint8_t W25QXXFlash::spi_flash_read_write_byte(uint8_t data) {
92
-  uint8_t returnByte = SPI.transfer(data);
90
+  const uint8_t returnByte = SPI.transfer(data);
93 91
   return returnByte;
94 92
 }
95 93
 

Loading…
取消
儲存