Skip to content

Commit d5531b1

Browse files
author
deepikabhavnani
committed
Set the baudrate to default and reduce prints in blinky
1 parent 2b2aee4 commit d5531b1

File tree

2 files changed

+12
-5
lines changed

2 files changed

+12
-5
lines changed

main.cpp

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,17 +8,25 @@
88

99
DigitalOut led1(LED1);
1010

11+
#define SLEEP_TIME 500 // (msec)
12+
#define PRINT_AFTER_N_LOOPS 20
13+
1114
// main() runs in its own thread in the OS
1215
int main()
1316
{
14-
SystemReport sys_state(500 /* Loop delay time in ms */);
17+
SystemReport sys_state( SLEEP_TIME * PRINT_AFTER_N_LOOPS /* Loop delay time in ms */);
1518

19+
int count = 0;
1620
while (true) {
1721
// Blink LED and wait 0.5 seconds
1822
led1 = !led1;
19-
wait_ms(500);
23+
wait_ms(SLEEP_TIME);
2024

21-
// Following the main thread wait, report on the current system status
22-
sys_state.report_state();
25+
if ((0 == count) || (PRINT_AFTER_N_LOOPS == count)) {
26+
// Following the main thread wait, report on the current system status
27+
sys_state.report_state();
28+
count = 0;
29+
}
30+
++count;
2331
}
2432
}

mbed_app.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
{
22
"target_overrides": {
33
"*": {
4-
"platform.stdio-baud-rate": 115200,
54
"platform.stack-stats-enabled": true,
65
"platform.heap-stats-enabled": true,
76
"platform.cpu-stats-enabled": true,

0 commit comments

Comments
 (0)