Skip to content

Commit de0c404

Browse files
Jamie SmithchrJosthallardfelserpavels
authored
Synchronize changes with Mbed upstream: July 2024 edition (mbed-ce#309)
* remove stdio checks in serial init if no console is available * STM32WL fix set preamble length to 8 * Add target support for XDOT_MAX32670 * TARGET_STM: only mask CAN rx interrupt after rx interrupt, not all CAN interrupts * Sleep Radio in between DC scheduled * Nuvoton HUSBD support endpoint write ZLP * USBCDC: support ZLP * Don't overlap STM32 FDCAN RAM sections * allow to override antenna gain * TFM: Fix undeclared function tfm_ns_interface_init ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration] * NUVOTON: CAN: Fix filter mask NOTE: This fix only targets CAN (M453/M487), not CAN-FD (M467). NOTE: NUC472 CAN doesn't support filter. * NUVOTON: CAN: Fix Rx interrupt doesn't work Major modifications: 1. Handle Rx interrupt based on Message Object interrupt (CAN_IIDR=0x0001~0x0020) instead of CAN_STATUS.RxOK 2. Also handle Tx interrupt following above for consistency Other related modifications: 1. Fix signature type error in CAN_CLR_INT_PENDING_BIT() 2. Add CAN_CLR_INT_PENDING_ONLY_BIT() which doesn't clear NewDat flag so that user can fetch received message in thread context NOTE: This fix only targets CAN (NUC472/M453/M487), not CAN-FD (M467). * NUVOTON: CAN: Fix Message Object number for Tx and recognition of Rx interrupt 1. The same Message Object number cannot use for both Tx and Rx simultaneously. For Tx, Message Object number 31 is reserved instead of 0. For Rx, Message Object numbers 0~30 are used and for filters. 2. NewDat bit (CAN_IsNewDataReceived()) isn't exclusive to Rx. Recognize Rx interrupt by Message Object number other than 31. NOTE: This fix only targets CAN (NUC472/M453/M487), not CAN-FD (M467). * NUVOTON: CAN: Fix filter mask being zero On mask being zero, it means any match, not exact match. NOTE: This fix only targets CAN (M453/M487), not CAN-FD (M467). NOTE: NUC472 CAN doesn't support filter. * Allow custom TCXO control parameter Allow custom TCXO control parameter * NUVOTON: EMAC: Fix undeclared function mbed_error_printf ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration] * NUVOTON: AnalogIn: Fix undeclared function gpio_set ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration] * NUVOTON: CAN: Fix undeclared function gpio_set ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration] * NUVOTON: AnalogOut: Fix undeclared function gpio_set ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration] * NUVOTON: SPI: Fix undeclared function gpio_set ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration] * NUVOTON: I2C: Fix undeclared function gpio_set ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration] * NUVOTON: Serial: Fix undeclared function gpio_set ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration] * Add separate flags for I2C slave transfer in progress Fixes ARMmbed#15498 Adds 2 boolean flags to the STM32 `i2c_s` object to indicate whether a transfer is in progress, separate from the existing "transfer pending" flags. `i2c_slave_write`, `i2c_slave_read` and their associated callbacks are modified to use these flags in addition to the pending flags. The original behavior of the pending flags is preserved. * ESP8266: Fix accessing uninitialized variable * Added missing delete * Add ability to change number of status registers for macronix QSPIF devices * correct scan parameters types * skip CRC when initializing TDBStore Problem: The build_ram_table() function of TDBStore loops over every entry, calculates the checksum and compares them to the stored checksum in the entry header to ensure integrity. For larger TDBStores (e.g. 8 MiB or more) in external single-SPI flash devices this check can take very long, thus rendering it unusable in some cases. Solution: The suggested solution skips the time consuming CRC of the data. After reading the key and calculating its CRC, it sets next_offset to the beginning of the next entry, thereby skipping the data. While this skips the integrity check, it significantly reduces the initial building of the RAM table. The data CRC can be enabled or disabled with a compiler flag. Contribution is provided on behalf of BIOTRONIK. * Added missing check for replay protection pointer before allocating new variable Problem: If a key with write-once flag is being set in a SecureStore without rollback-protection store (i.e. _rbp_kv == NULL), additional memory will be allocated for the variable _ih->key. The memory will not be deleted, though, as the delete in line 434 only happens if a rollback-protection store exists (i.e. _rbp_kv != NULL) Solution: Only allocate the memory if _rbp_kv != NULL Contribution is provided on behalf of BIOTRONIK. * Increase AT timeout to 10s in AT_CellularSMS::send_sms For some devices sending can be slow (as an example see SIM800, it can be up to 60s), command is being run properly but default timeout is returning an invalid error. See https://www.elecrow.com/wiki/images/2/20/SIM800_Series_AT_Command_Manual_V1.09.pdf * Increase AT timeout to 10s in AT_CellularSMS::get_sms When SMS list is big and baudrate is not fast enough, with default timeout we can suffer from timeout error while getting a sms because method is parsing the full list and this takes long. * Fix AT_CellularSMS::list_messages breaking in text mode when CRLF is contained in SMS payload text When parsing SMS, it can happen that we receive CRLF in the SMS payload (happened to me when receiving provider texts). As an example, we can receive: """ Hello <CR><LF> World! """ With previous implementation, second consume_to_stop_tag was stopping in <CR><LF> and rest of the code was failing for obvious reasons. With this commit we consume the full payload as bytes. * Add missing SPDX identifier to a bajillion Nuvoton source files + some others * More license fixes, upgrade M451 legacy PinNames.h, add MCU description * Fix some more legacy pin names --------- Co-authored-by: Jost, Chris <[email protected]> Co-authored-by: Charles <[email protected]> Co-authored-by: Leon Lindenfelser <[email protected]> Co-authored-by: Pavel Sorejs <[email protected]> Co-authored-by: cyliang tw <[email protected]> Co-authored-by: jmcloud <[email protected]> Co-authored-by: Chun-Chieh Li <[email protected]> Co-authored-by: Adam Gausmann <[email protected]> Co-authored-by: Mingjie Shen <[email protected]> Co-authored-by: Matthias Goebel <[email protected]> Co-authored-by: danielzhang <[email protected]> Co-authored-by: Mathieu Camélique <[email protected]> Co-authored-by: David Alonso de la Torre <[email protected]>
1 parent 6b946d4 commit de0c404

