67 lines
1016 B
C
Raw Normal View History

2020-10-18 22:02:17 +02:00
#include <string.h>
#include <stdint.h>
2020-10-24 19:34:30 +02:00
#include <stdbool.h>
2020-10-18 22:02:17 +02:00
#include <stdlib.h>
2020-10-29 15:44:13 +01:00
2020-10-18 22:02:17 +02:00
#include <main.h>
#include <usart.h>
2020-10-31 21:25:49 +01:00
#include <adc.h>
2020-10-18 22:02:17 +02:00
2020-10-29 15:44:13 +01:00
#include <PontCoopScheduler.h>
2020-10-27 15:12:19 +01:00
#include <led.h>
#include <loopCtrl.h>
2020-10-28 19:40:08 +01:00
#include <mbusComm.h>
2020-10-29 15:44:13 +01:00
#include <logger.h>
2020-10-31 21:25:49 +01:00
#include <frontend.h>
2020-10-28 19:40:08 +01:00
2020-10-18 22:02:17 +02:00
void my_setup_1() {
2020-10-27 15:12:19 +01:00
schInit();
2020-10-29 15:44:13 +01:00
logInit();
2020-10-18 22:02:17 +02:00
}
void my_errorHandler() {
2020-10-29 15:44:13 +01:00
led(RED, ON);
2020-10-18 22:02:17 +02:00
}
2020-10-25 15:37:16 +01:00
void helloMeterbus(void *handle) {
2020-10-28 19:40:08 +01:00
mbusCommRequest(0x5b, 80);
// static char msg[] = "Hello";
// HAL_UART_Transmit_IT(&mbusUart, &msg, strlen(msg));
}
2020-10-24 19:34:30 +02:00
2020-10-18 22:02:17 +02:00
void my_setup_2() {
2020-10-29 15:44:13 +01:00
led(RED, OFF);
led(GREEN, ON);
2020-10-27 15:12:19 +01:00
frontendInit();
2020-10-31 21:25:49 +01:00
schAdd(helloMeterbus, NULL, 0, 10000);
2020-10-18 22:02:17 +02:00
}
void my_loop() {
2020-10-27 15:12:19 +01:00
schExec();
2020-10-29 15:44:13 +01:00
logExec();
2020-10-18 22:02:17 +02:00
}
void SYSTICK_Callback() {
2020-10-27 15:12:19 +01:00
schUpdate();
2020-10-18 22:02:17 +02:00
}
2020-10-27 22:28:03 +01:00
void HAL_GPIO_EXTI_Callback(uint16_t pin) {
if (pin == Loop_Status_Pin) {
loopStatusCallback();
}
2020-10-29 15:44:13 +01:00
}
2020-10-31 21:25:49 +01:00
void HAL_ADC_ConvCpltCallback(ADC_HandleTypeDef* hadc) {
if (hadc == &frontendAdc) {
frontendAdcCallback(hadc);
}
2020-10-31 23:19:07 +01:00
2020-10-31 21:25:49 +01:00
}