programm works

This commit is contained in:
2024-09-22 21:38:17 +03:00
parent b98846eac1
commit 5b4db505c2
6 changed files with 263 additions and 117 deletions

View File

@ -46,8 +46,8 @@ MemoryStatus EEPROM_INIT() {
infoBlock.hwInfo.servos[SERVO_VERTICAL].def = 90;
infoBlock.hwInfo.servos[SERVO_VERTICAL].max = 180;
infoBlock.statInfo.totalShots = 0;
infoBlock.statInfo.totalPrograms = 0;
infoBlock.statInfo.shotsInShot = 0;
infoBlock.statInfo.shotsInProgram = 0;
infoBlock.statInfo.totalMacros = 0;
status = saveInfoBlock(&infoBlock);
@ -112,11 +112,11 @@ MemoryStatus EEPROM_INIT() {
CDC_Transmit_FS((uint8_t*) buffer, strlen(buffer));
snprintf(buffer, sizeof(buffer), "Total Shots: %lu\n",
infoBlock.statInfo.totalShots);
infoBlock.statInfo.shotsInShot);
CDC_Transmit_FS((uint8_t*) buffer, strlen(buffer));
snprintf(buffer, sizeof(buffer), "Total Programs: %lu\n",
infoBlock.statInfo.totalPrograms);
infoBlock.statInfo.shotsInProgram);
CDC_Transmit_FS((uint8_t*) buffer, strlen(buffer));
snprintf(buffer, sizeof(buffer), "Total Macros: %lu\n\n",
@ -263,7 +263,7 @@ MemoryStatus EEPROM_EARSE() {
uint16_t old_addr = 0;
do {
uint8_t Buf[255];
memset(Buf, 0xFF, sizeof(Buf));
memset(Buf, 0x00, sizeof(Buf));
FLASH_WriteBlock(addr, 0, Buf, sizeof(Buf), sizeof(Buf));
old_addr = addr;
addr += sizeof(Buf);