Skip to content

Commit 43d03b7

Browse files
nordic-krchnordic-segl
authored andcommitted
[nrf fromtree] samples: boards: nordic: coresight_stm: Improve benchmark
Add interrupt locking during test to ensure that main thread is not interrupts which would impact the test. Add longer sleep time between tests to ensure that all logs are processed on time and not dropped. Signed-off-by: Krzysztof Chruściński <[email protected]> (cherry picked from commit c61e92a)
1 parent b10cdab commit 43d03b7

File tree

1 file changed

+3
-1
lines changed
  • samples/boards/nordic/coresight_stm/src

1 file changed

+3
-1
lines changed

samples/boards/nordic/coresight_stm/src/main.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,14 @@ LOG_MODULE_REGISTER(app);
1616

1717
#define TEST_LOG(rpt, item) \
1818
({ \
19+
uint32_t key = irq_lock(); \
1920
uint32_t t = k_cycle_get_32(); \
2021
for (uint32_t i = 0; i < rpt; i++) { \
2122
__DEBRACKET item; \
2223
} \
2324
t = k_cycle_get_32() - t; \
24-
k_msleep(200); \
25+
irq_unlock(key); \
26+
k_msleep(400); \
2527
t; \
2628
})
2729

0 commit comments

Comments
 (0)