Wednesday, November 20, 2013

[debian] Install sogou pinyin on wheezy

This post is written on Nov 20, 2013.

Sogou pinyin can not be installed on default wheezy, since it depends on fcitx-bin (>=4.2.6). Only 4.2.4 is provided in the default apt source on wheezy. However the version on wheezy-backports is 4.2.8, so it's possible to use the fcitx-bin for sogou pinyin.

Here're the steps:
1. Get the latest release of sogou deb file from the following url:
http://packages.linuxdeepin.com/deepin/pool/non-free/f/fcitx-sogoupinyin-release/
2. Add following line in your sources.list


deb http://YOURMIRROR.debian.org/debian wheezy-backports main


3. Run "aptitude update"
4. Install fcitx-bin from backports:
 
aptitude -t wheezy-backports install fcitx-bin

5. Install the deb file of sogou pinyin, simply right click on the deb file and choose "Open with Software Installer"
6. On finished, restart X to activate it.
7. Right click on the fcitx icon at the right-bottom, choose "configure".
8. Add "Sogou Pinyin" to "Input Method", close the dialog windows.

And it's done. Have fun.

Reference:
1. http://backports.debian.org/Instructions/
2. http://backports.debian.org/Instructions/#index3h2

Thursday, August 15, 2013

[DS5] c源文件访问scatter file中定义的变量

问题如下:

Scatter file内容部分:

#define MY_REGION_START 0x100
#define MY_REGION_END 0x200

现在需要在工程的c源文件中访问MY_REGION_START和MY_REGION_END.

方法如下
1. Scatter file修改为:
#define MY_REGION_START 0x100
#define MY_REGION_END 0x200

....
#定义一个新的段名字为 MY_REGION
  MY_REGION MY_REGION_START
  {
        * (MY_REGION_START)
  }

  MY_REGION MY_REGION_END
 
        * (MY_REGION_END)
  }

2. 在需要访问的c源文件头上定义extern变量如下:

extern unsigned int Image$$MY_REGION$$ZI$$Base;  // 对应MY_REGION_START
extern unsigned int Image$$MY_REGION$$ZI$$Limit:  // 对应MY_REGION_END

或者
extern char Image$$MY_REGION$$ZI$$Base[];
extern char Image$$MY_REGION$$ZI$$Limit[];
两者区别:
如果声明的symbol是int型, 那在访问的时候需要用&(取址符).
例如:
printf("start: 0x%X, end 0x%X\n", (unsigned int) &Image$$MY_REGION$$ZI$$Base,Image$$MY_REGION$$ZI$$Limit);


参考文档:
1. Image$$ execution region symbols
2. Importing linker-defined symbols in C and C++

Wednesday, August 07, 2013

[IAR] Use Gvim as External Editor of IAR

Type: Command Line
Editor: browse to your gvim
Arguments: 
      --remote-tab-silent $FILE_PATH$
Or 
      --remote-silent $FILE_PATH$

     # if you have MiniBufExplorer installed for vim.