Skip to content

Commit 8800baa

Browse files
committed
fix(irq_test): update single baremetal tests
Signed-off-by: Diogo Costa <[email protected]>
1 parent 6271408 commit 8800baa

File tree

1 file changed

+5
-5
lines changed
  • tests/recipes/single-baremetal/src

1 file changed

+5
-5
lines changed

tests/recipes/single-baremetal/src/irq.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,23 +20,23 @@ void test_interrupt_timer_callback();
2020
void uart_rx_handler();
2121

2222

23-
bool irq_en_timer = false;
24-
bool irq_en_uart = false;
23+
volatile bool irq_en_timer = false;
24+
volatile bool irq_en_uart = false;
2525

2626
#define TIMER_INTERVAL (TIME_MS(100))
2727
#define TEST_TIME_WAIT (TIME_MS(100))
2828
#define TEST_TIMEOUT "200"
2929

30-
BAO_TEST(IRQ_CHECK, TIMER)
30+
BAO_TEST(IRQ_CHECK1, TIMER)
3131
{
3232
COMMAND_SEND_TIMEOUT(TEST_TIMEOUT);
3333

3434
irq_set_handler(TIMER_IRQ_ID, test_interrupt_timer_callback);
35-
irq_enable(TIMER_IRQ_ID);
3635
timer_set(TIMER_INTERVAL);
36+
irq_enable(TIMER_IRQ_ID);
3737
irq_set_prio(TIMER_IRQ_ID, IRQ_MAX_PRIO);
3838

39-
timer_wait(TEST_TIME_WAIT);
39+
while(!irq_en_timer);
4040
EXPECTED_TRUE(irq_en_timer);
4141
}
4242

0 commit comments

Comments
 (0)