px4_nuttx_tasks: call clearenv() before task_create

Frees up around 6kB of RAM on Pixracer & Pixhawk.
This commit is contained in:
Beat Küng
2017-03-29 14:25:52 +02:00
committed by Lorenz Meier
parent 80e7475267
commit be2d10ff45

View File

@@ -74,6 +74,13 @@ int px4_task_spawn_cmd(const char *name, int scheduler, int priority, int stack_
sched_lock();
/* None of the modules access the environment variables (via getenv() for instance), so delete them
* all. They are only used within the startup script, and NuttX automatically exports them to the children
* tasks.
* This frees up a considerable amount of RAM.
*/
clearenv();
/* create the task */
pid = task_create(name, priority, stack_size, entry, argv);