Skip to content

Fix error in tests-mbed_drivers-ticker when LED2 is not connected #10976

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
Jul 9, 2019
Merged
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
12 changes: 9 additions & 3 deletions TESTS/mbed_drivers/ticker/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,9 @@ void ticker_callback_1(void)
void ticker_callback_2(void)
{
++callback_trigger_count;
switch_led2_state();
if (LED2 != NC) {
switch_led2_state();
}
}


Expand Down Expand Up @@ -110,7 +112,9 @@ void test_case_1x_ticker()
Ticker ticker;

led1 = 1;
led2 = 1;
if (LED2 != NC) {
led2 = 1;
}
callback_trigger_count = 0;

greentea_send_kv("timing_drift_check_start", 0);
Expand Down Expand Up @@ -151,7 +155,9 @@ void test_case_2x_ticker()
Ticker ticker1, ticker2;

led1 = 0;
led2 = 1;
if (LED2 != NC) {
led2 = 1;
}
callback_trigger_count = 0;

ticker1.attach_us(ticker_callback_1, 2 * ONE_MILLI_SEC);
Expand Down