mirror of
https://github.com/DashyFox/StackSport.git
synced 2025-12-16 01:09:57 +00:00
led and rc
This commit is contained in:
@ -3,6 +3,7 @@
|
||||
#include "usbd_cdc_if.h"
|
||||
#include "Print.h"
|
||||
#include "RobotFunctions.h"
|
||||
#include "Indicator.h"
|
||||
|
||||
InfoBlock infoBlock;
|
||||
extern IWDG_HandleTypeDef hiwdg;
|
||||
@ -265,16 +266,23 @@ MemoryStatus delMacro(unsigned char number) {
|
||||
MemoryStatus EEPROM_EARSE() {
|
||||
uint16_t addr = 0;
|
||||
const uint16_t EEPROM_MAX_ADDR = 1024*32;
|
||||
led_PingPong_start(7, 12);
|
||||
do {
|
||||
uint8_t Buf[64];
|
||||
HAL_IWDG_Refresh(&hiwdg);
|
||||
memset(Buf, 0x00, sizeof(Buf));
|
||||
HAL_IWDG_Refresh(&hiwdg);
|
||||
|
||||
FLASH_WriteBlock(addr, 0, Buf, sizeof(Buf), sizeof(Buf));
|
||||
|
||||
HAL_IWDG_Refresh(&hiwdg);
|
||||
led_PingPong_next();
|
||||
uint8_t progress = (addr * 100) / EEPROM_MAX_ADDR;
|
||||
led_progressbar(00, 06, progress<50 ? 100 : 100-(progress-50)*2);
|
||||
led_progressbar(13, 19, progress<50 ? 100-progress*2 : 0);
|
||||
|
||||
addr += sizeof(Buf);
|
||||
} while (addr < EEPROM_MAX_ADDR);
|
||||
led_clear();
|
||||
|
||||
return EEPROM_OK;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user