[sky9x] Automatic conversion from EEPROM v212 to v213 (not tested)

This commit is contained in:
bsongis
2012-10-24 20:40:50 +00:00
parent 87532ac457
commit 795b48e7c5
6 changed files with 242 additions and 43 deletions
+16 -6
View File
@@ -44,8 +44,8 @@ extern uint8_t Eeprom32_process_state ;
extern void eeprom_init( void ) ;
extern void end_spi(); // TODO not public
extern void ee32_process( void ) ;
extern bool ee32LoadGeneral( void ) ;
extern bool eeLoadGeneral( void ) ;
extern bool eeConvert();
extern void eeWaitFinished();
extern void eeDeleteModel( uint8_t id ) ;
@@ -57,12 +57,20 @@ extern void eeSwapModels(uint8_t id1, uint8_t id2);
struct t_file_entry
{
uint32_t block_no ;
uint32_t sequence_no ;
uint16_t size ;
uint8_t flags ;
uint32_t block_no ;
uint32_t sequence_no ;
uint16_t size ;
uint8_t flags ;
} ;
struct t_eeprom_header
{
uint32_t sequence_no ; // sequence # to decide which block is most recent
uint16_t data_size ; // # bytes in data area
uint8_t flags ;
uint8_t hcsum ;
};
extern struct t_file_entry File_system[] ;
extern char ModelNames[][sizeof(g_model.name)] ; // Allow for general
@@ -72,6 +80,8 @@ extern ModelData g_model;
extern uint8_t Spi_tx_buf[] ;
extern uint8_t Spi_rx_buf[] ;
void read32_eeprom_data(uint32_t eeAddress, register uint8_t *buffer, uint32_t size, uint32_t immediate=0);
#if defined(SDCARD)
const pm_char * eeBackupModel(uint8_t i_fileSrc);
const pm_char * eeRestoreModel(uint8_t i_fileDst, char *model_name);