From 93b063fedfcf7409a67df035170ea5670cad22e1 Mon Sep 17 00:00:00 2001 From: Josh Rahm Date: Tue, 24 Nov 2020 13:46:41 -0700 Subject: Moved action to top level. Removed old iterations of the project and moved the files from 02-usart to the root directory since that's the sole place where the action is and that subproject has outgrown its initial title. --- 02-usart/tests/test_irq.c | 43 ------------------------------------------- 1 file changed, 43 deletions(-) delete mode 100644 02-usart/tests/test_irq.c (limited to '02-usart/tests/test_irq.c') diff --git a/02-usart/tests/test_irq.c b/02-usart/tests/test_irq.c deleted file mode 100644 index 3c4ee9c..0000000 --- a/02-usart/tests/test_irq.c +++ /dev/null @@ -1,43 +0,0 @@ -#include "test_harness.h" - -#include "arch/stm32l4xxx/peripherals/irq.h" -#include "arch/stm32l4xxx/peripherals/nvic.h" - -TEST(irq, nvic) -{ - interrupt_set_t is = { 0 }; - - interrupt_set_add(&is, IRQ_USART2); - interrupt_set_add(&is, IRQ_USART3); - - enable_interrupts(&is); - - ASSERT_EQ(is.irqs[1], 0xC0); - ASSERT_EQ(NVIC.ise_r[1], 0xC0); - - return 0; -} - -TEST(irq, nvic_edgecase) -{ - interrupt_set_t is = { 0 }; - interrupt_set_add(&is, IRQ_WWDG_IRQ); - interrupt_set_add(&is, IRQ_I2C1_ER); - - enable_interrupts(&is); - - ASSERT_EQ(is.irqs[0], 1); - ASSERT_EQ(NVIC.ise_r[0], 1); - ASSERT_EQ(is.irqs[1], 1); - ASSERT_EQ(NVIC.ise_r[1], 1); - - return 0; -} - -TEST(irq, enable_single_interrupt) -{ - enable_interrupt(IRQ_USART2); - ASSERT_EQ(NVIC.ise_r[1], 0x40); - - return 0; -} -- cgit