mirror of
https://github.com/DashyFox/StackSport.git
synced 2025-06-27 20:59:36 +00:00
upd
This commit is contained in:
@ -6,25 +6,25 @@
|
||||
#define AT24C_ADRESS 0x50 // i2c slave adress EEPROM
|
||||
|
||||
#define START_ADR_STAT 0x0000 //00000
|
||||
#define STAT_BLOCKSIZE 20
|
||||
#define STAT_BLOCKSIZE sizeof(InfoBlock)
|
||||
|
||||
#define START_ADR_SHOT (START_ADR_STAT+STAT_BLOCKSIZE) // 0x0014 = 20
|
||||
#define START_ADR_SHOT (START_ADR_STAT+STAT_BLOCKSIZE)
|
||||
#define SHOT_BLOCKSIZE 10
|
||||
#define MAX_NUMBER_SHOTS 255
|
||||
|
||||
#define START_ADR_PROGRAM (START_ADR_SHOT + (SHOT_BLOCKSIZE*MAX_NUMBER_SHOTS)) // 0x0A0A = 2570
|
||||
#define START_ADR_PROGRAM (START_ADR_SHOT + (SHOT_BLOCKSIZE*MAX_NUMBER_SHOTS))
|
||||
#define PROGRAM_BLOCKSIZE 203
|
||||
#define MAX_NUMBER_PROGRAMS 100
|
||||
#define MAX_NUMBER_SHOTS_IN_PROGRAMS \
|
||||
(PROGRAM_BLOCKSIZE-sizeof(ProgramHeader)) /sizeof(ProgramShot) // 100
|
||||
|
||||
#define START_ADR_MACRO (START_ADR_PROGRAM + (PROGRAM_BLOCKSIZE*MAX_NUMBER_PROGRAMS)) // 0x5956 = 22870
|
||||
#define START_ADR_MACRO (START_ADR_PROGRAM + (PROGRAM_BLOCKSIZE*MAX_NUMBER_PROGRAMS))
|
||||
#define MACRO_BLOCKSIZE 81
|
||||
#define MAX_NUMBER_MACRO 100
|
||||
#define MAX_NUMBER_PROGRAMS_IN_MACRO \
|
||||
(MACRO_BLOCKSIZE-sizeof(MacroHeader)) /sizeof(MacroProgram) // 20
|
||||
|
||||
#define MEMORY_END (START_ADR_MACRO + (MACRO_BLOCKSIZE*MAX_NUMBER_MACRO)) // 0x78FA = 30970
|
||||
#define MEMORY_END (START_ADR_MACRO + (MACRO_BLOCKSIZE*MAX_NUMBER_MACRO))
|
||||
|
||||
typedef enum MemoryStatus {
|
||||
EEPROM_FAIL,
|
||||
@ -103,16 +103,20 @@ typedef struct HardwareInit_t{
|
||||
}HardwareInit_t;
|
||||
|
||||
typedef struct Statistics{
|
||||
uint16_t totalShots;
|
||||
uint16_t totalPrograms;
|
||||
uint16_t totalMacros;
|
||||
uint32_t totalShots;
|
||||
uint32_t totalPrograms;
|
||||
uint32_t totalMacros;
|
||||
}Statistics;
|
||||
|
||||
typedef struct InfoBlock{
|
||||
HardwareInit_t hwInfo;
|
||||
Statistics statInfo;
|
||||
}InfoBlock;
|
||||
|
||||
|
||||
MemoryStatus FLASH_WriteBlock(uint16_t startAddr, uint8_t number, uint8_t *writeData, uint8_t dataSize);
|
||||
MemoryStatus FLASH_ReadBlock(uint16_t startAddr, uint8_t number, uint8_t *readData, uint8_t dataSize);
|
||||
|
||||
MemoryStatus FLASH_WriteBlock(uint16_t startAddr, uint8_t number,
|
||||
uint8_t *writeData);
|
||||
MemoryStatus FLASH_ReadBlock(uint16_t startAddr, uint8_t number,
|
||||
uint8_t *outData);
|
||||
|
||||
MemoryStatus saveShot(unsigned char number, Shot *shot);
|
||||
MemoryStatus getShot(unsigned char number, Shot *shot);
|
||||
|
Reference in New Issue
Block a user