actually do it

This commit is contained in:
Matthew Kennedy 2020-12-10 23:48:55 -08:00
parent 9b23129d2a
commit 327e3b08ec
2 changed files with 39 additions and 0 deletions

36
firmware/uart.cpp Normal file
View File

@ -0,0 +1,36 @@
#include "ch.h"
#include "hal.h"
#include "chprintf.h"
#include "uart.h"
static const UARTConfig uartCfg =
{
.txend1_cb = nullptr,
.txend2_cb = nullptr,
.rxend_cb = nullptr,
.rxchar_cb = nullptr,
.rxerr_cb = nullptr,
.timeout_cb = nullptr,
.timeout = 0,
.speed = 500000,
.cr1 = 0,
.cr2 = 0,
.cr3 = 0,
};
static char printBuffer[200];
static THD_WORKING_AREA(waUartThread, 256);
static void UartThread(void*)
{
}
void InitUart()
{
uartStart(&UARTD1, &uartCfg);
chThdCreateStatic(waUartThread, sizeof(waUartThread), NORMALPRIO, UartThread, nullptr);
}

3
firmware/uart.h Normal file
View File

@ -0,0 +1,3 @@
#pragma once
void InitUart();