aboutsummaryrefslogtreecommitdiff
path: root/02-usart/src/main.c
diff options
context:
space:
mode:
authorJosh Rahm <joshuarahm@gmail.com>2020-11-16 18:20:32 -0700
committerJosh Rahm <joshuarahm@gmail.com>2020-11-16 18:20:32 -0700
commit9f17335c19a6ae91a450e267b5313148644a7a14 (patch)
treef1ae946ada62148913a8cc10bc985f8de926a4a0 /02-usart/src/main.c
parent4767c73fb2e1f96469fe24a83b443c1774b01d86 (diff)
downloadstm32l4-9f17335c19a6ae91a450e267b5313148644a7a14.tar.gz
stm32l4-9f17335c19a6ae91a450e267b5313148644a7a14.tar.bz2
stm32l4-9f17335c19a6ae91a450e267b5313148644a7a14.zip
Add DMA header file which defines the DMA registers and add
testing_harness with fake environment to allow testing on x86 development machines.
Diffstat (limited to '02-usart/src/main.c')
-rw-r--r--02-usart/src/main.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/02-usart/src/main.c b/02-usart/src/main.c
index 5af52ed..862676c 100644
--- a/02-usart/src/main.c
+++ b/02-usart/src/main.c
@@ -1,4 +1,5 @@
+#include "arch.h"
#include "clock.h"
#include "delay.h"
#include "gpio.h"
@@ -70,7 +71,7 @@ int enable_usart1(uint32_t baud_rate)
/* Enable the transmitter and the receiver. */
usart_set_enabled(&USART1, USART_ENABLE_TX);
- asm volatile(" cpsie i ");
+ enable_interrupts();
}
/* Main function. This gets executed from the interrupt vector defined above. */
@@ -88,6 +89,6 @@ int main()
enable_usart2(115200);
pin_on(pin3);
- usart_transmit_str(&USART2, "Hello, World\n");
+ usart_transmit_str_sync(&USART2, "Hello, World\n");
for(;;);
}