From c0e5fa99088e4f91c1049eb2d94ddc33286b9315 Mon Sep 17 00:00:00 2001 From: deweibel Date: Wed, 18 Aug 2010 18:29:03 +0000 Subject: [PATCH] Added GetWritePage() git-svn-id: https://arducopter.googlecode.com/svn/trunk@230 f9c3cf11-9bcb-44bc-f272-b75c42450872 --- libraries/DataFlash/DataFlash.cpp | 7 +++++++ libraries/DataFlash/DataFlash.h | 1 + 2 files changed, 8 insertions(+) diff --git a/libraries/DataFlash/DataFlash.cpp b/libraries/DataFlash/DataFlash.cpp index de2c6fc2c9..516c45cf68 100644 --- a/libraries/DataFlash/DataFlash.cpp +++ b/libraries/DataFlash/DataFlash.cpp @@ -21,6 +21,7 @@ WriteInt(data) : Write an integer (2 bytes) WriteLong(data) : Write a long (4 bytes) StartRead(page) : Start a read on (page) + GetWritePage() : Returns the last page written to GetPage() : Returns the last page read ReadByte() ReadInt() @@ -274,6 +275,12 @@ void DataFlash_Class::WriteLong(long data) WriteByte(data&0xFF); // Last byte } +// Get the last page written to +int DataFlash_Class::GetWritePage() +{ + return(df_PageAdr); +} + // Get the last page read int DataFlash_Class::GetPage() { diff --git a/libraries/DataFlash/DataFlash.h b/libraries/DataFlash/DataFlash.h index 8329621f3d..2155310be1 100644 --- a/libraries/DataFlash/DataFlash.h +++ b/libraries/DataFlash/DataFlash.h @@ -67,6 +67,7 @@ class DataFlash_Class void Init(); void ReadManufacturerID(); int GetPage(); + int GetWritePage(); void PageErase (unsigned int PageAdr); // Write methods void StartWrite(int PageAdr);