Browse Source

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

vanilla_fb_2.0.x
Scott Lahteine 4 years ago
parent
commit
f72c559824
  1. 4
      Marlin/src/HAL/STM32F1/HAL_SPI.cpp
  2. 6
      Marlin/src/libs/W25Qxx.cpp

4
Marlin/src/HAL/STM32F1/HAL_SPI.cpp

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

6
Marlin/src/libs/W25Qxx.cpp

@ -80,16 +80,14 @@ void W25QXXFlash::init(uint8_t spiRate) {
* @brief Receive a single byte from the SPI port. * @brief Receive a single byte from the SPI port.
* *
* @return Byte received * @return Byte received
*
* @details
*/ */
uint8_t W25QXXFlash::spi_flash_Rec() { uint8_t W25QXXFlash::spi_flash_Rec() {
uint8_t returnByte = SPI.transfer(ff); const uint8_t returnByte = SPI.transfer(0xFF);
return returnByte; return returnByte;
} }
uint8_t W25QXXFlash::spi_flash_read_write_byte(uint8_t data) { uint8_t W25QXXFlash::spi_flash_read_write_byte(uint8_t data) {
uint8_t returnByte = SPI.transfer(data); const uint8_t returnByte = SPI.transfer(data);
return returnByte; return returnByte;
} }

Loading…
Cancel
Save