2010年4月27日 星期二

Visual Studio 2008 Link Problem

http://msdn.microsoft.com/en-us/library/cc664727.aspx

在Visual Stdio 2008 中,要使用 #define _BIND_TO_CURRENT_VCLIBS_VERSION 1;
才會對 SP1 的Library binding 。不然的話,預設的連結方式為連結到 release version。

To show what version of libraries that lib file needs, type:
dumpbin /directives .lib
The output might contain something like:




Linker Directives

-----------------

/manifestdependency:"type='win32'

name='Microsoft.VC90.CRT'

version='9.0.21022.8'

processorArchitecture='x86'

publicKeyToken='1fc8b3b9a1e18e3b'"

/DEFAULTLIB:"MSVCRT"

/DEFAULTLIB:"OLDNAMES"



related info:
http://www.nuonsoft.com/blog/2008/10/29/binding-to-the-most-recent-visual-studio-libraries/
http://blogs.msdn.com/vcblog/archive/2008/08/12/bugs-fixed-in-mfc-in-visual-studio-2008-sp1.aspx

2010年4月26日 星期一

WaitForSingleObject thread (等待執行緒結束)

WaitForSingleObject ( threadHandle )
會等待執行緒結束

USB Timeout Related Issue

USB stick 插入和拔出的時間問題。

在USB Host Client Driver Registry Settings 有一項

[HKEY_LOCAL_MACHINE\Drivers\USB\ClientDrivers\Mass_Storage_Class\6]
MediaPollInterval:1250 ; msec
ReadSectorTimeout:2000
WriteSectorTimeout:2000
ScsiCommandTimeout:5000
UnitAttnRepeat:10

UnitAttnRepeat 是指測試 Unit 是否Ready,其測試次數。

flow:
IOCTL_DISK_READ, IOCTL_DISK_WRITE ( disk.c ) -->
ScsiRWSG --> ScsiReadWrite ( scsi2.c )  --> ScsiUnitAttention
--> ScsiTestUnitReady

如果 UnitAttnRepeat 為10的話,則 ScsiTestUnitReady 執行10次

而MediaPollInterval
則是在 disk.c 的 MediaChangeThread() 裡面會用到

2010年4月20日 星期二

German TimeZone Problem

德國的客戶有個問題,用網路存取檔案,總是會有一些時間差。懷疑是TimeZone的Problem。

的確,因為我根本還沒有處理時區的問題。

經過查證後(Use GetTimeZoneInformation() ),WINCE 5 default time zone 為 Pacific Standard Time, UTC -0800。

德國,查證 Wiki後,為 Central European Time (CET),現在(4月)為 CEST, Central European Summer Time。

CET 為 UTC + 0100, CEST 為 UTC + 0200
切換時間為 每年三月的最後一個星期日 UTC 1:00
及每年 十月的最後一個星期日 UTC 1:00

其它請參閱 SetTimeZoneInformation

註:
設定秘訣 year 為 0 ,幾月的第幾個星期格式, 5為最後
然後此函數daylight轉換的時間 為local time,要注意。

2010年4月16日 星期五

JPEG Library Study

 jpeg_write_raw_data() -->

jpeg_write_raw_data() 每次16行,也就是一個 imcu row

encode_mcu_huff() 被 call 8160 次
encode_one_block() 被 call 65280次

2010年4月13日 星期二

Warning: Image exceeds specified memory size by 9280 bytes and may not run.

When makeimg, there is the warning above.
AUTOSIZE
要修改 config.bib 或 eboot.bib

ce.bib 也是最終的 bib

WINCE 6 SD Card driver build error, PBInitEnv.bat

In AU1200 BSP, build SD Card driver has the following error!
There is no SDbus.lib.
So remove SD Card driver.
In platform.bib we want to remove BSP_SDHC_AU1X,
and it is defined in PBInitEnv.bat.

But PBInitEnv.bat is created by system.
When u setup catalog item. It will write variables to pbinitenv.bat.