Merge pull request #779 from alistair23/alistair/spi-status

modules: Don't read excess status data
This commit is contained in:
Jan Gromeš 2023-06-27 17:34:20 +02:00 committed by GitHub
commit f6203e5036
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View file

@ -240,7 +240,7 @@ int16_t Module::SPIcheckStream() {
// get the status
uint8_t spiStatus = 0;
uint8_t cmd = this->SPIstatusCommand;
state = this->SPItransferStream(&cmd, 1, false, NULL, &spiStatus, 1, true, RADIOLIB_MODULE_SPI_TIMEOUT);
state = this->SPItransferStream(&cmd, 1, false, NULL, &spiStatus, 0, true, RADIOLIB_MODULE_SPI_TIMEOUT);
RADIOLIB_ASSERT(state);
// translate to RadioLib status code

View file

@ -1852,7 +1852,7 @@ int16_t SX126x::setRegulatorMode(uint8_t mode) {
uint8_t SX126x::getStatus() {
uint8_t data = 0;
this->mod->SPIreadStream(RADIOLIB_SX126X_CMD_GET_STATUS, &data, 1);
this->mod->SPIreadStream(RADIOLIB_SX126X_CMD_GET_STATUS, &data, 0);
return(data);
}