2007年4月17日 星期二

Full Circle - a new forum Ubuntu

這本雜誌將會以電子書的方式發行
紀錄有關Ubuntu, Opensource 及技術面 的發展

http://www.fullcirclemagazine.org/

透過Facebook分享

2007年4月16日 星期一

set apt-get proxy if you need

When I work, I alwasys need to set a configure in apt.conf by using my company's proxy
If you have the same situation, just follow the steps

1. Open /etc/apt/apt.conf
2. type some information into the file
Acquire::Http::Proxy "http://proxy.example:3128";

reference:
http://wiki.debian.org.hk/w/APT

透過Facebook分享

2007年4月14日 星期六

Mpll Upll FCLK HCLK PCLK

因應不同的硬體元件
有不同的 clock
arm裡面
有三個clock - FCLK, HCLK, PCLK
FCLK: 用於CPU
HCLK: 用於 controller (including memory, interrupt,LCD), DMA, Usb host block
PCLK: 用於 peripheral

Mpll 產生 clock 然後依照FCLK, HCLK, and PCLK的分配比率 來產生不同硬體元件的 clock
FCL, HCLK, PCLK的比率分配產生 由設定CLKDIVN(0x4C000014)來得到
Mpll的產生有一個公式 Mpll = (2*m*Fin)/(p*2^s)
m = (MDIV + 8)
p= (PDIV + 2)
s = SDIV
MDIV, PDIV, and SDIV 由設定 MPLLCON(0x4c000004)得到
如此一來
就可以得到FCLK, HCLK, PCLK.

Upll 則是用於 USB的設備
計算的概念相同
可參考
UPLLCON(0x3c000008)

透過Facebook分享

2007年3月26日 星期一

c code how to read the content of file vs. MFC

int main()
{
FILE *pfile;
int inum1,inum2;

char clocation[40] = "/home/nelsonchung/Code/config.txt";

//if (( pfile = fopen(clocation,"r")== NULL))
if (( pfile = fopen(clocation,"r")) == NULL)
{
printf("File could not be opened\n");
}
else
{
fscanf(pfile,"%d %d",&inum1,&inum2);
while(!feof(pfile)){
printf("\n%d %d",inum1,inum2);
fscanf(pfile,"%d %d",&inum1,&inum2);
}
}
fclose(pfile);
return 0;
}



MFC


CString strconfigfilepath = "\\SDMMC\\FMTOOLconfig.txt";
CString strFMFreq1(_T(""));
CString errormessage = "Can't found config";
//CStdioFile f;
CFile f;

if( ! f.Open( strconfigfilepath, CFile::modeRead ) ) //沒有讀到設定檔 就關閉程式
{
AfxMessageBox(strconfigfilepath);
exit(0);
}
//char pbuf[100];
BYTE pbuf1[5];
BYTE pbuf2[5];
BYTE pbuf3[5];
BYTE pbuf4[5];
UINT nBytesRead1 = f.Read( pbuf1, 2 ); //抓取頭兩個 87
strFMFreq1 = pbuf1;
iFMFreqfirstfront = _ttoi(strFMFreq1);
// strFMFreq1.Format(_T("%d"),a1);
// AfxMessageBox(strFMFreq1);

UINT nBytesRead2 = f.Read( pbuf2, 1 ); //濾過.
nBytesRead2 = f.Read( pbuf2, 1 ); //抓取接下來的小數 5
strFMFreq1 = pbuf2;
iFMFreqfirstlast = _ttoi(strFMFreq1);
// strFMFreq1.Format(_T("%d"),a2);
// AfxMessageBox(strFMFreq1);

UINT nBytesRead3 = f.Read( pbuf3, 1 ); //濾過空格
nBytesRead3 = f.Read( pbuf3, 3 ); //抓取接下來的數字 108
strFMFreq1 = pbuf3;
iFMFreqsecondfront = _ttoi(strFMFreq1);
// strFMFreq1.Format(_T("%d"),a3);
// AfxMessageBox(strFMFreq1);

UINT nBytesRead4 = f.Read( pbuf4, 1 ); //濾過.
nBytesRead4 = f.Read( pbuf4, 1 ); //抓取接下來的小數 0
strFMFreq1 = pbuf4;
iFMFreqsecondlast = _ttoi(strFMFreq1);

透過Facebook分享

2007年3月21日 星期三

cool edit 2000 - 非介紹篇

為了要讓錄音的時候
畫面可以跟著一起跑

特地run了一下cool edit 2000
然後在Option -> Setting -> General -> Live update during record
將此選項打勾
就可以在一邊錄音的時候 一邊更新畫面的資訊

透過Facebook分享