55 lines
817 B
C

#include <string.h>
#include <stdint.h>
#include <stdbool.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() {
led(RED, ON);
}
void helloMeterbus(void *handle) {
mbusCommRequest(0x5b, 80);
// static char msg[] = "Hello";
// HAL_UART_Transmit_IT(&mbusUart, &msg, strlen(msg));
}
void my_setup_2() {
led(RED, OFF);
led(GREEN, ON);
schAdd(helloMeterbus, NULL, 0, 2000);
}
void my_loop() {
schExec();
logExec();
}
void SYSTICK_Callback() {
schUpdate();
}
void HAL_GPIO_EXTI_Callback(uint16_t pin) {
if (pin == Loop_Status_Pin) {
loopStatusCallback();
}
}