implement uart connection for logger

This commit is contained in:
2020-10-29 15:44:13 +01:00
parent e5a77ccc00
commit 3ce69c0a64
9 changed files with 73 additions and 27 deletions

View File

@ -1,28 +1,30 @@
#include <string.h>
#include <stdint.h>
#include <stdbool.h>
#include <PontCoopScheduler.h>
#include <stdlib.h>
#include <main.h>
#include <usart.h>
#include <PontCoopScheduler.h>
#include <led.h>
#include <loopCtrl.h>
#include <mbusComm.h>
#include <logger.h>
void my_setup_1() {
schInit();
logInit();
}
void my_errorHandler() {
ledRed(true);
led(RED, ON);
}
void helloWorld(void *handle) {
static char hello[] = "Hello World\n\r";
HAL_UART_Transmit_IT(&debugUart, (uint8_t*) hello, strlen(hello));
logMsg("Hello World\n\r");
}
void helloMeterbus(void *handle) {
@ -31,8 +33,8 @@ void helloMeterbus(void *handle) {
void my_setup_2() {
ledRed(false);
ledGreen(true);
led(RED, OFF);
led(GREEN, ON);
schAdd(helloWorld, NULL, 0, 5000);
schAdd(helloMeterbus, NULL, 0, 10000);
@ -41,6 +43,7 @@ void my_setup_2() {
void my_loop() {
schExec();
logExec();
}
void SYSTICK_Callback() {
@ -51,4 +54,4 @@ void HAL_GPIO_EXTI_Callback(uint16_t pin) {
if (pin == Loop_Status_Pin) {
loopStatusCallback();
}
}
}