diff options
author | Josh Rahm <joshuarahm@gmail.com> | 2020-11-20 18:41:49 -0700 |
---|---|---|
committer | Josh Rahm <joshuarahm@gmail.com> | 2020-11-20 19:03:01 -0700 |
commit | fd763486d875968941c77386e23936e817856c8e (patch) | |
tree | ed85ffe2d6c27b502d06aefa5e63244450bb7028 /02-usart/src/main.c | |
parent | 3b6018348d51c77f53adca90e498d7bf268c91c9 (diff) | |
download | stm32l4-fd763486d875968941c77386e23936e817856c8e.tar.gz stm32l4-fd763486d875968941c77386e23936e817856c8e.tar.bz2 stm32l4-fd763486d875968941c77386e23936e817856c8e.zip |
Finally got a peripheral interrupt!
Diffstat (limited to '02-usart/src/main.c')
-rw-r--r-- | 02-usart/src/main.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/02-usart/src/main.c b/02-usart/src/main.c index 6d22486..8b98cbf 100644 --- a/02-usart/src/main.c +++ b/02-usart/src/main.c @@ -6,6 +6,7 @@ #include "core/system.h" #include "core/usart.h" #include "core/nvic.h" +#include "core/irq.h" #include "delay.h" #include "mem.h" @@ -64,6 +65,9 @@ int main() regset(USART2.c_r1, usart_txeie, 1); regset(USART2.c_r1, usart_rxneie, 1); usart_set_enabled(&USART2, USART_ENABLE_TX | USART_ENABLE_RX); + + + enable_interrupt(IRQ_USART2); USART2.td_r = (uint8_t) 0x61; __IO gpio_port_t* port_b = enable_gpio(GPIO_PORT_B); |