mirror of
https://github.com/PX4/PX4-Autopilot.git
synced 2026-05-28 02:36:37 +08:00
px4_nuttx_tasks: call clearenv() before task_create
Frees up around 6kB of RAM on Pixracer & Pixhawk.
This commit is contained in:
@@ -74,6 +74,13 @@ int px4_task_spawn_cmd(const char *name, int scheduler, int priority, int stack_
|
|||||||
|
|
||||||
sched_lock();
|
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 */
|
/* create the task */
|
||||||
pid = task_create(name, priority, stack_size, entry, argv);
|
pid = task_create(name, priority, stack_size, entry, argv);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user