Skip to content

Commit

Permalink
Use 0xFF (not 'ff') for byte transfer
Browse files Browse the repository at this point in the history
  • Loading branch information
thinkyhead committed Oct 16, 2020
1 parent 0f9d57e commit fb28c60
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
4 changes: 2 additions & 2 deletions Marlin/src/HAL/STM32F1/HAL_SPI.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ void spiInit(uint8_t spiRate) {
* @details
*/
uint8_t spiRec() {
uint8_t returnByte = SPI.transfer(ff);
uint8_t returnByte = SPI.transfer(0xFF);
return returnByte;
}

Expand Down Expand Up @@ -154,7 +154,7 @@ void spiSendBlock(uint8_t token, const uint8_t* buf) {
#if ENABLED(SPI_EEPROM)

// 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
void spiSend(uint32_t chan, byte b) { SPI.send(b); }
Expand Down
6 changes: 2 additions & 4 deletions Marlin/src/libs/W25Qxx.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -80,16 +80,14 @@ void W25QXXFlash::init(uint8_t spiRate) {
* @brief Receive a single byte from the SPI port.
*
* @return Byte received
*
* @details
*/
uint8_t W25QXXFlash::spi_flash_Rec() {
uint8_t returnByte = SPI.transfer(ff);
const uint8_t returnByte = SPI.transfer(0xFF);
return returnByte;
}

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;
}

Expand Down

0 comments on commit fb28c60

Please sign in to comment.