This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Global Object Pointer - C++ LPC1768

Hi, I have a problem about Global Pointer of an Object.
Here is my simple code

#include "LPC17xx.h"
#include "class.h"

Class1* Pot;

/* Interrupt every 100ms */
extern "C" void SysTick_Handler(void)
{
 LPC_GPIO2->FIOPIN  ^= (1<<0);  //Toggle Led1
}


int main(void)
{
 SystemInit();
 SysTick_Config(SystemFrequency / 10);  //100ms
 Pot = new Class1(0, 0);
 LPC_GPIO2->FIODIR  |= (1<<0);  //Led 1 as Output

 while(1);
}

Don't care about what is "class".
In this way I created a global pointer of an object and I want to associat it to a real object.

Pot = new Class1(0, 0);

During compiling noError occur, but when I flash my LPC1768 usinf Keil uVision and ULINK2, nothing happen.
NO Led Blink
NO Debug mode
it's seems no flash was written in it.

If I comment
//Pot = new Class1(0, 0);

Led Blinks and Debug mode works.

I think it's a "Configuration/option" issue.
Someone can help me?
thanks,
Walter

0