File tree Expand file tree Collapse file tree 2 files changed +12
-5
lines changed Expand file tree Collapse file tree 2 files changed +12
-5
lines changed Original file line number Diff line number Diff line change 8
8
9
9
DigitalOut led1 (LED1);
10
10
11
+ #define SLEEP_TIME 500 // (msec)
12
+ #define PRINT_AFTER_N_LOOPS 20
13
+
11
14
// main() runs in its own thread in the OS
12
15
int main ()
13
16
{
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 */ );
15
18
19
+ int count = 0 ;
16
20
while (true ) {
17
21
// Blink LED and wait 0.5 seconds
18
22
led1 = !led1;
19
- wait_ms (500 );
23
+ wait_ms (SLEEP_TIME );
20
24
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;
23
31
}
24
32
}
Original file line number Diff line number Diff line change 1
1
{
2
2
"target_overrides" : {
3
3
"*" : {
4
- "platform.stdio-baud-rate" : 115200 ,
5
4
"platform.stack-stats-enabled" : true ,
6
5
"platform.heap-stats-enabled" : true ,
7
6
"platform.cpu-stats-enabled" : true ,
You can’t perform that action at this time.
0 commit comments