Jump to content

Recommended Posts

Hi

I have found some code that I have found interesting its purpose is to create a class for handling the interrupt mechanism. I am however encountering problems with getting it to work.

Some points I am not sure of:

Are forward class declarations workeable, and if so is the standard format okay:

// forward declarations
class Timer;
class UART;
class DUART;

Also the class:

 

class Interrupts
{
public:
Interrupts(void);
//void Interrupt::Reg(int intNumber, Interrupt* intThisPtr)
//static void Register(int interrupt_number, Interrupt* intThisPtr);
  //static void Register(int intnumber, Interrupt* intThisPtr);
  /* static void Interrupt_0(void);
static void Interrupt_1(void);
static void Interrupt_2(void);
static void Interrupt_3(void);
 static void Interrupt_4(void);
 */
  static void InterruptHandler(int intNumber);
virtual void ISR(void);

private:
static bool Init;
static class Interrupts* ISRVectorTable[MAX_INTERRUPTS];   ////[b]THIS LINE is causing a problem with structure  [/b]
																						////cannot have bit data members

};

 

There are also problems with the name Interrupts being rejected.

 

The code that I have been trying to get working can be viewed at:

 

http://www.embedded.com/9900245;jsessionid...JUNN2JVN?pgno=2

 

Many thanks

Dave

Link to post
Share on other sites
  • 1 month later...

An example of handling interrupts with C++ compiler would be very useful, just searched the C++ manual PDF and found nothing.

 

Im thinking of porting a BoostC program to BoostC++ and would need some examples of how to impliment interrupts.....

Link to post
Share on other sites
Are forward class declarations workeable...

 

Yes forward declaration does work. Just make sure you use at least 6.84 version

 

An example of handling interrupts with C++ compiler would be very useful, just searched the C++ manual PDF and found nothing.

 

Im thinking of porting a BoostC program to BoostC++ and would need some examples of how to impliment interrupts.....

 

We plan to add more C++ sample projects into SourceBoost installation. Handling interrupts in a class will be a good candidate.

 

Regards,

Pavel

Link to post
Share on other sites

Join the conversation

You are posting as a guest. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...