📄 debug.c
字号:
/************************************************** * * <filename> * * CVS ID: $Id: debug.c,v 1.13 2006/09/25 13:49:55 belardi Exp $ * Author: Leos Longauer [LL] - STM * Date: $Date: 2006/09/25 13:49:55 $ * Revision: $Revision: 1.13 $ * * Description: * * - TRACE32 feature: printf() to terminal window * *************************************************** * * COPYRIGHT (C) ST Microelectronics 2005 * All Rights Reserved * **************************************************** * * STM CVS Log: * * $Log: debug.c,v $ * Revision 1.13 2006/09/25 13:49:55 belardi * Added #pragma to force ARM compilation , due to inline _asm * * Revision 1.12 2006/09/18 09:55:21 belardi * Corrected CVS keyword usage * * Revision 1.11 2006/09/18 09:22:43 belardi * Added Log CVS keyword into file header * * Revision 1.10 2006/09/15 20:18:11 belardi * Added Log CVS keyword into file header * * ***************************************************/#include "configuration.h" #ifdef TRACE_DEBUG// [RB] this file contains __asm instructions which cannot// be compiled in Thumb mode#pragma ARM#include "debug.h"#include <stdio.h>struct __FILE { unsigned int handle; /* Add whatever you need here */};size_t __fread_bytes_avail(void *buf, size_t nbytes, FILE *stream)/* Read a single character into buf[] using fgetc() */{ *(char *)buf = (char)fgetc(stream); return 1;}int putcc(int ch){ int temp = ch; int DCCStatus; do { __asm {MRC p14,0,DCCStatus,c0,c0;} }while (DCCStatus & DCC_WRITEBUSY); __asm {MCR p14,0,temp,c1,c0;} return temp; }int getcc(){ int temp; int DCCStatus; do { __asm {MRC p14,0,DCCStatus,c0,c0;} }while (!(DCCStatus & DCC_READFULL)); __asm {MRC p14,0,temp,c1,c0;} return temp;}#if (HAVE_PRINTF==0)// [RB] doubly defined function, use the pdebug.c version with HAVE_PRINTFint fputc(int ch, FILE *f){ return putcc(ch);}#endifint fgetc(FILE *f){ return getcc();}#endif // TRACE_DEBUG
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -