mirror of
https://github.com/DashyFox/StackSport.git
synced 2025-12-16 01:09:57 +00:00
fix rc debug and ir logic
This commit is contained in:
@ -135,6 +135,7 @@ MemoryStatus saveInfoBlock() {
|
||||
}
|
||||
|
||||
MemoryStatus getInfoBlock() {
|
||||
memset(&infoBlock, 0x00, sizeof(InfoBlock));
|
||||
MemoryStatus status = FLASH_ReadBlock(START_ADR_STAT, 0,
|
||||
(uint8_t*) &infoBlock, sizeof(InfoBlock));
|
||||
|
||||
@ -155,6 +156,7 @@ MemoryStatus saveShot(unsigned char number, Shot *shot) {
|
||||
|
||||
MemoryStatus getShot(unsigned char number, Shot *shot) {
|
||||
HAL_IWDG_Refresh(&hiwdg);
|
||||
memset(shot, 0x00, sizeof(Shot));
|
||||
if (FLASH_ReadBlock(START_ADR_SHOT, number, (uint8_t*) shot, SHOT_BLOCKSIZE)
|
||||
!= EEPROM_OK) {
|
||||
return EEPROM_FAIL;
|
||||
@ -198,6 +200,7 @@ MemoryStatus saveProg(unsigned char number, Program *prog) {
|
||||
}
|
||||
|
||||
MemoryStatus getProg(unsigned char number, Program *prog) {
|
||||
memset(prog, 0x00, sizeof(Program));
|
||||
if (FLASH_ReadBlock(START_ADR_PROGRAM, number, (uint8_t*) prog,
|
||||
PROGRAM_BLOCKSIZE) != EEPROM_OK) {
|
||||
return EEPROM_FAIL;
|
||||
@ -245,6 +248,7 @@ MemoryStatus saveMacro(unsigned char number, Macro *macro) {
|
||||
}
|
||||
|
||||
MemoryStatus getMacro(unsigned char number, Macro *macro) {
|
||||
memset(macro, 0x00, sizeof(Macro));
|
||||
if (FLASH_ReadBlock(START_ADR_MACRO, number, (uint8_t*) macro,
|
||||
MACRO_BLOCKSIZE) != EEPROM_OK) {
|
||||
return EEPROM_FAIL;
|
||||
@ -364,7 +368,7 @@ MemoryStatus FLASH_ReadBlock(uint16_t startAddr, uint8_t number,
|
||||
return EEPROM_OUT_OF_RANGE;
|
||||
}
|
||||
|
||||
memset(readData, 0x00, dataSize);
|
||||
// memset(readData, 0x00, !!!!dataSize!!!!);
|
||||
|
||||
uint16_t blockAddr16 = (uint16_t) (startAddr
|
||||
+ (uint16_t) (number * dataSize));
|
||||
|
||||
Reference in New Issue
Block a user