[SX128x] Cleanup private/protected members
This commit is contained in:
parent
bbe407b50f
commit
b5d931ec79
3 changed files with 15 additions and 23 deletions
|
@ -12,10 +12,11 @@ int16_t SX1280::range(bool master, uint32_t addr, uint16_t calTable[3][6]) {
|
|||
RADIOLIB_ASSERT(state);
|
||||
|
||||
// wait until ranging is finished
|
||||
uint32_t start = this->mod->hal->millis();
|
||||
while(!this->mod->hal->digitalRead(this->mod->getIrq())) {
|
||||
this->mod->hal->yield();
|
||||
if(this->mod->hal->millis() - start > 10000) {
|
||||
Module* mod = this->getMod();
|
||||
uint32_t start = mod->hal->millis();
|
||||
while(!mod->hal->digitalRead(mod->getIrq())) {
|
||||
mod->hal->yield();
|
||||
if(mod->hal->millis() - start > 10000) {
|
||||
clearIrqStatus();
|
||||
standby();
|
||||
return(RADIOLIB_ERR_RANGING_TIMEOUT);
|
||||
|
|
|
@ -6,10 +6,6 @@ SX128x::SX128x(Module* mod) : PhysicalLayer(RADIOLIB_SX128X_FREQUENCY_STEP_SIZE,
|
|||
this->mod = mod;
|
||||
}
|
||||
|
||||
Module* SX128x::getMod() {
|
||||
return(this->mod);
|
||||
}
|
||||
|
||||
int16_t SX128x::begin(float freq, float bw, uint8_t sf, uint8_t cr, uint8_t syncWord, int8_t pwr, uint16_t preambleLength) {
|
||||
// set module properties
|
||||
this->mod->init();
|
||||
|
@ -1347,6 +1343,10 @@ void SX128x::readBit(uint32_t pin) {
|
|||
}
|
||||
#endif
|
||||
|
||||
Module* SX128x::getMod() {
|
||||
return(this->mod);
|
||||
}
|
||||
|
||||
uint8_t SX128x::getStatus() {
|
||||
uint8_t data = 0;
|
||||
this->mod->SPIreadStream(RADIOLIB_SX128X_CMD_GET_STATUS, &data, 0);
|
||||
|
|
|
@ -361,8 +361,6 @@ class SX128x: public PhysicalLayer {
|
|||
*/
|
||||
SX128x(Module* mod);
|
||||
|
||||
Module* getMod();
|
||||
|
||||
// basic methods
|
||||
|
||||
/*!
|
||||
|
@ -782,11 +780,7 @@ class SX128x: public PhysicalLayer {
|
|||
#if !RADIOLIB_GODMODE && !RADIOLIB_LOW_LEVEL
|
||||
protected:
|
||||
#endif
|
||||
Module* mod;
|
||||
|
||||
#if !RADIOLIB_GODMODE
|
||||
protected:
|
||||
#endif
|
||||
Module* getMod();
|
||||
|
||||
// cached LoRa parameters
|
||||
float bandwidthKhz = 0;
|
||||
|
@ -814,19 +808,16 @@ class SX128x: public PhysicalLayer {
|
|||
int16_t clearIrqStatus(uint16_t clearIrqParams = RADIOLIB_SX128X_IRQ_ALL);
|
||||
int16_t setRangingRole(uint8_t role);
|
||||
int16_t setPacketType(uint8_t type);
|
||||
|
||||
int16_t setHeaderType(uint8_t hdrType, size_t len = 0xFF);
|
||||
|
||||
#if !RADIOLIB_GODMODE && !RADIOLIB_LOW_LEVEL
|
||||
private:
|
||||
#endif
|
||||
|
||||
// common low-level SPI interface
|
||||
static int16_t SPIparseStatus(uint8_t in);
|
||||
|
||||
#if !RADIOLIB_GODMODE
|
||||
private:
|
||||
#endif
|
||||
Module* mod;
|
||||
|
||||
// common low-level SPI interface
|
||||
static int16_t SPIparseStatus(uint8_t in);
|
||||
|
||||
// common parameters
|
||||
uint8_t power = 0;
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue