Skip to content

Commit 8d5d92f

Browse files
committed
Added notify_start() to indicate test start
Added BusOut test
1 parent bbd9618 commit 8d5d92f

File tree

4 files changed

+32
-0
lines changed

4 files changed

+32
-0
lines changed

libraries/tests/mbed/bus/main.cpp

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
#include "mbed.h"
2+
#include "test_env.h"
3+
4+
BusOut bus1(D0, D1, D2, D3, D4, D5, D6, D7, D8, D9, D10, D11, D12, D13, D14, D15);
5+
BusOut bus2(A5, A4, A3, A2, A1, A0);
6+
int i;
7+
8+
int main()
9+
{
10+
notify_start();
11+
12+
for (i=0; i<=65535; i++) {
13+
bus1 = i;
14+
bus2 = i;
15+
wait(0.0001);
16+
}
17+
18+
notify_completion(true);
19+
}

libraries/tests/mbed/env/test_env.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,10 @@ void led_blink(PinName led, float delay) {
1111
while(1);
1212
}
1313

14+
void notify_start() {
15+
printf("{{start}}" NL);
16+
}
17+
1418
void notify_completion(bool success) {
1519
if (success) {
1620
printf("{{success}}" NL);

libraries/tests/mbed/env/test_env.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88

99
void led_blink(PinName led, float delay);
1010

11+
void notify_start();
12+
1113
void notify_completion(bool success);
1214

1315
#endif

workspace_tools/tests.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -252,6 +252,13 @@
252252
"dependencies": [MBED_LIBRARIES, TEST_MBED_LIB],
253253
"automated": False,
254254
},
255+
{
256+
"id": "MBED_BUS", "description": "Blinky BUS",
257+
"source_dir": join(TEST_DIR, "mbed", "bus"),
258+
"dependencies": [MBED_LIBRARIES, TEST_MBED_LIB],
259+
"automated": False,
260+
"duration": 15,
261+
},
255262

256263
# Size benchmarks
257264
{

0 commit comments

Comments
 (0)