IF BSP_BTUART
[HKEY_LOCAL_MACHINE\Drivers\BuiltIn\Serial2]
"Irq"=dword:15 ; 21 IRQ_BTUART
"MemBase"=dword:40200000 ; BTUART Register
"MemLen"=dword:40
"DeviceArrayIndex"=dword:81 ; BTUART object
"Prefix"="COM"
"IClass"=multi_sz:"{CC5195AC-BA49-48a0-BE17-DF6D1B0173DD}",
"{A32942B7-920C-486b-B0E6-92A702A99B35}"
"Dll"="$(_TGTPLAT_PFX)_serial.dll"
"Order"=dword:15 ; make sure it is loaded afer IPM
"Flags"=dword:0
"Index"=dword:2 "32BitBus"=dword:1
"EnableDMA"=dword:1
"AutoFlowControl"=dword:2 ; 0=no auto flow, 1=half auto flow, 2=full auto flow
"RxBufferSize"=dword:2048
"DebugMask"=dword:3
[HKEY_LOCAL_MACHINE\Drivers\BuiltIn\Serial2\Unimodem]
"Tsp"="Unimodem.dll"
"DeviceType"=dword:0
"FriendlyName"="Serial Cable on BT port:"
; "FriendlyName"="Not Serial port:"
"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
ENDIF BSP_BTUART
IF BSP_FFUART
[HKEY_LOCAL_MACHINE\Drivers\BuiltIn\Serial]
"Irq"=dword:16 ; 22 IRQ_FFUART
"MemBase"=dword:40100000 ; FFUART Register
"MemLen"=dword:40
"DeviceArrayIndex"=dword:80 ; FFUART object
"Prefix"="COM"
"IClass"=multi_sz:"{CC5195AC-BA49-48a0-BE17-DF6D1B0173DD}",
"{A32942B7-920C-486b-B0E6-92A702A99B35}"
"Dll"="$(_TGTPLAT_PFX)_serial.dll"
"Order"=dword:15 ; make sure it is loaded afer IPM
"Flags"=dword:0
"Index"=dword:1
"32BitBus"=dword:1
"EnableDMA"=dword:1
"AutoFlowControl"=dword:2 ; 0=no auto flow, 1=half auto flow, 2=full auto flow
"RxBufferSize"=dword:2048
"DebugMask"=dword:3
[HKEY_LOCAL_MACHINE\Drivers\BuiltIn\Serial\Unimodem]
"Tsp"="Unimodem.dll"
"DeviceType"=dword:0
"FriendlyName"="Serial Cable on COM1:"
"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
ENDIF BSP_FFUART
以上摘录platform.reg:BSP_BTUART[COM2] BSP_FFUART[COM1]
对比分析发现只有我标明红色的地方不同,为什么我上面回复“gooogleman”时,说肯定不是应用调用的,因为我既便修改了"Index"=dword:1=>4或5,初始化后,都有COM_OPEN操作,如果是应用调用的,那么应用应该还是调用L"COM2:"才对,除非应用直接读注册表项。再就是我也看了驱动的代码发现关键就是“DeviceArrayIndex”项的值。