misc.c

来自「瑞萨M16C编写的模拟PS2主机与标准键盘通讯程序.完整的工程文件,测试可用.」· C语言 代码 · 共 52 行

C
52
字号
// Miscellaneous microcontroller functions#include "misc.h"#include "machine.h"#include <ctype.h>#include <string.h>// This code will be placed in the fixed memory area//#pragma SECTION program fixed_program// Delays for (aproximately) the specified number of microseconds// Input: d - delay time in usvoid delay( u16 d ) {	u16 i;	for ( i = 0; i < d; i ++ ) 	{		nop();		nop();		nop();		nop();		nop();		nop();		nop();		nop();		nop();		nop();		nop();		nop();		nop();		nop();		nop();		nop();		nop();		nop();		nop();		nop();			}}// Transform a string to lower case// Input: pstr - the stringvoid strlower( char *pstr ){  u16 i;    for( i = 0; i < strlen( pstr ); i ++ )    pstr[ i ] = tolower( pstr[ i ] );}

⌨️ 快捷键说明

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