|
5,ser2410_ser.c
在const HWOBJ IoObj{……}后面添加:
const HWOBJ IoObj1 = {
THREAD_AT_INIT,
SYSINTR_SERIAL1,
(PHW_VTBL) &IoVTbl
};
修改:
const PCHWOBJ HWObjects[] = {
&IoObj,
&IoObj1,
&IrObj
};
修改:
PHWOBJ GetSerialObject(DWORD DeviceArrayIndex)
{
PHWOBJ pSerObj;
RETAILMSG(DEBUGMODE,(TEXT("IRDA : GetSerialObject\r\n")));
IRDA = DeviceArrayIndex;
if ( DeviceArrayIndex == 0 )
pSerObj = (PHWOBJ)(&IoObj);
else if( DeviceArrayIndex == 1 )
pSerObj = (PHWOBJ)(&IoObj1);
else
pSerObj = (PHWOBJ)(&IrObj);
return (pSerObj);
}
6,注册表\FILES\platform.reg
在串口0后添加:
[HKEY_LOCAL_MACHINE\Drivers\BuiltIn\SER2410_1]
"DeviceArrayIndex"=dword:1
"Irq"=dword:17
"IoBase"=dword:50004000
"IoLen"=dword:2C
"Prefix"="COM"
"Dll"="SER2410.Dll"
"Order"=dword:2
"Priority"=dword:0
"Port"="COM2:"
"DeviceType"=dword:0 ; null modem
"FriendlyName"="S2410 COM2"
; "Index"=dword:2
"IClass"="{A32942B7-920C-486b-B0E6-92A702A99B35}"
[HKEY_LOCAL_MACHINE\Drivers\BuiltIn\SER2410_1\Unimodem]
"Tsp"="Unimodem.dll"
"DeviceType"=dword:0
"FriendlyName"="SER2410 UNIMODEM"
"DevConfig"=hex: 10,00, 00,00, 05,00,00,00, 10,01,00,00, 00,4B,00,00, 00,00, 08, 00, 00, 00,00,00,00
7,注:
由于TE2410开发板上没有红外,所以代码中红外部分是没有用的。
启动后查看注册表[HKEY_LOCAL_MACHINE\Drivers\Active]可以看到刚添加的串口对应的设备名是COMX,可通过修改Order及Index的值来改变X的值(COM2被USB占用,最好设成COM3...)。 |
|