lpcxpresso / c plus plus

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

lpcxpresso / c plus plus

708 次查看
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by bobi-one on Mon Feb 07 05:52:30 MST 2011
I am trying to do the blinky program with c plus plus over the Red suite IDE.
After the C++ wizard i just add (gpio.c(renamed to .cpp), gpio.h) and copy the systick function from the c example. The code compiles with no errors. But after upload to the board , the LED doesn't blink. I am quite a noob at programming, and I really don't understand the core of the  languages. If someone can hint me what to do or read how to learn to do cpp programs with the lpc.
0 项奖励
回复
2 回复数

692 次查看
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by bobi-one on Mon Feb 07 07:13:21 MST 2011
extern "C"
void SysTick_Handler(void) {
  msTicks++;                        /* increment counter necessary in Delay() */
}

and everything is SUPER now thanks

Now I need to learn how to figure out when and where to put extern 'C' in my development process
0 项奖励
回复

692 次查看
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by whitecoe on Mon Feb 07 06:25:02 MST 2011
Imagine this is a name mangling issue with the systick interrupt handler and you need to add an [FONT=Courier New][SIZE=2]extern "C"[/SIZE][/FONT]...

http://en.wikipedia.org/wiki/Name_mangling#Handling_of_C_symbols_when_linking_from_C.2B.2B

HTH!
0 项奖励
回复