Skip to content

Commit e2617cc

Browse files
authored
Merge pull request #3144 from ARMmbed/release-candidate
Release candidate for 5.2.1
2 parents e435a07 + 03edc37 commit e2617cc

File tree

943 files changed

+519311
-29831
lines changed

Some content is hidden

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

943 files changed

+519311
-29831
lines changed

TESTS/netsocket/ip_parsing/main.cpp

Lines changed: 94 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
1+
#include "mbed.h"
2+
#include "greentea-client/test_env.h"
3+
#include "unity.h"
4+
#include "utest.h"
5+
6+
using namespace utest::v1;
7+
8+
9+
// IP parsing verification
10+
void test_ip_accept(const char *string, nsapi_addr_t addr) {
11+
SocketAddress address;
12+
TEST_ASSERT(address.set_ip_address(string));
13+
TEST_ASSERT(address == SocketAddress(addr));
14+
}
15+
16+
template <const char *string>
17+
void test_ip_reject() {
18+
SocketAddress address;
19+
TEST_ASSERT(!address.set_ip_address(string));
20+
TEST_ASSERT(!address);
21+
}
22+
23+
#define TEST_IP_ACCEPT(name, string, ...) \
24+
void name() { \
25+
nsapi_addr_t addr = __VA_ARGS__; \
26+
test_ip_accept(string, addr); \
27+
}
28+
29+
#define TEST_IP_REJECT(name, string) \
30+
void name() { \
31+
test_ip_reject(string); \
32+
}
33+
34+
35+
// Test cases
36+
TEST_IP_ACCEPT(test_simple_ipv4_address,
37+
"12.34.56.78",
38+
{NSAPI_IPv4,{12,34,56,78}})
39+
TEST_IP_ACCEPT(test_left_weighted_ipv4_address,
40+
"255.0.0.0",
41+
{NSAPI_IPv4,{255,0,0,0}})
42+
TEST_IP_ACCEPT(test_right_weighted_ipv4_address,
43+
"0.0.0.255",
44+
{NSAPI_IPv4,{0,0,0,255}})
45+
TEST_IP_ACCEPT(test_null_ipv4_address,
46+
"0.0.0.0",
47+
{NSAPI_IPv4,{0,0,0,0}})
48+
49+
TEST_IP_ACCEPT(test_simple_ipv6_address,
50+
"1234:5678:9abc:def0:1234:5678:9abc:def0",
51+
{NSAPI_IPv6,{0x12,0x34,0x56,0x78,0x9a,0xbc,0xde,0xf0,
52+
0x12,0x34,0x56,0x78,0x9a,0xbc,0xde,0xf0}})
53+
TEST_IP_ACCEPT(test_left_weighted_ipv6_address,
54+
"1234:5678::",
55+
{NSAPI_IPv6,{0x12,0x34,0x56,0x78,0x00,0x00,0x00,0x00,
56+
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}})
57+
TEST_IP_ACCEPT(test_right_weighted_ipv6_address,
58+
"::1234:5678",
59+
{NSAPI_IPv6,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
60+
0x00,0x00,0x00,0x00,0x12,0x34,0x56,0x78}})
61+
TEST_IP_ACCEPT(test_hollowed_ipv6_address,
62+
"1234:5678::9abc:def8",
63+
{NSAPI_IPv6,{0x12,0x34,0x56,0x78,0x00,0x00,0x00,0x00,
64+
0x00,0x00,0x00,0x00,0x9a,0xbc,0xde,0xf8}})
65+
TEST_IP_ACCEPT(test_null_ipv6_address,
66+
"::",
67+
{NSAPI_IPv6,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
68+
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}})
69+
70+
71+
// Test setup
72+
utest::v1::status_t test_setup(const size_t number_of_cases) {
73+
GREENTEA_SETUP(10, "default_auto");
74+
return verbose_test_setup_handler(number_of_cases);
75+
}
76+
77+
Case cases[] = {
78+
Case("Simple IPv4 address", test_simple_ipv4_address),
79+
Case("Left-weighted IPv4 address", test_left_weighted_ipv4_address),
80+
Case("Right-weighted IPv4 address", test_right_weighted_ipv4_address),
81+
Case("Null IPv4 address", test_null_ipv4_address),
82+
83+
Case("Simple IPv6 address", test_simple_ipv6_address),
84+
Case("Left-weighted IPv6 address", test_left_weighted_ipv6_address),
85+
Case("Right-weighted IPv6 address", test_right_weighted_ipv6_address),
86+
Case("Hollowed IPv6 address", test_hollowed_ipv6_address),
87+
Case("Null IPv6 address", test_null_ipv6_address),
88+
};
89+
90+
Specification specification(test_setup, cases);
91+
92+
int main() {
93+
return !Harness::run(specification);
94+
}

