PDA

View Full Version : c++ class on TI code composer??


jung5000
11-02-2005, 01:10 PM
Hello..

I am developing board now with TI's 6416 chip.
I want to use c++ so I tried as follow

and checked m_uBaseAddress value

#1 shows ok, which means initialized m_uBaseAddress with EMIF_BASE

but

#2-1 is not initialize with EMIF_BASE

so i tried as #2-2

after execute #2-2, m_uBaseAddress is initialized.


what's the problem?

did I do something wrong?
or
TI CCS does not support c++ correctly?

I'm using CCS 3.1 and
checked "Treat C Files as C++ Files", "Support RTTI" Options

=========================================
main.cpp
=========================================
#define EMIF_BASE 0x68000000

void main()
{
cEMIF emif2(EMIF_BASE); // #1

cEMIF* emif1 = new cEMIF(EMIF_BASE) // #2-1
setBase(EMIF_BASE); // #2-2
}

=========================================
EMIF class
=========================================

class cEMIF()
{
public:
cEMIF();
cEMIF(Uint16 uAddress_);
~cEMIF();

void setBase(Uint16 uAddress_);

private:
Uint16 m_uBaseAddress;
};

cEMIF::cEMIF()
: m_uBaseAddress(0)
{
}

cEMIF::cEMIF(Uint16 uAddress_)
: m_uBaseAddress(uAddress_)
{
}

cEMIF::~cEMIF()
{
}

void cEMIF::setBase(Uint16 uAddress_)
{
m_uBaseAddress = uAddress_;
}