Skip to content

Commit

Permalink
Merge pull request ARMmbed#81 from linlingao/rebase_11_6
Browse files Browse the repository at this point in the history
Rebase to master
  • Loading branch information
linlingao authored Nov 7, 2018
2 parents 878b544 + 960bc6d commit 6059c34
Show file tree
Hide file tree
Showing 1,338 changed files with 222,323 additions and 8,034 deletions.
7 changes: 4 additions & 3 deletions .astyleignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,16 @@ features/cryptocell
features/mbedtls
features/lwipstack/lwip
rtos/TARGET_CORTEX/rtx4
features/filesystem/littlefs/littlefs
features/filesystem/fat/ChaN
features/storage/filesystem/littlefs/littlefs/
features/storage/filesystem/fat/ChaN
features/storage/FEATURE_STORAGE
features/frameworks
features/FEATURE_BLE/targets
features/unsupported/
features/FEATURE_COMMON_PAL/
hal/storage_abstraction
FEATURE_NANOSTACK/coap-service
FEATURE_NANOSTACK/sal-stack-nanostack
rtos/TARGET_CORTEX/rtx5
TESTS/mbed_hal/trng/pithy
targets
tools
41 changes: 27 additions & 14 deletions .github/issue_template.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,22 @@
<!--
************************************** WARNING **************************************
The ciarcom bot parses this header automatically. Any deviation from the
template may cause the bot to automatically correct this header or may result in a
warning message, requesting updates.
Please ensure that nothing follows the Issue request type section, all
issue details are within the Description section and no changes are made to the
template format (as detailed below).
*************************************************************************************
-->

### Description
<!--

<!--
Required
Add detailed description of what you are reporting.
Good example: https://os.mbed.com/docs/latest/reference/workflow.html
Expand All @@ -13,19 +30,15 @@


### Issue request type
<!--

<!--
Required
Please add only one X to one of the following types. Do not fill multiple types. (Split the issue otherwise.)
Please note this is not a GitHub task list; indenting the boxes or changing the format to add a '.' or '*' in front
of them changes the meaning incorrectly. The only changes to make are to add a description under the
description heading and to add an 'x' to the correct box.
[X] Question
[ ] Enhancement
[ ] Bug
Please add only one X to one of the following types. Do not fill multiple types (split the issue otherwise.)
Please note this is not a GitHub task list, indenting the boxes or changing the format to add a '.' or '*' in front
of them would change the meaning incorrectly. The only changes to be made are to add a description text under the
description heading and to add a 'x' to the correct box.
-->

[ ] Question
[ ] Enhancement
[ ] Bug
[ ] Question
[ ] Enhancement
[ ] Bug

2 changes: 2 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,7 @@
[ ] Refactor
[ ] Target update
[ ] Functionality change
[ ] Docs update
[ ] Test update
[ ] Breaking change

21 changes: 16 additions & 5 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,15 +51,25 @@ matrix:
# Print versions we use
- doxygen --version
before_script:
# Build doxygen
- >
(git clone --depth=1 --single-branch --branch Release_1_8_14 https://github.com/doxygen/doxygen;
cd doxygen;
mkdir build;
cd build;
cmake -G "Unix Makefiles" ..;
make;
sudo make install)
# Create BUILD directory for tests
- mkdir BUILD
script:
# Assert that the Doxygen build produced no warnings.
# The strange command below asserts that the Doxygen command had an
# output of zero length
- >
doxygen doxyfile_options 2>&1 |
tee BUILD/doxygen.out && [ ! -s BUILD/doxygen.out ]
- doxygen doxyfile_options 2>&1
# Once Mbed OS has been fixed, enable the full test by replacing the top line with this:
# - ( ! doxygen doxyfile_options 2>&1 | grep . )

# Assert that all binary libraries are named correctly
# The strange command below asserts that there are exactly 0 libraries
# that do not start with lib
Expand All @@ -86,6 +96,7 @@ matrix:

