Skip to content

Commit d3aa385

Browse files
committed
chore: allow some redefinitions
Fixes #10 Signed-off-by: Frederic Pillon <[email protected]>
1 parent 13f0eb4 commit d3aa385

File tree

2 files changed

+33
-11
lines changed

2 files changed

+33
-11
lines changed

src/BSP/radio_conf.h

+21-7
Original file line numberDiff line numberDiff line change
@@ -50,48 +50,62 @@
5050
* @brief drive value used anytime radio is NOT in TX low power mode
5151
* @note override the default configuration of radio_driver.c
5252
*/
53-
#define SMPS_DRIVE_SETTING_DEFAULT SMPS_DRV_40
53+
#ifndef SMPS_DRIVE_SETTING_DEFAULT
54+
#define SMPS_DRIVE_SETTING_DEFAULT SMPS_DRV_40
55+
#endif
5456

5557
/**
5658
* @brief drive value used anytime radio is in TX low power mode
5759
* TX low power mode is the worst case because the PA sinks from SMPS
5860
* while in high power mode, current is sunk directly from the battery
5961
* @note override the default configuration of radio_driver.c
6062
*/
61-
#define SMPS_DRIVE_SETTING_MAX SMPS_DRV_60
63+
#ifndef SMPS_DRIVE_SETTING_MAX
64+
#define SMPS_DRIVE_SETTING_MAX SMPS_DRV_60
65+
#endif
6266

6367
/**
6468
* @brief Provides the frequency of the chip running on the radio and the frequency step
6569
* @remark These defines are used for computing the frequency divider to set the RF frequency
6670
* @note override the default configuration of radio_driver.c
6771
*/
68-
#define XTAL_FREQ ( 32000000UL )
72+
#ifndef XTAL_FREQ
73+
#define XTAL_FREQ ( 32000000UL )
74+
#endif
6975

7076
/**
7177
* @brief in XO mode, set internal capacitor (from 0x00 to 0x2F starting 11.2pF with 0.47pF steps)
7278
* @note override the default configuration of radio_driver.c
7379
*/
74-
#define XTAL_DEFAULT_CAP_VALUE ( 0x20UL )
80+
#ifndef XTAL_DEFAULT_CAP_VALUE
81+
#define XTAL_DEFAULT_CAP_VALUE ( 0x20UL )
82+
#endif /* XTAL_DEFAULT_CAP_VALUE */
7583

7684
/**
7785
* @brief voltage of vdd tcxo.
7886
* @note override the default configuration of radio_driver.c
7987
*/
80-
#define TCXO_CTRL_VOLTAGE TCXO_CTRL_1_7V
88+
#ifndef TCXO_CTRL_VOLTAGE
89+
#define TCXO_CTRL_VOLTAGE TCXO_CTRL_1_7V
90+
#endif
8191

8292
/**
8393
* @brief Radio maximum wakeup time (in ms)
8494
* @note override the default configuration of radio_driver.c
8595
*/
86-
#define RF_WAKEUP_TIME ( 1UL )
96+
#ifndef RF_WAKEUP_TIME
97+
#define RF_WAKEUP_TIME ( 1UL )
98+
#endif
8799

88100
/**
89101
* @brief DCDC is enabled
90102
* @remark this define is only used if the DCDC is present on the board
91103
* (as indicated by RBI_IsDCDC())
92104
* @note override the default configuration of radio_driver.c
93105
*/
94-
#define DCDC_ENABLE ( 1UL )
106+
#ifndef DCDC_ENABLE
107+
#define DCDC_ENABLE ( 1UL )
108+
#endif
95109

96110
/**
97111
* @brief disable the Sigfox radio modulation

src/STM32CubeWL/LoRaWAN/Mac/Region/RegionEU868.h

+12-4
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,9 @@ extern "C"
7777
/*!
7878
* Maximal datarate that can be used by the node
7979
*/
80-
#define EU868_TX_MAX_DATARATE DR_7
80+
#ifndef EU868_TX_MAX_DATARATE
81+
#define EU868_TX_MAX_DATARATE DR_7
82+
#endif
8183

8284
/*!
8385
* Minimal datarate that can be used by the node
@@ -87,12 +89,16 @@ extern "C"
8789
/*!
8890
* Maximal datarate that can be used by the node
8991
*/
90-
#define EU868_RX_MAX_DATARATE DR_7
92+
#ifndef EU868_RX_MAX_DATARATE
93+
#define EU868_RX_MAX_DATARATE DR_7
94+
#endif
9195

9296
/*!
9397
* Default datarate used by the node
9498
*/
95-
#define EU868_DEFAULT_DATARATE DR_0
99+
#ifndef EU868_DEFAULT_DATARATE
100+
#define EU868_DEFAULT_DATARATE DR_0
101+
#endif
96102

97103
/*!
98104
* Minimal Rx1 receive datarate offset
@@ -127,7 +133,9 @@ extern "C"
127133
/*!
128134
* Default antenna gain
129135
*/
130-
#define EU868_DEFAULT_ANTENNA_GAIN 2.15f
136+
#ifndef EU868_DEFAULT_ANTENNA_GAIN
137+
#define EU868_DEFAULT_ANTENNA_GAIN 2.15f
138+
#endif
131139

132140
/*!
133141
* Enabled or disabled the duty cycle

0 commit comments

Comments
 (0)