CANopenNode / CANopenSocket

Obsolete repository, replaced by CANopenDemo and CANopenLinux
Apache License 2.0
208 stars 119 forks source link

increase buffer size, use malloc for large buffers #14

Closed geoffrey-vl closed 4 years ago

geoffrey-vl commented 4 years ago

One embedded systems with limited RAM increasing the size of canopend/canopencom buffers - which are allocated on the stack - crashes canopend. Changed that to heap allocation so that there is more headroom. I've also enabled print of the error message description in all cases. Previously it was only enabled when using canopencomm via arguments. It's good to have control, i.e. enable/disable, but I don't see the point of changing the behavior depending on how a command is offered (via file, via argument, etc). For those who are actively using in it scripts, if you want to parse the error code try using regex instead of looking for \r\n.

martinwag commented 4 years ago

Changing that to 1MB was the first thing I changed on company git server :-). I hope you checked for memory leaks.