From be9b9f3e67e29b9811f1b52c8e198322bf45bc80 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Wed, 4 Jul 2012 13:44:01 +1000 Subject: [PATCH] DataFlash: fixed SITL build --- libraries/Desktop/support/DataFlash_APM1.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/libraries/Desktop/support/DataFlash_APM1.cpp b/libraries/Desktop/support/DataFlash_APM1.cpp index f5bb7ba1d6..b45d9d3128 100644 --- a/libraries/Desktop/support/DataFlash_APM1.cpp +++ b/libraries/Desktop/support/DataFlash_APM1.cpp @@ -105,6 +105,13 @@ void DataFlash_APM1::PageErase (uint16_t PageAdr) pwrite(flash_fd, fill, DF_PAGE_SIZE, PageAdr*DF_PAGE_SIZE); } +void DataFlash_APM1::BlockErase (uint16_t BlockAdr) +{ + uint8_t fill[DF_PAGE_SIZE*8]; + memset(fill, 0xFF, sizeof(fill)); + pwrite(flash_fd, fill, DF_PAGE_SIZE*8, BlockAdr*DF_PAGE_SIZE*8); +} + void DataFlash_APM1::ChipErase(void (*delay_cb)(unsigned long)) {