野火电子论坛

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 15657|回复: 4

关于SD卡模拟U盘的实验中的一些问题

[复制链接]
发表于 2014-9-16 20:30:30 | 显示全部楼层 |阅读模式
在初始化的时候,调用了Get_SerialNum这个函数,
void Get_SerialNum(void)
{
  uint32_t Device_Serial0, Device_Serial1, Device_Serial2;

  Device_Serial0 = *(__IO uint32_t*)(0x1FFFF7E8);
  Device_Serial1 = *(__IO uint32_t*)(0x1FFFF7EC);
  Device_Serial2 = *(__IO uint32_t*)(0x1FFFF7F0);

  Device_Serial0 += Device_Serial2;
  if (Device_Serial0 != 0)
  {
    IntToUnicode (Device_Serial0, &MASS_StringSerial[2] , 8);
    IntToUnicode (Device_Serial1, &MASS_StringSerial[18], 4);
  }
}
我不明白的是为什么调用IntToUnicode 这个函数的第三个参数竟然不一样一个是8,一个是4

回复

使用道具 举报

发表于 2014-9-16 20:57:48 | 显示全部楼层
那个函数有什么功能?
回复 支持 反对

使用道具 举报

 楼主| 发表于 2014-9-16 20:59:32 | 显示全部楼层
Get_SerialNum应该是获取USB的一些序列号,IntToUnicode应该是把一个int型的数据转换为Unicode编码的字符串吧
回复 支持 反对

使用道具 举报

 楼主| 发表于 2014-9-16 21:00:55 | 显示全部楼层
汪曼丽 发表于 2014-9-16 20:57
那个函数有什么功能?

Get_SerialNum应该是获取USB的一些序列号,IntToUnicode应该是把一个int型的数据转换为Unicode编码的字符串吧
回复 支持 反对

使用道具 举报

发表于 2014-9-16 21:08:42 | 显示全部楼层
a594373280 发表于 2014-9-16 21:00
Get_SerialNum应该是获取USB的一些序列号,IntToUnicode应该是把一个int型的数据转换为Unicode编码的字符 ...

你看看函数的参数说明,然后对比一下
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

联系站长|手机版|野火电子官网|野火淘宝店铺|野火电子论坛 ( 粤ICP备14069197号 ) 大学生ARM嵌入式2群

GMT+8, 2024-5-26 14:02 , Processed in 0.025444 second(s), 23 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表