Skip to content

Commit

Permalink
Merge pull request #2714 from adbridge/mbed-os-5.1
Browse files Browse the repository at this point in the history
Release mbed-os-5.1.4 and mbed lib v126
  • Loading branch information
sg- authored Sep 16, 2016
2 parents bdab10d + 6caef39 commit 21dd700
Show file tree
Hide file tree
Showing 338 changed files with 42,479 additions and 4,133 deletions.
48 changes: 48 additions & 0 deletions .github/issue_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
Note: This is just a template, so feel free to use/remove the unnecessary things

### Description
- Type: Bug | Enhancement | Question
- Related issue: `#abc`
- Priority: Blocker | Major | Minor

---------------------------------------------------------------
## Bug

**Target**
K64F|??

**Toolchain:**
GCC_ARM|ARM|IAR

**Toolchain version:**

**mbed-cli version:**
(`mbed --version`)

**meed-os sha:**
(`git log -n1 --oneline`)

**DAPLink version:**

**Expected behavior**

**Actual behavior**

**Steps to reproduce**

----------------------------------------------------------------
## Enhancement

**Reason to enhance or problem with existing solution**

**Suggested enhancement**

**Pros**

**Cons**

-----------------------------------------------------------------

## Question

**How to?**
39 changes: 39 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
Notes:
* 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).
* This is just a template, so feel free to use/remove the unnecessary things

## Description
A few sentences describing the overall goals of the pull request's commits.


## Status
**READY/IN DEVELOPMENT/HOLD**


## Migrations
If this PR changes any APIs or behaviors, give a short description of what *API users* should do when this PR is merged.

YES | NO


## Related PRs
List related PRs against other branches:

branch | PR
------ | ------
other_pr_production | [link]()
other_pr_master | [link]()


## Todos
- [ ] Tests
- [ ] Documentation


## Deploy notes
Notes regarding the deployment of this PR. These should note any
required changes in the build environment, tools, compilers, etc.


## Steps to test or reproduce
Outline the steps to test or reproduce the PR here.
106 changes: 106 additions & 0 deletions TESTS/host_tests/timing_drift_auto.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
"""
mbed SDK
Copyright (c) 2011-2013 ARM Limited
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
"""

from mbed_host_tests import BaseHostTest


class TimingDriftTest(BaseHostTest):
""" This test is reading single characters from stdio
and measures time between their occurrences.
"""
__result = None

# This is calculated later: average_drift_max * number of tick events
total_drift_max = None

average_drift_max = 0.05
ticks = []
start_time = None
finish_time = None
dut_seconds_passed = None
total_time = None
total_drift = None
average_drift = None

def _callback_result(self, key, value, timestamp):
# We should not see result data in this test
self.__result = False

def _callback_end(self, key, value, timestamp):
""" {{end;%s}}} """
self.log("Received end event, timestamp: %f" % timestamp)
self.notify_complete(result=self.result(print_stats=True))


def _callback_tick(self, key, value, timestamp):
""" {{tick;%d}}} """
self.log("tick! %f" % timestamp)
self.ticks.append((key, value, timestamp))


def setup(self):
self.register_callback("end", self._callback_end)
self.register_callback('tick', self._callback_tick)


def result(self, print_stats=True):
self.dut_seconds_passed = len(self.ticks) - 1

if self.dut_seconds_passed < 1:
if print_stats:
self.log("FAIL: failed to receive at least two tick events")
self.__result = False
return self.__result

self.total_drift_max = self.dut_seconds_passed * self.average_drift_max

self.start_time = self.ticks[0][2]
self.finish_time = self.ticks[-1][2]
self.total_time = self.finish_time - self.start_time
self.total_drift = self.total_time - self.dut_seconds_passed
self.average_drift = self.total_drift / self.dut_seconds_passed

if print_stats:
self.log("Start: %f" % self.start_time)
self.log("Finish: %f" % self.finish_time)
self.log("Total time taken: %f" % self.total_time)

total_drift_ratio_string = "Total drift/Max total drift: %f/%f"
self.log(total_drift_ratio_string % (self.total_drift,
self.total_drift_max))

average_drift_ratio_string = "Average drift/Max average drift: %f/%f"
self.log(average_drift_ratio_string % (self.average_drift,
self.average_drift_max))


if abs(self.total_drift) > self.total_drift_max:
if print_stats:
self.log("FAIL: Total drift exceeded max total drift")
self.__result = False
elif self.average_drift > self.average_drift_max:
if print_stats:
self.log("FAIL: Average drift exceeded max average drift")
self.__result = False
else:
self.__result = True

return self.__result


def teardown(self):
pass
29 changes: 0 additions & 29 deletions TESTS/integration/threaded_blinky/main.cpp

This file was deleted.

8 changes: 6 additions & 2 deletions TESTS/mbed_drivers/lp_timeout/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,15 @@ void lp_timeout_1s_deepsleep(void)
{
complete = false;

timestamp_t start = us_ticker_read();
/*
* We use here lp_ticker_read() instead of us_ticker_read() for start and
* end because the microseconds timer might be disable during deepsleep.
*/
timestamp_t start = lp_ticker_read();
lpt.attach(&cb_done, 1);
deepsleep();
while (!complete);
timestamp_t end = us_ticker_read();
timestamp_t end = lp_ticker_read();

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

0 comments on commit 21dd700

Please sign in to comment.