adsputch.c

来自「epson 13506 driver code」· C语言 代码 · 共 70 行

C
70
字号
/*
**===========================================================================
** putch.c
**---------------------------------------------------------------------------
** Copyright (c) 1998 Epson Research and Development, Inc.
** All Rights Reserved.
**===========================================================================
*/

#include <stdarg.h>
#include "ads-io.h"
#include "hal.h"

/*-------------------------------------------------------------------------*/

int vsiprintf( char *buffer, const char *format, va_list argptr );

/*-------------------------------------------------------------------------*/

static const char Revision[] = "ADSPUTCH.C=$Revision: 3 $";

/*-------------------------------------------------------------------------*/

#ifdef BUSTED_UART

#define MAX_PRINTF_OUTPUT 256
#include <stdarg.h>

int Printf(const char *pszFormat,...)
    {
    int len;
    char szOutput[MAX_PRINTF_OUTPUT];
    va_list ArgList;

    va_start (ArgList, pszFormat);
    vsprintf (szOutput, pszFormat, ArgList);
    va_end (ArgList);
    len = strlen(szOutput);
    Write(1,szOutput,len);
    return len;
    }
#endif

#if 0

/* this file implements putchar() for
 * the Motorola MPC821ADS
 * we call routines from ads-io.c, contained in libads.a
 */


/* putch() writes byte to the console port */
void putch(int ch)
{
	if (!SMC2InitDone)
      SMC2Init();

	if (ch == '\n')
      SMC2PutChar ('\r');

	SMC2PutChar (ch);
}


void putchar(int ch)
{
   putch(ch);
}
#endif

⌨️ 快捷键说明

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