Jump to content

Recommended Posts

How do you use the modulus operator in both an interrupt and the main line functions? I get a "Serious Warning" if I do.

 

Jacob Christ

The serious warning may just be coincidental... could you post some code showing the source of the warning? You're talking about '%', right? The error may be in relation to mis-matched types and return-values, maybe. Hard to tell without code and warnings, though.

Edited by twomers
Link to post
Share on other sites
How do you use the modulus operator in both an interrupt and the main line functions? I get a "Serious Warning" if I do.

 

Jacob Christ

The serious warning may just be coincidental... could you post some code showing the source of the warning? You're talking about '%', right? The error may be in relation to mis-matched types and return-values, maybe. Hard to tell without code and warnings, though.

 

Huh, the warning seems to have gone away when I add the code back in... maybe it has to do with building the whole project clean...

 

... but then it came back later... here is the message from the linker:

 

Building CASM file
Serious Warning: Possible sw stack corruption, function '__rem_16_16' called by
more than one asynchronous thread (main/Task, interrupt, interrupt low)

Memory Usage Report
===================
RAM available:1536 bytes, used:1037 bytes (67.6%), free:499 bytes (32.4%),
Heap size:499 bytes, Heap max single alloc:127 bytes
ROM available:30720 bytes, used:27844 bytes (90.7%), free:2876 bytes (9.3%)

 

 

Jacob

Link to post
Share on other sites

BoostC uses internal functions to perform certain mathematical functions, in this case one called __rem_16_16. BoostC does not use a stack for local variable so its generally not a good idea to call a function from more than one execution thread.

 

You could try useing different data types (signed, unsigned, int, char)in the main and interrupt thread (different data types have different functions, at a guess for char % char one called __rem_8_8).

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...