diff options
Diffstat (limited to 'tmk_core')
| -rw-r--r-- | tmk_core/common/chibios/flash_stm32.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/tmk_core/common/chibios/flash_stm32.c b/tmk_core/common/chibios/flash_stm32.c index e8b3dc4bc..66f2b1376 100644 --- a/tmk_core/common/chibios/flash_stm32.c +++ b/tmk_core/common/chibios/flash_stm32.c | |||
| @@ -161,9 +161,11 @@ FLASH_Status FLASH_ProgramHalfWord(uint32_t Address, uint16_t Data) { | |||
| 161 | * @retval None | 161 | * @retval None |
| 162 | */ | 162 | */ |
| 163 | void FLASH_Unlock(void) { | 163 | void FLASH_Unlock(void) { |
| 164 | /* Authorize the FPEC Access */ | 164 | if (FLASH->CR & FLASH_CR_LOCK) { |
| 165 | FLASH->KEYR = FLASH_KEY1; | 165 | /* Authorize the FPEC Access */ |
| 166 | FLASH->KEYR = FLASH_KEY2; | 166 | FLASH->KEYR = FLASH_KEY1; |
| 167 | FLASH->KEYR = FLASH_KEY2; | ||
| 168 | } | ||
| 167 | } | 169 | } |
| 168 | 170 | ||
| 169 | /** | 171 | /** |
