serial hello world

This commit is contained in:
Wolfgang Hottgenroth 2020-10-11 02:12:01 +02:00
parent a8baec64ab
commit 84c739e933
Signed by: wn
GPG Key ID: B586EAFCDF2F65F4

View File

@ -1,9 +1,14 @@
#include <string.h>
#include <stdint.h>
#include <PontCoopScheduler.h>
#include <stdlib.h>
#include <main.h>
#include <usart.h>
void my_setup_2() {
void my_setup_1() {
schInit();
}
@ -25,11 +30,16 @@ void blinkBlue(void *handle) {
HAL_GPIO_TogglePin(LED_Blue_GPIO_Port, LED_Blue_Pin);
}
void my_setup_1() {
schInit();
void helloWorld(void *handle) {
static char hello[] = "Hello World\n\r";
HAL_UART_Transmit_IT(&huart1, (uint8_t*) hello, strlen(hello));
}
void my_setup_2() {
schAdd(blinkBlue, NULL, 0, 250);
schAdd(blinkRed, NULL, 0, 500);
schAdd(blinkGreen, NULL, 0, 1000);
schAdd(helloWorld, NULL, 0, 5000);
}
void my_loop() {