Re: Using const in function arguments.

2024-07-12 Thread Nathan Hartman
Hi Saurav, I think it comes down to whether a parameter like "const uint8_t * const" is C89-compatible. I can't seem to find a reference that gives me a definitive answer to this question, but it *might* have originally been a C++ feature that became standard C at some point. Whether that happened

Re: Using const in function arguments.

2024-07-12 Thread Saurav Pal
Hi Alan, Thank you for the information. However, for my case, it's passed through function parameters. For example, let's say it's a helper function to read mem[2]. `mem` in this case is a function argument. It isn't reassigned, so the pointer is a const, and it isn't used to modify the underlyin

Re: Using const in function arguments.

2024-07-12 Thread Alan C. Assis
Hi Saurav, I don't know why it is not much used, maybe Greg or Xiang have some idea. I think the most common use of const for variables that you want to keep in flash to avoid keeping it in RAM (to save RAM space for MCU with low RAM memory). The side effect on this case is Flash access is slowe

Re: Using external libraries with NuttX

2024-07-12 Thread Xiang Xiao
You can add the search path to my_project/Make.defs, other places will search the new patch automatically. Of course, it's better to only add the well designed include path to Make.defs to avoid the potential conflict. On Fri, Jul 12, 2024 at 2:14 PM Michal Lenc wrote: > Hello all, > > I am curr