cmsis/core_cm0.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -197,6 +197,14 @@
197197
#define __O volatile /*!< Defines 'write only' permissions */
198198
#define __IO volatile /*!< Defines 'read / write' permissions */
199199

200+
#ifdef __cplusplus
201+
#define __IM volatile /*!< Defines 'read only' permissions */
202+
#else
203+
#define __IM volatile const /*!< Defines 'read only' permissions */
204+
#endif
205+
#define __OM volatile /*!< Defines 'write only' permissions */
206+
#define __IOM volatile /*!< Defines 'read / write' permissions */
207+
200208
/*@} end of group Cortex_M0 */
201209

202210

cmsis/core_cm0plus.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -207,6 +207,14 @@
207207
#define __O volatile /*!< Defines 'write only' permissions */
208208
#define __IO volatile /*!< Defines 'read / write' permissions */
209209

210+
#ifdef __cplusplus
211+
#define __IM volatile /*!< Defines 'read only' permissions */
212+
#else
213+
#define __IM volatile const /*!< Defines 'read only' permissions */
214+
#endif
215+
#define __OM volatile /*!< Defines 'write only' permissions */
216+
#define __IOM volatile /*!< Defines 'read / write' permissions */
217+
210218
/*@} end of group Cortex-M0+ */
211219

212220

cmsis/core_cm3.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -202,6 +202,14 @@
202202
#define __O volatile /*!< Defines 'write only' permissions */
203203
#define __IO volatile /*!< Defines 'read / write' permissions */
204204

205+
#ifdef __cplusplus
206+
#define __IM volatile /*!< Defines 'read only' permissions */
207+
#else
208+
#define __IM volatile const /*!< Defines 'read only' permissions */
209+
#endif
210+
#define __OM volatile /*!< Defines 'write only' permissions */
211+
#define __IOM volatile /*!< Defines 'read / write' permissions */
212+
205213
/*@} end of group Cortex_M3 */
206214

207215

cmsis/core_cm4.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -248,6 +248,14 @@
248248
#define __O volatile /*!< Defines 'write only' permissions */
249249
#define __IO volatile /*!< Defines 'read / write' permissions */
250250

251+
#ifdef __cplusplus
252+
#define __IM volatile /*!< Defines 'read only' permissions */
253+
#else
254+
#define __IM volatile const /*!< Defines 'read only' permissions */
255+
#endif
256+
#define __OM volatile /*!< Defines 'write only' permissions */
257+
#define __IOM volatile /*!< Defines 'read / write' permissions */
258+
251259
/*@} end of group Cortex_M4 */
252260

253261

cmsis/core_cm7.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -263,6 +263,14 @@
263263
#define __O volatile /*!< Defines 'write only' permissions */
264264
#define __IO volatile /*!< Defines 'read / write' permissions */
265265

266+
#ifdef __cplusplus
267+
#define __IM volatile /*!< Defines 'read only' permissions */
268+
#else
269+
#define __IM volatile const /*!< Defines 'read only' permissions */
270+
#endif
271+
#define __OM volatile /*!< Defines 'write only' permissions */
272+
#define __IOM volatile /*!< Defines 'read / write' permissions */
273+
266274
/*@} end of group Cortex_M7 */
267275

268276

docs/build_profiles.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# Build Profiles
2+
Mbed 5.0 supports three primary build profiles, *default*, *debug* and *small*. When using
3+
the online compiler the *default* profile is used. When building from the command line
4+
the desired profile can be can be selected by adding the ```--profile <profile>```
5+
command line flag. Custom user defined profiles can also be specific by giving the path
6+
the the profile.
7+
8+
## Default profile
9+
* Small and fast code
10+
* Full error information - e.x. asserts have filename and line number
11+
* Hard to follow code flow when using a debugger
12+
13+
## Debug profile
14+
* Easy to step through code with a debugger
15+
* Full error information - e.x. asserts have filename and line number
16+
* Largest and slowest profile
17+
18+
## Small profile
19+
* Smallest profile and still fast
20+
* Minimal error information
21+
* Hard to follow code flow when using a debugger

