⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 f_system.c

📁 S3C2410 USB Mass storage 源码.
💻 C
字号:
/***************************************************************/
/*
 * F_system.c, 20070206, denny
 *
 * A Marconix Software Product
 * Copyright(c) Marconix Co., Ltd. 2007
 * All Rights Reserved. Reproduction, adaption, or
 * translation without prior written permission is
 * prohibited, except as allowed under the copyright laws.
 */
/***************************************************************/

//#include "inc.h" 
#include "F_system.h"

u8 Intnum2Char(u8 Intnum)
{
	if(Intnum>9)
		return (0x41 + Intnum - 10);
	else
		return (0x30 + Intnum);
}

char *strupr(char *string)
{
	unsigned char i=0;

	do
	{
		if(string[i]>='a'&&string[i]<='z')
			string[i] -= 0x20;
		i++;
	}while(string[i]!='\0');

	return NULL;
}

char *strlwr(char *string)
{
	unsigned char i=0;

	do
	{
		if(string[i]>='A' && string[i]<='Z')
			string[i]+=0x20;
		i++;
	}while(string[i]!='\0');
}
#if 0
void memcpy(void *s1, const void *s2, int n)
{
	int i;

	for (i = 0; i < n; i++)
		((char *)(s1))[i] = ((const char *)(s2))[i];
}

void memset(void *s, const char ch, int n)
{
	int i;

	for (i = 0; i < n; i++)
		((char *)(s))[i] = ch;
}


char *strcpy(char *dest, char *src)
{
	u16 i,j;

	for(i=0;; i++)
	{
		if(src[i]!=0)
			dest[i]=src[i];
		else{
			dest[i]='\0';
			break;
		}
	}
	return NULL;
}

int strcmp(const char *s1, const char *s2)
{
	u16 i;

	for(i=0; ; i++)
	{
		if(s1[i] != s2[i])
			return 1;
		if(s1[i] =='\0' )
			break;
	}
	return 0;
}
#endif
void INT_Char(u32 IntNum, char *str)
{
	u8 i = 0,j = 0, tmp = 0;
	u32 tmpnum = IntNum;

	do{
		tmpnum = tmpnum/10;
		i++;
	}while(tmpnum);

	tmpnum = IntNum;
	j = i;
	for(;j>0;j--)
	{
		str[j-1] = tmpnum%10 +0x30;
		tmpnum /=10;
	}
	str[i] = 0;
}


⌨️ 快捷键说明

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