Skip to content

Commit 21dd700

Browse files
authored
Merge pull request #2714 from adbridge/mbed-os-5.1
Release mbed-os-5.1.4 and mbed lib v126
2 parents bdab10d + 6caef39 commit 21dd700

File tree

338 files changed

+42479
-4133
lines changed

Some content is hidden

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

338 files changed

+42479
-4133
lines changed

.github/issue_template.md

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
Note: This is just a template, so feel free to use/remove the unnecessary things
2+
3+
### Description
4+
- Type: Bug | Enhancement | Question
5+
- Related issue: `#abc`
6+
- Priority: Blocker | Major | Minor
7+
8+
---------------------------------------------------------------
9+
## Bug
10+
11+
**Target**
12+
K64F|??
13+
14+
**Toolchain:**
15+
GCC_ARM|ARM|IAR
16+
17+
**Toolchain version:**
18+
19+
**mbed-cli version:**
20+
(`mbed --version`)
21+
22+
**meed-os sha:**
23+
(`git log -n1 --oneline`)
24+
25+
**DAPLink version:**
26+
27+
**Expected behavior**
28+
29+
**Actual behavior**
30+
31+
**Steps to reproduce**
32+
33+
----------------------------------------------------------------
34+
## Enhancement
35+
36+
**Reason to enhance or problem with existing solution**
37+
38+
**Suggested enhancement**
39+
40+
**Pros**
41+
42+
**Cons**
43+
44+
-----------------------------------------------------------------
45+
46+
## Question
47+
48+
**How to?**

.github/pull_request_template.md

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
Notes:
2+
* Pull requests will not be accepted until the submitter has agreed to the [contributer agreement](https://github.com/ARMmbed/mbed-os/blob/master/CONTRIBUTING.md).
3+
* This is just a template, so feel free to use/remove the unnecessary things
4+
5+
## Description
6+
A few sentences describing the overall goals of the pull request's commits.
7+
8+
9+
## Status
10+
**READY/IN DEVELOPMENT/HOLD**
11+
12+
13+
## Migrations
14+
If this PR changes any APIs or behaviors, give a short description of what *API users* should do when this PR is merged.
15+
16+
YES | NO
17+
18+
19+
## Related PRs
20+
List related PRs against other branches:
21+
22+
branch | PR
23+
------ | ------
24+
other_pr_production | [link]()
25+
other_pr_master | [link]()
26+
27+
28+
## Todos
29+
- [ ] Tests
30+
- [ ] Documentation
31+
32+
33+
## Deploy notes
34+
Notes regarding the deployment of this PR. These should note any
35+
required changes in the build environment, tools, compilers, etc.
36+
37+
38+
## Steps to test or reproduce
39+
Outline the steps to test or reproduce the PR here.

TESTS/host_tests/timing_drift_auto.py

Lines changed: 106 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,106 @@
1+
"""
2+
mbed SDK
3+
Copyright (c) 2011-2013 ARM Limited
4+
5+
Licensed under the Apache License, Version 2.0 (the "License");
6+
you may not use this file except in compliance with the License.
7+
You may obtain a copy of the License at
8+
9+
http://www.apache.org/licenses/LICENSE-2.0
10+
11+
Unless required by applicable law or agreed to in writing, software
12+
distributed under the License is distributed on an "AS IS" BASIS,
13+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
See the License for the specific language governing permissions and
15+
limitations under the License.
16+
"""
17+
18+
from mbed_host_tests import BaseHostTest
19+
20+
21+
class TimingDriftTest(BaseHostTest):
22+
""" This test is reading single characters from stdio
23+
and measures time between their occurrences.
24+
"""
25+
__result = None
26+
27+
# This is calculated later: average_drift_max * number of tick events
28+
total_drift_max = None
29+
30+
average_drift_max = 0.05
31+
ticks = []
32+
start_time = None
33+
finish_time = None
34+
dut_seconds_passed = None
35+
total_time = None
36+
total_drift = None
37+
average_drift = None
38+
39+
def _callback_result(self, key, value, timestamp):
40+
# We should not see result data in this test
41+
self.__result = False
42+
43+
def _callback_end(self, key, value, timestamp):
44+
""" {{end;%s}}} """
45+
self.log("Received end event, timestamp: %f" % timestamp)
46+
self.notify_complete(result=self.result(print_stats=True))
47+
48+
49+
def _callback_tick(self, key, value, timestamp):
50+
""" {{tick;%d}}} """
51+
self.log("tick! %f" % timestamp)
52+
self.ticks.append((key, value, timestamp))
53+
54+
55+
def setup(self):
56+
self.register_callback("end", self._callback_end)
57+
self.register_callback('tick', self._callback_tick)
58+
59+
60+
def result(self, print_stats=True):
61+
self.dut_seconds_passed = len(self.ticks) - 1
62+
63+
if self.dut_seconds_passed < 1:
64+
if print_stats:
65+
self.log("FAIL: failed to receive at least two tick events")
66+
self.__result = False
67+
return self.__result
68+
69+
self.total_drift_max = self.dut_seconds_passed * self.average_drift_max
70+
71+
self.start_time = self.ticks[0][2]
72+
self.finish_time = self.ticks[-1][2]
73+
self.total_time = self.finish_time - self.start_time
74+
self.total_drift = self.total_time - self.dut_seconds_passed
75+
self.average_drift = self.total_drift / self.dut_seconds_passed
76+
77+
if print_stats:
78+
self.log("Start: %f" % self.start_time)
79+
self.log("Finish: %f" % self.finish_time)
80+
self.log("Total time taken: %f" % self.total_time)
81+
82+
total_drift_ratio_string = "Total drift/Max total drift: %f/%f"
83+
self.log(total_drift_ratio_string % (self.total_drift,
84+
self.total_drift_max))
85+
86+
average_drift_ratio_string = "Average drift/Max average drift: %f/%f"
87+
self.log(average_drift_ratio_string % (self.average_drift,
88+
self.average_drift_max))
89+
90+
91+
if abs(self.total_drift) > self.total_drift_max:
92+
if print_stats:
93+
self.log("FAIL: Total drift exceeded max total drift")
94+
self.__result = False
95+
elif self.average_drift > self.average_drift_max:
96+
if print_stats:
97+
self.log("FAIL: Average drift exceeded max average drift")
98+
self.__result = False
99+
else:
100+
self.__result = True
101+
102+
return self.__result
103+
104+
105+
def teardown(self):
106+
pass

TESTS/integration/threaded_blinky/main.cpp

Lines changed: 0 additions & 29 deletions
This file was deleted.

TESTS/mbed_drivers/lp_timeout/main.cpp

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,11 +43,15 @@ void lp_timeout_1s_deepsleep(void)
4343
{
4444
complete = false;
4545

46-
timestamp_t start = us_ticker_read();
46+
/*
47+
* We use here lp_ticker_read() instead of us_ticker_read() for start and
48+
* end because the microseconds timer might be disable during deepsleep.
49+
*/
50+
timestamp_t start = lp_ticker_read();
4751
lpt.attach(&cb_done, 1);
4852
deepsleep();
4953
while (!complete);
50-
timestamp_t end = us_ticker_read();
54+
timestamp_t end = lp_ticker_read();
5155

5256
/* It takes longer to wake up from deep sleep */
5357
TEST_ASSERT_UINT32_WITHIN(LONG_TIMEOUT, 1000000, end - start);

0 commit comments

Comments
 (0)