Skip to content

Commit 09b8d7f

Browse files
cypress-neilvmedcy
authored andcommitted
Fix error in tests-mbed_drivers-ticker when LED not available
1 parent a415dfa commit 09b8d7f

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

TESTS/mbed_drivers/ticker/main.cpp

+9-3
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,9 @@ void ticker_callback_1(void)
7171
void ticker_callback_2(void)
7272
{
7373
++callback_trigger_count;
74-
switch_led2_state();
74+
if (LED2 != NC) {
75+
switch_led2_state();
76+
}
7577
}
7678

7779

@@ -110,7 +112,9 @@ void test_case_1x_ticker()
110112
Ticker ticker;
111113

112114
led1 = 1;
113-
led2 = 1;
115+
if (LED2 != NC) {
116+
led2 = 1;
117+
}
114118
callback_trigger_count = 0;
115119

116120
greentea_send_kv("timing_drift_check_start", 0);
@@ -151,7 +155,9 @@ void test_case_2x_ticker()
151155
Ticker ticker1, ticker2;
152156

153157
led1 = 0;
154-
led2 = 1;
158+
if (LED2 != NC) {
159+
led2 = 1;
160+
}
155161
callback_trigger_count = 0;
156162

157163
ticker1.attach_us(ticker_callback_1, 2 * ONE_MILLI_SEC);

0 commit comments

Comments
 (0)