Commit Graph

121 Commits

Author SHA1 Message Date
Andrew Tridgell 1283b92cb7 DataFlash: fix for new AP_RTC API 2018-06-15 08:01:22 +10:00
Andrew Tridgell 777b4c8cfe DataFlash: avoid stat of current log file
this avoids getting invalid data base for stat() for the current log
file.

It also only gives up writing to a log file if writes fail for 2
seconds. This avoids a temporary write failure causing the log to be
closed (that can happen on ChibiOS with directory listing while writing)
2018-06-14 14:55:41 +10:00
Michael du Breuil c4a66349ef DataFlash: Remove suspend timer calls, restirct flush() to replay 2018-06-06 07:16:58 +10:00
Francisco Ferreira 221ba177c5 DataFlash: remove Qualcomm board support 2018-05-17 09:57:20 +10:00
Michael du Breuil 7e4972a061 DataFlash: Fix a false reporting of dead IO thread when millis() wraps 2018-05-14 10:11:32 +09:00
Michael du Breuil 703c7fb4b7 DataFlash: Remove unneeded inits and newlines 2018-05-14 10:10:38 +09:00
Lucas De Marchi 904888fba7 DataFlash: Linux boards never use /fs 2018-05-04 11:42:55 -07:00
Peter Barker 8027883734 DataFlash: remove vestiges of CLI functions 2018-04-10 10:27:08 +09:00
LukeMike 3dcaf83eaa VRBRAIN / DataFlash: some update for new VR Brain 5.2E (EEPROM version) 2018-02-05 08:26:49 +11:00
LukeMike bf6e57e7a4 VRBRAIN / DataFlash: added writebuf_chunk for VR Brain 5.4 2018-02-05 08:26:49 +11:00
Andrew Tridgell 38a36a070f DataFlash: removed some special cases for ChibiOS 2018-01-20 17:40:07 +11:00
Andrew Tridgell 43a6ed4099 DataFlash: support ChibiOS FATFS implementation 2018-01-15 11:46:02 +11:00
Peter Barker 3af5be76aa DataFlash: protect write fd with semaphore
If the sensor threads are using WriteBlock they may pass the _write_fd
== -1 check but then have that set to -1 by the main thread
2017-09-20 11:33:07 +01:00
Peter Barker 4263c1a90c DataFlash: file not being initialised means logging is failed 2017-09-11 17:42:38 +01:00
Peter Barker 9783c0c3ba DataFlash: log dataflash-file statistics periodically 2017-08-28 22:05:44 +01:00
Peter Barker 776d88bb6b DataFlash: remove duplicate variables 2017-08-28 22:05:44 +01:00
Peter Barker 975d2fd0d1 DataFlash: add debug for io thread failure 2017-07-28 17:06:49 +01:00
Peter Barker 0769432e63 DataFlash: move log-write-started logic to be backend-specific 2017-07-19 16:37:28 +01:00
Peter Barker 1f0a14ab33 DataFlash: add PrepForArming method 2017-07-19 16:37:28 +01:00
Francisco Ferreira a1115ba5d0
DataFlash: move some code from WritesOK into a new ShouldLog method 2017-07-19 16:37:21 +01:00
Peter Barker b572c13ca9 DataFlash: move starting of new logs into DataFlash 2017-07-19 16:37:16 +01:00
Peter Barker 4234f4ef7a DataFlash: move _initialised into DataFlash_Backend 2017-07-19 16:37:16 +01:00
Peter Barker f6a09d0657 DataFlash: eliminate GCS_MAVLINK::send_statustext_all 2017-07-11 23:53:53 +01:00
Peter Barker 001d3a7118 DataFlash: correct consts on CardInserted 2017-06-16 17:07:48 +01:00
Peter Barker 91b62abfe5 DataFlash: simplify dataflash initialisation 2017-06-14 12:20:29 +01:00
Peter Barker 0be2e7962f DataFlash: create a WritesOK method for WritePrioritisedBlock 2017-06-11 20:34:12 +01:00
Peter Barker 9324d8e251 Dataflash: emit io thread warnings much less frequently 2017-04-19 12:33:18 +09:00
Peter Barker 057819ccef DataFlash: zero-pad the number in the log filename
This helps with collating when reviewing log files