events/Event.h

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ class Event<void()> {
147147
* @param a0..a4 Arguments to pass to the event
148148
*/
149149
void call() const {
150-
int id = post();
150+
MBED_UNUSED int id = post();
151151
MBED_ASSERT(id);
152152
}
153153

@@ -540,7 +540,7 @@ class Event<void(A0)> {
540540
* @param a0..a4 Arguments to pass to the event
541541
*/
542542
void call(A0 a0) const {
543-
int id = post(a0);
543+
MBED_UNUSED int id = post(a0);
544544
MBED_ASSERT(id);
545545
}
546546

@@ -933,7 +933,7 @@ class Event<void(A0, A1)> {
933933
* @param a0..a4 Arguments to pass to the event
934934
*/
935935
void call(A0 a0, A1 a1) const {
936-
int id = post(a0, a1);
936+
MBED_UNUSED int id = post(a0, a1);
937937
MBED_ASSERT(id);
938938
}
939939

@@ -1326,7 +1326,7 @@ class Event<void(A0, A1, A2)> {
13261326
* @param a0..a4 Arguments to pass to the event
13271327
*/
13281328
void call(A0 a0, A1 a1, A2 a2) const {
1329-
int id = post(a0, a1, a2);
1329+
MBED_UNUSED int id = post(a0, a1, a2);
13301330
MBED_ASSERT(id);
13311331
}
13321332

@@ -1719,7 +1719,7 @@ class Event<void(A0, A1, A2, A3)> {
17191719
* @param a0..a4 Arguments to pass to the event
17201720
*/
17211721
void call(A0 a0, A1 a1, A2 a2, A3 a3) const {
1722-
int id = post(a0, a1, a2, a3);
1722+
MBED_UNUSED int id = post(a0, a1, a2, a3);
17231723
MBED_ASSERT(id);
17241724
}
17251725

@@ -2112,7 +2112,7 @@ class Event<void(A0, A1, A2, A3, A4)> {
21122112
* @param a0..a4 Arguments to pass to the event
21132113
*/
21142114
void call(A0 a0, A1 a1, A2 a2, A3 a3, A4 a4) const {
2115-
int id = post(a0, a1, a2, a3, a4);
2115+
MBED_UNUSED int id = post(a0, a1, a2, a3, a4);
21162116
MBED_ASSERT(id);
21172117
}
21182118

features/FEATURE_BLE/targets/TARGET_ARM_SSG/TARGET_BEETLE/source/ArmGap.cpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,8 +77,13 @@ ble_error_t ArmGap::startAdvertising(const GapAdvertisingParams &params)
7777
return BLE_ERROR_PARAM_OUT_OF_RANGE;
7878
}
7979

80+
/* Peer Addr Type 0 = Public */
81+
uint8_t peerAddrType = 0;
82+
uint8_t peerAddr[6];
83+
memset(peerAddr, 0, 6);
84+
8085
DmAdvSetInterval(params.getInterval(), params.getInterval());
81-
DmAdvStart(params.getAdvertisingType(), params.getTimeout());
86+
DmAdvStart(params.getAdvertisingType(), params.getTimeout(), peerAddrType, peerAddr);
8287

8388
state.advertising = 1;
8489

features/FEATURE_BLE/targets/TARGET_NORDIC/TARGET_NRF5/source/btle/btle.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,10 +58,13 @@ extern "C" {
5858
#include "nRF5xServiceDiscovery.h"
5959
#include "nRF5xCharacteristicDescriptorDiscoverer.h"
6060

61+
6162
bool isEventsSignaled = false;
6263

6364
extern "C" void assert_nrf_callback(uint16_t line_num, const uint8_t *p_file_name);
6465
void app_error_handler(uint32_t error_code, uint32_t line_num, const uint8_t *p_file_name);
66+
extern "C" void SD_EVT_IRQHandler(void); // export the softdevice event handler for registration by nvic-set-vector.
67+
6568

6669
static void btle_handler(ble_evt_t *p_ble_evt);
6770

@@ -112,10 +115,14 @@ static uint32_t signalEvent()
112115
return NRF_SUCCESS;
113116
}
114117

118+
115119
error_t btle_init(void)
116120
{
117121
nrf_clock_lf_cfg_t clockConfiguration;
118122

123+
// register softdevice handler vector
124+
NVIC_SetVector(SD_EVT_IRQn, (uint32_t) SD_EVT_IRQHandler);
125+
119126
// Configure the LF clock according to values provided by btle_clock.h.
120127
// It is input from the chain of the yotta configuration system.
121128
clockConfiguration.source = LFCLK_CONF_SOURCE;

0 commit comments

Comments
 (0)