aboutsummaryrefslogtreecommitdiff
path: root/02-usart/src/mem.c
diff options
context:
space:
mode:
authorJosh Rahm <joshuarahm@gmail.com>2020-11-16 21:02:48 -0700
committerJosh Rahm <joshuarahm@gmail.com>2020-11-16 21:02:48 -0700
commitc0e1b4cdf20c55f2cbbdf3a5889f447974135fd8 (patch)
tree003c27f4551f02de304da28cc60314a4516c40ed /02-usart/src/mem.c
parentcd115ba47253ce8d2680178248116d251abacb23 (diff)
downloadstm32l4-c0e1b4cdf20c55f2cbbdf3a5889f447974135fd8.tar.gz
stm32l4-c0e1b4cdf20c55f2cbbdf3a5889f447974135fd8.tar.bz2
stm32l4-c0e1b4cdf20c55f2cbbdf3a5889f447974135fd8.zip
Got the DMA to send a simple message through UART2.
Diffstat (limited to '02-usart/src/mem.c')
-rw-r--r--02-usart/src/mem.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/02-usart/src/mem.c b/02-usart/src/mem.c
new file mode 100644
index 0000000..5772bdc
--- /dev/null
+++ b/02-usart/src/mem.c
@@ -0,0 +1,11 @@
+#include "mem.h"
+#include "common.h"
+
+void memcpy_(void* dest, const void* src, size_t len)
+{
+ uint8_t* dest_ = (uint8_t*) dest;
+ uint8_t* src_ = (uint8_t*) src;
+
+ while ((len--) > 0)
+ *(dest_ ++) = *(src_ ++);
+}