car/my_src/main2.c

51 lines
808 B
C
Raw Normal View History

2018-01-16 16:17:34 +01: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
*/
#include <stdlib.h>
#include <PontCoopScheduler.h>
#include "stm32f1xx_hal.h"
#include "blinky.h"
2018-01-16 17:56:07 +01:00
#include "pwm.h"
2018-01-16 16:17:34 +01:00
void my_setup_1() {
schInit();
}
void my_loop() {
schExec();
}
void HAL_SYSTICK_Callback() {
schUpdate();
}
void my_errorHandler() {
HAL_GPIO_WritePin(ERROR_GPIO_Port, ERROR_Pin, GPIO_PIN_SET);
}
void my_setup_2() {
blinkyInit();
2018-01-16 17:56:07 +01:00
pwmInit();
2018-01-16 16:17:34 +01:00
}