tm_putstring.c

来自「uT Kernel os source code for AT91」· C语言 代码 · 共 48 行

C
48
字号
/* *---------------------------------------------------------------------- *    micro T-Kernel * *    Copyright (C) 2006-2007 by Ken Sakamura. All rights reserved. *    micro T-Kernel is distributed under the micro T-License. *---------------------------------------------------------------------- * *    Version:   1.00.00 *    Released by T-Engine Forum(http://www.t-engine.org) at 2007/03/26. * *---------------------------------------------------------------------- */#include <typedef.h>#include <stddef.h>#include <tk/syslib.h>IMPORT void sio_send_frame( const UB* buf, INT size );IMPORT void sio_recv_frame( UB* buf, INT size );/* * Ctrl-C is not supported */EXPORT INT tm_putstring( UB *buff ){	const UB* p = buff;	static const char CR = 0x0d;	INT imask;	DI(imask);	while (*p != NULL) {		if (*p == 0x0a) { /* LF */			sio_send_frame((const VP)&CR, 1);			sio_send_frame((const VP)p, 1);		} else {			sio_send_frame((const VP)p, 1);		}		p++;	}	EI(imask);	return 0;}

⌨️ 快捷键说明

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