Add USB CDC and loop-back test

This commit is contained in:
fruchti 2020-10-11 22:37:46 +02:00
commit 7234eb8360
34 changed files with 15808 additions and 0 deletions

24
stm32f103c8t6/src/debug.c Normal file
View file

@ -0,0 +1,24 @@
#include "debug.h"
void Debug_Print(const char *message)
{
uint32_t m[] = {2, (uint32_t)message, strlen(message)};
__asm__("mov r0, #0x05;"
"mov r1, %[m];"
"bkpt #0xAB"
:
: [m] "r" (m)
: "r0", "r1", "memory");
}
void Debug_PutChar(char c)
{
uint32_t m[] = {2, (uint32_t)(&c), 1};
__asm__("mov r0, #0x05;"
"mov r1, %[m];"
"bkpt #0xAB"
:
: [m] "r" (m)
: "r0", "r1", "memory");
}