test_main.c
1.56 KB
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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
#ifdef FREE_RTOS_TEST
#else
#include "C_def.h"
#include "debug.h"
#if 0
void vApplicationStackOverflowHook( void )
#else
void vApplicationStackOverflowHook( void *xTask, char *pcTaskName )
#endif
{
static stack_overflow_flag = 0;
int i = 0;
/* Look at pxCurrentTCB to see which task overflowed its stack. */
//puts("Stack overflow, Stopping.");
//DBG_Printf("Stack overflow, Stopping.\n\r");
#if 0//def XT_SIMULATOR
exit(0);
#else
for( ;; )
{
i++;
asm("nop");
#if 0
asm("nop");
asm("break 1,1");
#else
if (stack_overflow_flag == 0)
{
stack_overflow_flag = 1;
DBG_Printf("stack overflow:%s\n\r", pcTaskName);
//DBG_Printf("pTask:0x\n\r", xTask);
}
if (i >= 1000000*100)
{
asm("nop");
asm("break 1,1");
}
#endif
}
#endif
}
#if 1//configUSE_TICK_HOOK
void vApplicationTickHook( void ) __attribute__ ((section (".internal_ram_1_text")));
void vApplicationTickHook( void )
{
#if 0
#if F_FULL
/* Prodding periodically from the tick interrupt. */
if (uStartTimerDemoTask)
vTimerPeriodicISRTests(); // Defined in TimerDemo.c
/* Call the periodic event group from ISR demo. */
if (uStartEventGroupTasks)
vPeriodicEventGroupsProcessing(); // Defined in EventGroupsDemo
/* Call the periodic queue overwrite from ISR demo. */
if (uStartQueueSetTasks)
vQueueSetAccessQueueSetFromISR();
/* Call the periodic queue overwrite from ISR demo. */
if (uStartQueueOverwriteTask)
vQueueOverwritePeriodicISRDemo(); // Defined in QueueOverwrite
#else
if (u_perf_test)
vPerfTestTickHook();
#endif
#endif
}
#endif
#endif //FREE_RTOS_TEST