Closes #2212
2017-02-15 07:23:49 +11:00
Peter Barker 58d74230d5 DataFlash: correct error detection for asprintf 2017-02-15 07:23:49 +11:00
murata 1b2ea27a68 DataFlash: Unify from print or println to printf. 2017-01-27 18:20:22 +11:00
Peter Barker bc45ab5409 DataFlash: add a heartbeat for the io thread in DataFlash_File 2016-11-29 15:14:09 -08:00
Peter Barker e11c276b35 DataFlash_File: stop trying to stuff a uint64_t into a uint32_t 2016-11-29 15:14:09 -08:00
Peter Barker 2c8a0a9123 DataFlash: rotate files when vehicle is disarmed 2016-11-28 09:42:09 -08:00
Lucas De Marchi c9eff28c44 DataFlash: add O_CLOEXEC in places missing it
By opening with O_CLOEXEC we make sure we don't leak the file descriptor
when we are exec'ing or calling out subprograms. Right now we currently
don't do it so there's no harm, but it's good practice in Linux to have
it.
2016-11-07 12:37:30 -03:00
murata c808ee2f49 Global: To nullptr from NULL.
RC_Channel: To nullptr from NULL.

AC_Fence: To nullptr from NULL.

AC_Avoidance: To nullptr from NULL.

AC_PrecLand: To nullptr from NULL.

DataFlash: To nullptr from NULL.

SITL: To nullptr from NULL.

GCS_MAVLink: To nullptr from NULL.

DataFlash: To nullptr from NULL.

AP_Compass: To nullptr from NULL.

Global: To nullptr from NULL.

Global: To nullptr from NULL.
2016-11-02 16:04:47 -02:00
Murilo Belluzzo a91da2e803 DataFlash: Change ::bufferspace_available return type
from 'uint16_t' to 'uint32_t' to avoid overflow (possible in at least
two implementations: Block and File).
2016-10-27 14:24:11 +11:00
Murilo Belluzzo c112e1c889 DataFlash: Make use of ByteBuffer class
This patch replaces the 'old style' ringbuffer by the ByteBuffer class.
An effort was made to keep the exchange as close as possible from a
drop-in replacement to minimize the risk of introducing bugs.

Although the exchange opens opportunities for improvement and
simplification of this class.
2016-10-27 14:24:10 +11:00
Mathieu OTHACEHE 152edf7189 Global: remove mode line from headers
Using a global .dir-locals.el file is a better alternative than
reincluding the same emacs header in every file of the project.
2016-10-24 09:42:01 -02:00
Peter Barker a10cde35f5 DataFlash: stop logging before filling SD card on PX4
Filling the SD card causes NuttX to have conniptions, including
data loss and failure to boot
2016-09-26 14:02:58 -07:00
Peter Barker 8f376944aa DataFlash: immediately restart logging after erasing logs 2016-09-19 17:57:59 +09:00
Peter Barker fce798bc7a DataFlash: avoid integer underflow
Thanks to mbelluzzo: f44b1b3556
2016-09-13 13:32:09 +09:00
Peter Barker fd87a4f180 DataFlash: fix unused result warning 2016-08-25 15:53:47 +10:00
Peter Barker 8d253dec8e DataFlash: support for mavlink SENSOR message 2016-08-11 17:48:44 -03:00
Lucas De Marchi efb6b4c57e DataFlash: ifdef both __APPLE__ and __MACH__
This is how we do in other places and should mean that we are targetting
MacOS, not other apple products or other OSes using a mach kernel.
2016-07-07 12:41:51 -03:00
Peter Barker 334af1ecd7 DataFlash: base class method for resetting state on log open 2016-05-07 07:21:16 +10:00
Peter Barker eea2d5dcb5 DataFlash_File: avoid integer wrap when checking minimum time 2016-05-07 07:21:15 +10:00
Andrew Tridgell fe8070bd51 DataFlash: move lock to protect just buffer IO 2015-12-29 09:10:28 +11:00
Andrew Tridgell b967140572 DataFlash: enable minimal file mode
This adds a "minimal" dataflash mode with a board specific macro. The
QURT port uses this to avoid problematic system calls that are buggy
in the QURT RTOS

With some pending updates to QURT we may be able to remove some (or
all) of this
2015-12-27 16:21:26 +11:00
Peter Barker 2f1297f30c DataFlash_File: Check return values of lseek 2015-12-21 16:07:23 +11:00
Peter Barker ce84ba049f DataFlash_File: protect against fopen failing 2015-12-21 16:07:23 +11:00