diff options
author | Trygve Laugstøl <trygvis@inamo.no> | 2016-01-02 20:53:42 +0100 |
---|---|---|
committer | Trygve Laugstøl <trygvis@inamo.no> | 2016-01-02 20:53:42 +0100 |
commit | 9129af503c8211d713c8a160a3b6f3f86b328639 (patch) | |
tree | 3cd9ff26f4d323fc553b2a99d56be9b81a57a4c4 /include | |
parent | aae314fead54dab7b258f3a6c7ac1615833f9987 (diff) | |
download | stm32f103-playground-9129af503c8211d713c8a160a3b6f3f86b328639.tar.gz stm32f103-playground-9129af503c8211d713c8a160a3b6f3f86b328639.tar.bz2 stm32f103-playground-9129af503c8211d713c8a160a3b6f3f86b328639.tar.xz stm32f103-playground-9129af503c8211d713c8a160a3b6f3f86b328639.zip |
o Adding a utility to dump segment sizes from the generated ELF files.
o Adding os2 with support for critical sections. More to come.
o Adding dma1 to test DMA + SPI.
Diffstat (limited to 'include')
-rw-r--r-- | include/debug.h | 44 | ||||
-rw-r--r-- | include/playground.h | 12 |
2 files changed, 56 insertions, 0 deletions
diff --git a/include/debug.h b/include/debug.h new file mode 100644 index 0000000..d2926b3 --- /dev/null +++ b/include/debug.h @@ -0,0 +1,44 @@ +#ifndef DEBUG_H +#define DEBUG_H + +#ifdef __cplusplus +extern "C" { +#endif + +__attribute__((format (printf, 1, 2))) +void dbg_printf(const char *fmt, ...); + +void dbg_putc(void * junk, char); + +enum SemihostingCmd { + SYS_CLOSE = 0x02, + SYS_CLOCK = 0x10, + SYS_ELAPSED = 0x30, + SYS_ERRNO = 0x13, + SYS_FLEN = 0x0C, + SYS_GET_CMDLINE = 0x15, + SYS_HEAPINFO = 0x16, + SYS_ISERROR = 0x08, + SYS_ISTTY = 0x09, + SYS_OPEN = 0x01, + SYS_READ = 0x06, + SYS_READC = 0x07, + SYS_REMOVE = 0x0E, + SYS_RENAME = 0x0F, + SYS_SEEK = 0x0A, + SYS_SYSTEM = 0x12, + SYS_TICKFREQ = 0x31, + SYS_TIME = 0x11, + SYS_TMPNAM = 0x0D, + SYS_WRITE = 0x05, + SYS_WRITEC = 0x03, + SYS_WRITE0 = 0x04, +}; + +void send_command(enum SemihostingCmd command, void *message); + +#ifdef __cplusplus +}; +#endif + +#endif diff --git a/include/playground.h b/include/playground.h new file mode 100644 index 0000000..c224908 --- /dev/null +++ b/include/playground.h @@ -0,0 +1,12 @@ +#ifndef PLAYGROUND_H +#define PLAYGROUND_H + +extern "C" void halt(); + +template<typename T, size_t N> +static inline +size_t SizeOfArray(const T(&)[N]) { + return N; +} + +#endif |