I'm concerned about stack overflow as I consider using a linear fit function which declares 5 local variables as floats and accepts 5 pointers.
5floats * 4B/float + 5pointers * 4B /pointer => 40B?
I'm concerned about stack overflow as I consider using a linear fit function which declares 5 local variables as floats and accepts 5 pointers.
5floats * 4B/float + 5pointers * 4B /pointer => 40B?
No worries, there are plenty of space left for you to use. You can declare 10 times that without any problem.
No worries, there are plenty of space left for you to use. You can declare 10 times that without any problem.
I agree with Hoang, by default we declare 2KB of stack for application (in arm_startup_nrf51.s file) and it should be plenty of space for your variables. If you think the answer from Hoang is correct, please accept the answer.