Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/cc1120.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ rfStatus_t CC1120::writeRegister(uint16_t address, uint8_t buffer)
digitalWrite(pin_cs, LOW);

// normal register range
if (address & 0x3f == address) {
if (CC1120::registerInNormalRange(address)) {
uint8_t header = ((uint8_t) address) | SINGLE_REGISTER_WRITE;
SPI.transfer(header);
}
Expand All @@ -73,7 +73,7 @@ rfStatus_t CC1120::readRegister(uint16_t address, uint8_t *buffer)
digitalWrite(pin_cs, LOW);

// normal register range
if (address & 0x3f == address) {
if (CC1120::registerInNormalRange(address)) {
uint8_t header = ((uint8_t) address) | SINGLE_REGISTER_READ;
SPI.transfer(header);
}
Expand Down
4 changes: 4 additions & 0 deletions src/cc1120.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,10 @@ class CC1120 {
/* @brief Gets the current status */

private:
static inline bool registerInNormalRange(uint16_t address) {
return (address & 0x3f) == address;
}

SPIClass& spi;
SPISettings spiSettings = SPISettings(10000000, SPI_MSBFIRST, SPI_MODE0); // copied from E22 Driver, need to verify

Expand Down