ICC-AVR stack overflow function

Go To Last Post
2 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I want to check for stack overflow so I have tried to use the _StackCheck(); function. I have included macros.h The problem is that when I try to write my owm _StackOverflowed() as per the instructions on the ICC-AVR help:

"The default _StackOverflowed() library function jumps to location 0 and resets the program. To change this default behavior, write your own _StackOverflowed function in your source code. This will override the default one."

I receive an error:

"redeclaration of `_StackOverflowed' previously declared at C:\include\macros.h(56)"

When the instructions say to "write your own stack overflow function in your source code" should it be written like any other standard function?

Thanks,
JW

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I belive I found the error, the function _StackOverflowed() has to have a parameter.
therfore it needs to be _StackOverflowed(char n){...}
and then n will show HW vs SW overflow