aboutsummaryrefslogtreecommitdiff
path: root/02-usart/src
diff options
context:
space:
mode:
authorJosh Rahm <joshuarahm@gmail.com>2020-11-16 18:53:44 -0700
committerJosh Rahm <joshuarahm@gmail.com>2020-11-16 19:47:24 -0700
commitcd115ba47253ce8d2680178248116d251abacb23 (patch)
tree31f79d94f51e9c17d9d6ec32e567bbea672671ac /02-usart/src
parent9f17335c19a6ae91a450e267b5313148644a7a14 (diff)
downloadstm32l4-cd115ba47253ce8d2680178248116d251abacb23.tar.gz
stm32l4-cd115ba47253ce8d2680178248116d251abacb23.tar.bz2
stm32l4-cd115ba47253ce8d2680178248116d251abacb23.zip
Update the genmake script for tests.
Update the genmake script to do the following: - Fix bug to link the object files from the source. - Test build output goes into a build/ directory. - Test makefile rules now run the test after building.
Diffstat (limited to '02-usart/src')
-rw-r--r--02-usart/src/isr_vector.c6
-rw-r--r--02-usart/src/main.c4
2 files changed, 10 insertions, 0 deletions
diff --git a/02-usart/src/isr_vector.c b/02-usart/src/isr_vector.c
index ab38dc2..6d5128c 100644
--- a/02-usart/src/isr_vector.c
+++ b/02-usart/src/isr_vector.c
@@ -1,7 +1,11 @@
#include "isr_vector.h"
+
+#include "arch.h"
#include "delay.h"
#include "gpio.h"
+#ifdef ARCH_STM32L4
+
/* Forward-declare the main function. This is implemented in main.c. */
void main();
@@ -163,3 +167,5 @@ void unhandled_isr()
delay(5000000);
}
}
+
+#endif
diff --git a/02-usart/src/main.c b/02-usart/src/main.c
index 862676c..5f45e0b 100644
--- a/02-usart/src/main.c
+++ b/02-usart/src/main.c
@@ -74,6 +74,8 @@ int enable_usart1(uint32_t baud_rate)
enable_interrupts();
}
+#ifdef ARCH_STM32L4
+
/* Main function. This gets executed from the interrupt vector defined above. */
int main()
{
@@ -92,3 +94,5 @@ int main()
usart_transmit_str_sync(&USART2, "Hello, World\n");
for(;;);
}
+
+#endif