Write "Hello world!" out via UART protocol
cmake_minimum_required(VERSION 3.3)
project(SimplexUART_Demo C CXX ASM)
create_simple_executable(${PROJECT_NAME} SimplexUART_Demo.cpp)
void error (const PropWare::ErrorCode err);
const int32_t BAUD_RATE = 115200;
const int32_t DELAY = 200;
PropWare::ErrorCode err;
char numberPattern[] = {
0x01,
0x02,
0x03,
0x45,
0xe5,
0xaa,
0xff,
0x80,
0x00 };
char string[] = "Hello world! This is my most favoritest sentence ever!!!\r\n";
error(err);
error(err);
while (1) {
uart.
puts(numberPattern);
waitcnt(DELAY * MILLISECOND + CNT);
waitcnt(DELAY * MILLISECOND + CNT);
}
}
void error (const PropWare::ErrorCode err) {
while (1) {
debugLEDs.write((uint32_t) err);
waitcnt(100*MILLISECOND);
debugLEDs.write(0);
waitcnt(100*MILLISECOND);
}
}