diff --git a/libraries/DataFlash/DataFlash.cpp b/libraries/DataFlash/DataFlash.cpp index 30c5174227..82a3ed5b5c 100644 --- a/libraries/DataFlash/DataFlash.cpp +++ b/libraries/DataFlash/DataFlash.cpp @@ -31,6 +31,7 @@ */ +#include #include "DataFlash.h" #include diff --git a/libraries/DataFlash/DataFlash.h b/libraries/DataFlash/DataFlash.h index 0185aa8d9b..4cf4eb3cf9 100644 --- a/libraries/DataFlash/DataFlash.h +++ b/libraries/DataFlash/DataFlash.h @@ -44,49 +44,49 @@ class DataFlash_Class // DataFlash Log variables... unsigned char df_BufferNum; unsigned char df_Read_BufferNum; - unsigned int df_BufferIdx; - unsigned int df_Read_BufferIdx; - unsigned int df_PageAdr; - unsigned int df_Read_PageAdr; + uint16_t df_BufferIdx; + uint16_t df_Read_BufferIdx; + uint16_t df_PageAdr; + uint16_t df_Read_PageAdr; unsigned char df_Read_END; unsigned char df_Stop_Write; //Methods - unsigned char BufferRead (unsigned char BufferNum, unsigned int IntPageAdr); - void BufferWrite (unsigned char BufferNum, unsigned int IntPageAdr, unsigned char Data); - void BufferToPage (unsigned char BufferNum, unsigned int PageAdr, unsigned char wait); - void PageToBuffer(unsigned char BufferNum, unsigned int PageAdr); + unsigned char BufferRead (unsigned char BufferNum, uint16_t IntPageAdr); + void BufferWrite (unsigned char BufferNum, uint16_t IntPageAdr, unsigned char Data); + void BufferToPage (unsigned char BufferNum, uint16_t PageAdr, unsigned char wait); + void PageToBuffer(unsigned char BufferNum, uint16_t PageAdr); void WaitReady(); unsigned char ReadStatusReg(); unsigned char ReadStatus(); - unsigned int PageSize(); + uint16_t PageSize(); public: unsigned char df_manufacturer; unsigned char df_device_0; unsigned char df_device_1; - unsigned int df_PageSize; + uint16_t df_PageSize; DataFlash_Class(); // Constructor void Init(); void ReadManufacturerID(); - int GetPage(); - int GetWritePage(); - void PageErase (unsigned int PageAdr); + int16_t GetPage(); + int16_t GetWritePage(); + void PageErase (uint16_t PageAdr); void ChipErase (); // Write methods - void StartWrite(int PageAdr); + void StartWrite(int16_t PageAdr); void FinishWrite(); void WriteByte(unsigned char data); - void WriteInt(int data); - void WriteLong(long data); + void WriteInt(int16_t data); + void WriteLong(int32_t data); // Read methods - void StartRead(int PageAdr); + void StartRead(int16_t PageAdr); unsigned char ReadByte(); - int ReadInt(); - long ReadLong(); + int16_t ReadInt(); + int32_t ReadLong(); }; extern DataFlash_Class DataFlash; -#endif \ No newline at end of file +#endif