This commit is contained in:
Wolfgang Hottgenroth
2018-01-16 16:17:34 +01:00
commit 3aa6bbc9a6
258 changed files with 391391 additions and 0 deletions

21
my_src/blinky.c Normal file
View File

@ -0,0 +1,21 @@
/*
* blinky.c
*
* Created on: Jan 16, 2018
* Author: wn
*/
#include "blinky.h"
#include "stm32f1xx_hal.h"
#include <PontCoopScheduler.h>
void blinkyExec(void *handle) {
HAL_GPIO_TogglePin(LED_GPIO_Port, LED_Pin);
}
void blinkyInit() {
schAdd(blinkyExec, NULL, 0, 1000);
}

15
my_src/blinky.h Normal file
View File

@ -0,0 +1,15 @@
/*
* blinky.h
*
* Created on: Jan 16, 2018
* Author: wn
*/
#ifndef BLINKY_H_
#define BLINKY_H_
void blinkyInit();
#endif /* BLINKY_H_ */

48
my_src/main2.c Normal file
View File

@ -0,0 +1,48 @@
/*
* 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"
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();
}

18
my_src/main2.h Normal file
View File

@ -0,0 +1,18 @@
/*
* main2.h
*
* Created on: Oct 21, 2016
* Author: wn
*/
#ifndef MAIN2_H_
#define MAIN2_H_
void my_setup_1();
void my_setup_2();
void my_loop();
void my_errorHandler();
#endif /* MAIN2_H_ */