POSIX: Added PX4_ROOTFSDIR to file paths

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>
This commit is contained in:
Mark Charlebois
2015-06-11 21:36:13 -07:00
parent 0c43803ec7
commit 4d1ae6269b
10 changed files with 25 additions and 14 deletions
+1 -1
View File
@@ -571,7 +571,7 @@ MavlinkFTP::ErrorCode
MavlinkFTP::_workTruncateFile(PayloadHeader* payload)
{
char file[kMaxDataLength];
const char temp_file[] = "/fs/microsd/.trunc.tmp";
const char temp_file[] = PX4_ROOTFSDIR"/fs/microsd/.trunc.tmp";
strncpy(file, _data_as_cstring(payload), kMaxDataLength);
payload->size = 0;
+2 -2
View File
@@ -389,7 +389,7 @@ protected:
} else if (write_err_count < write_err_threshold) {
/* string to hold the path to the log */
char log_file_name[32] = "";
char log_file_path[64] = "";
char log_file_path[70] = "";
timespec ts;
px4_clock_gettime(CLOCK_REALTIME, &ts);
@@ -400,7 +400,7 @@ protected:
// XXX we do not want to interfere here with the SD log app
strftime(log_file_name, sizeof(log_file_name), "msgs_%Y_%m_%d_%H_%M_%S.txt", &tt);
snprintf(log_file_path, sizeof(log_file_path), "/fs/microsd/%s", log_file_name);
snprintf(log_file_path, sizeof(log_file_path), PX4_ROOTFSDIR"/fs/microsd/%s", log_file_name);
fp = fopen(log_file_path, "ab");
/* write first message */