From f8123dfd47de3835b1504ee40788ece54c01b1bb Mon Sep 17 00:00:00 2001 From: tianjialong Date: Wed, 15 Feb 2023 19:55:48 +0800 Subject: [PATCH] add hardware_main file --- app/Core/Src/main.c | 10 +++++++++- app/MDK-ARM/app.uvguix.29643 | 6 +++--- app/MDK-ARM/app.uvoptx | 20 ++++++++++++++++---- app/MDK-ARM/app.uvprojx | 5 +++++ src/hardware_main.c | 26 ++++++++++++++++++++++++++ 5 files changed, 59 insertions(+), 8 deletions(-) create mode 100644 src/hardware_main.c diff --git a/app/Core/Src/main.c b/app/Core/Src/main.c index acf56ad..d99731a 100644 --- a/app/Core/Src/main.c +++ b/app/Core/Src/main.c @@ -27,7 +27,7 @@ /* Private includes ----------------------------------------------------------*/ /* USER CODE BEGIN Includes */ - +#include /* USER CODE END Includes */ /* Private typedef -----------------------------------------------------------*/ @@ -37,6 +37,7 @@ /* Private define ------------------------------------------------------------*/ /* USER CODE BEGIN PD */ +#define HARDWARE_FLAG true /* USER CODE END PD */ /* Private macro -------------------------------------------------------------*/ @@ -95,8 +96,15 @@ int main(void) MX_TIM1_Init(); MX_TIM4_Init(); /* USER CODE BEGIN 2 */ +#if !HARDWARE_FLAG extern void user_main(); user_main(); +#endif + +#if HARDWARE_FLAG + extern void hardware_main(); + hardware_main(); +#endif /* USER CODE END 2 */ /* Call init function for freertos objects (in freertos.c) */ diff --git a/app/MDK-ARM/app.uvguix.29643 b/app/MDK-ARM/app.uvguix.29643 index cd083f4..448b182 100644 --- a/app/MDK-ARM/app.uvguix.29643 +++ b/app/MDK-ARM/app.uvguix.29643 @@ -1822,7 +1822,7 @@ Build 966 - 00200000010000001000FFFF01001100434D4643546F6F6C426172427574746F6ECF7F0000000000001C0000000000000000000000000000000001000000010000000180D07F0000000000001D000000000000000000000000000000000100000001000000018030800000000002001E000000000000000000000000000000000100000001000000FFFF01001500434D4643546F6F6C4261724D656E75427574746F6EC7040000000000006A0000000C4261746368204275696C2664000000000000000000000000010000000100000000000000000000000100000004000580C7040000000000006A0000000C4261746368204275696C266400000000000000000000000001000000010000000000000000000000010000000000058046070000000000006B0000000D42617463682052656275696C640000000000000000000000000100000001000000000000000000000001000000000005804707000000000000FFFFFFFF0B426174636820436C65616E0100000000000000000000000100000001000000000000000000000001000000000005809E8A0000000000001F0000000F4261746326682053657475702E2E2E000000000000000000000000010000000100000000000000000000000100000000000180D17F0000000004002000000000000000000000000000000000010000000100000001800000000001000000FFFFFFFF00000000000000000000000000010000000100000001804C8A0000000000002100000000000000000000000000000000010000000100000001800000000001000000FFFFFFFF000000000000000000000000000100000001000000FFFF01001900434D4643546F6F6C426172436F6D626F426F78427574746F6EBA0000000000000000000000000000000000000000000000000100000001000000960000000300205000000000036170709600000000000000010003617070000000000180EB880000000000002200000000000000000000000000000000010000000100000001800000000001000000FFFFFFFF0000000000000000000000000001000000010000000180C07F000000000000230000000000000000000000000000000001000000010000000180B08A000000000400240000000000000000000000000000000001000000010000000180A8010000000000004E00000000000000000000000000000000010000000100000001807202000000000000530000000000000000000000000000000001000000010000000180BE010000000000005000000000000000000000000000000000010000000100000000000000054275696C64DC010000 + 00200000010000001000FFFF01001100434D4643546F6F6C426172427574746F6ECF7F0000000000001C0000000000000000000000000000000001000000010000000180D07F0000000002001D000000000000000000000000000000000100000001000000018030800000000000001E000000000000000000000000000000000100000001000000FFFF01001500434D4643546F6F6C4261724D656E75427574746F6EC7040000000000006A0000000C4261746368204275696C2664000000000000000000000000010000000100000000000000000000000100000004000580C7040000000000006A0000000C4261746368204275696C266400000000000000000000000001000000010000000000000000000000010000000000058046070000000000006B0000000D42617463682052656275696C640000000000000000000000000100000001000000000000000000000001000000000005804707000000000000FFFFFFFF0B426174636820436C65616E0100000000000000000000000100000001000000000000000000000001000000000005809E8A0000000000001F0000000F4261746326682053657475702E2E2E000000000000000000000000010000000100000000000000000000000100000000000180D17F0000000004002000000000000000000000000000000000010000000100000001800000000001000000FFFFFFFF00000000000000000000000000010000000100000001804C8A0000000000002100000000000000000000000000000000010000000100000001800000000001000000FFFFFFFF000000000000000000000000000100000001000000FFFF01001900434D4643546F6F6C426172436F6D626F426F78427574746F6EBA0000000000000000000000000000000000000000000000000100000001000000960000000300205000000000036170709600000000000000010003617070000000000180EB880000000000002200000000000000000000000000000000010000000100000001800000000001000000FFFFFFFF0000000000000000000000000001000000010000000180C07F000000000000230000000000000000000000000000000001000000010000000180B08A000000000400240000000000000000000000000000000001000000010000000180A8010000000000004E00000000000000000000000000000000010000000100000001807202000000000000530000000000000000000000000000000001000000010000000180BE010000000000005000000000000000000000000000000000010000000100000000000000054275696C64DC010000 583 @@ -1974,8 +1974,8 @@ ..\..\iflytop_microcontroller\sdk\stm32\pwm.c 0 - 62 - 89 + 8 + 90 1 0 diff --git a/app/MDK-ARM/app.uvoptx b/app/MDK-ARM/app.uvoptx index 92ac21f..54c2063 100644 --- a/app/MDK-ARM/app.uvoptx +++ b/app/MDK-ARM/app.uvoptx @@ -1807,6 +1807,18 @@ 0 0 + + 10 + 130 + 1 + 0 + 0 + 0 + ..\..\src\hardware_main.c + hardware_main.c + 0 + 0 + @@ -1817,7 +1829,7 @@ 0 11 - 130 + 131 1 0 0 @@ -1829,7 +1841,7 @@ 11 - 131 + 132 1 0 0 @@ -1841,7 +1853,7 @@ 11 - 132 + 133 1 0 0 @@ -1853,7 +1865,7 @@ 11 - 133 + 134 1 0 0 diff --git a/app/MDK-ARM/app.uvprojx b/app/MDK-ARM/app.uvprojx index 9bce264..546d508 100644 --- a/app/MDK-ARM/app.uvprojx +++ b/app/MDK-ARM/app.uvprojx @@ -1124,6 +1124,11 @@ 1 ..\..\src\zport.c + + hardware_main.c + 1 + ..\..\src\hardware_main.c + diff --git a/src/hardware_main.c b/src/hardware_main.c new file mode 100644 index 0000000..28924a4 --- /dev/null +++ b/src/hardware_main.c @@ -0,0 +1,26 @@ +#include +#include +#include +#include + +#include "cmsis_os.h" +#include "config.h" +#include "encoder_acquistion_service.h" +#include "iwdg.h" +#include "lwip.h" +#include "main.h" +#include "protocol.h" +#include "usart.h" +#include "zboard.h" +#include "zport.h" +// +#include "iflytop_microcontroller/sdk/stm32/stm32sdk.h" + +#define TAG "HARDWARE_MAIN" + +void hardware_main() { + ZLOGI(TAG, "start hardware test"); + while (1) { + /* code */ + } +} \ No newline at end of file