sdlog2: select MIN < MAX bytes to write

Previously, the MAX and MIN were both 512 meaning that usually it would
start writing at > 512 bytes but only write 512 bytes which results in
a 512 bytes write shortly followed by a e.g. 30 bytes write.

Also, performance (measured in missed poll updates) seems slightly
better on Snapdragon with bigger chunks.
This commit is contained in:
Julian Oes
2016-07-07 10:09:06 +02:00
committed by Lorenz Meier
parent 1631cfdc83
commit 5f18f9bbba
+7 -1
View File
@@ -144,8 +144,14 @@ static bool logwriter_should_exit = false; /**< Logwriter thread exit flag */
static const unsigned MAX_NO_LOGFOLDER = 999; /**< Maximum number of log dirs */
static const unsigned MAX_NO_LOGFILE = 999; /**< Maximum number of log files */
static const int LOG_BUFFER_SIZE_DEFAULT = 8192;
#if defined __PX4_POSIX
static const int MAX_WRITE_CHUNK = 2048;
static const int MIN_BYTES_TO_WRITE = 256;
#else
static const int MAX_WRITE_CHUNK = 512;
static const int MIN_BYTES_TO_WRITE = 512;
static const int MIN_BYTES_TO_WRITE = 256;
#endif
static bool _extended_logging = false;
static bool _gpstime_only = false;