- arm-none-eabi-gcc --version
- python --version
- pip list --verbose
script:
# Run local testing on tools
- PYTHONPATH=. coverage run -a -m pytest tools/test
Expand Down Expand Up @@ -132,10 +143,10 @@ matrix:
# update status if we succeeded, compare with master if possible
- |
CURR=$(cat astyle-branch.out | grep Formatted | wc -l)
PREV=$(curl https://api.github.com/repos/$TRAVIS_REPO_SLUG/status/master \
PREV=$(curl -u "$MBED_BOT" https://api.github.com/repos/$TRAVIS_REPO_SLUG/status/master \
| jq -re "select(.sha != \"$TRAVIS_COMMIT\")
| .statuses[] | select(.context == \"travis-ci/$NAME\").description
| capture(\", (?<files>[0-9]+) files\").warnings" \
| capture(\", (?<files>[0-9]+) files\").files" \
|| echo 0)
STATUSM="Passed, ${CURR} files"
Expand Down
46 changes: 3 additions & 43 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,45 +1,5 @@
# Description
This document is cheat sheet for everyone who wants to contribute to [ARMmbed/mbed-os](https://github.com/ARMmbed/mbed-os) GitHub repository at GitHub.
All changes in code base should originate from GitHub Issues and take advantage of existing GitHub flows. Goal is to attract contributors and allow them contribute to code and documentation at the same time.
# Contributing to Mbed OS

Guidelines from this document are created to help new and existing contributors understand process workflow and align to project rules before pull request is submitted. It explains how a participant should do things like format code, test fixes, and submit patches.
Mbed OS is an open-source, device software platform for the Internet of Things. Contributions are an important part of the platform, and our goal is to make it as simple as possible to become a contributor.

## Where to get more information?
You can read more on our [documentation page](https://docs.mbed.com/docs/mbed-os-handbook/en/latest/cont/contributing/).

# How to contribute
We really appreciate your contributions! We are Open Source project and we need your help. We want to keep it as easy as possible to contribute changes that get things working in your environment. There are a few guidelines that we need contributors to follow so that we can have a chance of keeping on top of things.

Before a pull request will be merged, the [mbed Contributor Agreement](http://developer.mbed.org/contributor_agreement/) must be signed.

You can pick up existing [mbed-os GitHub Issue](https://github.com/ARMmbed/mbed-os/issues) and solve it or implement new feature you find important, attractive or just necessary. We will review your proposal via pull request mechanism, give you comments and merge your changes if we decide your contribution satisfy criteria such as quality.

# Enhancements vs Bugs
Enhancements are:
* New features implementation.
* Code refactoring.
* Coding rules, coding styles improvements.
* Code comments improvement.
* Documentation work.

Bugs are:
* Issues rose internally or externally by [ARMmbed/mbed-os](https://github.com/ARMmbed/mbed-os) users.
* Internally (within mbed team) created issues from Continuous Integration pipeline and build servers.
* Issues detected using automation tools such as compilers, sanitizers, static code analysis tools etc.

# Gate Keeper role
Gate Keeper is a person responsible for GitHub process workflow execution and is responsible for repository / project code base. Gate Keeper is also responsible for code (pull request) quality stamp and approves or rejects code changes in project’s code base.

Gate Keepers will review your pull request code, give you comments in pull request comment section and in the end if everything goes well merge your pull request to one of our branches (most probably default ```master``` branch).

Please be patient, digest Gate Keeper's feedback and respond promptly :)

# mbed SDK porting
* For more information regarding mbed SDK porting please refer to [mbed SDK porting](http://developer.mbed.org/handbook/mbed-SDK-porting) handbook.
* Before starting the mbed SDK porting, you might want to familiarize with the [mbed SDK library internals](http://developer.mbed.org/handbook/mbed-library-internals) first.

# Glossary
* Gate Keeper – persons responsible for overall code-base quality of [ARMmbed/mbed-os](https://github.com/ARMmbed/mbed-os) project.
* Enhancement – New feature deployment, code refactoring actions or existing code improvements.
* Bugfix – Issues originated from GitHub Issues pool, raised internally within mbed classic team or issues from automated code validators like linters, static code analysis tools etc.
* Mbed classic – mbed SDK 2.0 located in GitHub at [ARMmbed/mbed-os](https://github.com/ARMmbed/mbed-os).
To encourage productive collaboration, as well as robust, consistent and maintainable code, we have a set of guidelines for contributing to Mbed OS. Please see: [contributing guidelines](https://os.mbed.com/docs/latest/reference/contributing.html).
2 changes: 1 addition & 1 deletion TESTS/host_tests/rtc_reset.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ class RtcResetTest(BaseHostTest):
"""

"""Start of the RTC"""
START_TIME = 50000
START_TIME = 1537789823 # GMT: Monday, 24 September 2018 11:50:23
START_TIME_TOLERANCE = 10
"""Time to delay after sending reset"""
DELAY_TIME = 5.0
Expand Down
13 changes: 6 additions & 7 deletions TESTS/host_tests/system_reset.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,6 @@ class SystemResetTest(BaseHostTest):
def __init__(self):
super(SystemResetTest, self).__init__()
self.reset = False
cycle_s = self.get_config_item('program_cycle_s')
self.program_cycle_s = cycle_s if cycle_s is not None else DEFAULT_CYCLE_PERIOD

self.test_steps_sequence = self.test_steps()
# Advance the coroutine to it's first yield statement.
self.test_steps_sequence.send(None)
Expand All @@ -61,16 +58,18 @@ def test_steps(self):
"""Reset the device and check the status
"""
system_reset = yield

self.reset = False

wait_after_reset = self.get_config_item('forced_reset_timeout')
wait_after_reset = wait_after_reset if wait_after_reset is not None else DEFAULT_CYCLE_PERIOD

self.send_kv(MSG_KEY_DEVICE_RESET, MSG_VALUE_DUMMY)
time.sleep(self.program_cycle_s)
time.sleep(wait_after_reset)
self.send_kv(MSG_KEY_SYNC, MSG_VALUE_DUMMY)

system_reset = yield

if self.reset == False:
raise RuntimeError('Platform did not reset as expected.')

# The sequence is correct -- test passed.
yield True
yield True
1 change: 1 addition & 0 deletions TESTS/lorawan/loraradio/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@


using namespace utest::v1;
using namespace mbed;

static LoRaRadio *radio = NULL;
rtos::Semaphore event_sem(0);
Expand Down
2 changes: 1 addition & 1 deletion TESTS/mbed_drivers/crc/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ void test_thread(void)
char test[] = "123456789";
uint32_t crc;
MbedCRC<POLY_32BIT_ANSI, 32> ct;
TEST_ASSERT_EQUAL(0, ct.compute((void *)test, strlen((const char*)test), &crc));
TEST_ASSERT_EQUAL(0, ct.compute((void *)test, strlen((const char *)test), &crc));
TEST_ASSERT_EQUAL(0xCBF43926, crc);
}

Expand Down
4 changes: 2 additions & 2 deletions TESTS/mbed_drivers/lp_ticker/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ void test_multi_ticker(void)
ticker[i].attach_us(callback(increment_multi_counter), MULTI_TICKER_TIME_MS * 1000);
}

Thread::wait(MULTI_TICKER_TIME_MS + extra_wait);
ThisThread::sleep_for(MULTI_TICKER_TIME_MS + extra_wait);
TEST_ASSERT_EQUAL(TICKER_COUNT, multi_counter);

for (int i = 0; i < TICKER_COUNT; i++) {
Expand All @@ -95,7 +95,7 @@ void test_multi_ticker(void)
ticker[i].attach_us(callback(increment_multi_counter), (MULTI_TICKER_TIME_MS + i) * 1000);
}

Thread::wait(MULTI_TICKER_TIME_MS + TICKER_COUNT + extra_wait);
ThisThread::sleep_for(MULTI_TICKER_TIME_MS + TICKER_COUNT + extra_wait);
TEST_ASSERT_EQUAL(TICKER_COUNT, multi_counter);

for (int i = 0; i < TICKER_COUNT; i++) {
Expand Down
6 changes: 3 additions & 3 deletions TESTS/mbed_drivers/mem_trace/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@
#include <stdio.h>
#include <stdarg.h>

#if !MBED_MEM_TRACING_ENABLED
#error [NOT_SUPPORTED] test not supported
#ifndef MBED_MEM_TRACING_ENABLED
#error [NOT_SUPPORTED] test not supported
#endif

using utest::v1::Case;
Expand Down Expand Up @@ -391,7 +391,7 @@ static void test_case_multithread_malloc_free()
threads[i].start(callback(malloc_free, &threads_continue));
}

Thread::wait(wait_time_us);
ThisThread::sleep_for(wait_time_us);
threads_continue = false;

for (int i = 0; i < NUM_TEST_THREADS; i++) {
Expand Down
8 changes: 4 additions & 4 deletions TESTS/mbed_drivers/race_test/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,13 +39,13 @@ class TestClass {
public:
TestClass()
{
Thread::wait(500);
ThisThread::sleep_for(500);
instance_count++;
}

void do_something()
{
Thread::wait(100);
ThisThread::sleep_for(100);
}

~TestClass()
Expand Down Expand Up @@ -83,7 +83,7 @@ void test_case_func_race()
// Start start first thread
t1.start(cb);
// Start second thread while the first is inside the constructor
Thread::wait(250);
ThisThread::sleep_for(250);
t2.start(cb);

// Wait for the threads to finish
Expand All @@ -105,7 +105,7 @@ void test_case_class_race()
// Start start first thread
t1.start(cb);
// Start second thread while the first is inside the constructor
Thread::wait(250);
ThisThread::sleep_for(250);
t2.start(cb);

// Wait for the threads to finish
Expand Down
4 changes: 2 additions & 2 deletions TESTS/mbed_drivers/ticker/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ void test_multi_ticker(void)
ticker[i].attach_us(callback(increment_multi_counter), MULTI_TICKER_TIME_MS * 1000);
}

Thread::wait(MULTI_TICKER_TIME_MS + extra_wait);
ThisThread::sleep_for(MULTI_TICKER_TIME_MS + extra_wait);
TEST_ASSERT_EQUAL(TICKER_COUNT, multi_counter);

for (int i = 0; i < TICKER_COUNT; i++) {
Expand All @@ -211,7 +211,7 @@ void test_multi_ticker(void)
ticker[i].attach_us(callback(increment_multi_counter), (MULTI_TICKER_TIME_MS + i) * 1000);
}

Thread::wait(MULTI_TICKER_TIME_MS + TICKER_COUNT + extra_wait);
ThisThread::sleep_for(MULTI_TICKER_TIME_MS + TICKER_COUNT + extra_wait);
TEST_ASSERT_EQUAL(TICKER_COUNT, multi_counter);

for (int i = 0; i < TICKER_COUNT; i++) {
Expand Down
2 changes: 1 addition & 1 deletion TESTS/mbed_drivers/timeout/timeout_tests.h
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ void test_multiple(void)
for (size_t i = 0; i < NUM_TIMEOUTS; i++) {
timeouts[i].attach_callback(mbed::callback(cnt_callback, &callback_count), TEST_DELAY_US);
}
Thread::wait(TEST_DELAY_MS + 2);
ThisThread::sleep_for(TEST_DELAY_MS + 2);
TEST_ASSERT_EQUAL(NUM_TIMEOUTS, callback_count);
}

Expand Down
7 changes: 5 additions & 2 deletions TESTS/mbed_hal/critical_section/critical_section_test.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,11 @@
* limitations under the License.
*/

/** \addtogroup hal_critical_tests
/** \addtogroup hal_critical
* @{
* \defgroup hal_critical_test Tests
* Tests definitions of the HAL Critical module.
* @{
*/

#ifndef MBED_CRITICAL_SECTION_TEST_H
Expand Down Expand Up @@ -45,7 +48,7 @@
template <int N>
void test_critical_section();


/**@}*/
/**@}*/

#endif // MBED_CRITICAL_SECTION_TEST_H
Loading

0 comments on commit 6059c34

Please sign in to comment.