HAL_PX4: writing more than 512 bytes at a time can cause IO errors

the vfat fs in NuttX is really very picky!
This commit is contained in:
Andrew Tridgell 2013-01-23 16:54:11 +11:00
parent 68fc9ac1d8
commit c9799fb2b7
2 changed files with 2 additions and 2 deletions

View File

@ -28,7 +28,7 @@ void PX4Storage::_storage_create(void)
{
mkdir(STORAGE_DIR, 0777);
unlink(STORAGE_FILE);
_fd = open(STORAGE_FILE, O_RDWR|O_CREAT|O_TRUNC, 0666);
_fd = open(STORAGE_FILE, O_RDWR|O_CREAT, 0666);
if (_fd == -1) {
hal.scheduler->panic("Failed to create " STORAGE_FILE);
}

View File

@ -7,7 +7,7 @@
#include "AP_HAL_PX4_Namespace.h"
#define PX4_STORAGE_SIZE 4096
#define PX4_STORAGE_MAX_WRITE 1024
#define PX4_STORAGE_MAX_WRITE 512
#define PX4_STORAGE_LINE_SHIFT 7
#define PX4_STORAGE_LINE_SIZE (1<<PX4_STORAGE_LINE_SHIFT)
#define PX4_STORAGE_NUM_LINES (PX4_STORAGE_SIZE/PX4_STORAGE_LINE_SIZE)