Monday, April 18, 2011

menuconfig

Add an entry to kernel config menu
** make sure library has been installed, "ncurses-devel"

/kernel source$ make clean
/kernel source$ make menuconfig

Friday, April 15, 2011

Change emacs theme

M-x load-library
color-theme
M-x color-theme-select

After you've selected a theme on the list then press ENTER

P.S. Place color-theme folder to ~/.emacs.d

Sunday, April 3, 2011

Tags with Emacs

For emacs you can't use the file, which is generated by ctags. You should use etags.

$ find -E . -iregex '.*\.(cpp|[ch])$' | etags -

Inside Emacs

M-x visit-tags-table <RET> FILE <RET>
M-. Find the first definition of TAG
M-* Pop back
C-u M-. Find the next definition



Reference:

Synopsis:

Saturday, March 5, 2011

Search string in multiple files

$ find -E ./ -iregex '.*\.(cpp|h)$' | xargs grep -Ei 'string'

Replace string in multiple files

$ find -E ./ -iregex '.*menu_.*\.(cpp|h)$' | xargs sed -E -i~ 's/ORG/NEW/g'

Multiple file name change

$ find -E ./ -iregex '.*menu_.*\.(cpp|h)$' > file.list
$ perl -w rename.pl file.list

-----------------------------------------
while($line = <>) {
if($line =~ m/.*(\bMenu_Setting.*)/i) {
# print "$1\n";
$old = $line;
$old =~ s/^\./\/home\/max\/src\/csu502 can\/acu-stm32-lcd/;
$old =~ s/\n//;
print "$old\n";
$newname = $old;
# replace file name
$newname =~ s/Menu_Setting_//;
print "$newname\n\n";
# use shell command: mv
system("mv", "$old", "$newname");
}
}

Tuesday, November 9, 2010

CSTACK & FreeRTOS

FreeRTOS V6.1.0
MCU: ARM Cortex-M3
Compiler: IAR 5.3

修改CSTACK的大小會當機!
如果當機的話,可以修改port.c.
---------------------------------------------------------------
portSTACK_TYPE *pxPortInitialiseStack( portSTACK_TYPE *pxTopOfStack, pdTASK_CODE pxCode, void *pvParameters )
{
/* Simulate the stack frame as it would be created by a context switch
interrupt. */
   pxTopOfStack--; /* 將該行移除或加回,就可解決當機的問題 */
....
....
---------------------------------------------------------------

針對不同的CSTACK size, linker會把CSTACK排在不同的地方;可能是RAM的開頭或尾巴。