File tree

236 files changed

+1204
-170
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

236 files changed

+1204
-170
lines changed

connectivity/FEATURE_BLE/include/ble/gap/ScanParameters.h

+4-4
Original file line numberDiff line numberDiff line change
@@ -82,15 +82,15 @@ class ScanParameters {
8282
/**
8383
* Get the scan interval.
8484
*/
85-
const scan_window_t &getInterval() const
85+
const scan_interval_t &getInterval() const
8686
{
8787
return interval;
8888
}
8989

9090
/**
9191
* Get the scan window.
9292
*/
93-
const scan_interval_t &getWindow() const
93+
const scan_window_t &getWindow() const
9494
{
9595
return window;
9696
}
@@ -121,8 +121,8 @@ class ScanParameters {
121121
*/
122122
ScanParameters(
123123
phy_t phy = phy_t::LE_1M,
124-
scan_window_t scan_interval = scan_interval_t::min(),
125-
scan_interval_t scan_window = scan_window_t::min(),
124+
scan_interval_t scan_interval = scan_interval_t::min(),
125+
scan_window_t scan_window = scan_window_t::min(),
126126
bool active_scanning = false,
127127
own_address_type_t own_address_type = own_address_type_t::RANDOM,
128128
scanning_filter_policy_t scanning_filter_policy = scanning_filter_policy_t::NO_FILTER

connectivity/cellular/include/cellular/framework/API/ATHandler.h

+13
Original file line numberDiff line numberDiff line change
@@ -318,6 +318,13 @@ class ATHandler {
318318
*/
319319
void skip_param(ssize_t len, uint32_t count);
320320

321+
/** Consumes the given length from the reading buffer even if the stop tag has been found
322+
*
323+
* @param len length to be consumed from reading buffer
324+
* @param count number of parameters to be skipped
325+
*/
326+
void skip_param_bytes(ssize_t len, uint32_t count);
327+
321328
/** Reads given number of bytes from receiving buffer without checking any subparameter delimiters, such as comma.
322329
*
323330
* @param buf output buffer for the read
@@ -408,6 +415,12 @@ class ATHandler {
408415
*/
409416
bool consume_to_stop_tag();
410417

418+
/** Consumes the received content until current stop tag is found even if stop tag has been found previously
419+
*
420+
* @return true if stop tag is found, false otherwise
421+
*/
422+
bool consume_to_stop_tag_even_found();
423+
411424
/** Return the last 3GPP error code.
412425
* @return last 3GPP error code
413426
*/

connectivity/cellular/source/framework/AT/AT_CellularSMS.cpp

+22-2
Original file line numberDiff line numberDiff line change
@@ -420,6 +420,7 @@ nsapi_size_or_error_t AT_CellularSMS::send_sms(const char *phone_number, const c
420420
}
421421

422422
_at.lock();
423+
_at.set_at_timeout(10s);
423424

424425
int write_size = 0;
425426

@@ -437,6 +438,7 @@ nsapi_size_or_error_t AT_CellularSMS::send_sms(const char *phone_number, const c
437438
// sending can be cancelled by giving <ESC> character (IRA 27).
438439
_at.cmd_start(ESC);
439440
_at.cmd_stop();
441+
_at.restore_at_timeout();
440442
_at.unlock();
441443
return write_size;
442444
}
@@ -482,6 +484,7 @@ nsapi_size_or_error_t AT_CellularSMS::send_sms(const char *phone_number, const c
482484
pdu_str = create_pdu(phone_number, message + i * concatenated_sms_length, pdu_len,
483485
sms_count, i + 1, header_len);
484486
if (!pdu_str) {
487+
_at.restore_at_timeout();
485488
_at.unlock();
486489
return NSAPI_ERROR_NO_MEMORY;
487490
}
@@ -509,6 +512,7 @@ nsapi_size_or_error_t AT_CellularSMS::send_sms(const char *phone_number, const c
509512
// sending can be cancelled by giving <ESC> character (IRA 27).
510513
_at.cmd_start(ESC);
511514
_at.cmd_stop();
515+
_at.restore_at_timeout();
512516
_at.unlock();
513517
delete [] pdu_str;
514518
return msg_write_len;
@@ -523,13 +527,15 @@ nsapi_size_or_error_t AT_CellularSMS::send_sms(const char *phone_number, const c
523527
delete [] pdu_str;
524528
remaining_len -= concatenated_sms_length;
525529
if (_at.get_last_error() != NSAPI_ERROR_OK) {
530+
_at.restore_at_timeout();
526531
return _at.unlock_return_error();
527532
}
528533
}
529534
}
530535

531536
_sms_message_ref_number++;
532537
nsapi_error_t ret = _at.get_last_error();
538+
_at.restore_at_timeout();
533539
_at.unlock();
534540

535541
return (ret == NSAPI_ERROR_OK) ? msg_len : ret;
@@ -697,6 +703,7 @@ nsapi_size_or_error_t AT_CellularSMS::get_sms(char *buf, uint16_t len, char *pho
697703
}
698704

699705
_at.lock();
706+
_at.set_at_timeout(10s);
700707

701708
nsapi_size_or_error_t err = list_messages();
702709
if (err == NSAPI_ERROR_OK) {
@@ -710,6 +717,7 @@ nsapi_size_or_error_t AT_CellularSMS::get_sms(char *buf, uint16_t len, char *pho
710717
*buf_size = info->msg_size;
711718
}
712719
free_linked_list();
720+
_at.restore_at_timeout();
713721
_at.unlock();
714722
return NSAPI_ERROR_PARAMETER;
715723
}
@@ -734,6 +742,7 @@ nsapi_size_or_error_t AT_CellularSMS::get_sms(char *buf, uint16_t len, char *pho
734742

735743
free_linked_list();
736744

745+
_at.restore_at_timeout();
737746
_at.unlock();
738747

739748
// update error only when there really was an error, otherwise we return the length
@@ -1027,6 +1036,7 @@ nsapi_error_t AT_CellularSMS::list_messages()
10271036
int index = 0;
10281037
int length = 0;
10291038
char *pdu = NULL;
1039+
char buffer[32]; // 32 > SMS_STATUS_SIZE, SMS_MAX_PHONE_NUMBER_SIZE, SMS_MAX_TIME_STAMP_SIZE
10301040

10311041
_at.resp_start("+CMGL:");
10321042
while (_at.info_resp()) {
@@ -1049,8 +1059,18 @@ nsapi_error_t AT_CellularSMS::list_messages()
10491059
// +CMGL: <index>,<stat>,<oa/da>,[<alpha>],[<scts>][,<tooa/toda>,<length>]<CR><LF><data>[<CR><LF>
10501060
// +CMGL: <index>,<stat>,<da/oa>,[<alpha>],[<scts>][,<tooa/toda>,<length>]<CR><LF><data>[...]]
10511061
index = _at.read_int();
1052-
(void)_at.consume_to_stop_tag(); // consume until <CR><LF>
1053-
(void)_at.consume_to_stop_tag(); // consume until <CR><LF>
1062+
_at.read_string(buffer, SMS_STATUS_SIZE);
1063+
_at.read_string(buffer, SMS_MAX_PHONE_NUMBER_SIZE);
1064+
_at.skip_param(); // <alpha>
1065+
_at.read_string(buffer, SMS_MAX_TIME_STAMP_SIZE);
1066+
_at.read_int();
1067+
int size = _at.read_int(); // length
1068+
_at.consume_to_stop_tag(); // consume until <CR><LF> end of header
1069+
if (size > 0) {
1070+
// we can not use skip param because we already consumed stop tag
1071+
_at.skip_param_bytes(size, 1);
1072+
}
1073+
_at.consume_to_stop_tag_even_found(); // consume until <CR><LF> -> data
10541074
}
10551075

10561076
if (index >= 0) {

connectivity/cellular/source/framework/device/ATHandler.cpp

+40
Original file line numberDiff line numberDiff line change
@@ -484,6 +484,26 @@ void ATHandler::skip_param(ssize_t len, uint32_t count)
484484
return;
485485
}
486486

487+
void ATHandler::skip_param_bytes(ssize_t len, uint32_t count)
488+
{
489+
if (!ok_to_proceed()) {
490+
return;
491+
}
492+
493+
for (uint32_t i = 0; i < count; i++) {
494+
ssize_t read_len = 0;
495+
while (read_len < len) {
496+
int c = get_char();
497+
if (c == -1) {
498+
set_error(NSAPI_ERROR_DEVICE_ERROR);
499+
return;
500+
}
501+
read_len++;
502+
}
503+
}
504+
return;
505+
}
506+
487507
ssize_t ATHandler::read_bytes(uint8_t *buf, size_t len)
488508
{
489509
if (!ok_to_proceed()) {
@@ -1093,6 +1113,26 @@ bool ATHandler::consume_to_stop_tag()
10931113
return false;
10941114
}
10951115

1116+
1117+
bool ATHandler::consume_to_stop_tag_even_found()
1118+
{
1119+
if (_error_found) {
1120+
return true;
1121+
}
1122+
1123+
if (!_is_fh_usable) {
1124+
_last_err = NSAPI_ERROR_BUSY;
1125+
return true;
1126+
}
1127+
1128+
if (consume_to_tag((const char *)_stop_tag->tag, true)) {
1129+
return true;
1130+
}
1131+
1132+
clear_error();
1133+
return false;
1134+
}
1135+
10961136
// consume by size needed?
10971137

10981138
void ATHandler::resp_stop()

connectivity/cellular/tests/UNITTESTS/doubles/ATHandler_stub.cpp

+9
Original file line numberDiff line numberDiff line change
@@ -201,6 +201,10 @@ void ATHandler::skip_param(ssize_t len, uint32_t count)
201201
{
202202
}
203203

204+
void ATHandler::skip_param_bytes(ssize_t len, uint32_t count)
205+
{
206+
}
207+
204208
ssize_t ATHandler::read_bytes(uint8_t *buf, size_t len)
205209
{
206210
return ATHandler_stub::ssize_value;
@@ -301,6 +305,11 @@ bool ATHandler::consume_to_stop_tag()
301305
return ATHandler_stub::bool_value;
302306
}
303307

308+
bool ATHandler::consume_to_stop_tag_even_found()
309+
{
310+
return ATHandler_stub::bool_value;
311+
}
312+
304313
void ATHandler::resp_stop()
305314
{
306315
if (ATHandler_stub::resp_stop_success_count > 0) {

connectivity/cellular/tests/UNITTESTS/framework/AT/at_cellularsms/at_cellularsmstest.cpp

+10-2
Original file line numberDiff line numberDiff line change
@@ -155,8 +155,16 @@ TEST_F(TestAT_CellularSMS, test_AT_CellularSMS_get_sms)
155155
ATHandler_stub::resp_info_false_counter = 1;
156156
ATHandler_stub::resp_info_true_counter2 = 2;
157157
ATHandler_stub::int_value = 11;
158-
ATHandler_stub::read_string_index = 4;
159-
ATHandler_stub::read_string_table[4] = "";
158+
ATHandler_stub::read_string_index = (3 * 2) + (2 * 2); // 3 read_string in list_messages + 2 read_string in read_sms_from_index
159+
ATHandler_stub::read_string_table[10] = "";
160+
// list_messages
161+
ATHandler_stub::read_string_table[9] = "1"; // status
162+
ATHandler_stub::read_string_table[8] = "+00611223344"; // phone
163+
ATHandler_stub::read_string_table[7] = "24/12/12,11:15:00+04"; // timestamp
164+
ATHandler_stub::read_string_table[6] = "1"; // status
165+
ATHandler_stub::read_string_table[5] = "+00611223344"; // phone
166+
ATHandler_stub::read_string_table[4] = "24/12/12,11:15:00+04"; // timestamp
167+
// read_sms_from_index
160168
ATHandler_stub::read_string_table[3] = "REC READ";
161169
ATHandler_stub::read_string_table[2] = "09/01/12,11:15:00+04";
162170
ATHandler_stub::read_string_table[1] = "REC READ";

connectivity/drivers/emac/TARGET_NUVOTON_EMAC/TARGET_M460/m460_eth.c

+1
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
//#include <stdbool.h>
2121
#include "m460_eth.h"
2222
#include "mbed_toolchain.h"
23+
#include "mbed_interface.h"
2324
//#define NU_TRACE
2425
#include "numaker_eth_hal.h"
2526

connectivity/drivers/emac/TARGET_NUVOTON_EMAC/TARGET_M480/m480_eth.c

+1
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
#include <stdbool.h>
2121
#include "m480_eth.h"
2222
#include "mbed_toolchain.h"
23+
#include "mbed_interface.h"
2324
//#define NU_TRACE
2425
#include "numaker_eth_hal.h"
2526

connectivity/drivers/emac/TARGET_NUVOTON_EMAC/TARGET_NUC472/nuc472_eth.c

+1
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
#include <stdbool.h>
2121
#include "nuc472_eth.h"
2222
#include "mbed_toolchain.h"
23+
#include "mbed_interface.h"
2324
//#define NU_TRACE
2425
#include "numaker_eth_hal.h"
2526

connectivity/drivers/lora/COMPONENT_SX126X/SX126X_LoRaRadio.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -437,7 +437,7 @@ void SX126X_LoRaRadio::cold_start_wakeup()
437437
if (MBED_CONF_SX126X_LORA_DRIVER_XTAL == 0) {
438438
#endif
439439
caliberation_params_t calib_param;
440-
set_dio3_as_tcxo_ctrl(TCXO_CTRL_1_7V, 320); //5 ms
440+
set_dio3_as_tcxo_ctrl(MBED_CONF_SX126X_LORA_DRIVER_TCXO_CTRL, 320); //5 ms
441441
calib_param.value = 0x7F;
442442
write_opmode_command(RADIO_CALIBRATE, &calib_param.value, 1);
443443
}

connectivity/drivers/lora/COMPONENT_SX126X/mbed_lib.json

+4
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,10 @@
3838
"help": "Default: -1 = use crystal-select, TXCO = 0, XTAL = 1",
3939
"value": -1
4040
},
41+
"tcxo-ctrl": {
42+
"help": "TCXO Control voltage. Default: TCXO control TCXO_CTRL_1_7V (RAK4630 use TCXO_CTRL_3_0V)",
43+
"value": "TCXO_CTRL_1_7V"
44+
},
4145
"spi-mosi": {
4246
"value": "NC"
4347
},

connectivity/drivers/wifi/COMPONENT_ESPRESSIF_ESP8266/ESP8266/ESP8266.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -1190,7 +1190,7 @@ bool ESP8266::get_sntp_config(bool *enable, int *timezone, char *server0,
11901190
&tmp, timezone, server0, server1, server2)
11911191
&& _parser.recv("OK\n");
11921192
_smutex.unlock();
1193-
*enable = tmp ? true : false;
1193+
*enable = (done && tmp) ? true : false;
11941194
return done;
11951195
}
11961196

connectivity/lorawan/lorastack/mac/LoRaMac.cpp

+3
Original file line numberDiff line numberDiff line change
@@ -1137,6 +1137,9 @@ lorawan_status_t LoRaMac::schedule_tx()
11371137
if (backoff_time != 0) {
11381138
tr_debug("DC enforced: Transmitting in %lu ms", backoff_time);
11391139
_can_cancel_tx = true;
1140+
if (_device_class != CLASS_C) {
1141+
_lora_phy->put_radio_to_sleep();
1142+
}
11401143
_lora_time.start(_params.timers.backoff_timer, backoff_time);
11411144
}
11421145
return LORAWAN_STATUS_OK;

connectivity/lorawan/lorastack/phy/LoRaPHYAS923.cpp

+4
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,11 @@
187187
/*!
188188
* Default antenna gain
189189
*/
190+
#ifdef LORAPHY_ANTENNA_GAIN
191+
#define AS923_DEFAULT_ANTENNA_GAIN LORAPHY_ANTENNA_GAIN
192+
#else
190193
#define AS923_DEFAULT_ANTENNA_GAIN 2.15f
194+
#endif
191195

192196
/*!
193197
* ADR Ack limit

connectivity/lorawan/lorastack/phy/LoRaPHYAU915.cpp

+4
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,11 @@
9696
/*!
9797
* Default antenna gain
9898
*/
99+
#ifdef LORAPHY_ANTENNA_GAIN
100+
#define AU915_DEFAULT_ANTENNA_GAIN LORAPHY_ANTENNA_GAIN
101+
#else
99102
#define AU915_DEFAULT_ANTENNA_GAIN 2.15f
103+
#endif
100104

101105
/*!
102106
* ADR Ack limit

connectivity/lorawan/lorastack/phy/LoRaPHYCN470.cpp

+4
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,11 @@
9595
/*!
9696
* Default antenna gain
9797
*/
98+
#ifdef LORAPHY_ANTENNA_GAIN
99+
#define CN470_DEFAULT_ANTENNA_GAIN LORAPHY_ANTENNA_GAIN
100+
#else
98101
#define CN470_DEFAULT_ANTENNA_GAIN 2.15f
102+
#endif
99103

100104
/*!
101105
* ADR Ack limit

connectivity/lorawan/lorastack/phy/LoRaPHYCN779.cpp

+4
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,11 @@
107107
/*!
108108
* Default antenna gain
109109
*/
110+
#ifdef LORAPHY_ANTENNA_GAIN
111+
#define CN779_DEFAULT_ANTENNA_GAIN LORAPHY_ANTENNA_GAIN
112+
#else
110113
#define CN779_DEFAULT_ANTENNA_GAIN 2.15f
114+
#endif
111115

112116
/*!
113117
* ADR Ack limit

connectivity/lorawan/lorastack/phy/LoRaPHYEU433.cpp

+4
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,11 @@
107107
/*!
108108
* Default antenna gain
109109
*/
110+
#ifdef LORAPHY_ANTENNA_GAIN
111+
#define EU433_DEFAULT_ANTENNA_GAIN LORAPHY_ANTENNA_GAIN
112+
#else
110113
#define EU433_DEFAULT_ANTENNA_GAIN 2.15f
114+
#endif
111115

112116
/*!
113117
* ADR Ack limit

connectivity/lorawan/lorastack/phy/LoRaPHYEU868.cpp

+4
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,11 @@
107107
/*!
108108
* Default antenna gain
109109
*/
110+
#ifdef LORAPHY_ANTENNA_GAIN
111+
#define EU868_DEFAULT_ANTENNA_GAIN LORAPHY_ANTENNA_GAIN
112+
#else
110113
#define EU868_DEFAULT_ANTENNA_GAIN 2.15f
114+
#endif
111115

112116
/*!
113117
* ADR Ack limit

connectivity/lorawan/lorastack/phy/LoRaPHYIN865.cpp

+4
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,11 @@
107107
/*!
108108
* Default antenna gain
109109
*/
110+
#ifdef LORAPHY_ANTENNA_GAIN
111+
#define IN865_DEFAULT_ANTENNA_GAIN LORAPHY_ANTENNA_GAIN
112+
#else
110113
#define IN865_DEFAULT_ANTENNA_GAIN 2.15f
114+
#endif
111115

112116
/*!
113117
* ADR Ack limit

0 commit comments

Comments
 (0)