Skip to content

use forced_reset_timeout as delay after reset #8309

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 5, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
4 changes: 2 additions & 2 deletions TESTS/mbed_platform/system_reset/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,9 @@ void test_system_reset()

int main(void)
{
GREENTEA_SETUP(2, "system_reset");
GREENTEA_SETUP(30, "system_reset");
test_system_reset();
GREENTEA_TESTSUITE_RESULT(0); // Fail on any error.

return 0;
}
}