模拟器中不能使用和硬件相关的程序,因为模拟器上根本就没有相应的硬件。在PC上有的硬件不是模拟器可以使用的!!!
PC与掌上电脑的串口是不是一样,这很难说。因为嵌入式开发是针对不同硬件平台进行的!
有的掌上电脑用的是标准的RS232,有的不是。
您用EVT(EVC和EVB)写的串口操作程序,可以下载到开发板上进行测试。当然开发板上需有串口硬件。
我现在正在做一个串口测试程序,对硬件部开发的串口驱动程序进行测试。功能已经实现,但还需一些易用性的完善。
Palm OS ROM
http://www.echoice.com.cn/download/download.asp?softwareID=132
Release configurations use the following macros:
RETAILMSG(cond, printf_exp). Conditionally displays the print message.
RETAILLED(cond, parms). Conditionally outputs WORD values to the LED.
ERRORMSG(cond, printf_exp). Prints "Error: File Line" before the print message.
To enable the debug macros, you must build a debug configuration. Debug configurations use the three retail macros listed above, as well as the following debug macros:
DEBUGMSG(cond, printf_exp). Conditionally displays the print message.
DEBUGLED(cond, parms). Conditionally outputs WORD values to the LED.
DEBUGCHK(expr). Asserts the expression. If expr is FALSE, the macro calls DEBUGBREAK.
DEBUGZONE(zone_id). Tests the mask bit in the current debug zone settings. You can use DEBUGZONE to turn debug zones on or off.
Declare Function TranslateMessage Lib "coredll.dll" (ByVal MSG As String) As Boolean
网上down到的,有关unicode的函数集:
Attribute VB_Name = "modUniCode"
Option Explicit
Public Function MemStringToLong(StringIn As String) As Long
On Error Resume Next
Dim hWorkVal As String
" Convert the String back to Long Integer.
" Converting back to Big Endian format.
Dim i As Long
For i = 4 To 1 Step -1
hWorkVal = hWorkVal & Hex(AscB(MidB(StringIn, i, 1)))
Next i
" Return Long Integer value.
MemStringToLong = CLng("&H" & hWorkVal)
End Function
Public Function LongToMemoryString(ByVal lInputValue As Long) As String
Dim hWorkVal As String
Dim n As Long
Dim i As Long
" Convert to HEX value.
hWorkVal = Hex(lInputValue)
" Check to see if it is not zero.
If hWorkVal <> "0" Then
" Convert to memory storage format (Little Endian).
" For example, 0000A411 would convert to 11A40000.
"
" Place leading zeros in 8 character sequence to
" maintain consistent character count
n = Len(hWorkVal)
If n < 8 Then
hWorkVal = String(8 - n, "0") & hWorkVal
End If
"
" Use ChrB to rebuild Bytes.
For i = 7 To 1 Step -2
LongToMemoryString = LongToMemoryString & _
ChrB(CInt("&H" & Mid(hWorkVal, i, 2)))
Next i
Else
" Just return zeros.
" Use ChrB to build Bytes.
LongToMemoryString = ChrB(CInt("&H00"))
LongToMemoryString = LongToMemoryString & ChrB(CInt("&H00"))
LongToMemoryString = LongToMemoryString & ChrB(CInt("&H00"))
LongToMemoryString = LongToMemoryString & ChrB(CInt("&H00"))
End If
End Function
[NextPage] |