diff options
author | Josh Rahm <joshuarahm@gmail.com> | 2020-11-21 21:57:14 -0700 |
---|---|---|
committer | Josh Rahm <joshuarahm@gmail.com> | 2020-11-21 21:57:14 -0700 |
commit | 822c68c74ebc3ac3694f87d516f1e91f2ce1d0fe (patch) | |
tree | 709b480c0d0283501c2376713f6b495c32292520 /02-usart/src/stdlibrepl.c | |
parent | b073c19f9ec330423fa07c66d1c0604883044f6b (diff) | |
download | stm32l4-822c68c74ebc3ac3694f87d516f1e91f2ce1d0fe.tar.gz stm32l4-822c68c74ebc3ac3694f87d516f1e91f2ce1d0fe.tar.bz2 stm32l4-822c68c74ebc3ac3694f87d516f1e91f2ce1d0fe.zip |
Fix mem.c to use the address of DATA_SEGMENT_START instead of the value
Diffstat (limited to '02-usart/src/stdlibrepl.c')
-rw-r--r-- | 02-usart/src/stdlibrepl.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/02-usart/src/stdlibrepl.c b/02-usart/src/stdlibrepl.c new file mode 100644 index 0000000..2d9d839 --- /dev/null +++ b/02-usart/src/stdlibrepl.c @@ -0,0 +1,13 @@ +/* + * Replacement for common stdlib functions that don't exist + * on the ARM bare-metal compilation environment. + */ + +#include <stddef.h> + +size_t strlen(char* ch) +{ + size_t ret = 0; + while(*(ch ++) != 0) ++ ret; + return ret; +} |