ttt2/my_src/main2.c

55 lines
872 B
C
Raw Normal View History

2017-05-26 18:45:18 +02:00
/*
* main2.c
*
* Created on: Oct 21, 2016
* Author: wn
*/
/*
* 1. insert #include "main2.h" at USER CODE Includes of main.c
* 2. insert my_setup_1(); at USER CODE 1 in main.c
* 3. insert my_setup_2(); at USER CODE 2 in main.c
* 4. insert my_loop(); at USER CODE 3 in main.c
* 5. insert my_errorHandler(); at USER CODE BEGIN Error_Handler in main.c
* All this is done by the script insertMyCode.sh in tools
*/
2017-06-07 22:15:54 +02:00
#include <hmi.h>
2017-05-26 18:45:18 +02:00
#include <stdlib.h>
#include <PontCoopScheduler.h>
#include "stm32f1xx_hal.h"
#include "oled.h"
#include "timer.h"
2017-06-12 17:50:08 +02:00
#include "alarm.h"
2017-05-26 18:45:18 +02:00
void my_setup_1() {
schInit();
}
void my_loop() {
schExec();
}
void HAL_SYSTICK_Callback() {
schUpdate();
}
2017-05-26 18:45:18 +02:00
void my_errorHandler() {
2017-05-26 18:57:42 +02:00
HAL_GPIO_WritePin(ERROR_GPIO_Port, ERROR_Pin, GPIO_PIN_SET);
2017-05-26 18:45:18 +02:00
}
void my_setup_2() {
2017-06-07 22:15:54 +02:00
hmiInit();
timerInit();
oledInit();
2017-06-12 17:50:08 +02:00
alarmInit();
2017-05-26 18:45:18 +02:00
}