Friday, November 2, 2018

Timer Function應用(aTimerRepeatStart)


Suppose we would like to do something periodically in our embedded system.

Without Timer Function:
1. Add a time variable
2. Compare time variable with  system time in a main loop.
3. If timeout happens, then do something; if not, go to step 2.
...lousy...又臭又長

With aTimerRepeatStart function:


Simply one line code to achieve it :

aTimerRepeatStart(Id, 3000, Do_Something_Function_Pointer);


The advantage by using Timer Library is that
1. Code is clear and simple
2. Code is not spread everywhere.
3. Easy to do platform porting

不過前提就是要有加這些Timer fucntion了...廢話...。


Keyword: Scaler, Monitor Firmware, Timer.





17x17x17 3D-Lut

晨星mStar 3D lut,由三軸去調整出色域Gamut/Gamma/Color Temperature,17x17x17 points,RGB:0~255,interpolation,也有小資料量的9x9x9可直接用。

DICOM,醫療灰階標準

DICOM,醫療灰階標準,JND,直接查表吧...不然就Excel套公式吧。


JND formula

Keyword: Scaler, Medical Monitor, DICOM, JND

ALS(Auto Luminance Stabilizer), sensor of light and temperature, 追踪背光

ALS(Auto Luminance Stabilizer), sensor of light and temperature, 追踪背光,for DICOM.

追踪Algorithm,原本我同事是依據高亮或低亮面板去追踪,速度很快,然而他繞跑了,本宅雖然逆來順受但本宅不是勤勞的小蜜蜂,改成通用版,速度比較慢,不然我司Panel多的跟山一樣...。


Keyword: Scaler, Medical Monitor, ALS, DICOM



Timer Function應用(aTimerStart)

來說說timer function應用(例如:顯示OSD三秒後要清除OSD)

ShowMainMenu()
CleanMainMenu()

以mStar來說,都是在OsdTimeoutHandler()去處理清除OSD。
而以GNSS、RT TV平台來說,直接就有Timer function可以直接使用(prototype如下),所以可以在ShowMainMenu()後直接呼叫aTimerStart(Id, 3sec, CleanMainMenu())。

好處是code可以很集中,不會散的到處都是,而且將來要porting至其他平台時,很方便,壞處是如果有其他交互作用,造成bug的話, 要追踪會比較麻煩,所以適用簡單的action。


P.S. u8TimerId