From 2ddf3e728a99c46ac90f8cec144c11713a7953d4 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Wed, 7 Jan 2015 08:09:35 +1100 Subject: [PATCH] DataFlash: use common RingBuffer.h --- libraries/DataFlash/DataFlash_File.cpp | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/libraries/DataFlash/DataFlash_File.cpp b/libraries/DataFlash/DataFlash_File.cpp index 6ac3f1c347..0e829209a5 100644 --- a/libraries/DataFlash/DataFlash_File.cpp +++ b/libraries/DataFlash/DataFlash_File.cpp @@ -24,6 +24,7 @@ #include #include #include +#include "../AP_HAL/utility/RingBuffer.h" extern const AP_HAL::HAL& hal; @@ -183,16 +184,6 @@ void DataFlash_File::EraseAll() } } -/* - buffer handling macros - */ -#define BUF_AVAILABLE(buf) ((buf##_head > (_tail=buf##_tail))? (buf##_size - buf##_head) + _tail: _tail - buf##_head) -#define BUF_SPACE(buf) (((_head=buf##_head) > buf##_tail)?(_head - buf##_tail) - 1:((buf##_size - buf##_tail) + _head) - 1) -#define BUF_EMPTY(buf) (buf##_head == buf##_tail) -#define BUF_ADVANCETAIL(buf, n) buf##_tail = (buf##_tail + n) % buf##_size -#define BUF_ADVANCEHEAD(buf, n) buf##_head = (buf##_head + n) % buf##_size - - /* Write a block of data at current offset */ void DataFlash_File::WriteBlock(const void *pBuffer, uint16_t size) {