This commit is contained in:
2020-10-18 22:02:17 +02:00
commit 82b150f51e
87 changed files with 91206 additions and 0 deletions

11
cube/User/Inc/main2.h Normal file
View File

@ -0,0 +1,11 @@
#ifndef _MAIN2_H_
#define _MAIN2_H_
void my_setup_1();
void my_setup_2();
void my_loop();
void my_errorHandler();
void SYSTICK_Callback();
#endif // _MAIN2_H_

51
cube/User/Src/main2.c Normal file
View File

@ -0,0 +1,51 @@
#include <string.h>
#include <stdint.h>
#include <PontCoopScheduler.h>
#include <stdlib.h>
#include <main.h>
#include <usart.h>
void my_setup_1() {
schInit();
}
void my_errorHandler() {
}
void blinkRed(void *handle) {
HAL_GPIO_TogglePin(LED_Red_GPIO_Port, LED_Red_Pin);
}
void blinkGreen(void *handle) {
HAL_GPIO_TogglePin(LED_Green_GPIO_Port, LED_Green_Pin);
}
void blinkBlue(void *handle) {
HAL_GPIO_TogglePin(LED_Blue_GPIO_Port, LED_Blue_Pin);
}
void helloWorld(void *handle) {
static char hello[] = "Hello World\n\r";
HAL_UART_Transmit_IT(&huart1, (uint8_t*) hello, strlen(hello));
}
void my_setup_2() {
schAdd(blinkBlue, NULL, 0, 250);
schAdd(blinkRed, NULL, 0, 500);
schAdd(blinkGreen, NULL, 0, 1000);
schAdd(helloWorld, NULL, 0, 5000);
}
void my_loop() {
schExec();
}
void SYSTICK_Callback() {
schUpdate();
}