Skip to content

Commit 48d80ef

Browse files
Martinhoff-makercfriedt
authored andcommitted
tests: app_dev: ram_context_for_isr: update IRQ configuration
This commit modifies the IRQ number and priority definitions in the fake_driver.c file to accommodate different platform configurations. The condition are based on nested_irq test file. Signed-off-by: Martin Hoff <[email protected]>
1 parent a4fa5de commit 48d80ef

File tree

3 files changed

+20
-4
lines changed

3 files changed

+20
-4
lines changed

tests/application_development/ram_context_for_isr/include/fake_driver.h

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,25 @@
1111
extern "C" {
1212
#endif
1313

14+
#ifdef CONFIG_BOARD_QEMU_CORTEX_M3
15+
16+
#define TEST_IRQ_NUM 42
17+
#define TEST_IRQ_PRIO 1
18+
19+
#elif defined(CONFIG_GIC)
20+
/*
21+
* For the platforms that use the ARM GIC, use the SGI (software generated
22+
* interrupt) line 14 for testing.
23+
*/
24+
#define TEST_IRQ_NUM 14
25+
#define TEST_IRQ_PRIO IRQ_DEFAULT_PRIORITY
26+
27+
#else
28+
/* For all the other platforms, use the last available IRQ line for testing. */
29+
#define TEST_IRQ_NUM (CONFIG_NUM_IRQS - 1)
30+
#define TEST_IRQ_PRIO 1
31+
#endif
32+
1433
typedef void (*fake_driver_irq_callback_t)(const struct device *dev, void *user_data);
1534

1635
struct fake_driver_config {

tests/application_development/ram_context_for_isr/src/fake_driver.c

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,6 @@
1010

1111
#define DT_DRV_COMPAT fakedriver
1212

13-
#define TEST_IRQ_NUM 27
14-
#define TEST_IRQ_PRIO 4
15-
1613
static void fake_driver_isr(const void *arg)
1714
{
1815
const struct device *dev = (const struct device *)arg;

tests/application_development/ram_context_for_isr/src/main.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ ZTEST(ram_context_for_isr, test_fake_driver_in_ram)
7272
api->register_irq_callback(dev, test_irq_callback, NULL);
7373
test_flag = false;
7474

75-
NVIC_SetPendingIRQ(27);
75+
NVIC_SetPendingIRQ(TEST_IRQ_NUM);
7676

7777
k_busy_wait(1000);
7878

0 commit comments

Comments
 (0)