In nuttx the mode parameter to open is not required but in Linux,
and per the POSIX spec, mode is required if the O_CREAT flag is
passed.
The mode flags are different for NuttX and Linux so a new set of
PX4 defines was added:
PX4_O_MODE_777 - read, write, execute for user, group and other
PX4_O_MODE_666 - read, and write for user, group and other
PX4_O_MODE_600 - read, and write for user
Signed-off-by: Mark Charlebois <charlebm@gmail.com>
mcu_unique_id() reads registers at an invalid address in non-nuttx builds.
Added ifdef to return a dummy value for non-nuttx builds.
Signed-off-by: Mark Charlebois <charlebm@gmail.com>
The simulator was using pthread APIs directly so calls to px4_getpid()
would fail since the task ID was not known. Changed simulator to use
px4_task_spawn_cmd.
Signed-off-by: Mark Charlebois <charlebm@gmail.com>
If the posix target is run and the rootfs is not created, then
there is an fopen in mavlink without a return value check and then a write
to the fd. When this condition occurs it tries to write to NULL and will
segfault.
Signed-off-by: Mark Charlebois <charlebm@gmail.com>
The default rootfs is now in:
Build/posix_default.build/rootfs/
The subdirs fs/microsd and eeprom are now created if they do not exist.
Signed-off-by: Mark Charlebois <charlebm@gmail.com>
Set a default path relative to current dir for the posix target.
Running make posixrun will create the required directoroes and then run
mainapp from its build location.
PX4_ROOTFSDIR is set to nothing for nuttx.
Signed-off-by: Mark Charlebois <charlebm@gmail.com>
The addition of the hrt workqueue required adding some additional files to
unittests/CMakeLists.txt
Signed-off-by: Mark Charlebois <charlebm@gmail.com>