test_main.c 1.56 KB
#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