diff --git a/Core/Inc/cppmain.h b/Core/Inc/cppmain.h new file mode 100644 index 0000000..50283a2 --- /dev/null +++ b/Core/Inc/cppmain.h @@ -0,0 +1,25 @@ +/* + * cppmain.hh + * + * Created on: Jul 4, 2023 + * Author: heck + */ + +#ifndef INC_CPPMAIN_H +#define INC_CPPMAIN_H + + + +#ifdef __cplusplus +extern "C" { +#endif + +void cppmain(void); + +#ifdef __cplusplus +}; +#endif + + +#endif /* INC_CPPMAIN_H */ + diff --git a/Core/Src/cppmain.cc b/Core/Src/cppmain.cc new file mode 100644 index 0000000..f4d88da --- /dev/null +++ b/Core/Src/cppmain.cc @@ -0,0 +1,22 @@ +/* + * cppmain.cc + * + * Created on: Jul 4, 2023 + * Author: heck + */ + +#include "cppmain.h" +#include "main.h" +//#include +//#include + +//std::vector v{}; + +void cppmain(void) { + while (1) { +// v.push_back(23); + + HAL_GPIO_TogglePin(LED_GREEN_GPIO_Port, LED_GREEN_Pin); +// HAL_Delay(v.size()); + } +} diff --git a/Core/Src/main.c b/Core/Src/main.c index f2c56b4..351ef0d 100644 --- a/Core/Src/main.c +++ b/Core/Src/main.c @@ -21,7 +21,7 @@ /* Private includes ----------------------------------------------------------*/ /* USER CODE BEGIN Includes */ - +#include "cppmain.h" /* USER CODE END Includes */ /* Private typedef -----------------------------------------------------------*/ @@ -91,13 +91,14 @@ int main(void) /* Infinite loop */ /* USER CODE BEGIN WHILE */ - while (1) - { - /* USER CODE END WHILE */ - HAL_GPIO_TogglePin(LED_GREEN_GPIO_Port,LED_GREEN_Pin); - HAL_Delay(250); - /* USER CODE BEGIN 3 */ - } + cppmain(); +// while (1) +// { +// /* USER CODE END WHILE */ +// HAL_GPIO_TogglePin(LED_GREEN_GPIO_Port,LED_GREEN_Pin); +// HAL_Delay(250); +// /* USER CODE BEGIN 3 */ +// } /* USER CODE END 3 */ }