Browse Source

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

Scott Lahteine 4 years ago
parent
commit
f72c559824
2 changed files with 4 additions and 6 deletions
  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 View File

110
  * @details
110
  * @details
111
  */
111
  */
112
 uint8_t spiRec() {
112
 uint8_t spiRec() {
113
-  uint8_t returnByte = SPI.transfer(ff);
113
+  uint8_t returnByte = SPI.transfer(0xFF);
114
   return returnByte;
114
   return returnByte;
115
 }
115
 }
116
 
116
 
154
 #if ENABLED(SPI_EEPROM)
154
 #if ENABLED(SPI_EEPROM)
155
 
155
 
156
 // Read single byte from specified SPI channel
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
 // Write single byte to specified SPI channel
159
 // Write single byte to specified SPI channel
160
 void spiSend(uint32_t chan, byte b) { SPI.send(b); }
160
 void spiSend(uint32_t chan, byte b) { SPI.send(b); }

+ 2
- 4
Marlin/src/libs/W25Qxx.cpp View File

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

Loading…
Cancel
Save