# HG changeset patch # User matthewreed # Date 2017-10-05 14:15:30 # Node ID 20618713ba15db54576863ba8bbf58ce14418d54 # Parent 5b244673cf7f522b38dd6ac9ab8c45f334cdaf28 Updated flash to support newest HAL library diff --git a/src/flash.c b/src/flash.c --- a/src/flash.c +++ b/src/flash.c @@ -46,7 +46,7 @@ static void __flash_write(flash_settings // Erase the FLASH pages FLASH_EraseInitTypeDef erase; - erase.TypeErase = TYPEERASE_PAGES; + erase.TypeErase = FLASH_TYPEERASE_PAGES; erase.PageAddress = (uint32_t) eeprom; erase.NbPages = 1; uint32_t SectorError = 0; @@ -58,12 +58,12 @@ static void __flash_write(flash_settings uint16_t i; for(i = 0; i < (sizeof(flash_settings_t)/2); i++) { - HAL_FLASH_Program(TYPEPROGRAM_HALFWORD, (uint32_t)&eeprom[i], tosave->data[i]); + HAL_FLASH_Program(FLASH_PROC_PROGRAMHALFWORD, (uint32_t)&eeprom[i], tosave->data[i]); checksum ^= tosave->data[i]; } // write the checksum - HAL_FLASH_Program(TYPEPROGRAM_HALFWORD, (uint32_t)&eeprom[i+1], checksum); + HAL_FLASH_Program(FLASH_PROC_PROGRAMHALFWORD, (uint32_t)&eeprom[i+1], checksum); HAL_FLASH_Lock(); }