Skip to content

Commit

Permalink
samples: boards: nordic: coresight_stm: Improve benchmark
Browse files Browse the repository at this point in the history
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 <krzysztof.chruscinski@nordicsemi.no>
  • Loading branch information
nordic-krch authored and fabiobaltieri committed Sep 27, 2024
1 parent c2454f2 commit c61e92a
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion samples/boards/nordic/coresight_stm/src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,14 @@ LOG_MODULE_REGISTER(app);

#define TEST_LOG(rpt, item) \
({ \
uint32_t key = irq_lock(); \
uint32_t t = k_cycle_get_32(); \
for (uint32_t i = 0; i < rpt; i++) { \
__DEBRACKET item; \
} \
t = k_cycle_get_32() - t; \
k_msleep(200); \
irq_unlock(key); \
k_msleep(400); \
t; \
})

Expand Down

0 comments on commit c61e92a

Please sign in to comment.