debug.c

来自「ADSP-BF537Display部分的代码」· C语言 代码 · 共 66 行

C
66
字号
/*=============================================================================
=
= Name:     QVGA Display and Timer Verification and Example Code
=
===============================================================================
=
= (C) Copyright 2006 - Analog Devices, Inc.  All rights reserved.
=
= File Name :   debug.c
=
= Date      :   12/21/06
=
= Target    :   ADSP-BF537
=
= Version   :   1.0
=
= Purpose   :   Test the display with a bitmap
=
=
=
==============================================================================*/

#include <setjmp.h>
#include <stdarg.h>
#include <stdio.h>

//---------------------------------------------------------------------------------------------------------------
//---------------------------------------------------------------------------------------------------------------
//---------------------------------------------------------------------------------------------------------------

// Exceptions raised here are caught in main()
jmp_buf CatchContext;

//---------------------------------------------------------------------------------------------------------------
//---------------------------------------------------------------------------------------------------------------
//---------------------------------------------------------------------------------------------------------------

void BF537_EZKIT_Trace (const char* fmt, ...)
{
	va_list args;
	va_start (args, fmt);

	char msg[512];
	vsprintf (msg, fmt, args);
	fputs (msg, stdout);
	fflush (stdout);

	va_end (args);
}

void BF537_EZKIT_Throw (const char* fmt, ...)
{
	va_list args;
	va_start (args, fmt);

	char msg[256];
	vsprintf (msg, fmt, args);

	BF537_EZKIT_Trace ("\n%s\n", msg);

	longjmp (CatchContext, 0xE);
	
	va_end (args);
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?