81 lines
1.3 KiB
C
Raw Normal View History

2021-01-09 22:01:21 +01:00
#include <string.h>
#include <stdint.h>
#include <stdbool.h>
#include <stdlib.h>
#include <main.h>
#include <usart.h>
#include <spi.h>
#include <PontCoopScheduler.h>
#include <show.h>
#include <logger.h>
#include <eeprom.h>
#include <wizHelper.h>
#include <cmdHandler.h>
#include <config.h>
void my_setup_1() {
schInit();
logInit();
showInit();
}
void my_errorHandler() {
show(LED_RED, ON);
}
2021-02-06 15:31:03 +01:00
void second_tick(void *handle) {
logMsg("Tick");
}
2021-01-09 22:01:21 +01:00
void my_setup_2() {
show(LED_RED, OFF);
show(LED_GREEN, BLINK);
logMsg("Application starting");
eepromInit();
configInit();
2021-02-06 15:31:03 +01:00
// wizInit();
2021-01-09 22:01:21 +01:00
2021-02-06 15:31:03 +01:00
// cmdHandlerInit();
schAdd(second_tick, NULL, 0, 60*1000);
2021-01-30 17:56:50 +01:00
logMsg("Application running");
2021-01-09 22:01:21 +01:00
}
void my_loop() {
// show(DEBUG_2, TOGGLE);
schExec();
#ifndef LOGGER_OUTPUT_BY_INTERRUPT
logExec();
#endif //LOGGER_OUTPUT_BY_INTERRUPT
}
void SYSTICK_Callback() {
schUpdate();
}
void HAL_UART_TxCpltCallback(UART_HandleTypeDef *huart) {
#ifdef LOGGER_OUTPUT_BY_INTERRUPT
if (huart == &debugUart) {
debugTxCpltCallback(huart);
}
#endif //LOGGER_OUTPUT_BY_INTERRUPT
}
void HAL_SPI_TxCpltCallback(SPI_HandleTypeDef *hspi) {
if (hspi == &eepromSpi) {
eepromSpiTxCpltCallback(hspi);
}
}
2021-02-06 15:31:03 +01:00