From a764bf06d0975cbf1620b079351c7437053ea1a8 Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Mon, 1 Apr 2013 01:58:37 -0700 Subject: 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 --- src/drivers/ao_log_fat.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/drivers') 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(); +} -- cgit v1.2.3