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);