Skip to content

Commit 74f6f7f

Browse files
thugheskartben
authored andcommitted
tests: kernel: interrupt: Remove MS_TO_US
No files use MS_TO_US except tests/kernel/interrupt/src/nested_irq.c. While the macro is convenient, we should put it in a more central location and use it everywhere if we want to use it rather than just in interrupt_util.h. For now, remove it and replace the two usages to match how code is written in the rest of Zephyr. Signed-off-by: Tom Hughes <[email protected]>
1 parent 9e1bf0b commit 74f6f7f

File tree

2 files changed

+2
-4
lines changed

2 files changed

+2
-4
lines changed

subsys/testsuite/include/zephyr/interrupt_util.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,6 @@
77
#ifndef INTERRUPT_UTIL_H_
88
#define INTERRUPT_UTIL_H_
99

10-
#define MS_TO_US(ms) (ms * USEC_PER_MSEC)
11-
1210
#if defined(CONFIG_CPU_CORTEX_M)
1311
#include <cmsis_core.h>
1412

tests/kernel/interrupt/src/nested_irq.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ void isr0(const void *param)
112112
trigger_irq(irq_line_1);
113113

114114
/* Wait for interrupt */
115-
k_busy_wait(MS_TO_US(DURATION));
115+
k_busy_wait(DURATION * USEC_PER_MSEC);
116116

117117
/* Validate nested ISR result token */
118118
zassert_equal(isr1_result, ISR1_TOKEN, "isr1 did not execute");
@@ -160,7 +160,7 @@ ZTEST(interrupt_feature, test_nested_isr)
160160
trigger_irq(irq_line_0);
161161

162162
/* Wait for interrupt */
163-
k_busy_wait(MS_TO_US(DURATION));
163+
k_busy_wait(DURATION * USEC_PER_MSEC);
164164

165165
/* Validate ISR result token */
166166
zassert_equal(isr0_result, ISR0_TOKEN, "isr0 did not execute");

0 commit comments

Comments
 (0)