Massive clean thanks to Schwabe : unifdef -m -DCPUARM -UCPUM64 -UCPUM2560 -UPCBSTD -UPCBMEGA2560 -UPCBGRUVIN9X -UPCB9X $(find . -name "*.cpp" -or -name "*.h")
This commit is contained in:
@@ -23,22 +23,10 @@
|
||||
|
||||
#include "definitions.h"
|
||||
|
||||
#if defined(CPUARM)
|
||||
#define blkid_t uint16_t
|
||||
#define EEFS_VERS 5
|
||||
#define MAXFILES 62
|
||||
#define BS 64
|
||||
#elif defined(CPUM2560) || defined(CPUM2561) || defined(CPUM128)
|
||||
#define blkid_t uint8_t
|
||||
#define EEFS_VERS 5
|
||||
#define MAXFILES 36
|
||||
#define BS 16
|
||||
#else
|
||||
#define blkid_t uint8_t
|
||||
#define EEFS_VERS 4
|
||||
#define MAXFILES 20
|
||||
#define BS 16
|
||||
#endif
|
||||
|
||||
PACK(struct DirEnt {
|
||||
blkid_t startBlk;
|
||||
@@ -46,11 +34,7 @@ PACK(struct DirEnt {
|
||||
uint16_t typ:4;
|
||||
});
|
||||
|
||||
#if defined(CPUARM)
|
||||
#define EEFS_EXTRA_FIELDS uint8_t spare[2];
|
||||
#else
|
||||
#define EEFS_EXTRA_FIELDS
|
||||
#endif
|
||||
|
||||
PACK(struct EeFs {
|
||||
uint8_t version;
|
||||
@@ -74,15 +58,9 @@ extern EeFs eeFs;
|
||||
|
||||
#define RESV sizeof(EeFs) //reserv for eeprom header with directory (eeFs)
|
||||
|
||||
#if defined(CPUM64)
|
||||
#define FIRSTBLK (RESV/BS)
|
||||
#define BLOCKS (EEPROM_SIZE/BS)
|
||||
#define BLOCKS_OFFSET 0
|
||||
#else
|
||||
#define FIRSTBLK 1
|
||||
#define BLOCKS (1+(EEPROM_SIZE-RESV)/BS)
|
||||
#define BLOCKS_OFFSET (RESV-BS)
|
||||
#endif
|
||||
|
||||
uint16_t EeFsGetFree();
|
||||
|
||||
@@ -200,15 +178,9 @@ inline void eepromWriteProcess()
|
||||
#define DISPLAY_PROGRESS_BAR(x)
|
||||
#endif
|
||||
|
||||
#if defined(CPUARM)
|
||||
bool eeCopyModel(uint8_t dst, uint8_t src);
|
||||
void eeSwapModels(uint8_t id1, uint8_t id2);
|
||||
void eeDeleteModel(uint8_t idx);
|
||||
#else
|
||||
#define eeCopyModel(dst, src) theFile.copy(FILE_MODEL(dst), FILE_MODEL(src))
|
||||
#define eeSwapModels(id1, id2) EFile::swap(FILE_MODEL(id1), FILE_MODEL(id2))
|
||||
#define eeDeleteModel(idx) EFile::rm(FILE_MODEL(idx))
|
||||
#endif
|
||||
|
||||
#if defined(SDCARD)
|
||||
const pm_char * eeBackupModel(uint8_t i_fileSrc);
|
||||
@@ -216,17 +188,14 @@ const pm_char * eeRestoreModel(uint8_t i_fileDst, char *model_name);
|
||||
#endif
|
||||
|
||||
// For conversions
|
||||
#if defined(CPUARM)
|
||||
void loadRadioSettingsSettings();
|
||||
void loadModel(int index, bool alarms=true);
|
||||
#endif
|
||||
|
||||
bool eepromOpen();
|
||||
void eeLoadModelName(uint8_t id, char *name);
|
||||
bool eeLoadGeneral();
|
||||
|
||||
// For EEPROM backup/restore
|
||||
#if defined(CPUARM)
|
||||
inline bool isEepromStart(const void * buffer)
|
||||
{
|
||||
// OpenTX EEPROM
|
||||
@@ -249,6 +218,5 @@ inline bool isEepromStart(const void * buffer)
|
||||
}
|
||||
|
||||
void eepromBackup();
|
||||
#endif
|
||||
|
||||
#endif // _EEPROM_RLC_H_
|
||||
|
||||
Reference in New Issue
Block a user