-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.c
54 lines (41 loc) · 984 Bytes
/
main.c
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
50
51
52
53
/*
PC IP Adress - 192.168.127.99
MCU IP Adress -192.168.127.123 - PORT 4001
*/
#include "main.h" //Main header
#ifdef _RTE_
#include "RTE_Components.h" // Component selection
#endif
#ifdef RTE_CMSIS_RTOS2 // when RTE component CMSIS RTOS2 is used
#include "cmsis_os2.h" // ::CMSIS:RTOS2
#endif
#ifdef RTE_CMSIS_RTOS2_RTX5
/**
* Override default HAL_GetTick function
*/
uint32_t HAL_GetTick (void)
{
static uint32_t ticks = 0U;
uint32_t i;
if (osKernelGetState () == osKernelRunning)
{
return ((uint32_t)osKernelGetTickCount ());
}
for (i = (SystemCoreClock >> 14U); i > 0U; i--)
{
__NOP(); __NOP(); __NOP(); __NOP(); __NOP(); __NOP();
__NOP(); __NOP(); __NOP(); __NOP(); __NOP(); __NOP();
}
return ++ticks;
}
#endif
int main(void)
{
DeviceInitialize();
osKernelInitialize ();
osThreadNew(app_main, NULL, &app_main_attr);
osKernelStart();
while (1)
{
}
}