diff options
author | Keith Packard <keithp@keithp.com> | 2013-04-01 01:58:37 -0700 |
---|---|---|
committer | Keith Packard <keithp@keithp.com> | 2013-04-01 01:58:37 -0700 |
commit | a764bf06d0975cbf1620b079351c7437053ea1a8 (patch) | |
tree | 504e146cd2546e4a5292fc88764312ef6943e604 /src/drivers/ao_log_fat.c | |
parent | c2de64b10894b366398a8b37ebd2305d9be46d46 (diff) |
altos: Flush the on-board mega log after every sample interval.
SPI flash parts don't need flushing, but the SD card does. Make sure
the SD card contents are sane after every logging interval has passed
by flushing all dirty blocks to the device.
Signed-off-by: Keith Packard <keithp@keithp.com>
Diffstat (limited to 'src/drivers/ao_log_fat.c')
-rw-r--r-- | src/drivers/ao_log_fat.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/drivers/ao_log_fat.c b/src/drivers/ao_log_fat.c index 2741555f..6b433b99 100644 --- a/src/drivers/ao_log_fat.c +++ b/src/drivers/ao_log_fat.c @@ -83,3 +83,9 @@ ao_log_mega(struct ao_log_mega *log) ao_mutex_put(&log_mutex); return wrote; } + +void +ao_log_flush(void) +{ + ao_fat_sync(); +} |