1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
| #include "main.h"
| #include "os_task.h"
| #include "os_clock.h"
| #include "clock.h"
| #include "adc.h"
| #include "can.h"
| #include "crc.h"
| #include "dma.h"
| #include "i2c.h"
| #include "tim.h"
| #include "gpio.h"
| #include "Hal_gpio.h"
| #include "Hal_adc.h"
| static void GPIO_FunctionTestTask(void *p)
| {
| *p;
| HAL_GPIO_TogglePin(EXT_END_GPIO_Port, EXT_END_Pin);
| }
|
| int main(void)
| {
| OS_TASK_MSG task_queue[16] = {0};
| InitOSTaskQueue(task_queue, 16);
| /* Reset of all peripherals, Initializes the Flash interface and the Systick. */
| HAL_Init();
| /* Configure the system clock */
| SystemClock_Config();
|
| /* Initialize all configured peripherals */
| MX_GPIO_Init();
| MX_CAN1_Init();
| MX_ADC1_Init();
| MX_CRC_Init();
| MX_I2C1_Init();
| MX_I2C2_Init();
| MX_TIM1_Init();
| MX_DMA_Init();
| MX_TIM15_Init();
|
| Hal_ADCInit();
|
| OSTaskCreate(GPIO_FunctionTestTask, 1, 1, NULL);
|
| OSSchedule(&OS_GetTick);
| while (1)
| {
| ;
| }
| }
|
|