Jump to content
raskolnikov

Calling Novo Macros From Member Functions

Recommended Posts

I have a situation where I am using the C++ compiler and NOVO RTOS together. I have two tasks that I have declared in the same file as my interrupts and Main. From inside these tasks I access member functions that in turn call NOVO macros. When I go about it this way the code fails, versus writing it in C style with all functions declared in the same file. Here is an example:

 

class CUart *uart; // forward declaration

 

void interrupt()...

 

Task0()

{

uart->send(); // this call fails when calling SysBeginCriticalSection()

}

 

void Main(void)

{

SysCreateTask(...

SysStartTask(...

while(1)...

}

 

The code in the send member function uses the NOVO macros SysBeginCriticalSection() and SysEndCriticalSection(). When called from the C style program all is well but when called from the class member function it fails. I hope this is just something that I am doing wrong and not a limitation of the C++ compiler.

 

Thanks,

 

Matt

Share this post


Link to post
Share on other sites
The code in the send member function uses the NOVO macros SysBeginCriticalSection() and SysEndCriticalSection(). When called from the C style program all is well but when called from the class member function it fails. I hope this is just something that I am doing wrong and not a limitation of the C++ compiler.
I think we could do with a complete small program that demonstrates this issue then we can investigate further.

 

Regards

Dave

Share this post


Link to post
Share on other sites
The code in the send member function uses the NOVO macros SysBeginCriticalSection() and SysEndCriticalSection(). When called from the C style program all is well but when called from the class member function it fails. I hope this is just something that I am doing wrong and not a limitation of the C++ compiler.

Taking a quick look at the program you sent:

1) The project you sent had no -swcs option for linker.

2) Please read the Novo Manual section "Critical Sections with Prioritized Interrupts Notes" as it looks like you are not following the guidelines and so some corruption maybe resulting.

 

Regards

Dave

Share this post


Link to post
Share on other sites

Your content will need to be approved by a moderator

Guest
You are commenting as a guest. If you have an account, please sign in.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoticons maximum 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...

×