Skip to content

Commit 4691c37

Browse files
Kimmo Vaisanenkivaisan
authored andcommitted
Change static variables to class members
Some variables were still defind as static in sources but as drivers are now C++ classes, these variables should be members of the class.
1 parent a8fef8f commit 4691c37

File tree

4 files changed

+13
-12
lines changed

4 files changed

+13
-12
lines changed

SX1272/SX1272_LoRaRadio.cpp

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ typedef struct
8080
*/
8181
typedef struct
8282
{
83-
modem_type modem;
83+
modem_type modem;
8484
uint8_t addr;
8585
uint8_t value;
8686
} radio_registers_t;
@@ -159,12 +159,6 @@ const fsk_bw_t fsk_bandwidths[] =
159159
*/
160160
static const radio_registers_t radio_reg_init[] = RADIO_INIT_REGISTERS_VALUE;
161161

162-
static uint8_t radio_variant;
163-
164-
/**
165-
* Flag used to set the RF switch control pins in low power mode when the radio is not active.
166-
*/
167-
static bool radio_is_active = false;
168162

169163
/**
170164
* Constructor
@@ -216,6 +210,8 @@ SX1272_LoRaRadio::SX1272_LoRaRadio(PinName spi_mosi,
216210
_tcxo = 1;
217211
}
218212

213+
radio_is_active = false;
214+
219215
#ifdef MBED_CONF_RTOS_PRESENT
220216
irq_thread.start(mbed::callback(this, &SX1272_LoRaRadio::rf_irq_task));
221217
#endif

SX1272/SX1272_LoRaRadio.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -375,6 +375,13 @@ class SX1272_LoRaRadio: public LoRaRadio {
375375
// Access protection
376376
PlatformMutex mutex;
377377

378+
uint8_t radio_variant;
379+
380+
/**
381+
* Flag used to set the RF switch control pins in low power mode when the radio is not active.
382+
*/
383+
bool radio_is_active;
384+
378385
// helper functions
379386
void setup_registers();
380387
void default_antenna_switch_ctrls();

SX1276/SX1276_LoRaRadio.cpp

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,6 @@ SPDX-License-Identifier: BSD-3-Clause
4848
#define XTAL_FREQ 32000000
4949
#define FREQ_STEP 61.03515625
5050

51-
#define RX_BUFFER_SIZE 256
52-
5351
/*!
5452
* Constant values need to compute the RSSI value
5553
*/
@@ -72,7 +70,7 @@ typedef struct
7270
*/
7371
typedef struct
7472
{
75-
uint8_t modem;
73+
uint8_t modem;
7674
uint8_t addr;
7775
uint8_t value;
7876
} radio_registers_t;
@@ -157,8 +155,6 @@ enum RadioVariant {
157155
#define SPI_FREQUENCY 8000000
158156
#endif
159157

160-
static uint8_t radio_variant;
161-
162158
/**
163159
* Constructor
164160
*/

SX1276/SX1276_LoRaRadio.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -390,6 +390,8 @@ class SX1276_LoRaRadio: public LoRaRadio {
390390
// Access protection
391391
PlatformMutex mutex;
392392

393+
uint8_t radio_variant;
394+
393395
// helper functions
394396
void setup_registers();
395397
void default_antenna_switch_ctrls();

0 commit comments

Comments
 (0)